Skip to content

Instantly share code, notes, and snippets.


Martin Wawrusch mwawrusch

View GitHub Profile
View nodejs-server.js
ar http = require('http');
var fs = require('fs');
var util = require('util');
var fileCache;
var sendFile = function(conn, file) {
conn.writeHead(200, {"Content-Type": "text/html", "Content-Length": file.length});
View multi-collections.js
var mongoose = require('mongoose');
mongoose.connect('localhost', 'testing_multiTenant');
* User schema.
var UserSchema = new mongoose.Schema({
name: String
, prefix: { type: String, required: true }
gudbergur / README.markdown
Created Feb 19, 2012
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things
View README.markdown

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
    # source can be a function
    source: (typeahead, query) ->
      # this function receives the typeahead object and the query string
ngs / gradient_support.rb
Created Feb 2, 2012
a patch to fix compass raising error when using 'transparent' keyword for gradiention: 'Expected a color. Got: transparent'
View gradient_support.rb
## If you are using under a rails project,
## I recommend to put this script onto config/initializer instead of applying the patch
module Compass::SassExtensions::Functions::GradientSupport
class ColorStop < Sass::Script::Literal
def initialize(color, stop = nil)
self.options = {}
if color.is_a?(Sass::Script::String) && color.value == 'transparent'
pksunkara /
Created Dec 16, 2011
Command Line Arguments Specification

Command Line Arguments Specification

This specification defines Command Line Arguments level 1 (CLARG 1.0). This document aims to direct development of command line tools conform to a set of rules while parsing options.


The different type of arguments are:

  • Short Option
  • Long Option
pksunkara / mixin.sass
Created Nov 25, 2011
Some mixins for SASS
View mixin.sass
$useIEFilters: 1
// might be 0 or 1. disabled by default.
-moz-border-radius: $values
-webkit-border-radius: $values
border-radius: $values
View sitemap_s3_publisher.rb
require 'aws/s3'
rescue LoadError => e
e.message << " (You may need to install the aws-s3 gem)"
raise e
class SitemapS3Publisher
def generate
View soundcloud_oauth2_user_agent_authentication_flow_demo.html
<!DOCTYPE html>
<html lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>SoundCloud OAuth 2 User Agent Authentication Flow Demo</title>
<script type="text/javascript" charset="utf-8" src="javascript/jquery-1.4.2.js"></script>
<script type="text/javascript" charset="utf-8">
$(function () {
var extractToken = function(hash) {
View mongo_paperclip.rb
module Paperclip
class << self
def logger #:nodoc:
module ClassMethods
def has_attached_file name, options = {}
include InstanceMethods
kneath /
Created Nov 18, 2009 — forked from defunkt/bundle.rake
Intelligent asset bundling for Rails (GitHub's asset bundling)

GitHub Javascript Strategy

Unless otherwise necessary (such as mobile development), the GitHub javascript codebase is based off jQuery. You can safely assume it will be included on every page.

File naming

  • All jquery plugins should be prefixed with jquery, such as jquery.facebox
  • All github-specific jquery plugins should be prefixed with jquery.github. Like jquery.github.repo_list.js
  • All page-specific files (that only run on ONE page) should be prefixed with page. page.billing.js
You can’t perform that action at this time.