Skip to content

Instantly share code, notes, and snippets.

View mAlishera's full-sized avatar

Ekaterina mAlishera

  • Berlin, Germany
View GitHub Profile
@mAlishera
mAlishera / damerau_levenshtein.go
Created March 3, 2019 21:57
Proper Damerau-Levenshtein edit distance algorithm in Go
package damerau_levenshtein
// O(|s| x |t|)
// a and b are zero-indexed, not one-indexed
func Distance(s, t string) int {
var i, j, cost int
m, n := len(s), len(t)
d := make([][]int, m+1)
for i = 0; i <= m; i++ {
@mAlishera
mAlishera / damerau_levenshtein_distance.rb
Created March 3, 2019 21:34 — forked from dhruvasagar/damerau_levenshtein_distance.rb
Damerau-Levenshtein distance for ruby in C
#!/usr/bin/env ruby1.9
# encoding: UTF-8
require 'rubygems'
require 'inline'
require 'time'
class DamerauLevenshtein
def distance(str1, str2, block_size=2, max_distance=10)
res = distance_utf(str1.unpack("U*"), str2.unpack("U*"), block_size, max_distance)
(res > max_distance) ? nil : res
@mAlishera
mAlishera / bash-cheatsheet.sh
Created April 9, 2017 19:44 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.