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 | |
clear | |
one() | |
{ | |
FILETEXT=`cat $FILE | tail -c +5` | |
echo $FILETEXT | |
rm -f $FILE | |
} | |
two() | |
{ |
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
#include <avr/sleep.h> | |
#include <avr/interrupt.h> | |
volatile int pinOutState; | |
ISR(PCINT0_vect){ | |
if (pinOutState == 0){ | |
PORTB = (1 << PB1); | |
pinOutState = 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
38400 8N1 |
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]" |
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 |
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 |
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)) |
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 ruby | |
class Player | |
attr_accessor :name, :team, :position, :pseudonym | |
def initialize(name, team, pseudonym, strategy) | |
@name = name | |
@team = team | |
@position = name | |
@pseudonym = pseudonym | |
@selection = $players.reject { |a| a == @pseudonym }.sample |
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]], |
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
# Keep track of who has three pseudonyms | |
class StrategythreePseudonyms | |
def initialize(parent) | |
@strategy = parent | |
@player = @strategy.player | |
@memory = @strategy.memory | |
end | |
def remember(calledName, calledTeam, calledPosition, calledPseudonym, callerName) | |
# if someone called a number being remembered |