Skip to content

Instantly share code, notes, and snippets.

View a-b's full-sized avatar
🇺🇦

AL Berez a-b

🇺🇦
View GitHub Profile
SELECT
trim(line_number) AS line_number,
trim(colname) AS colname,
trim(type) AS type,
trim(col_length) AS col_length,
trim(position) AS position,
trim(raw_field_value) AS raw_field_value,
trim(err_code) AS err_code,
trim(err_reason) AS err_reason
FROM stl_load_errors sl, stv_tbl_perm sp
@a-b
a-b / latency.txt
Created November 6, 2015 18:43 — 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
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms
@a-b
a-b / docker.json
Created November 17, 2015 19:50 — forked from hitsujiwool/docker.json
docker + docker-compose on Amazon Linux
{
"variables": {
"aws_access_key": "{{env `AWS_ACCESS_KEY`}}",
"aws_secret_key": "{{env `AWS_SECRET_KEY`}}"
},
"builders": [
{
"type": "amazon-ebs",
"ssh_pty": true,
"access_key": "{{user `aws_access_key`}}",
@a-b
a-b / README.md
Created November 26, 2015 08:46 — forked from wvengen/README.md
Ruby memory analysis over time

Finding a Ruby memory leak using a time analysis

When developing a program in Ruby, you may sometimes encounter a memory leak. For a while now, Ruby has a facility to gather information about what objects are laying around: ObjectSpace.

There are several approaches one can take to debug a leak. This discusses a time-based approach, where a full memory dump is generated every, say, 5 minutes, during a time that the memory leak is showing up. Afterwards, one can look at all the objects, and find out which ones are staying around, causing the

@a-b
a-b / springer-free-maths-books.md
Created December 28, 2015 20:18 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of maths books available for free, here are the direct links
@a-b
a-b / .vimrc
Created February 5, 2016 03:47 — forked from robbintt/.vimrc
Toggle tab size in .vimrc with <f3>. Doesn't set initial conditions.
" Apparently some vim environments require colons before commands in
" .vimrc and others don't. This file has been primarily tested in
" Ubuntu 12.04, 13.10, and 14.04 environments, where a : is required
" on each line before a command. According to one stackexchange topic
" it is best to leave the leading colons because systems that do not
" require them can still execute them.
" Author - Trent Robbins
:set background=dark
@a-b
a-b / postmortem.md
Created July 20, 2017 22:55 — forked from mlafeldt/postmortem.md
Example Postmortem from SRE book, pp. 487-491

Shakespeare Sonnet++ Postmortem (incident #465)

Date

2015-10-21

Authors

  • jennifer
  • martym
@a-b
a-b / venn-diagrams.js
Created April 15, 2018 19:01 — forked from yurivish/venn-diagrams.js
Area-proportional Venn Diagrams
// Since `overlapArea` function is monotonic increasing, we can perform a
// simple bisection search to find the distance that leads to an overlap
// area within epsilon of the desired overlap.
function distanceForOverlapArea(r1, r2, desiredOverlap) {
// Ensure r1 <= r2
if (r1 > r2) {
var temp = r2;
r2 = r1;
r1 = temp;
}
function gp() {
printf "GlobalProtect: "
case $1 in
on)
echo ON
launchctl load /Library/LaunchAgents/com.paloaltonetworks.gp.pangpa.plist
launchctl load /Library/LaunchAgents/com.paloaltonetworks.gp.pangps.plist
;;
*)
echo OFF
@a-b
a-b / Makefile
Created February 12, 2020 01:51
Speed up ginkgo blur proposal
blur:
ginkgo blur $(git status -s | sed -r 's/^.{3}//' | xargs dirname | sort -u)