Skip to content

Instantly share code, notes, and snippets.

cat ~/.ssh/_config | grep -v 'github' | awk '/^Host/ { if($2 !~ /\*/) print $2;}' | xargs -I host ssh host 'cat /etc/motd'
@imtapps
imtapps / gist:5885324
Created June 28, 2013 14:59
Search commits from a date to find any migrations
git log --stat --summary --since=2013-06-01 | grep "|" | cut -d "|" -f 1 | sort -u | grep migration
@imtapps
imtapps / analyze.sh
Created January 15, 2014 19:55
Build Tree of dependencies between projects
#!/bin/bash
DONE=()
WORKING=`pwd`
class DummyMeta(type):
@property
def thing1(self):
return "in thing1"
class Dummy(object):
__metaclass__ = DummyMeta
# thing1 = 'asldfkj'
@imtapps
imtapps / gist:9055924
Created February 17, 2014 18:10
Format an XML file in vim
:read !xmllint --format %
<!DOCTYPE html>
<html>
<head>
<title>Media Query Example</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="main-content">
<div class="container">
node_installed = `which npm`
if node_installed.empty?
execute "cd ~ && wget 'http://nodejs.org/dist/v0.10.25/node-v0.10.25-linux-x64.tar.gz'"
execute "cd ~ && tar xvzf node-v0.10.25-linux-x64.tar.gz"
execute "cd ~ && mv node-v0.10.25-linux-x64 nodejs"
execute "cd /usr/bin/ && ln -s ~/nodejs/bin/node /usr/bin/node"
execute "cd /usr/bin/ && ln -s ~/nodejs/bin/npm /usr/bin/npm"
end
@imtapps
imtapps / .vimrc
Last active August 29, 2015 14:01
Resize Panes in Vim with this config using arrow keys
nnoremap <Left> :vertical resize +1<CR>
nnoremap <Right> :vertical resize -1<CR>
nnoremap <Up> :resize +1<CR>
nnoremap <Down> :resize -1<CR>
" Uncommenting the following line breaks the previous lines
" nnoremap <Esc> :nohlsearch<CR>
@imtapps
imtapps / progress.py
Created July 14, 2014 16:25
Show the progress without scrolling
import sys
import time
for i in range(100):
sys.stderr.write('\r')
sys.stderr.write(str(i))
time.sleep(.01)
@imtapps
imtapps / designer.html
Created August 19, 2014 12:43
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">