Skip to content

Instantly share code, notes, and snippets.

(use 'clojure.contrib.monads)
(defn new-pair [value log] {:value value :log log})
(defn starting-pair [value] (new-pair value nil))
(defn log [base-value]
(fn [log]
(new-pair base-value (cons base-value log))))
(defmonad logging-m

Routing in Ember

In Ember, the application's state manager handles routing. Let's take a look at a simple example:

App.stateManager = Ember.StateManager.create({
  start: Ember.State.extend({
    index: Ember.State.extend({
      route: "/",
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@dherman
dherman / emacs-cheat-sheet.md
Created August 2, 2012 16:22
My emacs cheat sheet

In penance for cracking stupid jokes on Twitter, here's my Emacs cheat sheet. Emacs has a steep learning curve, so I've tried to order them by importance so you could learn them in stages.

One overall rule of thumb: pay attention to the minibuffer (the line at the bottom of the editor). It will often guide you through a process, and also gives you hints about what state you're in, such as the middle of a multi-chord sequence.

The other rule of thumb: when in doubt, C-g it out.

Basics (mandatory)

You simply can't get by without having these at your fingertips.

@w0ng
w0ng / codehilite-hybrid.css
Created August 19, 2012 18:08
css for python-markdown's codehilite extension (incomplete)
.codehilite .hll { background-color: #373b41 }
.codehilite { background: #1d1f21; color: #c5c8c6 }
.codehilite .c { color: #969896 } /* Comment */
.codehilite .err { border: 1px solid #cc6666 } /* Error */
.codehilite .g { color: #c5c8c6 } /* Generic */
.codehilite .k { color: #81a2be } /* Keyword */
.codehilite .l { color: #cc6666 } /* Literal */
.codehilite .o { color: #c5c8c6 } /* Operator */
.codehilite .x { color: #c5c8c6 } /* Other */
.codehilite .p { color: #c5c8c6 } /* Punctuation */
@Hupotronic
Hupotronic / h264-vs-vp8-test.md
Last active May 11, 2024 18:19
H.264 & VP8 Quality Comparison And Some Words on Future Video Formats

VP8 vs H.264 - Which One is Better?

So I was reading Hacker News and decided to read the comments in the thread about H.265 being approved. Pretty close to the top was this comment about VP9, Google's future video format. I have some words of my own about it and other future formats at the bottom of this post, but what jumped out from the comment to me was this part:

Many have already implemented VP8 (which is also slightly better than h.264 at this point)

The comparison linked to back up that statement is faulty for several reasons, such as not providing the source material used (hell, he doesn't even name the source material), exact encoding settings used (no, some random profiles are not enough), not providing the resulting encodes, only providing a

@desandro
desandro / require-js-discussion.md
Created January 31, 2013 20:26
Can you help me understand the benefit of require.js?

I'm having trouble understanding the benefit of require.js. Can you help me out? I imagine other developers have a similar interest.

From Require.js - Why AMD:

The AMD format comes from wanting a module format that was better than today's "write a bunch of script tags with implicit dependencies that you have to manually order"

I don't quite understand why this methodology is so bad. The difficult part is that you have to manually order dependencies. But the benefit is that you don't have an additional layer of abstraction.


@alexcican
alexcican / Preferences.sublime-settings
Last active March 7, 2024 05:37
SublimeText User settings
{
"auto_complete_commit_on_tab": true,
"color_scheme": "Packages/Color Scheme - Default/Tomorrow-Night-Eighties.tmTheme",
"file_exclude_patterns":
[
".DS_Store"
],
"folder_exclude_patterns":
[
"bin",
anonymous
anonymous / gist:5378663
Created April 13, 2013 14:38
Anonymous Open Letter to the Ember.js Core Team

Anonymous Open Letter to the Ember.js Core Team

Disclaimer: I've been using Ember for quite some time now, about when 0.9.8 was released, which means I'm not a random hater using backbone or angular.

I do believe Ember is the best thing out there, but I want to point out some things which really piss me off.

Most of them are based on the fact that the core team doesn't seem to be organized and doesn't prioritize the right things. Here are couple of examples:

  • Ember Extension was a great idea, there were couple of videos released with it, everyone loved it, but the project has been dead for 2 months now. There are 11 open issues, many of them for a few months without any response from the core team.
@danneu
danneu / golang-vs-clojure-async.md
Last active November 6, 2023 04:09
Google I/O 2012 - Go Concurrency Patterns ported to Clojure Video: http://www.youtube.com/watch?v=f6kdp27TYZs