Skip to content

Instantly share code, notes, and snippets.

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jstnlvns
jstnlvns / git: gitignore.md
Created November 16, 2018 19:42
a gitignore cheatsheet

Git sees every file in your working copy as one of three things:

  1. tracked - a file which has been previously staged or committed;
  2. untracked - a file which has not been staged or committed; or
  3. ignored - a file which Git has been explicitly told to ignore.

Ignored files are usually build artifacts and machine generated files that can be derived from your repository source or should otherwise not be committed. Some common examples are:

  • dependency caches, such as the contents of /node_modules or /packages
  • compiled code, such as .o, .pyc, and .class files
@jstnlvns
jstnlvns / init.lua
Last active March 22, 2024 19:55
Hammerspoon INIT
hs.window.animationDuration = 0
-- Keys Being Used
-- hyper q = Mailmate
-- hyper w = GTD
-- hyper e = File/Document Management
-- hyper/meh r = Swinson/Safari open tab in new window
-- hyper/meh t = Default Browser
-- hyper y = Emacs
@jstnlvns
jstnlvns / csvtomd_pastebot.py
Created February 12, 2018 18:40
For use in Pastebot to convert CSV formatted text with headers to a markdown table.
#!/usr/bin/python
import sys
import csv
text = sys.stdin
text = text.readlines()
csvreader = csv.reader(text, delimiter=',', quotechar='"')
rowcnt = 0
for row in csvreader:
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jstnlvns
jstnlvns / sort_csv.py
Last active August 29, 2015 14:26 — forked from JimHaughwout/sort_csv.py
Sort CSV file by multiple columns, writing output to sorted CSV file.
#! /usr/bin/env python
"""
Sort CSV file by multiple columns, writing output to sorted CSV file.
Recommended for files saved in Windows CSV format.
Useful for situations where data file is too large for Excel.
: param source_file.csv : source csv file. Must end in .csv
: param sort column 1 : first sort in Excel-like column number (i.e., 1 ... N)
Use negative number to indicate descending sort,
Positive number to indicate ascending sort_step
@jstnlvns
jstnlvns / ping.sh
Last active August 29, 2015 14:26
Pinging Multiple Hosts
#!/bin/bash
rm /var/www/html/out.html
HOSTS="www.google.com www.duckduckgo.com www.stackoverflow.com"
COUNT=5
dd=$(date)
echo "<html><body>$dd<table><tr><th>HOST</th><th>STATUS</th></tr>" >> /var/www/html/out.html
@jstnlvns
jstnlvns / SSLPoke.java
Last active August 29, 2015 14:24 — forked from 4ndrej/SSLPoke.java
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.*;
/** Establish a SSL connection to a host and port, writes a byte and
* prints the response. See
* http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services
*/
public class SSLPoke {
public static void main(String[] args) {
@jstnlvns
jstnlvns / service-monitor.py
Created April 20, 2015 18:28
Service Monitoring
#! /usr/bin/env python
# Tweaked version of Motoma's service monitor script.
# https://gist.github.com/Motoma/828694#file-service-monitor-2-py
from os import system
from urllib2 import urlopen
from socket import socket
from sys import argv
from time import asctime

Keybase proof

I hereby claim:

  • I am jstnlvns on github.
  • I am jstn (https://keybase.io/jstn) on keybase.
  • I have a public key whose fingerprint is 8BF6 6B08 24D6 4FF9 7AF4 ECAC 225F 40F6 A7EF 3AD9

To claim this, I am signing this object: