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
Timeline | |
production state ->| | |
| | |
|<- migration that changes User entities, developer #1, no tests for the migration | |
| | |
|<- migration that renames User to Customer, developer #2, no tests for the migration | |
| | |
| | |
deploy -> | | |
| |
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
1 module HasFinalize | |
2 def self.included(base) | |
3 base.class_eval do | |
4 private | |
5 | |
6 def finalize(&block) | |
7 ObjectSpace.define_finalizer(self, &block) | |
8 end | |
9 end | |
10 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
% **Quicksort** | |
% The head of the list is taken as the pivot; the list is then split according to those elements smaller | |
% than the pivot and the rest. These two lists are then recursively sorted by quicksort, and joined together, | |
% with the pivot between them. | |
-module(test). | |
-export([qsort/1]). | |
reverse(List) -> | |
reverse(List, []). |
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
msort([]) -> | |
[]; | |
msort([H|[]]) -> | |
[H]; | |
msort(List) -> | |
[H|L] = divide2(List), | |
msort(msort(H), msort(L)). | |
msort(List1, List2) -> | |
msort(List1, List2, []). |
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
Warden::Strategies.add(:password) do | |
def authenticate! | |
service = UserLoginService.new(params['email'], params['password']) | |
if service.authenticate? | |
success!(service.user) | |
else | |
throw :warden | |
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
require 'set' | |
class I18n | |
def self.t(t, options = {}) | |
"#{t} - #{options}" | |
end | |
end | |
class Enum | |
class TokenNotFoundError < StandardError; 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
directory 'gitstats' | |
EXCLUDE_FILES = /(^vendor\/)|(^public\/)|(\.(jpg|png|gif|bmp|yaml|yml|jar|zip|gz|rar)$)/.freeze | |
Member = Struct.new(:email, :lines) do | |
include Comparable | |
def <=>(other) | |
self.lines <=> other.lines | |
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
#lang racket | |
(require rackunit) | |
;; BEGIN | |
(define (sqr x) | |
(* x x)) | |
(define (max x y) | |
(if (> x y) x y)) |
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
smartctl 6.3 2014-07-26 r3976 [x86_64-linux-4.0.0-0.rc3.git2.1.fc23.x86_64] (local build) | |
Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org | |
=== START OF INFORMATION SECTION === | |
Device Model: Samsung SSD 850 PRO 256GB | |
Serial Number: S1SUNSAFA06649M | |
LU WWN Device Id: 5 002538 8a0713409 | |
Firmware Version: EXM01B6Q | |
User Capacity: 256,060,514,304 bytes [256 GB] | |
Sector Size: 512 bytes logical/physical |