Skip to content

Instantly share code, notes, and snippets.

writing computer programs

Mr Rogers bunnymatic

writing computer programs
View GitHub Profile
bunnymatic /
Last active Aug 29, 2015 — forked from shamus/

Communication between collaborating Directives

Directives man! While the they're literally the entry point into angular development (you can't get going without ng-app), many people starting out with Angular are hesistant to write their own because of the complexity associated with them. But once that initial hurdle is crossed their value as reusable components becomes indispensible.

Occasionally a complicated component will come along, one

bunnymatic / index.html
Created Nov 21, 2014
html with jquery and lodash
View index.html
<script src="//"></script>
<script src="//"></script>
bunnymatic / Gemfile
Last active Aug 29, 2015
git bumper playtime
View Gemfile
source ""
gem 'git'
bunnymatic / gist:a78deb0e3274af571916
Created Jul 9, 2014
who done it - git blame statistics
View gist:a78deb0e3274af571916
Hop into a shell and to the root directory of your project and run
git ls-tree --name-only -z -r HEAD -- $1 | xargs -0 -n1 git blame --line-porcelain | grep "^author "|sort|uniq -c|sort -nr
Then wait a bit. You get a nice sorted list of lines of code and author name.
Add it to your bash profile like this
whodunit() {
git ls-tree --name-only -z -r HEAD -- $1 | xargs -0 -n1 git blame --line-porcelain | grep "^author "|sort|uniq -c|sort -nr
bunnymatic / clock.js
Last active Aug 29, 2015
cordova clock
View clock.js
SummitClock = {
twoDigits: function(v) {
return ("0" + v).slice(-2);
updateTime: function() {
var c = document.getElementById('clock');
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var secs = now.getSeconds();
bunnymatic / myproject_s3.rb
Created Feb 28, 2014
Build signed read url for s3/aws access outside of the aws-sdk#url_for which doesn't like filenames with w/spaces
View myproject_s3.rb
module MyProject
class S3
def config
def url_for_read(path, opts)
expire_date = ( + opts[:expires]).to_i
request_string = "GET\n\n\n#{expire_date}\n/#{config[:bucket]}/#{path}"
hmac = OpenSSL::HMAC.digest(digest, config[:secret_access_key], request_string)
bunnymatic / container.html
Last active Aug 29, 2015
js flash plugin
View container.html
<div id="fixture">
<div class="container">
<div class="container">
View completion-exercism.bash
__from_exercism_config() {
COMPREPLY=($(compgen -W 'current demo fetch login logout peek restore submit unsubmit whoami help' -- $cur))
complete -F __from_exercism_config -o default exercism
bunnymatic / hot_stuff-1.rb
Last active Jan 2, 2016
active_model_conversion blog post assets
View hot_stuff-1.rb
# the hot stuff wrapper/presenter
class HotStuff
def items
@items ||=