Skip to content

Instantly share code, notes, and snippets.

View matiaskorhonen's full-sized avatar

Matias Korhonen matiaskorhonen

View GitHub Profile
@tobitailor
tobitailor / get_barcode_from_image.js
Created June 1, 2010 19:33
Barcode recognition with JavaScript - Demo: http://bit.ly/djvUoy
/*
* Copyright (c) 2010 Tobias Schneider
* This script is freely distributable under the terms of the MIT license.
*/
(function(){
var UPC_SET = {
"3211": '0',
"2221": '1',
"2122": '2',
gem "resque", :require => "resque/server"
@scottraio
scottraio / quiet_assets.rb
Created December 12, 2011 23:11
Quiet down Rails 3.1 asset pipeline logging in development
Rails.application.assets.logger = Logger.new('/dev/null')
Rails::Rack::Logger.class_eval do
def before_dispatch_with_quiet_assets(env)
before_dispatch_without_quiet_assets(env) unless env['PATH_INFO'].index("/assets/") == 0
end
alias_method_chain :before_dispatch, :quiet_assets
end
@jcasimir
jcasimir / build_developers.markdown
Created February 9, 2012 15:27
Build Developers

Build Developers

Brief

You cannot do it on your own. Whether you're buildings products or a consultancy, you need developers. You can't afford to outbid everyone else and, even if you do, another company will up the ante in six months. You can't rely on your network or universities to deliver fully ready Rails devs. Professional recruiters are no answer.

Your only real option is to build them. That's the situation LivingSocial faced, and in this session, we'll share lessons learned from the design, recruitment, and beginning months of Hungry Academy. Let's discuss:

  • Recruiting applicants
  • Evaluating aptitude
@matiaskorhonen
matiaskorhonen / speaker.md
Last active November 8, 2022 21:28
Frozen Rails Talk Proposal Template (http://2014.frozenrails.eu/). If you want to submit multiple talks, just duplicate the talk.md file. If you don't want your proposal to be public, create a private gist.
@matiaskorhonen
matiaskorhonen / acegist.user.js
Created April 10, 2012 13:55 — forked from abernier/acegist.user.js
ACE editor for editing your gists
// ==UserScript==
// @id acegist
// @name ACEgist
// @author Antoine BERNIER (abernier)
// @version 0.1.1
// @description ACE editor in your gists
// @match https://gist.github.com/gists/*/edit
// ==/UserScript==
(function (d, cb) {
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session
@0xced
0xced / XCDFakeCarrier.m
Last active March 5, 2023 22:07
Hack to choose the displayed carrier name in the iOS simulator
//
// Copyright (c) 2012-2015 Cédric Luthi / @0xced. All rights reserved.
//
#import <Foundation/Foundation.h>
#if TARGET_OS_SIMULATOR
static const char *fakeCarrier;
static const char *fakeTime;
@andkerosine
andkerosine / raskell.rb
Created August 15, 2012 05:56
Haskell-like list comprehensions in Ruby
$stack, $draws = [], {}
def method_missing *args
return if args[0][/^to_/]
$stack << args.map { |a| a or $stack.pop }
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :<
end
class Array
def +@
@mcansky
mcansky / gist:3434417
Created August 23, 2012 08:59
signing an aws s3 url
# encoding : utf-8
require 'openssl'
require 'digest/sha1'
require 'base64'
module Aws
extend self
def signed_url(path, expire_date)
digest = OpenSSL::Digest::Digest.new('sha1')
can_string = "GET\n\n\n#{expire_date}\n/#{S3_BUCKET}/#{path}"