Skip to content

Instantly share code, notes, and snippets.

@lklepner
lklepner / gist:abf18b35fafbd5d14869bc43b7f9abf6
Last active November 23, 2021 14:30 — forked from joshuapowell/gist:e209a4dac5c8187ea8ce
Setup Postgres.app to use PostGIS on OS X

Download and Install Postgres.app

Before we can setup PostGIS we need to have a local version of Postgresql installed and running. The most effecient way to do this is to download and install Postgres.app.

Spatially Enable your Postgres Database

Once Postgres.app is installed in your computers /Applications directory. Open the Terminal and enter the following two commands

psql -d DATABASE_NAME -f /Applications/Postgres.app/Contents/Versions/13/share/postgresql/contrib/postgis-3.1/postgis.sql
@lklepner
lklepner / RNfontWeights.js
Created May 25, 2018 13:11 — forked from knowbody/RNfontWeights.js
React Native Font Weight Cheatsheet iOS
{ fontWeight: '100' }, // Thin
{ fontWeight: '200' }, // Ultra Light
{ fontWeight: '300' }, // Light
{ fontWeight: '400' }, // Regular
{ fontWeight: '500' }, // Medium
{ fontWeight: '600' }, // Semibold
{ fontWeight: '700' }, // Bold
{ fontWeight: '800' }, // Heavy
{ fontWeight: '900' }, // Black

Keybase proof

I hereby claim:

  • I am lklepner on github.
  • I am lklepner (https://keybase.io/lklepner) on keybase.
  • I have a public key ASAu5Ws2rMu0WDc2TcTQ9mAzmBNFqA2WJBbRtZbkHXbxQgo

To claim this, I am signing this object:

#!/bin/bash
#
# The reason of creating this script is that Endpoint Security VPN installs it's own application firewall kext cpfw.kext
# which prevents for example PPTP connections from this computer, which is not appropriate if you need subj connection just
# from time to time
# Usage: checkpoint.sh
# The script checks if Enpoint Security VPN is running. If it is, then it shuts it down, if it is not, it fires it up.
# Or, make an Automator action and paste the script.
# You will need sudo power, of course
#
sudo apt-get install avahi-daemon
sudo apt-get install netatalk
@lklepner
lklepner / background.js
Last active March 3, 2016 17:14
MapWarper Enlarger
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'enlarge.js'
});
});
@lklepner
lklepner / background.js
Created March 3, 2016 16:28 — forked from danharper/background.js
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@lklepner
lklepner / jquery.cach-inputs.js
Last active November 30, 2019 16:16 — forked from martindrapeau/jquery.cach-inputs.js
jQuery plugin to cache HTML inputs using local storage. Restores them upon next page load.
// Cache user inputs into HTML5 local storage. Restore them upon next page load.
// Usage:
// $('body').CacheInputs();
//
// Will store stringified JSON in local storage, against the key you specify
// or 'cache-inputs' if you omit it. See settings below.
//
// Author: Martin Drapeau
//
// Update 12/14/2015 - Added execution of options param to function as a callback when values have finished populating
@lklepner
lklepner / Backgrid.ClientSideFilterWithPickFilter
Created December 9, 2015 14:33 — forked from martindrapeau/Backgrid.ClientSideFilterWithPickFilter
Extend Backgrid ClientSideFilter with a pick filter, to pre-filter data set. Useful to combine text search with a select, checkboxes or radio buttons filters.
// Subclass Backgrid Filter to pass an extra 'pick' filter
Backgrid.ClientSideFilterWithPickFilter = Backgrid.Extension.ClientSideFilter.extend({
pickFilter: null,
setPickFilter: function (attrs) {
this.pickFilter = attrs;
this.search();
return this;
},
makeMatcher: function (query) {
#!/bin/sh
##3.5...10...15...20...25...30...35...40...45...50...55...60...65...70...75...80
##
## Debian / Linux / Ubuntu / LSB
## Startup script for Express / Node.js application with the forever module
##
##
## A modification of "init.d.lsb.ex" by Nicolas Thouvenin
##
##