Skip to content

Instantly share code, notes, and snippets.

View ghosthamlet's full-sized avatar

hamlet ghosthamlet

  • The Rest Is Silence of Code
View GitHub Profile
anonymous
anonymous / gist:858586
Created March 7, 2011 14:51
game.components.core
(ns game.components.core
(:use
[clojure.contrib.def :only (defvar-)]
(game.utils [core :only (safe-merge
keywords-to-hash-map
get-unique-number
runmap
if-do
distinct-seq?)])))
@michiakig
michiakig / ants.clj
Created July 19, 2011 22:37
Clojure ant sim from Rich Hickey
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Ant sim ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Copyright (c) Rich Hickey. All rights reserved.
; The use and distribution terms for this software are covered by the
; Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
; which can be found in the file CPL.TXT at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; the terms of this license.
; You must not remove this notice, or any other, from this software.
;dimensions of square world
@kellysutton
kellysutton / joinThoseBros.js
Created August 17, 2011 20:55
Example with an Array.join()
var createMyWrappedInput = function (defaultValue) {
return [
'<div class="Wrapper">',
'<input type="text" value="' + defaultValue + '"/>',
'</div>'
].join("");
};
@CHH
CHH / MetaObject.php
Created August 30, 2011 13:55
PHP does Meta Programming too! (Requires PHP 5.4)
<?php
namespace CHH;
trait MetaObject
{
protected static $__metaClass;
static function setMetaClass(MetaClass $metaClass)
{
@aemkei
aemkei / LICENSE.txt
Created October 27, 2011 17:16 — forked from 140bytes/LICENSE.txt
Lorenz Attractor - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
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
@vickychijwani
vickychijwani / ai-class.py
Created November 12, 2011 10:37 — forked from sumodx/ai-class.py
Download lecture videos of ai-class, with HTTP proxy and basic resume support
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "Deepak.G.R."
__credits__ = "Sumod Hajela"
__license__ = 'Public Domain'
"""
usage:
Go to command line and type
@jbrisbin
jbrisbin / gist:1444077
Created December 7, 2011 18:50
Reactor-based framework versus Node.js streaming

I've been hacking away recently at a JVM framework for doing asynchronous, non-blocking applications using a variation of the venerable Reactor pattern. The core of the framework is currently in Java. I started with Scala then went with Java and am now considering Scala again for the core. What can I say: I'm a grass-is-greener waffler! :) But it understands how to invoke Groovy Closures, Scala anonymous functions, and Clojure functions, so you can use the framework directly without needing wrappers.

I've been continually micro-benchmarking this framework because I feel that the JVM is a better foundation on which to build highly-concurrent, highly-scalable, C100K applications than V8 or Ruby. The problem has been, so far, no good tools exist for JVM developers to leverage the excellent performance and manageability of the JVM. This yet-to-be-publicly-released framework is an effort to give Java, Groovy, Scala, [X JVM language] developers access to an easy-to-use programming model that removes the necessity

@sontek
sontek / snowjob.sh
Last active August 9, 2024 13:14
Make your terminal snow
#!/bin/bash
LINES=$(tput lines)
COLUMNS=$(tput cols)
declare -A snowflakes
declare -A lastflakes
clear
@aemkei
aemkei / LICENSE.txt
Last active November 3, 2024 11:50 — forked from 140bytes/LICENSE.txt
Binary Tetris - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
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
@daveray
daveray / clojurescript-one-flow.md
Created January 28, 2012 05:13
ClojureScript One Execution Flow

And now that I've written this, I see that Brenton already documented pretty much the same thing here. Way it goes. Figuring it out myself is better than reading about it anyway :)

ClojureScript One is pretty nice and very well-documented. Despite that, it still wasn't clear to me exactly how we got from a browser request to stuff on the screen. CS1 is built around an event bus model which makes it beautifully decoupled, but hides the execution flow. Add multimethods to the mix and it's definitely a little confusing for a newcomer.

So, tonight, as a newcomer, I worked through the control flow for the initial (development) request from the browser all the way until stuff is displayed on the screen and ready for input. I found it to be an extremely enlightening exercise. The results are below, hopefully someone will find it useful.