Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@emiguelt
emiguelt / gist:f1ccaf53b882ee6215ea30342692ff9c
Created September 16, 2021 23:26 — forked from khakimov/gist:3558086
Matrix Effect in you terminal
echo -e "\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) ;sleep 0.05; done|awk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}'
@emiguelt
emiguelt / IntersectTwoCircles.js
Created October 9, 2020 03:56 — forked from jupdike/IntersectTwoCircles.js
Find the intersections (two points) of two circles, if they intersect at all
// based on the math here:
// http://math.stackexchange.com/a/1367732
// x1,y1 is the center of the first circle, with radius r1
// x2,y2 is the center of the second ricle, with radius r2
function intersectTwoCircles(x1,y1,r1, x2,y2,r2) {
var centerdx = x1 - x2;
var centerdy = y1 - y2;
var R = Math.sqrt(centerdx * centerdx + centerdy * centerdy);
if (!(Math.abs(r1 - r2) <= R && R <= r1 + r2)) { // no intersection
@emiguelt
emiguelt / tmux.conf
Last active February 10, 2020 19:51 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@emiguelt
emiguelt / autorotate.sh
Created February 25, 2019 18:30
Asus T110HA display autorotation in Linux (*ubuntu)
!/bin/sh
# Auto rotate touch screen based on device orientation.
#
# Based on chadm's script at https://linuxappfinder.com/blog/auto_screen_rotation_in_ubuntu.
# Receives input from monitor-sensor (part of iio-sensor-proxy package) and sets the touchscreen
# orientation based on the accellerometer positionn. We assume that the display rotation is
# handled by Linux Mint 18.1, Cinnamon 3.2.7. If this is not the case, add the appropriate
# xrandr command into each case block.

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname