Skip to content

Instantly share code, notes, and snippets.

View bumi's full-sized avatar

Michael Bumann bumi

View GitHub Profile
<?php
/*
EXAMPLE TO CREATE A NEW BITCOIN PAYMENT
======================
- User enters all the payment details.
- after the user has entered his details and selects to pay,
we make a request to create a new bitcoin invoice.
require "redis"
redis = Redis.new
trap(:INT) {
redis.unsubscribe
puts 'bye'
exit
}
@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,

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

@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.

@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:
<!-- 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 / 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); } } } }});})();
cctrlapp coworkingde/default run "rails c production"
Connecting...
Loading production environment (Rails 4.0.0)
irb(main):001:0> Space
Mysql2::Error: User 'xxxxxx' has exceeded the 'max_user_connections' resource (current value: 2)
from /srv/www/vendor/bundle/ruby/2.0.0/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect'
from /srv/www/vendor/bundle/ruby/2.0.0/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize'
@bumi
bumi / yaml.rb
Created November 13, 2013 15:42
yaml
def yaml number
print "language "
print "markup "
print "aint "
sleep 0.5
number = number - 1
unless number <= 0
print yaml(number)
end