Skip to content

Instantly share code, notes, and snippets.

View dannluciano's full-sized avatar
🏠
Working from home

Dann Luciano dannluciano

🏠
Working from home
View GitHub Profile
@dannluciano
dannluciano / using-uuid-as-pk.md
Created December 31, 2020 02:35 — forked from rponte/using-uuid-as-pk.md
Não use UUID como PK nas tabelas do seu banco de dados

Pretende usar UUID como PK em vez de Int/BigInt no seu banco de dados? Pense novamente...

TL;TD

Não use UUID como PK nas tabelas do seu banco de dados.

Um pouco mais de detalhes

@dannluciano
dannluciano / python-guide.sh
Created February 11, 2020 14:27 — forked from fernandolcouto/python-guide.sh
The definitive guide to setup my Python workspace
# The definitive guide to setup my Python workspace
# Author: Henrique Bastos <[email protected]>
PY3=3.8.0
#PY2=2.7.16
PY3TOOLS="youtube-dl pandas s3cmd fabric pytest"
#PY2TOOLS="rename mercurial"
VENVS=~/.ve
PROJS=~/workspace
@dannluciano
dannluciano / LetsDestroyC.md
Created February 5, 2020 00:30 — forked from shakna-israel/LetsDestroyC.md
Let's Destroy C

Let's Destroy C

I have a pet project I work on, every now and then. CNoEvil.

The concept is simple enough.

What if, for a moment, we forgot all the rules we know. That we ignore every good idea, and accept all the terrible ones. That nothing is off limits. Can we turn C into a new language? Can we do what Lisp and Forth let the over-eager programmer do, but in C?


User authentication system

Your task is now to create a user authentication system.

This document will guide you through all the features and implication of such system, so that you don't have to search them yourself.

We will focus on web/browser-technologies, however similar concept can be widely applied. This guide, is a work in progress, feel free to comment and provide feedbacks.

Expected Workflows

@dannluciano
dannluciano / tmux-cheatsheet.markdown
Last active February 19, 2019 21:15 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

-t -- /bin/sh -c 'tmux has-session && exec tmux attach || exec tmux'

start new:

tmux
@dannluciano
dannluciano / vpn.md
Created March 2, 2018 02:25 — forked from joepie91/vpn.md
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

(A Russian translation of this article can be found here, contributed by Timur Demin.)

Why not?

@dannluciano
dannluciano / latency.txt
Created July 2, 2017 14:14 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@dannluciano
dannluciano / pr.md
Created March 9, 2016 21:44 — forked from kennethreitz/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

// g++ -std=c++11 random.cpp -o random
#include <iostream>
#include <random>
int main ()
{
std::random_device rd;
std::cout << "default random_device characteristics:" << std::endl;
std::cout << "minimum: " << rd.min() << std::endl;

(a gist based on the old toolmantim article on setting up remote repos)

To collaborate in a distributed development process you’ll need to push code to remotely accessible repositories.

This is somewhat of a follow-up to the previous article setting up a new rails app with git.

For the impatient

Set up the new bare repo on the server: