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 / .tmux.conf
Created February 27, 2017 15:03 — forked from subfuzion/.tmux.conf
My .tmux.conf for tmux 2.1 (with fixes for mouse breakage)
# Inspirations:
# http://mutelight.org/practical-tmux
# http://zanshin.net/2013/09/05/my-tmux-configuration/
# http://files.floriancrouzat.net/dotfiles/.tmux.conf
# http://stackoverflow.com/questions/9628435/tmux-status-bar-configuration
# https://github.com/Lokaltog/powerline
# https://github.com/remiprev/teamocil
# http://superuser.com/questions/74492/whats-the-best-prefix-escape-sequence-for-screen-or-tmux
# http://blog.hawkhost.com/2010/07/02/tmux-%E2%80%93-the-terminal-multiplexer-part-2/
#
@clarketm
clarketm / sendmail_setup.md
Created February 26, 2017 07:19 — forked from kany/sendmail_setup.md
Setup SENDMAIL on Mac OSX Yosemite
@clarketm
clarketm / bash-cheat-sheet
Created February 10, 2017 04:38
BASH Cheat Sheet
B A S H C H E A T S H E E T
to page output forward (only): command filename | more
to page output forward & back: command filename | less
to print a dataset: lp datasetname (-d printerid) (-o landscape)
USE OF QUOTATION MARKS
echo "$varname" = echo The value of \$varname is \"$varname\"
= echo "The value of \$varname is \"$varname\"."
$fred='Four spaces between these words.'
@clarketm
clarketm / google-dorks
Created January 30, 2017 10:01 — forked from stevenswafford/google-dorks
Listing of a number of useful Google dorks.
" _ _ "
" _ /|| . . ||\ _ "
" ( } \||D ' ' ' C||/ { % "
" | /\__,=_[_] ' . . ' [_]_=,__/\ |"
" |_\_ |----| |----| _/_|"
" | |/ | | | | \| |"
" | /_ | | | | _\ |"
It is all fun and games until someone gets hacked!
@clarketm
clarketm / destructuring.js
Created December 11, 2016 17:15 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
@clarketm
clarketm / elasticsearch-cheatsheet.txt
Created November 15, 2016 06:12 — forked from stephen-puiszis/elasticsearch-cheatsheet.txt
Elasticsearch Cheatsheet - An Overview of Commonly Used Elasticsearch API Endpoints and What They Do
# Elasticsearch Cheatsheet - an overview of commonly used Elasticsearch API commands
# cat paths
/_cat/allocation
/_cat/shards
/_cat/shards/{index}
/_cat/master
/_cat/nodes
/_cat/indices
/_cat/indices/{index}
@clarketm
clarketm / checkNested.js
Created October 6, 2016 18:00
Test for nested JavaScript object key
/**
* Test for nested JavaScript object key
*
* @memberof Object.prototype
* @param {...String} key string(s)
* @return {Boolean} has nested key
*
* [http://stackoverflow.com/questions/2631001/javascript-test-for-existence-of-nested-object-key]
*/
Object.prototype.checkNested = function() {
@clarketm
clarketm / byString.js
Last active April 21, 2017 04:09
Access nested JavaScript object value from string key
/**
* Access nested JavaScript object value from string key
*
* @memberof Object.prototype
* @param s {String} property string
* @return {String} value for property string
*
* [http://stackoverflow.com/questions/6491463/accessing-nested-javascript-objects-with-string-key]
*/
Object.prototype.byString = function(s) {
@clarketm
clarketm / get_oauth2_token.py
Last active August 30, 2023 19:42
How to get Google OAuth 2.0 access token in console using the Python API
#!/usr/bin/env python
'''
This script will attempt to open your webbrowser,
perform OAuth 2.0 authentication and print your access token.
To install dependencies from PyPI:
$ pip install oauth2client
Then run this script:
@clarketm
clarketm / gist:861371f50d1f5fad09568490834315e5
Created August 18, 2016 17:30 — forked from tonymtz/gist:d75101d9bdf764c890ef
Uninstall nodejs from OSX Yosemite
# first:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
# go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*