Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#curl -L https://gist.githubusercontent.com/niofis/15a4ad324dbae858ca56a0fe23027103/raw | bash
if command -v apt-get &> /dev/null
then
echo "Debian based environment"
ENV="debian"
fi
if [[ $(cat /proc/device-tree/model 2>/dev/null) =~ "Zero" ]];
then
Instrucciones
Escribe una api REST que sirva quotes --que se encuentran al final de este document-- desde base de datos, debe soportar cuando menos 3 acciones:
* traer un quote aleatorio
* agregar un quote nuevo
* traer un quote específico
Los quotes deben analizarse para determinar si es divertido:
* Sumar los valores ascii de todos los caracteres del quote y determinar si el resultado es:
@niofis
niofis / tmux.conf
Last active November 22, 2021 04:20 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
@niofis
niofis / draw.lisp
Last active December 22, 2017 23:12
(ql:quickload "sdl2")
(require :sdl2)
(defparameter win nil)
(defparameter running nil)
(sdl2:init
:video)
(setf win (sdl2:create-window :title "nice"))
(setf running t)
#sync
rows = fn(y, rows) -> if y < @height do [cols.(y, 0, cols) | rows.(y + 1, rows)] else [] end end
#async
rows = fn(y, rows) -> if y < @height do [Task.async(fn -> cols.(y, 0, cols) end) | rows.(y + 1, rows)] else [] end end
closestHit :: [Maybe Hit] -> Maybe Hit
closestHit (x:[]) = x
closestHit (Nothing:xs) = closestHit xs
closestHit (x:Nothing:xs) = closestHit (x:xs)
closestHit (a@(Just x1):b@(Just x2):xs)
| (distance x1) < (distance x2) = closestHit (a:xs)
| otherwise = closestHit (b:xs)
@niofis
niofis / id_rsa.pub
Created October 26, 2017 21:38
id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAgEAqLRl05SyLpg5ehCtchYBX5oxJXFtw8V/iVdFGeNMIziegIha1nKuSrpSDqMN6lOIzWwjhxVYB/x8Izl+UiW3mzSEmP0y7vmJWevOKITvb/4evEzXMBTYJ2ApEulVe3h58xg1SYbDQWsUWZL7cM71x0btQg7lXHTmQMaMwlMb20DNyOHJqmn+OCJtb6daCMBiKdUQSr0bX+UoIqT1jqtz2G5Ni+9Q7pE7J5+dGryCpwwbx4auoccm7TQAaxweSKJxNsQb03IpWfa+5Hou55L0fP5l5T7kW9pReFwogaQFrva5JDBtn9X3BYG3m6nsEPb67rzYiWwXxMnDIQwID/DqiM4XH/Z2kElr+c5VKDAC/4Vb50eu5yJU+MWJa5PZvkbCA/Oh3gSTbCQo/aw7oYl/IAlf3ddO1jIFdq9qYgxNp1s9xQWzlfTOUw12m3nshi/bXLlZvHB4QeFtXO/JWt2175KsRpYEv4zwLCvA5PYKzgaKi5qBHvODlZKq8N1MYJ5oA1ugEmaDRypT7IRiyZ9Kz0igUI2RblZ9LurknCFgdKX6WrStzRuwP4D4coSTlwBVTdcKDQeERK6hSzilkDs/Ex6sbG5rqGH0StHrCsFkVBGFBrLApIWCWwDtrJmyL1t0DHA1PHl4b8NTjnB/6rDUqDorbXbYP77YFXF/rtpVC3M=
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 12,
// font family with optional fallbacks
@niofis
niofis / .bash_profile
Last active January 28, 2019 06:39
bash_profile mac
#some options taken from http://natelandau.com/my-mac-osx-bash_profile/
alias ll='ls -FGlAhp'
alias cp='cp -iv' # Preferred 'cp' implementation
alias mv='mv -iv' # Preferred 'mv' implementation
alias mkdir='mkdir -pv'
alias ls='ls -G'
PS1='\[\e[0;36m\]\u@\h\[\e[m\] \[\e[0;32m\]\w\[\e[m\] \[\e[0;34m\]\$\[\e[m\] \[\e[0;37m\]'
export PS1="\[\033[38;5;244m\]\u\[$(tput sgr0)\]\[\033[38;5;26m\][\w]\[$(tput sgr0)\]\[\033[38;5;15m\]\n\\$\[$(tput sgr0)\] "
# OPAM configuration
http://gigamonkeys.com/book/introduction-why-lisp.html
http://www.learnlispthehardway.org/book/1-02-12-format/
https://lbolla.wordpress.com/2010/12/05/sbcl-quicker-than-c/
http://caml.inria.fr/pub/docs/manual-ocaml/