Skip to content

Instantly share code, notes, and snippets.

@dchersey
dchersey / log_error.rb
Last active October 25, 2016 18:14
simple development and production logging code for rubymotion
class Object
def log_error message, object=nil
if Device.simulator?
mp "ERROR: #{message}"
mp object if object
else
NSLog("ERROR: #{message}: %@\n".to_s, object)
end
end
@dchersey
dchersey / pre-commit
Last active October 27, 2016 20:33
commit hook to detect presence of rubymotion logging statements
#!/bin/sh
# Redirect output to stderr.
exec 1>&2
# enable user input
exec < /dev/tty
consoleregexp='^[^#]*mp[^a-zA-Z0-9]'
# CHECK
if test $(git diff --cached | grep $consoleregexp | grep + | wc -l) != 0
then
@dchersey
dchersey / keybase_proof.txt
Created September 13, 2019 21:49
keybase proof
### Keybase proof
I hereby claim:
  * I am dchersey on github.
  * I am davidhersey (https://keybase.io/davidhersey) on keybase.
  * I have a public key ASDllaV0hEsBCUkII2Ehzi6YaZ0XILf7BZi5kZF1F1pruAo
To claim this, I am signing this object: