View spl2c.sh
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 | |
LOCATION="/usr/local/bin" | |
if [ $# -eq 2 ]; then | |
if [ -f $1 ]; then | |
$LOCATION/spl/bin/spl2c < $1 > $2.c | |
gcc $2.c -o $2 -I $LOCATION/spl/include -L $LOCATION/spl/lib -lspl -lm | |
rm $2.c | |
rm $1 | |
else | |
echo "USAGE: spl2c [file to compile] [name of resulting program]" |
View xkcd_now_get.sh
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 | |
for HOUR in {00..23}; do | |
for MINUTE in 00 15 30 45; do | |
wget "http://imgs.xkcd.com/comics/now/"$HOUR"h"$MINUTE"m.png" | |
done | |
done | |
exit |
View xkcd_now_selector.sh
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 | |
# Change this to the directory containing the image files. | |
XKCDPATH="/usr/local/bin/xkcdnow" | |
HOUR=$(TZ=Asia/Kamchatka date +%H) | |
MINUTE=$(date +%M) | |
if [ $MINUTE -gt 00 -a $MINUTE -le 15 ]; then | |
MINUTE=15 | |
elif [ $MINUTE -gt 15 -a $MINUTE -le 30 ]; then | |
MINUTE=30 |
View age.sh
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 | |
BIRTHDAY=$1 | |
DAYSTODAY=$(date +%j | sed "s/^0*//g") | |
DAYSATBIRTH=$(date -d "$BIRTHDAY" +%j | sed "s/^0*//g") | |
YEARSOLD=$(($(date +%Y)-$(date -d "$BIRTHDAY" +%Y))) | |
if [ $DAYSATBIRTH -gt $DAYSTODAY ]; then | |
YEARSOLD=$(($YEARSOLD-1)); | |
DAYSSINCE=$(($((365-$DAYSATBIRTH))+$DAYSTODAY)) | |
else | |
DAYSSINCE=$(($DAYSTODAY-$DAYSATBIRTH)) |
View text.js
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 letters = { | |
' ' : [[50, 0, 50, 0]], | |
'!' : [[0, 45, 0, 50, 8], | |
[0, 10, 0, 35, 8]], | |
'"' : [[0, 10, 0, 20, 8], | |
[10, 10, 10, 20, 8]], | |
'#' : [[0, 35, 20, 35, 8], | |
[0, 25, 20, 25, 8], | |
[15, 20, 15, 40, 8], | |
[5, 20, 5, 40, 8]], |
View ifchanged.sh
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
badopts() | |
{ | |
echo -e "Usage: ifchanged [command to check] [number of seconds to wait between checks] [command to execute if not changed] [command to execute if changed]" | |
exit | |
} | |
if [ $# -ne 4 ] | |
then | |
badopts | |
else | |
while true |
View Paypal_error.txt
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
Tue Nov 20 16:47:25 PayPal[30597] <Error>: *** -[__NSCFCalendar components:fromDate:toDate:options:]: fromDate cannot be nil | |
I mean really, what do you think that operation is supposed to mean with a nil fromDate? | |
An exception has been avoided for now. | |
A few of these errors are going to be reported with this complaint, then further violations will simply silently do whatever random thing results from the nil. | |
Here is the backtrace where this occurred this time (some frames may be missing due to compiler optimizations): | |
( | |
0 CoreFoundation 0x3a1d948f <redacted> + 86 | |
1 PayPal 0x0019981b -[PPKBCheckInManager nearbyMerchantRefresh] + 162 | |
2 PayPal 0x0018833f -[PPMerchantListingsViewController viewWillAppear:] + 1414 | |
3 UIKit 0x333cb319 <redacted> + 136 |
View randprog.sh
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 | |
LINES=`cat $1 | wc -l` | |
LINESB=`echo $((RANDOM % LINES))` | |
WHICH=`echo $((LINESB + 1))` | |
COM=`cat $1 | head -n $WHICH | tail -n 1` | |
eval $COM | |
exit |
View error.log
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
2012-12-03 21:35:26 +0000 assistant_service the local store doesn't allow tasks and we have no default calendar :( |
OlderNewer