Skip to content

Instantly share code, notes, and snippets.

@mbildner
mbildner / boardFactory.html
Last active August 29, 2015 14:06
Playing with factories
<html>
<head>
<title>target</title>
<style type="text/css">
div.target {
width: 400px;
height: 400px;
background-color: red;
transition: background-color 1s;

Just a test

Also a test

OMG SO AM I


var cluster = require('cluster');
if (cluster.isWorker) {
console.log('Worker ' + process.pid + ' has started.');
// Send message to master process.
process.send({msgFromWorker: 'This is from worker ' + process.pid + '.'})
// Receive messages from the master process.
@mbildner
mbildner / gist:c0486dec166444bf366a
Last active August 29, 2015 14:05
clean/dirty branch name
LIGHT_GRAY="\[\033[0;37m\]"; BLUE="\[\033[1;36m\]"; RED="\[\033[0;31m\]"; LIGHT_RED="\[\033[1;31m\]";
GREEN="\[\033[0;32m\]"; WHITE="\[\033[1;37m\]"; LIGHT_GRAY="\[\033[0;37m\]"; YELLOW="\[\033[1;33m\]";
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \(\1\)/';
}
function parse_git_status {
git status 2> /dev/null | grep 'working directory clean' | wc -l;
}
function check_git_changes {
@mbildner
mbildner / tokenizer.js
Last active August 29, 2015 14:04
clean tokenizer
var str = "users[allUsers['123124'].username].first";
var allUsers = {
'123124': {username: 'mbildner'}
};
var users = {
'mbildner': {
first: 'moshe',
// During build, delete everything between start and end tags, keeping things safely scoped
// This exists for Grunt, and seems relatively easy to port to Gulp.
// https://github.com/philipwalton/grunt-strip-code/
(function hasPrivateFunctions (window) {
this.isPublicFunction = isPublicFunction;
function isPublicFunction () {
return 'I am a public function';
<html ng-app="app">
<head>
<title>ng dropdown</title>
<!-- <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"></link> -->
<style>
mb-select {
display: block;
background-color: lime;
width: 40px;
<html ng-app="app">
<head>
<title>Datepicker</title>
</head>
<body>
<date-range-picker
startDate="04-15-1989"
endDate="06-12-2001"
>
@mbildner
mbildner / plus_overload
Created February 28, 2014 00:22
operator overloading js
<html>
<head>
<title></title>
</head>
<body>
<script>
function Person (first, last) {
this.first = first;
this.last = last;
<html>
<head>
<style type="text/css">
path.link {
fill: none;
stroke: lime;
stroke-width: 2px;
}
circle {