Open terminal and type:
1. Create a directory at ~/bin:
mkdir ~/bin
2. Copy sublime executable to your ~/bin directory:
-- 1. Place in ~/Library/Scripts and enable the Applescript menu via the Applescript Editor | |
-- 2. Substitute "vpn.example.com" and "redacted" for your VPN server and password | |
-- 3. Open Security & Privacy System Preferences, go to Privacy, Accessibility | |
-- 4. Enable Applescript Editor and System UI Server | |
-- 5. Trigger script from the menu | |
-- 6. Enjoy being connected | |
tell application "Cisco AnyConnect Secure Mobility Client" | |
activate | |
end tell |
document.querySelector('video').playbackRate = 1.5
Videos on any page using a video tag. Youtube, vimeo etc
(Right click/2 finger click on mac -> inspect element); on the video to reveal the <video></video>
tag, otherwise you might get a var v = document.querySelector('video'); var t = prompt('Set the playback rate'); v.playbackRate = parseFloat(t)
err.
Paste this into the console (go to console from the window that pops up from inspect element or cmd + option + i
):
# Sample implementation of quicksort and mergesort in ruby | |
# Both algorithm sort in O(n * lg(n)) time | |
# Quicksort works inplace, where mergesort works in a new array | |
def quicksort(array, from=0, to=nil) | |
if to == nil | |
# Sort the whole array, by default | |
to = array.count - 1 | |
end |
#Getting Started
##Webpage:
<html>
<head>
<title>Testing with Ruby and Selenium WebDriver</title>
</head>
<body bgcolor="antiquewhite">
require "rubygems" | |
require "json" | |
require "net/http" | |
require "uri" | |
uri = URI.parse("http://api.sejmometr.pl/posiedzenia/BZfWZ/projekty") | |
http = Net::HTTP.new(uri.host, uri.port) | |
request = Net::HTTP::Get.new(uri.request_uri) |
// iMacro CheatSheet - Command Reference | |
// http://wiki.imacros.net/Command_Reference | |
// iMacros supports 3 types of variables: | |
// * The macro variables !VAR0 thru !VAR9. They can be used with the SET and ADD command inside a macro. | |
// * Built-in variables. They contain certain values set by iMacros. | |
// * User-defined variables. They are defined in-macro using the SET command. | |
require 'net/https' | |
require 'json' | |
require 'uri' | |
# | |
# Use your project key to query the API | |
# 1) go to Google API Console: https://code.google.com/apis/console/ | |
# 2) go to "Services" tab and enable "Page Speed Online API" | |
# 3) go to "API Key" tab and copy your "API Key" | |
# |
# Author: Mike Hagerty, 11/28/2012 | |
# The purpose of this script is to pull data from the Yahoo Sports API. I tried to document the steps as thoroughly as possible, as I had a | |
# tough time navigating this process | |
# Yahoo Sports requires Oauth authentication for personal team-related data. This requirement complicates the automation of pulling data, as Oauth in general requires user interaction to complete the authentication process. | |
# Mechanize is used to automate the user interaction steps required to authenticated via Oauth. | |
# This script also has example code for storing the data in a mongodb at the end | |
#!/usr/bin/ruby |