Skip to content

Instantly share code, notes, and snippets.

Michael Kessler netzpirat

Block or report user

Report or block netzpirat

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
angular.module('project', ['projectServices'])
.config ($routeProvider) ->
templateUrl: 'partials/login.html',
controller: LoginCtrl)
templateUrl: 'partials/assignments.html',
controller: AssignmentListCtrl)
.otherwise(redirectTo: '/login')
netzpirat / fs_change.rb
Created Dec 29, 2011
Listen to file changes with Guard
View fs_change.rb
require 'guard/listener'
listener = Guard::Listener.select_and_init({
watchdir: '/tmp',
watch_all_modifications: true
listener.on_change do |files|
puts "File change: #{ files.join(',') }"
netzpirat / gist:1497369
Created Dec 19, 2011
Create promotion code per collection for Shopify
View gist:1497369
# Save your promotion codes in code.csv
require 'capybara'
require 'csv'
session =
session.visit ''
session.fill_in 'login', :with => 'YOURLOGIN'
session.fill_in 'password', :with => 'YOURPASSWORD'
session.click_button 'Sign In'
netzpirat / validation.js
Created Sep 12, 2011 — forked from mikeolivieri/validation.js
Backbone Model Validation
View validation.js
_.extend(Backbone.Model.prototype, Backbone.Events, {
errors: [],
validate: function (attrs) {
this.errors = [];
var model = this;
netzpirat /
Created Jun 23, 2011
Model based form validation and row editor for Ext JS 4
# The form adds model based validation to the form
# and it updates the 'reset' and 'save' buttons from the owning
# form panel according to the dirty and validity status of the form.
# @author Michael Kessler
Ext.define 'Ext.ux.form.Basic',
extend: 'Ext.form.Basic'
netzpirat /
Created Jun 1, 2011 — forked from kossnocorp/
MacVim with Drawer compile manual

Clone & Build

curl | sh
netzpirat /
Created May 4, 2011
Return nothing from a CoffeeScript function
# Everything is an Expression
greeting = 'Hi CoffeeScripter'
# Expect it's undefined
greeting = 'Hi CoffeeScripter'
return undefined
netzpirat / embed.rb
Created Mar 29, 2011
ActiveRecord embedding
View embed.rb
module ActiveRecord
# Allows embedding of ActiveRecord models.
# Embedding other ActiveRecord models is a composition of the two
# and leads to the following behaviour:
# - Nested attributes are accepted on the parent without the _attributes suffix
# - Mass assignment security allows the embedded attributes
# - Embedded models are destroyed with the parent when not appearing in an update again
netzpirat / json_helper.rb
Created Mar 3, 2011
The Sencha responder adds generic JSON response handling for the Ext JS framework.
View json_helper.rb
require 'siren'
# The JsonHelper adds a possibility to query JSON data with a simple query language.
# Read more about the Siren JSONQuery implementation at:
# @author Michael Kessler
module JsonHelper
def json(query)
netzpirat / widgets.rb
Created Dec 29, 2010
Testing apotomo widgets with RSpec
View widgets.rb
module RSpec::Rails
module WidgetExampleGroup
extend ActiveSupport::Concern
extend RSpec::Rails::ModuleInclusion
include RSpec::Rails::RailsExampleGroup
include ActionView::TestCase::Behavior
include RSpec::Rails::ViewAssigns
include RSpec::Rails::Matchers::RenderTemplate
include RSpec::Rails::BrowserSimulators
You can’t perform that action at this time.