Skip to content

Instantly share code, notes, and snippets.

View zicklag's full-sized avatar
🛰️
Making awesome stuff!

Zicklag zicklag

🛰️
Making awesome stuff!
View GitHub Profile
Entity [
MyComponent,
Scale { x: 2.0, y: 2.0, z: 2.0 },
PropDemo {
value: "hello",
sequence: [0,1,2],
map: {field: 1.0, hello: "hi"},
nested: {field: [{test: 1.0}]}
},
// Children entities are nested

Modeling timeseries data in Dgraph with timestamp on value object

Problem is, you will likely want to query by TimeStamp and need to index the TimeStamp in your schema. However when sending tons of mutations adding new values with high frequency the index keeps rebuilding and all attempts querying the timeseries data will either timeout or fail saying something like “try again later”. Recording a few values per minute should work fine, but for anything more aggressive run more tests before building a whole product relying on it. This approach puts timestamps on the node. An alternative approach is to put the timestamps on a facet, see below.

Schema

Name: string @index(fulltext, term, trigram) .
Value: uid @reverse .
@johnchandlerburnham
johnchandlerburnham / ATaxonomyOfSelfTypes.md
Last active August 15, 2024 12:26
A Taxonomy of Self Types

A Taxonomy of Self-Types

Part I: Introduction to Self-Types

Datatypes in the Formality programming language are built out of an unusual structure: the self-type. Roughly speaking, a self-type is a type that can depend or be a proposition on it's own value. For instance, the consider the 2 constructor datatype Bool:

@zicklag
zicklag / .gitignore
Created February 28, 2020 20:48
These are the coolest two lines that should be in *every* .gitignore file
# Ignore everything that has "gitignore" in the name, except for the .gitignore file
*gitignore*
!.gitignore
# This makes it super easy to backup source files and other resources that you happen to want in your repo
# dir at the moment, but that you don't want to end up accidentally commiting.
@DallasC
DallasC / linfa-eco.md
Created December 11, 2019 03:23
Rust AI Algorithm Ecosystem

Interesting general purpose crates to consider

peroxide

Rust comprehensive scientific computation library contains linear algebra, numerical analysis, statistics and machine learning tools with farmiliar syntax

Bindings

faiss

Rust language bindings for Faiss, the state-of-the-art vector search and clustering library.

liblinear

Rust bindings for the liblinear C/C++ library. Provides a thin (but rustic) wrapper around the original C-interface exposed by the library.

@zicklag
zicklag / Creating a Proxy Proxy for Skipping Proxy Authentication Prompts.md
Last active January 13, 2021 08:12
How to setup a proxy for skipping proxy authentication prompts.

Creating a Proxy Proxy for Skipping Proxy Authentication Prompts

Update

I found an easier way to do this with a Go program that doesn't require writing a script and installing node. Check out this comment.

Original Solution

Some programs support a proxy, but they don't support authentication without prompting. This is the case with Chrome and VSCode. This caused me problems particularly when trying to automate Chrome with Selenium. The workaround is to run a local proxy, set your http_proxy environment variables to the local proxy, and tell the local proxy to, in turn, proxy requests to your real proxy and to include your username and password.

@HadrienG2
HadrienG2 / High_Performance_Rust.md
Last active February 26, 2025 15:36
Making Rust a perfect fit for high-performance computations

Hello, Rust community!

My name is Hadrien and I am a software performance engineer in a particle physics lab. My daily job is to figure out ways to make scientific software use hardware more efficiently without sacrificing its correctness, primarily by adapting old-ish codebases to the changes that occured in the software and computing landscape since the days where they were designed:

  • CPU clock rates and instruction-level parallelism stopped going up, so optimizing code is now more important.
  • Multi-core CPUs went from an exotic niche to a cheap commodity, so parallelism is not optional anymore.
  • Core counts grow faster than RAM prices go down, so multi-processing is not enough anymore.
  • SIMD vectors become wider and wider, so vectorization is not a gimmick anymore.
@HoldOffHunger
HoldOffHunger / bradvin.social.share.urls.txt
Last active April 16, 2025 06:44
Social Share URL's (Summary)
https://www.facebook.com/sharer.php?u={url}
https://www.facebook.com/dialog/share?app_id={app_id}&display={page_type}&href={url}&redirect_uri={redirect_url}
https://reddit.com/submit?url={url}&title={title}
https://twitter.com/intent/tweet?url={url}&text={title}&via={user_id}&hashtags={hash_tags}
https://www.linkedin.com/sharing/share-offsite/?url={url}
https://api.whatsapp.com/send?phone={phone_number}&text={title}%20{url}
https://www.tumblr.com/widgets/share/tool?canonicalUrl={url}&title={title}&caption={text}&tags={hash_tags}
http://pinterest.com/pin/create/button/?url={url}
https://www.blogger.com/blog-this.g?u={url}&n={title}&t={text}
https://www.evernote.com/clip.action?url={url}&title={title}
@wanglf
wanglf / vscode-extension-offline.md
Last active April 19, 2025 06:56
Download VS Code extensions as VSIX

How to use?

  • Copy content of vsix-bookmarklet, create a bookmark in your browser.
  • Navigate to the web page of the VS Code extension you want to install.
  • Click the bookmark you just created, then click the download button.
    download
  • After download finished, rename the file extension to *.vsix.
  • In VS Code, select Install from VSIX... in the extension context menu.
    vsc
@paulera
paulera / exploding-cards.md
Last active September 13, 2024 04:06
Exploding cards: Explodding Kittens variant, with regular playing cards

Exploding cards

This is a variant of the Exploding Kittens game rules, using regular playing cards

  • 1 deck: 3 to 8 players
  • 2 decks: up to 16 players

Objective

The last survivor wins the game. If you draw a Bomb card and don't have a Disarm card, you die.

Preparing the game