Skip to content

Instantly share code, notes, and snippets.

@janv
janv / Assetfile.rb
Created January 14, 2013 10:26 — forked from jondot/Assetfile
require 'rake-pipeline-web-filters'
output "public"
class Rake::Pipeline::DSL::PipelineDSL
def production?
ENV['RAKEP_MODE'] == 'production'
end
end
Erma
Test2
Erma
Test2
@janv
janv / change_watcher.js.coffee
Created August 8, 2012 13:28
CoffeeScript/Backbone recursive change watcher
define [
'underscore'
], (_) ->
# Support for listening to change events of attributes through multiple indirection.
class ChangeWatcher
# The initialTarget becomes the first event dispatcher and also the calling context of the callback.
# It is usually initialized with `this`. The initialChain is an array of attribues to follow.
# Each attribute is looked for in its predecessor.
# The callback is called in the context of initialTarget and receives as parameters the old and
@janv
janv / button.sass
Created July 4, 2012 20:28
SASS Button Link
a:hover
-moz-box-shadow: inset 0px 1px 0px 0px #ffffff
-webkit-box-shadow: inset 0px 1px 0px 0px #ffffff
box-shadow: inset 0px 1px 0px 0px #ffffff
background: -webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf) )
background: -moz-linear-gradient( center top, #ededed 5%, #dfdfdf 100% )
//filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#dfdfdf')
background-color: #ededed
@janv
janv / penny-arcade-keyboard-nav.user.js
Created June 7, 2012 10:13
Penny Arcade Comic Keyboard Nav UserJS for Chrome
// ==UserScript==
// @name Penny Arcade Keyboard Navigation
// @namespace http://jan.varwig.org
// @description Flip through pages with Left and Right key on your keyboard
// @match http://*.penny-arcade.com/comic*
// ==/UserScript==
(function(){
document.addEventListener("keyup", function(event){
if (event.keyCode == 37) {
@janv
janv / save_state.coffee
Created March 21, 2012 18:00
Save Query parameters to location.href
save_state = (stateInfo) ->
currentState = {}
for term in window.location.href.split(/\?|&/)
[key, value] = term.split('=')
continue unless value?
currentState[key] = decodeURIComponent(value)
for key, value of stateInfo
if value?
@janv
janv / keywords.txt
Created February 24, 2012 21:00
Hackup Clean Code keywords
Robert C. Martin / Uncle Bob
https://sites.google.com/site/unclebobconsultingllc/home/articles
http://butunclebob.com/ArticleS.UncleBob
http://www.objectmentor.com/resources/publishedArticles.html
http://confreaks.com/videos/759-rubymidwest2011-keynote-architecture-the-lost-years
http://www.viddler.com/v/6726f23c
http://www.viddler.com/v/914a911f
Bücher bei Amazon
@janv
janv / nginx_error_rate.py
Created February 16, 2012 11:21 — forked from eykd/nginx_error_rate.py
Munin plugin for displaying error rates from Nginx
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""nginx_error_rate -- Munin plugin to report the error rate in an access log.
The access log defaults to `/var/log/nginx/access.log`. This may be
customized with the following stanza in your munin plugin conf:
[nginx_error_rate]
env.access_log /path/to/access.log
"""
@janv
janv / application.rb
Created February 15, 2012 13:30 — forked from mcmire/application.rb
Integrating the Logging framework into your Rails 3 app
#-----------------------------------------------------------------------------------------------
# config/application.rb
#-----------------------------------------------------------------------------------------------
require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(:default, Rails.env) if defined?(Bundler)
# Bring in the Railtie that will set Rails' various logger variables to
# instances of Logging::Logger instead of Rails' built-in ActiveSupport::BufferedLogger.