Skip to content

Instantly share code, notes, and snippets.

@mala
mala / XSS
Created February 1, 2012 09:42
yuga.jsのXSS直したバージョンがなかなかリリースされないので勝手に直したやつ
http://www.kyosuke.jp/yugajs/#"></a><img src=/ onerror=alert(1)>
@yu-tang
yu-tang / gprops.js
Created January 27, 2012 16:59
CScript/WScript 環境の JScript.Global オブジェクトに既定で追加されているプロパティを調べてみる
/*
CScript/WScript 環境の JScript.Global オブジェクトに
既定で追加されているプロパティを調べてみる
*/
(function(obj){
var a = [];
for (var i in obj) {
a.push(i + ':' + typeof(obj[i]));
}
WScript.Echo(a.join('\n'));
@yu-tang
yu-tang / include.js
Created January 26, 2012 10:42
CScript/WScript 環境の JScript 用ユーティリティ
/*
いちいち WScript... と書きたくないためだけのユーティリティ
*/
// echo() as WScript.Echo()
this.echo = function(){
var s = '',i, numargs = arguments.length;
for (i = 0; i < numargs; i++){
s += arguments[i];
}
@Raynos
Raynos / old.js
Created January 24, 2012 18:28 — forked from Zirak/a.js
ol reverse attribute polyfill
//use this if you want support for browsers which don't have ES5 goodies
(function () {
"use strict";
var lists = document.getElementsByTagName( 'ol' ), list;
for ( var i = 0, len = lists.length; i < len; i++ ) {
// bug 1 not local variable
list = lists[i];
@Raynos
Raynos / a.md
Created January 23, 2012 19:48
Shim status of ES6

ES6 what can be shimmed and what not.

Currently only lists things that can be shimmed or are experimentally implemented

Note that for any kind of decent ES6 support we need an ES6 transpiler. A few projects are attempting this [Reference SO question][3]

  • [traceur][4]
  • [Caja][5]
  • [ES transpiler][6]
@paulirish
paulirish / rAF.js
Last active April 17, 2025 15:06
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@ryan-blunden
ryan-blunden / addClass.js
Created December 19, 2011 06:23
Basic BDD example for addClass method
/**
* Experimenting with no frills BDD to write a simple addClass method
*/
function TestSuite(name, setup, teardown) {
var leftPadding = 60;
this.name = name || '';
this.tests = [];
this.setup = setup || function() {},
@tily
tily / scaling_isomorphic_javascript_code.ja.markdown
Last active May 1, 2023 09:03
サバクラ両方で動く JavaScript の大規模開発を行うために

サバクラ両方で動く JavaScript の大規模開発を行うために

原文:Scaling Isomorphic Javascript Code (This is just for study, please contact me at tily05 atmark gmail.com if any problem.)

考えてみれば Model-View-Controller とか MVC ってよく聞くよね。実際どんなものか知ってる? 抽象的に言うなら「オブジェクト情報の保持されるグラフィック・システム (つまり、ラスターではないグラフィック。ゲームとか) 上に構築された、表示系を中心としたアプリケーションにおいて、主要な機能どうしの関わりをうまく分離すること」とでも言おうか。もう少し深く考えを押し進めてみれば、これは当然、他のさまざまなアプリケーションにもあてはまる言葉 (bucket term ?) だ。

過去に多くの開発コミュニティが MVC による解決案を提供し、それによってよくあるユースケースにうまく対処し、地位を築くことができた。例をあげるなら、Ruby や Python コミュニティは Rails や Django を作り、MVC アーキテクチャを実現した。

@terkel
terkel / reset.css
Created November 12, 2011 10:56
CSS Reset
/*!
* CSS Reset 2011-12-25
* https://gist.github.com/gists/1360380
*
* Author: Takeru Suzuki, http://terkel.jp/
* License: Public domain
*
* Inspired by Normalize.css: http://necolas.github.com/normalize.css/
*/
@hail2u
hail2u / csslint-rules.md
Last active April 29, 2023 14:59
CSSLintのRulesの超訳

訳注

これは超訳です。

CSSLintは「なんでこんなルールなんだ…」とイラっとすることが多いですけど、それぞれにそれなりに理由があります。まぁ勿論無視するべきなルールとかもあります。例えば見出し要素の再定義禁止とかはHTML5に対するCSSなら無理な話です。そんなわけでどんな理由なのかを簡単に訳しました。無視するかどうかは自分で決めましょう!

この訳はCSSLintと同じライセンスで提供されます。

Possible Errors