Instantly share code, notes, and snippets.

View 🗳 How to get the vote out for Democrats 🗳.md
View file.md
View sleep.coffee
sleep = (ms)->
date = new Date()
loop
break if (new Date())-date > ms
# from https://stackoverflow.com/questions/951021/what-is-the-javascript-version-of-sleep
# as foretold in a million passionate comments by programmers 'round the world,
# using this in business logic in javascript is a bad idea. but it sometimes comes in
# handy when trying to experiment with something in dev (like if you want to simulate
# a timeout)
View rails-timezones.md

Time.find_zone! uses these two methods to look up strings:

  • ActiveSupport::TimeZone[time_zone]
  • TZInfo::Timezone.get(time_zone)

The lists they reference are these:

  • ActiveSupport::TimeZone.all.map(&:tzinfo).map(&:canonical_identifier) (150)
  • TZInfo::Timezone.all_identifiers (606)
View config.ru
require_relative 'config/environment'
class FileDescriptorLogger
def initialize(app)
@app = app
end
def call(env)
if 1000==rand(1001)
unclosed_files = 0
View dumping only create table statements from postgres.sh
pg_dump --schema-only --no-privileges --no-owner DBNAME | awk 'RS="";/CREATE TABLE[^;]*;/' > DBNAME.sql
View file.md

intro

Goal is to convert

<img src="<%= ENV["IMAGE_URL"] %>/icons/app-ui-logo-white.png" id="topbar-logo" alt="Freedom logo">

to

View How to install ruby and gitsh on macOS 10.12 Sierra with macports.md
sudo port selfupdate
sudo port install ruby25 # will include readline
sudo port select ruby ruby25

### >>> OPEN A NEW TERMINAL!!! <<<
### otherwise, the configuration won't point to the correct version of readline, no matter what you do.
### not sure if this is "through" the ruby binary, or something else in the environment
### i just saved you 17 hours of your life, you're welcome
View file.md