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 string import split | |
class Table: | |
def __init__(self): | |
self.labels = [] | |
self.data = [] | |
def populate(self, file_name, col_delim="\t", row_delim="\n", data_start=None): | |
with open(file_name, 'r') as f: | |
if data_start: |
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 | |
# Script for installing tmux on systems where you don't have root access. | |
# tmux will be installed in $HOME/local/bin. | |
# It's assumed that wget and a C/C++ compiler are installed. | |
# exit on error | |
set -e | |
TMUX_VERSION=1.9a |
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
// The node to be monitored | |
var target = $( "#content" )[0]; | |
// Create an observer instance | |
var observer = new MutationObserver(function( mutations ) { | |
mutations.forEach(function( mutation ) { | |
var newNodes = mutation.addedNodes; // DOM NodeList | |
if( newNodes !== null ) { // If there are new nodes added | |
var $nodes = $( newNodes ); // jQuery set | |
$nodes.each(function() { |
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 | |
# INFO=$(xwininfo -frame) | |
# WIN_GEO="--width=" | |
# WIN_GEO="$WIN_GEO$(echo $INFO | grep -oEe 'geometry [0-9]+x[0-9]+' | grep -oEe '[0-9]+x[0-9]+' | grep -oEe '[0-9]+x[0-9]+')" | |
# WIN_XY="--x=" | |
# WIN_XY="$WIN_XY$(echo $INFO | grep -oEe 'Corners:\s+\+[0-9]+\+[0-9]+' | grep -oEe '[0-9]+\+[0-9]+' | sed -e 's/+/ --y=/' )" | |
# WIN_HEI=`echo $WIN_GEO | sed s/x/\\ --height=/g` | |
XWININFO=$(xwininfo) | |
read X < <(awk -F: '/Absolute upper-left X/{print $2}' <<< "$XWININFO") |
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
// ==UserScript== | |
// @name Stash PR links for commits | |
// @namespace https://gist.githubusercontent.com/hsingh23/67528e4193cf84cad3f1/raw/stash-pullrequest-linker.user.js | |
// @version 1.0.9 | |
// @downloadURL https://gist.githubusercontent.com/hsingh23/67528e4193cf84cad3f1/raw/stash-pullrequest-linker.user.js | |
// @updateURL https://gist.githubusercontent.com/hsingh23/67528e4193cf84cad3f1/raw/stash-pullrequest-linker.user.js | |
// @description Stash's commit view does not show you which pull request a commit belongs to. This script links it up as best as it can. | |
// @author Harsh Singh | |
// @match https://*/projects/*/repos/*/commits* | |
// @match http://*/projects/*/repos/*/commits* |
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
fb = { | |
group: { | |
groupGuid: { | |
name: "name", | |
timezone: someTimezone, | |
owners: { | |
accountGuid: 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
Flows: | |
create group: | |
1. get timezone, default alert time | |
2. create chore group | |
get group: | |
sign up with email password: | |
1. create user |
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
# Check if zplug is installed | |
if [[ ! -d ~/.zplug ]]; then | |
git clone https://github.com/zplug/zplug ~/.zplug | |
source ~/.zplug/init.zsh && zplug update --self | |
fi | |
# Essential | |
source ~/.zplug/init.zsh | |
# Make sure to use double quotes to prevent shell expansion |
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
################################################################### | |
# CONFIGURATION OPTIONS | |
################################################################### | |
# Every item has a default value besides MIRRORS (which is unset). | |
# Use aptitude or apt-get? | |
# Note that for outputting the package URI list, we always use apt-get | |
# ...since aptitude can't do this | |
# Optionally add the FULLPATH to apt-get or apt-rpm or aptitude | |
# e.g. /usr/bin/aptitude |
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
var async = require('asyncawait/async'); | |
var await = require('asyncawait/await'); | |
console.log("starting") | |
var getSomethingAsync = function(i){ | |
return new Promise((resolve, reject) => { | |
setTimeout(()=>resolve(`money = ${i}`), Math.random()*500) | |
}) | |
} | |
var foo = async(function() { |
OlderNewer