Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / debug.md
Last active October 29, 2019 16:58
Guide to debug amber application on VSCode.
@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 / stream.cr
Last active February 1, 2019 13:16
Try kemal/crystal stream
require "kemal"
get "/stream" do |env|
env.response.print "START"
env.response.flush
sleep 3
env.response.print "MIDDLE"
env.response.flush
sleep 5
env.response.print "END"
@faustinoaq
faustinoaq / reload.md
Last active December 6, 2017 03:15
Guide to reload client on public file changes.

Amber Reload

Reloading public files on Amber.

Requisites

You need Crystal and Amber::CMD installed

Steps

@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 / 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 / icosahedron.xml
Created July 28, 2017 00:57
Icosahedron data
<?xml version="1.0"?>
<m> <p x="0.550563524346" y="0.758024984088" z="-0.349682612032"/>
<p x="0.62319582135" y="0.436643142534" z="0.648821804759"/>
<p x="0.975676690271" y="-0.177816333299" z="-0.12820432003"/>
<p x="-0.32007250628" y="0.0780544757795" z="0.944172171553"/>
<p x="0.437594031513" y="-0.598061218782" z="0.671441912732"/>
<p x="0.32007250628" y="-0.0780544757795" z="-0.944172171553"/>
<p x="0.250253520018" y="-0.916161840828" z="-0.313082508502"/>
<p x="-0.437594031513" y="0.598061218782" z="-0.671441912732"/>
<p x="-0.62319582135" y="-0.436643142534" z="-0.648821804759"/>