Skip to content

Instantly share code, notes, and snippets.

@zilveer
zilveer / router.html
Created January 15, 2023 12:12 — forked from joakimbeng/router.html
A really simple Javascript router
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Building a router</title>
<script>
// Put John's template engine code here...
(function () {
// A hash to store our routes:

Usecase - Integrating Anoncoin to Coinomi

A simple usecase of a Bitcoin compatible coin integration. Not all coins are created equal, so it is possible that extra work must be done to successfully integrate a new cryptocurrency.

  1. Start the Anoncoin daemon and in the anoncoin.conf file add the option "txindex=1"
rpcuser=anoncoinrpc
rpcpassword=MFfySYp9o9qQi0mYbQmxOdE1pEHVS1DQuhhHssOzkO3
rpcport=8022
function getList(idxSoul,cb){
let listOfSouls = {}
let soulsToCheckAgainstUnique = []
gun.get(idxSoul).once(function(data){
if(data === undefined){cb.call(cb,listOfSouls); return}//for loop would error if not stopped
for (const soul in data) {
if(soul === '_')continue
if(data[soul] !== null){//not Deleted
//this means `false` will pass through, so archived items will still keep increment and unique values enforced
soulsToCheckAgainstUnique.push(soul)
@zilveer
zilveer / bootstrap.toggleModal.js
Created June 6, 2022 13:18 — forked from todofixthis/bootstrap.toggleModal.js
Shows/Hides a Bootstrap 3 modal and returns a Promise object.
/** Shows or hides a Bootstrap 3 modal and returns a Promise object.
*
* Bootstrap's modal functions return before the modal is shown/
* hidden, which can cause glitches if subsequent code doesn't
* expect that.
*
* Unfortunately, there is no built-in way to defer an
* operation until after the modal is shown/hidden, so
* this function does a little monkey-patching to make
* it work.
@zilveer
zilveer / swipe.js
Created June 3, 2022 16:36 — forked from SleepWalker/swipe.js
A simple swipe detection on vanilla js
var touchstartX = 0;
var touchstartY = 0;
var touchendX = 0;
var touchendY = 0;
var gesuredZone = document.getElementById('gesuredZone');
gesuredZone.addEventListener('touchstart', function(event) {
touchstartX = event.screenX;
touchstartY = event.screenY;
@zilveer
zilveer / README.md
Created April 12, 2022 12:12 — forked from kevinbull/README.md
Using JavaScript generate a 32 character hexadecimal universal id string.

generateUnid

Each call returns a random 32 character hexidecimal string. Based on the work done https://gist.github.com/jed/982883

Usage:

<script src="https://gist.github.com/kevinbull/f1cbc5440aa713bd5c9e.js"></script>

var unid = generateUnid();
@zilveer
zilveer / README.txt
Created January 6, 2021 00:30 — forked from straydogstudio/README.txt
A jQuery fixed header table implementation. Designed to work with Bootstrap, but should work generally.
Here is a simple jQuery plugin to make a table header fixed on top of a div when this is scrolled.
Using the code from twitter bootstrap documentation page, this code is customized for table header.
Create the table with the table-fixed-header class and a thead tag:
<table class="table table-striped table-fixed-header" id="mytable">
<thead class="header">
<tr>
<th>Email Address</th>
<th>First Name</th>
<th>Last Name</th>
@zilveer
zilveer / GunShareExample
Created November 18, 2020 23:26 — forked from pszabop/GunShareExample
Example of using Gun to share a secret with another user. Includes unit tests.
// alas this generates the warning `user.pair() IS DEPRECATED AND WILL BE DELETED!!!`
//
// put a value shared between two users
// user and this user (classic public key encryption, except that a session
// key is used instead of encrypting the data with the public key.
// analagous to `openssl pkeyutl -derive -inkey key.pem -peerkey pubkey.pem -out secret`
//
// @param: key - the key where the value is stored
// @param: value - the value to store at index key
// @param: otherUser - the info or public key of the other user to share the value with
@zilveer
zilveer / IPTV-big-list.m3u
Created April 12, 2020 16:32 — forked from skypce/IPTV-big-list.m3u
IPTV big list.m3u
#EXTM3U
#EXTINF:-1,TELEMUNDO
http://iphone-streaming.ustream.tv/ustreamVideo/21733416/streams/live/playlist.m3u8
#EXTINF:0,TELEMUNDO
http://iphone-streaming.ustream.tv/ustreamVideo/21733416/streams/live/playlist.m3u8
#EXTINF:-1,UNIVISION
http://iphone-streaming.ustream.tv/ustreamVideo/21680354/streams/live/playlist.m3u8
#EXTINF:0,UNIVISION 1
@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