Skip to content

Instantly share code, notes, and snippets.

Copyright (c) 2019, Leslie Wu
All rights reserved.

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@lwu
lwu / Gemfile
Last active September 9, 2017 20:59
Sinatra file server
source 'https://rubygems.org'
gem 'sinatra'
The 100 Most Influential People in Health and Fitness <http://greatist.com/health/most-influential-health-fitness-people>
1. Michelle Obama
2. Mehmet Oz, M.D.
3. Deepak Chopra, M.D.
4. Jillian Michaels
5. Vani Hari
6. Tara Stiles
7. Mark Bittman
8. Gary Taubes
@lwu
lwu / serve.rb
Created February 13, 2015 02:32
serve.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'sinatra'
set :public_folder, 'public'
get '/' do
"Serve.rb"
end
@lwu
lwu / nutritional-composition.tsv
Created February 23, 2014 03:19
Appendix 3b: Nutritional composition of Balance of Good Health indicators [from Nutrient profiles: Options for definitions for use in relation to food promotion and children’s diets]
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 11 columns, instead of 2. in line 7.
Category Food Food Energy (kJ per 100g) Saturated fat (g per 100g) NME sugar (g per 100g) Sodium (mg per 100g) Calcium (mg per 100g) Iron (mg per 100g) n-3 fatty acids (g per 100g) Fruit and vegetable content* * Fruit and vegetable content has been estimated due to lack of recipe information. The foods in the database were assigned one of the following five values:
Bread, other cereals and potatoes French fries 1174 5.8 1.3 310 14 1 0 10 10% Between 0 and 20% fruit and vegetables (by weight)
Bread, other cereals and potatoes Corn flakes 1601 0.2 8.2 1000 5 7.9 0 10 30% Between 20 and 40%
Bread, other cereals and potatoes Cream crackers 1746 5.4 0 610 110 1.7 0 10 50% Between 40 and 60%
Bread, other cereals and potatoes Crispbread 1312 0.1 3.2 220 45 3.5 0 10 70% Between 60 and 80%
Bread, other cereals and potatoes Crunchy nut corn flakes 1721 0.7 37.7 600 15 7.9 0 10 90% Between 80 and 100%
Bread, other cereals and potatoes Currant buns 1185 1.9 16 317 110 1.9 0 10
Bread, other cereals and potatoes Malt lo
@lwu
lwu / cupcake-score.rb
Created December 6, 2013 14:04
Cupcake score.rb
# Generic - White Sugar 1/2 Cup
# Generic - All-Purpose Flour (Cup), 1.75 cup
# 365 - Baking Powder, Aluminum-Free, 2.4 g (1/8 tsp)
# Baking soda, 0.5 tsp
# Spices - Cinnamon, ground, 0.5 tsp
# Diamond Crystal - Kosher Salt No Iodide, 0.5 tsp (0.7 g)
# Honey, 0.5 cup
# Butter - Unsalted, 0.5 cup
# 2 Eggs Large
# Trader Joes - Greek Style Honey Yogurt, 0.3 container (8 oz)
@lwu
lwu / menustat-search-results-1385156374.csv
Created November 22, 2013 22:08
CSV Export from @nycHealthy MenuStat.org website
We can't make this file beautiful and searchable because it's too large.
"Restaurant ","Food Category ","Item_Name ","Item Description 2013 ","Servings Per Item 2013 ","Serving Size 2013 ","Serving Size Unit 2013 ","Servings Size Text 2013 ","Calories 2013 ","Total Fat (g) 2013 ","Saturated Fat (g) 2013 ","Trans Fat (g) 2013 ","Cholesterol (mg) 2013 ","Sodium (mg) 2013 ","Potassium (mg) 2013 ","Carbohydrates (g) 2013 ","Fiber (g) 2013 ","Sugar (g) 2013 ","Protein (g) 2013 "
Applebee's,"Appetizers & Sides","Appetizer Sampler","Appetizer Sampler, Appetizers, As Served",,"=""-""","=""-""",,"=""2300-2460""","=""143-160""","=""43-47""","=""2-2.5""","=""-""","=""5440-6150""","=""-""","=""157-183""",13,"=""-""","=""89-91"""
Applebee's,"Appetizers & Sides","Applesauce, Kids","Applesauce, Side, Kids",,"=""-""","=""-""",,90,0,0,0,"=""-""",5,"=""-""",23,2,"=""-""",0
Applebee's,"Appetizers & Sides","Baked Potato","Baked Potato, Steaks & Toppers or Soups, Salads & Sides",,"=""-""","=""-""",,330,18,11,0,"=""-""",170,"=""-""",41,3,"=""-""",6
Applebee's,"Appetizers & Sides","Boneless Wings, Class
@lwu
lwu / slam.el
Created November 21, 2013 04:19
Poetry Code Slam 2013 #performance
(fset 'copy-character-from-other-buffer
[?\C-x ?5 ?o ?\C- right escape ?w ?\C-x ?5 ?o ?\C-y])
(global-set-key [(a)] 'copy-character-from-other-buffer)
(global-set-key [(s)] 'copy-character-from-other-buffer)
(global-set-key [(d)] 'copy-character-from-other-buffer)
(global-set-key [(f)] 'copy-character-from-other-buffer)
(global-set-key [(g)] 'copy-character-from-other-buffer)
(global-set-key [(h)] 'copy-character-from-other-buffer)
(global-set-key [(j)] 'copy-character-from-other-buffer)
@lwu
lwu / poe.rb
Created November 13, 2013 00:15
code poetry 2013
#!/usr/bin/env ruby
require 'rubygems' # gratitude
require 'nokogiri' # arigato
h=Nokogiri::HTML(`curl http://www.biblegateway.com/passage/?search=Psalm+23&version=KJV&interface=print`).css(".text").text.split(/\W/)
%w(Zarvox Princess Cellos).each{|v|`say -v #{v} #{[9,7,9,123,9,42,55,118,104,108,6,7,100,10,95,96,86,76,120,72,106,107,63,32,42].map {|i|h[i]}.join(' ')}`}