Skip to content

Instantly share code, notes, and snippets.

@dunckr
dunckr / karma.conf.js
Last active December 21, 2015 15:39
Backbone, CoffeeScript and Karma setup
// Karma configuration
// http://karma-runner.github.io/0.10/config/configuration-file.html
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
// testing framework to use (jasmine/mocha/qunit/...)
frameworks: ['jasmine'],
@dunckr
dunckr / Gruntfile.js
Last active December 21, 2015 15:39
Angular, CoffeeScript and Karma
// Generated on 2013-08-22 using generator-angular 0.3.1
'use strict';
var LIVERELOAD_PORT = 35729;
var lrSnippet = require('connect-livereload')({ port: LIVERELOAD_PORT });
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
// # Globbing
// for performance reasons we're only matching one level down:
@dunckr
dunckr / Quirks
Last active February 19, 2019 02:05
JS Cheatsheet WIP
Array(30).join(' ') // empty string
!!variable // to boolean
Array.prototype.slice.call(arguments) // array like object into an array
str += 'Using' // number casting
Function.call.apply(Foo.prototype.method, arguments); // Foo.prototype.method.call(this, arg1, arg2... argN)
@dunckr
dunckr / Controller
Last active December 27, 2015 17:19
Angular CoffeeScript Minsafe Templates
class Ctrl
constructor: (@$scope) ->
angular.module('app').controller 'ctrl', ['$scope', Ctrl]
@dunckr
dunckr / Coffeelint.sublime-build
Created November 23, 2013 14:40
Sublime Build CoffeeLint
{
"cmd": ["/usr/local/share/npm/bin/coffeelint","$file","-f","/path/coffeelint.json"]
}
@dunckr
dunckr / Patterns
Created November 27, 2013 21:28
JSON of Patterns for Quizington sample. Taken from http://www.dofactory.com/Patterns/Patterns.aspx
{
"Abstract Factory": "Creates an instance of several families of classes",
"Adapter": "Match interfaces of different classes",
"Bridge": "Separates an object\u2019s interface from its implementation",
"Builder": "Separates object construction from its representation",
"Chain of Responsibility": "A way of passing a request between a chain of objects",
"Command": "Encapsulate a command request as an object",
"Composite": "A tree structure of simple and composite objects",
"Decorator": "Add responsibilities to objects dynamically",
"Facade": "A single class that represents an entire subsystem",
@dunckr
dunckr / Gemfile
Created December 2, 2013 23:26
1.9.3 Gemset
source 'https://rubygems.org'
gem 'rails', '3.2.3'
gem 'jquery-rails', '2.0.1'
gem 'bootstrap-sass', '2.0.0'
gem 'bcrypt-ruby', '3.0.1'
gem 'faker', '1.0.1'
gem 'will_paginate', '3.0.3'
gem 'bootstrap-will_paginate', '0.0.5'
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
# Push Bindings
bind 1:shift;cmd push left bar-resize:screenSizeX/2
bind 2:shift;cmd push right bar-resize:screenSizeX/2
bind 3:shift;cmd push up bar-resize:screenSizeY/2
bind 4:shift;cmd push down bar-resize:screenSizeY/2
/**
* Airbnb JSHint settings for use with SublimeLinter and Sublime Text 2.
*
* 1. Install SublimeLinter at https://github.com/SublimeLinter/SublimeLinter
* 2. Open user preferences for the SublimeLinter package in Sublime Text 2
* * For Mac OS X go to _Sublime Text 2_ > _Preferences_ > _Package Settings_ > _SublimeLinter_ > _Settings - User_
* 3. Paste the contents of this file into your settings file
* 4. Save the settings file
*
* @version 0.3.0
@dunckr
dunckr / Gruntfile.js
Last active December 31, 2015 22:39
MEAN config
// Generated on 2013-12-20 using generator-angular-fullstack 1.0.1
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'
module.exports = function (grunt) {