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 / asm.s
Last active October 28, 2022 17:59
32bit x86 Linux hello world exploration
.text
.intel_syntax noprefix
.file "test"
.globl _start
.type _start,@function
_start:
push ebp
push ebx
push edi
push esi
const std = @import("std");
const builtin = @import("builtin");
pub fn main() !void {
try dbg("{d}", 24);
}
fn dbg(comptime fmt: []const u8, x: anytype) !void {
comptime std.debug.assert(builtin.mode == .Debug);
const std = @import("std");
extern fn sigaltstack(ss: *const stack_t, oss: *stack_t) c_int;
const stack_t = extern struct {
sp: ?*anyopaque,
flags: c_int,
size: usize,
};
@nektro
nektro / css.css
Last active September 17, 2022 06:02
Yaml Css Preprocess
.head {
height: 32px;
font-size: 16px;
line-height: 32px
}
.head ul {
margin: 0
}
.head ul li {
list-style-type: none;
package main
import (
"bytes"
"fmt"
"golang.org/x/crypto/ssh"
)
func main() {
@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 / main.zig
Created April 26, 2022 21:36
x11 opengl demo
const std = @import("std");
const c = @cImport({
@cInclude("X11/Xlib.h");
@cInclude("X11/Xutil.h");
@cInclude("X11/keysymdef.h");
@cInclude("GL/gl.h");
@cInclude("GL/glx.h");
});
const extras = @import("extras");
pub fn amInside() !bool {
return try extras.doesFileExist(null, "/.dockerenv");
}
@nektro
nektro / Progress.zig
Last active February 24, 2022 02:16
A single line progress bar
const std = @import("std");
const string = []const u8;
const Progress = @This();
const ansi = @import("ansi");
const range = @import("range").range;
const extras = @import("extras");
total: usize,
current: usize = 0,
@nektro
nektro / createImageBitmap.js
Created November 7, 2017 01:14
Edge and Safari Polyfill for createImageBitmap
/* Safari and Edge polyfill for createImageBitmap
* https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/createImageBitmap
*/
if (!('createImageBitmap' in window)) {
window.createImageBitmap = async function(blob) {
return new Promise((resolve,reject) => {
let img = document.createElement('img');
img.addEventListener('load', function() {
resolve(this);
});