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 / 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/
@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 / Effect.js
Created April 13, 2017 00:12 — forked from brentvatne/Effect.js
redux-saga alternative with async/await?
/**
* @providesModule Effects
* @flow
*/
import { Linking } from 'react-native';
import AppDataApi from 'AppDataApi';
import Actions from 'Actions';
import ActionTypes from 'ActionTypes';
@clarketm
clarketm / detectBrowserLanguage.js
Created April 4, 2017 16:14 — forked from leipert/detectBrowserLanguage.js
Detect browser language in javascript (utilizing lodash)
// These window.navigator contain language information
// 1. languages -> Array of preferred languages (eg ["en-US", "zh-CN", "ja-JP"]) Firefox^32, Chrome^32
// 2. language -> Preferred language as String (eg "en-US") Firefox^5, IE^11, Safari,
// Chrome sends Browser UI language
// 3. browserLanguage -> UI Language of IE
// 4. userLanguage -> Language of Windows Regional Options
// 5. systemLanguage -> UI Language of Windows
var browserLanguagePropertyKeys = ['languages', 'language', 'browserLanguage', 'userLanguage', 'systemLanguage'];
@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
.header on
.mode column
.nullvalue NULL
@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