Skip to content

Instantly share code, notes, and snippets.

Michal Stawinski nazgee

Block or report user

Report or block nazgee

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View TokenSet 5.5k in 300 out
michal@e6540:~/workspace/liclipse/plagiat$ time python ./ --lowercase --limitoutput 300 --limitinput 5500 --method ComparisonTokenSet
data = pubmed_result.csv
limitinput = 5500
limitoutput = 300
method = ComparisonTokenSet
lowercase = True
max number of combinations to check: 15122250
nazgee /
Created May 21, 2016 — forked from natevw/
Using Bus Blaster v4 with STM32F4x SWD

Using Bus Blaster v4 with STM32F4x SWD

For SWD (instead of normal JTAG) you need a different CPLD "buffer logic" image on the Bus Blaster, the KT-Link compatible ones seem like the recommended means.

# with buffer logic at
# via from
curl -O
openocd -f board/dp_busblaster_v3.cfg -c "adapter_khz 1000; init; svf /Users/natevw/Downloads/ktlink.svf; shutdown"
View backend_kms.c
switch (format) {
// 32bpp
// unsupported...
goto error;
View backen_kms.c
static struct gbm_bo *gbm_kms_bo_create(struct gbm_device *gbm,
uint32_t width, uint32_t height,
uint32_t format, uint32_t usage)
struct gbm_kms_device *dev = (struct gbm_kms_device*)gbm;
struct gbm_kms_bo *bo;
unsigned attr[] = {
// Note that I wrote this in java in Processing - paste this GIST into processing to see it in action.
// It is not the most elegant thing ever but it does deal with end caps and ribbon loops and the like.
// If you port this over to say objective-c / opengl / c etc - you may need to deal with polygon direction
// here is a snapshot of it running :
int nvertices = 0;
float[] vertexpool = new float[3000];
float x1,x2,y1,y2;
void intersect(int kind, float x0, float y0, float x1,float y1,float x2,float y2,float x3,float y3,float x4,float y4) {
nazgee /
Created Mar 17, 2014
AndEngine TextTweaker (used to colorized Text objects using regular expressions)
package eu.nazgee.features.utils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.andengine.entity.text.Text;
import org.andengine.entity.text.vbo.HighPerformanceTextVertexBufferObject;
import org.andengine.opengl.font.IFont;
import org.andengine.opengl.font.Letter;
import org.andengine.util.adt.color.Color;
nazgee / gist:7433663
Created Nov 12, 2013
code snippet to request test ads on "unknown" device
View gist:7433663
public static void addThisDeviceAsTestDevice(AdRequest pAdRequest) {
String android_id = Settings.Secure.getString(GameResources.ACTIVITY.getContentResolver(), Settings.Secure.ANDROID_ID);
String deviceId = md5(android_id).toUpperCase();
boolean isTestDevice = pAdRequest.isTestDevice(GameResources.ACTIVITY);
if (!isTestDevice) {
throw new RuntimeException("Failed to use test Ads :(");
nazgee /
Created May 7, 2013
Positioner class for andengine
package eu.nazgee.features.utils;
import org.andengine.entity.IEntity;
public class Positioner {
// ===========================================================
// Constants
// ===========================================================
// ===========================================================
nazgee / gist:4011051
Created Nov 4, 2012
BROKEN-and-OLD GLES2 testing of debug draw
View gist:4011051
From bf83c5e8e3b656795c85d0c321e72917900937ad Mon Sep 17 00:00:00 2001
From: Michal Stawinski <>
Date: Sun, 4 Nov 2012 09:20:21 +0100
Subject: [PATCH] Testing of OLD-and-BROKEN degbugdraw on GLES2
--- | 1 +
.../examples/ | 75 ++++++++++++++++++++
2 files changed, 76 insertions(+)
nazgee / gist:4011043
Created Nov 4, 2012
GLES2 testing of debug draw
View gist:4011043
From 37ec12de2624870eca58cbf60860445e4c478de3 Mon Sep 17 00:00:00 2001
From: Michal Stawinski <>
Date: Sun, 4 Nov 2012 09:20:21 +0100
Subject: [PATCH] Testing of degbugdraw on GLES2
--- | 1 +
.../examples/ | 75 ++++++++++++++++++++
2 files changed, 76 insertions(+)
You can’t perform that action at this time.