Skip to content

Instantly share code, notes, and snippets.

View xmonader's full-sized avatar
🏠
Working from home

xmonader xmonader

🏠
Working from home
View GitHub Profile
@xmonader
xmonader / table.sh
Created December 22, 2021 18:21 — forked from m-motawea/table.sh
make table in bash
#!/bin/bash
# the script to make tables like this
# +----------+--------+--------------------+
# |col1 |col2 |col3 |
# +----------+--------+--------------------+
# |val1 |val3 |val4 |
# +----------+--------+--------------------+
# |valqeefnkl|val3wekj|val4 |
# |1 |bkjwvsaj| |
@xmonader
xmonader / urlshort.nim
Last active December 19, 2023 12:08
urlshort.nim
# nimshorturl
# Copyright xmonader
# nim url shortening service
import jester, asyncdispatch, htmlgen, json, os, strutils, strformat, db_sqlite
# hostname can be something configurable "http://ni.m:5000"
let hostname = "localhost:5000"
var theDb : DbConn
if not fileExists("/tmp/mytest.db"):
theDb = open("/tmp/mytest.db", "", "", "")
theDb.exec(sql("""create table urls (
@xmonader
xmonader / 3.11.testnet.md
Created August 15, 2023 09:13
3.11 testnet

3.11 on Testnet

The long waited release is now already available on testnet, we are looking forward for your feedback

GPU

The main theme of 3.11 is the GPU support, It's now available across the dashboard, playground, grid statistics and the explorer.

Note: we came up with a late decision to remove the GPU data from the chain itself, and indexing it in the gridproxy

Tooling

➜ /tmp cat horribleppl.json| grep twinID | uniq
"twinID": 57
"twinID": 89
"twinID": 281
"twinID": 255
"twinID": 57
"twinID": 255
"twinID": 83
"twinID": 47
"twinID": 1127
@xmonader
xmonader / out.txt
Created December 29, 2022 14:46
out.txt
➜ terraform-provider-grid git:(development) ✗ go test -v ./pkg/...
=== RUN TestCreate
--- FAIL: TestCreate (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x630636]
goroutine 19 [running]:
@xmonader
xmonader / uuid.py
Created December 17, 2022 07:32
uuid.py
import os
import struct
def generate_uuid():
"""Generate a random UUID."""
with open("/dev/urandom", "rb") as f:
data = f.read(16)
return struct.unpack("<LHHBBLBBBBB", data)
def uuid_to_string(uuid):
@xmonader
xmonader / uuid.pas
Created December 17, 2022 07:30
uuid.pas
{$mode objfpc}{$H+}
unit UUID;
interface
uses
Classes, SysUtils, Math;
type
@xmonader
xmonader / type-systems.txt
Created November 22, 2021 23:08 — forked from dicej/type-systems.txt
Type system learning notes
Classes
* Keith Devlin - Introduction to Mathematical Thinking - https://www.coursera.org/learn/mathematical-thinking
* Michael Genesereth - Introduction to Logic - https://www.coursera.org/learn/logic-introduction
* Robert Harper - Homotopy Type Theory - http://www.cs.cmu.edu/~rwh/courses/hott/
Books and Articles
* Benjamin C. Pierce - Types and Programming Languages - https://www.cis.upenn.edu/~bcpierce/tapl/
* x775 - Introduction to Datalog - https://x775.net/2019/03/18/Introduction-to-Datalog.html
* Bartosz Milewski - Category Theory For Programmers - https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/
* Benjamin C. Pierce et al. - Software Foundations - https://softwarefoundations.cis.upenn.edu/
import x.json2
struct First {
mut:
a int
}
struct Second {
mut:
ok bool
import os, httpclient
import threadpool, strutils
import times
import asyncdispatch
type
# LinkCheckResult = [link: string, state:bool]
LinkCheckResult = ref object
link: string
state: bool