Skip to content

Instantly share code, notes, and snippets.

View aristidb's full-sized avatar

Aristid Breitkreuz aristidb

  • Amsterdam, Netherlands
View GitHub Profile
function MyClass(x) {
this.value = x;
}
MyClass.prototype = {
'print': function() { print(this.value); }
};
var o = new MyClass("hello world");
var my_global = {};
var importer = new Importer(my_global);
assert(importer.container === my_global);
importer.load('XML')
var doc = my_global.XML.Document();
Foo = {
// ...
}
this.load = 2
function headers(str) {
var lst = str.split("\n");
var hdr = {};
hdr.__proto__ = null;
lst.forEach(function (x) {
if (!x.length)
return;
[ name, value ] = x.split(/\s*:\s*/, 2);
if (!hdr[name])
hdr[name] = value;
template<size_t (curl::*Method)(void *, size_t, size_t, void *)>
static size_t curl::c_handle_curl(void *ptr, size_t size, size_t nmemb, void *stream) {
curl *self = static_cast<curl*>(ptr);
return (self->*Method)(ptr, size, nmemb, stream);
}
foo ( &curl::c_handle_curl<&curl::method_name> );
suite_name = 'The big test suite'
test_foo = function() {
expect(2);
ok(1, "Check ok");
same([1,2],[3,2], "Arrays are the same");
}
/*
[execute in scope (new TestSuite)]
// checks if `c' is a space or a h-tab (see RFC 2616 chapter 2.2)
inline bool isspht(char c) {
return c == ' ' || c == '\t';
}
template<class Source, typename Char>
bool expect(Source &in, Char c) {
int t = boost::iostreams::get(in);
if(t == c)
return true;
boost::any environment::enumerate_start(int &n) {
n = 0; // We dont know how many
return boost::any(environ);
}
value environment::enumerate_next(boost::any &iter) {
char **env = boost::any_cast<char**>(iter);
if (*env == 0)
return value();
bin/
jsrepl
lib/
libflusspferd.so
libflusspferd-xml.so
flusspferd/
prelude.js
plugins/
libxml.so -> ../../libflusspferd-xml.so
libcurl.so
#!/bin/bash
cd /var/git/flusspferd.git
git remote update
git for-each-ref --format="%(refname)" refs/remotes/|while read ref
do
branch=$(echo $ref|sed -e 's/^refs\/remotes\/[^\/]*\//refs\/heads\//')
echo "$ref => $branch"
git push . $ref:$branch