Skip to content

Instantly share code, notes, and snippets.

View bplaat's full-sized avatar
💻
Working on stuff

Bastiaan van der Plaat bplaat

💻
Working on stuff
View GitHub Profile
@bplaat
bplaat / select.js
Created August 12, 2017 18:02
Simple jQuery like js dom selector
const $ = (query) => Array.from(document.querySelectorAll(query));
$('button').forEach(btn => console.log(btn.innerHTML));
import javafx.application.Application;
import javafx.beans.value.ChangeListener;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.scene.Scene;
import javafx.stage.Stage;
@bplaat
bplaat / bassietasks.c
Created May 13, 2018 10:39
BassieTasks GTK3 Task Manager first test
// BassieTasks - Made by Bastiaan van der Plaat (https://bastiaan.plaatsoft.nl/)
// Ubuntu install: sudo apt install build-essential libgtk-3-dev
// Build & Run: gcc bassietasks.c -Wall -o bassietasks $(pkg-config --cflags gtk+-3.0 --libs gtk+-3.0) && ./bassietasks
#include <gtk/gtk.h>
int main(int argc, char *argv[]) {
gtk_init(&argc, &argv);
GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_icon_name(GTK_WINDOW(window), "utilities-system-monitor");
@bplaat
bplaat / index.js
Created June 27, 2018 07:31
Blockchain
var crypto = require('crypto');
class Block {
constructor(index, previousHash, data) {
this.index = index;
this.previousHash = previousHash;
this.timestamp = Date.now();
this.data = data;
this.nonce = 0;
}
@bplaat
bplaat / editor.asm
Last active September 3, 2019 17:05
A simple win32 editor made with assembly
; Bassies Editor
format PE GUI
entry start
macro invoke proc, [arg] {
reverse pushd arg
common call [proc]
}
section '.text' code readable executable
@bplaat
bplaat / hello.asm
Created February 20, 2019 15:48
Simple win32 program
; ./nasm -f bin hello.asm -o hello.exe && ./hello
BITS 32
CPU 386
ORG 0x400000
%define RVA(a) (a - 0x400000)
%macro push_dwords_reverse 1-*
%rep %0
%rotate -1
push dword %1
@bplaat
bplaat / bear.md
Last active September 3, 2019 17:05
A simple python script the prints all albums of a artist in markdown

Blackbear

ANONYMOUS

  1. PINK ROLEX (2:16)
  2. HATE MY GUTS (2:40)
  3. DRUG DEALER (2:46)
  4. SWEAR TO GOD (2:30)
  5. MAKE A MESS (2:39)
  6. SICK OF IT ALL (2:56)
  7. CHANGES (2:34)
@bplaat
bplaat / .htaccess
Last active September 3, 2019 17:04
Simple PHP framework
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*$ index.php [L]
@bplaat
bplaat / drs.c
Created July 15, 2019 16:14
Age of Empires 1 and 2 drs file unpacker
// http://wiki.xentax.com/index.php/GRAF:Age_Of_Empires_DRSArchive
// tcc drs.c && ./drs "C:\Program Files (x86)\Microsoft Games\Age of Empires\data\sounds.drs" sounds
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
typedef struct DRS_TABLE {
uint32_t type;
uint32_t offset;
@bplaat
bplaat / dl.py
Created August 10, 2019 22:44
Kerksoft image downloader
import urllib
i = 1
while True:
j = 1
request = urllib.urlopen('http://liedboek.liedbundels.nu/content/liedboek/computer-' + str(i) + '-muziek-couplet-' + str(j) + '-1.png')
if request.getcode() == 200:
print('Get ' + str(i) + '-' + str(j))
file = open('kerksoft-client/images/liedboek/' + str(i) + '-' + str(j) + '.png', 'w')
file.write(request.read())
file.close()