Skip to content

Instantly share code, notes, and snippets.

View lp's full-sized avatar

Louis-Philippe Perron lp

View GitHub Profile
@lp
lp / coderwall_widget_div.html
Created May 26, 2011 22:00
HTML DIV for Coderwall Widget
<div id="coderwall_badges">
<script
type="text/javascript"
src="http://coderwall-widget.appspot.com/coderwallbadges.js/yourusername">
</script>
<script>
new CoderwallWidget({
'color':'yourtextcolor',
'backgroundColor':'yourbgcolor',
'width':245,
@lp
lp / cjson error
Created May 9, 2011 13:40
lua cjson module compilation error
cc -g -O2 -Wall -pedantic -fpic -I/usr/local/include -DVERSION=\"1.0\" -c -o lua_cjson.o lua_cjson.c
cc -g -O2 -Wall -pedantic -fpic -I/usr/local/include -DVERSION=\"1.0\" -c -o strbuf.o strbuf.c
cc -shared -lm -o cjson.so lua_cjson.o strbuf.o
Undefined symbols:
"_lua_pushnil", referenced from:
_json_append_data in lua_cjson.o
_json_append_data in lua_cjson.o
"_luaL_error", referenced from:
_json_throw_parse_error in lua_cjson.o
_json_encode_descend in lua_cjson.o
@lp
lp / gist:959356
Created May 6, 2011 17:12
brew install io error
brew install -v io
/usr/local/git/bin/git
==> Cloning git://github.com/stevedekorte/io.git
Updating /Users/lpperron/Library/Caches/Homebrew/io--git
git fetch git://github.com/stevedekorte/io.git
git checkout-index -a -f --prefix=/private/tmp/homebrew-io-HEAD-rYix/
==> cmake .. -DCMAKE_INSTALL_PREFIX='/usr/local/Cellar/io/HEAD' -DCMAKE_BUILD_TYPE=None -Wno-dev
cmake .. -DCMAKE_INSTALL_PREFIX='/usr/local/Cellar/io/HEAD' -DCMAKE_BUILD_TYPE=None -Wno-dev
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
@lp
lp / sequence_renamer.rb
Created January 12, 2011 16:37
will rename files to enclosing folder name with sequenced numbers
require 'find'
nowDir = File.dirname( File.expand_path(__FILE__))
nameMem = Hash.new
Find.find( nowDir) do |path|
if ! File.directory?(path)
if File.basename(path).match(/^\..*/).nil?
dirPath = File.dirname(path)
if ! nameMem.has_key? dirPath
@lp
lp / OMC-IPAdress.plist
Created July 31, 2009 19:50
Contextual Menu to show IP Address
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>COMMAND_LIST</key>
<array>
<dict>
<key>ACTIVATION_MODE</key>
<string>act_always</string>
<key>COMMAND</key>
@lp
lp / OMC-IPAddress.plist
Created July 31, 2009 19:45
contextual menu to show IP
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>COMMAND_LIST</key>
<array>
<dict>
<key>ACTIVATION_MODE</key>
<string>act_always</string>
<key>COMMAND</key>
@lp
lp / essay on context free.rb
Created June 4, 2009 21:37
essai on context free modes
#!/usr/bin/env ruby
# -4 add separate recurse and iterate... iterate not implemented but routed
# -5 add a progressive recurse... sort of
# -6 the progressive recurse is really the same a the recurse, but progressive,
# then the progressive has become an infinite type
# -8 cleaned up... abandonned iterate, infinite and stacked
$total = 0
$nist = 0
#!/usr/bin/env ruby
# quick and dirty script for EDL cleaning
# will process all files inside this script directory
# insert some conditions or some processing in the certer iteration loop
require 'find'
require 'ftools'
scriptfile = File.basename(__FILE__)
Dir.chdir( File.dirname(__FILE__))
other_files = Array.new
@lp
lp / remove_accents.rb
Created February 26, 2009 15:34
batch text substitution, quick and dirty way
#!/usr/bin/env ruby
# quick and dirty script to convert files with french
# accents to no accent files, it opens all files in same folder,
# and enclosed folders recursively. You can replace entries in the SUBSTITUTION Hash
# to build your own substitution table. If your files encoding are other than ASCII,
# you can also convert them by uncommenting the Iconv line and putting the right
# encoding in there.
require 'find'
require 'ftools'
require 'iconv'
#!/usr/bin/env ruby
require 'yaml'
marshal_file = 'marshal_dump.marshal'
yaml_file = 'yaml_dump.yml'
def line; puts "\n"; end; line
# building a immense array of hashes