Skip to content

Instantly share code, notes, and snippets.

View stuarthendren's full-sized avatar
🏠
Working from home

Stuart Hendren stuarthendren

🏠
Working from home
View GitHub Profile
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@stuarthendren
stuarthendren / .gitalias
Last active August 11, 2020 18:47
.gitalias
[alias]
# List alias commands
la = "!git config -l | grep alias | cut -c 7-"
list-alias = "!git la"
# List commits in increasing detail
l = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
lll = log -u
# Most common diffs
diffc = diff --cached HEAD^
@stuarthendren
stuarthendren / CassandraSchemaGenerator.java
Last active April 26, 2020 15:23 — forked from eintopf/CassandraSchemaGenerator.java
Since the Datastax driver currently does not support the Auto-Creation of table schema I have extended this class by https://gist.github.com/eintopf. It creates the create queries (strings). The execution has to be done in another step. The original problem originates from here: http://stackoverflow.com/questions/32953050/datastax-cassandra-java…
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.net.InetAddress;
import java.nio.ByteBuffer;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
#!/bin/bash
yum update -y
echo "Installing Maven"
wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
yum install -y apache-maven
echo "Installing docker"
yum install -y docker
sudo service docker start
sudo usermod -a -G docker ec2-user
@stuarthendren
stuarthendren / ElasticHostsMiamiApiLiveTest.testGetDive
Last active October 14, 2018 16:21
ElasticHostsMiamiApiLiveTest
org.jclouds.http.HttpException: Couldn't receive response {statusCode=200, message=OK, headers={Transfer-Encoding=[chunked], Cache-Control=[no-cache], Server=[BaseHTTP/0.3 Python/2.6.6], Date=[Wed, 27 May 2015 14:51:52 GMT], X-API-Version=[2.0.0]}, payload=[content=true, contentMetadata=[contentDisposition=null, contentEncoding=null, contentLanguage=null, contentLength=null, contentMD5=null, contentType=text/plain, expires=null], written=false]}, payload: null
at org.jclouds.http.functions.ReturnStringIf2xx.apply(ReturnStringIf2xx.java:45)
at org.jclouds.elasticstack.functions.SplitNewlines.apply(SplitNewlines.java:42)
at org.jclouds.elasticstack.functions.SplitNewlines.apply(SplitNewlines.java:1)
at org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:90)
at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:73)
at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:1)
at org.jclouds.rest.internal.DelegatesToInvocationFunction.handle(Delegates
@stuarthendren
stuarthendren / .bashrc windows
Last active October 14, 2018 16:21
.bashrc windows
PATH=$PATH:"/c/dev/todo"
PATH=$PATH:"/c/dev/scripts"
export PATH
FILES=/c/dev/scripts/*
for f in $FILES
do
source $f
done
@stuarthendren
stuarthendren / myscript
Last active May 8, 2018 15:15
Bash template
#!/usr/bin/env bash
set -euo pipefail
IFS=$' \n\t'
# To source a dependency
#. dependency
# Script directory
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
@stuarthendren
stuarthendren / .gitconfig
Last active December 25, 2015 13:09
windows .gitconfig
[user]
name = [name]
email = [email]
[core]
editor = 'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin
[merge]
tool = kdiff3
[mergetool "kdiff3"]
path = C:\\dev\\kdiff3\\kdiff3.exe
keepBackup = false
@stuarthendren
stuarthendren / x
Created December 11, 2008 14:22
PrintWhatYouLike.com Ubiquity Command
CmdUtils.CreateCommand({
names: ["print what you like"],
homepage: "http://stuarthendren.net/",
author: { name: "Stuart Hendren", email: "stuarthendren@gmail.com"},
contributors: ["Stuart Hendren"],
license: "CC by-sa, http://creativecommons.org/licenses/by-sa/2.0/",
description: "Sends the current page to PrintWhatYouLike.com",
icon: "http://www.printwhatyoulike.com/static/img/favicon.png",
help: "Print the current tab using <a href='http://printwhatyoulike.com'>PrintWhatYouLike.com</a>",