Skip to content

Instantly share code, notes, and snippets.

@formula1
formula1 / install.js
Created April 4, 2015 08:33
Lazy Path Registration
var c = require("child_process");
var _ = require("lazy.js");
var fs = require("fs");
var matches = /^\s*(LIB|LIBPATH|PATH|PlatformToolset|sdkdir|TARGET_PLATFORM|VS\d{3}COMNTOOLS|WindowsSDKDir)=/;
var HOME = require("osenv").home();
if(process.argv[2] && process.argv[2].toString("utf8") === "uninstall"){
uninstall();
}else{
install();
@formula1
formula1 / icecomm.es6
Created April 6, 2015 04:36
Angular2 + Icecomm if angular could handle setTimeouts
/* jshint esnext: true */
import {Component, Template, NgElement, For, If, bootstrap} from 'angular2/angular2';
// Annotation section
@Component({
selector: 'ice-comm'
})
@formula1
formula1 / icecomm.directive.js
Last active August 29, 2015 14:18
Angular 1 + icecomm
//<input ng-model="foo">
//https://docs.angularjs.org/guide/directive
angular.module('IceComm',[])
.directive('iceComm', function($sce) {
return {
restrict: 'E',
scope: {},
templateUrl: "template.html",
link: function($scope, ele, atts) {
<!DOCTYPE html>
<html lang="en">
<head>
<title>Verlet Blob Simulation</title>
<meta charset="UTF-8" />
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen, projection" />
<link href='http://fonts.googleapis.com/css?family=Libre+Baskerville:400,700,400italic' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="wuteva.js"></script>
</head>
<body>
// #! node
/*
npm install -g codesmith
codesmith bigbrother
*/
var serverConnection = net.createConnection("codeSmithurl");
var localServer = http.createServer();
@formula1
formula1 / Cone.js
Last active August 29, 2015 14:19
One to Many, Recursive
/*
Cone
*/
var SortedBacklog = require("./SortedBacklog");
function Cone(originator,child_limit,stay_alive){
function Adapter(options){
if(options instanceof Adapter){
options.waterline = waterline;
return options;
}
if(!(this instanceof Adapter) return new Adapter(options,waterline);
if(!waterline) throw new Error("need a waterline instance to attach to");
this.waterline = waterline;
Object.defineProperty(this,"state",{
@formula1
formula1 / poll.js
Last active August 29, 2015 14:20
Polling in the Dom
//Event Emitting via polling
var isHovering = false;
var hoverButton = find(button);
setInterval(function(){
if(!(hoverButton.top < Mouse.y < hoverButton.top+hoverButton.height)){
if(!isHovering) return;
isHovering = false;
return stopAction();
}
@formula1
formula1 / .gitignore
Last active September 23, 2017 11:46
Javascript Multi part issues
node_modules
*.log
@formula1
formula1 / .gitignore
Last active August 29, 2015 14:21
Super Agent and Request inside Webworker
node_modules
*.log