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 | |
DATE=$(date -d "$1" +%Y-%m-%d) | |
URL="http://schlockmercenary.com/$DATE" | |
PICS=$(xidel $URL -e "//@src/resolve-uri(.)" 2> /dev/null | egrep '[0-9][a-z].(png|jpg)') | |
if [ -z "$PICS" ]; then | |
PICS=$(xidel $URL -e "//@src/resolve-uri(.)" 2> /dev/null | egrep '[0-9].[png|jpg]' | head -n 1) | |
fi | |
echo "$PICS" | |
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
#!/usr/bin/env ruby | |
$one = 0 | |
$two = 0 | |
$three = 0 | |
$four = 0 | |
$five = 0 | |
$six = 0 | |
$seven = 0 | |
$eight = 0 | |
$nine = 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
#!/usr/bin/env ruby | |
$randwins = 0 | |
$swins = 0 | |
$equal = 0 | |
$tried = [] | |
ARGV[0].to_i.times do | |
$times = 0 | |
$num = rand(1..9) | |
$sel = rand(1..$num) | |
loop do |
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; do | |
RES=`$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
#!/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
greed = 0 | |
flush = 0 | |
10000000.times do | |
dice = [] | |
6.times do | |
dice.push((1..6).to_a.sample) | |
end | |
if dice.include?(1) and dice.include?(2) and dice.include?(3) and dice.include?(4) and dice.include?(5) and dice.include?(6) | |
greed += 1 | |
elsif dice[0] == dice[1] and dice[1] == dice[2] and dice[2] == dice[3] and dice[3] == dice[4] and dice[4] == dice[5] |
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
# 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 |