Skip to content

Instantly share code, notes, and snippets.

View leostera's full-sized avatar
🛠️
ars longa vita brevis

Leandro Ostera leostera

🛠️
ars longa vita brevis
View GitHub Profile
@leostera
leostera / config.ml
Last active February 10, 2020 22:39 — forked from p1xelHer0/config.ml
open Rresult
open Sexplib0.Sexp
let parse root_path =
let read_config path =
let root_path = path |> Fpath.to_dir_path |> Fpath.normalize in
let odot_file = Fpath.append root_path Model.config_file in
Bos.OS.File.read odot_file
in
info Skipping @opam/zed@opam:1.6
info Skipping @opam/zarith@opam:1.7
info Skipping @opam/yojson@opam:1.7.0
info Skipping @opam/x509@opam:0.6.3
info Skipping @opam/uri@opam:2.2.1
info Skipping @opam/tls@opam:0.10.2
info Skipping @opam/stringext@opam:1.6.0
info Skipping @opam/stdlib-shims@opam:0.1.0
info Skipping @opam/stdio@opam:v0.12.0
info Skipping @opam/ssl@opam:0.5.7
@leostera
leostera / future.md
Created February 18, 2017 20:58 — forked from xaviervia/future.md
2017-02-18
  • Blockchain of blockchains with RSA public keys for resource registry (domain + intents/messages accepted)
  • Go down from HTTP/WS to have a simpler/more essential protocol for communication. Protocol not based on simple human analogies (verb, noun)
  • Protocol is (hopefully) implementation of Real OOP.
  • External resources in the language are represented with URLs
  • Discovery/caching decisions (URL resolution) is delegated to the runtime
  • Runtime should eventually be a hypervisor that only manages resource allocation. Or dedicated hardware, programs for FPGA. High level functional language for FPGA programming.
  • Language is expressed in an AST. AST can be formatted in different transport encodings (JSON for example).
  • Language is just representation of category theory operations between the resources, assuming they fulfillthe expected types.
  • Language is lazy and asynchonous by default. Tagline: "sync is just async that works very fast"
  • Under the hood, operations are Real OOP (messages)
@leostera
leostera / xhyve-freebsd-tutorial-1.md
Created December 2, 2016 22:26 — forked from tanb/xhyve-freebsd-tutorial-1.md
FreeBSD running on xhyve tutorial. (Appendix: Resize image with qemu. Create FreeBSD VM with qemu).

TL;DR

  • Create 5GB FreeBSD image.
  • Install FreeBSD on xhyve.
  • Mount host directory.

Requisites

@leostera
leostera / README.md
Created April 19, 2016 07:48 — forked from dnozay/_Jenkins+Script+Console.md
jenkins groovy scripts collection.
@leostera
leostera / ask_area.erl
Last active August 29, 2015 14:27
ask_area.erl
-module(ask_area).
-export([print_area/0]).
print_area() ->
try area() of
Area -> io:format("The area is ~p~n", [Area])
catch
error:Err -> io:format("~s~n", [error_msg(Err)])
end.
-module(shiftand).
%% shiftand:match("announce", "annual_announce").
-export([match/2]).
match(Pattern, Text) ->
PatLen = length(Pattern),
BitMaskTable = init_table(Pattern),
MatchMask = 1 bsl (PatLen - 1),
1 ASPMX.L.GOOGLE.COM
5 ALT1.ASPMX.L.GOOGLE.COM
5 ALT2.ASPMX.L.GOOGLE.COM
10 ALT3.ASPMX.L.GOOGLE.COM
10 ALT4.ASPMX.L.GOOGLE.COM
$(document).ready(function() {
$("#events_search input").keyup(function() {
timer = setTimeout(function() {
$.get($("#events_search").attr("action"), $("#events_search").serialize(), null, "script");
$('#events-partial').addClass('animated fadeIn');
window.setTimeout( function(){
$('#events-partial').removeClass('animated fadeIn');
}, 600);
return false;
}, 2000);
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
helper_method :current_user
alias_method :devise_current_user, :current_user
def current_user
@current_user ||= if session[:user_id]