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 | |
function jsonval { | |
temp=`echo $json | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w $prop` | |
echo ${temp##*|} | |
} | |
json=`curl -s -X GET http://twitter.com/users/show/$1.json` | |
prop='profile_image_url' | |
picurl=`jsonval` |
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 | |
echo 'XML data monitor. Type CTRL-C to stop' | |
while : | |
do | |
d=`date` | |
s=`curl -X GET -s http://aserver:4300/server/callqueue/xml | cut -c2-60 | cut -d'>' -f1` | |
echo $d ' | ' $s | |
sleep 2 | |
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
var options = { | |
enableHighAccuracy: true, | |
maximumAge: 60000, | |
timeout: 0 | |
}; | |
if (window.navigator.geolocation) { | |
navigator.geolocation.getCurrentPosition(successCallback, errorCallback, options); | |
} else { | |
alert('Your browser does not natively support geolocation.'); |
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 | |
productID[1]=12894ecabe3d01eae4a4dfab8fbfc3a5 | |
productID[2]=4a4f5c9f1347c11080adcd09bd0230e8 | |
productID[3]=4a4f5c9f1347c11080adcd09bd023452 | |
RANDOM=`date '+%s'` | |
echo ${productID[$[($RANDOM % 2) + 1]]} | |
echo ${productID[$[($RANDOM % 2) + 1]]} | |
echo ${productID[$[($RANDOM % 2) + 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
# src string: Add 2 Arcade Friends within 10 days | |
p = '{Add} {2} {Arcade Friends} {within} {10} {days}' | |
[i.split('{')[-1] for i in p.lower().replace(' ','_').split('}') if '{' in i] |
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
# place line below in .bash_profile | |
alias uuid='python -c "from uuid import uuid4; print uuid4();"' |
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
server { | |
server_name yoursite.com; | |
root /usr/share/html; | |
index index.html; | |
location / { | |
try_files $uri $uri/ /index.html; | |
} | |
} |
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
hfind() { | |
history | grep $1 | grep -v history | grep -v hfind | sed -E 's/^.{7}//' | sort | uniq | |
} |
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
Add to .bash_profile | |
export PS1="\n┏━➤ [\D{%T}┊ \u@\h]: \w\n┗━➤ " | |
New prompt looks like this: | |
┏━➤ [23:30:23┊ cjus@phoenix]: ~/dev | |
┗━➤ |
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
bkup() { | |
d=`date +%Y%m%d-%H%M%S` | |
fname=''$1-$d.tgz | |
tar czf $fname $1 | |
} |
OlderNewer