Skip to content

Instantly share code, notes, and snippets.

View Sinjo's full-sized avatar
✌️
peace and leauxve

Chris Sinjakli Sinjo

✌️
peace and leauxve
View GitHub Profile
@Sinjo
Sinjo / isolation_level
Created April 21, 2015 22:39
Single node Postgres: Read Committed + some other property (causal consistency?)
locks=# SELECT current_setting('transaction_isolation');
current_setting
-----------------
read committed
(1 row)

Keybase proof

I hereby claim:

  • I am sinjo on github.
  • I am sinjo (https://keybase.io/sinjo) on keybase.
  • I have a public key whose fingerprint is 4C72 3988 4729 BE4A E4E2 5C11 8FB9 FBC5 C0E8 1A14

To claim this, I am signing this object:

@Sinjo
Sinjo / sadness_controller.rb
Last active August 29, 2015 14:00
response initialised without making a request
class SadnessController < ApplicationController
def index
end
end
@Sinjo
Sinjo / jruby_string_lines
Last active December 20, 2015 11:39
JRuby 1.7.4 bug in --2.0 mode JRuby returns an Enumerator. This was the 1.9.3 behaviour, but in 2.0.0 MRI changed to returning an array.
#!/usr/bin/env ruby
lines = ARGV.flat_map { |file_name| File.open(file_name, 'r:bom|utf-8') { |file| file.read.lines } }
p lines
p lines.first
@Sinjo
Sinjo / moving_day.rb
Last active December 17, 2015 20:09
Crazy Ruby MovingDay idea
require 'date'
class Date
alias_method :old_compare, :<=>
def <=> other
if other.respond_to? :to_date
old_compare other.to_date
else
old_compare other
@Sinjo
Sinjo / Generic.java
Created November 10, 2012 23:05
Static Method Generics
import java.util.ArrayList;
import java.util.List;
public class Generic {
public static void main(final String[] args) {
final ArrayList<String> strings = new ArrayList<>();
strings.add("foo");
final String string = staticMethod(strings);