Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am hasanen on github.
  • I am jonihasanen (https://keybase.io/jonihasanen) on keybase.
  • I have a public key ASBpGhFerx7mPZe_9p20lmXEHdXR1s2YfFjDiTkZqLg_2go

To claim this, I am signing this object:

@hasanen
hasanen / industry.rb
Last active August 29, 2015 14:13
N+1 problem
class Industry
def initialize name, parent=nil
@name, @parent = name, parent
end
def full_name
[parent_name, @name].reject{|n| n.empty?}.join(' / ')
end
def parent_name
@hasanen
hasanen / gist:12593a1e237d5c6e5d57
Last active August 29, 2015 14:06
Check syntax of all yaml-files under current folder (in zsh)
gem install yaml-lint
for file in **/*.yml; do yaml-lint $file; done
@hasanen
hasanen / ssh.expect
Created September 12, 2014 08:23
Expect-script for automating ssh-logins without keys
#!/usr/bin/expect -f
set username [lrange $argv 0 0]
set host [lrange $argv 1 1]
set password [lrange $argv 2 2]
set timeout -1
spawn ssh $username@$host
expect "*?assword:*"
send -- "$password\r"
send -- "\r"