Skip to content

Instantly share code, notes, and snippets.

View Test.java
public class Test {
static int a;
public static boolean f(int b) {
while(true) {
if( a==3 ) {
return true;
}
try {
View test.html
<html>
<head>
<script>
function put(data, callback) {
request("PUT", "https://api.myjson.com/bins/4wq17", JSON.stringify(data), callback)
}
function get(callback) {
request("GET", "https://api.myjson.com/bins/4wq17", null, callback)
}
function request(method, url, data, callback) {
View gist:a911b98b56b1e241fa76
package dependencies;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
View string.c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef struct {
int len;
char *s;
} string_t;
typedef string_t string;
View gist:77cd12ec4d40d4442124
#include <vector>
#include <iostream>
#include <dmtx.h>
#include <opencv2/opencv.hpp>
void decode(const cv::Mat& image){
int width = image.cols;
int height = image.rows;
View test.c
#include <stdio.h>
int main(int argc, char* argv[]) {
FILE * filePointer = NULL;
filePointer = stdin;
char inputText[300];
if (fgets(inputText, sizeof(inputText), filePointer) != NULL ) //!= EOF
{
View PerlinChunks.java
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import javax.swing.JFrame;
public class PerlinChunks {
private static int hash32shift(int key) {
key = ~key + (key << 15);
key = key ^ (key >>> 12);
key = key + (key << 2);
View browser.py
#!/usr/bin/python
import gtk, webkit, sys, time, gobject
class Browser:
def __init__(self, window, url):
self.window = window
self.view = (webkit.WebView(), webkit.WebView())
self.url = url
View R.java
import java.util.Random;
public class R {
private static long doRead(final Random r, final long rangeStart,
final long rangeEnd) {
long retVal = 0;
final long range = rangeEnd - rangeStart;
// Fill until we get to range
@banthar
banthar / go-gl.patch
Created Sep 11, 2013
golang + OSMesa
View go-gl.patch
diff --git a/gl.go b/gl.go
index 89581f3..8ba19cb 100644
--- a/gl.go
+++ b/gl.go
@@ -4,13 +4,8 @@
package gl
-// #cgo darwin LDFLAGS: -framework OpenGL -lGLEW
-// #cgo windows LDFLAGS: -lglew32 -lopengl32