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
#Print a list of URLs from sitemap.xml to stdout | |
xpath -q -e '/*/*/*/text()' sitemap.xml |
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 | |
read oldrev newrev refname | |
REPO="/my/repo.git" | |
BRANCH=`echo $refname | sed -n 's/^refs\/heads\///p'` | |
BRANCH_DIR="/etc/puppet/environments" | |
#Unset GIT_DIR and GIT_WORK_DIR so git chooses them by current directory | |
#Based on behaviour of git post-receive hook, undocumented | |
unset GIT_DIR |
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
# Example data line: | |
# 06/01 06/01 Bestbuy.com 00009944 888-237-8289 MN -$49.26 | |
echo '06/01 06/01 Bestbuy.com 00009944 888-237-8289 MN -$49.26' \ | |
| sed 's:[0-9]\+/[0-9]\+:&,:g' \ | |
| sed 's: -\?\$[0-9]\+:,&:' |
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 | |
# Run in the project's root | |
git ls-files | sed 's:[^/]*$::'| sed '/^$/d' | sort -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
#!/bin/sh | |
# Requirements: | |
# Install expect and make sure it's on your path | |
# sftp with working '-r' option | |
GIT_DIR=$1 | |
HOST=$2 | |
PASSWORD=$3 |
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 bash | |
# Taken from Karl Runge's FAQ on x11vnc | |
# http://www.karlrunge.com/x11vnc/faq.html#faq-xinerama | |
x11vnc -safer -localhost -nopw -once -viewonly -clip 1920x1080+0+0 -display :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
import os | |
from webob.dec import wsgify | |
from webob.exc import HTTPMovedPermanently | |
from paste.deploy import loadapp | |
from waitress import serve | |
@wsgify.middleware | |
def ForceSSLMiddleware(req, app): |
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
apply plugin: 'java' | |
repositories { | |
mavenCentral() | |
maven { | |
url 'http://clojars.org/repo/' | |
} | |
} | |
dependencies { |
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 pandas.core.api import Timestamp, Period | |
time_in_seconds = Timestamp('2013-03-31 22:11:19') | |
one_year_period = Period('2013') | |
time_in_seconds.to_period(one_year_period.freq) == one_year_period | |
# 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
Invoked with : | |
--ncalls: 5 | |
--repeats: 5 | |
------------------------------------------------------------------------------- | |
Test name | head[ms] | base[ms] | ratio | | |
------------------------------------------------------------------------------- | |
timeseries_with_format_no_exact | 447.1206 | 467.2980 | 0.9568 | |
OlderNewer