Skip to content

Instantly share code, notes, and snippets.

View cha0s's full-sized avatar
👌
Gettin' it

Ruben R cha0s

👌
Gettin' it
View GitHub Profile
From 7e9c16806638ca413025defc91185c8f2ea471a6 Mon Sep 17 00:00:00 2001
From: Ruben Rodriguez <cha0s@therealcha0s.net>
Date: Wed, 23 Jun 2010 07:00:06 -0500
Subject: [PATCH] Added Script.createContext() and Script.runInContext() and implemented it in the REPL.
---
lib/repl.js | 40 ++++++++--------
src/node.cc | 7 ++-
src/node_cares.cc | 8 ++--
src/node_child_process.cc | 2 +-
@cha0s
cha0s / WB-content-dev.md
Created June 3, 2012 07:44
Instructions for cloning and managing the WB content folder
$ sudo npm install -g npm
npm http GET https://registry.npmjs.org/npm
npm http 200 https://registry.npmjs.org/npm
npm http GET https://registry.npmjs.org/npm/-/npm-1.1.24.tgz
npm http 404 https://registry.npmjs.org/npm/-/npm-1.1.24.tgz
npm ERR! Error: shasum check failed for /tmp/npm-1338882388006/1338882388006-0.6075703264214098/tmp.tgz
npm ERR! Expected: e7523bb997bd4af19a95f02848e805ab9820c442
npm ERR! Actual: c9de0f9499b0a8db7475a87b0586fe0b83472313
npm ERR! at /usr/local/lib/node_modules/npm/lib/utils/sha.js:25:20
@cha0s
cha0s / gist:2946163
Created June 18, 2012 00:29
TexTy UI 2.0
# jQuery.
$ = jQuery
# The slot where the next guessed letter will fall.
guessSlot = 0
# The prefix necessary to keep the letter lists centered.
prefix = 2
# Triggered when a guess is submitted.
@cha0s
cha0s / gist:2975596
Created June 22, 2012 22:43
mmm, coffee
app.register(
'.html'
compile: (source, options) ->
if typeof source isnt 'string' then source else
(options) ->
mustache.to_html(
source
<?php
// This:
$slides = array(
"http://local.dh2i.com/images/slides/slide1.png",
"http://local.dh2i.com/images/slides/slide2.png",
"http://local.dh2i.com/images/slides/slide3.png",
"http://local.dh2i.com/images/slides/slide4.png",
);
<?php
function base_url() {
return (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . '/';
}
function path_parts() {
return array_filter(explode('/', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)));
}
@cha0s
cha0s / gist:3033492
Created July 2, 2012 14:20
Dialogue syntax
Man:
Hey! HEY! Will you help me?!
Decide: Will you help him?
No:
Man:
:(...
// array = [
// "#{value.candidates[0]}:#{value.index}"
// value.argTypes.map (argType) -> {V: [newCustomValue argType]}
// ]
array->Set(0, String::New((value.candidates[0] + ":" + value.index).toAscii()));
Handle<Array> args = Array::New();
for (int i = 0; i < value.argTypes.length(); i++) {
Handle<Array> a = Array::New();
function _get_open_close($date,&$open,&$close, $lid){
$day_of_week = strtolower(date('l',$date));
$times = db_fetch_array(db_query("
SELECT open_$day_of_week as open, close_$day_of_week as close
FROM spaces_locations
WHERE lid = %d", $lid
));
$open = strtotime($times['open']);