Skip to content

Instantly share code, notes, and snippets.

View Sibirtsev's full-sized avatar
💭
C++

Alexey Sibirtsev Sibirtsev

💭
C++
View GitHub Profile

FWIW: I (@Rondy) am not the author of the content presented here, which is an outline from Edmond Lau's book. I've just copy-pasted it from somewhere and saved as a personal gist, before it got popular on newsnews.ycombinator.com. I don't remember where exactly the original source is from and neither could find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

@Sibirtsev
Sibirtsev / perlin.py
Created December 7, 2019 08:13 — forked from eevee/perlin.py
Perlin noise in Python
"""Perlin noise implementation."""
# Licensed under ISC
from itertools import product
import math
import random
def smoothstep(t):
"""Smooth curve with a zero derivative at 0 and 1, making it useful for
interpolating.
@Sibirtsev
Sibirtsev / Instrumentor.h
Created November 17, 2019 13:20 — forked from TheCherno/Instrumentor.h
Basic Instrumentation Profiler
//
// Basic instrumentation profiler by Cherno
// Usage: include this header file somewhere in your code (eg. precompiled header), and then use like:
//
// Instrumentor::Get().BeginSession("Session Name"); // Begin session
// {
// InstrumentationTimer timer("Profiled Scope Name"); // Place code like this in scopes you'd like to include in profiling
// // Code
// }
@Sibirtsev
Sibirtsev / progressbars.py
Created June 26, 2019 10:15 — forked from franccesco/progressbars.py
Testing some of the progressbar libraries that I found interesting
# To test these progress bars you will have to
# install the following packages
# pipenv install click progress progressbar2 tqdm clint
import string
# progress bars
import time
import click
from tqdm import tqdm
@Sibirtsev
Sibirtsev / Makefile
Created February 20, 2019 13:46 — forked from aprxi/Makefile
Makefile_docker_20190214
# --------------------------------------------------------------------
# Copyright (c) 2019 LINKIT, The Netherlands. All Rights Reserved.
# Author(s): Anthony Potappel
#
# This software may be modified and distributed under the terms of the
# MIT license. See the LICENSE file for details.
# --------------------------------------------------------------------
# If you see pwd_unknown showing up, this is why. Re-calibrate your system.
PWD ?= pwd_unknown
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Sibirtsev
Sibirtsev / cmd.sh
Created December 21, 2018 10:29 — forked from kelvinn/cmd.sh
Example of using Apache Bench (ab) to POST JSON to an API
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/
@Sibirtsev
Sibirtsev / Arduino Song
Created April 25, 2018 06:14 — forked from eznj/star_wars.ino
Arduino Star Wars Song for Piezo
**/
const int c = 261;
const int d = 294;
const int e = 329;
const int f = 349;
const int g = 391;
const int gS = 415;
const int a = 440;
const int aS = 455;
@Sibirtsev
Sibirtsev / install_golang.sh
Created January 6, 2018 05:27 — forked from jniltinho/install_golang.sh
Install Golang on Linux
#!/bin/bash
## Install Golang 1.9 64Bits on Linux (Debian|Ubuntu|OpenSUSE|CentOS)
## http://www.linuxpro.com.br/2015/06/golang-aula-1-instalacao-da-linguagem-no-linux.html
## Run as root (sudo su)
## Thank's @geosoft1 | @gwmoura
GO_URL="https://storage.googleapis.com/golang"
GO_VERSION=${1:-"1.9.2"}
GO_FILE="go$GO_VERSION.linux-amd64.tar.gz"
@Sibirtsev
Sibirtsev / LCSTest.php
Created May 16, 2017 11:29 — forked from ezzatron/LCSTest.php
Longest common subsequence for PHP using arrays
<?php
class LCSTest extends PHPUnit_Framework_TestCase
{
/**
* Returns the longest common subsequence of two arrays.
*
* @link http://en.wikipedia.org/wiki/Longest_common_subsequence_problem
*
* @param array $left The first array.