Skip to content

Instantly share code, notes, and snippets.

@ahomu
ahomu / shot.js
Created November 23, 2013 08:08
めも
var page = require('webpage').create(),
system = require('system');
var url = system.args[1];
page.viewportSize = {
width : system.args[2] || 1024,
height: system.args[3] || 768
};
@ahomu
ahomu / gist:7212425
Created October 29, 2013 10:49
遊び捨てたpolymer
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
'use strict';
(function() {
/*jshint eqeqeq:false, maxparams:4 */
var COND_OPERATORS = {
'==' : function (l, r) { return l == r; },
'===': function (l, r) { return l === r; },
'!=' : function (l, r) { return l != r; },
'!==': function (l, r) { return l !== r; },
@ahomu
ahomu / h5v.js
Created June 27, 2013 03:54
grunt-html5validator .... 0.4.xで動作するかは不明 X(
/*
* grunt-html5validator
*
* @author ahomu
*/
module.exports = function(grunt) {
'use strict';
var TEMP_HTTP_RESOURCE = '.h5v.http.tmp',
@ahomu
ahomu / gist:5823669
Created June 20, 2013 15:18
いまいちだ...
/**
* Chikoque
*
* @author ahomu
*/
(function(win, doc, _) {
'use strict';
var defaults = {
@ahomu
ahomu / gist:5728342
Created June 7, 2013 10:14
.jshintrct
{
"globals": {
"Backbone": true,
"_": true,
"$": true,
"jQuery": true,
"Zepto": true
},
"maxlen": 100,
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://documentcloud.github.io/underscore/underscore-min.js"></script>
<script src="http://documentcloud.github.io/backbone/backbone-min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
@ahomu
ahomu / haster.js
Last active December 17, 2015 17:49
タッチ操作に応じてクラスを付けたりハズしたり
/**
* FastClick and touch activation class control.
*
* @dependency jQuery or Zepto
* @author ahomu
*/
(function(win, doc, $) {
'use strict';
@ahomu
ahomu / zepto_with_future.js
Last active December 17, 2015 17:49
ZeptoのajaxをなんとなくFutureのpolyfill仕立てにする
/**
* @see https://github.com/slightlyoff/Futures
*/
(function(Future, DollarLib) {
'use strict';
function _wrap(func, wrapper) {
return function() {
return wrapper.apply(this, [func].concat(Array.prototype.slice.call(arguments, 0)));
};
@ahomu
ahomu / timeago.js
Created May 24, 2013 12:00
x日前的な
'use strict';
/*
* JavaScript Pretty Date
* Copyright (c) 2011 John Resig (ejohn.org)
* Licensed under the MIT and GPL licenses.
*
* @original http://ejohn.org/blog/javascript-pretty-date/
*/
Util || (Util = {});