Skip to content

Instantly share code, notes, and snippets.

View superbrothers's full-sized avatar
🌏
Working from the earth

Kazuki Suda superbrothers

🌏
Working from the earth
View GitHub Profile
<!DOCTYPE html>
<html lang="ja">
<head>
<title>File API</title>
<meta charset="UTF-8">
</head>
<body>
<h1>File API</h1>
<div id="result">使用できない</div>
<script>
<?php
class A {
protected static $_a = 'a';
public static function get() {
return self::$_a;
}
}
var_dump(A::get()); // a
var Buffer = require('buffer').Buffer;
var Iconv = require('iconv').Iconv;
var iconv = new Iconv('cp932', 'UTF-8');
console.log(iconv.convert(new Buffer('こんにちは', 'binary')).toString());
// ==UserScript==
// @name test
// @namespace http://example.com/test
// @include http://*
// ==/UserScript==
(function () {
var elIcon = document.createElement('link');
elIcon.setAttribute('rel', 'shortcut icon');
elIcon.setAttribute('href', 'http://example.jp/favicon.ico');
// ==UserScript==
// @name tiqav dev
// @namespace http://dev.tiqav.com/userscripts/tiqav_dev.user.js
// @include http://localhost:3000/*
// ==/UserScript==
(function () {
var node, imgList = document.getElementsByTagName('img');
for (var i = 0, len = imgList.length; i < len; ++i) {
node = imgList.item(i);
var src = node.getAttribute('src');
NodeList.prototype.forEach = function (fun, thisp) {
return Array.prototype.forEach.call(this, fun, thisp);
};
NodeList.prototype.forEach = function (fun, thisp) {
return Array.prototype.forEach.call(this, fun, thisp);
};
var elems = document.getElementsByTagName('*');
elems.forEach(function (node, index, nodeList) {
console.log(node, index);
});
var elems = document.getElementsByTagName('*');
Array.prototype.forEach.call(elems, function (node, index, nodeList) {
console.log(node, index);
});
<!DOCTYPE html>
<html>
<head>
<title>STAR - Canvas</title>
</head>
<body>
<canvas id="star" width="12px" height="11px"></canvas>
</body>
<script><!--
var canvas = document.getElementById('star');
<?php
function timestamp() {
echo time();
}
?>
<!DOCTYPE html>
<html>
<head>
</head>
<body>