Skip to content

Instantly share code, notes, and snippets.

@mmozeiko
mmozeiko / shader.hlsl
Last active November 7, 2024 20:23
compute shader for rendering monospaced glyphs in grid
//
struct TerminalCell
{
// cell index into GlyphTexture, should be two 16-bit (x,y) values packed: "x | (y << 16)"
uint GlyphIndex;
// 0xAABBGGRR encoded colors, nonzero alpha for Foreground indicates to render colored-glyph
// which means use RGB values from GlyphTexture directly as output, not as ClearType blending weights
uint Foreground;
// own.rim.db.gundb-graphdb-api-notes.js
// JavaScript based graph-DB module developer user guide wishes
// created by Leonard Pauli, 28 aug 2019
//
/* includes:
install/access module
(add, remove, change, traverse) values
get current value
simple data structures (set)
(subscribe, unsubscribe) to changes
@Lightnet
Lightnet / gunjstrustsharekey.js
Last active January 28, 2021 09:14
gunjstrustsharekeyv3
/*
Self contain Sandbox Gun Module chain for auth sea.js:
Created by: Lightnet
License: MIT
Version: 3.0
Last Update:2019.08.17
Credit: amark ( https://github.com/amark/gun)
Status(Work in progress!):
@pseudosavant
pseudosavant / jSugar.js
Last active May 24, 2024 01:07
Utility function that adds in some jQuery-like syntactic sugar
// jQuery-like syntactic sugar. Only queries for one element. Does not loop over multiple like jQuery
export function $(query) {
if (typeof query === 'undefined') throw 'No query provided to $';
var el;
if (typeof query.nodeType === 'string') {
el = query;
} else if (typeof query === 'string' && query[0] === '<') {
const container = document.createElement('div');
container.innerHTML = query;
@jpstrikesback
jpstrikesback / Component.jsx
Last active April 20, 2019 03:15
RAD AsyncStorage Adapter
import * as React from 'react';
import {
View,
Text,
} from 'react-native';
import Gun from 'gun/gun';
import 'gun/lib/open';
import '../extensions/sea';
@d3x0r
d3x0r / gun_dev_null.js
Created April 18, 2018 23:47
A no-op storage driver for gun, in case gun has no other storage; at least one ack from a storage device is required for the engine to work....
Gun.on('opt', function(ctx){
const ACK_ = '@';
const SEQ_ = '#';
var gun = ctx.gun;
this.to.next(ctx);
ctx.on('put', function(at) {
this.to.next(at);
ctx.on('in', {[ACK_]: at[SEQ_], gun:gun, ok: 1});
@zrrrzzt
zrrrzzt / gun.restrict.put.server.js
Last active November 24, 2022 16:41
Example code for restricting put on GUN
/* You'll need this on your client
Gun.on('opt', function (ctx) {
if (ctx.once) {
return
}
ctx.on('out', function (msg) {
var to = this.to
// Adds headers for put
msg.headers = {
token: 'thisIsTheTokenForReals'
@alinz
alinz / gundb-stresstest.js
Created December 5, 2017 17:03
Gundb Stress Test
const stream = require('stream')
const Gun = require('gun')
const randomString = length => {
const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
let text = ''
for (var i = 0; i < length; i++) {
text += possible[Math.floor(Math.random() * possible.length)]
}
return text
@justinribeiro
justinribeiro / instructions.md
Last active October 8, 2018 01:57
The Web Platform Podcast: Pipelines for publishing

Justin's Guide to faster episodes

The follwing is my working document as I create a pipeline for faster YouTube > LibSyn / iTunes distribution. This is not complete, but really cuts down on some time.

Prerequisites

I'm a commandline guy, I like UNIX tooling philosophy. Hence, my prereqs.

  1. youtube-dl
  2. ffmpeg
  3. mutagen
@JosePedroDias
JosePedroDias / rndBase32.js
Created March 9, 2015 10:50
random base32 string of length len. works well up to 6 characters. chars are in the range [0-9][a-t]
function rndBase32(len) {
return ( ~~(Math.random() * Math.pow(32, len)) ).toString(32);
}