Skip to content

Instantly share code, notes, and snippets.

View golgote's full-sized avatar

Bertrand Mansion golgote

  • Mamasam
  • Vincennes, France
View GitHub Profile
@golgote
golgote / import_module.c
Created December 3, 2011 08:30
PHP C to convert CSV to array found on http://e-normous.com/nerd/import_module.c
/*
compilation:
cc -fPIC -DCOMPILE_DL=1 -I/usr/local/src/php-4.2.3/main/ -I/usr/local/src/php-4.2.3/Zend/ -I/usr/local/src/php-4.2.3/ -I/usr/local/src/php-4.2.3/TSRM import_module.c -c -o import_module.o
gcc -shared -L/usr/local/lib -rdynamic -o import_module.so import_module.o
usage:
- assume headers are in the first row, use them for field titles
dl("/path/to/module");
start_import("/path/to/file");
@golgote
golgote / gist:1347562
Created November 8, 2011 11:40
Use palette.pl in TextMate to output colors used in a CSS file
#!/usr/bin/env ruby
# Palette is a Perl tool that creates a color swatch from a CSS file
# http://code.google.com/p/css-palette/source/browse/trunk/src/palette.pl
require ENV["TM_SUPPORT_PATH"] + "/lib/tm/executor"
require ENV["TM_SUPPORT_PATH"] + "/lib/tm/save_current_document"
palette = ENV["TM_BUNDLE_SUPPORT"] + "/palette.pl"
TextMate.save_current_document