Skip to content

Instantly share code, notes, and snippets.

View bellentuck's full-sized avatar

Ben Ellentuck bellentuck

  • New York, NY
View GitHub Profile
@bellentuck
bellentuck / basicBootstrapHTMLTemplate.html
Created October 18, 2016 19:25 — forked from joechan3/basicBootstrapHTMLTemplate.html
joechan3's Basic Bootstrap Template using CDNs (from Lynda.com - Course: Bootstrap Essentials Training-Ray Villalobos)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
<!--Picturefill-->
body {
font-family: 'HelveticaNeue-UltraLight', 'Helvetica Neue UltraLight', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-weight: 100;
letter-spacing: 1px;
}
@bellentuck
bellentuck / undirected-graph.js
Created January 31, 2017 17:51 — forked from Cfeusier/undirected-graph.js
Simple undirected graph implementation in JavaScript
var Graph = function() {
this.nodes = {};
this.edges = {};
};
Graph.prototype.addNode = function(node) {
this.nodes[node] = node;
};
Graph.prototype.contains = function(node) {
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Hello d3 World</title>
<script type="text/javascript" src="http://d3js.org/d3.v2.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
copyright: mit
copyright: mit
copyright: mit
@bellentuck
bellentuck / PredicateCombinators.js
Created December 14, 2017 16:46
JS predicate combinator boilerplate. Riffing off Jack Firth's "Predicates in Javascript"
// Firth: https://codepen.io/Universalist/post/predicates-in-javascript
(function(predicateCombinators) {
// CPL predication
function and(p1, p2) {
return function(x) {
return p1(x) && p2(x);
}
@bellentuck
bellentuck / vector.js
Created January 23, 2018 03:30 — forked from kj786/vector.js
Implement getters and setters to ease access to private members of Vector.
/*global console: true */
"use strict";
/*
A vector type
Write a constructor Vector that represents a vector in two-dimensional
space. It takes x and y parameters (numbers), which it should save to
properties of the same name.
Give the Vector prototype two methods, plus and minus, that take another vector as a parameter and return a new vector that has the sum
or difference of the two vectors’ (the one in this and the parameter) x
and y values.
@bellentuck
bellentuck / types.js
Created January 24, 2018 19:14 — forked from pbakondy/play.js
Play with Object.prototype.toString.call()
// under Google Chrome 36
Object.prototype.toString.call([])
// "[object Array]"
Object.prototype.toString.call(function(){})
// "[object Function]"
Object.prototype.toString.call({})
// "[object Object]"
Object.prototype.toString.call(null)
// "[object Null]"