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
mixin loadJQuery(version) | |
script(src='https://ajax.googleapis.com/ajax/libs/jquery/#{version}/jquery.min.js') | |
- var jQueryFallbacks = []; | |
- jQueryFallbacks[0] = 'http://code.jquery.com/jquery-' + version + '.min.js'; | |
- jQueryFallbacks[1] = 'http://ajax.aspnetcdn.com/ajax/jQuery/jquery-' + version + '.min.js'; | |
- jQueryFallbacks[2] = 'js/jquery' + (version.charAt(0) === '1'? '1': '') +'.js'; | |
each url in jQueryFallbacks | |
script. |
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
QuickLookJSON.qlgenerator | |
CC_QL.qlgenerator | |
QLStephen.qlgenerator | |
QLColorCode.qlgenerator | |
QLMarkdown.qlgenerator | |
ScriptQL.qlgenerator | |
DICOMQuickLook.qlgenerator | |
ProcessingQL.qlgenerator | |
Archive.qlgenerator | |
GBQLGenerator.qlgenerator |
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
// Fork from Chromium's 'Bufferloader' class | |
// http://chromium.googlecode.com/svn/trunk/samples/audio/doc/loading-sounds.html | |
function BufferLoader(audioContext, urlList, callback){ | |
this.context = audioContext; | |
this.urlList = urlList; | |
this.onload = callback; | |
this.bufferList = []; | |
this.loadCount = 0; | |
} |
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
var addEvent; | |
if('addEventListener' in window){ | |
addEvent = function(elm, eventType, func){ | |
elm.addEventListener(eventType, func, false); | |
}; | |
}else if('attachEvent' in window){ // IE | |
addEvent = function(elm, eventType, func){ | |
elm.attachEvent('on'+eventType, function(){ func.apply(elm); }); | |
}; | |
} |
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
/* | |
ArduinoなどのUSBデバイスを繋いでいる状態でこれを実行すると、 | |
デバイス名がクリップボードにコピーされる | |
そのまま Quartz Composer の、Kineme Serial Inputの Device 欄にペーストすると | |
Quartz Composerでのシリアル通信が始まる | |
*/ | |
import java.awt.datatransfer.Clipboard; |
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
var mainPlaylist = iTunes.createTempPlaylist(); | |
(function(){ | |
//location.host returns "persistentid-***" | |
var hostPersistentID = location.host.split("-")[1]; | |
var tmpArr = iTunes.findTracksByTextFields({ | |
album : iTunes.findTrackByPersistentID( hostPersistentID ).album | |
}); | |
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
// background.jpg | |
// | |
// +------+------+ | |
// |#aaa |#aaa | | |
// | |:hover| | |
// +------+------+ | |
// |#bbb |#bbb | | |
// | |:hover| | |
// +------+------+ | |
// |#ccc |#ccc | |
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 | |
$agent = getenv('HTTP_USER_AGENT'); | |
function getVersion($req){ | |
global $agent; | |
preg_match( | |
"/(?<=".$req."[^0-9\.])([0-9]+)([0-9\._]+?)(?=[^0-9\._]|$)/i", | |
$agent, | |
$matchedStringsArr |
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 | |
function cssSprite($singleWidth, $singleHeight, $verticalNum, $horizontalNum, $elementNum){ | |
echo " style='background:"; | |
echo -floor($elementNum * ceil(1 / $verticalNum)) * $singleWidth, "px "; | |
echo -$elementNum % $horizontalNum * $singleHeight, "px "; | |
echo "url(******.jpg) no-repeat;'"; | |
} | |
?> |
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
/* | |
* Delete all empty log files, | |
* which are created when the "flush()" method isn't used correctly. | |
*/ | |
import java.io.File; | |
File[] files = new File(sketchPath("log")).listFiles(); | |
int deleted = 0; | |
for(File elm : files){ |