Skip to content

Instantly share code, notes, and snippets.

@wellsie
wellsie / index.html
Created October 29, 2019 18:00 — forked from tmichel/index.html
simple websocket example with golang
<html>
<head>
<title>WebSocket demo</title>
</head>
<body>
<div>
<form>
<label for="numberfield">Number</label>
<input type="text" id="numberfield" placeholder="12"/><br />
@wellsie
wellsie / workspace.sh
Created April 11, 2018 14:13 — forked from dixson3/workspace.sh
Create and manage a case-sensitive disk-image on OSX. This is great when you have a need to work with case-sensitive repos on a mac.
#!/bin/bash
# where to store the sparse-image
WORKSPACE=~/Documents/workspace.dmg.sparseimage
create() {
hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 60g -volname workspace ${WORKSPACE}
}
detach() {
@wellsie
wellsie / master.vm
Created July 8, 2017 20:56 — forked from rpgreen/master.vm
API Gateway "Send Everything" Mapping Template
## API Gateway "Send Everything" Mapping Template - Ryan Green - ryang@ryang.ca
## See http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html
#set($allParams = $input.params())
{
"body-json" : "$input.json('$')",
"params" : {
#foreach($type in $allParams.keySet())
#set($params = $allParams.get($type))
"$type" : {
#foreach($paramName in $params.keySet())
@wellsie
wellsie / android_instructions.md
Last active May 8, 2017 18:37 — forked from patrickhammond/android_instructions.md
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@wellsie
wellsie / GIF-Screencast-OSX.md
Created June 23, 2016 01:21 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@wellsie
wellsie / reverse.py
Last active May 6, 2016 17:58 — forked from nsfyn55/reverse.py
Reverse Singly Linked List Python
class Node:
def __init__(self, value, next):
self.value = value
self.next = next
def dump(self):
print self.value
if self.next is not None:
self.next.dump()
@wellsie
wellsie / reflection.go
Created April 24, 2016 19:42 — forked from drewolson/reflection.go
Golang Reflection Example
package main
import (
"fmt"
"reflect"
)
type Foo struct {
FirstName string `tag_name:"tag 1"`
LastName string `tag_name:"tag 2"`
@wellsie
wellsie / install-ffmpeg-amazon-linux.sh
Last active March 28, 2016 04:20 — forked from gboudreau/install-ffmpeg-amazon-linux.sh
How to compile ffmpeg on Amazon Linux (EC2)
#!/bin/sh
# Based on instructions found here: http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat#FFMpegInstallationonCentOSandRedHat-InstallX264
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF
@wellsie
wellsie / k8s-release-urls.sh
Last active October 20, 2016 01:56 — forked from jbeda/gist:2cae7dd22a453c3caa94
URLs for kubernetes release artifacts
$ gsutil ls -R gs://kubernetes-release/release/v1.2.0 | sed 's|gs://kubernetes-release|https://storage.googleapis.com/kubernetes-release|; /^.*:$/d; /^$/d'
https://storage.googleapis.com/kubernetes-release/release/v1.2.0/kubernetes-client-darwin-386.tar.gz
https://storage.googleapis.com/kubernetes-release/release/v1.2.0/kubernetes-client-darwin-386.tar.gz.md5
https://storage.googleapis.com/kubernetes-release/release/v1.2.0/kubernetes-client-darwin-386.tar.gz.sha1
https://storage.googleapis.com/kubernetes-release/release/v1.2.0/kubernetes-client-darwin-amd64.tar.gz
https://storage.googleapis.com/kubernetes-release/release/v1.2.0/kubernetes-client-darwin-amd64.tar.gz.md5
https://storage.googleapis.com/kubernetes-release/release/v1.2.0/kubernetes-client-darwin-amd64.tar.gz.sha1
https://storage.googleapis.com/kubernetes-release/release/v1.2.0/kubernetes-client-linux-386.tar.gz
https://storage.googleapis.com/kubernetes-release/release/v1.2.0/kubernetes-client-linux-386.tar.gz.md5
https://storage.googleapis.com/kub
@wellsie
wellsie / az.bash
Created February 7, 2016 15:26 — forked from rfletcher/az.bash
List all AWS availability zones
# List all AWS availability zones
#
# Depends on:
# - `aws`: https://aws.amazon.com/cli/ (installed and configured with credentials)
# - `jq`: https://stedolan.github.io/jq/
#
for REGION in $(
aws ec2 describe-regions | jq --raw-output '.Regions | map(.RegionName) | .[]' | sort
); do
aws ec2 describe-availability-zones --region "$REGION" |