Skip to content

Instantly share code, notes, and snippets.

View veganstraightedge's full-sized avatar
🐢
Computers were a mistake.

Shane Becker veganstraightedge

🐢
Computers were a mistake.
View GitHub Profile
@searls
searls / client.js
Created May 13, 2018 14:05
Sometimes I find it handy when I'm developing a single page app to have all front-end errors forwarded to the backend's log (when something doesn't work, I can look in a single terminal window)
const puts = (...anything) => {
fetch("/api/puts", {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({content: anything})
})
}

The 5-minute backpack demo

Here's what I carry in a Tom Bihn Synapse 19 bag when I travel for 1-to-n days. In general, I optimize for low-weight items, with a secondary focus on reducing maintenance. You can peruse a gallery of pictures, too.

Clothing

@zulhfreelancer
zulhfreelancer / upgrade.md
Last active February 17, 2023 00:42
How to upgrade Heroku Postgres database plan?
  1. Assuming you have multiple Heroku apps and Git remote like so:
development https://git.heroku.com/xxx.git (fetch)
development https://git.heroku.com/xxx.git (push)
origin      git@bitbucket.org:xxx/xxx.git  (fetch)
origin      git@bitbucket.org:xxx/xxx.git  (push)
production  https://git.heroku.com/xxx.git (fetch)
production  https://git.heroku.com/xxx.git (push)
staging https://git.heroku.com/xxx.git (fetch)
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style type="text/css">
td.linenos { background-color: #f0f0f0; padding-right: 10px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
@aaronpk
aaronpk / set_dates.rb
Created July 6, 2014 20:42
An untested script to change the upload date of your Flickr photos to the date the photo was taken
require 'flickraw'
FlickRaw.api_key = ''
FlickRaw.shared_secret = ''
@flickr = FlickRaw::Flickr.new
@flickr.access_token = ''
@flickr.access_secret = ''
# Test if the access token is valid
@sklppr
sklppr / markdown2html.rb
Last active December 30, 2015 08:39 — forked from brentsimmons/generate_html.rb
Batch conversion of Markdown to HTML.
#!/usr/bin/env ruby
require "fileutils"
require "redcarpet"
OUTPUT_FOLDER = "html"
HTML_TEMPLATE = <<-HTML
<!DOCTYPE html>
<html>
#!/usr/bin/env ruby
# PBS 4 Dec. 2013
# Renders HTML for all the .markdown files in the current directory.
# Gives each file a .html suffix.
# Saves them in a subfolder called HTML.
require 'rdiscount'
require 'find'
require 'fileutils'

Refactoring - Ruby Edition

Composing Methods

Extract Method

Inline Method

Inline Temp

@ehoch
ehoch / gist:1960548
Created March 2, 2012 19:17
Puma / DJ Procefile on Heroku
web: bundle exec puma -p $PORT
worker: bundle exec rake jobs:work
@veganstraightedge
veganstraightedge / caveatPatchor.js
Created October 27, 2011 20:47 — forked from protocool/caveatPatchor.js
Sample caveatPatchor.js file for use in Propane 1.1.2 and above
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.