This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.factory('androidLinkWorkaround', [function androidLinkWorkaroundFactory() { | |
var elements = []; | |
var isAndroid = function () { | |
return /(Android);?[\s\/]+([\d.]+)?/.test(navigator.userAgent); | |
}; | |
return { | |
on: function (targetSelectors, exclusionRootSelector) { | |
if ( !isAndroid() ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: test | |
test: | |
@find test/test-*.js | xargs -n 1 -t node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Toggle Google results page language | |
// @namespace http://bitmap.dyndns.org/ | |
// @description Japanese <-> English | |
// @include http://*.google.*/search?* | |
// ==/UserScript== | |
(function() { | |
window.__toggleGoogleLinkClickFlag = false; | |
document.addEventListener('mousedown', function(e) { | |
window.__toggleGoogleLinkClickFlag = ( e.target.tagName == 'A' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.gwt-HTML { | |
font-size:11px!important; | |
} | |
textarea.postBarTextarea { | |
background:#eee!important; | |
color:#333!important; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a = 'global'; | |
Object.prototype.b = 'Object'; | |
function test1() { | |
console.log(a); | |
console.log(b); | |
} | |
function test2() { | |
var b = 'inner'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ノーマルな形 | |
// ※ところで今の仕様書に FunctionDeclaration っていう Production が無いのはなぜ? | |
int func(int a) { | |
return a; | |
} | |
// FunctionExpression を使う場合。 | |
// Dart に Function Type はあるけど (T) -> <T> っていうよくわからん型なので、 | |
// FunctionTypeAlias (エイリアス)を定義する。らしい。 | |
typedef int A(int a); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
my %testhash = ( | |
test => 1, | |
hoge => 2, | |
fuga => 3, | |
); |
OlderNewer