Skip to content

Instantly share code, notes, and snippets.

View rudasn's full-sized avatar

Nicolas Rudas rudasn

View GitHub Profile
@eligrey
eligrey / object-watch.js
Created April 30, 2010 01:38
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@druu
druu / Less Compile.sublime-build
Created November 8, 2011 09:57
LessCSS Build System for Sublime Text 2
/**
* Basic LessCSS Build System for Sublime Text 2
*
* Prerequisites: node.js, global lesscss node module
* How it works:
* 1. Create the folders "src/css" and "assets/css" in your project root
* 2. Put all your .less files into "src/css"
* 3. Open your main .less file and hit "Build"
* 4. Dance happily around your minified and compiled CSS file in "assets/css"
* 5. Profit
@maxbrunsfeld
maxbrunsfeld / backbone_super.js
Created December 30, 2011 23:58
A 'super' method for backbone.js (plain javascript)
// This method gives you an easier way of calling super
// when you're using Backbone in plain javascript.
// It lets you avoid writing the constructor's name multiple
// times. You still have to specify the name of the method.
//
// So instead of having to write:
//
// User = Backbone.Model.extend({
// save: function(attrs) {
// this.beforeSave(attrs);
@jcromartie
jcromartie / tables.js
Created June 14, 2012 17:01
Backbone views done right done right?
var TableViewRow = Backbone.View.extend({
tagName: "tr",
template: _.template("<td><%= firstName %></td><td><%= lastName %></td>"),
render: function() {
this.$el.html(this.template(this.model.toJSON()));
return this;
}
});
class Example.Views.Table extends Backbone.View
template: JST['example/table']
initialize: ->
@collection.on 'add', @addOne
render: ->
@$el.html @template()
@addAll()
@
@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
@blackfalcon
blackfalcon / sassJunkDrawer.md
Last active March 23, 2022 20:09
Clean out your Sass junk-drawer

by Dale Sande

CSS has had a long and sordid past. A developer never sets out with the goal of making a complete and total mess of things. Their intention is not to build something that is practically illegible, impractical to maintain and is limited in scale. But somehow, this is where many inevitably end up. Luckily, all is not lost. With some simple strategies, organizational methods and out-of-the box tools, we can really help get that junk-drawer inline.

For many of us getting started with Sass, at one time or another have created a junk-drawer of files. For most, this was a rookie mistake, but for others, this is a continuing issue with our architecture and file management techniques. Sass doesn't come with any real rules for file management so developers are pretty much left to their own devices.

Large CSS files and increased complexity

CSS started out with very simple intentions, but as [tableless web design][1.1] began to really take a foothold, o

@gdamjan
gdamjan / README.md
Last active July 9, 2024 22:54
Setup for an easy to use, simple reverse http tunnels with nginx and ssh. It's that simple there's no authentication at all. The end result, a single ssh command invocation gives you a public url for your web app hosted on your laptop.

What

A lot of times you are developing a web application on your own laptop or home computer and would like to demo it to the public. Most of those times you are behind a router/firewall and you don't have a public IP address. Instead of configuring routers (often not possible), this solution gives you a public URL that's reverse tunnelled via ssh to your laptop.

Because of the relaxation of the sshd setup, it's best used on a dedicated virtual machine just for this (an Amazon micro instance for example).

Requirements

@parkji
parkji / Gruntfile.js
Last active December 20, 2015 22:59
Grunt file for building and serving jekyll sites. Means you can just do grunt watch instead of running two Jekyll commands
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
shell: {
jekyllBuild: {
command: 'jekyll build'
},
jekyllServe: {
command: 'jekyll serve'
}