Skip to content

Instantly share code, notes, and snippets.

Avatar

Raphael Kolm rkz

View GitHub Profile
@lmakarov
lmakarov / lambda-basic-auth.js
Created Aug 30, 2017
Basic HTTP Authentication for CloudFront with Lambda@Edge
View lambda-basic-auth.js
'use strict';
exports.handler = (event, context, callback) => {
// Get request and request headers
const request = event.Records[0].cf.request;
const headers = request.headers;
// Configure authentication
const authUser = 'user';
const authPass = 'pass';
@btoueg
btoueg / sellsy.py
Created Mar 2, 2015
Sellsy API python with OAuth
View sellsy.py
# -*- coding: utf-8 -*-
import json
import requests
from requests_oauthlib import OAuth1
from oauthlib.oauth1 import SIGNATURE_PLAINTEXT, SIGNATURE_TYPE_BODY
consumer_token = '***'
consumer_secret = '***'
user_token = '***'
@x-Code-x
x-Code-x / readme_install_node
Created Apr 30, 2012
Install npm node.js on Debian Squeeze / Wheezy / Linux Mint Debian Edition
View readme_install_node
#Quick cp from http://sekati.com/etc/install-nodejs-on-debian-squeeze
#
#Needed to install TileMill from MapBox
#
#Installs node.js which has npm bundled
#
#Build Dependencies
sudo apt-get update && apt-get install git-core curl build-essential openssl libssl-dev
View fb_helpers.py
import base64
import hashlib
import hmac
import simplejson as json
def base64_url_decode(inp):
padding_factor = (4 - len(inp) % 4) % 4
inp += "="*padding_factor
return base64.b64decode(unicode(inp).translate(dict(zip(map(ord, u'-_'), u'+/'))))