Skip to content

Instantly share code, notes, and snippets.

@tnhu
tnhu / gist:939f9172befc8edf244a
Last active August 29, 2015 14:06 — forked from anonymous/gist:1406238
Scala's complexity
Originally:
https://gist.github.com/7565976a89d5da1511ce
Hi Donald (and Martin),
Thanks for pinging me; it's nice to know Typesafe is keeping tabs on this, and I
appreciate the tone. This is a Yegge-long response, but given that you and
Martin are the two people best-situated to do anything about this, I'd rather
err on the side of giving you too much to think about. I realize I'm being very
critical of something in which you've invested a great deal (both financially
@tnhu
tnhu / fnv32_hash.js
Last active December 29, 2023 22:48 — forked from vaiorabbit/fnv32a.js
Shortest JavaScript String Hash implementation
// 32 bit FNV-1a hash
// Ref.: http://isthe.com/chongo/tech/comp/fnv/
function fnv32a(str) {
var FNV1_32A_INIT = 0x811c9dc5,
hval = FNV1_32A_INIT,
i, len;
for (i = 0, len = str.length; i < len; i++) {
hval ^= str.charCodeAt(i);
hval += (hval << 1) + (hval << 4) + (hval << 7) + (hval << 8) + (hval << 24);
@tnhu
tnhu / install-nodejs.sh
Created April 26, 2012 23:44
Install NodeJS
#!/bin/sh
VERSION=0.6.7
NAME=node-v$VERSION
DEST=$HOME/$NAME
TMP=$HOME/tmp/$NAME
echo This script installs NodeJS v$VERSION into $DEST
path=`pwd`
@tnhu
tnhu / minscalaactors.scala
Created April 13, 2012 07:25 — forked from viktorklang/minscalaactors.scala
Minimalist Scala Actors
©2012 Viktor Klang
object Actor {
import java.util.concurrent.{ConcurrentLinkedQueue, Executor}
import java.util.concurrent.atomic.{AtomicBoolean}
type Behavior = Any => Effect
sealed trait Effect { def getOrElse(old: Behavior): Behavior }
case object Stay extends Effect { def getOrElse(old: Behavior): Behavior = old }
case class Become(like: Behavior) extends Effect { def getOrElse(old: Behavior): Behavior = like }
@tnhu
tnhu / hack.sh
Created April 1, 2012 04:37 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@tnhu
tnhu / JSFaceTest.js
Created March 13, 2012 12:13
JSFaceTest
var JSFacePerson = jsface.Class({
constructor: function(name) {
this.name = name;
},
setAddress: function(country, city, street) {
this.country = country;
this.city = city;
this.street = street;
},
sayHello: function() {
@tnhu
tnhu / LICENSE.txt
Created December 21, 2011 15:27 — forked from azproduction/LICENSE.txt
Simple argv parser in 100 bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mikhail Davydov
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@tnhu
tnhu / gist:1331813
Created November 1, 2011 20:31 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@tnhu
tnhu / learning_resources.txt
Created June 14, 2011 06:11 — forked from nathansmith/web-design-development-learning-resources.md
Resources for learning web design & front-end development
Resources for learning web design & front-end development:
================================================================================
**ONLINE**
Design
> http://52weeksofux.com
> http://thedesigncubicle.com
@tnhu
tnhu / index.html
Created May 3, 2011 18:50
JavaScript Beautifier
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="en-us" dir="ltr" class="ie ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="en-us" dir="ltr" class="ie ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en-us" dir="ltr" class="ie ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en-us" dir="ltr" class="ie ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en-us" dir="ltr"> <!--<![endif]-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Online javascript beautifier</title>
<style type="text/css">