Skip to content

Instantly share code, notes, and snippets.

View jasonkeene's full-sized avatar
:shipit:

Jason Keene jasonkeene

:shipit:
View GitHub Profile
resource "remote_data" current_datetime {
count = "${var.size}"
taint = "is_end_of_the_world"
create = "date +%y%m%d%H%M"
shell = true
}
resource "openstack_compute_instance_v2" myinstance {
count = "${var.size}"
@jasonkeene
jasonkeene / go-for-the-dynamic-programmer.md
Last active March 23, 2017 18:39
Go for the Dynamic Programmer

Go for the Dynamic Programmer

  • Introduction
    • I love dynamic languages
    • You will hate the compiler (at first)
    • Goals for the series
  • C vs Go vs Python/Ruby/JavaScript
    • Compilation Speed
    • Runtime Speed
  • Startup Time
package main
import "fmt"
func main() {
func() {
goto HELL
}()
return
#!/usr/bin/env python
from itertools import chain
from random import SystemRandom
import sys
PLANTS = {
'Stinging Nettle': 3,
'Sorrel': 3,
// Excerpt from Practical Cryptography With Go
// https://leanpub.com/gocrypto/read#leanpub-auto-block-padding
// Pad applies the PKCS #7 padding scheme on the buffer.
func Pad(in []byte) []byte {
padding := 16 - (len(in) % 16)
if padding == 0 {
padding = 16
}
for i := 0; i < padding; i++ {
@jasonkeene
jasonkeene / settings.__init__.py
Last active August 29, 2015 14:12
Idea for class based settings.
from .local import config
config.render(globals())
@jasonkeene
jasonkeene / git-move.sh
Last active June 15, 2018 14:41
Moves commits from one repo to another preserving commit messages and author date.
# Usage:
# cd ~/my_old_repo
# git-move HEAD ~/my_new_repo
function git-move {
src=$(pwd)
commit=$1
dest=$2
git rev-list $commit --reverse |
while read hash; do
// ==UserScript==
// @name Hipchat Click to View Images
// @version 0.2
// @match https://*.hipchat.com/chat
// @copyright 2014, Zach "theY4Kman" Kanzler
// @grant GM_unsafeWindow
// ==/UserScript==
// Add styles to initially disable images
import pytest
class Fixture():
@property
def foo(self):
raise NotImplementedError
@pytest.fixture
@jasonkeene
jasonkeene / python_scripting.rst
Last active November 14, 2024 11:18
Get started with writing your own python scripts to automate system tasks.

Python for System Admins / Operators

Installing Python

Most Unix/Linux systems come with python pre-installed:

$ python -V