Skip to content

Instantly share code, notes, and snippets.

View cdlm's full-sized avatar
💭
😴

Damien Pollet cdlm

💭
😴
View GitHub Profile
@cdlm
cdlm / cgi-escape
Last active January 3, 2016 19:59
Script to help translators of http://thecodelesscode.com
#!/usr/bin/env ruby
require 'cgi'
input = ARGV.empty? ? $stdin : StringIO(ARGV.join(' '))
input.each_line do |line|
puts CGI::escape(line.chomp)
end
@cdlm
cdlm / io-build-looks-for-lzma.txt
Created December 11, 2012 20:54
homebrew io looks for lzma
$ brew install --verbose io
==> Downloading https://github.com/stevedekorte/io/tarball/2011.09.12
Already downloaded: /Library/Caches/Homebrew/io-2011.09.12.tgz
/usr/bin/tar xf /Library/Caches/Homebrew/io-2011.09.12.tgz
==> Patching
/usr/bin/patch -f -p1 -i 000-homebrew.diff
patching file libs/basekit/source/Common_inline.h
==> cmake .. -DCMAKE_INSTALL_PREFIX=/opt/homebrew/Cellar/io/2011.09.12 -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST -Wno-dev
cmake .. -DCMAKE_INSTALL_PREFIX=/opt/homebrew/Cellar/io/2011.09.12 -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST -Wno-dev
-- The C compiler identification is GNU 4.2.1
@cdlm
cdlm / _gem
Created February 5, 2012 11:22 — forked from alexvollmer/_gem
zsh completion for rubygems
#compdef gem gem1.9
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for gem (http://rubygems.org).
#
# Source: https://gist.github.com/164465
#
# ------------------------------------------------------------------------------
@cdlm
cdlm / README
Created January 23, 2012 23:51
Corrupted graphics on Mac OS X 10.7.2
This happens once a week or two, and requires a logout/relogin (apparently BezelUIServer does not exist anymore under Lion, and killing Dock or SystemUIServer has no effect)
@cdlm
cdlm / default.rb
Created July 17, 2011 10:44
My solarized iTerm2 + nanoc color fix + zsh syntax highlight
# patch nanoc's logging colors for solarized shinyness
#
# this is to work with the iTerm 2 color presets,
# which uses most of the "bright" color codes for the grayscale swatches
module Nanoc3::CLI
class Logger
(ACTION_COLORS ||= {}).update(
:create => "\e[38;5;2m",
:update => "\e[38;5;3m",
:identical => "\e[1;38;5;6m",
@cdlm
cdlm / gist:1044968
Created June 24, 2011 15:06
Moving a Seaside app into a sub-dispatcher
#('APP' 'files') do: [ :each | |h|
(self handlerAt: 'NEW_PREFIX')
register: (self unregister: (self handlerAt: each))
at: each ]
@cdlm
cdlm / closure_compiler.rb
Created December 23, 2010 22:33
nanoc3 filter wrapping the google closure compiler
class ClosureCompiler < Nanoc3::Filter
identifier :closure_compiler
def run(content, params={})
IO.popen("closure --third_party true --warning_level QUIET", 'r+') do |io|
io.write content
io.close_write
io.read
end
end