Skip to content

Instantly share code, notes, and snippets.

View collegeimprovements's full-sized avatar
💭
☀️

Arpit Shah collegeimprovements

💭
☀️
View GitHub Profile
@collegeimprovements
collegeimprovements / My Gem Collcetion
Created February 3, 2014 06:21
Ruby gems collection to make things easier and more intuitive :) It's fun. Read List, Read Documentation and Try it out. Make them a part of workflow if i find it useful and fun.
1. Highline [http://highline.rubyforge.org/]
2. Nokogiri [http://nokogiri.org/]
3. Mechanise [http://mechanize.rubyforge.org/]
4. Rails and Sinatra
5.
@collegeimprovements
collegeimprovements / app.js
Last active August 29, 2015 14:25
gist to fill textboxes with casperjs
var casper = require('casper').create({logLevel: "debug"});
casper.start('https://alarmadmin.alarm.com/default.aspx', function() {
casper.echo(this.getTitle());
if(this.exists('#txtUsername'))
{casper.echo('\n\n#txtUsername found***>>>');}else{casper.echo('\n\n#txtUsername NOT found***>>>');}
if(this.exists('#txtPassword'))
@collegeimprovements
collegeimprovements / app.js
Created July 20, 2015 05:57
Casperjs for alarm active admin - play ground
(function() {
var config = {u:'#txtUsername', p:'#txtPassword'};
var siteCred = {u:'cybagereg', p:'Cybage1'};
var fs = require('fs');
var list_of_files = ['aha.png','pre.png','Finally_new_page.png'];

Capybara

save_and_open_page

Matchers

have_button(locator)
map l nextTab
map s previousTab
let mapleader = "<Space>"
map <Leader>gh :tabnew& https://github.com/collegeimprovements<CR>
map <Leader>Gh :open https://github.com/collegeimprovements<CR>
set dimhintcharacters
@collegeimprovements
collegeimprovements / vim-homebrew
Created October 21, 2015 03:40
How to install vim. Install Ruby, Python with Rbenv and Pyenv ideally. Install homebrew and then install vim with the following commands. Use `brew info vim` for help.
brew install vim --disable-nls --override-system-vi --with-client-server --with-lua --with-luajit --with-python3 --enable-cscope --with-features=huge
@collegeimprovements
collegeimprovements / keyrepeat.shell
Last active November 17, 2015 11:41 — forked from kconragan/keyrepeat.shell
Sublime Text - Vintage J key problem solved - Enable key repeat in Apple Lion for Sublime Text in Vim mode
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
@collegeimprovements
collegeimprovements / sublime-icloud.txt
Created October 27, 2015 19:41 — forked from Chrisedmo/sublime-icloud.txt
Sync Sublime Text Plugins iCloud Drive
Sublime Text Plugins iCloud Drive
First Machine
On your first machine, use the following instructions.
$ cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/
$ mkdir ~/Library/Mobile\ Documents/com\~apple\~CloudDocs/Web\ Dev/Plugins
$ mv User ~/Library/Mobile\ Documents/com\~apple\~CloudDocs/Web\ Dev/Plugins
$ ln -s ~/Library/Mobile\ Documents/com\~apple\~CloudDocs/Web\ Dev/Plugins/User

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

@collegeimprovements
collegeimprovements / install-tmux
Last active December 19, 2015 09:50 — forked from rothgar/install-tmux
Install tmux 2.0 on rhel/centos 6
# Install tmux on Centos release 6.5
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -xvzf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/usr/local