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
| """ Minimal MapProxy Middleware demonstrating the decorate_img API | |
| To run: | |
| 1. Install MapProxy in a virtual enviroment together with Gunicorn | |
| 2. Create a basic MapProxy config and copy this file into the same directory as mapproxy.yaml | |
| 2. Activate virtual environment | |
| 3. Change to the directory containing this file | |
| 4. Run: | |
| gunicorn -k eventlet --workers=1 --log-file=- mapproxy_decorate:application |
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
| license: bsd-3-clause |
Syntax: cat <filename> | jq -c '.[] | select( .<key> | contains("<value>"))'
Example: To get json record having _id equal 611
cat my.json | jq -c '.[] | select( ._id | contains(611))'Remember: if JSON value has no double quotes (eg. for numeric) to do not supply in filter i.e. in contains(611)
These are some simple bash functions and scripts for making CSV/TSV files prettier on the command line
see http://stefaanlippens.net/pretty-csv.html for more information.
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
| import csv | |
| import sys | |
| import requests | |
| import json | |
| # Usage: python csv2geocode.py inputcsv inputcols geo_cols | |
| # Ex: python csv2geocode.py example.csv numero,voie,codep,ville longitude,latitude,score,type,label,citycode | |
| cols = sys.argv[2].split(',') | |
| print(cols) |
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
| # UPDATED 17 February 2019 | |
| # Redirect all HTTP traffic to HTTPS | |
| server { | |
| listen 80; | |
| listen [::]:80; | |
| server_name www.domain.com domain.com; | |
| return 301 https://$host$request_uri; | |
| } | |
| # SSL configuration |
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
| # import config. | |
| # You can change the default config with `make cnf="config_special.env" build` | |
| cnf ?= config.env | |
| include $(cnf) | |
| export $(shell sed 's/=.*//' $(cnf)) | |
| # import deploy config | |
| # You can change the default deploy config with `make cnf="deploy_special.env" release` | |
| dpl ?= deploy.env | |
| include $(dpl) |
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
| #!/bin/bash | |
| # Inspired by | |
| # https://www.codeenigma.com/community/blog/using-mdbtools-nix-convert-microsoft-access-mysql | |
| # USAGE | |
| # Rename your MDB file to migration-export.mdb | |
| # run ./mdb2sqlite.sh migration-export.mdb | |
| # wait and wait a bit longer... | |
| mdb-schema migration-export.mdb sqlite > schema.sql |
By the way, I'm available for tutoring and code review :)
- What Promises library should I use?
- How do I create a Promise myself?
- How do I use
new Promise? - How do I resolve a Promise?
- But what if I want to resolve a synchronous result or error?
- [But what if it's at the start of a chain, and I'm not in a
.thencallback yet?](https://gist.github.com/joepie91/4c3a10629a4263a522e3bc4839a28c83#6-but