Skip to content

Instantly share code, notes, and snippets.

@Nurdok
Nurdok / python_conversion.md
Last active December 16, 2022 03:45
Python Conversion

Python Number Conversion Chart

From To Expression
@adamgit
adamgit / .gitignore
Last active April 8, 2024 12:58
.gitignore file for Xcode4 / OS X Source projects
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.6
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
@jelder
jelder / configuration.rb
Created September 7, 2012 18:02
Alternative to Configatron compatible with the 12 Factor App philosophy.
# This is an attempt at constructing an application which complies with the
# ideas expressed at http://www.12factor.net/, specifically section 3, "Config"
# which states that configuration parameters which vary between environments
# should be stored in environment variables.
#
# `Configuration` is a thin wrapper around Ruby's ENV hash which also allows
# traditional custom config parameters to be set. Add an `attr_accessor` line
# and define the value in `config/environments/*.rb`.
#
# For example, `Configuration.api_token` called in the foobar environment will
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@nbrew
nbrew / install_w3af.sh
Created March 1, 2012 23:11
Install w3af with requirements on Mac OS X
#!/bin/bash
# Attempts to install the web application vulnerability scanner w3af and it's prerequisites.
# For more information about w3af, see: http://w3af.sourceforge.net/
# USAGE: pypi_install package_name version_number md5_checksum
# checksum is optional; package and version are required
function pypi_install() {
name=$1
version=$2
@steve9001
steve9001 / application.rb
Created December 7, 2011 16:18
Rails middleware to provide information about errors during requests
module MyApp
class Application < Rails::Application
if Rails.env == 'test'
require 'diagnostic'
config.middleware.use(MyApp::DiagnosticMiddleware)
end
end
end