Skip to content

Instantly share code, notes, and snippets.

View cloudhead's full-sized avatar
🌴
On vacation

Alexis Sellier cloudhead

🌴
On vacation
View GitHub Profile
var F = function () {};
F.name // ''
F.name = "foo";
F.name // ''
########################
# wp2toto #
# by Joseph Weissman #
########################
# config
author = "user"
wpfile = "user_blog_export.xml"
outdir = "../articles/"
// less
foo, bar {
color: black;
lol, &:cat {
font: none;
> a, b {
color: red;
}
//
// JS Prompt - a Talker plugin <http://talkerapp.com>
//
// to activate/deactivate the js prompt: /prompt
// to share variables amongst users: this.foo = 1;
//
plugin.usage = '/prompt';
plugin.command = 'prompt';
plugin.evalMode = false;
@cloudhead
cloudhead / promise.js
Created February 22, 2010 18:26 — forked from tmpvar/promise.js
var events = require('events');
exports.Promise = function () {
exports.EventEmitter.call(this);
this._blocking = false;
this.hasFired = false;
this._values = undefined;
};
process.inherits(exports.Promise, events.EventEmitter);
@cloudhead
cloudhead / up-wp-toto.rb
Created February 18, 2010 22:08
script used to import usabilitypost.com posts from wp to toto
i = 0
File.read("wp_posts2.csv").split('$$')[1..-1].each do |entry|
next if entry.gsub(/\n/,'').empty?
print '.'
date, body, title, slug = entry.split('||').map {|e| e.sub(/^""/, '').sub(/""$/, '') }
puts title if title.include? ':'
slug = title.downcase.gsub('[^a-z0-9]+', '-') if slug.empty?
date = date.split(/ +/).first
File.open("articles/#{date}-#{slug}.txt", "w") do |file|
file.write("title: #{title}\ndate: #{date.gsub('-', '/')}\nslug: #{slug}\n\n#{body}\n")
This file lays out my planned open-source projects for the next year or so.
These projects are interdependent upon eachother in complex ways, hence the
complexity of this graph. The *overall*, eventual goal, is a set of my own
clients I can use with Google Wave, a web framework I *actually like*, and a
JavaScript development environment/ecosystem I can stomache.
This list is ordered bottom-up, and right-to-left. Items below and indented
another item *must* be completed (or have portions thereof completed) before
their parent item can be worked on.
var posix = require("posix");
var sys = require("sys");
var continuables = require('continuables');
function writeFile(filename, value, mode) {
if (typeof value !== "string") {
throw new Error('Value must be a string');
}
if (typeof mode === "undefined") {
mode = 0600;
@cloudhead
cloudhead / gist:303324
Created February 13, 2010 07:45
substitution plugin for talker
//
// A Talker plugin to do live substitutions of previous message
//
// string example: s/wordl/world
// regexp example: r/^w/W
//
plugin.onMessageReceived = function (event) {
var match, row, messages, search;
if (match = event.content.match(/^([sr])\/(.+?)\/([^\/]*)(?:\/([gi])?)?$/)) {
row = $("#log tr[author='" + event.user.name + "'].message:last");
require.paths.unshift(
__filename.split('/').slice(0, -1).concat('vendor').join('/'));