# An alias for: git add --patch && git commit
# It would be nice if there was an interactive way to bypass git hooks if they block the commit
git config --global alias.pac '!f(){ git add --patch && git commit; }; f'
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
def move_thing(src_mod, dest_mod, find_str): | |
import os | |
import rope.base.project | |
from rope.base import libutils | |
from rope.refactor import move | |
project = rope.base.project.Project(os.getcwd()) | |
origin = libutils.path_to_resource(project, src_mod) | |
destination = libutils.path_to_resource(project, dest_mod) |
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 | |
# to split all commits since origin/master run: | |
# git rebase --interactive --exec git-split.sh origin/master | |
set -e | |
LF=$'\n' | |
SHA=$(git rev-parse --short HEAD) | |
MSG=$(git show -s --format=%B HEAD) | |
set -f; IFS=$'\n' |
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 logging | |
logging.basicConfig(format='%(asctime)s,%(msecs)d %(levelname)-8s [%(filename)s:%(lineno)d] %(message)s', | |
datefmt='%Y-%m-%d:%H:%M:%S', | |
level=logging.DEBUG) | |
logger = logging.getLogger(__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
const subscriptionMiddleware = { | |
applyMiddleware: function(options, next) { | |
// Get the current context | |
const context = options.getContext().graphqlContext; | |
// set it on the `options` which will be passed to the websocket with Apollo | |
// Server it becomes: `ApolloServer({contetx: ({payload}) => (returns options) | |
options.authorization = context.authorization; | |
next() | |
}, | |
}; |
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 | |
''' | |
This scripts needs the `pyserial` python package installed to run (`pip install pyserial`). | |
Usage: | |
>>> Aqua().get_ph_orp() | |
{'ph': 6.82, 'orp': 116.0} | |
''' | |
import serial |
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 python:3-stretch | |
COPY . /app | |
WORKDIR /app | |
RUN mkdir -p /tmp | |
# install socat and ssh to talk to the host ssh-agent | |
RUN apt-get update && apt-get install git socat openssh-client \ | |
# create variable called SSH_AUTH_SOCK, ssh will use this automatically |
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
INRES="1920x1080" # input resolution | |
OUTRES="1920x1080" # output resolution | |
FPS="15" # target FPS | |
GOP="30" # i-frame interval, should be double of FPS, | |
GOPMIN="15" # min i-frame interval, should be equal to fps, | |
THREADS="2" # max 6 | |
CBR="1000k" # constant bitrate (should be between 1000k - 3000k) | |
QUALITY="ultrafast" # one of the many FFMPEG preset | |
AUDIO_RATE="44100" | |
STREAM_KEY="" # use the terminal command Streaming streamkeyhere to stream your video to twitch or justin |
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 json | |
file_name = 'VERY_SECRET.txt' # input filename | |
out_file_name = 'VERY_SECRET.json' # output filename | |
data_line_start = ('Title:', 'Username:', 'Url:', 'Password:', 'Comment:') | |
def make_part(title, username, url, password, comment): | |
''' | |
whatever.split(':') split the line into Whatever and data |
This file has been truncated, but you can view the full file.
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
PLOVR_MODULE_INFO={"common-async":["base"],"pubs":["common-async"],"notes":["common-async"],"stats":["common-async"],"payments":["common-async"],"posters":["common-async"],"home-screens":["common-async"],"misc-screens":["common-async"],"hightower":["common-async"],"power-readers":["common-async"],"base":[]}; | |
PLOVR_MODULE_URIS={"common-async":"fingerprint:common-async","pubs":"fingerprint:pubs","notes":"fingerprint:notes","stats":"fingerprint:stats","payments":"fingerprint:payments","posters":"fingerprint:posters","home-screens":"fingerprint:home-screens","misc-screens":"fingerprint:misc-screens","hightower":"fingerprint:hightower","power-readers":"fingerprint:power-readers","base":"fingerprint:base"}; | |
PLOVR_MODULE_USE_DEBUG_MODE=false; | |
var _mdm={};(function(z){ | |
'use strict';var ea,fa,aaa,ia,ha,daa,ma,faa,gaa,Ga,Oa,Na,oaa,paa,hb,qaa,raa,jb,saa,taa,Db,uaa,vaa,waa,xaa,Mb,Nb,Ob,Pb,Qb,yaa,ac,bc,gc,zaa,hc,ic,Baa,Aaa,lc,Caa,Dc,Daa,Ec,Qc,Tc,Xc,Yc,fd,Eaa,Lc,Faa,ed,$c,ad,id,Gaa,hd,pd,rd,yd,Fd,nd,qd,Id,qe,Jaa,Kaa,Laa,Ma |