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
# sudo ln -s ~/nginx.conf unicorn.conf | |
upstream app_server { | |
server unix:/tmp/unicorn_padrino.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
charset utf-8; | |
server_name db.innshine.com; |
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
function conky_get_age(year, month, day) | |
if conky_window == nil then | |
return | |
end | |
daystoday = os.date("%j") | |
daysatbirth = os.date("%j", os.time{year=year, month=month, day=day}) | |
yearsold = os.date("%Y") - os.date("%Y", os.time{year=year, month=month, day=day}) | |
if daysatbirth > daystoday then | |
yearsold = math.floor(yearsold - 1) | |
dayssince = (365 - daysatbirth) + daystoday |
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, forgetting one in order to remember a better one | |
class StrategyqualitativeThreeCouchCaller | |
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 |
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, forgetting one in order to remember a better one | |
class StrategyqualitativeThree | |
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 |
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 StrategythreePseudonymsMaybe | |
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 |
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 |
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
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
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
#include <avr/sleep.h> | |
#include <avr/interrupt.h> | |
volatile int pinOutState; | |
ISR(PCINT0_vect){ | |
if (pinOutState == 0){ | |
PORTB = (1 << PB1); | |
pinOutState = 1; | |
} |