Copy file from local to remote
scp file.txt <user>@<server>:/path/to/remote/folder
Copy folder from local to remote
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" |
# -*- 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") |
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 |
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): |
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 | |
""" |
# 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 |
#!/usr/bin/env python | |
import os | |
import sys | |
import argparse | |
from PIL import Image | |
""" | |
Reduce images size | |
Images are resized keeping the aspect ratio | |
Usage: python image_resize.py -d /home/images -o /home/output_dir -s 1024 768 |
eda813560c801474904004d6b6b1cc4c |
<template> | |
<div | |
@dragstart.prevent | |
:class="[ | |
'el-input-number', | |
inputNumberSize ? 'el-input-number--' + inputNumberSize : '', | |
{ 'is-disabled': inputNumberDisabled }, | |
{ 'is-without-controls': !controls }, | |
{ 'is-controls-right': controlsAtRight } | |
]"> |