Skip to content

Instantly share code, notes, and snippets.

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);
#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
{
#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;
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef struct {
int len;
char *s;
} string_t;
typedef string_t string;
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;
@banthar
banthar / .gitignore
Created November 11, 2009 16:29
Go SDL bindings (new version here: http://github.com/banthar/Go-SDL)
**.o
**.8
_obj/
main
**.cgo?.go
**.cgo?.c
**.cgo?.8
sdl_defs.go
**~
@banthar
banthar / Main.hx
Created March 16, 2010 10:33
pollock
// haxe -lib neash -main Main -swf9 pollock.swf
import flash.display.Sprite;
import flash.display.Shape;
import flash.display.Stage;
import flash.display.StageScaleMode;
import flash.display.Bitmap;
import flash.display.BitmapData;
@banthar
banthar / reddit-notify.pl
Created April 7, 2010 11:39
reddit new message tray notify
#!/usr/bin/perl
use strict;
use warnings;
use LWP::Simple;
use Gtk2::TrayIcon;
# touch last_date
# wget "http://www.reddit.com/static/mailgray.png" "http://www.reddit.com/static/mail.png"
#
#!/usr/bin/perl
use DBI;
use LWP::Simple;
my $dbh = DBI->connect("dbi:SQLite:dbname=servers.sqlite3","","");
{
my $sth = $dbh->prepare("CREATE TABLE servertypes (name varchar(255));");
@banthar
banthar / mini.go
Created May 26, 2010 13:33 — forked from manveru/mini.go
package main
import (
"gl"
"sdl"
)
func main() {
if sdl.Init(sdl.INIT_VIDEO) != 0 {
println("Video initialization failed: " + sdl.GetError())