Skip to content

Instantly share code, notes, and snippets.

@lwu
lwu / README
Created August 12, 2008 05:18
example code demonstrating Mapnik C++ API
This code snippet, modifed from Mpanik's rundemo.cpp (r727, license LGPL),
renders the State of California using USGS state boundaries data.
Here's a play-by-play (via https://lists.berlios.de/pipermail/mapnik-devel/2008-August/000679.html)
rundemo.cpp renders a map of Ontario/Quebec, and instead I wanted to draw a
map of California and its surrounding states.
I grabbed the data from the USGS in the form of "statesp020" (google it, or
browse through nationalatlas.gov) and first wanted to modify rundemo.py
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'
@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(' ')}`}
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 / 1+1
Created September 6, 2012 06:08
Gist defect?
0