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 / index.html
Created April 3, 2017 02:04 — forked from jerome-labidurie/index.html
Synology SSO server login example
<html>
<head>
<!-- include Synology SSO js -->
<script src="http://ds:5000/webman/sso/synoSSO-1.0.0.js"></script>
</head>
<body>
<script>
/** Display login/logout button.
@clarketm
clarketm / README.md
Created March 6, 2017 20:10 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@clarketm
clarketm / apsw.md
Created March 3, 2017 09:10 — forked from scottstanfield/apsw.md
APSW: a better sqlite shell

APSW: A better Sqlite3 shell

If you use sqlite3 as a shell to manage SQLite databases, then you might want to consider using [APSW][1], "Another Python SQLite Wrapper".

When run through the Python interpreter, the APSW library has an interactive shell, much like the one included with sqlite3, but with some added functionality like .autoimport. A list of [what APSW does better][2] can be found in the docs.

@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 / 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) {