Skip to content

Instantly share code, notes, and snippets.

@kyo-ago
kyo-ago / gist:854008
Created March 4, 2011 01:43
YQLを使った外部ドメイン画像のData Scheme読み込み
var yql = function(qry, suc, err){
var c = "_" + (+new Date),
s = document.createElement("script"),
t;
var clean = function(){
s.parentNode.removeChild(s);
window[c] = null;
try{
delete window[c];
}catch(err){}
@kyo-ago
kyo-ago / gist:942007
Created April 26, 2011 08:49
viewBox用数値計算コード
var s=18,e=71,f=29-32,b=Math.abs(f--)+1,a=[];while(f++){var t=s-((e-s)/b)*f;a.push(((t*10)|0)/10);};console.log(a.reverse().join('\n'));
@kyo-ago
kyo-ago / gist:942028
Created April 26, 2011 09:21
文字列入れるの数値演算
.forEach(function (f) { console.log("\t\t\t'"+f.replace(/\s(\d+)/,function(a,b){return ' '+(b-0+5)})+"',");});
@kyo-ago
kyo-ago / gist:986118
Created May 23, 2011 02:26
NILScript Hotstrokes実装
Main.createNotifyIcon();
/*
with(require('Keyboard')){
for each(let [n,v] in Iterator(Keyboard.codes)){
println('Alias: '+(n+' ').slice(0,16)
+' / Code: 0x'+(('0'+v.toString(16)).slice(-2))
+' / ScanCode: 0x'+(('00'+(new Key(n)).scanCode.toString(16)).slice(-3))
+' / Name: '+(new Key(n)).name);
}
@kyo-ago
kyo-ago / jquery-animate-css-rotate-scale
Created June 1, 2011 15:05
jquery-animate-css-rotate-scale
/*!
* jquery-animate-css-rotate-scale
* Zachary Johnson
* www.zachstronaut.com
* https://github.com/zachstronaut/jquery-animate-css-rotate-scale/
* This code is currently available for use in all personal or commercial projects
* under both MIT and GPL licenses, just like jQuery.
*
* modified by @kyo_ago 2011-06-02
*/
@kyo-ago
kyo-ago / gist:1028841
Created June 16, 2011 07:34
set window.requestAnimationFrame
(function (w, r) {
w['r'+r] = w['r'+r] || w['webkitR'+r] || w['mozR'+r] || w['msR'+r] || w['oR'+r] || function(c){ w.setTimeout(c, 1000 / 60); };
})(window, 'equestAnimationFrame');
@kyo-ago
kyo-ago / gist:1048276
Created June 27, 2011 03:46
jQuery1.6.1 patch
8365 : if (fx.interval === 13) {
8366 : requestAnimationFrame( raf );
8367 : fx.tick();
8368 : } else {
8369 : setTimeout(function () {
8370 : requestAnimationFrame( raf );
8371 : fx.tick();
8372 : }, fx.interval - 16);
8373 : };
@kyo-ago
kyo-ago / gist:1055816
Created June 30, 2011 07:38
jQuery tools scrollable.js
172: itemWrap.stop(true, true).animate(props, time, conf.easing, fn || function() {
@kyo-ago
kyo-ago / shotenjin.js
Created September 6, 2011 08:19
shotenjinでextensionが作れるバージョン
17a18
> escapeXml_regexp : /[&<>"]/g,
20c21
< return typeof(s) != 'string' ? s : s.replace(/[&<>"]/g, Shotenjin._escape_func); //"
---
> return typeof(s) != 'string' ? s : s.replace(Shotenjin.escapeXml_regexp, Shotenjin._escape_func); //"
44c45,47
<
---
>
@kyo-ago
kyo-ago / gist:1353885
Created November 10, 2011 02:04
Fiddlerで対象ドメインのみUA差し替え
// これが書いてある行の下に
static function OnBeforeRequest(oSession: Session)
{
// 以下の3行を追加(ホスト名は適当に書き換える)
if (oSession.HostnameIs("www.example.com") || oSession.HostnameIs("example.com")) {
oSession.oRequest["User-Agent"] = "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7";
}