Skip to content

Instantly share code, notes, and snippets.

View gustaflindqvist's full-sized avatar
🚴‍♂️
Focusing

Gustaf Lindqvist gustaflindqvist

🚴‍♂️
Focusing
View GitHub Profile
@gustaflindqvist
gustaflindqvist / install_postgis_osx.sh
Created September 4, 2017 21:45 — forked from juniorz/install_postgis_osx.sh
Installing PostGIS on Mac OS X and Ubuntu
# Some good references are:
# http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x
# http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/
# http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392
#1. Install PostgreSQL postgis and postgres
brew install postgis
initdb /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
@gustaflindqvist
gustaflindqvist / pocket.png
Last active August 11, 2017 11:36
add images
pocket.png
@gustaflindqvist
gustaflindqvist / ci.sh
Created April 6, 2017 07:56 — forked from devn/ci.sh
Simple continuous deployment via Jenkins and Capistrano for all branches. Wire this up with Github post receive hooks from Jenkins for best results.
#!/bin/bash -x
# This should be your "script/ci" checked into version control, and then wired as your sole build step in Jenkins.
#
# Simplifying Assumptions:
#
# * You build all branches
# * You want to deploy all branches.
# * You wired up an SSH key to your CI server appropriately so it can talk to your deployment target(s) via Cap
@gustaflindqvist
gustaflindqvist / index.html
Last active March 13, 2017 11:58
Solve touch position and works great inside iframes
<div id="scroller" style="width: 50%; overflow: auto;">
<iframe height="100%" id="iframe" scrolling="no" width="100%" id="iframe" src="responses.html" />
</div>
@gustaflindqvist
gustaflindqvist / touchevent.js
Created March 13, 2017 11:57
Solve touch position and works great inside iframes
var startY = 0;
var startX = 0;
document.addEventListener("touchstart", function (event) {
alert(11);
parent.window.scrollTo(0, 1);
startY = event.targetTouches[0].pageY;
startX = event.targetTouches[0].pageX;
});
document.addEventListener("touchmove", function (event) {
event.preventDefault();
@gustaflindqvist
gustaflindqvist / .bashrc
Created February 11, 2017 17:59
ssh-agent
SSH_ENV=$HOME/.ssh/environment
# start the ssh-agent
function start_agent {
echo "Initializing new SSH agent..."
# spawn ssh-agent
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
@gustaflindqvist
gustaflindqvist / keybindings.json
Created February 9, 2017 09:43
VSCode keybindings
[
{ "key": "cmd+shift+d", "command": "editor.action.copyLinesDownAction",
"when": "editorTextFocus" },
{ "key": "cmd+shift+7", "command": "editor.action.commentLine",
"when": "editorTextFocus" }
]
@gustaflindqvist
gustaflindqvist / sticky.js
Created December 16, 2016 13:11 — forked from javierarques/sticky.js
Sticky Sideabr With Vanilla Javascript. Detects scroll and set fixed the element. Live example: http://codepen.io/javiarques/pen/vKdgjR
// Sticky Nav Component
var Sticky = (function() {
'use strict';
var CSS_CLASS_ACTIVE = 'is-fixed';
var Sticky = {
element: null,
position: 0,
addEvents: function() {
webpack --display-modules | awk '{print $3$4" "$2}' | grep -v bytes | sort -n | tail -100
@gustaflindqvist
gustaflindqvist / media-queries.scss
Created June 30, 2016 09:15 — forked from chrisjlee/media-queries.scss
All Media Queries breakpoints
@media (min-width:320px) { /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */ }
@media (min-width:480px) { /* smartphones, Android phones, landscape iPhone */ }
@media (min-width:600px) { /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */ }
@media (min-width:801px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ }
@media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ }
@media (min-width:1281px) { /* hi-res laptops and desktops */ }