This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function ticket() { | |
| mkdir -p tickets/resolved | |
| if [ $1 = 'resolve' ]; then | |
| mv ./tickets/$2.md ./tickets/resolved/resolved-$2.md | |
| git add .; echo "[$2] $3" | git commit -F - | |
| elif [ $1 = 'list' ]; then | |
| ls ./tickets/ | |
| elif [ ! -z "$1" ]; then | |
| echo $(date +"%Y%m%d-%H%M%S") "${@:2}" >> "./tickets/$1-$(ls -lR tickets/**/*.md | grep $1 | wc -l | awk '{$1=$1};1').md" | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Setting up [WorkboxJS](workboxjs.org) with [Django](djangoproject.com). | |
| Prerequisites: | |
| My particular project is using Docker to power the Django app. | |
| In front of the Django app there is Nginx which serves and caches assets. | |
| Your setup might be a bit different but I have yet to find any "best practices" regarding ServiceWorkers with Workbox, webpack, Nginx and Django. | |
| I wanted to use Workbox because I wanted to use precaching and background analytics for my site. This is quite lengthy. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Server | |
| app.use((req, res, next) => { | |
| match({ routes, location: req.url }, (error, redirectLocation, renderProps) => { | |
| let store = setupStore(); | |
| let promises = collectPromises(req.url, renderProps.routes, store); | |
| collectToken(req.cookies, store); | |
| Keys.all(promises).then(() => { | |
| const html = renderToString(<Provider store={store}> |