Skip to content

Instantly share code, notes, and snippets.

@jasonong
jasonong / gist:2300375
Created April 4, 2012 11:03 — forked from choonkeat/gist:2297910
street names of singapore
Abingdon Road
Adam Drive
Adam Park
Adam Road
Adis Road
Admiralty Drive
Admiralty Lane
Admiralty Link
Admiralty Road
Admiralty Road East
.count {
border: 1px solid #D4D4D4;
font-size: 11px;
font-weight: bold;
padding: 0px 8px;
line-height: 20px;
margin-left: 10px;
border-radius: 2px;
color: #333;
background-color: white;
@jasonong
jasonong / Assert disabled link
Created December 18, 2012 21:01
Check for a disabled link with Capybara + Rspec.
<link rel='canonical' href: '/home' />
@jasonong
jasonong / mp_profiles.rb
Last active August 29, 2015 13:56
Getting Mixpanel profiles where property "Name" is not set.
require 'rubygems'
require 'mixpanel_client'
config = {api_key: 'FOO', api_secret: 'BAR'}
client = Mixpanel::Client.new(config)
data = client.request('engage', {
where: 'not defined(properties["Name"])'
})
@jasonong
jasonong / gist:6bc765ade3838c9ea7a0
Last active August 29, 2015 14:21
Simple hash conditions for columns in model table.
sql = '1 = 1'
values = {}
if params[:foo].present?
sql << 'AND foo >= :foo'
values[:foo] = params[:foo]
end
if params[:bar].present?
sql << 'AND bar < :bar'