Skip to content

Instantly share code, notes, and snippets.

View gaocegege's full-sized avatar
🐮
Programming

Ce Gao gaocegege

🐮
Programming
View GitHub Profile
@gaocegege
gaocegege / actorexample.scala
Created June 9, 2015 23:50
scala actor example
import scala.actors.Actor
import scala.actors.Actor._
object Main {
class Pong extends Actor {
def act() {
var pongCount = 0
while (true) {
receive {
case "Ping" =>
@gaocegege
gaocegege / friend.scala
Created June 9, 2015 14:40
Gephi Toolkit Transformer in scala
package renren
class Friend(var uid: String, var school: String, var name: String, var link: String) extends Serializable {
override def toString(): String = {
s"Friend($uid, $school, $name, $link)"
}
override def equals(o: Any) = o match {
case that: Friend => that.uid.equalsIgnoreCase(this.uid)
case _ => false
@gaocegege
gaocegege / reporter.scala
Created June 6, 2015 08:46
scala reporter
package reporter
import scala.tools.nsc.Global
import scala.reflect.internal.util.{Position, NoPosition, FakePos}
object Reporters {
abstract class ReporterFormatter {
def formatTypeTitle(typ: MsgType): String
}
@gaocegege
gaocegege / httpclient.scala
Created June 6, 2015 08:45
scala httpclient example
import java.io._
import org.apache.commons._
import org.apache.http._
import org.apache.http.client._
import org.apache.http.client.methods.HttpPost
import org.apache.http.impl.client.DefaultHttpClient
import java.util.ArrayList
import org.apache.http.message.BasicNameValuePair
import org.apache.http.client.entity.UrlEncodedFormEntity
@gaocegege
gaocegege / tab-color-in-iterm2.zsh
Created May 18, 2015 14:57
add the script into .zshrc, and u can change the color of tab. from http://kendsnyder.com/tab-colors-in-iterm2-v10/
# iterm coloring
function tab-color() {
if [[ $# == 1 ]]
then
# convert hex to decimal
hex=$1
if [[ ${hex:0:1} == "#" ]]
then
# strip leading hash sign
hex=${hex:1:6}

Keybase proof

I hereby claim:

  • I am gaocegege on github.
  • I am gaocegege (https://keybase.io/gaocegege) on keybase.
  • I have a public key whose fingerprint is 48F2 9F0D 1473 D685 3D8E 0E92 8D04 D990 3473 542E

To claim this, I am signing this object: