Skip to content

Instantly share code, notes, and snippets.

View clarketm's full-sized avatar
🐍
Programming

Travis Clarke clarketm

🐍
Programming
View GitHub Profile
@clarketm
clarketm / postgres-cheatsheet.md
Created May 3, 2017 18:38 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

If run with -E flag, it will describe the underlaying queries of the \ commands (cool for learning!).

Most \d commands support additional param of __schema__.name__ and accept wildcards like *.*

@clarketm
clarketm / README.md
Created May 3, 2017 19:05 — forked from jimothyGator/README.md
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@clarketm
clarketm / web-servers.md
Created May 26, 2017 20:43 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@clarketm
clarketm / IntelliJ_IDEA__Perf_Tuning.txt
Created July 1, 2017 20:13 — forked from P7h/IntelliJ_IDEA__Perf_Tuning.txt
Performance tuning parameters for IntelliJ IDEA. Add these params in idea64.exe.vmoptions or idea.exe.vmoptions file in IntelliJ IDEA. If you are using JDK 8.x, please knock off PermSize and MaxPermSize parameters from the tuning configuration.
-server
-Xms2048m
-Xmx2048m
-XX:NewSize=512m
-XX:MaxNewSize=512m
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+UseParNewGC
-XX:ParallelGCThreads=4
-XX:MaxTenuringThreshold=1
@clarketm
clarketm / keybase.md
Created July 2, 2017 06:40
keybase.md

Keybase proof

I hereby claim:

  • I am clarketm on github.
  • I am clarketm (https://keybase.io/clarketm) on keybase.
  • I have a public key ASDFEqdz1w3np0oGp6iGJNedsQAIGYvzod26hJ3675Tkgwo

To claim this, I am signing this object:

@clarketm
clarketm / README.md
Created July 9, 2017 21:31 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@clarketm
clarketm / String.js
Created August 18, 2017 02:30
String.prototype.toTitleCase
String.prototype.toTitleCase = function () {
return this[0].toUpperCase() + this.substring(1).toLowerCase();
};
module.exports = String;
@clarketm
clarketm / regex.md
Last active October 26, 2017 02:23 — forked from vitorbritto/regex.md
Regex Cheat Sheet

Regular Expressions

Basic Syntax

  • /.../: Start and end regex delimiters
  • |: Alternation
  • (): Grouping
@clarketm
clarketm / raspberry-pi-vpn-router.md
Created November 19, 2017 20:41 — forked from superjamie/raspberry-pi-vpn-router.md
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to: