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 triggerEvent(element, eventType) { | |
var e; | |
if (document.createEventObject) { | |
//ie | |
e = document.createEventObject(); | |
element.fireEvent(eventType, e); | |
} else { | |
//others | |
e = document.createEvent('HTMLEvents'); |
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
#!/bin/bash | |
wget http://at.or.at/hans/pd/Firmata-2.2.zip | |
unzip Firmata-2.2.zip | |
mv Firmata-2.2/Firmata /Applications/Arduino.app/Contents/Resources/Java/libraries/Firmata_2_2 | |
rm -rf Firmata-2.2 | |
rm Firmata-2.2.zip | |
# Start your Arduino IDE. | |
# Navigate to File -> Examples -> Firmata_2_2 -> StandardFirmata |
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
scala> Await.result(OptionTimeoutFuture { Thread.sleep(3000); 1 }, Duration(2, SECONDS)) | |
res22: Option[Int] = None | |
scala> Await.result(OptionTimeoutFuture { Thread.sleep(5000); 1 }, Duration(1, SECONDS)) | |
res23: Option[Int] = None | |
scala> Await.result(OptionTimeoutFuture { Thread.sleep(5000); 1 }, Duration(1, SECONDS)) | |
java.util.concurrent.TimeoutException: Futures timed out after [1 second] | |
at scala.concurrent.impl.Promise$DefaultPromise.ready(Promise.scala:96) | |
at scala.concurrent.impl.Promise$DefaultPromise.result(Promise.scala:100) |
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 bash | |
set -o xtrace -o errexit -o pipefail -o nounset | |
######################################################################################## | |
# CircleCI's current recommendation for roughly serializing a subset | |
# of build commands for a given branch | |
# | |
# circle discussion thread - https://discuss.circleci.com/t/serializing-deployments/153 | |
# Code from - https://github.com/bellkev/circle-lock-test |