Skip to content

Instantly share code, notes, and snippets.

@kuzuha
kuzuha / README.md
Last active November 24, 2017 15:30

WHAT HAPPEND

provder configuration interpolation behavior seems changed since terraform 0.11.0.

before 0.11.0, values that from data resource variable in provider configuration came from terraform.state.
AFTER apply, values in terraform.state will be changed.
new values will be used when NEXT plan.

after 0.11.0, values that from data resource variable in provider configuration came from themselves.
new values are used IMMEDIATELY.

php -r '$a=[]; $a[]=2; $a[-1]=1; var_dump($a); array_shift($a); var_dump($a);'
array(2) {
[0]=>
int(2)
[-1]=>
int(1)
}
array(1) {
[0]=>
int(1)
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="failure">
<xs:complexType mixed="true">
<xs:attribute name="type" type="xs:string" use="optional"/>
<xs:attribute name="message" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
@kuzuha
kuzuha / gist:8cc5d70a31b9619e2938
Last active August 29, 2015 14:14
PHP といえば、Facebook の Hack はどうなったんだろう
ideサポート
intellijのideであるphpstormがサポートをしようとしている。
https://youtrack.jetbrains.com/issue/WI-21737
fix versiosには9.0が付いているので、うまくいけば2015年末にリリースされるであろうphpstorm 9.0に含まれる。
hhvm 3.3からxdebugが含まれるようになったことも含め、今後のide対応に期待が高まる。
async/await サポート
http://hhvm.com/blog/7091/async-cooperative-multitasking-for-hack
便利そう(小並感)
php -r '$a=[]; $a["1.1"]=1; $a[1.1]=2; var_dump($a);'
array(2) {
'1.1' =>
int(1)
[1] =>
int(2)
}
php -r '$a="0x12"; $a++; var_dump($a);'
int(19)
php -r '$a="012"; $a++; var_dump($a);'
<?php
trait AbstractSpeak
{
abstract protected function speak($string);
}
trait PrintSpeak
{
protected function speak($string)
import Ordering.Implicits._
case class Version(name: String, numbers: (Int, Int, Int, Int)) extends AnyRef with Ordered[Version] {
def compare(other: Version) = if (numbers == other.numbers) 0 else if (numbers < other.numbers) -1 else 1
}
@kuzuha
kuzuha / gist:8106846
Created December 23, 2013 23:59
fact20 bench in scala/node/java
% scala/bench 100000000 factorial20 factorial20 factorial20
# factorial20
## 3.9219999999999997
# factorial20
## 3.295
# factorial20
## 3.3129999999999997
% node/bench 100000000 factorial20 factorial20 factorial20
# factorial20
./perl6
> class t{}
t()
> role r{method hello{say 'hello'}}
r()
> class t_r does r {}
t_r()
> t_r.new().hello()
hello
> (t.new does r).hello()
{
"instrumentation": "node-jscoverage",
"sloc": 3,
"hits": 2,
"misses": 1,
"coverage": 66.66666666666666,
"files": [
{
"filename": "build/main/js/sample-project.js",
"coverage": 66.66666666666666,