Skip to content

Instantly share code, notes, and snippets.

View andykingking's full-sized avatar
🙊

Andrew King andykingking

🙊
View GitHub Profile
@andykingking
andykingking / README.rst
Last active August 5, 2018 23:31
Branching workflow

cmcrc-progress

@andykingking
andykingking / install_hipchat4.sh
Last active July 6, 2018 06:50
Setup hipchat4 for ubuntu
#!/usr/bin/env bash
LIBSSL_FILE="libssl1.0.2_1.0.2o-1_amd64.deb"
wget "http://ftp.us.debian.org/debian/pool/main/o/openssl1.0/$LIBSSL_FILE"
sudo dpkg -i "$LIBSSL_FILE"
sudo ln -s "/usr/lib/x86_64-linux-gnu/libssl.so.1.0.2" /opt/HipChat4/lib/libssl.so
rm "$LIBSSL_FILE"
@andykingking
andykingking / install-sublime-text-3.sh
Created May 13, 2017 00:45 — forked from anonymous/install-sublime-text-3.sh
Install Sublime Text 3 on Fedora
#!/bin/sh
BUILD="3131"
SHORTCUT="[Desktop Entry]
Name=Sublime Text 3
Comment=Edit text files
Exec=/usr/local/sublime-text-3/sublime_text
Icon=/usr/local/sublime-text-3/Icon/128x128/sublime-text.png
Terminal=false
@andykingking
andykingking / coin.ex
Last active April 13, 2024 14:08
Using structs with Access behaviour
# An example struct.
defmodule Coin do
# Using Kernel.put_in/3 and other methods requires the target to have the Access behaviour.
@behaviour Access
# Structs by default do not implement this. It's easy to delegate this to the Map implementation however.
defdelegate get(coin, key, default), to: Map
defdelegate fetch(coin, key), to: Map
defdelegate get_and_update(coin, key, func), to: Map
defdelegate pop(coin, key), to: Map
@andykingking
andykingking / vscode_jest_debugging.md
Created March 23, 2017 23:23
Debugging with Jest and VSCode

Debugging with Jest and VSCode

Assumptions

  • Your jest config is named jest.json.
  • You use babel.
  • You build to build.

Debugging

Keybase proof

I hereby claim:

  • I am andykingking on github.
  • I am andykingking (https://keybase.io/andykingking) on keybase.
  • I have a public key ASBuqS9qWZ4fwp-wYAa291-Il_R9NWcBQUE8qHkmrf14ago

To claim this, I am signing this object:

@andykingking
andykingking / set-creds.py
Last active October 25, 2016 03:37
Returns a string that can be `eval`-ed to set secrets as environment variables
import json
import subprocess
def fetch_value(key):
return subprocess.check_output(['credstash', '-r', data['region'], '-t', data['table'], 'get', key])
def create_shell_command(variable, credential):
value = fetch_value(credential)
return 'export {0}="{1}"'.format(variable, value)
@andykingking
andykingking / yaml-examples.md
Last active September 26, 2015 23:20
YAML - Strange and complicated

The YAML spec is pretty complicated, and has alot of edge cases. If your whole document is

--- 
gjsogjsgj:gsdgs:sgdjsjgosdg: 

That's actually valid YAML. In some examples like:

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@andykingking
andykingking / dev-env.rb
Last active December 28, 2015 01:49
Quick script to start certain services for development
require 'sys/proctable'
module ProcTableGrep
def exist?
Sys::ProcTable.ps.each do |p|
return true if p.cmdline.include? @pgrep
end
false
end
end