Skip to content

Instantly share code, notes, and snippets.

@tyrcho
tyrcho / _vimrc
Created October 28, 2015 13:51
vim / gvim init script vimrc
noremap <silent> <F4> :let @* = expand("%:p")<CR>
http://stackoverflow.com/questions/916875/yank-file-name-path-of-current-buffer-in-vim
@tyrcho
tyrcho / mvnquickinstall.bat
Last active October 14, 2015 14:13
Maven quick install : skips tests (including compilation of test sources), findbugs, checkstyle (see http://maven.apache.org/surefire/maven-surefire-plugin/examples/skipping-test.html)
mvn install -Dmaven.test.skip=true -Dfindbugs.skip=true -Dcheckstyle.skip=true
@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>
@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 — 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 / Backtracking.scala
Last active November 28, 2017 00:21
Backtracking generic algorithm with demo on the problem of the 8 (or N) queens
import scala.annotation.tailrec
object Backtracking {
trait Problem {
type Node
trait Result
case object Rejected extends Result
@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 / 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 / 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 / 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