Skip to content

Instantly share code, notes, and snippets.

@orendon
orendon / day02.cpp
Created December 2, 2020 20:53
AoC 2020
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
int count(string str, char c) {
int cnt = 0;
for (auto &s : str) {
@orendon
orendon / binary.py
Last active September 13, 2024 19:59
Ruby and Python string/integer to binary
for i in range(10):
num = 1<<i
print(format(num, '03d'), '=', format(num, '010b')) # we could use '#010b' to ouput 001 = 0b0000000001
"""
001 = 0000000001
002 = 0000000010
004 = 0000000100
008 = 0000001000
016 = 0000010000
@orendon
orendon / keybase.md
Created July 26, 2020 16:47
keybase.md

Keybase proof

I hereby claim:

  • I am orendon on github.
  • I am orendon (https://keybase.io/orendon) on keybase.
  • I have a public key ASB336B8B3i_a6R7mYQrru7p0l74CRnWNTnCT7efSlMVUwo

To claim this, I am signing this object:

@orendon
orendon / history_bk.sh
Created May 18, 2020 15:59
history backup
history -w orendon_hist_$(date +%Y-%m-%d_%H-%M-%S).txt
@orendon
orendon / py37.sh
Last active January 15, 2020 05:06
Install Python 3.7.2 on Ubuntu/Debian (tested on Google Cloud Shell)
# Install requirements
sudo apt-get install -y build-essential
sudo apt-get install -y checkinstall
sudo apt-get install -y libreadline-gplv2-dev
sudo apt-get install -y libncursesw5-dev
sudo apt-get install -y libssl-dev
sudo apt-get install -y libsqlite3-dev
sudo apt-get install -y tk-dev
sudo apt-get install -y libgdbm-dev
sudo apt-get install -y libc6-dev

FWIW: I didn't produce the content present here. I've just copy-pasted it from somewhere over the Internet, but I cannot remember exactly the original source. I was also not able to find the author's name, so I cannot give him/her the proper credit.


Effective Engineer - Notes

What's an Effective Engineer?

@orendon
orendon / System Design.md
Created January 20, 2018 21:10 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@orendon
orendon / pip_size.sh
Created January 10, 2018 20:36
Python: list pip packages size
pip list | xargs pip show | grep -E 'Location|Name' | cut -d ' ' -f 2 | paste -d ' ' - - | awk '{print $2 "/" tolower($1)}' | xargs du -sh 2> /dev/null

Eileen M. Uchitelle

Ingeniera de Sistemas Senior en GitHub. Soy una ávida contribuidora Open Source y estoy en el Rails Core Team y en el Rails Security Team. Disfruto hablar en conferencias, por lo general sobre el rendimiento o sobre contribuciones Open Source. Aparte de escribir código, me gusta la cerveza artesanal y senderismo con mi marido, Abe y nuestro perro, Arya.

Konstantin Haase

Co-Fundador y CTO en Travis CI, ex estrella de la ópera. Konstantin se describe a sí mismo como un "entusiasta del Open Source" y contribuye a una serie de proyectos de Ruby, incluyendo Ruby on Rails, Rack y Rubinus. Konstantin es también el actual mantenedor de Sinatra y bajo su dirección Sinatra se ha transformado en un

@orendon
orendon / filesystem.clj
Last active March 12, 2019 07:19
Clojure serialize deserialize
(defn serialize-obj [object filename]
(with-open [outp (-> (java.io.File. filename) java.io.FileOutputStream. java.io.ObjectOutputStream.)]
(.writeObject outp object)))
(defn deserialize-obj [filename]
(with-open [inp (-> (java.io.File. filename) java.io.FileInputStream. java.io.ObjectInputStream.)]
(.readObject inp)))
(defn deserialize-bytes [filename]
(-> filename