Skip to content

Instantly share code, notes, and snippets.

Chris Le chrisle

Block or report user

Report or block chrisle

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
@admackin
admackin / tmux-build.sh
Created Oct 15, 2012
Build tmux (iTerm2 version) as a local single-user installation on Ubuntu 10.04
View tmux-build.sh
#!/bin/sh
mkdir tmp
cd tmp
wget https://github.com/downloads/libevent/libevent/libevent-2.0.20-stable.tar.gz | tar xzf -
cd libevent-2.0.20-stable
./configure --prefix=$HOME/local && make && make install
cd ..
@seamusabshere
seamusabshere / excelwebservice.vb
Created Sep 28, 2012
Excel VB for accessing http://carbon.brighterplanet.com/flights.txt as a web service (early 2011)
View excelwebservice.vb
Option Explicit
Function GetBrighterPlanetApiKey()
GetBrighterPlanetApiKey = ActiveWorkbook.Worksheets("Setup").Range("C2").Value
End Function
Function IsEmissionEstimateServiceOnline()
If LCase(ActiveWorkbook.Worksheets("Setup").Range("C3").Value) = "online" And ThisWorkbook.HasFinishedWorkbookOpen() = True Then
IsEmissionEstimateServiceOnline = True
Else
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active Sep 18, 2019
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
View osx-for-hackers.sh
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@walterdavis
walterdavis / document.rb
Created Jul 1, 2012
Text extraction processor for Paperclip to read PDF files
View document.rb
def extract_text
file = File.open("#{pdf.queued_for_write[:text].path}","r")
plain_text = ""
while (line = file.gets)
# plain_text << line.gsub(/[^\x00-\x7F]/n,'').gsub(/`/,"'").gsub(/^\d+$/,'').to_s + "\n"
plain_text << Iconv.conv('ASCII//IGNORE', 'UTF8', line)
end
self.plain_text = plain_text
#self.plain_text = Iconv.conv('ASCII//IGNORE', 'UTF8', file.read)
end
@gasman
gasman / pnginator.rb
Created Apr 30, 2012
pnginator: pack Javascript into a self-extracting PNG
View pnginator.rb
#!/usr/bin/env ruby -w
# pnginator.rb: pack a .js file into a PNG image with an HTML payload;
# when saved with an .html extension and opened in a browser, the HTML extracts and executes
# the javascript.
# Usage: ruby pnginator.rb input.js output.png.html
# By Gasman <http://matt.west.co.tt/>
# from an original idea by Daeken: http://daeken.com/superpacking-js-demos
@paulmillr
paulmillr / method-missing.coffee
Created Jan 20, 2012
ECMAScript 6 proxies fun (method missing, negative array indexes)
View method-missing.coffee
# Ruby’s “method missing” analog with ES6 proxies.
proxify = (object) ->
new Proxy object, get: (receiver, name) ->
object[name] ? object.methodMissing.bind object, name
object = proxify
a: 1,
b: 15,
c: ->
'called'
You can’t perform that action at this time.