Skip to content

Instantly share code, notes, and snippets.

@enricostano
enricostano / shift_register.rs
Last active May 13, 2016 14:01
Playing with shift registers with Rust + ARMv7 + GPIO
extern crate sysfs_gpio;
use sysfs_gpio::{Direction,Pin};
use std::time::Duration;
use std::thread::sleep;
fn main() {
let data_pin = Pin::new(18); // SER #14
let latch_pin = Pin::new(23); // RCLK #12
let clock_pin = Pin::new(24); // SRCLK #11
@diniremix
diniremix / dockersetup.MD
Last active September 22, 2016 14:16
setup docker on elementary OS freya

instalar docker

instalar una imagen (ubuntu 14.04 en este caso)

  • sudo docker run ubuntu:14.04

revisar las imagenes instaladas

  • sudo docker images

entrar en la imagen recien creada

@rye
rye / vomit.ru
Last active January 30, 2017 11:38
A Ruby web server to act like Python's SimpleHTTPServer module.
#!/usr/bin/env rackup
#\ -E deployment
use Rack::ContentLength
app = Rack::Directory.new Dir.pwd
run app
@rabbitt
rabbitt / schema_clone.py
Last active October 8, 2020 12:56
PostgreSQL schema cloner (including data).
import psycopg2 as pg
from io import BytesIO
from collections import defaultdict
from contextlib import contextmanager
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT, ISOLATION_LEVEL_READ_COMMITTED
READ_COMMIT = ISOLATION_LEVEL_READ_COMMITTED
AUTO_COMMIT = ISOLATION_LEVEL_AUTOCOMMIT
@PikachuEXE
PikachuEXE / babel_loader_builder.js
Created March 18, 2019 08:02
Webpacker 4 multiple target config
/* eslint-disable global-require */
/* eslint-env node */
const validEnv = ["development", "test", "production"]
const currentEnv = process.env.NODE_ENV || "unknown"
const isDevelopmentEnv = currentEnv === "development"
const isProductionEnv = currentEnv === "production"
const isTestEnv = currentEnv === "test"
if (!validEnv.includes(currentEnv)) {
@jrichardsz
jrichardsz / sheet-to-api-rest-v1.js
Last active January 31, 2022 01:42
google sheet spreadsheet as api rest using google app script or feeds
var sheetId = "15x3asddawIXE";
var sheetName = "20adsasd-4";
var token = 'adasdasd';
var telegramToken = 'asdasdasd';
var book = SpreadsheetApp.openById(sheetId);
var sheet = book.getSheetByName(sheetName);
var sheetLog = book.getSheetByName("log");

Crystal vs Node.js Websocket Benchmark

Crystal 0.9.1 with Kemal

require "kemal"

ws "/" do |socket|
  socket.on_message do |message|
 end

Senior Backend Developer at Devengo

Devengo is a startup focused on a simple but ambitious mission: make finance a fairer place. Founded by well-known fintech players Fernando Cabello-Astolfi and Alberto Molpeceres our first product is an innovative social benefit that allows workers to collect their earned wages in real-time. Your money, when you need it.

The problem

Economists identify¹ three main challenges any person and household must face to reach a sustainable level of financial wellness: having sufficient and stable income, maintaining an economic-financial balance that limits problems of overindebtedness and avoiding severe poverty.

The last two challenges are the most pressing ones as they have an immediate effect on the material living conditions of the population and they compound over time sinking the households' economies further and further.

In Spain al

@noelrappin
noelrappin / splat_check.rb
Created December 30, 2022 18:00
Splat check
class Consumer
def takes_args(a, b, c)
p "#{a} #{b} #{c}"
end
def takes_keys(a:, b:, c:)
p "#{a} #{b} #{c}"
end
end
@strzibny
strzibny / unused_routes.rb
Created May 5, 2016 15:21
Find unused routes in Rails
#!/usr/bin/env ruby
# Extracted from traceroute gem + checking the presence of views as well
require_relative './config/environment.rb'
class Traceroute
def initialize(app)
@app = app
end