Skip to content

Instantly share code, notes, and snippets.

View argan's full-sized avatar

Argan Wang argan

View GitHub Profile
import java.io.OutputStream;
import java.io.PrintStream;
public class Unicorn {
private static String str1 = "UNICORN #1: PAT THIS UNICORN ONCE";
private static String str2 = "UNICORN #2: PAT THIS UNICORN ONCE";
static class Printer extends PrintStream {
private PrintStream origin;
public class MysteryBox {
private long x0, x1;
private boolean y0, y1, y2, y3;
private int z0;
private double[] a = new double[8];
}
@argan
argan / Article.scala
Created February 20, 2013 06:15 — forked from bmc/Article.scala
case class Article(...);
object Article {
import DBUtil._
def delete(id: Long): Either[String, Boolean] = {
withTransaction { implicit connection =>
SQL("DELETE FROM comments WHERE article_id = {id}").on("id" -> id).executeUpdate()
SQL("DELETE FROM appusers WHERE id = {id}").on("id" -> id).executeUpdate( )
Right(true)
public class HelloWorld {
private static int foo() {
return 42;
}
private static void bar() {
}
public static void main(String[] args) throws Exception {
foo();
import java.io.*;
import java.util.*;
import sun.jvm.hotspot.memory.*;
import sun.jvm.hotspot.oops.*;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.tools.*;
public class DumpClassURL extends Tool {
public void run() {
import java.io.*;
import java.util.*;
import sun.jvm.hotspot.memory.*;
import sun.jvm.hotspot.oops.*;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.tools.*;
import sun.jvm.hotspot.utilities.*;
public class DirectMemorySize extends Tool {
@argan
argan / 0_reuse_code.js
Created June 13, 2014 16:58
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console