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 flatten(listOfLists): | |
""" | |
Flatten arbitrary levels of nesting for an array of integers. | |
Any non list, non int value throws an exception. | |
""" | |
results = [] | |
for item in listOfLists: | |
if isinstance(item, int): |
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
use strict; | |
use warnings FATAL => 'all'; | |
use MarpaX::Languages::SQL2003::AST; | |
use Data::Dump qw(pp); | |
my $input = ""; | |
while (<>) { | |
$input = $input . $_; | |
} |
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
[color] | |
ui = auto | |
[color "branch"] | |
current = yellow reverse | |
local = yellow | |
remote = green | |
[color "diff"] | |
meta = yellow bold | |
frag = magenta bold | |
old = red bold |
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-option -g default-command "reattach-to-user-namespace -l zsh" | |
# fix colors | |
set -g default-terminal "screen-256color" | |
# Arrow movement: nice | |
bind -n S-down new-window | |
bind -n S-left prev | |
bind -n S-right next | |
bind -n C-S-left swap-pane -D | |
bind -n C-S-right swap-pane -U |
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
*.json merge=json_merge |
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 -e | |
# Helps you run a bisect script against your repo and determine which hunk caused a failure | |
############################################################################### | |
set -e # exit on command errors (so you MUST handle exit codes properly!) | |
set -E # pass trap handlers down to subshells | |
set -o pipefail # capture fail exit codes in piped commands | |
#set -x # execution tracing debug messages | |
# Error handler | |
on_err() { |
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
F F=1:1:100 W:F#3=0 "Fizz" W:F#5=0 "Buzz" W:(F#3>0)&(F#5>0) F W ! |
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 - | |
#=============================================================================== | |
# | |
# FILE: tmp.sh | |
# | |
# USAGE: ./tmp.sh | |
# | |
# DESCRIPTION: | |
# | |
# OPTIONS: --- |
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/dash | |
echo "a,b,c" | while read line; do | |
IFS=',' | |
set -- $line | |
for word in "$@"; do echo "$word"; done | |
done |
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
setref() | |
{ | |
if [ -n "$1" ]; then | |
eval $1=$2 | |
else | |
echo "Null parameter passed to this function" | |
fi | |
} | |
deref() | |
{ |
NewerOlder