This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Keep in mind that when asking for a `return` after another, only the first one will be output. | |
# This example is meant as a simple starting point, to show how to get the information in the simplest available way. | |
# Google Chrome | |
tell application "Google Chrome" to return URL of active tab of front window | |
tell application "Google Chrome" to return title of active tab of front window | |
# Google Chrome Canary | |
tell application "Google Chrome Canary" to return URL of active tab of front window | |
tell application "Google Chrome Canary" to return title of active tab of front window | |
# Chromium |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ = jQuery | |
TIMEOUT = 20000 | |
lastTime = (new Date()).getTime() | |
setInterval -> | |
currentTime = (new Date()).getTime() | |
# If timeout was paused (ignoring small | |
# variations) then trigger the 'wake' event | |
if currentTime > (lastTime + TIMEOUT + 2000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
rpm --import https://raw.githubusercontent.com/example42/puppet-yum/master/files/CentOS.6/rpm-gpg/RPM-GPG-KEY.atrpms | |
rpm -Uvh https://www.mirrorservice.org/sites/dl.atrpms.net/el6.7-x86_64/atrpms/stable/atrpms-repo-6-7.el6.x86_64.rpm | |
sed -i 's,http://dl,https://www.mirrorservice.org/sites/dl,' /etc/yum.repos.d/atrpms*.repo | |
yum install ffmpeg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Parsing Time in String to a Date Obj | |
* @param timeString - time in String | |
* --> Acceptable Times - | |
* 1,01,10,011,101,110,0111,1011, | |
* With AM/PM - 1p,01p,10p | |
* | |
* @returns tempDateObj {Date} - Date Object that represents time String | |
*/ | |
function parseTimeString(timeString) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.) We can't access private members in methods that are added to the object at a later point. | |
2.) Writing Unit Tests for Private Functions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Implementation | |
// run key up event handler as debounced key down handlers | |
var | |
_debounceTimeout; // key debouncer required params | |
// Usage | |
debounceStart(function(){ | |
// Function which is to be debounced | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (root, factory) { | |
if ( typeof define === 'function' && define.amd ) { | |
define([], factory(root)); | |
} else if ( typeof exports === 'object' ) { | |
module.exports = factory(root); | |
} else { | |
root.myPlugin = factory(root); | |
} | |
})(typeof global !== "undefined" ? global : this.window || this.global, function (root) { |