Skip to content

Instantly share code, notes, and snippets.

@jbranchaud
jbranchaud / postgres-migrating-from-int-to-bigint.md
Created July 5, 2023 22:49
PostgreSQL: Migrating from INT to BIGINT
@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
@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(),
@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

from __future__ import unicode_literals
import os
import re
import time
import unicodedata
from collections import OrderedDict
from datetime import date
from optparse import OptionParser
from xml.dom.pulldom import START_ELEMENT, parse
# 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
@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);
@jboner
jboner / latency.txt
Last active April 24, 2024 16:33
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
@ramalho
ramalho / on the bash shell...
Created November 21, 2011 21:23
from 0 to Web in 35 lines
luciano@vogon:~$ sudo easy_install bottle
[sudo] password for luciano:
Searching for bottle
Reading http://pypi.python.org/simple/bottle/
Reading http://bottlepy.org/
[...]
Reading http://github.com/defnull/bottle
Best match: bottle 0.9.7
Downloading http://pypi.python.org/packages/source/b/bottle/bottle-0.9.7.tar.gz#md5=eb4faa6a519251928e4bb737db4217ae
Processing bottle-0.9.7.tar.gz
@starenka
starenka / .gitignore
Created September 18, 2011 20:02
fabfile to deploy flask app to nginx/supervisor/uwsgi stack
.idea/*
*.pyc