Skip to content

Instantly share code, notes, and snippets.

View tadasv's full-sized avatar
🚀

tadasv tadasv

🚀
  • USA
  • 19:51 (UTC -04:00)
View GitHub Profile
@tadasv
tadasv / Count leading zeros
Created February 3, 2014 02:38
A way to count leading 0 bits of a 32 bit int in 5 instructions :)
#include <stdio.h>
/*
You can do the same with a built in function if your compiler supports it:
zeros = __builtin_clz(arg);
*/
int main(int argc, const char *argv[])
{
@tadasv
tadasv / keybase.md
Created January 15, 2018 14:51
Keybase proof

Keybase proof

I hereby claim:

  • I am tadasv on github.
  • I am tadasv (https://keybase.io/tadasv) on keybase.
  • I have a public key ASCGrghnxBEUnd7xLAn2V7JWVDloZsz9xIToQZ53RzLt0Qo

To claim this, I am signing this object:

@tadasv
tadasv / orm.go
Last active February 14, 2022 19:19
Simple ORM for Golang
/*
This is an implementation of simple ORM that supports CRUD operations on single object, column mapping from struct tags.
example:
type Account struct {
orm.Model
UUID string
Name string
Email string