Skip to content

Instantly share code, notes, and snippets.

David Askew dhaskew

Block or report user

Report or block dhaskew

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am dhaskew on github.
  • I am askew (https://keybase.io/askew) on keybase.
  • I have a public key ASDVjIGch3E2i3Kw8W44aTKiSYH50CVxIsAKry4fscqOkQo

To claim this, I am signing this object:

View gist:f598e642b8b4a271a20d
# Define a function to find the hypotenuse of a right triangle with side lengths a and b
def hypotenuse_right(a,b)
return a**2 + b**2
end
h = hypotenuse_right(1,2)
puts h
# What methods do strings have that symbols don't? Describe a few. What methods do symbols have that strings don't?
@dhaskew
dhaskew / power_events.applescript
Created Mar 1, 2014
#eventscripts #applescript #power #timemachine #
View power_events.applescript
-- To receive the eventArgs parameter
-- we wrap the script in an on run handler
on run eventArgs
-- every eventArgs record has a trigger property
-- that describes the action that caused the script to be executed
set thisTrigger to (trigger of eventArgs)
You can’t perform that action at this time.