Skip to content

Instantly share code, notes, and snippets.

@tyrcho
tyrcho / sample
Last active August 29, 2015 14:08
Sample HS log extract
MatchStart(HeroChosen(Gul'dan,Warlock,false,1))
HeroPowerDeclared(CS2_056,1)
CardEvent(,6,ADDED_TO_DECK,1)
CardEvent(,7,ADDED_TO_DECK,1)
CardEvent(,8,ADDED_TO_DECK,1)
CardEvent(,9,ADDED_TO_DECK,1)
CardEvent(,10,ADDED_TO_DECK,1)
CardEvent(,11,ADDED_TO_DECK,1)
CardEvent(,12,ADDED_TO_DECK,1)
CardEvent(,13,ADDED_TO_DECK,1)
@tyrcho
tyrcho / README.md
Created November 7, 2014 13:24
default application (windows)

Allows to change the default program Windows uses for filew with unknown file extension.

@tyrcho
tyrcho / Dockerfile
Created February 6, 2015 08:48
activiti explorer in tomcat 7 - docker
FROM tomcat:7
RUN curl -SL https://github.com/Activiti/Activiti/releases/download/activiti-5.17.0/activiti-5.17.0.zip -o activiti.zip \
&& unzip activiti.zip \
&& rm activiti.zip \
&& cp activiti-5.17.0/wars/activiti-explorer.war webapps \
&& rm -rf activiti-5.17.0
@tyrcho
tyrcho / clash.ahk
Created March 5, 2015 22:05
Clash of Clans easy deploy with AutoHotKeys
#IfWinActive, BlueStacks
x1 := 240
x11 := 1200
y := 770
Deploy(i)
{
global
BlockInput, On
@tyrcho
tyrcho / AstarGraph.scala
Last active August 29, 2015 14:17
Breadth first graph (A*)
import scala.annotation.tailrec
object GraphDemo extends App {
val graph = SimpleGraph(Nil)
val from = SimpleNode(0, 0)
val to = SimpleNode(15, 8)
val moves = graph.shortestPath(from, to).getOrElse(Nil)
moves.reverse.map(_.name).foreach(println)
}
@tyrcho
tyrcho / AstarGraph.scala
Last active August 29, 2015 14:17 — forked from tyrcho/AstarGraph.scala
A star (A*) Graph traversal to find lowest cost
//CodinGame - Bender
object Solution extends App {
val n = readInt
val exterior = -1 -> new Room(-1, 0, -1, -1)
val roomsRead = for {
i <- (0 until n).toList
Array(id, value, next1, next2) = readLine split " "
} yield id.toInt -> Room(id.toInt, value.toInt, if (next1 == "E") -1 else next1.toInt, if (next2 == "E") -1 else next2.toInt)
val rooms = (exterior :: roomsRead).toMap
@tyrcho
tyrcho / MbeanInfo.scala
Created April 3, 2015 15:25
Displays system information from Java/Scala using ManagementFactory and JMX MBean Server
import java.lang.management.ManagementFactory
import scala.collection.JavaConversions._
import scala.util.Try
object Test extends App {
val mbeanServer = ManagementFactory.getPlatformMBeanServer
for {
mb <- mbeanServer.queryMBeans(null, null)
name = mb.getObjectName
} {
@tyrcho
tyrcho / index.html
Last active August 29, 2015 14:21 — forked from tyrcho/README.md
<!DOCTYPE html>
<html>
<title>Agile Catalog</title>
<xmp theme="cerulean" style="display:none;">
This catalog references books and videos on agile.
@tyrcho
tyrcho / SimpleCardSimul.scala
Last active August 29, 2015 14:21
Simple card game simulation
import scala.util.Random
import scala.annotation.tailrec
object SimpleHSApp extends App {
import Minions._
val rush = Deck("rush", Map(minions(1) -> 10, minions(2) -> 10, minions(3) -> 10))
val slow = Deck("slow", Map(minions(3) -> 10, minions(4) -> 10, minions(2) -> 10))
println(List.fill(1000)(play(rush, slow, DefaultStrategy)).count(identity))
@tyrcho
tyrcho / index.html
Last active August 29, 2015 14:21
Sample hover with card picture on mouse events
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title> - cards hover demo</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.js"> </script>