Skip to content

Instantly share code, notes, and snippets.

@henrik
henrik / yosemite_upgrade_notes.md
Last active December 30, 2015 02:29
Yosemite upgrade notes

Yosemite upgrade notes

From a (mostly) Ruby on Rails developer.

After doing the below everything seems to work (some of it worked before doing anything), including Ruby, Gems, RVM, Homebrew, VirtualBox/Vagrant VMs, Pow, tmux, git, vim.

  1. Did a full-disk backup that I can restore from
  2. Moved out /usr/local to avoid super slow install, per option 1 in https://jimlindley.com/blog/yosemite-upgrade-homebrew-tips/: sudo mv /usr/local ~/local
  3. Upgraded to Yosemite
  4. Restored /usr/local, per option 1 in https://jimlindley.com/blog/yosemite-upgrade-homebrew-tips/: sudo mv ~/local /usr
@balupton
balupton / blog-moving-docpad-forward-a-gui.md
Created June 10, 2012 15:40
Blog: Moving DocPad Forward, the rise of backend-agnostic GUIs

Moving DocPad Forward, the rise of backend-agnostic GUIs

A GUI, or rather a CMS interface for DocPad is the big next step. It was also one of the first proof of concepts I used to ensure DocPad would be able to scale into the web development platform of the future.

Proof of Concept

Back in the first early months of DocPad, I created three plugins:

  • Authenticate: To authenticate you against the project's maintainers to ensure that you have read and write access
  • REST: Provided authenticated users the ability to update documents via HTTP POST requests using JSON
@epitron
epitron / instapaper-backup.rb
Last active October 17, 2017 02:37
An Instapaper scraper.
#!/usr/bin/env ruby
require 'mechanize'
USERNAME = ""
PASSWORD = ""
# TODO: Save cookies with "http.cookie_jar.{load,save} filename"
# TODO: Store password in ~/.config or some kind of wallet
@shostakovich
shostakovich / bootstrap.sh
Created October 1, 2012 17:16
Chef Solo on Mac OS X - examples
#!/bin/sh
USERNAME=shostakovich
mkdir ~/tmp
cd ~/tmp
# Install GCC + Git
curl https://github.com/downloads/kennethreitz/osx-gcc-installer/GCC-10.7-v2.pkg > GCC-10.7-v2.pkg
sudo installer -pkg GCC-10.7-v2.pkg -target /
@martindemello
martindemello / chain-of-responsibility.rb
Created February 20, 2015 21:30
chain of responsibility example in ruby
class PurchaseApprover
# Implements the chain of responsibility pattern. Does not know anything
# about the approval process, merely whether the current handler can approve
# the request, or must pass it to a successor.
attr_reader :successor
def initialize successor
@successor = successor
end
@garethrees
garethrees / application.html.erb
Created January 26, 2012 14:40
Boilerplate HTML <head> Section
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<!-- Make a DNS handshake with a foreign domain, so the connection goes faster when the user eventually needs to access it. This works well for loading in assets (like images) from another domain, or a JavaScript library from a CDN. -->
<link rel="dns-prefetch" href="//ajax.googleapis.com" />
<link rel="dns-prefetch" href="//s3.amazonaws.com" />
<!-- Make sure the latest version of IE is used -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
@kneath
kneath / growth.md
Last active November 12, 2018 06:33
Growth position

Hack on github.com with me

Thanks everyone! I've got enough leads for the time being.

@datagrok
datagrok / if_i_ran_the_company.md
Last active January 14, 2019 07:36
If I ran a company, what would it look like?

The article previously hosted at this location is now published on my website: If I Ran The Company.

@eqhmcow
eqhmcow / apache-logtop-README
Last active July 29, 2019 14:54
Real-time top-like requests-per-second average for httpd request logs - similar to apachetop
DESCRIPTION
logstat.pl and logtop.pl
These scripts show current and average request-per-second counts based on
apache access logs in real-time.
You can see the total requests-per-second as well as a breakdown by:
* vhost
* URL
@nowlinuxing
nowlinuxing / gist:6435240
Created September 4, 2013 10:23
execute Controller#action via rails runner with user authentication (devise)
rails runner "ApplicationController.allow_forgery_protection = false; s = ActionDispatch::Integration::Session.new(Rails.application); s.post('/login', user: {login: 'admin', password: 'password'}); s.get('/my'); puts s.response.body"