Skip to content

Instantly share code, notes, and snippets.

View MacDue's full-sized avatar
:shipit:

Benjamin Maxwell MacDue

:shipit:
View GitHub Profile
@MacDue
MacDue / parameterized_verbatim.hpp
Last active June 19, 2020 11:44
parameterized_verbatim for sqlpp11
/*
* Copyright (c) 2013-2020, Roland Bock, MacDue
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
@MacDue
MacDue / crosshair.c
Created February 19, 2018 15:53
OpenGL crosshair
void draw_crosshair() {
/* Draws a crosshair in the center of the screen */
glDisable(GL_DEPTH_TEST);
glDisable(GL_LIGHTING);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluOrtho2D(0, width, height, 0);
/* A book page URL is like http://reader.vlebooks.com/reader/sessionid_<ID>/page/MTA3My84NTE4LzQvMA==
* The page of a book is from MTA3My84NTE4LzQvMA== this is simply a base64 encoded string.
* Decoded it becomes something like 1073/8518/4/0
* That is <Page>/<Some>/<Other>/<Ids>
* For educational purposes only.
*/
// Example call stealBook(4, "23672386824842", "/1337/1/2")
function stealBook(bookPageCount, session_id, bookId) {
const snekfetch = require('snekfetch');
const EventEmitter = require('events');
const BASE_URL = 'http://discoin.sidetrip.xyz';
const endpoints = {
transactions: '/transactions',
transaction: '/transaction'
};
class DiscoinError extends Error {