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 / README.adoc
Last active August 27, 2015 15:53
Testing ascii doc

This is a test.

  1. I am a dot

    1. I am a subdot

  2. I am a toplevel dot

@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' > 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 / 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
@Jun-Dai
Jun-Dai / purge_emails.gs
Created March 1, 2015 21:19
GoogleScript for purging old e-mails based on patterns
var CONFIGS = [
{ search: "label:github", after_days: 5 },
{ search: "label:tlug", after_days: 30 },
{ search: "from:Trello", after_days: 30 },
{ search: "from:Quora Digest", after_days: 10 }
];
var SAVE_EMAIL_LABEL = "saved";
var EMAIL_FOR_SUMMARIES = "you@me.com";
var SEARCH_LIMIT = 100;
@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 / 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))))