Skip to content

Instantly share code, notes, and snippets.

Andreas Brekken abrkn

Block or report user

Report or block abrkn

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
@abrkn
abrkn / index.js
Created Nov 4, 2014
requirebin sketch
View index.js
// example using the raf module from npm. try changing some values!
var requestAnimationFrame = require("raf")
var canvas = document.createElement("canvas")
canvas.width = 500
canvas.height = 500
document.body.appendChild(canvas)
var context = canvas.getContext("2d")
View gist:2bfca219d53a281f18de
CREATE SCHEMA core;
CREATE DOMAIN currency_id AS TEXT
CHECK (LENGTH(VALUE) > 0);
CREATE TABLE currency (
currency currency_id PRIMARY KEY
);
CREATE DOMAIN amount AS NUMERIC(20, 8)
View db.sql
CREATE SCHEMA core;
CREATE DOMAIN currency_id AS TEXT
CHECK (LENGTH(VALUE) > 0);
CREATE TABLE currency (
currency currency_id PRIMARY KEY
);
CREATE DOMAIN amount AS NUMERIC(20, 8)
View nfs-mount-boot2docker.sh
#!/usr/bin/env bash
############################################################################
#
# Use NFS for boot2docker
#
# See: https://quip.com/EDYLAAfuup5M (no login needed)
# See also: https://github.com/boot2docker/boot2docker/issues/587#issuecomment-66935011
# See also: http://support.apple.com/en-us/HT202243
# See also: https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man5/exports.5.html
View swoop-1.js
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
console.log('whoa!');
window.browserifiedCrypto = require('crypto');
console.log('coulda been worse');
},{"crypto":7}],2:[function(require,module,exports){
},{}],3:[function(require,module,exports){
/*!
View gist:1869253
internal void RenderParallel(Scene scene, CancellationToken cancellationToken)
{
int[] rgb = new int[screenWidth * screenHeight];
var pixelsQuery =
from y in
Enumerable.Range(0, screenHeight).AsParallel()
.WithCancellation(cancellationToken)
let recenterY = -(y - (screenHeight / 2.0)) / (2.0 * screenHeight)
select from x in Enumerable.Range(0, screenWidth)
View gist:2688059
PS C:\users\andy\git\striim> ls
Directory: C:\users\andy\git\striim
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 11.05.2012 14:54 docs
d---- 13.05.2012 13:56 lib
View gist:2688939
var process = require('process');
module.exports = function(capacity) {
var semaphore = {
capacity: capacity,
current: 0,
queue: [],
acquire: function(task) {
if (semaphore.current == semaphore.capacity) {
return queue.push(task);
View gist:2692366
Error: Cannot find module 'html'
at Function._resolveFilename (module.js:332:11)
at Function._load (module.js:279:25)
at Module.require (module.js:354:17)
at require (module.js:370:17)
at View.templateEngine (C:\users\andy\git\striim\lib\escaped-server\node_modules\phantom\node_modules\express\li
ew\view.js:134:38)
at Function.compile (C:\users\andy\git\striim\lib\escaped-server\node_modules\phantom\node_modules\express\lib\v
js:68:17)
at ServerResponse._render (C:\users\andy\git\striim\lib\escaped-server\node_modules\phantom\node_modules\express
View gist:2694037
Shows:
{
"_id" : "tt0108778",
"airDate" : "1996-01-07",
"cover" : "0a78f3d53bb9124930b677c6f3a522cc",
"crawledAt" : ISODate("2012-05-07T11:31:16.133Z"),
"episodesCrawledAt" : ISODate("2012-05-07T11:31:23.411Z"),
"imdb" : "tt0108778",
"keywords" : [
"friends",
You can’t perform that action at this time.