This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SESSION_NAME="dev" | |
APP_PATH="~/path/to/stuff" | |
APP="basename ${APP_PATH}" | |
SERVER="server ssh address" | |
tmux has-session -t ${SESSION_NAME} | |
if [ $? != 0 ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
tmux start-server | |
tmux new-session -d -n tmux-ssh-window -s tmux-ssh | |
for i in $* | |
do | |
tmux split-window -v -t tmux-ssh-window | |
tmux send-keys "ssh $i" C-m | |
tmux select-layout -t tmux-ssh-window main-horizontal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var imgs = new Array; | |
// replace all images by the xxl version | |
$('li > img').each(function(i, item){ | |
var new_src = $(item).prop('src').replace('large', 'xxlarge'); | |
$(item).prop('src', new_src); | |
imgs.push($(item)); | |
}); | |
// kill everything on page | |
$('body').empty(); |
Searching can be an efficient way to navigate the current buffer.
The first search commands we learn are usually /
and ?
. These are seriously cool, especially with the incsearch
option enabled which lets us keep typing to refine our search pattern. /
and ?
really shine when all we want is to jump to something we already have our eyeballs on but they are not fit for every situation:
- when we want to search something that's not directly there, those two commands can make us lose context very quickly,
- when we need to compare the matches.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
tmux has-session -t dev | |
if [ $? != 0 ] | |
then | |
tmux new-session -s dev -n "TEST" -d | |
tmux split-window -h -t dev:0 | |
tmux split-window -v -t dev:0.1 | |
tmux send-keys -t dev:0.0 'cd ~/foo/bar' C-m | |
tmux send-keys -t dev:0.1 'autossh -M 0 -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" test@test -t "cd ~/bar;bash"' C-m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import os | |
import shlex | |
import pprint | |
import re | |
from subprocess import * | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## How to hide API keys from github ## | |
1. If you have already pushed commits with sensitive data, follow this guide to remove the sensitive info while | |
retaining your commits: https://help.github.com/articles/remove-sensitive-data/ | |
2. In the terminal, create a config.js file and open it up: | |
touch config.js | |
atom config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf-8 | |
from os import system | |
PROJECT_PATH = 'path_to_your_project' | |
ACTIVATE_VENV = '. path_to_your_virtualenv/bin/activate' | |
def tmux(command): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!env bash | |
if [ -n "$TMUX" ]; then | |
# we are in a tmux session... | |
for i in `tmux list-panes -a |cut -f 7 -d " "` | |
do | |
# loop through panes in active tmux session and find first active vim pane | |
cmd="$(tmux display -p -t $i '#{pane_current_command}')" #look at this pane's running command | |
cmd="$(basename "$cmd" | tr A-Z a-z)" #normalize basename and lowercase paranoid | |
if [ "${cmd%m}" = "vi" ]; then | |
# We have found a pane with vim running lets send it to the pane with :e (change for split/buffer/tab) |