Skip to content

Instantly share code, notes, and snippets.

Avatar

Kenan Sulayman 19h

View GitHub Profile
View pbzx2.c
###### WARNING: PRIOR WORK: https://gist.githubusercontent.com/xerub/adf396f479d401b9c0e9/raw/18db6c9211a57f969a3c6063554a3ff82c44e1fa/pbzx2.c
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <lzma.h>
int main(int argc,
@19h
19h / preconnecter.ts
Last active Dec 30, 2018
preconnect hooker for external links
View preconnecter.ts
// https://gist.github.com/KenanSulayman/2da1085913b94add85315e08959bafa6
;(() => {
const runner = () => {
const processed: string[] = [];
const preconn = (type: string, url: string) => {
if (~processed.indexOf(url)) {
return;
}
@19h
19h / app.ts
Created Dec 14, 2018
PsychonautWiki Global Drug Survey Banner (SubstanceBox)
View app.ts
declare interface Window {
wgPageName?: string;
wgCategories?: string;
}
class Pr1ce {
protected _container?: HTMLTableSectionElement;
protected _pageName?: string;
protected _categories?: string;
protected _facts: string[];
View jenkins-material-theme.css
undefined#header{background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAACg4AAAL4CAYAAACps554AAAKzmlDQ1BJQ0MgUHJvZmlsZQAASImVlwdUU9kWQO97L73QAhGQEnoTpAgEkBJCCyAgHWyEJJBQYkgIKjZUBkdwLKiIoDKioyIKNorYEAu2QbGAfYIMIuo4WLCh5j/gE2b+X///9c9aZ939zjv3nHPfuvetcwGgErgSSRasAUC2OFcaHezPSExKZuCfAhzAAjKwB3guTyZhRUWFA1TGx7/Lhy4AjYy37Udi/fv7/yqafIGMBwAUhXIqX8bLRvk4qoM8iTQXAGQPajdbkCsZ4csoa0vRAlF+NMLpYzw4wqmjjMGM+sRGs1HWBYBA4XKl6QBQzFE7I4+XjsahBKDsKOaLxCijz8CHJ+TyUUbzginZ2fNHWIGydepf4qT/LWaqKiaXm67isbWMCiFAJJNkcRf9n5/jf0t2lnw8hyWqFKE0JBod0bqge5nzw1QsTo2IHGcRf9R/lIXykLhx5snYyePM5waEqeZmRYSPc5ooiKOKk8uJHWeBLDBmnKXzo1W50qRs1jhzpRN55ZlxKrtQwFHFzxfGJoxznig+YpxlmTFhEz5slV0qj1bVLxAH+0/kDVKtPVv2l/WKOKq5ucLYENXauRP1C8SsiZiyRFVtfEFA4IRPnMpfkuuvyiXJilL5C7KCVXZZXoxqbi66ISfmRqm+YQY3NGqcQTgIBgwQB7JALpACLggCIiAGglzBwpE9CtjzJYukonRhLoOFnjIBgyPmOUxhODs6MQEYObNjW+IdffQsQvSrE7ZVNQB4n1AqlScnbKE3ATiSAgCpYcJmPQcAjX4ALp/iyaV5Y7aR44T+CUhAHWgDPWAEzIA1+ldwBm7AC/iBQBAKIkEsSAJzAQ8IQTZa+QKwBKwARaAEbABbQAWoArvBfnAIHAVN4BQ4By6Ba+AmuAseAgXoAy/BIP
View openssh.randomart.js
const defaultSymbols = 'ES .o+=*BOX@%&#/^'.split('');
const defaultBounds = {
width: 17,
height: 9
};
const generateBoard = (data, bounds) => {
/* create board */
const board = [];
@19h
19h / mdc2-ubuntu.patch
Created Jul 17, 2018
microdc2-ubuntu-patches <891113>
View mdc2-ubuntu.patch
unchanged:
--- microdc2-0.15.6/configure.ac 2010-01-17 04:44:54.000000000 +0000
+++ microdc2-0.15.6/configure.ac 2010-01-20 23:57:34.000000000 +0000
@@ -47,12 +47,12 @@
#AH_TEMPLATE([XML_SAVE_FORMAT], [1], [Define if libxml2 has no such option for xmlSave- functions])
AC_PATH_PROG(XML_CONFIG, xml2-config)
AC_PATH_PROG(TR, tr)
-if test -n "$XML_CONFIG" && test -n "$TR"; then
- LIBXML2_VERSION=`$XML_CONFIG --version | $TR -d "."`
- if test $LIBXML2_VERSION -eq 2616; then
@19h
19h / distance.js
Created Jun 25, 2018
Vector Distance using WebAssembly
View distance.js
console.log(loadWebAssembly().exports['f64.distance'](1, 2, 3, 4));
function loadWebAssembly(opts) {
var imp = opts && opts.imports
var wasm = toUint8Array('AGFzbQEAAAABDgJgAX8Bf2AEf39/fwF8AwMCAAEHGQIGc3F1YXJlAAAMZjY0LmRpc3RhbmNlAAEKKQIIACAAIABsDwseAQJ/IAAgAmshBCABIANrIQUgBBAAIAUQAGq3nw8L')
var ready = null
var mod = {
buffer: wasm,
memory: null,
View app.js
var http = require("http"), fs = require("fs");
var index_buf = fs.readFileSync("./index.html");
http.createServer(function (req, res) {
var isClosed;
if (req.url === "/" || req.url === "/index.html") {
res.write(index_buf);
}
View x.c
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
typedef struct {
bool isRoot;
} selectedViewModel;
void log (const char *type) {
write(0, type, strlen(type));
@19h
19h / client.js
Last active Aug 29, 2015
End to end encrypted TCP-based RPC server and client.
View client.js
["crypto", "net"].forEach(function (m) { global[m] = require(m) })
var api = {
key: Buffer([
0x01, 0xB9, 0x43, 0xE4, 0x8B, 0xBD, 0x33, 0x91, 0xF1, 0xE1, 0x25, 0x32, 0xEC, 0x3B, 0xD3, 0x36,
0x5B, 0xB9, 0x5B, 0x96, 0xD9, 0xA0, 0xF5, 0x22, 0x54, 0x31, 0x99, 0xF8, 0xB5, 0xBF, 0x4E, 0xE3
]),
iv: Buffer([
0x4d, 0x4e, 0x34, 0x58, 0x37, 0x66, 0x61, 0x43, 0x4f, 0x52, 0x34, 0x50, 0x45, 0x43, 0x38, 0x4b
You can’t perform that action at this time.