Skip to content

Instantly share code, notes, and snippets.


Karim Naufal mysticaltech

View GitHub Profile
ifeulner /
Last active December 15, 2022 02:05
Longhorn hcloud best practices

Longhorn best practices

The following settings are provided as an example how longhorn should be configured in a production cluster, especially if it is deployed on Hetzner Cloud infrastructure.

Hetzner server nodes provide local storage and allow up to five attached volumes (with a size of up to 10TiB each) Local storage is provided by NVMe storage and therefore is much faster than the attached volumes, but limited in size (max 300GiB usable).

Initial configuration

Also you want to control the nodes that are used for storage. So it is suggested to set the option Create default disk only on labeled node to true

koakh / gist:fbbc37cde630bedcf57acfd4d6a6956b
Last active February 5, 2023 05:15
SurrealDB : How to use signin and signup (server + client nodesjs)
View gist:fbbc37cde630bedcf57acfd4d6a6956b
**As a developer you have complete control over the signup and signin functionality...**
$ surreal sql --conn http://localhost:8000 --user root --pass root --ns test --db test
-- optional : this is the default see --ns test --db test start server flags
-- USE NS test DB test;
marshki /
Last active December 3, 2021 20:35
One-way Rsync mirror of data from source to destination. Run as a crontab.
#!/usr/bin/env bash
# mirror_mirror
# One-way Rsync mirror of data from source to destination.
# Author: M. Krinitz <mjk235 [at] nyu [dot] edu>
# Date: 2020.04.20
# License: MIT
silversillu / rage-clicks.js
Created September 18, 2019 07:36
Tracking Rage Clicks using GTM
View rage-clicks.js
if ( typeof(jQuery) === 'function' ) {
jQuery(document).ready(function($) {
getPath: function() {
var path, node = this;
while (node.length) {
var realNode = node[0],
name = realNode.localName;
if (!name) break;
name = name.toLowerCase();
View g_series_9.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Lauszus /
Last active May 3, 2022 15:43
Generic CRC-8, CRC-16 and CRC-32 calculations in Python
#!/usr/bin/env python
# Inspired by:
# The CRC values are verified using:
def reflect_data(x, width):
# See:
if width == 8:
x = ((x & 0x55) << 1) | ((x & 0xAA) >> 1)
x = ((x & 0x33) << 2) | ((x & 0xCC) >> 2)
x = ((x & 0x0F) << 4) | ((x & 0xF0) >> 4)
uttara-cmu / sample_size_AB.R
Last active April 3, 2020 08:22
Evan Miller's Tool - R code
View sample_size_AB.R
# The code given in #2 gist is not in R. There is a change in formula compared to the one in this blog post and the one used by Evan Miller's tool (#3).
p = 0.03
pct_mde = 0.1
alpha = 0.05
power = 1- 0.2
Rich-Harris /
Last active February 6, 2023 06:05
The truth about Svelte

I've been deceiving you all. I had you believe that Svelte was a UI framework — unlike React and Vue etc, because it shifts work out of the client and into the compiler, but a framework nonetheless.

But that's not exactly accurate. In my defense, I didn't realise it myself until very recently. But with Svelte 3 around the corner, it's time to come clean about what Svelte really is.

Svelte is a language.

Specifically, Svelte is an attempt to answer a question that many people have asked, and a few have answered: what would it look like if we had a language for describing reactive user interfaces?

A few projects that have answered this question:

View config.json
"type": "webpack",
"entryPoint": 1,
"knownPaths": {},
"moduleAst": ["body", 0, "expression", "argument", "arguments", 0]
Cryptophobia /
Last active April 23, 2020 17:16
Helm Init GKE RBAC Hephy Workflow

Running Hephy Workflow on GKE Kubernetes Cluster Fix:

There is a fix for Helm that we need to do if we are using Helm 2.x in order to give helm enough permissions to create releases.

Hopefully this will be fixed in Helm 3.x as promised.

This is a known issue and was first found here: helm/helm#3055

Before we deploy Hephy Workflow, we need to enable our user to be able to create RBAC roles since Hephy Workflow needs to configure its own clusterroles through Helm:

Prerequisites for using Helm on GKE Role-Based Access Control: