Skip to content

Instantly share code, notes, and snippets.

See .

@nkohari
nkohari / linq.js
Created September 26, 2009 20:13
linq.js
/*
linq.js -- a simple LINQ implementation for javascript
Author: Nate Kohari <nate@enkari.com>
Copyright (C) 2009 Enkari, Ltd.
Released under the Apache 2.0 license (http://www.opensource.org/licenses/apache2.0.php)
*/
Array.prototype.all = function(func) {
var result = true;
this.iterate(function(item) {
@tedheich
tedheich / todosqlite-createdb.py
Created October 21, 2009 13:18
script to create the sqlite db for todo.py
#-*- coding: ISO-8859-1 -*-
# filename: todosqlite-createdb.py
# author: ted heich
#
# This program is the first part of the todosqlite app, this program handles
# the creation of the table. If todo.sqlite does not exist on the file system.
# Everytime you run this code, the table todo will be dropped and recreated--so be warned.
# it is created automatically.
#
@tedheich
tedheich / todosqlite.py
Created October 21, 2009 13:19
A simple command line todo list using SQLite and Python
#! /sw/bin/python
# filename: todosqlite.py
# author: ted heich
# blog: http://fornoobs.info
#
# A simple todo list app using Python and sqlite using the cmd line interface
#
#from pysqlite2 import dbapi2 as sqlite
import pysqlite2.dbapi2 as sqlite
@rjungemann
rjungemann / watch.js
Created February 23, 2010 19:39
JQuery monitoring DOM properties
// Thanks to James Podolsey for this code, from the "Monitoring DOM
// Properties" article, located at
// http://james.padolsey.com/javascript/monitoring-dom-properties/
jQuery.fn.watch = function(id, fn) {
return this.each(function() {
var self = this, oldVal = self[id];
$(self).data('watch_timer',
setInterval(function() {
@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.
*/
@tbtlr
tbtlr / get_barcode_from_image.js
Created June 1, 2010 19:33
Barcode recognition with JavaScript - Demo: http://bit.ly/djvUoy
/*
* Copyright (c) 2010 Tobias Schneider
* This script is freely distributable under the terms of the MIT license.
*/
(function(){
var UPC_SET = {
"3211": '0',
"2221": '1',
"2122": '2',

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

@stagas
stagas / how-to-run-apache-and-node.js-together-the-right-way.markdown
Created December 24, 2010 14:45
How to run Apache and Node.js together (the right way)

Step 1

Get a VPS that offers 2 or more IP addresses.

Step 2

From the WHM cPanel, find the menu item Service Configuration, select Apache Configuration and then click on Reserved IPs Editor.

Step 3

@revolunet
revolunet / lzw_encoder.js
Created February 25, 2011 14:55
LZW javascript compress/decompress
// LZW-compress a string
function lzw_encode(s) {
var dict = {};
var data = (s + "").split("");
var out = [];
var currChar;
var phrase = data[0];
var code = 256;
for (var i=1; i<data.length; i++) {
currChar=data[i];