This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:set number | |
:set relativenumber | |
:set autoindent | |
:set tabstop=4 | |
:set shiftwidth=4 | |
:set smarttab | |
:set softtabstop=4 | |
:set mouse=a | |
:set whichwrap+=<,>,[,] " right move in the first char of non first line move to end of previous line | |
:set foldmethod=syntax |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://stackoverflow.com/questions/1057564/pretty-git-branch-graphs | |
[alias] | |
lg1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all | |
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all | |
lg = !"git lg1" | |
dog = log --all --decorate --oneline --graph |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Dark mode | |
Execute the following code in your browser console. | |
https://superuser.com/questions/1527410/how-can-i-preview-pdfs-with-google-chrome-in-dark-mode/1527417 | |
*/ | |
var cover = document.createElement("div"); | |
let css = ` | |
position: fixed; | |
pointer-events: none; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Modular Exponentiation (Rapid Exponentiation) | |
--------------------------------------------- | |
Efficient algorithm used in the RSA public key cryptographic system | |
More info: | |
https://en.wikipedia.org/wiki/Modular_exponentiation | |
""" | |
from time import time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Show simple move effect in the command prompt. | |
X-axis movement (right to left), with recursion | |
loop (in moveAnimation function) | |
[ More ASCII art to show in this program ] | |
[------> https://www.asciiart.eu <-------] | |
_ ,_, _ | |
/ `'=) (='` \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <windows.h> | |
using namespace std; | |
int main() { | |
char human[4][4]={ | |
" O " , | |
"/|\\", | |
" | ", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Simulation to the Monty Hall Paradox | |
https://es.wikipedia.org/wiki/Problema_de_Monty_Hall | |
*/ | |
#include <iostream> | |
#include <cstdlib> | |
#include <ctime> | |
using namespace std; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Performance fibonacci function with Dynamic Programming """ | |
import time | |
def fib1(n): | |
""" simple recursive algorithm """ | |
if (n == 1 or n == 2): | |
return 1 | |
return fib1(n-1) + fib1(n-2) |