Skip to content

Instantly share code, notes, and snippets.

View brianjriddle's full-sized avatar

Brian Riddle brianjriddle

View GitHub Profile
@brianjriddle
brianjriddle / spacemacs-user-config.el
Created July 11, 2022 11:02
spacemacs hunspell configuration
(defun dotspacemacs/user-config ()
"Configuration for user code:
This function is called at the very end of Spacemacs startup, after layer
configuration.
Put your configuration code here, except for variables that should be set
before packages are loaded."
;; For dictionaries look here https://wiki.openoffice.org/wiki/Dictionaries
(with-eval-after-load "ispell"
(setq ispell-program-name "hunspell")
;; ispell-set-spellchecker-params has to be called
@brianjriddle
brianjriddle / textit.sh
Created December 17, 2021 14:28
best stupid hack to rinse formatting between all types of clients
#!/bin/bash
# This has got to be the best dumb hack i've seen.
# what does this do? basically just strips *any* formatting you happen to have in your pastebuffer and remove it.
# Now i can copy and paste from any program and paste *clean* UTF-8 like ken thompson intended https://www.cl.cam.ac.uk/~mgk25/ucs/utf-8-history.txt
pbpaste | pbcopy
@brianjriddle
brianjriddle / git-checkout-date.sh
Created January 31, 2012 06:36
git checkout source code to a specific date
git checkout "`git rev-list master -n 1 --first-parent --before=2008-03-02`"
@brianjriddle
brianjriddle / aapt-badger.txt
Last active April 19, 2019 15:47
who put that badger in androids aapt. scroll all the way to the end.
➜ ~ cd $ANDROID_SDK ➜ r21.1 git:(master) pwd /usr/local/Cellar/android-sdk/r21.1
➜ r21.1 git:(master) cd platform-tools ➜ platform-tools git:(master) strings aapt nonav
dpad
navexposed
nokeys
12key
keysexposed
keyshidden
notouch
stylus
@brianjriddle
brianjriddle / retrieve-cert.sh
Created January 22, 2014 14:51
save a ssl certificate for a host
#!/bin/sh
#
# usage: retrieve-cert.sh remote.host.name [port]
#
REMHOST=$1
REMPORT=${2:-443}
echo |\
openssl s_client -connect ${REMHOST}:${REMPORT} 2>&1 |\
sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'
@brianjriddle
brianjriddle / prompt.sh
Created November 28, 2013 22:02
precmd that adds a separator
function brris_precmd_hook {
local bar=""
local separator="✨"
for ((i = 0; i < ${COLUMNS}; i++)) ; do
bar="${bar}${separator}"
done
echo $fg_bold[yellow]${bar}
}
[[ -z $precmd_functions ]] && precmd_functions=()
precmd_functions=($precmd_functions brris_precmd_hook)
@brianjriddle
brianjriddle / yaml-pp
Created November 20, 2013 08:28
YAML formatter in ruby
#!/usr/bin/env ruby
require 'yaml'
yaml_file = YAML::load(File.open(ARGV[0]))
puts YAML::dump(yaml_file)
@brianjriddle
brianjriddle / jenkins-farwell.txt
Created November 6, 2013 07:40
farewell jenkins
Hej Jenkins,
Vi behöver prata.
Vi har varit ihop några år nu men som Oall good things¹ även vi måste ta
slut.
Du har fått ögonen upp för andra och jag känner att det är dags för mig
att släppt dig fri.
@brianjriddle
brianjriddle / build.xml
Created September 22, 2013 08:00
Ant tasks to check if working directory is clean.
<?xml version="1.0" encoding="UTF-8"?>
<project name="git" default="is-working-directory-clean">
<target name="-git-status">
<exec executable="git" outputproperty="git.status.message" failifexecutionfails="false" errorproperty="">
<arg value="status"/>
<arg value="--short"/>
</exec>
<condition property="git.clean.wd">
<and>
@brianjriddle
brianjriddle / ant-build-snippet.xml
Created July 25, 2013 11:01
ant task to run all the tests or only one test. You'll need to supply the properties where to find your test source, libs and what not. Mainly here so i don't have to look this up again because it's not often need to do this but ant's as poorly written as this sentence.
<target name="run-tests" depends="compile">
<junit failureproperty="test.failure" includeantruntime="false">
<classpath refid="run.classpath"/>
<formatter type="plain" usefile="no"/>
<batchtest todir="${reports.dir}" unless="test">
<fileset dir="${source.dir}" includes="**/*Test.java"/>
<formatter type="xml"/>
</batchtest>