This file contains hidden or 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
from datetime import datetime | |
import hashlib | |
import time | |
import urllib | |
def main(): | |
fn = 'current-%s.jpg' % datetime.now().strftime('%Y%m%d%H%M') | |
lasthash = file('LATEST', 'r').read().strip() | |
thishash, thisfile = None, None |
This file contains hidden or 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
Carriers (2) | |
Litter tray with lid/hood & cat san clumping litter | |
Food (wet? dry? milk?) | |
Flea/worming stuff [see Vet] | |
Toys | |
CATS! |
This file contains hidden or 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
[user] | |
name = Will Boyce | |
email = | |
signingkey = | |
[branch "master"] | |
remote = origin | |
merge = refs/heads/master | |
[branch "dev"] | |
remote = origin |
This file contains hidden or 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
=SUPERVISOR REPORT==== 12-Jun-2011::14:47:06 === | |
Supervisor: {local,erb_handler_supervisor} | |
Context: start_error | |
Reason: {{badmatch, | |
{'EXIT', | |
{{case_clause, | |
{ok,[1234,"/Users/wrboyce/Dev/Erb/etc/"]}}, | |
[{erb_handler_sshcli,init,1}, | |
{gen_event,server_add_handler,4}, | |
{gen_event,handle_msg,5}, |
This file contains hidden or 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
Response = io_lib:format("~s: ", [Nick]) ++ | |
case ets:lookup(State#state.db, SeenKey) of | |
[{SeenKey, SeenData}] -> | |
{SeenAgeDays, {SeenAgeHours,SeenAgeMinutes,SeenAgeSeconds}} = calendar:time_difference(SeenData#data.datetime, calendar:universal_time()), | |
io_lib:format("~s was last seen", [SeenNick]) ++ | |
string:join("", lists:map(fun({V,L}) -> | |
case V of | |
0 -> | |
""; | |
_ -> |
This file contains hidden or 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
Host jumpbox | |
Hostname jumpbox.domain.com | |
Port 2020 | |
PasswordAuthentication no | |
Host *.domain.local | |
ProxyCommand ssh jumpbox -- nc %h %p | |
PasswordAuthentication no | |
# for tab completion goodness | |
Host ldap0.domain.local |
This file contains hidden or 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
import random | |
class CreditCard(object): | |
CARD_TYPES = { | |
'amex': { | |
'prefixes': ['34', '37'], | |
'length': [15] | |
}, | |
'diners-carte-blance': { |
This file contains hidden or 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
handle_call(getBots, _From, State) -> | |
io:format("handle_call(getBots)~n", []), | |
T = mnesia:table_info(bot_config,all), | |
io:format("table_info: ~p~n", [T]), | |
Q = qlc:q([ | |
C || C <- mnesia:table(bot_config), | |
C#bot_config.enabled =:= true]), | |
R = mnesia:transaction(fun() -> qlc:e(Q) end, 3), | |
io:format("Result: ~p~n", [R]), | |
{ok, Bots} = R, |
This file contains hidden or 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
-module(helloworld). | |
-behaviour(gen_server). | |
-include("erb.hrl"). | |
-export([start_link/1]). | |
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). | |
-define(SERVER, ?MODULE). | |
start_link(Bot) -> | |
gen_server:start_link(?SERVER, ?MODULE, [Bot], []). |
This file contains hidden or 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
from math import sqrt | |
def fib(n): | |
x = (1+sqrt(5))/2 | |
y = -(1/x) | |
return (x**n - y**n) / sqrt(5) |