Skip to content

Instantly share code, notes, and snippets.

View vchervanev's full-sized avatar
🎯
Focusing

Vladimir Chervanev vchervanev

🎯
Focusing
View GitHub Profile
@hiilppp
hiilppp / entering_range.scpt
Created April 16, 2014 19:20
AppleScript to unlock your Mac's screen. (Use EventScripts to automatically trigger script when a Bluetooth device (e.g., your iPhone) enters your Mac's range: http://www.mousedown.net/mouseware/EventScripts.html)
-- You need to create a Keychain item whose name matches what you use in place
-- of "[keychain_item_name]" on line #7 (and whose password is identical to your
-- user account's password).
tell application "System Events"
if ((get name of every process) contains "ScreenSaverEngine") then
set pw to (do shell script "security find-generic-password -l \"[keychain_item_name]\" -w")
tell application "ScreenSaverEngine" to quit
delay 0.5
keystroke pw
@fnichol
fnichol / README.md
Created March 12, 2011 20:52
Download a cacert.pem for RailsInstaller

Why?

There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.

From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?

Installation

The Ruby Way! (Fun)

@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')