Skip to content

Instantly share code, notes, and snippets.

View arkadius's full-sized avatar

Arek Burdach arkadius

View GitHub Profile
#!/bin/bash
host=$1
password=`awk "/#Password/ && inhost { print \\\$2 } /Host/ { inhost=0 } /Host $host/ { inhost=1 }" ~/.ssh/config`
if [[ -z "$password" ]]; then
/usr/bin/ssh $*
else
sshpass -p $password /usr/bin/ssh $*
fi
Sentiment: {
"docSentiment": {
"score": -0.222224,
"type": "negative"
},
"language": "english",
"totalTransactions": 1
}
Entities: {
"entities": [
import akka.actor.{Actor, ActorSystem, Props, Stash}
import scala.concurrent._
object AsyncRestart extends App {
val system = ActorSystem()
val actor = system.actorOf(Props(new AsyncRestartActor))
class A()
class B(val a: A)
class C(val b: B)
implicit def aToB(a: A) = new B(a)
implicit def sthConvertibleToBToC[T <% B](t: T): C = new C(t)
def doSthWithC[T <% C](t: T) = t.b
doSthWithC(new A)

Keybase proof

I hereby claim:

  • I am arkadius on github.
  • I am arkadius (https://keybase.io/arkadius) on keybase.
  • I have a public key whose fingerprint is F2F2 22AD E13A EAC9 6349 9E22 C406 0852 104F 9B5A

To claim this, I am signing this object:

it should "do round-trip" in {
forAll(initialBoardAndChangesGenerator) {
case InitialBoardAndChanges(initialBoard, changes) =>
lazy val boardAndEventsStream: Stream[(BoardState, Seq[TaskEvent])] =
(initialBoard, Nil) #::
(boardAndEventsStream zip changes).map {
case ((prevBoard, events), changedBoard) =>
val newAddedEvents = prevBoard.diff(changedBoard)
(changedBoard, newAddedEvents)
}
app.controller("ProjectCtrl", ['$scope', 'historySvc', function ($scope, historySvc) {
(...)
var refreshChart = function () {
historySvc.getHistory($scope.selectedSprint.id).then(function (history) {
$scope.history = history;
});
};
(...)
object MicroBurnServices {
def render = renderIfNotAlreadyDefined(
angular.module("MicroBurnServices")
.factory("historySvc", jsObjFactory()
.future("getHistory", (sprintId: String) =>
ApplicationContext().columnsHistoryProvider.columnsHistory(sprintId)
)
)
)
}
class ProjectStateBinder
extends SimpleNgModelBinder("projectState", ProjectState(Nil))
with BindingToClient
with CometListener {
override protected def registerWith = ApplicationContext().projectActor
override def lowPriority: PartialFunction[Any, Unit] = resendState orElse super.lowPriority
private def resendState: PartialFunction[Any, Unit] = {
class ProjectStateBinder
extends SimpleNgModelBinder("projectState", ProjectState(Nil))
with BindingToClient
with CometListener {
override protected def registerWith = ApplicationContext().projectActor
override def lowPriority: PartialFunction[Any, Unit] = resendState orElse super.lowPriority
private def resendState: PartialFunction[Any, Unit] = {