Skip to content

Instantly share code, notes, and snippets.

View essoen's full-sized avatar

Stein-Otto Svorstøl essoen

View GitHub Profile
@essoen
essoen / handlebars.js
Created November 20, 2015 15:53
Handlebars-helper
'use strict';
var handlebars = function() {
/**
*
* @param templateName
* @param containerName
* @param context
*/
var setup = function(templateName, containerName, context) {
# Install subversion
sudo apt-get -y install subversion
# Install g++
sudo apt-get -y install g++
# Install Hierarchical Data Format library
# NOTE: This library is not necessarily needed, but was required
# in order for this to compile against a clean Ubuntu 12.04 LTS system.
# I didn't need it on a clean EC2 Ubuntu 12.10 instance, so
@essoen
essoen / web.xml
Last active May 6, 2022 04:05
CORS * for GeoServer with Tomcat add following to `/var/lib/tomcat7/webapps/geoserver/WEB-INF/web.xml`
<filter>
<filter-name>CorsFilter</filter-name>
<filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
<init-param>
<param-name>cors.allowed.origins</param-name>
<param-value>*</param-value>
</init-param>
<init-param>
<param-name>cors.allowed.methods</param-name>
<param-value>GET,POST,HEAD,OPTIONS,PUT</param-value>
@essoen
essoen / reset-postgres-password.md
Last active August 18, 2016 13:58
How to reset a postgres password on ubuntu
  1. sudo -u postgres psql
  2. \password and set password
  3. \q
@essoen
essoen / prepare-commit-msg.sh
Created January 25, 2018 13:27 — forked from bartoszmajsak/prepare-commit-msg.sh
How to automatically prepend git commit with a branch name
#!/bin/bash
# This way you can customize which branches should be skipped when
# prepending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
fi
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_NAME="${BRANCH_NAME##*/}"
@essoen
essoen / readwise-later-to-pocket.py
Last active July 24, 2024 17:11
Script to move Readwise later to Pocket. Used with Zapier
import datetime
import requests
output = {
"Results": []
}
def fetch_reader_document_list_api(token = None, updated_after=None, location=None, category=None):
full_data = []
next_page_cursor = None