Skip to content

Instantly share code, notes, and snippets.

flipping bits...

andrew quartey drexler

flipping bits...
View GitHub Profile
drexler / apiUriTemplate.vm
Last active Aug 14, 2017
extract AWS API Gateway url information with a mapping template
View apiUriTemplate.vm
"headers": {
#foreach($param in $input.params().header.keySet())
"$param": "$util.escapeJavaScript($input.params().header.get($param))" #if($foreach.hasNext),#end
"pathParams": {
#foreach($param in $input.params().path.keySet())
"$param": "$util.escapeJavaScript($input.params().path.get($param))" #if($foreach.hasNext),#end
drexler / PropertyExistence.vm
Last active Sep 13, 2017
Test for a property existence in a velocity template
View PropertyExistence.vm
#set($flag = false)
#set($missing = "'""""'")
#if("'$input.json('$.aJsonField')'" != $missing)
"JsonFieldIsPresent": $input.json('$.aJsonField')
#set($flag = true)
#if("'$input.json('$.aJsonField')'" == $missing)
drexler / .bashrc
Created Dec 2, 2017
Starting ssh-agent on shell loads
View .bashrc
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
drexler / gist:463676e7c36de6ddb01ea798eb308df8
Last active Feb 8, 2018 — forked from leoapost/gist:4318441
Delete all remote branches, except master
View gist:463676e7c36de6ddb01ea798eb308df8
# Replace REMOTE_NAME with your remote name (e.g. origin)
git branch -r | grep REMOTE_NAME/ | grep -v 'master$' | grep -v HEAD| cut -d/ -f2 | while read line; do git push REMOTE_NAME :$line; done;
View What is


While I'm learning how to use Nginx, I was instructed to update the server_names_hash_bucket_size (/etc/nginx/nginx.conf) value from 32 to 64, but I don't understand why should I increase the value to 64.


References that have been read so far:

drexler /
Created Apr 17, 2018 — forked from ziadoz/
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# Versions
drexler / launch.json
Created Apr 27, 2018
Breakpoints ignored due to missing source maps
View launch.json
"version": "0.2.0",
"configurations": [
"type": "chrome",
"request": "launch",
"name": "Debug Project",
"url": "http://localhost:3000",
"sourceMaps": true,
"webRoot": "${workspaceFolder}",
drexler / presignedUrl.jsonc
Last active May 3, 2018
uploading strategies
View presignedUrl.jsonc
// Option one: directly upload base64 encoded files
// Pros: one network trip
// Cons: large attachments might cause processing delays and eventual lambda timeout
POST /tenants/{tenantId}/uploads
"items": [
"filename": "someLogo",
"filenameWithExtension": "someLogo.ext",

What I implemented:

Closes #XXXXX

drexler /
Created May 24, 2018
Install Chrome under WSL
# assumes you have ubuntu-desktop installed which includes stock libpulse
sudo add-apt-repository ppa:therealkenc/wsl-pulseaudio
sudo apt-get update && sudo apt-get upgrade
# Download the stable or development Chrome .deb package - dev if you want headless functionality
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt -f install # probably