Skip to content

Instantly share code, notes, and snippets.

@Override
public void draw() {
this.sprite.getTexture().bind();
//double w = this.width/32;
//double h = this.height/32; // we should do the same for height.
double row = this.sprite.getsY();
double col = this.sprite.getsX();
@belak
belak / PKGBUILD
Created May 22, 2012 13:26
broadcom-wl
# Contributor: Austin ( doorknob60 [at] gmail [dot] com )
# Maintainer: Gaetan Bisson <bisson@archlinux.org>
pkgname=broadcom-wl
pkgver=5.100.82.112
pkgrel=3
pkgdesc='Broadcom 802.11abgn hybrid Linux networking device driver'
url='http://www.broadcom.com/support/802.11/linux_sta.php'
arch=('i686' 'x86_64')
license=('custom')
@belak
belak / jot.go
Last active December 16, 2015 06:49
package main
// NOTE: This implements the following protocol:
// https://github.com/turn/json-over-tcp
// This was done for chunking reasons
// Darn you TCP!
import (
"encoding/binary"
"encoding/json"
// Any colors for output
var colors = require('colors');
// For json sockets
var jot = require('json-over-tcp');
// Setup socket.io
var app = require('http').createServer();
var io = require('socket.io').listen(app);
import requests
import gspread
gc = gspread.login('user@gmail.com', 'password')
wks = gc.open('Reddit Analysis Data').sheet1
# Grab the hot topics
r = requests.get("http://www.reddit.com/hot.json?limit=50")
j = r.json()
cols = ['title', 'author', 'over_18', 'url', 'permalink', 'created_utc', 'subreddit', 'num_comments', 'ups', 'downs', 'score']
@belak
belak / TMXTiledMapArtifactFixer.java
Last active August 29, 2015 13:58
Tileset Fixer
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import org.apache.commons.cli.BasicParser;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.HelpFormatter;
@belak
belak / mc-query.py
Last active August 29, 2015 13:58
Minecraft Stats Query
import json
import struct
import socket
# Minecraft varints are 32-bit signed values
# packed into Google Protobuf varints
# https://gist.github.com/nickelpro/7312782
import struct
def pack_varint(val):
@belak
belak / mc-query.php
Last active August 29, 2015 14:00
Minecraft Stats Query
<?php
// Settings
$hostname = "66.240.202.11";
$port = 25565;
// Based off of https://github.com/winny-/mcstat/blob/master/mcstat.php
// with updated reading of the key-value and username portions.
$sess_id = rand(1, 0xFFFFFFFF) & 0x0F0F0F0F;
@belak
belak / .gitmodules
Last active August 29, 2015 14:04
Ville Minecraft Query
[submodule "mcstat"]
path = mcstat
url = https://github.com/winny-/mcstat.git
@belak
belak / utils.c
Last active August 29, 2015 14:06
Random C string utils
// NOTE: _GNU_SOURCE is required for this to work because of asprintf
#define _GNU_SOURCE
#include <stdarg.h>
#include <stdio.h>
// This function allocates a string, prints the formatted version to it and uses write to print it to stdout.
void waprintf(const char *fmt, ...) {
va_list args;