Skip to content

Instantly share code, notes, and snippets.

View dmonay's full-sized avatar
Accomplished sheep. Aspiring shepherd.

Dmitry Pavluk dmonay

Accomplished sheep. Aspiring shepherd.
View GitHub Profile
@miguelmota
miguelmota / 64bit_buffer.js
Created November 30, 2022 21:42
Node.js 64-bit buffer example
const buf = Buffer.alloc(8)
const view = new DataView(buf.buffer)
view.setBigInt64(0, BigInt(100), false) // true when little endian
console.log(buf.toString('hex')) // "0000000000000064"
@metasikander
metasikander / NIP-05_Simple_Guide.md
Last active March 16, 2025 03:50
A small minimal guide on setting up NIP-05 identifier on branle/nostr

This is a very basic guide, just to understand what's needed to set it up.
If you have any questions you can find me at https://nostr.com/8355095016fddbe31fcf1453b26f613553e9758cf2263e190eac8fd96a3d3de9

Prerequisite

Setup static file on server

Create a file that resolves to <domain>/.well-known/nostr.json, and fill it out like this (enter the name you want to use, and input your own public key, make sure its the HEX-key):

{
@onlurking
onlurking / programming-as-theory-building.md
Last active October 13, 2025 17:26
Programming as Theory Building - Peter Naur

Programming as Theory Building

Peter Naur

Peter Naur's classic 1985 essay "Programming as Theory Building" argues that a program is not its source code. A program is a shared mental construct (he uses the word theory) that lives in the minds of the people who work on it. If you lose the people, you lose the program. The code is merely a written representation of the program, and it's lossy, so you can't reconstruct

@radlinskii
radlinskii / pre-commit.sh
Last active February 19, 2025 07:47
pre-commit git hook file for Golang. Be sure to save this file in your repository as `.git/hooks/pre-commit` and give it right to execute e.g. with command `chmod +x .git/hooks/pre-commit`
#!/bin/sh
STAGED_GO_FILES=$(git diff --cached --name-only | grep ".go$")
if [[ "$STAGED_GO_FILES" = "" ]]; then
exit 0
fi
GOLINT=$GOPATH/bin/golint
GOIMPORTS=$GOPATH/bin/goimports
@dvejmz
dvejmz / mandelbrot.go
Created April 29, 2017 21:38
Mandelbrot fractal implementation in Go as described in The Go Programming Language, Kernighan et al.
package main
import (
"image"
"image/color"
"image/png"
"math"
"math/cmplx"
"os"
)
@bradens
bradens / slack-dark-theme.css
Last active February 1, 2019 07:56
Dark theme for slack
#msgs_scroller_div::-webkit-scrollbar-track, #client_body::before, .client_container,
#search_terms, #client_body, #footer, ts-message, .channel_header, ts-jumper ts-jumper-container,
ts-jumper input[type="text"] {
background: #282c34 !important;
}
#client_body::before {
border-bottom: 1px solid #1a2129 !important;
}
@mariozig
mariozig / migrate_repo.sh
Last active September 16, 2024 18:48
Migrate repo from GitLab to GitHub Full blog post @ http://ruby.zigzo.com/2015/03/23/moving-from-gitlab-to-github/
# Assume we are in your home directory
cd ~/
# Clone the repo from GitLab using the `--mirror` option
$ git clone --mirror git@your-gitlab-site.com:mario/my-repo.git
# Change into newly created repo directory
$ cd ~/my-repo.git
# Push to GitHub using the `--mirror` option. The `--no-verify` option skips any hooks.
@janogarcia
janogarcia / email_coding_guidelines.md
Last active November 26, 2024 15:35
Email Coding Guidelines
@dmitshur
dmitshur / gist:6927554
Last active December 29, 2024 12:06
[Legacy GOPATH mode] How to `go get` private repos using SSH key auth instead of password auth.
@kavu
kavu / example.go
Created September 28, 2013 10:01
Minimal Golang + Cocoa application using CGO. Build with `CC=clang go build`
package main
/*
#cgo CFLAGS: -x objective-c
#cgo LDFLAGS: -framework Cocoa
#import <Cocoa/Cocoa.h>
int
StartApp(void) {
[NSAutoreleasePool new];