Skip to content

Instantly share code, notes, and snippets.

Maik Kempe mkempe

Block or report user

Report or block mkempe

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mkempe
mkempe / my_app.conf
Created Sep 25, 2014
RVM, Wrapper, Unicorn, Init.d
View my_app.conf
NAME="My App"
APP_PATH="/var/apps/my_app/current"
UNICORN="/usr/local/rvm/wrappers/my_app/unicorn_rails"
ENVIRONMENT="production"
@mkempe
mkempe / einbeinige.rb
Created Oct 19, 2011
Using ActiveRecord / Nokogiri for xml → database convert action
View einbeinige.rb
# encoding: utf-8
require 'active_record'
require 'mysql2'
require 'nokogiri'
require 'yaml'
ROOT = File.join(File.dirname(__FILE__), '..')
# ActiveRecord::Base.logger = Logger.new('log/debug.log')
View mixins.sass
@mixin arrow($color: white, $padding: 0 0 0 pem(15))
background: transparent url('/images/bundle/icons/arrows/#{$color}.gif') no-repeat left center
padding: $padding
@mixin underscore($border-color: #FFF, $border-bottom-width: 1px, $padding: 0 0 pem(1))
display: inline-block
.label
border-bottom: #{$border-bottom-width} solid transparent
padding: $padding
@mkempe
mkempe / gist:5804668
Created Jun 18, 2013
Find path of installed gem through ruby.
View gist:5804668
specs = Gem.latest_spec_for 'foo'
puts specs.gem_dir
View forEach.coffee
Handlebars.registerHelper 'forEach', (array, options) ->
return options.inverse @ if (options.inverse && !array.length)
array.map((item, index) ->
item.$index = index
item.$first = index is 0
item.$last = index is array.length - 1
options.fn item
).join ''
View faker.rb
#!/usr/bin/env rake
# encoding: utf-8
require 'faker'
namespace :faker do
desc '“Fakes” name'
task :name do
puts Faker::Name.name
end
View gist:4148951
#!/usr/bin/env monit
check host foobar.com with address foobar.com
group www
group foobar.com
if failed icmp type echo with timeout 5 seconds for 1 cycles then alert
if failed port 80 protocol http timeout 5 seconds for 1 cycles then alert
if failed url http://foobar.com timeout 5 seconds for 1 cycles then alert
@mkempe
mkempe / gist:4135568
Last active Oct 13, 2015
Vaading monkey patching at its best.
View gist:4135568
$('.v-app').livequery(function() {
$(this).resize(function(e) {
if ($.browser.msie && parseInt($.browser.version, 10) <= 8) {
vaadin.forceLayout();
}
});
});
@mkempe
mkempe / gist:3934476
Created Oct 22, 2012
Scala / MacPorts
View gist:3934476
$ port install scala2.9
$ port install scala_select
$ port select --set scala scala2.9
@mkempe
mkempe / gist:3871966
Created Oct 11, 2012
Capistrano: Deploy tag
View gist:3871966
set :branch do
default_tag = `git tag`.split("\n").last
tag = Capistrano::CLI.ui.ask "Tag to deploy [#{default_tag}]: "
tag = default_tag if tag.empty?
tag
end
You can’t perform that action at this time.