This file contains 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
# Run django test before commit, abort if fails | |
python manage.py test || exit 1 | |
# Run vue tests and linter before commit, abort if fails | |
EXIT_STATUS=0 | |
npm run lint || EXIT_STATUS=$? | |
npm run test:unit || EXIT_STATUS=$? | |
exit $EXIT_STATUS |
This file contains 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
from django.test.runner import DiscoverRunner | |
from django.conf import settings | |
from mongoengine import connect, disconnect, get_connection | |
from pymongo import MongoClient | |
from rest_framework.test import APITestCase | |
class TestRunner(DiscoverRunner): | |
""" | |
Custom test runner for mongoengine | |
""" |
This file contains 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 json | |
import itertools | |
""" | |
Convert a 3 columns CSV to a hierarchical JSON | |
with d3 sunburst default format. | |
Duplicated CSV column values are nested on the JSON as follows: | |
input file (CSV): |
This file contains 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
background no | |
font Snap.se:size=8 | |
xftfont Snap.se:size=8 | |
use_xft yes | |
xftalpha 0.1 | |
update_interval 3.0 | |
total_run_times 0 | |
own_window yes | |
own_window_type normal | |
own_window_transparent yes |
This file contains 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
# -*- coding: UTF-8 -*- | |
import csv | |
import os | |
import sys | |
import json | |
import time | |
import pyproj | |
import argparse | |
from urllib import parse, request | |
if sys.version_info[0] < 3: raise Exception("Python 3 required") |
This file contains 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
set "VIRTUAL_ENV=C:\Users\YOURUSER\Envs\YOURENVNAME" | |
:: Set variables | |
set "ENVIRONMENT=develop" | |
:: Change directory | |
cd C:\Users\YOURPROJECTPATH | |
:: Remove __pycache__ folders | |
for /d /r ".\API" %%a in (__pycache__) do if exist "%%a" rmdir /s /q "%%a" |
This file contains 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
[ | |
{ "keys": ["ctrl+alt+b"], "command": "toggle_comment", "args": { "block": true } }, | |
{ "keys": ["ctrl+alt+p"], "command": "autoprefixer" }, | |
{ "keys": ["ctrl+alt+c", "ctrl+alt+o", "ctrl+alt+n"], "command": "insert_snippet", "args": {"contents": "console.log($0);"}, "context": | |
[ | |
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, | |
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true } | |
] | |
}, | |
{ "keys": ["ctrl+alt+c", "ctrl+alt+o", "ctrl+alt+n"], "command": "insert_snippet", "args": {"contents": "console.log(${0:$SELECTION});"}, "context": |
This file contains 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
# returns latlng | |
def get_maxmin_latlon_region(region): | |
lon_max = -180 | |
lon_min = 180 | |
lat_max = -90 | |
lat_min = 90 | |
if region['type'] == 'Polygon': | |
for polygon in region['coordinates']: | |
for point in polygon: |
This file contains 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
[ | |
{ "keys": ["ctrl+alt+b"], "command": "toggle_comment", "args": { "block": true } }, | |
{ "keys": ["ctrl+alt+p"], "command": "autoprefixer" }, | |
// console.log() | |
{ "keys": ["ctrl+alt+c", "ctrl+alt+o", "ctrl+alt+n"], "command": "insert_snippet", "args": {"contents": "console.log($0);"}, "context": | |
[ | |
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, | |
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true } | |
] |
This file contains 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
f2605e92dff3a976d97ae6027d07f6b5 | |