Skip to content

Instantly share code, notes, and snippets.

➜ ~ diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *1.0 TB disk0
1: Windows Recovery 554.7 MB disk0s1
2: EFI NO NAME 104.9 MB disk0s2
3: Microsoft Reserved 16.8 MB disk0s3
4: Microsoft Basic Data 1.0 TB disk0s4
@timcharper
timcharper / lein-completion.bash
Created April 15, 2010 18:06
bash completion for leiningen
_lein_test()
{
local curw
COMPREPLY=()
curw=${COMP_WORDS[COMP_CWORD]}
if [ -d test ]; then
COMPREPLY=($(compgen -W '$(cd test; find * -name \*.clj | sed "s/.clj\$//" | sed "s/_/-/g" | sed "s|/|.|g")' -- $curw));
return 0
fi
}
@timcharper
timcharper / nailgun-build-failure.log
Created April 5, 2019 15:35
Nailgun build failure
➜ nailgun git:(master) mvn package
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] nailgun-all [pom]
[INFO] nailgun-server [jar]
[INFO] nailgun-examples [jar]
[INFO]
[INFO] ----------------------< com.facebook:nailgun-all >----------------------
var long lastNotified = 0
var String lastReceipt
rule "Alert for bad air"
when
Item Master_Air_Pm25 changed or System started
then
val pm25 = (Master_Air_Pm25.state as Number).intValue
logDebug("air-quality", "pm25 = {}", pm25)
if ((now.millis - lastNotified) > 3600000) {
if (pm25 >= 15) {
#define _DEBUG
unsigned int pm1 = 0;
unsigned int pm2_5 = 0;
unsigned int pm10 = 0;
long lastPmReading = 0;
byte buffer[24];
void setup() {
@timcharper
timcharper / crash-log.txt
Created June 15, 2018 17:59
Emacs 26.1 stale server file server-start crash
Process: Emacs-x86_64-10_10 [54595]
Path: /Applications/Emacs.app/Contents/MacOS/Emacs-x86_64-10_10
Identifier: org.gnu.Emacs
Version: Version 26.1 (9.0)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Emacs-x86_64-10_10 [54595]
User ID: 501
Date/Time: 2018-06-15 11:11:33.871 -0600
@timcharper
timcharper / README.md
Last active May 21, 2018 22:38
reset audio.ahk

Parallels desktop audio record latency will increase, slowly, over time. This is been an issue that I have encountered over many years of using the software. I'm not sure if it is related to clock drift, or what.

A relatively easy "fix" is to disable the microphone in the audio control panel, and then reenable it. Unfortunately, if you do this while Dragon is listening, it will cause Dragon to freeze up in a pretty bad way, so you must do the following:

  1. Turn off the microphone in Dragon
  2. Disable the microphone in the audio control panel recording pane
  3. Reenable the microphone in the audio control panel recording pane
  4. Turn the microphone on in Dragon again

In my configuration, I have the key ctrl-` bound to turn on/turnoff the microphone in Dragon. Also, in the audio control panel recording pane, I only have one device, so the offsets in this auto hot key script work. You may need to tweak it, for your own use. Hopefully, it gives you a starting point.

@timcharper
timcharper / output.json
Created March 20, 2018 03:30
OrientDB simple delete benchmark
{"op": "removing each vertex one at a time", "secs": 5.85228219}
{"op": "method 1", "secs": 5.87633618}
{"op": "removing edges first", "secs": 31.594552465}
{"op": "removing each vertex one at a time", "secs": 0.48545163}
{"op": "method 2", "secs": 32.106060129}
{"op": "remove edges via sql", "secs": 2.645357744}
{"op": "remove vertices via direct delete sql", "secs": 6.376951457}
{"op": "method 3", "secs": 9.050751531}
@timcharper
timcharper / rpmbuild
Last active March 14, 2018 19:39
Docker powered rpm-build (HACK that works for sbt-native-packager); put in your path and chmod +x
#!/bin/bash
# silly little workaround to make rpmbuild work through docker
# Build the image if it doesn't already exist
if !(docker inspect rpm-build 2>/dev/null 1>/dev/null); then
echo "rpm-build image does not exist; building"
rm -rf /tmp/rpm-build
mkdir -p /tmp/rpm-build
cat <<-EOF > /tmp/rpm-build/Dockerfile

Keybase proof

I hereby claim:

  • I am timcharper on github.
  • I am timcharper (https://keybase.io/timcharper) on keybase.
  • I have a public key ASA55PBWERBlKtFZOOxM-PPqyojWNz0ttZGh7X7FP4E8Gwo

To claim this, I am signing this object: