Skip to content

Instantly share code, notes, and snippets.

View oogatta's full-sized avatar

Naohiro Oogata oogatta

  • Otaru, Hokkaido, Japan
  • 23:36 (UTC +09:00)
View GitHub Profile
<?php
header("Cache-Control:no-cache,no-store");
?>
<!DOCTYPE html>
<html>
<head>
</head>
<body onload="document.getElementById('test').innerHTML='JS time:'+(new Date()).toString();" onunload="">
<?php
echo "PHP time:" . date("Y/m/d g:i:s");
#! /usr/bin/env perl
use strict;
use warnings;
use Cache::Memcached::Fast;
use Data::Dumper;
my $memd = new Cache::Memcached::Fast({
servers => [ { address => 'localhost:11211', weight => 2.5 } ],
; js2-mode
(add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
; tern
(add-hook 'js2-mode-hook (lambda () (tern-mode t)))
(eval-after-load 'tern
'(progn
(require 'tern-auto-complete)
(tern-ac-setup)))
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
@oogatta
oogatta / index.html
Last active June 3, 2023 11:48
Strange behavior of the IE11 on compat-mode. A function wrapping 'typeof' mis-detect an ActiveXObject.
<!DOCTYPE html>
<html>
<head>
<script src="test.js"></script>
</head>
<body>
</body>
</html>
@oogatta
oogatta / 0_reuse_code.js
Last active August 29, 2015 14:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/usr/bin/env perl
use strict;
use warnings;
use Carp::Assert;
use feature ':5.14';
my @list = qw/hoge fuga timpo/;
sub osicco {
assert @_ ~~ @list;
@oogatta
oogatta / gist:c16a45b59dfd38a6bbb2
Created May 31, 2015 06:15
angular android link workaround without any dependency
app.factory('androidLinkWorkaround', [function androidLinkWorkaroundFactory() {
var elements = [];
var isAndroid = function () {
return /(Android);?[\s\/]+([\d.]+)?/.test(navigator.userAgent);
};
return {
on: function (targetSelectors, exclusionRootSelector) {
if ( !isAndroid() ) {
@oogatta
oogatta / gist:3fcd96a6e7701bf60080
Created May 31, 2015 06:17
angular legacy url
angular
.module('angular-legacy-url', [])
.factory('AngularLegacyUrl', ['$window', function AngularLegacyUrlFactory($window) {
var getQueries = function (search) {
return search
.replace(/(^\?)/, '')
.split('&')
.reduce(function (sum, item) {
if ( item === '' ) {
return sum;
@oogatta
oogatta / .htmlhintrc
Created September 13, 2016 15:13
sample .htmlhintrc
{
"tagname-lowercase": false,
"tag-pair": true,
"attr-value-double-quotes": true,
"attr-value-not-empty": true,
"attr-no-duplication": true,
"id-unique": true,
"space-tab-mixed-disabled": "space4"
}