This file contains hidden or 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
| sad |
This file contains hidden or 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 char *ssid = "The cake is a lie."; | |
| ESP8266WebServer server(80); | |
| Servo servoLeft, servoMid, servoRight; | |
| long posLeft = 90, posMid = 90, posRight = 90; | |
| int forward[4][3] = {{70, 95, 60}, {110, 93, 100}, {110, 83, 100}, {80, 85, 70}}; | |
| int backward[4][3] = {{70, 95, 60}, {80, 85, 70}, {110, 83, 100}, {110, 93, 100}}; |
This file contains hidden or 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
| :set prompt "\ESC[1;34m%s\n\ESC[0;34mλ> \ESC[m" | |
| :set +t | |
| :def hoge const $ return $ unlines [":reload",":main"] |
This file contains hidden or 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
| for remote in `git branch -r | grep -v '\->'`; do git branch --track $remote; done |
This file contains hidden or 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
| ssh_authorized_keys: | |
| - ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAsY2XC4dDx1BpGuqxBxVIK5n8/r4uSr8Qp1M2MogWGk6W8OxBIWXZxsQe4bAai1p2FsRqHjl7CXC4hKHUQsR14oTvwLCarndLPRMMDSiOa+wQtSBsmt1ESZeVYFRtoIzn0t4dImTO55RfhZxyPijcX3TSQyTUjqU5ainBwtI1wsZKY1IsC4Pa3Jbc1iC+rjICz2BHv+q9vfIDy+kYQEeaHipSBf4wkQdwdfQK3JyKjJdYDe82/972HQjQPQ/niqZWEuPC/H93srytY/KLkayZlXreLFDbVvZtQXJboNq82T3mqDniDqTcKV1W3Kp850784T9nC+YwYWQRCd52oxS7IQ== [email protected] |
This file contains hidden or 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
| package App; | |
| import java.lang.reflect.InvocationHandler; | |
| import java.lang.reflect.Method; | |
| import java.lang.reflect.Proxy; | |
| public class Main { | |
| public static void main(String[] args) { | |
| MyInvocationHandler handler = new MyInvocationHandler(); | |
| MyProxy proxy = (MyProxy) Proxy.newProxyInstance(MyProxy.class.getClassLoader(), new Class[]{MyProxy.class}, handler); |
This file contains hidden or 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
| trait TaxStrategy { | |
| def tax(s: String): Double | |
| } | |
| class StrategyA extends TaxStrategy { | |
| override def tax(s: String): Double = 1 | |
| } | |
| class StrategyB extends TaxStrategy { | |
| override def tax(s: String): Double = 2 |
This file contains hidden or 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
| val restrictedAccess: Map[String, Elem] = Map("scala" -> tweets("scala"), "java" -> tweets("java")) | |
| val usingPartialFuncs: Map[String, (String) => Elem] = Map("scala" -> tweets _, "java" -> tweets _) | |
| usingPartialFuncs.view.map{ t=> t._2(t._1) }.head |
This file contains hidden or 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
| import java.net.URL | |
| import scala.io.Source | |
| import scala.xml.XML | |
| def tweets(handle: String) = { | |
| println("Fetching tweets for specified handle: " + handle) | |
| val source = Source.fromURL(new URL("https://twitter.com/search?q=" + handle)) | |
| val iterator: Iterator[String] = source.getLines() |
This file contains hidden or 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
| val restrictedList = List(-2, -1, 0, 1, 2) map(2 / _) | |
| restrictedList(0) | |
| val nonrestrictedList = List(-2, -1, 0, 1, 2).view map(2 / _) | |
| nonrestrictedList(0) |
NewerOlder