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
' Author: Rob W <[email protected]> | |
' License: Creative Commons 3.0 with attribution | |
' http://creativecommons.org/licenses/by/3.0/ | |
' | |
' My own use case: | |
' For browser-testing purposes, I've set up a Win XP Virtual Machine | |
' (http://stackoverflow.com/q/10541225). My Chrome installers are | |
' located in a virtual share, at \\VBOXSRV\WinShared\WinXPDev\Chrome\ | |
' When I need to test an old Chrome version, I launch this script, which | |
' automatically installs and configures Chrome. |
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
# Based on http://unix.stackexchange.com/questions/14303/bash-cd-up-until-in-certain-folder/14311#14311 | |
# Jump to closest matching parent directory | |
upto () { | |
if [ -z "$1" ]; then | |
return | |
fi | |
local upto=$@ | |
cd "${PWD/\/$upto\/*//$upto}" | |
} | |
# Auto-completion |
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
// ==UserScript== | |
// @name webkitNotifications shim for Firefox 22+ | |
// @namespace https://github.com/Rob--w/ | |
// @author Rob Wu <[email protected]> | |
// @description Enable desktop notifications on Firefox 22+ for websites which use the webkitNotification API. | |
// @include * | |
// @version 1.0.2 | |
// @grant none | |
// ==/UserScript== |
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/sh | |
# @author Rob Wu <[email protected]> (https://robwu.nl) | |
version=$1 | |
if [[ "${version}" != *"."* ]] ; then | |
echo "Repeat the command with an exact version:" | |
suffix="[0-9.]*" | |
# Version not specified in $1 | |
[ -z $version ] && suffix="[0-9][0-9.]+" | |
curl -s http://www.oldapps.com/google_chrome.php | grep -oP "google_chrome.php\?old_chrome=[0-9]+\">[A-Za-z ]+\K${version}${suffix}( [A-Za-z()]+)?" -m 10 | |
elif [ -e "${version}_chrome_installer.exe" ] ; then |
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 example of writable response bodies. | |
* Based on the draft of the Streams API (19 March 2014) | |
* https://dvcs.w3.org/hg/streams-api/raw-file/tip/Overview.htm | |
* Design document for response body reading/writing: | |
* https://docs.google.com/document/d/1iE6M-YSmPtMOsec7pR-ILWveQie8JQQXTm15JKEcUT8 | |
*/ | |
/* globals chrome, ByteStream, URL, XMLHttpRequest */ | |
'use strict'; |
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 | |
# The file where the PWD is going to be shared with other (new) tabs. | |
STY_SHARED_PWD="/tmp/.screenpwd-$STY" | |
if [ -e "$STY_SHARED_PWD" ] ; then | |
# If the file exists, then another session had already set the | |
# environment, so read the most recent PWD and go to the directory. | |
STY_PWD="$(</tmp/.screenpwd-$STY)" | |
# Provided that it's not empty. | |
[ -n "$STY_PWD" ] && cd "$STY_PWD" | |
fi |
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
/* | |
* FormData for XMLHttpRequest 2 - Polyfill for Web Worker | |
* (c) 2014 Rob Wu <[email protected]> | |
* License: MIT | |
* - append(name, value[, filename]) | |
* - XMLHttpRequest.prototype.send(object FormData) | |
* | |
* Specification: http://www.w3.org/TR/XMLHttpRequest/#formdata | |
* http://www.w3.org/TR/XMLHttpRequest/#the-send-method | |
* The .append() implementation also accepts Uint8Array and ArrayBuffer objects |
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
[ui] | |
# Usage: Assuming that you've saved hgeditor as ~/.mercurial/hgeditor | |
editor = ~/.mercurial/hgeditor |
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
/** | |
* Detects whether the PDF.js Chromium extension is installed in the browser. | |
* Example: isPDFJSExtensionInstalled(function(result) { alert('Is PDF.js installed? ' + result);}); | |
* | |
* @param {function(boolean)} callback - Called when the detection completed. | |
* | |
* Author: Rob Wu <[email protected]> (https://robwu.nl) | |
* Public domain - all rights waived. | |
*/ | |
function isPDFJSExtensionInstalled(callback) { |
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 | |
# Downloads and extracts specific npm package without dependencies or hooks. | |
# Usage: | |
# npm-download-only [package1] [package2] ... | |
# where package can be a specific version (e.g. [email protected]) or package. | |
# | |
# Written on 9 dec 2015 by Rob Wu (https://robwu.nl) | |
for arg in "$@" | |
do |
OlderNewer