Skip to content

Instantly share code, notes, and snippets.

///////////CryptoCloud settings all these keys are fake use your own
@authToken = eyJraWQiOiJJYk5MeVVvd3Fzbms0MUdLWUJ5SDlyNjRjWXYwYmp6U05CTmdHR3BrVGtJPSIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiJkMDYyODQwZS02YjdiLTRjZjctYjcwNC1jMTRjNzg2MWUyODkiLCJhdWQiOiIzaGRranA5MzU0M2ZsY2poZGxxaTFtZnNudSIsImNvZ25pdG86Z3JvdXBzIjpbIkNDQWZ0ZXJTZWxmU2lnbnVwIiwiU1dSb2xlQXV0aEpzcCIsIlNXUm9sZUFkbWluIiwiQ0NQZXJtaXRTdGFnZS1oYWRlYnVnIl0sImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJldmVudF9pZCI6IjZmYjhjZDc2LWEzOGQtNGUzNS1iODdlLWM1MmNlMTdkYWZlZSIsInRva2VuX3VzZSI6ImlkIiwiYXV0aF90aW1lIjoxNTgzODEyNDkwLCJpc3MiOiJodHRwczpcL1wvY29nbml0by1pZHAudXMtZWFzdC0xLmFtYXpvbmF3cy5jb21cL3VzLWVhc3QtMV9nQTkzS1VNdkkiLCJjb2duaXRvOnVzZXJuYW1lIjoiZDA2Mjg0MGUtNmI3Yi00Y2Y3LWI3MDQtYzE0Yzc4NjFlMjg5IiwiZXhwIjoxNTg0NTEyMjU5LCJpYXQiOjE1ODQ1MDg2NTksImVtYWlsIjoia2V2aW4ubWNkb25hbGRAY3J5cHRvd2Vyay5jb20ifQ.bpoK8-GVmH3nTZXMre7WIzvNOC509MmctP8OUUsU8XjKiG3bKgMR5r91CVNB-OsQghjEA3C6IZ943-3r5CnJ6RpyG4l86deaSktI__4v-b_LmN9RE33f71O0EMJjqOqjENEqdGis9C0-bEi0TyzQuzrLNaGWzURupsf6jzctBzcfMqhIqMyJkphHM6VfIHi
@i001962
i001962 / gql_search_stargazers.gql
Created April 28, 2020 01:47 — forked from katopz/gql_search_stargazers.gql
GraphQL Github Example : Search for top ten stargazers
// Try at : https://graphql-explorer.githubapp.com/
{
search(query: "language:JavaScript stars:>10000", type: REPOSITORY, first: 10) {
repositoryCount
edges {
node {
... on Repository {
name
descriptionHTML
stargazers {
@i001962
i001962 / HDR Unofficial port to JS (Hubbard Decision Random Number Generator)
Last active December 27, 2020 21:41
generate n random numbers from the same seed
// I haven't die hardered any of this. HDR passed. I wrote the js code based on what I found in Excel formula. CAUTION
// seed = 6345484 // change when you want a new starting point for a stream of random numbers
// PM_Index = 0 // where on stream do you want to grab random number from? Increment to n for n seeded random numbers
function HDRando(seed, PM_Index) {
const largePrime = 2147483647;
const million = 1000000;
const tenMillion = 10000000;
// Do we need this in js? is there a modulo?
function MOD(n, m) {
# to use call hdrando(6345484, 12000) First parameter is the seed and second is the number of trials, returns uniform random
def MOD (n, m):
remain = n % m;
if remain >= 0:
return remain
else:
# instead = remain +m:
return remain + m
# adapted from Js so still using custom MOD funct and not using return Math.floor(remain >= 0 ? remain : remain + m);
@i001962
i001962 / norminv.js
Created December 18, 2020 04:39 — forked from kmpm/norminv.js
Compute the quantile function for the normal distribution. - like Excel NORMINV
/// Original C++ implementation found at http://www.wilmott.com/messageview.cfm?catid=10&threadid=38771
/// C# implementation found at http://weblogs.asp.net/esanchez/archive/2010/07/29/a-quick-and-dirty-implementation-of-excel-norminv-function-in-c.aspx
/*
* Compute the quantile function for the normal distribution.
*
* For small to moderate probabilities, algorithm referenced
* below is used to obtain an initial approximation which is
* polished with a final Newton step.
*
* For very large arguments, an algorithm of Wichura is used.
// Metalog formula Generator!
//
// Created by Daniel ONeil
//
// Version 3.5.2
var hdrToggle = false;
$(document).ready(() => {
generateOutput();
$("#advancedHdr").hide();
@i001962
i001962 / gist:f9c1d0f43c7dfd11d301c9a2d8c3fbab
Last active October 7, 2022 07:55
gundb - public data that only a keypair holder may change
//document.write("<script src='https://cdn.jsdelivr.net/npm/gun/gun.js'></script>")
//document.write("<script src='https://cdn.jsdelivr.net/npm/gun/sea.js'></script>")
//var gun = Gun();
// write some gun data that is publicly accessible yet immutable to public
(async ()=>{
// Work in 'your' user nameSpace. This is just a test keypair to make it easy to try in dev console
var oldPair = {pub: "ec6y-kMl2HbmIfx3JQEGwqpZlrp7gjUaXqz5ZTVyHho.2FaHKv8rHwJPnsB1P8tHpdQACfLHElr-Fy3lZX41sRI", epub: "QKmF9qP18GsvRDy6LF2t5cdAYsJDkrfPbIKuNo-MJGQ.OBhlOXlq5DGEVo3gnvejMdK_Evg_7cgBuVtng5uf490", priv: "wvvrjoelk2sejdy22nKfieTlVB1UWl4R9d9gMqs1oFE", epriv: "lkE71r1VVCHSSKMlBu54QQ4U120h5SX-2YG1UMo_3iQ"}
user = gun.user();
// user.create(alias, pass, cb, opt) //<- should use soemthing like this instead
@i001962
i001962 / gist:2a139e1a7c9891398f100a80615d788e
Created June 28, 2021 15:21
GunDB - Immutable links to mutable user content
// This allows for a user to write what everthey want into a space that anybody can read but only the user may update.
// From Chrome dev console paste this snippet in only if gun and sea are not already included when at console.
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://cdn.jsdelivr.net/npm/gun/gun.js';
document.head.appendChild(script);
var scriptSea = document.createElement('script');
scriptSea.type = 'text/javascript';
scriptSea.src = 'https://cdn.jsdelivr.net/npm/gun/sea.js';
document.head.appendChild(scriptSea);
@i001962
i001962 / gist:2f90fe005f10c9a26f795c6ab08208c9
Last active June 28, 2021 16:36
github Graphql API - search for top 100 gundb repos
// https://docs.github.com/en/graphql/overview/explorer
{
search(query: "gundb in:readme", type: REPOSITORY, first: 100) {
repositoryCount
edges {
node {
... on Repository {
name
descriptionHTML
stargazers {
pub struct Canvas {
pub
let width: UInt8
pub
let height: UInt8
pub
let pixels: String
init(width: UInt8, height: UInt8, pixels: String) {
self.width = width