Skip to content

Instantly share code, notes, and snippets.

@bradyt
bradyt / main.dart
Last active February 24, 2019 05:36
import 'dart:math';
void main() {
var thing = [['a', 2.25], ['b', 1.99], ['c', 2.1]];
print(thing);
}
void main() {
var world = 'world';
var a = 'hello ${
world
}';
print(a);
}
@bradyt
bradyt / day-3.py
Created December 3, 2018 18:24
advent of code, 2018
import re
with open('./input') as f:
content = f.readlines()
data = []
for line in content:
m = re.match('#(\d+) @ (\d+),(\d+): (\d+)x(\d+)', line)
next = [int(m.group(i)) for i in range(1, 6)]
@bradyt
bradyt / arrow.el
Last active November 30, 2018 18:35
(require 'windmove)
(require 'evil nil t)
(global-set-key (kbd "<down>") 'windmove-down)
(global-set-key (kbd "<up>") 'windmove-up)
(global-set-key (kbd "<right>") 'windmove-right)
(global-set-key (kbd "<left>") 'windmove-left)
(when (require 'evil nil t)
FROM silex/emacs
ADD .emacs.d /root/.emacs.d
RUN emacs -batch -l ~/.emacs.d/init.el
WORKDIR /root/
CMD "bash"
import requests
import simplejson as json
# instructions on token start at https://developer.github.com/v3/?#authentication
# and end at https://github.com/settings/tokens
headers = {"Authorization": "token <token>"}
base_url = 'https://api.github.com/repos/<username>/<repo>'
def run_query(url):

Keybase proof

I hereby claim:

  • I am bradyt on github.
  • I am bradyt (https://keybase.io/bradyt) on keybase.
  • I have a public key ASB8sJVdAZEAAgj38WXurIvqMTZ9iwuC0QovM7TCTbBLdAo

To claim this, I am signing this object:

@bradyt
bradyt / envelope-budgeting.journal
Created July 22, 2017 06:56 — forked from simonmichael/envelope-budgeting.journal
envelope budgeting example
; An example of YNAB-ish envelope budgetting with hledger/ledger
; cf https://github.com/simonmichael/hledger/issues/315
; Using accounts like the following:
;
; assets
; business
; bank
; wf
; bchecking
sieve :: ([Int], [Int]) -> ([Int], [Int])
sieve p = if (null $ snd p)
then p
else sieve ( fst p ++ [ head $ snd p ]
, filter (\n -> (/=0) $ mod n $ head $ snd p ) $ tail $ snd p )
sieven :: Int -> [Int]
sieven n = fst $ sieve ([2], [3,5..n])