Skip to content

Instantly share code, notes, and snippets.

View jamesfe's full-sized avatar

jimmy jamesfe

  • Seattle, WA
View GitHub Profile
def good_stick_three_character_strings_together(x, y):
"""Should return x, a space, then y; for example:
x = dog
y = cat
returns "dog cat"
"""
assert type(x) == str and type(y) == str
assert len(x) == 3 and len(y) == 3
@jamesfe
jamesfe / gist:244a9780abb72e8c1a54cb1f9c18b687
Created June 8, 2021 00:05
bad optional argument example
import random
def do_things(blah={}):
blah[random.randint(0, 100)] = 4
print(blah)
do_things()
print('done once')
do_things()
@jamesfe
jamesfe / sample.json
Created January 29, 2018 07:07
reddit data
{
"IIHURRlCANEII": {
"posts": 304,
"scores": {
"askthe_donald": [
8,
7
],
"baseball": [
7,
Address: password with private key 16ga2uqnF1NqpAuQeeg7sTCAdtDUwDyJav has balance: 0 sent 35331540 and received 35331540
password b'16ga2uqnF1NqpAuQeeg7sTCAdtDUwDyJav' $ 0
Address: 123456 with private key 1565qkBbLcuFP78f7MFKkK8jtHGDwdSgvX has balance: 0 sent 177480 and received 177480
123456 b'1565qkBbLcuFP78f7MFKkK8jtHGDwdSgvX' $ 0
Address: 12345678 with private key 174Qm7g95BxXtVJvhGJ3cjdGLPgnSkuJHu has balance: 0 sent 20000 and received 20000
12345678 b'174Qm7g95BxXtVJvhGJ3cjdGLPgnSkuJHu' $ 0
Address: 1234 with private key 1B3PHXB6g5YGLvzTkxrrPEdLbpvfEoC5Qi has balance: 0 sent 1015513 and received 1015513
1234 b'1B3PHXB6g5YGLvzTkxrrPEdLbpvfEoC5Qi' $ 0
Address: qwerty with private key 1M8gvPDG58RvoLb1prNF8svWUb3vT3md5a has balance: 0 sent 80000 and received 80000
qwerty b'1M8gvPDG58RvoLb1prNF8svWUb3vT3md5a' $ 0
#!/bin/bash
for i in `seq 1 365`;
do
printf $i" "
node ./src/node_render.js $i
done
# Make it
# convert -delay 10 -loop 0 ./output/*.png animated.gif
# http://www.imagemagick.org/discourse-server/viewtopic.php?t=28672
#!/bin/bash
for i in `seq 1 365`;
do
printf $i" "
node ./src/node_render.js $i
done
# Make it
# convert -delay 10 -loop 0 ./output/*.png animated.gif
# http://www.imagemagick.org/discourse-server/viewtopic.php?t=28672
svg.append("path")
.datum({type: "FeatureCollection", features: shipData})
.attr("d", path)
.attr("class", "lines");
@jamesfe
jamesfe / aliases.sh
Created September 22, 2017 09:28
my git aliases
# publish a review
alias opush="git push origin HEAD:refs/publish/master"
# publish a draft
alias dpush="git push origin HEAD:refs/drafts/master"
alias gs="git status"
# next 4 aliases all automatically merge fixups into their targets
# commit fixups like so "git commit --fixup HEAD" (where <head> can be HEAD~1 HEAD~2, commit hash, etc.)
alias rebase2="git rebase -i HEAD~2 --autosquash"
alias rebase3="git rebase -i HEAD~3 --autosquash"
alias rebase4="git rebase -i HEAD~4 --autosquash"
@jamesfe
jamesfe / .vimrc
Created August 7, 2017 19:29
My VIMRC file
inoremap § <Esc> " fix european keyboards
set tags=tags;/
set clipboard=unnamed
set colorcolumn=120 " Add red line at char 120
set nocompatible " be iMproved, required
filetype off " required
set backspace=2 " Helps with backspace after insert
set number " Line numbers on
<html>
<head>
<title>Deleted Comment Count</title>
<script src="https://d3js.org/d3.v4.min.js"></script>
<style>
.line {
fill: none;
stroke: steelblue;
stroke-width: 2px;
}