Skip to content

Instantly share code, notes, and snippets.

View evert0n's full-sized avatar
:octocat:

Everton Yoshitani evert0n

:octocat:
View GitHub Profile
@evert0n
evert0n / fields.py
Created November 20, 2019 05:48 — forked from iamahuman/fields.py
Virtual Field for Django
from django.db.models import Field
from django.conf import settings
from django.utils.decorators import cached_property
class VirtualField(object):
"""
A virtual field, mainly used for caching and seamless computed field retrieval.
This acts both like a (cached) property and a virtual field if supported.
"""
@evert0n
evert0n / latency.txt
Created January 24, 2024 23:00 — forked from jboner/latency.txt
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

How we incorporate next and cloudfront (2018-04-21)

Feel free to contact me at robert.balicki@gmail.com or tweet at me @statisticsftw

This is a rough outline of how we utilize next.js and S3/Cloudfront. Hope it helps!

It assumes some knowledge of AWS.

Goals

@evert0n
evert0n / translation.md
Created June 8, 2023 00:54 — forked from lleyton/translation.md
(ENG) Open Source Business Challenges and Reality, Rui Ueyama

Open Source Business Challenges and Reality

Original Japanese note here.

Original Author: Rui Ueyama (creator of the mold linker)

Translated by @windowsboy111

Minimally edited by @lleyton

@evert0n
evert0n / README.md
Last active January 25, 2023 02:24
Eligible Annual Leave Challenge

Annual Paid Leave Allowance

  1. Paid leave shall be granted after 3 months have elapsed from the date of hire.

  2. Employees and full-time workers shall be granted paid leave as outlined in the table below, beginning after 3 months have elapsed since their hire date.

Month of Hire Month when leave is granted Number of days granted
January April 10
February May 10
@evert0n
evert0n / install_mysql_client.sh
Created August 29, 2022 03:09 — forked from sshymko/install_mysql_client.sh
Install MySQL 5.7 client on Amazon Linux 2
#!/bin/sh
sudo yum install -y https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
sudo yum install -y mysql-community-client
/*! @license Firebase v2.3.1
License: https://www.firebase.com/terms/terms-of-service.html */
var g, aa = this;
function n(a) {
return void 0 !== a
}
function ba() {}
@evert0n
evert0n / react-app-s3-sync.sh
Created June 11, 2019 11:47 — forked from kevindice/react-app-s3-sync.sh
A shell script for uploading a React app build to S3 + CloudFront for deployment
#!/bin/bash
S3_BUCKET_NAME=$1
CF_ID=$2
# Sync all files except for service-worker and index
echo "Uploading files to $S3_BUCKET_NAME..."
aws s3 sync build s3://$S3_BUCKET_NAME/ \
--acl public-read \
--exclude service-worker.js \
@evert0n
evert0n / example-api-gateway.yaml
Created March 1, 2022 18:07 — forked from elerch/example-api-gateway.yaml
YAML version of tmaslen's API Gateway cloudformation template - useful when you don't want to use SAM
---
AWSTemplateFormatVersion: '2010-09-09'
Description: Sample template that contains a Lambda function behind an API GW
Resources:
# BEGIN: Should only need this in an empty API Gateway situation
ApiGatewayCloudWatchLogsRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'