Skip to content

Instantly share code, notes, and snippets.

Avatar

Nate Hopkins hopsoft

View GitHub Profile
View README.md

There's one thing that I felt was missing from the CableReady ecosystem and should be doable: lazy loading

I introduce:

Futurism

with a helper in your template

<%= futurize @posts %>
@leastbad
leastbad / action_mailbox.md
Last active Sep 22, 2020
Action Mailbox: The Missing Manual
View action_mailbox.md

This is all you really need to know in order to make Action Mailbox work in development.

  1. Fire up ngrok http 3000 and make note of your subdomain for steps 3 and 8.
  2. Create a Mailgun account because they offer sandbox addresses; grab your domain from the Dashboard.
  3. Go into Receiving and create a catch-all route pointing to: https://XXX.ngrok.io/rails/action_mailbox/mailgun/inbound_emails/mime
  4. Add your Mailgun API key to your credentials:
action_mailbox:
  mailgun_api_key: API KEY HERE
@olivierlacan
olivierlacan / gist:4062929
Last active Sep 22, 2020 — forked from Gregg/gist:968534
Code School Screencasting Framework
View gist:4062929

Screencasting Framework

The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.

Why you should care about screencasting?

You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.

  1. Communicating more effectively - At Envy Labs we produce screencasts for our clients all the time. Whether it's demoing a new feature or for a presentation for an invester, they're often much more effective and pleasent than a phone call or screen sharing.
@bloudermilk
bloudermilk / benchmark.rb
Created Sep 9, 2012
Ruby single quotes vs. double quotes
View benchmark.rb
require "benchmark"
Benchmark.bm(7) do |bench|
bench.report("single") do
1_000_000.times do
'This is a string of substantial length. I doubt you will have many string
literals in your code that are longer than this, but if there are actually
costs to parsing double quoted strings this should exacerbate that.'
end
end
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@camertron
camertron / measure.rb
Created Jun 15, 2012
Measure the memory taken by a Ruby object (by Robert Klemme)
View measure.rb
#!/bin/env ruby
# lazy hack from Robert Klemme
module Memory
# sizes are guessed, I was too lazy to look
# them up and then they are also platform
# dependent
REF_SIZE = 4 # ?
OBJ_OVERHEAD = 4 # ?
@mm53bar
mm53bar / Gemfile
Created Mar 26, 2012
Automagically launch an EC2 image and then provision it using sunzi
View Gemfile
source 'http://rubygems.org'
gem 'sunzi'
gem 'rake'
gem 'fog'
@jimbojsb
jimbojsb / gist:1630790
Created Jan 18, 2012
Code highlighting for Keynote presentations
View gist:1630790

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

You can’t perform that action at this time.