Skip to content

Instantly share code, notes, and snippets.

@tonyhb
tonyhb / replace.coffee
Last active February 8, 2017 15:04
Marionette.Region.replace: Show and hide regions with a fadeIn/fadeOut animation
Marionette.Region.prototype.replace = (view, speed) ->
speed = speed || 150
if ! @currentView
@show(view)
return
@ensureEl()
isViewClosed = view.isClosed || _.isUndefined view.$el
isDifferentView = view isnt @currentView
view.render()
@0gust1
0gust1 / gruntfile_modularization.md
Last active April 25, 2016 12:50
Inventory of solutions to modularize grunt configuration for large project & (legacy) codebases

Grunt config modularization

Inventory of solutions to modularize grunt configuration for large project & (legacy) codebases

Existing solutions

Grunt-modules

@jbenet
jbenet / simple-git-branching-model.md
Last active April 9, 2024 03:31
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@facultymatt
facultymatt / roles_invesitgation.md
Last active April 16, 2024 09:31
Roles and permissions system for Nodejs
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active November 29, 2023 15:35
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@hongymagic
hongymagic / Backbone.Model.js
Last active July 1, 2016 03:34
Turn Backbone.Model accessor methods into property getters/setters. Trash the `get()` and `set()` and use it directly!
(function (Backbone) {
var _old = Backbone.Model;
// Take a Backbone.Model and introduce a proper set of accessors based on
// `defaults`. Instead of having to use accessor methods like `get` and
// `set`, just accesss your model properties:
//
// var user = new User();
// user.name = 'David';
@cbess
cbess / gist:4444374
Last active March 16, 2020 06:10
Xcode Delete and Duplicate Selected Lines
<key>Customized</key>
<dict>
<key>Delete Line</key>
<string>selectLine:, deleteBackward:</string>
<key>Duplicate Lines</key>
<string>selectLine:, copy:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward:</string>
<key>Duplicate Current Line</key>
<string>moveToBeginningOfLine:, deleteToEndOfLine:, yank:, insertNewline:, moveToBeginningOfLine:, yank:</string>
</dict>
function whichTransitionEvent(){
var t;
var el = document.createElement('fakeelement');
var transitions = {
'transition':'transitionend',
'MSTransition':'msTransitionEnd',
'MozTransition':'transitionend',
'WebkitTransition':'webkitTransitionEnd'
}
@ndarville
ndarville / business-models.md
Last active January 13, 2024 17:27
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@brian-mann
brian-mann / FadeTransitionRegion.js
Created October 24, 2012 16:28
Allows jQuery animation transitions between marionette regions
var FadeTransitionRegion = Backbone.Marionette.Region.extend({
show: function(view){
this.ensureEl();
view.render();
this.close(function() {
if (this.currentView && this.currentView !== view) { return; }
this.currentView = view;