Skip to content

Instantly share code, notes, and snippets.

View michaelsbradleyjr's full-sized avatar
💭
Dip trip, flip fantasia 🎺

Michael Bradley michaelsbradleyjr

💭
Dip trip, flip fantasia 🎺
View GitHub Profile
@michaelsbradleyjr
michaelsbradleyjr / test.html
Created March 27, 2014 18:36
Testing gist embedding on a WordPress 3.8.1 + Nevia theme installation
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Untitled</title>
</head>
<body>
</body>
</html>
;;; pbcopy.el --- Emacs Interface to pbcopy
;; Copyright (C) 2011 Daniel Nelson, based on xclip.el, by Leo Shidai Liu
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; This file is distributed in the hope that it will be useful,
@michaelsbradleyjr
michaelsbradleyjr / passnhash.bash
Last active August 29, 2015 14:02
password and hash generation with apg, htpasswd/bcrypt
#!/bin/bash
# password and hash pair generation with apg, htpasswd/bcrypt
# example usage:
# source this file or include the passnhash function in your .bash_profile/.bashrc
# then: `passnhash 0 35 14`
# prerequisites:
# 1) recent version of htpasswd that supports bcrypt (-B flag)
# deb: `apt-get install apache2-utils`
@michaelsbradleyjr
michaelsbradleyjr / Vagrantfile
Last active August 29, 2015 14:02
Sample Vagrantfile, cloud-config for deploying CoreOS to the Rackspace Cloud
# -*- mode: ruby -*-
# # vi: set ft=ruby :
# At present, you will need to clone the rackspace provider-plugin's source,
# build and install it manually (released versions don't properly support
# `user_data` and `config_drive`)
# git clone https://github.com/mitchellh/vagrant-rackspace.git
# cd vagrant-rackspace
# bundle && rake build
@michaelsbradleyjr
michaelsbradleyjr / myscript.sh
Last active August 29, 2015 14:06
Bash nested quotes puzzler
#!/bin/bash
# WHAT IS THE CORRECT/BEST WAY to transform $* (or the combined
# command) so that the non-working examples below will start working?
if [ -n "$*" ]; then
bash -l -c "su -c 'tmux new-session -s base \"$*\"' - user"
# these WORK
#!/usr/bin/bash
repo_dir=$1
repo_url=$2
mkdir -p /home/core/repos
cd /home/core/repos
if [ -d "./$repo_dir" ]; then
echo "pulling repo..."
#![feature(unboxed_closures)]
fn main() {
println!("\n");
println!("adder_1\n-------");
let a1 = adder_1(10000_f64);
println!("total: {}", a1);
println!("");
{ entry_cmd="eval $(cat)"; } << 'EOF'
tnw () {
tmux new-window -n "win$1" -d "$2"
}
tnw 0 'top -u root'
tnw 1 'top -u sailor'
tnw 2
@michaelsbradleyjr
michaelsbradleyjr / .bash_aliases.sh
Last active August 29, 2015 14:16
Some helpful docker aliases
# GNU parallel
# better than xargs: http://www.gnu.org/software/parallel/
# install: (wget -O - pi.dk/3 || curl pi.dk/3/) | bash && \
# echo will cite | parallel --bibtex
command -v parallel &>/dev/null
if [ $? != 0 ]; then
alias para='xargs'
else
alias para='parallel'
fi
(ns my.CustomException
(:gen-class :extends RuntimeException
:implements [clojure.lang.IDeref]
:constructors {[java.util.Map String] [String]
[java.util.Map String Throwable] [String Throwable]}
:init init
:state info
:methods [[getInfo [] java.util.Map]
[addInfo [Object Object] void]]))