Skip to content

Instantly share code, notes, and snippets.

@seanaedmiston
seanaedmiston / devise.rb
Created August 21, 2011 10:53
Devise Omniauthable
...
# ==> Configuration for any authentication mechanism
# Configure which keys are used when authenticating a user. The default is
# just :email. You can configure it to use [:username, :subdomain], so for
# authenticating a user, both parameters are required. Remember that those
# parameters are used only when authenticating and not when retrieving from
# session. If you need permissions, you should implement that in a before filter.
# You can also supply a hash where the value is a boolean determining whether
# or not authentication should be aborted when the value is not present.
config.authentication_keys = [ :login ]
@radar
radar / debug.md
Last active December 16, 2015 05:29

FIRST: Have you tried stopping your server process and restarting it?

Now with that out of the way...

Two quick, easy rules to getting help:

  1. Questions concerning problems with code you've written must describe the specific problem and include valid code to reproduce it. See http://SSCCE.org for guidance.
  2. Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: http://goo.gl/9nI4eq.

Please provide the following information in a new Gist:

@owainlewis
owainlewis / rails_codes.md
Last active December 20, 2015 13:59
Rails status code symbol mappings

Status Code Status Message Symbol

2xx Success
200	OK	:ok
201	Created	:created
202	Accepted	:accepted
203	Non-Authoritative Information	:non_authoritative_information
204	No Content	:no_content
205	Reset Content	:reset_content
@seisvelas
seisvelas / fib.c
Last active December 10, 2018 20:13
Learnin' C
#include <stdlib.h>
int main(void) {
int edi = 5; // nth fib num
int ebx = 0;
int eax = 1;
int edx; // tmp
start_loop:
--edi;
@gcollazo
gcollazo / fabfile.py
Created July 28, 2010 17:16 — forked from onyxfish/fabfile.py
Sample fabfile.py
from fabric.api import *
"""
Base configuration
"""
env.project_name = '$(project)'
env.database_password = '$(db_password)'
env.site_media_prefix = "site_media"
env.admin_media_prefix = "admin_media"
env.newsapps_media_prefix = "na_media"
@tavisrudd
tavisrudd / links.txt
Created March 23, 2013 04:55
some links related to my voice coding talk at #pycon
@jareware
jareware / s3-curl-backups.md
Last active August 29, 2021 00:56
Simple, semi-anonymous backups with S3 and curl

⇐ back to the gist-blog at jrw.fi

Simple, semi-anonymous backups with S3 and curl

Backing stuff up is a bit of a hassle, to set up and to maintain. While full-blown backup suites such as duplicity or CrashPlan will do all kinds of clever things for you (and I'd recommend either for more complex setups), sometimes you just want to put that daily database dump somewhere off-site and be done with it. This is what I've done, with an Amazon S3 bucket and curl. Hold onto your hats, there's some Bucket Policy acrobatics ahead.

There's also a tl;dr at the very end if you just want the delicious copy-pasta.

Bucket setup

@jaeschliman
jaeschliman / emacs-set-app-icon.m
Created January 24, 2014 03:18
change the Emacs.app application icon while it's running
/*
I typically run several emacs instances at once,
One handling IM and my timecard etc,
and one for each project I'm currently working on.
This way I can tailor a given instance of emacs to a given project
as much as I want without interfering with the others,
it simplifies buffer-switching and desktop saving etc.
But it gets to be a PITA command-tabbing between them as they all have the same icon.
This fixes that.
@bjhess
bjhess / st_cheat.txt
Created January 11, 2012 21:39
Sublime Text Cheatsheet
Navigation:
cmd-p Goto Anything ('@' for functions, ':' for line number)
cmd-r Function finder
ctl-g Goto line number
cmd-sft-p Command palette
cmd-sft-f Find in Files
cmd-opt-r Toggle regex when finding
cmd-opt-# Columns
ctr-# Switch columns
@rudyjahchan
rudyjahchan / Rakefile
Created June 9, 2011 16:45
Building and Deploying iOS Projects through Rake
require 'yaml'
require 'uri'
require 'tempfile'
require 'tmpdir'
SDK_DIR = "/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk"
TESTFLIGHT_URL = 'http://testflightapp.com/api/builds.json'
PROJECT_DIR = File.dirname __FILE__
RUBIOS_DIR = File.join(PROJECT_DIR, 'rubios')