Skip to content

Instantly share code, notes, and snippets.

View marianposaceanu's full-sized avatar

Posăceanu Marian marianposaceanu

View GitHub Profile
@marianposaceanu
marianposaceanu / ebooks.md
Created December 22, 2011 16:53 — forked from roidrage/ebooks.md
Self-published and awesome
@marianposaceanu
marianposaceanu / visualization_in_js.md
Created December 24, 2011 00:36 — forked from entaroadun/visualization_in_js.md
Visualization using Javascript on Github

Data visualization in one of three most important steps in data mining (https://github.com/entaroadun/hnpickup). 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:

class Lisp
def initialize
@env = {
:label => lambda { |(name,val), _| @env[name] = val },
:quote => lambda { |sexpr, _| sexpr[0] },
:car => lambda { |(list), _| list[0] },
:cdr => lambda { |(list), _| list.drop 1 },
:cons => lambda { |(e,cell), _| [e] + cell },
:eq => lambda { |(l,r), _| l == r },
:if => lambda { |(cond, thn, els), ctx| eval(cond, ctx) ? eval(thn, ctx) : eval(els, ctx) },
@marianposaceanu
marianposaceanu / eventmachine.rb
Created February 27, 2012 08:38 — forked from joshuasiler/eventmachine.rb
Initializer that allows EventMachine to run within Rails, and work with AMQP, Passenger, Thin and Capybara
require 'amqp'
module HiringThingEM
def self.start
if defined?(PhusionPassenger)
PhusionPassenger.on_event(:starting_worker_process) do |forked|
# for passenger, we need to avoid orphaned threads
if forked && EM.reactor_running?
EM.stop
end
Thread.new {
@marianposaceanu
marianposaceanu / app.rb
Created March 6, 2012 09:42 — forked from cpatni/app.rb
unique calculation using redis
require 'sinatra'
require 'redis'
require 'json'
require 'date'
class String
def &(str)
result = ''
result.force_encoding("BINARY")
@marianposaceanu
marianposaceanu / latency.md
Created May 31, 2012 10:18 — forked from jboner/latency.txt
Latency numbers every programmer should know

CPU

  • L1 cache reference 0.5 ns
  • Branch mispredict 5 ns (on a bad CPU architecture you're pretty much screwed)
  • L2 cache reference 7 ns
  • Mutex lock/unlock 25 ns
  • Main memory reference 100 ns
  • Compress 1K bytes with Zippy 3,000 ns
  • Send 2K bytes over 1 Gbps network 20,000 ns
  • Read 1 MB sequentially from memory 250,000 ns
@marianposaceanu
marianposaceanu / 0_README.md
Created September 20, 2012 12:33 — forked from josevalim/0_README.md
Sinatra like routes in Rails controllers

Sinatra like routes in Rails controllers

A proof of concept of having Sinatra like routes inside your controllers.

How to use

Since the router is gone, feel free to remove config/routes.rb. Then add the file below to lib/action_controller/inline_routes.rb inside your app.

@marianposaceanu
marianposaceanu / log.js
Created November 15, 2012 20:42 — forked from cowboy/log.js
JavaScript: log= (insanity?)
/*
* log= (insanity?)
* http://benalman.com/
*
* Copyright (c) 2012 "Cowboy" Ben Alman
* Licensed under the MIT license.
*/
Object.defineProperty(global, 'log', {
set: function(args) {
@marianposaceanu
marianposaceanu / Custom.css
Created December 4, 2012 11:09 — forked from bentruyman/Custom.css
IR_Black Theme for Chrome Developer Tools
/**********************************************/
/*
/* IR_Black Skin by Ben Truyman - 2011
/*
/* Based on Todd Werth's IR_Black:
/* http://blog.toddwerth.com/entries/2
/*
/* Inspired by Darcy Clarke's blog post:
/* http://darcyclarke.me/design/skin-your-chrome-inspector/
/*
@marianposaceanu
marianposaceanu / redis_install_ubuntu_10_04.md
Created December 10, 2012 12:27 — forked from torgeir/install_redis_on_ubuntu.md
Redis 2.4.8 Install on Ubuntu 10.04

Installation commands:

$ wget http://redis.googlecode.com/files/redis-2.4.8.tar.gz
$ tar xvfz redis-2.4.8.tar.gz 
$ cd redis-2.4.8/
$ mkdir -p /opt/redis
$ make PREFIX=/opt/redis install
$ cp redis.conf /opt/redis/redis.conf
$ chown -R redis:redis /opt/redis