Skip to content

Instantly share code, notes, and snippets.

View iurisilvio's full-sized avatar

Iuri de Silvio iurisilvio

View GitHub Profile
@jboner
jboner / latency.txt
Last active May 3, 2024 15:17
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
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
@jbranchaud
jbranchaud / postgres-migrating-from-int-to-bigint.md
Created July 5, 2023 22:49
PostgreSQL: Migrating from INT to BIGINT
@vinicius73
vinicius73 / 0-contribua-.md
Last active February 9, 2024 10:10
Guia de referencias sobre estudo de JavaScript

Contribua

Se você quiser adicionar mais algum tópico deixe seu comentário, o objetico é facilitar para os iniciantes ou aqueles que buscam dominar JavaScript, quais tópicos são importantes para dominar JavaScript.

São tópicos para quem sabe o minimo de JavaScript (declarar variáveis), a ordem em que eles aparecem são por importância para o dominio como um todo. Mesmo que você já tenha experiência com JS, recomendo que leia os links de cada tópico para fortalecer suas bases teóricas e ter um comportamento mais profundo da linguagem.

Lista originalmente criada e compilada por Vinicius Reis

@jcrist
jcrist / bench.py
Last active January 11, 2024 14:34
A quick benchmark comparing msgspec (https://github.com/jcrist/msgspec), pydantic v1, and pydantic v2
"""A quick benchmark comparing the performance of:
- msgspec: https://github.com/jcrist/msgspec
- pydantic V1: https://docs.pydantic.dev/1.10/
- pydantic V2: https://docs.pydantic.dev/dev-v2/
The benchmark is modified from the one in the msgspec repo here:
https://github.com/jcrist/msgspec/blob/main/benchmarks/bench_validation.py
I make no claims that it's illustrative of all use cases. I wrote this up
@elivz
elivz / wordpress-w3tc-site.conf
Created March 20, 2011 18:06
Nginx configuration for WordPress with W3 Total Cache plugin. See http://elivz.com/blog/single/wordpress_with_w3tc_on_nginx/
server {
# Redirect yoursite.com to www.yoursite.com
server_name yoursite.com;
rewrite ^(.*) http://www.yoursite.com$1 permanent;
}
server {
# Tell nginx to handle requests for the www.yoursite.com domain
server_name www.yoursite.com;
@starenka
starenka / .gitignore
Created September 18, 2011 20:02
fabfile to deploy flask app to nginx/supervisor/uwsgi stack
.idea/*
*.pyc
@ssbarnea
ssbarnea / mysql-convert-utf8.py
Created July 6, 2011 18:48
Script to convert a a database to use utf8 encoding
#! /usr/bin/env python
import MySQLdb
host = "localhost"
passwd = ""
user = "root"
dbname = "mydbname"
db = MySQLdb.connect(host=host, user=user, passwd=passwd, db=dbname)
cursor = db.cursor()
@autoize
autoize / 6977.diff
Created December 31, 2019 15:06
Pull request #6977 for Amazon SES API support in Mautic 2.15.3
diff --git a/app/bundles/EmailBundle/Assets/js/config.js b/app/bundles/EmailBundle/Assets/js/config.js
index f233d59f3f..5951c08143 100644
--- a/app/bundles/EmailBundle/Assets/js/config.js
+++ b/app/bundles/EmailBundle/Assets/js/config.js
@@ -66,6 +66,7 @@ Mautic.testMonitoredEmailServerConnection = function(mailbox) {
Mautic.testEmailServerConnection = function() {
var data = {
amazon_region: mQuery('#config_emailconfig_mailer_amazon_region').val(),
+ amazon_api_region: mQuery('#config_emailconfig_mailer_amazon_api_region').val(),
api_key: mQuery('#config_emailconfig_mailer_api_key').val(),
@nebirhos
nebirhos / jquery.ajax.progress.js
Created October 15, 2012 11:26 — forked from db/jquery.ajax.progress.js
add XHR2 upload and download progress events to jQuery.ajax
(function addXhrProgressEvent($) {
var originalXhr = $.ajaxSettings.xhr;
$.ajaxSetup({
xhr: function() {
var req = originalXhr(), that = this;
if (req) {
if (typeof req.addEventListener == "function" && that.progress !== undefined) {
req.addEventListener("progress", function(evt) {
that.progress(evt);
}, false);
# Builder file for sentry
#
FROM ubuntu
MAINTAINER Michael Crosby
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade