Skip to content

Instantly share code, notes, and snippets.

@faustinoaq
faustinoaq / Makefile
Last active April 10, 2019 20:58
Makefile for arduino.cr
# Compiled using LLVM 6 with AVR target support
# Digispark Attiny85 version
CC=avr-gcc
AR=avr-ar
OBJCOPY=avr-objcopy
STRIP=avr-strip
SIZE=/home/main/.arduino15/packages/arduino/tools/avr-gcc/4.8.1-arduino5/bin/avr-size
CRYSTAL=/run/media/main/5E7F72DC50CCBB04/crystal-master-4f5c55d-0.27.1-dev/bin/crystal
AVR-INCLUDE=$(HOME)/.arduino15/packages/arduino/tools/avr-gcc/4.8.1-arduino5/avr/include/
@faustinoaq
faustinoaq / aes.cr
Last active May 23, 2021 13:50
AES Cipher example in Crystal
require "openssl/cipher"
module AES
def self.encrypt(data, password)
cipher = OpenSSL::Cipher.new("aes-128-cbc")
cipher.encrypt
cipher.key = password
io = IO::Memory.new
io.write(cipher.update(data))
io.write(cipher.final)
@faustinoaq
faustinoaq / empresas-panama.csv
Last active April 16, 2024 15:45
Lista de empresas de tecnología y desarrollo en Panamá
Sitio Web Nombre de la Empresa
http://www.admios.com Admios
https://allsafe.com.pa All Safe Solutions S.A.
http://www.allsecurity.org/wp AllSecurity – Revista Allsecurity Especializada en Tecnologías & Seguridad de la información Noticias comunidad Hardware Software ethical Hacking cybersecurity.
http://www.americavirtual.net America Virtual – Diseño Web Panama – Marketing Digital
https://arpiasoftware.com arpiasoftware.com
http://www.livewalkpty.com Audio walks that Awaken Panama's HIstory - Panama Self-Guided Audio Walking Tours
http://best.com.pa Best Software Inc. – Sage 50 (antes Peachtree) ACT! OIS en Panamá
http://www.bitban.com Bitban | Simplificando la web
http://bluetideconsulting.com BlueTide IT Consulting
@faustinoaq
faustinoaq / dependencies.cr
Last active December 6, 2017 03:11
Extract binary dependencies (dynamic libraries) for crystal compiled program
executable = "bin/critter"
deps = [] of String
output = `ldd #{executable}`.scan(/(\/.*)\s\(/) do |m|
library = m[1]
deps << library
real_lib = File.real_path(library)
deps << real_lib if real_lib != library
end
@faustinoaq
faustinoaq / routes.cr
Last active December 2, 2017 06:11
Build routes for Amber automatically
def build_url
case verb
when "get"
case action_name
when :index then "/"
when :show then "/:#{param}"
when :new then "/new"
when :edit then "/:#{param}/edit"
end
when "post"
@faustinoaq
faustinoaq / proc.cr
Last active December 6, 2017 03:14
Using Kemal via def to proc
require "kemal"
def index(env)
"Hello World!"
end
get "/", &->index(HTTP::Server::Context)
Kemal.run
@faustinoaq
faustinoaq / untyped.cr
Created September 26, 2017 23:09
Compiled time array
A = [] of Nil
{% A << 0 %}
{% A << "Some String" %}
{% p A[0] %} # => 0
{% p A[1] %} # => "Some String"
@faustinoaq
faustinoaq / init.el
Created September 25, 2017 23:48
Personal Emacs configuration
;; @faustinoaq
;; GNU Emacs 24
;; ~/.emacs.d/init.el
;; MELPA packages
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.org/packages/") t)
(package-initialize)
@faustinoaq
faustinoaq / mini.css
Created September 25, 2017 23:13
Minimal CSS for a website
body {
font-family: Arial, Helvetica, sans-serif;
max-width: 1280px;
margin: 0 auto;
padding: 0 5%;
}
a {
text-decoration: none;
}
@faustinoaq
faustinoaq / .vimrc
Last active September 25, 2017 22:47
Minimal Vim configuration
set number
set nowrap
set expandtab
set shiftwidth=2
set tabstop=2
set mouse=a
call plug#begin('~/.vim/plugged')
Plug 'kien/ctrlp.vim'