Skip to content

Instantly share code, notes, and snippets.

@azu
azu / item21.js
Created February 25, 2014 13:42
項目21 apply
/**
* Created by azu on 2014/02/25.
* LICENSE : MIT
*/
"use strict";
function getAllScores() {
return [1, 2, 3];
}
function average() {
@azu
azu / asciidoctor_marked.sh
Created March 2, 2014 05:52
asciidoctor + Marked (support include path)
#!/bin/sh
asciidoctor -a source-highlighter=pygments --backend html5 --base-dir "`dirname $MARKED_PATH`/" -
@azu
azu / gist:9404959
Created March 7, 2014 03:52
WEB+DB PRESS plusの電子書籍化お問い合わせ
いつも弊社の書籍をご愛顧いただきありがとうございます。
技術評論社WEB+DB PRESS編集部池田と申します。本書の編集を担当いた
しました。
お問い合わせありがとうございます。申し訳ありませんが、電子化を検
討はしているのですが、現時点では『コーディングを支える技術』の電
子版の販売は具体的には決定していない状態です。
このたびはお問い合わせありがとうございました。今後とも弊誌刊行物
をなにとぞよろしくお願いいたします。
@azu
azu / dokudoc.js
Created March 8, 2014 05:13
AST Stack example
/**
* Created by azu on 2014/03/06.
* LICENSE : MIT
*/
"use strict";
var esprima = require('esprima');
var estraverse = require('estraverse');
var escodegen = require('escodegen');
var esquery = require("esquery");
var clone = require("clone");
@azu
azu / no-bra.js
Created March 8, 2014 14:47
no wrapper browserify
/**
* Created by azu on 2014/03/08.
* LICENSE : MIT
*/
"use strict";
var bu = require('browserify');
var through = require('through');
bu({pack: function (value) {
var parser = through();
var stream = through(
@azu
azu / AppDelegate.m
Created March 10, 2014 09:02
BlockInjection log controller
[BILib injectToClassWithNameRegex:BIRegex(@"^[^(UI)].*?Controller$") methodNameRegex:BIRegex(@"^viewWillAppear") preprocess:^{
NSLog(@"%@", [BILib prettyFunction]);
}];
@azu
azu / io.js
Last active August 29, 2015 13:57
Download file by Downloads.jsm/ XPCOM
/*
Copyright 2012 Christopher Hoobin. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
/*
* espowerify - Browserify transform for power-assert.
*
* https://github.com/twada/espowerify
*
* Copyright (c) 2014 Takuto Wada
* Licensed under the MIT license.
* https://raw.github.com/twada/espowerify/master/MIT-LICENSE.txt
*/
var through = require('through'),
@azu
azu / promise-thenable.js
Created April 5, 2014 16:18
Web Notifications as promise
"use strict";
function notifyMessage(message) {
return new Promise(function (resolve, reject) {
if (Notification.permission === "granted") {
var notification = new Notification(message);
return resolve(notification);
} else if (Notification) {
Notification.requestPermission(function (status) {
if (Notification.permission !== status) {
Notification.permission = status;
"use strict";
function notifyMessage(message, options, callback) {
if (Notification.permission === "granted") {
var notification = new Notification(message, options);
callback(null, notification);
} else if (Notification) {
Notification.requestPermission(function (status) {
if (Notification.permission !== status) {
Notification.permission = status;
}