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 / 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.
*/
@19h
19h / uf2.js
Created June 18, 2015 15:14
UF2 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.
*/
@19h
19h / resize.js
Last active December 4, 2017 10:59
Streamed image resize using lwip (@wtr7)
// modules
var lwip = require('lwip'),
path = require('path'),
fs = require('fs'),
rstream = require('stream').Readable;
// config
var placesPath = '/Users/apx/Downloads/places';
// helper
@19h
19h / harvester.coffee
Created March 20, 2015 01:23
Example Log.io custom harvester using the Server TCP API
net = require 'net'
class Harvester
constructor: (@host = '127.0.0.1', @port = 28777, {@name, @streams}) ->
@queue = []
# deregister existing node
@queue.push "-node|#{@name}\r\n"
# register and setup streams
@19h
19h / keybase.md
Created July 5, 2014 14:50
keybase.md

Keybase proof

I hereby claim:

  • I am kenansulayman on github.
  • I am apx (https://keybase.io/apx) on keybase.
  • I have a public key whose fingerprint is 74BD 49D0 DABB 7AB9 C1CE 8A67 9337 CFF2 ED85 FF40

To claim this, I am signing this object: