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/bash | |
# Replace all long urls in MYFILE file with short urls using API from: | |
# https://github.com/briancray/PHP-URL-Shortener | |
MYFILE=~/somefile | |
DOMAIN=domain.com | |
URLSERVICE="http://$DOMAIN/shorten.php?longurl=" | |
# Get URL from todo list | |
URLLIST=$(grep "http://" $MYFILE | sed 's/.*http:\/\/\([^ ]*\).*/http:\/\/\1/') |
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 | |
cd ../src || exit 1 | |
for f in 20*_*.*; do | |
TIMESTAMP=${f%.*} # Remove extension | |
TIMESTAMP=`echo $TIMESTAMP | sed 's/_001$//'` # Remove _001 from *.3gp files | |
TIMESTAMP=`echo $TIMESTAMP | awk 'sub("..$", "")'` # Remove last two characters (seconds in the timestamp) | |
TIMESTAMP=`echo $TIMESTAMP | sed 's/_//'` | |
echo Setting $f to $TIMESTAMP | |
touch -mt $TIMESTAMP $f | |
touch -t $TIMESTAMP $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
'base_shipping_hidden_tax_amount' | |
'base_currency_code' | |
'subtotal_incl_tax' | |
'shipping_method' | |
'billing_name' | |
'subtotal_canceled' | |
'base_discount_refunded' | |
'base_shipping_refunded' | |
'total_paid' | |
'base_adjustment_negative' |
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
kw = read.csv("~/Downloads/keywords.csv", skip=1) | |
kw.conv <- subset(kw, Keyword.state == "enabled" & Conv...1.per.click. > 0) | |
View(kw.conv) | |
convs <- unlist(c(kw.conv["Conv...1.per.click."])) | |
clicks <- unlist(c(kw.conv["Clicks"])) | |
prop.test(convs,clicks,alternative=c("greater")) |
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
func xmlrpc(url string, methodName string, args ...string) string { | |
// Marshal XML | |
type Param struct { | |
Entry string `xml:"value>string"` | |
} | |
type methodCall struct { | |
XMLName xml.Name `xml:"methodCall"` | |
MethodName string `xml:"methodName"` | |
Params []Param `xml:"params>param"` |
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
ifconfig wlan0 down | |
iwconfig wlan0 mode ad-hoc | |
iwconfig wlan0 essid <ESSID> | |
iwconfig wlan0 key <TENDIGITPASSWORD> | |
ifconfig wlan0 up | |
dhclient wlan0 |
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/bash | |
echo "Untracked Projects:" | |
echo "-------------------" | |
for i in * | |
do | |
if [ -d $i ]; then | |
if ! [ -d $i/.git ]; then | |
echo $i | |
fi |
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 | |
# | |
# Download the solutions to ME422, which are posted every week | |
# | |
# Created Wed Oct 3 10:33:57 PDT 2007 | |
# Explanation of wget switches | |
# nH No host | |
# nc no clobber, don't replace existing files |
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 | |
while test $# -gt 0 ; | |
do | |
case $1 in | |
*.pdf) | |
/usr/bin/gs -dNOPAUSE -dNOCACHE -dBATCH -sDEVICE=epswrite -sOutputFile=${1%.pdf}.eps $1 | |
;; | |
*) |