Skip to content

Instantly share code, notes, and snippets.


Alex Fedorov waterlink

View GitHub Profile
waterlink / application.scss
Created March 12, 2014 22:22
Accordion without js
View application.scss
@mixin transition($x) {
transition: #{$x};
-o-transition: #{$x};
-moz-transition: #{$x};
-webkit-transition: #{$x};
ul.tabs {
list-style: none;
waterlink / rake.rb
Created March 18, 2014 15:15
RSpec setup for testing rake tasks
View rake.rb
# spec/support/rake.rb
require 'rake'
module Rake::TestHelpers
def run_task(name=subject)
Rake.application.invoke_task name
waterlink / database_cleaner.rb
Last active August 29, 2015 13:57
database_cleaner support config file for RSpec
View database_cleaner.rb
# spec/support/database_cleaner.rb
# inspired by this article
# and later edited according to thoughtbot/suspenders setup (truncation => deletion)
RSpec.configure do |config|
config.before(:suite) do
View rspec_rails_cheetsheet.rb
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
response.should render_template(:index)
response.should redirect_to(movies_path)
waterlink /
Created July 23, 2014 16:10
Skype on docker
# vi: syn=sh :
from ubuntu:12.04
run echo "deb precise main universe multiverse" > /etc/apt/sources.list
run echo "deb precise partner" >> /etc/apt/sources.list
run apt-get -qqyy update
run apt-get install -qqyy x11vnc xvfb skype pulseaudio pavucontrol openssh-server
waterlink / gist:1d03dffd6615a513bea8
Created September 20, 2014 18:48
tmux + vim moves
View gist:1d03dffd6615a513bea8
# smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -l"
View output
target/john: error while loading shared libraries: cannot open shared object file: No such file or directory
waterlink /
Created November 4, 2014 15:29
Rust: Clone, Show, Send & friends
// Clone - for cloning non-owned resources to
// make actions that require ownership
// over them
// Show - if you ever want to log the value of
// this enum
// Send - if you ever want to send it over
// channel to a different task
// PartialEq - if you want to check if two instances
// of this enum are the same
waterlink /
Last active August 29, 2015 14:08
Rust: How to get +50 to karma when implementing an Open Source library ?
// Use these lines in your root crate source code
// This stuff really works. It adds +50 to karma.
// And frequency of trains being delayed when you want to get
// somewhere in hurry really drops :)
waterlink /
Created November 6, 2014 10:17
Some tips
  • Use for github to show a link when creating a pull request
  • git checkout - to switch to previous branch (that way you can switch between 2 branches forth and back)
  • The first commit of a repo, as the first commit cannot be rebased later: git commit -m "init repo" --allow-empty
  • git status -sb