This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait ListAdapter[+T] extends Reactive { | |
def isEmpty:Boolean = size <= 0 | |
def indexes:Range = 0 to maxIndex step 1 | |
def maxIndex:Int = size - 1 | |
def apply(index: Int):T = item(index) | |
def size:Int | |
def item(index: Int):T | |
def createItemString(index: Int): String | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PORT=5555 | |
echo "Getting device ip..." | |
PHONE_IP=`adb shell ip -f inet addr show wlan0 | grep inet | cut -d: -f2 | awk '{ print $2 }' | grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}"` | |
echo "Device ip: $PHONE_IP" | |
echo "Enabling adb tcpip on port $PORT" | |
adb tcpip $PORT | |
echo "adb tcpip enabled. Connecting..." | |
adb connect $PHONE_IP:$PORT | |
echo "Adb over wifi connected. Now you can remove your usb cable." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A | |
class A2 extends A | |
class B | |
trait M[X] | |
// | |
// Upper Type Bound | |
// | |
def upperTypeBound[AA <: A](x: AA): A = x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: "java" | |
apply plugin: "eclipse" | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
compile ( | |
"org.jboss.netty:netty:latest.integration", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'java' | |
apply from: 'provided.gradle' | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
provided group: 'org.projectlombok', name: 'lombok', version:'1.14.8' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Formatting constants | |
export BOLD=`tput bold` | |
export UNDERLINE_ON=`tput smul` | |
export UNDERLINE_OFF=`tput rmul` | |
export TEXT_BLACK=`tput setaf 0` | |
export TEXT_RED=`tput setaf 1` | |
export TEXT_GREEN=`tput setaf 2` | |
export TEXT_YELLOW=`tput setaf 3` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.util.DynamicVariable | |
/** | |
* A concise JSON DSL in Scala. | |
* When you want to use, only | |
* import Jsson._ is needed. | |
* Note that this program change the semantics of standard -> operator. | |
* I recommend that you use enclosing block with Jsson as followings: | |
* { | |
* import Jsson._ | |
* val obj = %{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def json(foo:String, bar:String) = | |
f"""{ | |
| "commands" : [{ | |
| "type" : "set_user_data", | |
| "user_data" : { | |
| "foo" : $foo%s, | |
| "bar" : $bar%s | |
| } | |
| }] |