Skip to content

Instantly share code, notes, and snippets.

View camsaul's full-sized avatar
💭
I am Cam

Cam Saul camsaul

💭
I am Cam
View GitHub Profile
@camsaul
camsaul / your_kit.clj
Created March 18, 2017 00:40
Profiling with YourKit
{:jvm-opts ["-agentpath:/Users/camsaul/Downloads/YourKit-Java-Profiler-2017.02.app/Contents/Resources/bin/mac/libyjpagent.jnilib"]}
@camsaul
camsaul / lein-different-jvm.sh
Created March 29, 2017 18:19
Run lein with different JVM
#!/bin/bash
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home lein run
@camsaul
camsaul / json-to-yaml.sh
Created April 11, 2017 22:01
Convert JSON file to YAML
#! /bin/bash
python -c 'import sys, yaml, json; yaml.safe_dump(json.load(sys.stdin), sys.stdout, default_flow_style=False)' < $file
@camsaul
camsaul / generate-javadoc.sh
Created June 7, 2017 21:42
generating javadocs
#!/bin/bash
javadoc -sourcepath ./src/main/java -subpackages net.sf.jsqlparser
@camsaul
camsaul / fix_busted_mysql.sh
Created July 11, 2017 19:25
fix busted MySQL
#! /bin/bash
# kill the server
pkill -KILL mysqld
# drop all the DBs, logfiles, and other busted data
rm -rf /usr/local/var/mysql/*'@002'*
rm /usr/local/var/mysql/ib*
# now restart the server
@camsaul
camsaul / debug_expectations_tests.clj
Last active March 19, 2018 22:37
Debugging Clojure Expectations Tests (Metabase Codebase)
(def current-test-name (atom nil))
(defonce my-redef
(do (let [orig-fn @#'expectations/test-name]
(intern 'expectations 'test-name
(fn [metta]
(u/prog1 (orig-fn metta)
(reset! current-test-name <>)
(println "Now we're going to run:" <>)))))
:ok))
@camsaul
camsaul / mac_settings.sh
Last active August 10, 2017 22:43
Mac Settings
#!/bin/bash
# Reminder of the various things to do when setting up a Mac
# Things to install via App Store:
# Patterns
# xCode
# Slack
# System Monitor
# Things to install from web:
@camsaul
camsaul / secure_random.sh
Created July 25, 2017 01:20
Generate Secure Random Strings
#!/bin/bash
# base 64
openssl rand -base64 32
# hex
openssl rand -hex 32
@camsaul
camsaul / toucan.txt
Last active October 13, 2017 02:10
ASCII Art Toucan
llccc::;,,''.....''''',,,,,,,,,,,,,,,,;;;,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::::::::::::::::::
ccccccc::;;,''...'''''',,,,,,,,,,,,,,,,,,,,,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::::::::::::::::::
;::cccccc:::;;,''''''''',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::::::::::::::
',,;::cccccc:::;;,,'''''',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::::::::::::::
..'',,;::::ccc::::;;,,'''',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;;;;;;;;;;;;:::::::::::::;;;;;;;::::::::::::::::
....''',,;;::::::::;;;,,,,,,,,,,,,,,,,,,,,,,,,'',,,'''',,,,;;;;:::::::::::;;;;;;;;;;;;;;;:::::::::::::::::::::::::::::::
'''''''''',,;;::::;;;;,,,,,,,,,,,,,,,,,,,,'''',,;cloodxxkkkkkkkkkkkkkkkxxxxdool:,'........''',,;;:::::::::::::::::::::::
''''''''''''',,;;;;;;,,,,,,,,,,,,,,,,,,,;clodkO0KKXK0OkxdddooooooooooooookKXKK00Okxoc;'..........',;::::::::::::::::::::
'''''''''''''''',,,,,,,,,,,,,,,,,,:codxO0KXXXXK0Okdollll
@camsaul
camsaul / external_ip.sh
Created October 17, 2017 01:01
Get your external IP address
#!/bin/bash
curl ifconfig.me