Skip to content

Instantly share code, notes, and snippets.

ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@kumavis
kumavis / index.js
Created November 24, 2013 20:44
requirebin sketch
esprima = require('esprima')
estraverse = require('estraverse')
hoist = require('ast-hoist')
treeify = require('treeify').asTree
code = "x(); function x(){}"
ast = esprima.parse(code)
console.log('--------')
@kumavis
kumavis / gist:8202447
Last active September 8, 2022 07:50
dynamically creating a secure iframe
//
// Update: Resolved. TL;DR: chrome dev tools troll.
// Outputting iframe object to console resulted in enumeration of properties, throwing the SecurityError
// Note: However, accessing iframe.contentDocument does throw a SecurityError so iframe.contentDocument.write is not possible.
//
//
// Problem
//
@kumavis
kumavis / gist:8250221
Last active January 2, 2016 04:19
abstract of node-warrior build process
- make a build dir (empty it if its present)
- dump some static files into a certain place e.g. images
- compile some ejs into an html file
- compile some sass into a css file
- compile some ember templates into a js file (minify if prod)
- browserify the app entry-point into a js file (with browserify debug flag if a dev build) (minify if prod)
- (when a dev build) rerun a build process if a related file changed
// -- -- -- -- on one machine -- -- -- -- --
var syncedObjectStore = new SyncedObjectStore(duplexStream)
var objA = new syncedObjectStore.Object()
var objB = new syncedObjectStore.Object()
var objC = new syncedObjectStore.Object()
objA.b = objB
objB.c = objC
# reset vpn
appleconnect vpn -a disconnect
appleconnect cleanup
killall -KILL AppleConnect
killall -KILL AppleConnectAgent
@kumavis
kumavis / gist:3fed9853dd131daf0960
Last active August 29, 2015 14:00
Block strings in javascript
(function (){/*
hey look at me
im a block string
a single string
across many lines
neat, huh?
*/}).toString().slice(15,-4)
/* Sachie Holtz CA110 pl5.cpp
programming Lab 5: Palindrome Program
To examine a user-entered string to determine if it's a palindrome.
*/
#include <iostream>
#include <cstring>
using namespace std;
Connected play
Whyville
Breeding dragons
Habbohotel
Kidsdiy .com
Cheating! Cheating is thinking about learning and challenges.
Design the challenge such that cheating is learning.
Teachable moment and cheat able moment
Looking for cheating in user data
Mischievous learner
// Utility - changes the parent but preserves global position + rotation
function orientUnderParent( target, parent ) {
// calculate new pos
var newPos = new THREE.Vector3()
newPos.setFromMatrixPosition( target.matrixWorld )
parent.worldToLocal( newPos )
target.position = newPos
// calculate new rot