Skip to content

Instantly share code, notes, and snippets.

View chazdky's full-sized avatar

Chaz Davis chazdky

View GitHub Profile
@brettinternet
brettinternet / tmux-setup.sh
Created July 5, 2017 14:07
a simple shell script to setup my django dev env with tmux
#!/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 ]
#!/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
@leobossmann
leobossmann / extract.js
Created December 6, 2016 15:54
Extract and rename images from Pixieset
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();
@romainl
romainl / Vim_pushing_built-in_features_beyond_their_limits.markdown
Last active March 14, 2025 12:03
Vim: pushing built-in features beyond their limits

Vim: pushing built-in features beyond their limits

The situation

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.
@B-Galati
B-Galati / tmux.sh
Last active September 8, 2022 13:00
tmux script example
#!/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
#!/usr/bin/env python
import sys
import os
import shlex
import pprint
import re
from subprocess import *
## 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
@fisadev
fisadev / work
Created December 3, 2015 14:57
A python script to launch my tmux things at once
#!/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):
anonymous
anonymous / v.sh
Created November 25, 2015 00:41
#!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)