Skip to content

Instantly share code, notes, and snippets.

View michaeldeol's full-sized avatar

Michael Deol michaeldeol

View GitHub Profile
@michaeldeol
michaeldeol / .vimrc
Last active August 29, 2015 14:14 — forked from andyfowler/.vimrc
" tmux will only forward escape sequences to the terminal if surrounded by a DCS sequence
" http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTinkbdoZ8eNR1X2UobLTeww1jFrvfJxTMfKSq-L%2B%40mail.gmail.com&forum_name=tmux-users
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
=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')
SELECT CONCAT(table_schema, '.', table_name),
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows,
CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA,
CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx,
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size,
ROUND(index_length / data_length, 2) idxfrac
FROM information_schema.TABLES
ORDER BY data_length + index_length DESC
LIMIT 30;
@michaeldeol
michaeldeol / gist:7645611
Last active December 29, 2015 08:49 — forked from istepanov/gist:3950977
Remove PHPStorm 7
#!/usr/bin/sh
rm -rf "$HOME/Library/Preferences/WebIde70"
rm -rf "$HOME/Library/Caches/WebIde70"
rm -rf "$HOME/Library/Application Support/WebIde70"
rm -rf "$HOME/Library/Logs/WebIde70"
@michaeldeol
michaeldeol / assessment.md
Created May 11, 2012 16:17 — forked from rmurphey/assessment.md
assessment

What do you think the following code does?

function fn(msg, time) {
  setTimeout(function() {
    console.log(msg);
  }, time);
}

fn('it works', 1000);
@michaeldeol
michaeldeol / thumbnails.js
Created May 4, 2011 20:18 — forked from jiggliemon/thumbnails.js
This should contain the stand alone code for the tumbnails, and their related functionality
//
// The code in this file should:
// - build a thumbnail container
// - populate the container with thumbnails
// - when a thumbnail is clicked, the main image should be updated with the appropriate image
//
// This code should be optional, and initiate itself if included.
//
(function(){
var thumbContainer = document.createDocumentFragment();
/*
Form Elements
-- Styled to look like native Safari on OS X.
-- Drop-down <select> menus are unaffected.
-- Buttons are unaffected. Native OS style.
*/
input,
button,
select,