Skip to content

Instantly share code, notes, and snippets.

@entaroadun
entaroadun / visualization_in_js.md
Created December 23, 2011 21:35
Visualization using Javascript on Github

Data visualization in one of three most important steps in data mining (https://github.com/entaroadun/hnpickup#readme). Often times, it's impossible to understand data without proper visualization. I went looking for great tools to do that.

Two website list recent JS visualization frameworks:

Most of them are available on Github. My three favorite:

@jasonweng
jasonweng / array_distinct.js
Created December 19, 2011 14:00 — forked from fundon/array_distinct.js
array distinct , JavaScript
//http://lijing00333.wordpress.com/2011/02/08/%E6%95%B0%E7%BB%84%E5%8E%BB%E9%87%8D%E2%80%94%E2%80%94%E4%B8%80%E9%81%93%E5%89%8D%E7%AB%AF%E6%A0%A1%E6%8B%9B%E8%AF%95%E9%A2%98/
// [1,2,2,2,3,4,5].toString().match(/(\d)(?!.*,\1)/g);
Array.prototype.distinct = function() {
var o = {}, i = 0, l = this.length;
for (; i < l;) {
if (!o.hasOwnProperty(this[i])) {
o[this[i++]] = 1;
} else {
this.splice(i, 1);
@huangdongxu
huangdongxu / session.py
Created December 2, 2011 12:45
Tornado Session With Memcached Backend
import os
import sys
import cPickle
import time
import hashlib
import logging
import uuid
import cmemcached
(function($) {
// Used by dateinput
$.expr = {':': {}};
// Used by bootstrap
$.support = {};
// Used by dateinput
$.fn.clone = function(){
var ret = $();
@teddyzetterlund
teddyzetterlund / README.markdown
Last active June 25, 2019 05:45
My CodeBrawl Entry: Command line TODO lists

Do It - Simple Todo List

Do It is a simple todo list application written for the command-line. Right now it doesn't have any fancy features or anything and a simple text-file is probably handier to use for keeping track of your todos. Do It is simply my entry for the Code Brawl competition Command line TODO lists.

Background

This project is my first in more than one way. It's my first entry to Code Brawl and it's my first command-line application. I didn't enter the competition to win it, I entered because it would give me motivation to just jump into it and try to write my first CLI-application.

It turned out I couldn't spare a whole of time this week, but at least I got the essential in and I'm planning on improving this application further and then make it my first gem - just for the sake of learning and experimenting.

@fundon
fundon / flush.php
Created July 25, 2011 09:57
BigPipe php
<?php
/**
* http://www.justincarmony.com/blog/2011/01/24/php-nginx-and-output-flushing/
* http://huoding.com/2011/06/26/88
* http://www.infoq.com/cn/news/2010/08/bigpipe-facebook-optimize
* http://www.subbu.org/blog/2010/07/bigpipe-done-in-node-js
* nginx fail!
* apache success!
*/
@Jxck
Jxck / ecma5_on_v8.js
Created July 9, 2011 12:02
The sample usage of ECMA 5 Features Implemented in V8
/**
* The sample usage of ECMA 5 Mozilla Features Implemented in V8
* https://github.com/joyent/node/wiki/ECMA-5-Mozilla-Features-Implemented-in-V8
* You can use thease new feature of ECMA5 on Node.js as you like.
* because there is no IE :)
* Order is deferent form original wiki.
* Sources are Checked on Node.js v0.5.0(unstable), v0.4.9(stable)
*
* you can execute this file.
* $ node ecma5_on_v8.js
@kaaes
kaaes / objects.js
Created June 26, 2011 14:11
ECMA5 object cheatsheet
/**
* Object descriptor
**/
var a = {
prop1 : 14
}
var descriptorObj1 = Object.getOwnPropertyDescriptor(a, 'prop1');
@bobbrez
bobbrez / gist:993344
Created May 26, 2011 15:15
MySQL on OS X using Homebrew

Change Permissions

You'll need to change the permissions for /usr/local for your local user.

sudo chown -R whoami /usr/local

Homebrew

The easiest way to get everything setup is to use Homebrew. To do this, you'll need to first install XCode from the standard XCode from Apple Developer site. Afterwards you can just install Homebrew though its normal installation

ruby -e "$(curl -fsSLk https://gist.github.com/raw/323731/install_homebrew.rb)"

@andrei-m
andrei-m / levenshtein.js
Last active October 9, 2024 10:36
Levenshtein distance between two given strings implemented in JavaScript and usable as a Node.js module
/*
Copyright (c) 2011 Andrei Mackenzie
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE