This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var exec = require('child_process').exec; | |
var suspend = require('suspend'); | |
var resume = suspend.resume; | |
suspend.run(function*(){ | |
// first determine the list of npm usernames to sync up to | |
var npmUsers = process.argv.slice(2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var vm = require('vm'); | |
var pathCode = process.binding('natives').path; | |
var sandbox = { | |
process: { | |
env: process.env, | |
cwd: process.cwd, | |
platform: 'win32' | |
}, | |
require: require, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="wpcom.js"></script> | |
<script> | |
// create a client WPCOM instance | |
var wpcom = WPCOM(); | |
// retrieve a listing of the most recent | |
// 5 posts on "en.blog.wordpress.com" | |
wpcom | |
.site('en.blog.wordpress.com') | |
.postsList({ number: 5 }, function(err, data) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Compile: | |
* Unix/OSX: gcc -o test test.c -ldl | |
* Windows via dlfcn-win32: cl.exe /I dlfcn-win32 dlfcn-win32\dlfcn.c test.c /Fetest.exe | |
*/ | |
#include <dlfcn.h> | |
#include <stdio.h> | |
int main () { | |
void *handle, *symbol; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var utility = ffi.Library('utility', { | |
'tesJson': ['void', ['string']] | |
}); | |
var obj = {'1': 'one', '2': 'two'}; | |
utility.tesJson(JSON.stringify(obj)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* TypeScript single-file compiler: | |
* | |
* $ node tsc-single-file.js < input.ts > output.js | |
* | |
* Avoids TypeScript attempting to compile an entire "project", | |
* so that a proper `make` target can be written. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var domPaste = require('dom-paste'); | |
console.log(domPaste); | |
var input = document.createElement('div'); | |
input.contentEditable = 'true'; | |
input.style.width='300px'; | |
input.style.height='100px'; | |
input.style.border='solid 1px black'; | |
document.body.appendChild(input); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
wcwidth.js: JavaScript Portng of Markus Kuhn's wcwidth() Implementation | |
======================================================================= | |
Copyright (C) 2012 by Jun Woong. | |
This package is a JavaScript porting of `wcwidth()` implementation | |
[by Markus Kuhn](http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c). | |
Permission is hereby granted, free of charge, to any person obtaining a copy of |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
my $file = "logo.png"; | |
my $length = -s $file; | |
print "Content-type: image/png\n"; | |
print "Content-length: $length \n\n"; | |
binmode STDOUT; | |
open (FH,'<', $file) || die "Could not open $file: $!"; | |
my $buffer = ""; | |
while (read(FH, $buffer, 10240)) { | |
print $buffer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ref = require('ref'); | |
var Struct = require('ref-struct'); | |
var ffi = require('ffi'); | |
// typedefs | |
var MPI_Datatype = 'int'; | |
var MPI_Comm = 'int'; | |
var MPI_Status = Struct({ | |
count: 'int', | |
MPI_SOURCE: 'int', |
OlderNewer