Skip to content

Instantly share code, notes, and snippets.

View illucent's full-sized avatar
🎯
Focusing

Andrew Starodubtsev illucent

🎯
Focusing
View GitHub Profile
#!/usr/bin/env python3
"""Generate data at constant rate (float interval).
To try, run:
$ python3 constant-bit-rate-modulo.py | pv >/dev/null
"""
from time import sleep, monotonic as timer
@grantc
grantc / processes.py
Created November 5, 2015 12:49
list top 20 proceses by memory usage
import psutil
import json
import datetime
procs = []
timestamp = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
for proc in psutil.process_iter():
try:
pinfo = proc.as_dict(attrs=['pid', 'name', 'cmdline'])
@ttur
ttur / neural-style-instructions.md
Last active November 13, 2017 15:21
Instructions on setting up and running neural-style on CentOS and AWS G2, and how to create slideshow videos of the results with ffmpeg
@tsulej
tsulej / lattice.pde
Created December 1, 2016 07:36
Fake delaunay
PImage img;
final static int[][] kernel = {
// { 6,10,0}, {10,0,-10}, {0,-10,-6}
{2,2,0},{2,0,-2},{0,-2,-2}
};
int sample_size = 20; // points are chosen in grid sample_size x sample_size
int thr = 70; // edge threshold, lower - more point, higher - less
@ezekg
ezekg / Cliref.md
Created June 5, 2016 20:26 — forked from yunga/Cliref.md
CLIRef.md
_________ _____ _______________       _____
\_   ___ \\    \\___________   \____ / ____\     ~/.bash/cliref.md
/    \  \/|    | |   ||       _/ __ \  __\    copy/paste from whatisdb
\     \___|__  |_|_  ||    |   \  __/|_ |   http://pastebin.com/yGmGiDQX
 \________  /_____ \_||____|_  /____  /_|     yunga.palatino@gmail.com
 20160515 \/ 1527 \/         \/     \/

alias CLIRef.txt='curl -s "http://pastebin.com/raw/yGmGiDQX" | less -i'

@livibetter
livibetter / README.rst
Last active October 22, 2018 22:29
my scripts for screen recording

record scripts

Scripts I wrote for screen recording.

Dependencies

@jeetsukumaran
jeetsukumaran / DisableNonCountedBasicMotions.vim
Last active January 25, 2019 12:06
Disable Basic Motions if not Preceded By a Count
" Notes:
" (1) To enhance the ergonomics of this sufficiently to make it practical, at
" least, until your brain grows a new lobe dedicated to counting line offsets
" in the background while you work, you should either make sure you have
" something like the following in your `~/.vimrc`:
"
" set number
" if has('autocmd')
" augroup vimrc_linenumbering
" autocmd!

Quick reference: Math

Data properties

  • Math.E: number ES1

    Euler’s number, base of the natural logarithms, approximately 2.7182818284590452354.

  • Math.LN10: number ES1

define('ADMIN_COOKIE_PATH', '/');
define('COOKIE_DOMAIN', '');
define('COOKIEPATH', '');
define('SITECOOKIEPATH', '');
@yurivish
yurivish / venn-diagrams.js
Last active December 26, 2020 03:20
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;
}