Skip to content

Instantly share code, notes, and snippets.

View siman's full-sized avatar
🏠
Working from home

Alex Siman siman

🏠
Working from home
View GitHub Profile
@siman
siman / install-scala-2.11.7-sbt-0.13.9-on-ubuntu.sh
Last active November 17, 2015 15:28 — forked from osipov/gist:c2a34884a647c29765ed
Install Scala 2.11.7 and SBT 0.13.9 using apt-get on Ubuntu 14.04 or any Debian derivative using apt-get
sudo apt-get remove scala-library scala
sudo wget www.scala-lang.org/files/archive/scala-2.11.7.deb
sudo dpkg -i scala-2.11.7.deb
sudo apt-get update
sudo apt-get install scala
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 642AC823
sudo apt-get update
sudo apt-get install sbt
trait IgnoreIfBusyCmd
abstract class IgnoreIfBusyTyped[C <: IgnoreIfBusyCmd](implicit m: Manifest[C]) extends Actor with ActorLogging{
import context.{become, unbecome}
import context.system
class Completed {
override def toString = "Completed"
}
abstract class IgnoreIfBusyTyped[C](implicit m: Manifest[C])
extends Actor with ActorLogging {
import context.{become, unbecome}
import context.system
class Completed {
override def toString = "Completed"
}
@siman
siman / VipTreeApp.scala
Last active December 23, 2015 02:19
Filter VIP nodes of a tree. (non tail-recursive yet)
package example
import collection.mutable.ArrayBuffer
import collection.mutable
import annotation.tailrec
/**
* @author Alex Siman <aleksandr.siman@gmail.com>
* Date: 2013-09-12
*/
@siman
siman / gist:7458258
Created November 13, 2013 23:14
Postgres DAO with Slick (Scala)
package models
import scala.slick.driver.PostgresDriver.simple._
import Database.threadLocalSession
import scala.slick.jdbc.{GetResult, StaticQuery => Q}
trait AbstractDao[Id, E] {
def countAll: Int
{
"brand": "Twitch",
"site": "https://www.twitch.tv/",
"logo": "https://www-cdn.jtvnw.net/images/twitch_logo3.jpg",
"market": "Gaming",
"tactic": "Build a UGC community"
},
{
"brand": "Airbnb",
"site": "https://www.airbnb.com/",
@siman
siman / jquery-in-browser-console.js
Created April 20, 2017 23:59
Inject jQuery into browser console
var script = document.createElement("script");
script.setAttribute("src", "//code.jquery.com/jquery-latest.min.js");
script.addEventListener('load', function() {
var script = document.createElement("script");
document.body.appendChild(script);
}, false);
document.body.appendChild(script);
pragma solidity ^0.4.8;
// ----------------------------------------------------------------------------------------------
// A collaboration between Incent and Bok :)
// Enjoy. (c) Incent Loyalty Pty Ltd, and Bok Consulting Pty Ltd 2017. The MIT Licence.
// ----------------------------------------------------------------------------------------------
//config contract
contract TokenConfig {
@siman
siman / ethereum-transfer-events.js
Created October 26, 2017 19:50
JSON output of Transfer events of Golem token, Ethereum
// web3 code for Golem smart contract
// Golem token:
// https://etherscan.io/address/0xa74476443119A942dE498590Fe1f2454d7D4aC0d
// Golem Token tx:
// https://etherscan.io/tx/0x6e8e11e694673b0b9135511a8267ff05a8444af7d88aaf043350e6349fdb9bb0
// Golem creation block:
// 2603185