Skip to content

Instantly share code, notes, and snippets.

View dant3's full-sized avatar

Viacheslav Blinov dant3

View GitHub Profile
@dant3
dant3 / type-bounds.scala
Created September 29, 2015 22:08 — forked from retronym/type-bounds.scala
Tour of Scala Type Bounds
class A
class A2 extends A
class B
trait M[X]
//
// Upper Type Bound
//
def upperTypeBound[AA <: A](x: AA): A = x
@dant3
dant3 / typedactordemo.scala
Last active August 28, 2015 15:38 — forked from rkuhn/typedactordemo.scala
TypedActor Demonstration
package typedactordemo
import akka.actor._
import akka.dispatch.Future
import akka.pattern.ask
import akka.util.Timeout
import akka.util.duration._
case class Request(payload: String)
case class Response(payload: String)
@dant3
dant3 / vlcsms.c
Last active August 29, 2015 14:22 — forked from TimSC/vlcsms.c
//To compile:
//cc vlcsms.c -o vlcsms -lvlc
//This source is by Tim Sheerman-Chase and it is released as public domain.
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include <inttypes.h>
#include <vlc/vlc.h>
/**
* Copyright 2013 John Smith
*
* This file is part of Jewelsea Tic-Tac-Toe.
*
* Jewelsea Tic-Tac-Toe is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
@dant3
dant3 / vlcsms.c
Last active August 29, 2015 14:15 — forked from TimSC/vlcsms.c
//To compile:
//cc vlcsms.c -o vlcsms -lvlc
//This source is by Tim Sheerman-Chase and it is released as public domain.
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include <inttypes.h>
#include <vlc/vlc.h>
/*
* to run from console:
* $scala DuplicatesFinder.scala /path/to/android/project
*/
import java.io.File
import scala.xml._
val folder = args(0)
val project = new File(folder)
package com.example.jeremybell.myapplication
import android.app.Activity
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
class MyActivity extends Activity {
override def onCreate(savedInstanceState: Bundle): Unit = {
super.onCreate(savedInstanceState)
import sbt._
import sbt.Keys._
import android.Keys._
object JavaAndroidBuild extends Build {
lazy val rootSettings = Seq(
packageT in Compile <<= packageT in Android in app3,
packageRelease <<= packageRelease in Android in app3,
packageDebug <<= packageDebug in Android in app3
package com.actforex.nst
import java.util.concurrent.{CancellationException, Executors, FutureTask, Callable}
import scala.concurrent.{ExecutionContext, Future}
import ExecutionContext.Implicits.global
trait CancelForFuture {
def cancel(mayInterruptIfRunning:Boolean):Boolean
}
@dant3
dant3 / boost.sh
Created March 25, 2014 19:55 — forked from rsobik/boost.sh
#===============================================================================
# Filename: boost.sh
# Author: Pete Goodliffe
# Copyright: (c) Copyright 2009 Pete Goodliffe
# Licence: Please feel free to use this, with attribution
# Modified version
#===============================================================================
#
# Builds a Boost framework for the iPhone.
# Creates a set of universal libraries that can be used on an iPhone and in the