Skip to content

Instantly share code, notes, and snippets.

@azu
azu / hoge.markdown
Created February 10, 2014 14:15 — forked from taizooo/hoge.markdown

#なんだかんだ

##えーと1 どういうこういう そういうどういう

##えーと2 どういうこういう そういうどういう

@azu
azu / index.js
Created October 29, 2014 05:39 — forked from juliangruber/index.js
requirebin sketch
var patcher = require('html-patcher')
var patch = patcher(document.body, render())
setInterval(function () {
patch(render())
}, 1000);
function render () {
return '<h1>' + Date.now() + '</h1>';
<!-- index.html -->
<html>
<head>
<title>Qiitaトレンド</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<link href="http://nvd3.org/assets/css/nv.d3.css" rel="stylesheet" type="text/css">
<style>
body {
overflow-y:scroll;
}
@azu
azu / e4xToDOM.js
Created February 21, 2010 08:24 — forked from gifnksm/e4xToDOM.js
e4xToDOM
// XML (E4X)からDOM Nodeへの変換
function e4xToDOM(xml, xmlns) {
// DTD 無指定の場合
if(!xmlns) xmlns = "http://www.w3.org/1999/xhtml";
var pretty = XML.prettyPrinting;
// 余分な空白を混入させないように,prettyPrintingを一時的に無効にする
XML.prettyPrinting = false;
var doc = (new DOMParser).parseFromString(
'<root xmlns="' + xmlns + '">' + xml.toXMLString() + "</root>",
@azu
azu / gist:403465
Created May 17, 2010 06:33 — forked from os0x/gist:360183
(function(){
// ある関数について、最初に呼び出されたときと2回目以降で処理を分ける方法
// 自分自身を書き換える関数
// 初期化コストが低いが、見た目がイマイチ
// 関数宣言でなくても良いが、関数宣言なら定義する場所を気にしなくて良くなる
function A(){
A = _A;
/*一回目の処理*/
// _A.apply(this,arguments);//2回目の処理を呼ぶこともOK
// ==UserScript==
// @name Twitter OAuth Caution
// @namespace http://github.com/mooz/
// @description Display caution when application requests a 'write' access
// @include http://twitter.com/oauth/authorize?*
// @include http://twitter.com/oauth/authenticate?*
// @include https://twitter.com/oauth/authorize?*
// @include https://twitter.com/oauth/authenticate?*
// ==/UserScript==
// ==UserScript==
// @name A smart dashboard have my id
// @namespace jp.mitukiii.tumblr
// @include http*://www.tumblr.com/dashboard*
// ==/UserScript==
(function() {
var getMyId = document.getElementsByName("t")[0].value;
var isPost = function(elem) {
return !!elem.id.match(/^post[0-9]+$/i);
// ==UserScript==
// @name expand_twitter_notation
// @description はてなダイアリー編集中にtwitter記法を展開する
// @namespace http://shiba-yu36.net/
// @include http://d.hatena.ne.jp/*
// ==/UserScript==
(function() {
function parseTweetId (string) {
// ==UserScript==
// @name twicli post canceler
// @namespace http://efcl.info/
// @description twicliのポストを行うのに5秒の猶予を設けて、その間にキャンセルボタンを押せばポストをキャンセルできます。
// @author azu
// @homepage http://efcl.info/
// @twitter https://twitter.com/azu_re
// ==/UserScript==
/* http://gist.github.com/567983.txt をプラグインにロード */
@azu
azu / dispatcher.js
Created December 19, 2010 14:50 — forked from yoko/dispatcher.js
dispatcher.js
var dispatcher = {
location: window.location,
stash : [],
connect: function(paths, action) {
if (paths || paths === 0) {
paths = paths.valueOf();
if (!(typeof paths == 'object' && !(paths instanceof RegExp))) // webkit: typeof RegExp == 'function'
paths = { pathname: paths };
dispatcher.stash.push([paths, action]);