Skip to content

Instantly share code, notes, and snippets.

View bunnymatic's full-sized avatar
💭
writing computer programs

Mr Rogers bunnymatic

💭
writing computer programs
View GitHub Profile
__from_exercism_config() {
COMPREPLY=()
local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=($(compgen -W 'current demo fetch login logout peek restore submit unsubmit whoami help' -- $cur))
}
complete -F __from_exercism_config -o default exercism
@bunnymatic
bunnymatic / container.html
Last active August 29, 2015 13:56
js flash plugin
<div id="fixture">
<div class="container">
</div>
<div class="container">
</div>
</div>
@bunnymatic
bunnymatic / clock.js
Last active August 29, 2015 13:57
cordova clock
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
bunnymatic / Gemfile
Last active August 29, 2015 14:05
git bumper playtime
source "https://rubygems.org"
gem 'git'
@bunnymatic
bunnymatic / index.html
Created November 21, 2014 22:31
html with jquery and lodash
<html>
<head>
</head>
<body>
</body>
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
</html>
@bunnymatic
bunnymatic / a.md
Last active August 29, 2015 14:16 — forked from shamus/a.md

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
bunnymatic / CSS animate a delete button.markdown
Created July 31, 2015 23:56
CSS animate a delete button
@bunnymatic
bunnymatic / jquery.cachedDataService.js
Last active August 29, 2015 14:27
jQuery Cached Ajax Data Service
window.CachedDataService = {
inProgress: {
},
ajax: function(ajaxOptions) {
var key = ajaxOptions.url + (JSON.stringify(ajaxOptions.data || ''))
if (this.inProgress[key]) {
return this.inProgress[key];
}
else {
@bunnymatic
bunnymatic / safe_logger.js
Created November 12, 2010 01:11
Provide a tiny module that will allow for safe logging to console for browsers that allow it. For those that don't, don't log anything. Easily turned off with a debug switch which can be server generated (depending on environment dev/staging/prod) or no
var L = window.SafeLogger = window.SafeLogger || {};
//
// from server or on a specific page you want console data
// L.__debug__ = true
//
L.log = function() {
if (window.console && L.__debug__) {
// TODO: Chrome doesn't let us call apply on console.log.
// Interpolate variable arguments manually and construct
// a single-argument call to console.log for Chrome.
@bunnymatic
bunnymatic / history search for bash
Created December 8, 2010 17:49
find that old command that you ran a while back
alias lookfor="history | grep"