Skip to content

Instantly share code, notes, and snippets.

View mkempe's full-sized avatar
💭
I may be slow to respond.

Maik Kempe mkempe

💭
I may be slow to respond.
View GitHub Profile
@mkempe
mkempe / my_app.conf
Created September 25, 2014 00:06
RVM, Wrapper, Unicorn, Init.d
NAME="My App"
APP_PATH="/var/apps/my_app/current"
UNICORN="/usr/local/rvm/wrappers/my_app/unicorn_rails"
ENVIRONMENT="production"
@mkempe
mkempe / table.tex
Last active August 29, 2015 13:57
Table with „tabulary“ and line breaks
%\usepackage{longtable}
%\usepackage{tabulary}
\newcommand{\cellOneOne}{ \textbf{Foobar} }
\newcommand{\cellOneTwo}{ \textbf{Foobar} }
\newcommand{\cellOneThree}{ \textbf{Foobar} }
% ----- ----- ----- ----- ----- ----- ----- ----- -----
@mkempe
mkempe / class.coffee
Last active August 29, 2015 13:56
Coffeescript template for jQuery Plugin + Class.
class @Awesome
defaults:
isItAwesome: true
constructor: (element, options) ->
@element = $ element
@options = $.extend { }, @defaults, options
setup.call @
@mkempe
mkempe / mixins.sass
Last active December 22, 2015 22:49
@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 June 18, 2013 11:35
Find path of installed gem through ruby.
specs = Gem.latest_spec_for 'foo'
puts specs.gem_dir
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 ''
@mkempe
mkempe / faker.rb
Created December 14, 2012 16:26
Faker
#!/usr/bin/env rake
# encoding: utf-8
require 'faker'
namespace :faker do
desc '“Fakes” name'
task :name do
puts Faker::Name.name
end
@mkempe
mkempe / gist:4148951
Created November 26, 2012 16:00
Monit Kung Fu
#!/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 October 13, 2015 03:57
Vaading monkey patching at its best.
$('.v-app').livequery(function() {
$(this).resize(function(e) {
if ($.browser.msie && parseInt($.browser.version, 10) <= 8) {
vaadin.forceLayout();
}
});
});
@mkempe
mkempe / gist:3934476
Created October 22, 2012 21:21
Scala / MacPorts
$ port install scala2.9
$ port install scala_select
$ port select --set scala scala2.9