Skip to content

Instantly share code, notes, and snippets.

View Jun-Dai's full-sized avatar

Jun-Dai Bates-Kobashigawa Jun-Dai

View GitHub Profile
@Jun-Dai
Jun-Dai / determine_yield.rb
Last active December 10, 2015 21:58
No idea how accurate this truly is as I have no training in accounting whatsoever (other than a 3rd grade class on balancing my checkbook). Anyways, I wanted to know what my overall annualised yield was for my RateSetter account where I've made some deposits on certain dates and know my current balance. I would welcome improvements or correction…
# Simple script to determine what your rough overall annual yield is for something that has gained value with multiple deposits and withdrawals.
#
# Expects an input file with each line in one of the following formats:
#
# 1. amount added:
# yyyy-mm-dd £###.##
#
# 2. amount subtracted:
# yyyy-mm-dd (£###.##)
#
@Jun-Dai
Jun-Dai / import.sh
Last active March 2, 2021 15:53
Script to import my photos from the SD card to my USB stick
echo
echo "source dir: ${PHOTO_SRC_DIR:=/Volumes/EOS_DIGITAL}"
echo "target base dir: ${PHOTO_TARG_BASE_DIR:=/Volumes/Ellington/Raw Imports}"
echo "date: ${FOLDER_DATE:=`date "+%Y-%m-%d"`}"
PHOTO_TARG_DIR="$PHOTO_TARG_BASE_DIR/$FOLDER_DATE"
PHOTO_TMP_DIR="$PHOTO_TARG_BASE_DIR/tmp_`date +%s`"
echo "target folder will be: ${PHOTO_TARG_DIR}"
echo
@Jun-Dai
Jun-Dai / testing.md
Created July 2, 2013 15:12
Markdown tests
  1. List
  2. List
  • indented list
  • indented list item two
  1. outer list.
@Jun-Dai
Jun-Dai / coins.scm
Created September 24, 2013 23:30
coins in scheme
(define (cc amount kinds-of-coins)
(if (or (< amount 0) (= kinds-of-coins 0)) 0
(+ (cc amount (- kinds-of-coins 1))
(if (= amount (first-denomination kinds-of-coins)) 1 0)
(cc (- amount (first-denomination kinds-of-coins)) kinds-of-coins))))
@Jun-Dai
Jun-Dai / tabs_v_spaces.md
Last active August 29, 2015 14:02
Tabs vs. spaces

An attempt to summarize all the arguments around tabs vs. spaces.

Tabs:

  • Each developer can pick their tab size - if one dev likes 4-column tabs and the other likes 2-column tabs, they are both happy.
    • counter: really?
      • counter to counter: yes
  • Fewer characters in the code. This matters more for things that go over the wire (HTML, XML).
    • counter: if you really care, you'll minify anyways. This is pretty trivial.
  • It is easier to type and erase when using a tool that doesn't insert spaces when you press the tab key or delete them when you hit backspace.
@Jun-Dai
Jun-Dai / recipe_v2.md
Created June 23, 2014 02:18
Singapore Sling
  • 500ml pineapple juice
  • 150ml gin
  • 40ml cherry juice
  • 40ml brandy
  • 50ml orange juice?
  • 40ml pomegranate liqueur
  • 50ml fresh lime juice
  • dash of bitters
@Jun-Dai
Jun-Dai / README.md
Last active August 29, 2015 14:04
Polling in Duolingo

One way to extract polling data from Duolingo. Ask each user to write what they want in their comment in the form:

I vote for Tamil.

Then, with the script below, you can extract the vote for each user into a CSV output. If you want to run this and save to a CSV so you can upload it to Google spreadsheets, you can do this (on a mac):

ruby get_poll_results.rb 'https://www.duolingo.com/comments/3938897' &gt; poll_results.csv
@Jun-Dai
Jun-Dai / recipe.md
Last active August 29, 2015 14:04
recipe_v3.md

What I did so far:

  • 1L pineapple juice
  • 250 ml blood orange juice
  • 375 ml gin
  • 40 ml cherry brandy
  • 120 ml cognac
@Jun-Dai
Jun-Dai / README.md
Last active June 9, 2017 15:42
Seattle for Michael
  • Northwest Tofu (Chinese)
    • Especially the salt+pepper tofu and the salty soy milk (which is a soup), but other things are good.
  • Hoang Lan (Vietnamese)
    • the bun rieu here is amazing (best I've had). Known for their Bun bo hue. All the grilled meats, etc., are good. Pho is okay.
  • Crumble and Flake (Patisserie)
    • Especially the Kouign Amann and the Chewios
  • Eltana (Montreal bagels)
  • Slim's Last Chance Chilli Shack (Chilli, beer, more chilli)
  • Top Pot Doughnuts
  • John Howie
@Jun-Dai
Jun-Dai / London.md
Last active August 29, 2015 14:16
TODO
  • Borough Market (Saturday)
  • south of London Bridge
  • The George Inn
  • only galleried Inn in London
  • near Borough Market
  • Walking along the south bank is nice. Can walk from Borough.
  • Tate Modern
  • Shakespeare's Globe
  • Southbank Centre, etc.
  • Sunday Roast