Skip to content

Instantly share code, notes, and snippets.

@zilveer
zilveer / jobserver.lua
Created February 4, 2020 11:20 — forked from rybakit/jobserver.lua
tarantool/queue config example
queue = require('queue')
local function start(config)
box.once('jobserver:v0.1.0', function()
local tube = queue.create_tube('default', 'fifottl', {if_not_exists = true})
end)
end
local function stop()
end
var bitHex = 8;
//idea is that when a pub key gets created, the user stores this int32 in its profile.
//then when you go to fetch the list of pubkeys, hash the key and also fetch the int32 from the profile
//compair the alias + int32 and show the user profile(s) to the requesting user for decision
//when user has decided save the pubkey and any other meta data you wish
var sha256_toint_test = "something like a publickey that has a reference of the output int32";
@zilveer
zilveer / IslandECN_Source_Code
Last active January 20, 2020 14:40
Island ECN 10th Birthday Source Code Release!
SET TALK OFF
SET CURSOR OFF
SET SAFETY OFF
SET MEMOWIDTH TO 80
CLEAR ALL
CLOSE ALL
CLEAR
CLEAR MACRO && Get rid of F keys typing commands
SET HELP OFF && Needed to clear out F1 key too
@zilveer
zilveer / engine.c
Created January 19, 2020 06:29 — forked from druska/engine.c
Quant Cup 1's winning order book implementation
/*****************************************************************************
* QuantCup 1: Price-Time Matching Engine
*
* Submitted by: voyager
*
* Design Overview:
* In this implementation, the limit order book is represented using
* a flat linear array (pricePoints), indexed by the numeric price value.
* Each entry in this array corresponds to a specific price point and holds
* an instance of struct pricePoint. This data structure maintains a list
@zilveer
zilveer / gunjstrustsharekeyv2.js
Created January 17, 2020 02:13 — forked from Lightnet/gunjstrustsharekeyv2.js
add share key graph node for gunjs for more options
/*
Self contain Sandbox Gun Module:
Created by: Lightnet
Credit: amark ( https://github.com/amark/gun)
License: MIT
//===============================================
// CLEAR GUN DATABASE
localStorage.clear();
//(function() {
//===============================================
// INIT GUN DATABASE
let gunurl = window.location.origin+'/gun';
//console.log(gunurl);
var gun = Gun(gunurl);
gun.on('hi', peer => {//peer connect
@zilveer
zilveer / Testing-scroll-jQuery.markdown
Created January 14, 2020 09:49
A Pen by Moncho Varela.
var crypto = require('crypto');
var bitcoin = require('bitcoinjs-lib')
var bitcoinMessage = require('bitcoinjs-message')
function doVerify() {
var wif;
@zilveer
zilveer / gunAuth.class.js
Created December 16, 2019 00:15
GunDB Auth Class in Javascript
import { createBrowserHistory } from 'history';
const Gun = require('gun');
const SEA = require('gun/sea');
const history = createBrowserHistory({forceRefresh:true});
var gun = Gun();
var user = gun.user()
class Auth {
constructor() {
@zilveer
zilveer / validator
Created December 16, 2019 00:05 — forked from jabis/validator
validator.js
var validator = module.exports = {
isDecimal : function(input) { return (/^(?=.)\d*(\.\d{1,9})?$/.test(input)); },
isNull : function(input) { return ((input == null) || (typeof input === "string" && input.replace(/\s/g, "") == "") || (typeof input === "undefined") || (input.length == 0)); },
isAlpha : function(input) { return (/^[a-zA-Z]+$/.test(input) && !validator.isNull(input)); },
isAlphanumeric : function(input) { return !(/\WöäåÖÄÅ/.test(input)); },
isNumeric : function(input) { return (/^-?(?:0$0(?=\d*\.)|[1-9]|0)\d*(\.\d+)?$/.test(input)); },
isEmail : function(input) { return (!validator.isNull() || (/^(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]\.?){0,63}[a-z0-9!#$%&'*+\/=?^_`{|}~-]@(?:(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)*[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\])$/i).test(input)); }
};