Skip to content

Instantly share code, notes, and snippets.

Avatar

David Hersey dchersey

View GitHub Profile
View keybase_proof.txt
### 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:
@dchersey
dchersey / log_error.rb
Last active Oct 25, 2016
simple development and production logging code for rubymotion
View log_error.rb
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 Oct 27, 2016
commit hook to detect presence of rubymotion logging statements
View pre-commit
#!/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
You can’t perform that action at this time.