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
interface Point { | |
x: number; | |
y: number; | |
} | |
interface Vector { | |
x: number; | |
y: number; | |
} |
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
while (IsASCIIDigit(value[port_end]) && port_end < length) | |
++port_end; | |
while (value[port_start] == '0' && port_start < port_end - 1) | |
++port_start; | |
// Required for backwards compat. | |
// https://www.w3.org/Bugs/Public/show_bug.cgi?id=23463 | |
if (port_start == port_end) | |
return "0"; |
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
{ | |
"type": "object", | |
"properties": { | |
"AWSEBDockerrunVersion": { | |
"type": "integer", | |
"minimum": 1, | |
"maximum": 2 | |
}, | |
"authentication": { | |
"type": "object", |
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
// I recently saw http://davidwalsh.name/detect-native-function tweeted by | |
// @elijahmanor and was pretty jazzed about it. One of my favorite JS tricks is | |
// detecting native methods. Detecting native methods is handy because third | |
// party code can shim methods incorrectly as seen in past versions of | |
// Prototype.js, es5-shim, & modernizr, which can cause your code to behave in | |
// unexpected ways. This isn't a knock against those projects, shimming is really | |
// really hard to get right. Shimmed methods may also lack the performance | |
// benefits of their native counterparts. Lo-Dash, Dojo, Ember, & YUI, | |
// to name a few, detect native methods to avoid shims and rely on their own | |
// fallback paths, trusting their code over third-party. |
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
/*! | |
* Copyright 2015 Google Inc. All rights reserved. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
$ run.sh & | |
$ vim run.sh | |
(30 秒以内に foo を bar に変えて保存する) | |
bar |
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
from functools import reduce | |
identity = lambda x: x | |
transduce_as_map = lambda mapper: lambda concat: lambda xs, x: concat(xs, mapper(x)) | |
transduce_as_filter = lambda predicate: lambda concat: lambda xs, x: concat(xs, x) if predicate(x) else xs | |
compose = lambda f, g: lambda x: f(g(x)) | |
compose_n = lambda *fns: reduce(compose, fns, identity) |
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
$ exec 7<> /dev/tcp/8.8.8.8/53 |
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
$ embulk irb | |
2017-10-04 23:49:33.706 +0900: Embulk v0.8.30 | |
irb(main):001:0> p 'yay' | |
"yay" | |
=> "yay" | |
irb(main):004:0> 3.times {|i| print(i)} | |
012=> 3 |
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
$ apt-cache madison openssl | |
openssl | 1.0.2g-1ubuntu4.8 | http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages | |
openssl | 1.0.2g-1ubuntu4.6 | http://archive.ubuntu.com/ubuntu xenial-security/main amd64 Packages | |
openssl | 1.0.2g-1ubuntu4 | http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages | |
openssl | 1.0.2g-1ubuntu4 | http://archive.ubuntu.com/ubuntu xenial/main Sources | |
openssl | 1.0.2g-1ubuntu4.8 | http://archive.ubuntu.com/ubuntu xenial-updates/main Sources | |
openssl | 1.0.2g-1ubuntu4.6 | http://archive.ubuntu.com/ubuntu xenial-security/main Sources |
NewerOlder