Skip to content

Instantly share code, notes, and snippets.

View mihaitodor's full-sized avatar
:shipit:
Shipit!

Mihai Todor mihaitodor

:shipit:
Shipit!
View GitHub Profile
@17twenty
17twenty / crazyOlSelectCase.go
Last active April 27, 2025 23:34
Using reflect.SelectCase - an example
package main
import (
"log"
"reflect"
"time"
)
func main() {
c1 := make(chan int)
.global _start
_start:
LDR R0,=matrix0
LDR R1,=matrix1
LDR R2,=matrix2
LDR R3,=matrix3
@ Load Q0-Q3 with the data
.global main
.func main
main:
LDR R0, =random_seed
LDR R0, [R0]
MOV R1, #num_elements
BL _rng_loop
LDR R0, =unordered_msg
BL printf
@dvdbng
dvdbng / vim-heroku.sh
Last active October 16, 2024 17:15
Run vim in heroku updated 2017
mkdir ~/vim
cd ~/vim
# Staically linked vim version compiled from https://github.com/ericpruitt/static-vim
# Compiled on Jul 20 2017
curl 'https://s3.amazonaws.com/bengoa/vim-static.tar.gz' | tar -xz
export VIMRUNTIME="$HOME/vim/runtime"
export PATH="$HOME/vim:$PATH"
cd -
def find_ngrams(input_list, max_n):
return [map(lambda x: list(x), zip(*[input_list[i:] for i in range(n)])) for n in range(1, max_n+1)]
@joyrexus
joyrexus / README.md
Last active June 12, 2025 20:55
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@rharkanson
rharkanson / RandomBigInteger.cs
Created March 1, 2017 01:35
RandomBigInteger - An extension to the C# Random class for generating random BigIntegers
using System;
using System.Numerics;
namespace System.Numerics
{
class RandomBigInteger : Random
{
public RandomBigInteger() : base()
{
}
@GLMeece
GLMeece / latency_numbers.md
Last active February 22, 2025 10:46
Latency Numbers Every Programmer Should Know - MarkDown Fork

Latency Comparison Numbers

Note: "Forked" from Latency Numbers Every Programmer Should Know

Event Nanoseconds Microseconds Milliseconds Comparison
L1 cache reference 0.5 - - -
Branch mispredict 5.0 - - -
L2 cache reference 7.0 - - 14x L1 cache
Mutex lock/unlock 25.0 - - -
#include <cmath>
#include <iostream>
using std::cout;
using std::endl;
float quake3_hack(float number) {
float x2 = number * 0.5f;
float y = number;
long i = *(long*) & y;
@sj26
sj26 / LICENSE.md
Last active August 26, 2025 22:35
Bash retry function

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit