Skip to content

Instantly share code, notes, and snippets.

View 19h's full-sized avatar
✔️
This account is verified.

Kenan Sulayman 19h

✔️
This account is verified.
View GitHub Profile
@19h
19h / preconnecter.ts
Last active December 30, 2018 04:17
preconnect hooker for external links
// 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 December 14, 2018 00:42
PsychonautWiki Global Drug Survey Banner (SubstanceBox)
declare interface Window {
wgPageName?: string;
wgCategories?: string;
}
class Pr1ce {
protected _container?: HTMLTableSectionElement;
protected _pageName?: string;
protected _categories?: string;
protected _facts: string[];
@19h
19h / jenkins-material-theme.css
Created November 21, 2018 13:54
jenkins-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
@19h
19h / openssh.randomart.js
Created October 1, 2018 12:45
OpenSSH randomart
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 July 17, 2018 20:10
microdc2-ubuntu-patches <891113>
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 June 25, 2018 11:53
Vector Distance using WebAssembly
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,
@19h
19h / app.js
Last active August 29, 2015 14:24
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);
}
@19h
19h / x.c
Last active August 29, 2015 14:24
#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 August 29, 2015 14:23
End to end encrypted TCP-based RPC server and client.
["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
@19h
19h / u2f.js
Created June 18, 2015 15:15
U2F API for Chrome by Google Inc.
// Copyright 2014 Google Inc. All rights reserved
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
/**
* @fileoverview The U2F api.
*/