This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#s/ActiveSupport::TestCase/Test::Unit::TestCase works | |
require 'test_helper' | |
class ThingTest < ActiveSupport::TestCase | |
def test_thing | |
ActiveRecord::Base.uncached do | |
first = ActiveRecord::Base.connection.query("select now();") | |
p [Time.now, first] | |
sleep 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
routes.rb | |
namespace :manage do | |
resources :dashboard, :only => [] do | |
collection do | |
get 'index' | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#metaprogramming | |
class Array | |
def tail | |
head, *tail = self | |
return tail | |
end | |
def head | |
head, *tail = self | |
return head | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* 07da981 - Revert "Pie in the sky, maybe its a bug in precompiled bullshit" (22 hours ago) <Adam Weis> | |
* 0282d02 - Pie in the sky, maybe its a bug in precompiled bullshit (22 hours ago) <Adam Weis> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby 1.9.3 | |
rake spec 48.14s user 2.45s system 93% cpu 53.839 total | |
ruby 2.0.0 | |
rake spec 20.33s user 1.90s system 87% cpu 25.432 total | |
ruby 2.1.0 | |
rake spec 15.70s user 1.88s system 84% cpu 20.804 total |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <math.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
int | |
isPrime(uintmax_t n) { | |
if (n < 2) { | |
return 0; | |
} else if (n == 2 || n == 3) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Mem_store = Irmin_mem.KV(Irmin.Contents.String); | |
let config = Irmin_mem.config(); | |
let repo = Mem_store.Repo.v(config); | |
open Lwt.Infix; | |
let master = config => Mem_store.Repo.v(config) >>= Mem_store.master; | |
let info = msg => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
U-Boot 1.3.0-rc3-lab126 (Apr 16 2011 - 20:15:23) | |
CPU: Freescale i.MX35 at 532 MHz | |
Board: MX35 Luigi [ POR] | |
WDOG_WCR = 0xff31 | |
WDOG_WMCR = 0x0 | |
Board Id: SP1B000000000000 | |
S/N: B008A0A0118305W4 | |
DRAM: 256 MB | |
Using default environment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
U-Boot 1.3.0-rc3-lab126 (Apr 16 2011 - 20:15:23) | |
CPU: Freescale i.MX35 at 532 MHz | |
Board: MX35 Luigi [ POR] | |
WDOG_WCR = 0xff31 | |
WDOG_WMCR = 0x0 | |
Board Id: SP1B000000000000 | |
S/N: B008A0A0118305W4 | |
DRAM: 256 MB | |
Using default environment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener('copy', function(e) { | |
const text = e.target.textContent; | |
try { | |
const url = new URL(text); | |
url.searchParams.delete("s"); | |
e.clipboardData.setData('text/plain', url.href); | |
e.preventDefault(); | |
} catch(_) {} | |
}); |