Skip to content

Instantly share code, notes, and snippets.

View MattMS's full-sized avatar
🤔

Matt McKellar-Spence MattMS

🤔
View GitHub Profile
@MattMS
MattMS / Windows apps.md
Last active August 29, 2015 14:20
Apps I use on Windows.
@MattMS
MattMS / Vim spaces.md
Last active August 29, 2015 14:20
Find spaces in Vim

Find spaces in Vim

Find leading spaces

^\s*[ ]

The square brackets around the space are not needed, except here to

@MattMS
MattMS / copy_table_to_other.sql
Created May 11, 2015 04:57
Copy part of a table into a new table.
INSERT INTO other_schema.new_table (id, name, definition)
SELECT old_id, old_name, old_definition
FROM original_schema.current_table
WHERE old_name IS NOT NULL;
@MattMS
MattMS / HTTPS_NoScript.txt
Last active September 18, 2015 11:56
Force these sites to use HTTPS with NoScript
aws.amazon.com
bethsoft.com
couchdb.apache.org
data.gov.au
docs.aws.amazon.com
docs.docker.com
docs.mongodb.org
docs.wagtail.io
en.wikipedia.org
geck.bethsoft.com
@MattMS
MattMS / gunicorn_conf.py
Last active August 29, 2015 14:22
Gunicorn configuration example.
# Use this configuration with:
# cd /svr/flask
# ENV/bin/gunicorn -c gunicorn_conf.py manage:app
import multiprocessing
# http://docs.gunicorn.org/en/latest/configure.html#bind
#
bind = '127.0.0.1:8000'
@MattMS
MattMS / Docker_GeoServer.sh
Created June 14, 2015 11:45
GeoServer and PostGIS in Docker.
docker run --name "postgis" -d -t kartoza/postgis
docker run --name "geoserver" --link postgis:postgis -p 8080:8080 -d -t kartoza/geoserver
@MattMS
MattMS / sql_server_geoserver.sql
Created June 23, 2015 08:02
Create SQL Server geometry table for GeoServer.
CREATE TABLE GEOMETRY_COLUMNS(
F_TABLE_SCHEMA VARCHAR(30) NOT NULL,
F_TABLE_NAME VARCHAR(30) NOT NULL,
F_GEOMETRY_COLUMN VARCHAR(30) NOT NULL,
COORD_DIMENSION INTEGER,
SRID INTEGER NOT NULL,
TYPE VARCHAR(30) NOT NULL,
UNIQUE(F_TABLE_SCHEMA, F_TABLE_NAME, F_GEOMETRY_COLUMN),
CHECK(
TYPE IN ('POINT','LINE', 'POLYGON', 'COLLECTION', 'MULTIPOINT', 'MULTILINE', 'MULTIPOLYGON', 'GEOMETRY')
@MattMS
MattMS / Python_time_delta_from_text.py
Created August 28, 2015 05:13
Create a Python timedelta from text.
from datetime import timedelta
import logging
logger = logging.getLogger(__name__)
def get_time_delta_from_text(text):
kwargs = dict()
for pair in text.split(','):
name, sep, value = pair.partition('=')
@MattMS
MattMS / vim_fix_slow_sql.vim
Created September 29, 2015 04:35
Fix delay when typing Ctrl+C in Vim with SQL files.
" https://www.reddit.com/r/vim/comments/2om1ib/how_to_disable_sql_dynamic_completion/
let g:omni_sql_no_default_maps = 1
@MattMS
MattMS / Lubuntu install.sh
Created October 26, 2015 00:17
Some important packages after installing Lubuntu.
#!/bin/sh
sudo apt-get install pulseaudio