Skip to content

Instantly share code, notes, and snippets.

View sjdonado's full-sized avatar
:atom:
The enemy of the art is the absence of limitations - Orson Welles

Juan Rodriguez sjdonado

:atom:
The enemy of the art is the absence of limitations - Orson Welles
View GitHub Profile
@sjdonado
sjdonado / snake_matrix.rb
Created December 14, 2019 22:10
Print a square matrix in snake pattern
puts "n:"
n = gets.to_i
matrix = Array.new(n){Array.new(n, 0)}
def snake(n, matrix, i, j, num)
if num == n * n
matrix[i][j] = num
return num
end
matrix[i][j] = num
@sjdonado
sjdonado / truncatablePrimes.js
Created December 14, 2019 22:02
The sum of the first 10 truncatable primes
let tPrimesCounter = 0;
let sum = 0;
let num = 7;
function isPrime(num, div = 2) {
if (num < div || num % div === 0) {
return false;
}
if (div === Math.ceil(Math.sqrt(num))) {
return true;
@sjdonado
sjdonado / .vimrc
Last active December 14, 2019 22:10
My vim config
git config --global diff.tool vimdiff
git config --global difftool.prompt false
--- ~/.vimrc ---
syntax enable
colorscheme monokai
set number
set incsearch