Skip to content

Instantly share code, notes, and snippets.

oren

Block or report user

Report or block oren

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@oren
oren / index.js
Created Dec 4, 2014
requirebin sketch
View index.js
var Chartist = require("chartist")
/* Add a basic data series with six labels and values */
var data = {
labels: ['1', '2', '3', '4', '5', '6'],
series: [
{
data: [1, 2, 3, 5, 8, 13]
}
]
View _README.md

JankyBrowser

The only cross-platform browser that fits in a Gist!

One line install. Works on Linux, MacOSX and Windows.

Local Install

$> npm install http://gist.github.com/morganrallen/f07f59802884bcdcad4a/download
@oren
oren / css
Last active Aug 29, 2015
css
View css
body {
color: red;
color: blue;
}
View keybase.md

Keybase proof

I hereby claim:

  • I am oren on github.
  • I am oren (https://keybase.io/oren) on keybase.
  • I have a public key whose fingerprint is 411A 3267 0515 3D9A D33F 10DD 73BF 6EA3 1BE4 B582

To claim this, I am signing this object:

View auth
var http = require('http');
http.createServer(function (req, res) {
if (!authorized(req, res, ['admin'])) {
res.statusCode = 401;
res.end("You don't have permissions");
}
res.statusCode = 200;
res.end('Welcome back!');
@oren
oren / gist:6980348
Created Oct 14, 2013
testling issue
View gist:6980348
on iMac:
$ browserify test.js | testling
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:980:11)
at Process.ChildProcess._handle.onexit (child_process.js:771:34)
View gist:6803198
diff --git a/tests/models/listing_test.js b/tests/models/listing_test.js
index 14c3d14..c04b7a6 100644
--- a/tests/models/listing_test.js
+++ b/tests/models/listing_test.js
@@ -10,6 +10,7 @@ var dict = {
'Name': 'CPK',
'HeadingText': 'Restaurants',
'PrimaryCollection': 'food',
+ 'Personalization.TotalNotes': '10'
};
View router.js
// The server's main routes function
//
// Supports the following end-points:
// POST /push
// POST /register
// POST /register.php
// GET /health
// GET /health.txt
function router(config, req, res) {
@oren
oren / simulator.js
Created Jul 17, 2012
functional test
View simulator.js
// Elphi System Simulator in Node.js
// TODO: check failure case
// 0) request times
// 0) server hangs
// 0) HTTP request timeouts where we never get a response
// 1) no api
// 2) no proxy on
// 3) plugs unresponsive
View gist:999737
goal:
-----
return an array of names that start with j and sorted by id
["josh", "jordan"]
arr = [{name: 'jordan',id: 3}, {name: 'josh',id: 1}, {name: 'rob',id: 5}]
1)
arr.select!{ |a| a[:name][/\Aj/] }
You can’t perform that action at this time.