Skip to content

Instantly share code, notes, and snippets.

<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;
// 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';
@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',
@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 {
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.

Just a test

Also a test

OMG SO AM I


@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;
@mbildner
mbildner / sequentialTimeout.html
Last active August 29, 2015 14:09
sequential timeout library
<html ng-app="mbildner.timeout">
<head>
<title></title>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<script>
function isFunction (obj) {
return typeof obj === 'function';
}
@mbildner
mbildner / simple_http_server.bash
Created January 3, 2015 18:24
pserve bash profile
# start python simpleHTTPServer in current directory
function pserve {
if [[ -z $1 ]]; then
PYTHON_SERVER_PORT=8000
else
PYTHON_SERVER_PORT=$1
fi
python -m SimpleHTTPServer $PYTHON_SERVER_PORT
}
@mbildner
mbildner / gulpfile.js
Created January 11, 2015 18:00
merge gulp streams *IN ORDER*
/* jshint node: true */
'use strict';
var gulp = require('gulp');
var mainBowerFiles = require('main-bower-files');
var concat = require('gulp-concat');
var merge = require('gulp-merge');
gulp.task('all', function () {