Skip to content

Instantly share code, notes, and snippets.

View nektro's full-sized avatar
🌻
if you know, you know

Meghan Denny nektro

🌻
if you know, you know
View GitHub Profile
@nektro
nektro / Dockerfile
Created March 19, 2021 08:57
minimal requirements to build and install zig from scratch with docker
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /root
COPY . .
RUN apt update
RUN apt -y upgrade
RUN apt -y install apt-utils apt-transport-https ca-certificates
RUN apt -y install wget gpg
#!/usr/bin/env bash
set -e
arch=$(uname -m)
os=$(uname -s | tr '[:upper:]' '[:lower:]')
double="$arch-$os"
if [[ $1 == *"dev"* ]]; then
wget -q --show-progress https://ziglang.org/builds/zig-linux-x86_64-$1.tar.xz
@nektro
nektro / network_containers.go
Created October 7, 2020 23:23
Read the names and IDs of all the containers in a docker network
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"net"
"net/http"
)
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: node_exporter
namespace: prometheus/node_exporter
spec:
template:
metadata:
labels:
name: node_exporter
@nektro
nektro / get_github_user.sh
Created September 29, 2020 10:39
./get_github_user.sh <username>
#!/usr/bin/env bash
c1=1
c2=0
mkdir -p $1
cd $1
IFS=$'\n'
uid="$GITHUB_CLIENT"
@nektro
nektro / onion-address-gen.go
Last active June 25, 2022 20:45
Golang Vanity v3 Onion Address Generator
package main
import (
"crypto"
"crypto/ed25519"
"encoding/base32"
"encoding/base64"
"encoding/hex"
"flag"
"fmt"
@nektro
nektro / hello_world.ll
Last active August 7, 2020 05:55
LLVM 10 Hello World
@0 = global [15 x i8] c"Hello, world!\0A\00"
define i32 @1(i8* %0) {
1:
%2 = ptrtoint i8* %0 to i64
%3 = call i64 asm sideeffect "syscall", "=r,{rax},{rdi},{rsi},{rdx}"(i64 1, i64 1, i64 %2, i64 15)
ret i32 0
}
define i32 @main() {
0:

Keybase proof

I hereby claim:

  • I am nektro on github.
  • I am nektro (https://keybase.io/nektro) on keybase.
  • I have a public key ASDrf2NGIRUIhTL0Q-W-WOtb4NhTV26AcwT265RmVSmdSwo

To claim this, I am signing this object:

-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBF11bxYBEAC33e7bGs/uISbcR4vCZ0z/PsFHBKL1eL/VpzbDStHYo3N4e7kv
cHd1NptpRltSgdqsC3bAgVS37q8sQBDsQXEpWtFGC1b3v82OI8E7caTlNDZKwv2P
UAwT7R9SdoX8QJImWo7eRZDMnFMc0/HbOXNzvWYExoYcQM3awlUjTEOsaX3WwFDx
fZ0MKcx5XTXk3qSixZLt7pIyx4CaIACUM36wbvxU7CpSL0qkRyGwlWjangvN+b9o
vmPbZk3uVeZO4mvHUmimpiZYCOjrDBaIMAUm9KBtfSWZU25wbj5QKvKVkSyDvWFw
Wz5YdBkLWsORBU5G8KTZAMh/XdDuO2hXPIlbUagCmxm7WFPtglY//nCuXiUAGPxL
lBeKFlduJ6er4ICXGYtOJ0g9Ay5x6CM1Dn7a0myM2ZGXa/SlTMfbLaa9/4xfy0Ew
aLqwNQQ7vkjTyuW2AKgEsGNYUYIZ7iAaYoR+HuapQdRQ8anTNrL4g1M3ja2wEPcb

the base idea for the lang is to merge object oriented and function in a way that forces the code to preserve the direction of data in the same direction of the page

for example when you have an object method you can do object.call().call().call().call() and chain methods together calling methods on the return types of the method prior

however, when you have a static function, this flow is reverse and goes inward-out ie call(call(call(call(object))))

so what my lang does is makes it so everything is a method call. by removing methods completely. class definitions are only allowed to have the properties, and a constructor method