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
// Return single USB port's name | |
String unixUsbSerial(String device){ | |
return unixUsbSerials(device, 1)[0]; | |
} | |
// Return multiple USB ports' names | |
String[] unixUsbSerials(String device, int... num){ | |
/* Parameter "device" can be "cu" or "tty". | |
* num[0] can be a number of ports required. | |
*/ |
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
iTunes.goToChapter = function(cNum){ | |
//Note : iTunes.currentChapter starts at 1, NOT 0. | |
//If currently playing track has no chapter | |
if(this.currentChapter == 0 || ! cNum){ | |
return; | |
} | |
var isPlaying = false; | |
if(this.waveform.waveformData){ |
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
// ref: http://ituneslp.net/tutorials/itunescontrol | |
array.sortOn = function() { | |
for(var i=0 ; i < arguments.length; i++){ | |
var field = arguments[i]; | |
this.sort(function(a, b){ | |
if(a[field] > b[field]){ | |
return 1; | |
} | |
if(a[field] < b[field]){ |
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
<?php | |
// ref: http://www.php.net/manual/ja/function.file-exists.php#79118 | |
function getResource(){ | |
$args_last_key = func_num_args() - 1; | |
$resource_urls = array_slice(func_get_args(), 0, $args_last_key); | |
// The last argument is a local file path. | |
$local_fallback = func_get_arg($args_last_key); | |
NewerOlder