Skip to content

Instantly share code, notes, and snippets.

View darkoverlordofdata's full-sized avatar

Bruce Davidson darkoverlordofdata

View GitHub Profile
@darkoverlordofdata
darkoverlordofdata / Varargs.vala
Last active January 29, 2016 05:08
Vala Tutorial: Variable-Length_Argument_Lists
/**
* Varargs.vala
*
* @see https://wiki.gnome.org/Projects/Vala/Tutorial#Variable-Length_Argument_Lists
*
*
* valac Varargs.vala
* ./Varargs
*
*/
@darkoverlordofdata
darkoverlordofdata / define.js
Created June 20, 2016 17:18
AMD Compatible module self loader
/**
* AMD Compatible module loader
*
* @param root object
* @returns module loader function define
*
*/
var define = (function (modules) {
return (name, deps, callback) => {
modules[name] = { id: name, exports: {} }
@darkoverlordofdata
darkoverlordofdata / mt19937.js
Created July 30, 2016 20:01
Mersenne Twister Asm.JS
import Ffi from 'ffi'
import {buffer} from 'ffi'
import Stdlib from 'stdlib'
export const mt19937 = (function(stdlib, foreign, heap) {
"use asm";
var HEAP = new stdlib.Uint32Array(heap);
var malloc = foreign.malloc;
GLib = imports.gi.GLib
Gio = imports.gi.Gio
Gdk = imports.gi.Gdk
Gtk = imports.gi.Gtk
Notify = imports.gi.Notify
Lang = imports.lang
APP_NAME = "Grrr!"
Notify.init(APP_NAME)
@darkoverlordofdata
darkoverlordofdata / valac2.vala
Created May 13, 2017 22:20
wrap valac for use from script (nodejs)
#!/usr/bin/env vala
/**
* ValaC2
*
* breaks valac into 2 steps with plugin pre/post processing
* this front end just collects all of the command line arguments and runs the coffeescript.
*
* command line flags are mangled to prevent the cli from expanding them.
*
*
@darkoverlordofdata
darkoverlordofdata / codiad-install.sh
Created January 6, 2018 03:49
Install my termux-codiad version
#installs the browser-based editor Codiad
#
# based on rnauber/install_codiad.sh
DEST=~/codiad
ADDR=127.0.0.1:53162
pkg install php
if [ ! -e $DEST ]
@darkoverlordofdata
darkoverlordofdata / tglm.h
Last active June 19, 2019 06:44
Tiny glm
/*******************************************************************
*
* MIT License Copyright (c) 2018 Dark Overlord of Data
* tglm is Tiny GLM for c99
*
* opengl math helpers inspired by GLM.
* using clang vector extensions and function overload.
*
*/
#pragma once
@darkoverlordofdata
darkoverlordofdata / UbuntoForAndroid.sh
Last active April 23, 2019 04:22
Ubuntu running on android
apt update && apt upgrade -y
apt install lsb-core build-essential dialog apt-utils -y
apt install xfce4 -y
export DISPLAY=:0 PULSE_SERVER=tcp:127.0.0.1:4712
startxfce4
@darkoverlordofdata
darkoverlordofdata / install-pc.py
Last active May 16, 2019 21:17
for access using wget
import urllib.request,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaee' + 'ebe013ee18cced0ef93d5f746d80ef60'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
@darkoverlordofdata
darkoverlordofdata / gist:9f13f6527cc7494776ec2cc41377d9cd
Created May 24, 2019 20:53
Fix usb drive after BalenaEtcher hoses it
in Linuxm run gparted and select device
Partition -> Delete
or
Partition -> Format To: select cleared
Edit -> Apply
it should now say unalocated!
Device -> Create Partition Table: select msdos