Skip to content

Instantly share code, notes, and snippets.

View cdlm's full-sized avatar
💭
😴

Damien Pollet cdlm

💭
😴
View GitHub Profile
@alexvollmer
alexvollmer / _gem
Created August 8, 2009 17:49
zsh completion for rubygems
#compdef gem gem1.9
gem_general_flags=("(-h --help)"{-h,--help}"[Get help on this command]"
"(-V --verbose)"{-V,--verbose}"[Set the verbose level of output]"
"(-q --quiet)"{-q,--quiet}"[Silence commands]"
"--config-file[Use this config file instead of default]:file:_files"
"--backtrace[Show stack backtrace on errors]"
"--debug[Turn on Ruby debugging]"
$nul_arg
)
@fracai
fracai / obfuscate_mail.rb
Created February 17, 2011 01:24
An email obfuscation filter for nanoc. It should find and hide all links in the form of: <a href="mailto:"></a>
module Nanoc3::Filters
class ObfuscateMail < Nanoc3::Filter
identifier :obfuscate_mail
require 'digest/sha1'
def run(content, params={})
link_count=0
@AndrewRadev
AndrewRadev / tabularize.vim
Last active September 26, 2015 22:48
Tabularize mappings for specific use cases
" Tabularize mappings
"
" sa= -- align by equals
" sa> -- align by "=>"
"
" and so on. Note that any character can be entered and the mappings will
" attempt to align by that, in the simplest way possible.
"
" sa| -- equivalent to ":Tab/|"
"
@pk
pk / juicer_filter.rb
Created November 9, 2011 15:25
Nanoc Juicer filter for minifying CSS/JS
module PK
module Filter
class Juice < Nanoc3::Filter
identifier :juice
type :text
def run(content, params={})
input_filename = File.join('content', @item.path)
output_filename = File.absolute_path(File.join('tmp', "#{@item.path}"))
anonymous
anonymous / gist:1406238
Created November 29, 2011 20:09
Originally:
https://gist.github.com/7565976a89d5da1511ce
Hi Donald (and Martin),
Thanks for pinging me; it's nice to know Typesafe is keeping tabs on this, and I
appreciate the tone. This is a Yegge-long response, but given that you and
Martin are the two people best-situated to do anything about this, I'd rather
err on the side of giving you too much to think about. I realize I'm being very
critical of something in which you've invested a great deal (both financially
@tomstuart
tomstuart / gist:1466504
Created December 12, 2011 10:40
FizzBuzz in the lambda calculus in Ruby
>> IF = -> b { b }
=> #<Proc:0x007fb4e4049cc8 (lambda)>
>> LEFT = -> p { p[-> x { -> y { x } } ] }
=> #<Proc:0x007fb4e403d680 (lambda)>
>> RIGHT = -> p { p[-> x { -> y { y } } ] }
=> #<Proc:0x007fb4e4028ff0 (lambda)>
>> IS_EMPTY = LEFT
@dalehenrich
dalehenrich / MetacelloScripting.st
Created February 23, 2012 10:02
Sample of Metacello Scripting API
"download HEAD of master branch of the sample project, i.e., download from github, but don't load Sample project into image"
Metacello new
project: 'Sample';
repository: 'github://dalehenrich/sample:master/core';
get.
"load HEAD of master branch of the sample project, i.e., download from github, and load Sample project into image"
Metacello new
project: 'Sample';
repository: 'github://dalehenrich/sample:master/core';
@dalehenrich
dalehenrich / smalltalkProjectSructure.md
Created February 23, 2012 10:19
Proposed Smalltalk project directory structure

##Monticello Package Structure

The basic idea is to store individual methods in files so that git can manage method-level history. The split between classes and extensions in the snapshot directory is differentiate between classes defined in a package and extension methods defined in the package:

+-Sample-Core.pkg\
  +-snapshot\
  | +-classes\
  | | +-SampleCore.class\
  | |   +-SampleCore.st
@dalehenrich
dalehenrich / assumptions.md
Created February 23, 2012 17:36
List of assumptions about using git for managing Smalltalk source
  1. I assume that by moving to a disk-based structure, we are expecting folks to edit and modify directory structure on disk using the shell and standard editors. This means that all information is going to be stored in plain test files. No binary files. Binary files may be stored in the project structure for use by developers, but the mechanisms for loading code into an image from disk must not involve binary files.

  2. I assume that we will preserve package structure on disk. This means that at a minimum we must be able to preserve the collection of class and method definitions that make up a Monticello package. This includes traits and any other standard definitions that are currently present in a Monticello package. In practice "preserving the package structure" means that one can load a package from disk and then save the package to disk in another location and the directory structure is "identical". The package loader must be respectful of files and directories that are not part of the official package

@simonmichael
simonmichael / sm-Ledger.st
Created May 3, 2014 17:15
a prototype squeak port of Ledger, 2007
"
prototype ledger file parser in squeak
Simon Michael
test scripts:
s1 := LedgerParserTests sample1 readStream
PositionableStream
2007/10/7 the fairmont sonoma mission inn & spa
expenses:food:dining $11