Skip to content

Instantly share code, notes, and snippets.

View TheBB's full-sized avatar
🏠
Working from home

Eivind Fonn TheBB

🏠
Working from home
View GitHub Profile
import Data.List (intercalate, transpose)
import Data.Maybe (fromJust)
import GHC.Exts (sortWith)
data Square = Empty | Mine | Click
newtype Minefield = Minefield [[Square]]
instance Show Square where
show Empty = "."
show Mine = "*"
@TheBB
TheBB / gist:be84c8061f5eed050963
Last active August 29, 2015 14:02 — forked from MB6/WC1
import requests
resp = requests.get('http://worldcup.sfg.io/matches')
for jogo in (j for j in requests.get('http://worldcup.sfg.io/matches').json() if j['status'] == 'completed'):
print jogo['home_team']['country'], jogo['home_team']['goals'], 'x', jogo['away_team']['country'], jogo['away_team']['goals']
@TheBB
TheBB / gist:a4f83caba9d4e23e6a28
Last active August 29, 2015 14:02
ReneFroger's vimrc
" Easymotion {
let g:EasyMotion_leader_key = '<Space>'
let g:StupidEasyMotion_leader_key = 'f'
let g:EasyMotion_use_upper = 1
let g:EasyMotion_keys = 'ASDFWIERUOGHJKL'
" }
" Vim Over {
let g:over_enable_auto_nohlsearch = 1
let g:over_enable_cmd_window = 1
@TheBB
TheBB / gist:26c3b38ac24333c16913
Created August 7, 2014 17:32
Ackermann function
#include <iostream>
#include <stack>
#include <cstdlib>
typedef unsigned long long ull;
ull ack(ull m, ull n)
{
std::stack<ull> st;
st.push(m);
@TheBB
TheBB / primes.py
Last active August 29, 2015 14:05
Primes in Python
import sys
def sieve(limit):
a = [True] * limit
a[0] = a[1] = False
for i, isprime in enumerate(a):
if isprime:
yield i
#!/usr/bin/perl
###########################################################
#-PRIVATE-SHIT--PRIVATE-SHIT--PRIVATE-SHIT--PRIVATE-SHIT--#
###########################################################
# Legend Bot [2011] DO NOT FUCKIN SHARE! #
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
# Commands: #
# !legend @system #
# !legend @rootable #
# !legend @cleanlogs #
w=0 x=1 y=8 z=9
w=0 x=5 y=33 z=3
w=0 x=8 y=8 z=8
w=0 x=12 y=33 z=2
w=0 x=15 y=8 z=7
w=0 x=19 y=33 z=1
w=0 x=22 y=8 z=6
w=0 x=26 y=33 z=0
w=0 x=29 y=8 z=5
w=0 x=36 y=8 z=4
total = 1904
wc = 3
xc = 25
yc = 38
zc = 175
# roots = []
for w in xrange(0, total/wc + 1):
for x in xrange(0, (total - wc*w)/xc + 1):
import random
import sys
from itertools import product
def random_monty(choices):
return random.choice(choices)
def deterministic_monty(choices):
return random.choice([c for c in choices if c != 0])
1. Snute (83)
2. Bly (80)
3. Tefel (68)
4. Scarlett (60)
5. Nerchio (58)
6. VortiX (52)
7. Jim (52)
8. MaNa (41)
9. Happy (38)
10. TLO (38)