Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View bumi's full-sized avatar

Michael Bumann bumi

View GitHub Profile
@bumi
bumi / bookmarklet.js
Last active August 29, 2015 13:56
This bookmarklet reorders the diff files in a github diff view. It tries to display the spec/test files directly after the actual code files. Add a new bookmark with the content of the bookmarklet.js file
javascript:(function(){$.each($('#files .js-details-container'), function(i, element) {var path = $(element).children('.meta').data('path'); if(!path.match(/_spec\.*$/)) { var extension_match = path.match(/\..*$/); if(extension_match) { var extension = extension_match[0]; var filename_match = path.match(/.*(\/.*)\..*$/); if(filename_match) { var filename = path.match(/.*(\/.*)\..*$/)[1]; var spec_path = filename + '_spec' + extension; var spec_dom = $('.meta[data-path$="' + spec_path + '"]').parent(); if(spec_dom.length > 0) { spec_dom.detach(); spec_dom.insertAfter(element); } } } }});})();
<!-- Begin MailChimp Signup Form -->
<link href="//cdn-images.mailchimp.com/embedcode/slim-081711.css" rel="stylesheet" type="text/css">
<style type="text/css">
#mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; width:400px;}
/* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
</style>
<div id="mc_embed_signup">
<form action="http://railslove.us4.list-manage.com/subscribe/post?u=b49716aaa1a57433ea4727e3f&amp;id=8c094634f4" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<label for="mce-EMAIL">Subscribe to the AfricaHackTrip mailing list</label>
@bumi
bumi / food.coffee
Created August 25, 2014 12:22
a hubot script that suggest you a place to go for food near your place. - no more discussions on where to go for lunch in the office. :)
# Description:
# hubot suggests a place to go for food
#
# Dependencies:
# node-foursquare-venues
#
# Configuration:
# configure your foursquare client id and secret and your location
#
# Commands:
@bumi
bumi / commit-messages.mdown
Created September 18, 2014 13:10
article about commit messages

A lot has been written about commit messages and what makes a good commit message - and why this is important. But still most developers could practice a bit more. This is a list from a quick search about commit messages with articles every developer should read.

[ingstagram image](javascript:document.location = $(".Frame.Image").attr("src");)

@bumi
bumi / transaction.json
Created October 29, 2014 14:40
ebics-box transaction json example
[
{
"sha": "4a4a74838ccfd7dadcb454be11a06cc6a9d3de7330f6c555e37853b7eb2e4526",
"date": "2014-10-10",
"entry_date": "2014-10-10",
"amount": 123.45,
"amount_in_cents": 12345,
"sign": 1,
"debit": false,
"credit": true,
require "redis"
redis = Redis.new
trap(:INT) {
redis.unsubscribe
puts 'bye'
exit
}
@bumi
bumi / gist:20856
Created October 29, 2008 22:57
nice bash alias for git push origin master
# jan's gitpush alias: http://railslove.com/weblog/2008/10/28/git-push-it-origin-master/#comments
alias gitpush=\
'open http://www.youtube.com/watch?v=BCV5yGKWjv4; \
git push origin master'
#!/usr/bin/env ruby
#actually I just wanted to try forking a gist :D
exit unless ARGV.size == 1
pids = %x[ps ax|grep #{ARGV[0]}|grep -v grep].split("\n").map{|line| line.strip.scan(/^\d+/).first.to_i} - [Process.pid]
if pids.any?
system "kill #{pids.join(' ')}"
puts "killed #{pids.size} #{ARGV[0]} instance(s)"
@bumi
bumi / gist:27085
Created November 20, 2008 16:03
fakebug - don't let console.log break your code on browsers without firebug
var fakebug = function() {
var firebug_methods = ["log", "info", "debug", "warn", "error", "assert", "dir", "dirxml", "trace", "group", "groupEnd", "time", "timeEnd", "profile", "profileEnd", "count"];
window.console = {};
for(var i=0;i<firebug_methods.length;i++) {
window.console[firebug_methods[i]] = function() {};
}
};
if(!window.console) { fakebug(); }