Add this to your path and make sure to chmod u+x
each of them. Then you can run:
count Hello World
# Outputs:
# characters: 11
# spaces: 2
#PROMPT STUFF | |
GREEN=$(tput setaf 2); | |
YELLOW=$(tput setaf 3); | |
WHITE=$(tput setaf 7) | |
function git_branch { | |
# Shows the current branch if in a git repository | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ \(\1\)/'; | |
} | |
var colors = [ | |
'rgb(30, 104, 35)', 'rgb(68, 163, 64)', 'rgb(140, 198, 101)', 'rgb(214, 230, 133)', 'rgb(238, 238, 238)' | |
]; | |
var days = $('#calendar-graph').find('rect.day'); | |
days.css({ | |
fill: colors[4] | |
}); | |
days.on('click', function(e) { | |
e.stopPropagation(); | |
$this = $(this); |
Some snippets for Chrome that I've made or found/modified and thought were useful.
# Put this in .git/hooks/ | |
#!/bin/bash | |
PROJECT_ROOT=$(git rev-parse --show-toplevel) | |
CMD="${PROJECT_ROOT}/hooks/pre-commit.js" | |
eval ${CMD} |
/** @jsx React.DOM */ | |
'use strict'; | |
var React = require('react'); | |
var BuildBadge = React.createClass({ | |
propTypes: { | |
owner: React.PropTypes.string.isRequired, | |
repo: React.PropTypes.string.isRequired, | |
branch: React.PropTypes.string |
var utils = { | |
PropTypes: { | |
objectWith: function(options) { | |
return objectWithFn(options, false); | |
} | |
} | |
}; | |
utils.PropTypes.objectWith.isRequired = function(options) { | |
return objectWithFn(options, true); |
// through2 is a thin wrapper around node transform streams | |
var through = require('through2'); | |
var gutil = require('gulp-util'); | |
var _ = require('lodash-node'); | |
var PluginError = gutil.PluginError; | |
var PLUGIN_NAME = 'gulp-logit'; | |
// plugin level function (dealing with files) | |
function gulpLogIt(log) { |
(function() { | |
'use strict'; | |
_.mixin({ | |
startsWith: function startsWithMixin(s1, s2) { | |
return startsOrEndsWith(_.first, s1, s2); | |
}, | |
endsWith: function endsWithMixin(s1, s2) { | |
return startsOrEndsWith(_.last, s1, s2); | |
} | |
}); |