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 / class.coffee
Last active Aug 29, 2015
Coffeescript template for jQuery Plugin + Class.
View class.coffee
class @Awesome
defaults:
isItAwesome: true
constructor: (element, options) ->
@element = $ element
@options = $.extend { }, @defaults, options
setup.call @
@mkempe
mkempe / table.tex
Last active Aug 29, 2015
Table with „tabulary“ and line breaks
View table.tex
%\usepackage{longtable}
%\usepackage{tabulary}
\newcommand{\cellOneOne}{ \textbf{Foobar} }
\newcommand{\cellOneTwo}{ \textbf{Foobar} }
\newcommand{\cellOneThree}{ \textbf{Foobar} }
% ----- ----- ----- ----- ----- ----- ----- ----- -----
View static-site-generators-in-ruby.txt
* nanoc (http://nanoc.stoneship.org)
* Jekyll (http://github.com/mojombo/jekyll)
* Serve (http://github.com/jlong/serve)
* Webby (http://webby.rubyforge.org)
View location-based-goodness-in-ruby.txt
* Graticule (http://github.com/collectiveidea/graticule)
* geokit-gem (http://github.com/andre/geokit-gem)
* geokit-rails (http://github.com/andre/geokit-rails)
View encoding_kung_fu.rb
#!/usr/bin/env ruby
require 'find'
Find.find(Dir.getwd) do |file| # Get current working directory and iterate over each file
next if file.include?('.svn') # Ignore svn files
system "file -I '#{file}'" # Print file information via file command
end
@mkempe
mkempe / copyFooAction
Created Nov 1, 2011
Copy function to clone an existing object in Extbase.
View copyFooAction
<?php
// → http://answerpot.com/showthread.php?463705-Cloning%20Model%20and%20add%20to%20repository
public function copyFooAction(Tx_Foo_Domain_Model_Foo $foo) {
$propertyMapper = t3lib_div::makeInstance('Tx_Extbase_Property_Mapper'); // Create new Tx_Extbase_Property_Mapper
$propertyMapper->injectReflectionService(t3lib_div::makeInstance('Tx_Extbase_Reflection_Service'));
$newFoo = new Tx_Foo_Domain_Model_Foo();
$attributes = array('foo',
'bar'
@mkempe
mkempe / multiple_ajax_request_with_jquery.js
Created Feb 18, 2012
Multiple Ajax request with jQuery
View multiple_ajax_request_with_jquery.js
var queue = [];
$.each(foobars, function(i, foobar) { // Built up queue
queue.push($.getJSON(
'http://foobar.com/foo.js', // URL
{ foo: foobar.bar }, // Params
function(data) { // Callback
# ...
));
});
@mkempe
mkempe / capybara_extensions.rb
Created Jul 18, 2012
Testing rspec views with capybara
View capybara_extensions.rb
# encoding: utf-8
module RSpec
module Support
module Views
module CapybaraExtensions
def rendered
Capybara.string(@rendered)
end
View gist:3799263
var selector = angular.element($(".ng-scope")[0]);
var scope = selector.scope();
var grid = scope.$$childTail.grid;
$.each(grid, function(i, row) {
$.each(row, function(j, element) {
element.solve();
});
});
@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.