Skip to content

Instantly share code, notes, and snippets.

View jbfink's full-sized avatar
💭
we have statuses now? is this AOL?

John Fink jbfink

💭
we have statuses now? is this AOL?
View GitHub Profile
@jrochkind
jrochkind / gist:2161449
Created March 22, 2012 18:40
A Capistrano Rails Guide

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".

@fernandoaleman
fernandoaleman / Linux Static IP
Created March 23, 2012 16:20
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@rsinger
rsinger / method_missing.rb
Created May 31, 2012 17:45
method_missing example
class Foo
def method_missing(method_name, *args)
# method_name is a symbol
if method_name.to_s =~ /^find_by_/
self.find_by_magic_method(method_name, args)
elsif method_name.to_s =~ /^other_dynamic_method_/
self.do_other_dynamic_method(method_name, args)
end
# If we get here, we'll get a NoMethodError
end
@rbriank
rbriank / gist:3078571
Created July 9, 2012 20:03
monitor a website and do something if it's down
alias monitor='while true; do if [ "$(wget -T 10 -t 1 https://some.server.com -O /dev/null -o /dev/stdout | grep 200.OK)" = "" ]; then "$(..restart...)"; echo "restarted at `date`"; fi; echo "last checked at `date`"; sleep 1800; done'
@UniIsland
UniIsland / SimpleHTTPServerWithUpload.py
Created August 14, 2012 04:01
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
@sgsinclair
sgsinclair / gist:3824291
Created October 3, 2012 00:59 — forked from jbfink/gist:3824267
unable to access array. need reader?
class Argh
def initialize
@array = %w[bob ted alice frank]
end
def get
@array
end
end
puts Argh.new.get
@mreidsma
mreidsma / LTC2013.markdown
Created October 6, 2012 02:46
Websites are for People (LTC2013 Talk Proposal)

Library websites are notoriously hard to use. Librarians and library staff spend much of their time training our patrons to use our online tools, instead of helping to develop deeper skills. While our tools are often complex, they seem to have been designed for the computers they run on rather than the people who use them. This issue has rightfully come to the forefront of the library world in recent years.

The usual debate is between making our tools so simple that anyone can use them, or training our patrons to use the complex tools. But there is middle ground here. We can make our tools easier without losing the power that much of their complexity brings. But we need to shift the burden of teaching how to use the tools from our staff to the tools themselves.

In this presentation, I'll talk about what we can learn from fields like evolutionary psychology and video game design that will help us build helpful and powerful websites that people can actually use.

@bensie
bensie / base.rb
Created December 6, 2012 17:53
Sinatra API Helpers
require "sinatra/base"
require "sinatra/namespace"
require "multi_json"
require "api/authentication"
require "api/error_handling"
require "api/pagination"
module Api
class Base < ::Sinatra::Base
@ruebot
ruebot / gist:5462998
Created April 25, 2013 20:43
drupal filter issues
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
ERROR 2013-04-25 16:15:25.992 [http-8080-1] (DrupalAuthModule) SQLState: 08S01
ERROR 2013-04-25 16:15:25.993 [http-8080-1] (DrupalAuthModule) VendorError: 0
ERROR 2013-04-25 16:15:25.993 [http-8080-1] (DrupalAuthModule) Error Connecting to Database server localhost port 3306 database digital_library_drupal
ERROR 2013-04-25 16:15:25.993 [http-8080-1] (AuthFilterJAAS) javax.security.auth.login.LoginException: Login Failure: all modules ignored
@tobert
tobert / p2d.sh
Last active May 27, 2020 15:59
Physical-to-Docker conversion script ... as in, these are the steps I went through, but this script is not something you want to run on any machine you care about. I've removed employer-specific stuff from this copy.
#!/bin/bash
#
# This is really just notes, but I put them in a shell script so I get
# free highlighting and easy cut/paste (in and out).
#
echo "Don't run this script! It's meant to be read. It will destroy your system!"
exit 1
RAW="lucid-amd64-cdh3u4-raw"