Skip to content

Instantly share code, notes, and snippets.

View ILoGM's full-sized avatar

Alexey Mikka ILoGM

  • FunBox
  • Ulyanovsk, Russia
View GitHub Profile
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active June 2, 2024 11:23
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@gumayunov
gumayunov / tmux.conf
Last active December 23, 2015 08:49
set -g default-command "exec /bin/zsh -l"
set -g bell-action none
set -g history-limit 10000
set -g base-index 1
set -g default-terminal "screen-256color"
#setw -u automatic-rename
@tadast
tadast / .irbrc
Created May 6, 2013 19:46
easy rails route scanning in Rails console
# Put this in your ~/.irbrc for easy rails route scanning
#
# Usage:
# > routes
# => prints all routes
# > routes /GET.*user/i
# => prints routes matching a given regex
# > routes "user"
# => matches strings as well
@gonzedge
gonzedge / application_controller.rb
Created January 5, 2012 02:34
Rails 3.1 - Adding custom 404 and 500 error pages
class ApplicationController < ActionController::Base
# ...
unless Rails.application.config.consider_all_requests_local
rescue_from Exception, with: lambda { |exception| render_error 500, exception }
rescue_from ActionController::RoutingError, ActionController::UnknownController, ::AbstractController::ActionNotFound, ActiveRecord::RecordNotFound, with: lambda { |exception| render_error 404, exception }
end
private
def render_error(status, exception)
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')