Skip to content

Instantly share code, notes, and snippets.

🐍
Programming

Travis Clarke clarketm

View GitHub Profile
@clarketm
clarketm / nginx.conf
Created Jan 27, 2019 — forked from weapp/nginx.conf
Return common errors as json in Nginx
View nginx.conf
error_page 500 /500.html;
location /500.html{
return 500 '{"error": {"status_code": 500,"status": "Internal Server Error"}}';
}
error_page 502 /502.html;
location /502.html{
return 502 '{"error": {"status_code": 502,"status": "Bad Gateway"}}';
}
@clarketm
clarketm / .gitignore
Created Dec 2, 2018 — forked from marsam/.gitignore
An IPython extension to pretty print python AST.
@clarketm
clarketm / curl.md
Created Aug 19, 2018 — forked from subfuzion/curl.md
curl POST examples
View curl.md

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@clarketm
clarketm / python-es6-comparison.md
Created Jul 21, 2018 — forked from revolunet/python-es6-comparison.md
# Python VS ES6 syntax comparison
View python-es6-comparison.md

Python VS ES6 syntax comparison

Python syntax here : 2.7 - online REPL

Javascript ES6 via Babel transpilation - online REPL

Imports

import math
@clarketm
clarketm / README-Template.md
Created May 25, 2018 — forked from PurpleBooth/README-Template.md
A template to make good README.md
View README-Template.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@clarketm
clarketm / import_csv_to_mongo
Created Jan 24, 2018 — forked from mprajwala/import_csv_to_mongo
Store CSV data into mongodb using python pandas
View import_csv_to_mongo
#!/usr/bin/env python
import sys
import pandas as pd
import pymongo
import json
def import_content(filepath):
mng_client = pymongo.MongoClient('localhost', 27017)
@clarketm
clarketm / import_csv_to_mongo
Created Jan 24, 2018 — forked from mprajwala/import_csv_to_mongo
Store CSV data into mongodb using python pandas
View import_csv_to_mongo
#!/usr/bin/env python
import sys
import pandas as pd
import pymongo
import json
def import_content(filepath):
mng_client = pymongo.MongoClient('localhost', 27017)
View Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@clarketm
clarketm / Makefile
Created Dec 3, 2017 — forked from postmodern/Makefile
A generic Makefile for building/signing/install bash scripts
View Makefile
NAME=project
VERSION=0.0.1
DIRS=etc lib bin sbin share
INSTALL_DIRS=`find $(DIRS) -type d 2>/dev/null`
INSTALL_FILES=`find $(DIRS) -type f 2>/dev/null`
DOC_FILES=*.md *.txt
PKG_DIR=pkg
PKG_NAME=$(NAME)-$(VERSION)
View raspberry-pi-vpn-router.md

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:

You can’t perform that action at this time.