This file contains hidden or 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
# git remote add upstream <origin-url> | |
git fetch upstream | |
git merge upstream/master | |
git push origin master | |
This file contains hidden or 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
git clone --mirror <clone-url> | |
cd reponame | |
git bundle create ../reponame.bundle --all |
This file contains hidden or 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
create_files_with_dates () { | |
file_name=$1 | |
num_days=$2 | |
tmp_dir="tmp/" | |
mkdir -p $tmp_dir | |
for ((i=0; i <= $1 - 1; i++)); do | |
day=`date -j -v-${i}d +%Y%m%d` | |
> ${tmp_dir}${day}${file_name} |
This file contains hidden or 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 get_nested_value(originalDict, path): | |
keys = path.split('.') | |
val = originalDict | |
for key in keys: | |
val = val.get(key) | |
return val |
This file contains hidden or 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 | |
array=( | |
one | |
two | |
three | |
) | |
for item in "${array[@]}"; do | |
echo $item |
This file contains hidden or 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 click | |
def prompt_proxy(ctx, param, use_proxy): | |
if use_proxy: | |
host = ctx.params.get('proxy_host') | |
if not host: | |
host = click.prompt('Proxy host', default='localhost') | |
port = ctx.params.get('proxy_port') |
This file contains hidden or 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
""" | |
Example of checking wether the current time is between | |
a start and end time. This assumes no access to timespan like functions | |
and is why the times are integers. | |
Use nose to run tests with `nosetests check_time_between.py` | |
""" | |
def test_before_window(): |