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
const e=["sample"],o=()=>{const t=document.querySelectorAll(".js-chirp-container");0!==t.length?t.forEach((o=>{new MutationObserver((o=>{o.forEach((o=>{Array.from(o.addedNodes).forEach((o=>{const{name:t,text:r}=extractText(o);(o=>e.some((e=>o.includes(e))))(r)&&(console.log(`removed ${r} by ${t}}`),o.parentNode.removeChild(o))}))}))})).observe(o,{childList:!0})})):setTimeout(o,500)};o(); |
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
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(e.hyperapp={})}(this,function(e){"use strict";e.h=function(e,n){for(var t=[],r=[],o=arguments.length;2<o--;)t.push(arguments[o]);for(;t.length;){var l=t.pop();if(l&&l.pop)for(o=l.length;o--;)t.push(l[o]);else null!=l&&!0!==l&&!1!==l&&r.push(l)}return"function"==typeof e?e(n||{},r):{nodeName:e,attributes:n||{},children:r,key:n&&n.key}},e.app=function(e,n,t,r){var o,l=[].map,u=r&&r.children[0]||null,i=u&&function n(e){return{nodeName:e.nodeName.toLowerCase(),attributes:{},children:l.call(e.childNodes,function(e){return 3===e.nodeType?e.nodeValue:n(e)})}}(u),f=[],m=!0,a=v(e),c=function e(r,o,l){for(var n in l)"function"==typeof l[n]?function(e,t){l[e]=function(e){var n=t(e);return"function"==typeof n&&(n=n(h(r,a),l)),n&&n!==(o=h(r,a))&&!n.then&&d(a=p(r,v(o,n),a)),n}}(n,l[n]):e(r.concat(n),o[n]=v(o[n]),l[n]=v(l[n]));return l}([],a,v(n));return d(),c;function g(e){return"func |
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
sealed abstract class ActorType { | |
override def toString: String = this.getClass.getName.init | |
} | |
case object Application extends ActorType | |
case object Group extends ActorType | |
case object Organization extends ActorType | |
case object Person extends ActorType | |
case object Service extends ActorType |
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
object unpack { | |
def main(args: Array[String]): Unit = { | |
val tuple = (1, 2) | |
println(plus(1, 2)) // 3 | |
println((plus _).tupled(tuple)) // 3 | |
} | |
def plus(a: Int, b: Int): Int = a + b | |
} |
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
args = [1, 2] | |
def plus(a, b): | |
return a + b | |
print(plus(1, 2)) # 3 | |
print(plus(*args)) # 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
sudo docker run -it --rm -p 9000:9000 \ | |
-v=$(pwd):/root \ | |
-e VIRTUAL_HOST=chao.example.com \ | |
-e LETSENCRYPT_HOST=chao.example.com \ | |
-e LETSENCRYPT_EMAIL=chao@example.com \ | |
-e VIRTUAL_PORT=9000 \ | |
--net friends_link \ | |
hseeberger/scala-sbt:8u151-2.12.4-1.1.0 \ | |
sbt run |
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
object app extends App { | |
val l = List(1, 1, 1, 2, 2, 3, 4, 5, 5) | |
val res = S09(l) | |
println(res) | |
def S09[A](list: List[A]): List[Any] = { | |
def together(num: Int, head: A, tail: List[A]): List[Any] = { | |
println(num, head, tail) | |
tail match { | |
case x :: xs if x == head => together(num + 1, head, xs) |
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
object chao extends App{ | |
implicit class RichInt(arg: Int) { | |
def hosiinize: String = arg.toString + "兆円欲しい!" | |
} | |
println(3.hosiinize) // 3兆円欲しい! | |
println(5000.hosiinize) // 5000兆円欲しい! | |
} |
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
class Yakisoba(val taste: String) | |
object main extends App { | |
// YakisobaからBooleanへのImplicit Conversion | |
implicit def yakisobaToBoolean[A](yakisoba: A)(implicit f: A => Yakisoba): Boolean = yakisoba.taste == "sauce" | |
// BooleanからIntへのImpliit Conversion | |
implicit def booleanToInt[B](arg: B)(implicit f: B => Boolean): Int = if (arg) 1 else 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
class MyClass: | |
def getX(self): | |
return self | |
myclass = MyClass() | |
# クラスから呼び出すと想定通り動く | |
print(myclass.getX()) | |
# <__main__.MyClass object at 0x7f2a12223588> |
NewerOlder