Skip to content

Instantly share code, notes, and snippets.

@ysugimoto
ysugimoto / iOS6sample.html
Created October 29, 2012 01:15
iOS6's handleEvent not works by Function's property
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>index</title>
<meta name="viewport" content="width=device-width; initial-scale=1.0" />
<script>
document.addEventListener('DOMContentLoaded', function() {
@bobslaede
bobslaede / modernizr.positionfixed.js
Created September 16, 2011 08:50
Modernizr position fixed check
;(function(Modernizr, window) {
Modernizr.addTest('positionfixed', function () {
var test = document.createElement('div'),
control = test.cloneNode(false),
fake = false,
root = document.body || (function () {
fake = true;
return document.documentElement.appendChild(document.createElement('body'));
}());
@jakubkulhan
jakubkulhan / indent.pegjs
Created July 28, 2012 10:42
Python style indentation parser in PEG.js
// do not use result cache, nor line and column tracking
{ var indentStack = [], indent = ""; }
start
= INDENT? lines:( blank / line )*
{ return lines; }
line
= SAMEDENT line:(!EOL c:. { return c; })+ EOL?
@jonathantneal
jonathantneal / matchesSelector.polyfill.js
Created July 6, 2012 21:51
matchesSelector Polyfill // returns whether an element matches a selector
this.Element && function(ElementPrototype) {
ElementPrototype.matchesSelector = ElementPrototype.matchesSelector ||
ElementPrototype.mozMatchesSelector ||
ElementPrototype.msMatchesSelector ||
ElementPrototype.oMatchesSelector ||
ElementPrototype.webkitMatchesSelector ||
function (selector) {
var node = this, nodes = (node.parentNode || node.document).querySelectorAll(selector), i = -1;
while (nodes[++i] && nodes[i] != node);
@brettz9
brettz9 / Array.from.js
Last active December 9, 2020 01:42
Array.from polyfill (see also https://github.com/mathiasbynens/Array.from )
/**
* @license MIT, GPL, do whatever you want
* @requires polyfill: Array.prototype.slice fix {@link https://gist.github.com/brettz9/6093105}
*/
if (!Array.from) {
Array.from = function (object) {
'use strict';
return [].slice.call(object);
};
}
@uupaa
uupaa / How to create the Base64 image string by the Chrome Browser.md
Last active May 25, 2021 06:48
How to create the Base64 image string by the Chrome Browser.

Chrome ブラウザだけで、画像の DataURI を簡単に取得する方法を紹介します。

  1. 適当な画像を右クリックし 新しいタブで画像を開く を選択します。

  2. 新しいタブで表示された画像をさらに右クリックし、 要素の検証 を選択します。

@qnighy
qnighy / juxtaposition-application.md
Created February 22, 2022 13:18
並置による関数適用に関する所感

並置による関数適用

並置による関数適用の善し悪しについて盛り上っているので、自分の意見を表明しておく。以下の2本立て。

  • 純粋に構文論的な議論 (構文拡張の余地を残す)
  • 意味論との関係での議論 (副作用の表示)

先に結論だけ書くと、私はどちらかといえば括弧による関数適用のほうが好みです。

そもそも並置による関数適用とは

@rodneyrehm
rodneyrehm / mb_range.php
Created October 22, 2011 15:35
PHP: mb_range() - Unicode compatible range('A', 'Z')
<?php
mb_internal_encoding('UTF-8');
/**
* multibyte string compatible range('A', 'Z')
*
* @param string $start Character to start from (included)
* @param string $end Character to end with (included)
* @return array list of characters in unicode alphabet from $start to $end
@uupaa
uupaa / fp.now.md
Last active May 25, 2022 11:58
いまどきのガラケー事情

いまどきのガラケーと Flash Lite 開発事情

いまどきのガラケーコーディングがどうなっているか確認してみました。

ガラケーを取り巻く環境の変化

  • 停波による古い端末の一掃
    • docomo
      • 2006春モデル以前の端末が mova の停波により 2012/03/31 から利用不能に
  • au
@Gab-km
Gab-km / whyILeftHeroku.rst
Last active December 30, 2022 10:56
何故私は Heroku から離れたか、および新しい AWS セットアップのメモ

何故私は Heroku から離れたか、および新しい AWS セットアップのメモ

原著者

Adrian Holovaty

原文

Why I left Heroku, and notes on my new AWS setup

金曜日、私は Heroku から Amazon Web Services(AWS) を直接使うように Soundslice を移行しました。私はこの変更ができてとても、そうとても嬉しくて、私がどうやったかということと、もし皆さんが同じような立場だったら何故それを検討すべきかということについて広く伝えたいと思います。