View gist:643efb5f48ff07b843cc
View gist:943ab37cf222381ef7d6
// NAD27 to NAD83/WSG84 converter
var data = [
{ item: '1', lat: [32,19,45.5], lon: [-64,50,7.8] },
{ item: '2', lat: [32,19,1.6], lon: [-64,50,33.8] },
{ item: '3', lat: [32,18,49.2], lon: [-64,50,31.9] },
{ item: '4', lat: [32,18,10.3], lon: [-64,52,1.5] },
View gist:1927b2abaa05e6b098d5
# ([].each {}).empty?
# .each returns the enumerator
# the block itself returns an array
<% if @messages.each do |message| %>
<%# code or partial to display the message %>
<% end.empty? %>
You have no messages.
View deferred yield.rb
def yield_placeholder(name, content = nil, &block)
if content_for?(name)
concat @view_flow.get(name)
if block_given?
content = capture(&block)
concat content
View gist:8852875

MOBILE WEB (at 25 minutes)

Jimmy Soni (Managing Editor at the Huffington Post)

  • You'll get a lot more traction as a publisher if you focus on mobile web than if you focus on mobile apps
  • The people that download your app our your hardcore loyalists
  • 80% to 85% of apps are never opened after their first open
View gist:8682328
TASK: [npm install --production] **********************************************
failed: [] => {"failed": true}
msg: this module requires key=value arguments (['production', 'state=present'])
FATAL: all hosts have already failed -- aborting
View ansible-lineinfile-examples.yml
## credit:
- hosts: alpine_install
user: root
# - name: create a complete empty file
# command: /usr/bin/touch /test/test.conf
- name: create a new file with lineinfile
View docker-ubuntu-13x.yml
# vagrant.yml
- hosts: all
user: vagrant
sudo: True
- name: Update APT package cache
apt: update_cache=yes
- name: Upgrade APT packages
apt: upgrade=yes
View tricks.txt
I have marked with a * those which I think are absolutely essential
Items for each section are sorted by oldest to newest. Come back soon for more!
* In bash, 'ctrl-r' searches your command history as you type
- Input from the commandline as if it were a file by replacing
'command <' with 'command <<< "some input text"'
- '^' is a sed-like operator to replace chars from last command
'ls docs; ^docs^web^' is equal to 'ls web'. The second argument can be empty.
* '!!:n' selects the nth argument of the last command, and '!$' the last arg