Skip to content

Instantly share code, notes, and snippets.

🥑

Lee Packham leepa

🥑
Block or report user

Report or block leepa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:307846
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index 61a2a2d..228e1d5 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -29,7 +29,12 @@ class Pathname
if src.is_a? Array
src.collect {|src| install src }
else
- raise "#{src} does not exist" unless File.exist? src
+ # if it's a symlink, don't resolve it to a file because if we are moving
View gist:422212
Dear Subject Name Here,
Aperture Science is pleased to inform you that we have partnered with Valve to announce the gala CANCELLATION of the June 14 Portal 2 event at the Regal Theater. The event will be replaced by a surprise. And even though the cancellation of the event certainly counts as a surprise, we are pleased to further announce that the cancellation of the event is not THE surprise. However, per International treaties regarding the definition of the word "surprise", of which both Aperture Science and Valve are signatories, the time, date and content of the actual surprise will only become available as you experience the surprise.
If you'd like to ask fruitless questions about the E3 Portal 2 surprise or, more fruitfully, schedule an appointment to attend a Portal 2 screening at the Valve booth during E3, please contact Valve's Special Envoy to Surprises, Doug Lombardi.
Thank you for **RECORD SCRATCH!!!**
PS: The surprising record scratch is also not the surprise.
View gist:442134
// ==UserScript==
// @name MPUK Forum Banner Head Removal
// @namespace http://leenux.org.uk/
// @description Removes awful header thingy that people hate
// @include http://forums.multiplay.co.uk/*
// ==/UserScript==
var allDivs, thisDiv;
allDivs = document.evaluate(
"//div[@class='main-page']",
View gist:470925
>>> pprint.pprint(sysconfig.get_config_vars())
{'AC_APPLE_UNIVERSAL_BUILD': 0,
'AIX_GENUINE_CPLUSPLUS': 0,
'AR': 'ar',
'ARFLAGS': 'rc',
'ASDLGEN': './Parser/asdl_c.py',
'ASDLGEN_FILES': './Parser/asdl.py ./Parser/asdl_c.py',
'AST_ASDL': './Parser/Python.asdl',
'AST_C': './Python/Python-ast.c',
'AST_C_DIR': './Python',
@leepa
leepa / http.js
Created Jul 17, 2010
This is a slight mod on the original - it supports HTTPS and actually has error handling!
View http.js
// Express - HTTP - Copyright TJ Holowaychuk <tj@vision-media.ca> (MIT Licensed)
/**
* Module dependencies.
*/
var http = require('http'),
parse = require('url').parse,
queryString = require('querystring')
View gist:527780
➜ local git:(master) pwd
/usr/local
➜ local git:(master) brew install libgpg-error
Formula already installed: /usr/local/Cellar/libgpg-error/1.8
➜ local git:(master) brew install libgcrypt
Formula already installed: /usr/local/Cellar/libgcrypt/1.4.5
➜ local git:(master) brew install gnutls
==> Downloading http://ftp.gnu.org/pub/gnu/gnutls/gnutls-2.10.1.tar.bz2
File already downloaded and cached to /Users/lpackham/Library/Caches/Homebrew
==> ./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/gnutls/2.10.1 --disable-guile
View config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by GnuTLS configure 2.10.1, which was
generated by GNU Autoconf 2.65. Invocation command line was
$ ./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/gnutls/2.10.1 --disable-guile
## --------- ##
## Platform. ##
View foo.rb
def normalize_version version, sep, max_width
version_split = version.split(sep)
output = ""
for s in version_split
output << sprintf('%' + max_width.to_s + 's', s)
end
output
end
v1 = '1.4.1'
View gist:729349
defaults write com.apple.Dock orientation -string top
killall Dock
View gist:764794
daemonize yes
pidfile /var/run/redis.pid
logfile /var/log/redis.log
port 6379
bind 127.0.0.1
timeout 300
loglevel notice
You can’t perform that action at this time.