Mountain Lion (10.8) has three main difference compared to Lion (10.7):
- XCode 4.4 does not install Command Line Tools by default
- X11 isn't available anymore
- The installed version of OpenSSL has some bugs
require 'socket' | |
module EventEmitter | |
def _callbacks | |
@_callbacks ||= Hash.new { |h, k| h[k] = [] } | |
end | |
def on(type, &blk) | |
_callbacks[type] << blk | |
self |
require 'pry' | |
data = { | |
a: { | |
alfa: "alfa", | |
beta: "beta" | |
}, | |
b: 2, | |
c: { | |
alfa: { |
require "raindrops" | |
class UnicornConnectionMonitor | |
def initialize(app, options = {}) | |
@app = app | |
@statsd = options.fetch(:statsd) | |
end | |
def call(env) | |
if linux? && unicorn? |
This is a proof-of-concept of a couple of concurrent data structures written in Ruby.
The implementations are heavily commented for those interested. There are benchmarks (with results) included below. The results are interesting, but, as always, take with a grain of salt.
AtomicLinkedQueue
is a lock-free queue, built on atomic CAS operations.
package main | |
import ( | |
"log" | |
"net" | |
"os" | |
"os/signal" | |
"sync" | |
"syscall" | |
"time" |
$("button.mark-all-as-read").parent().prepend('<button class="box-action mute-all-unread css-truncate tooltipped upwards" original-title="mute all unread notifications"> <span class="octicon octicon-mute"></span> </button>'); | |
$('button.mute-all-unread').click(function(event) { | |
// mute all unread notifications | |
$(this).parent().parent().parent().find('li.unread').find('.js-mute-notification button').click(); | |
return false; | |
}); |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"