Skip to content

Instantly share code, notes, and snippets.

View mariiillo's full-sized avatar
🏠
Working from home

Mario Viapiano mariiillo

🏠
Working from home
View GitHub Profile
@mariiillo
mariiillo / postgres-brew.md
Created July 5, 2019 13:14 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@mariiillo
mariiillo / container.rb
Created February 22, 2019 10:18
dry-auto_inject + rom-sql
require 'dry-container'
require 'dry-auto_inject'
module Corto
module Infrastructure
# Dry-Container
class Container
extend Dry::Container::Mixin
register 'urls_repository' do
@mariiillo
mariiillo / lab.r
Created September 27, 2018 06:07
Classification Lab
# Classification Lab
library(kernlab)
library(caret)
wine_part <- read.csv("~/Schreibtisch/wine_part.csv")
wine_test <- read.csv("~/Schreibtisch/wine_test.csv")
normalize <- function(x) { return ((x-min(x) / (max(x)-min(x)))) }
wine_norm <- as.data.frame(lapply(wine_part[,-1], normalize))
wine_test_norm <- as.data.frame(lapply(wine_test[,-1], normalize))
@mariiillo
mariiillo / test.json
Created September 11, 2018 07:20
test
{
"language": "english",
"sugLanguage": "english",
"sentences": [
"The names, types, behavior, settings and other properties of audio sources are defined in a model series related document, called audio handling sources table, "BRXXX_AH_SRC" in Microsoft Excel format.",
"Also, the realization of audio connections depends on the current model series. This is defined in a model series related document, called audio handling connections table, called "BRXXX_AH_CON" in Microsoft Powerpoint format.",
"XXX is a wild card for the appropriate model series (e.g., 204).",
"For the model series 204, the documents BR204_AH_SRC [RD906] and BR204_AH_CON [RD1046] shall be valid.",
]
}
@mariiillo
mariiillo / bsearch2.rs
Last active August 7, 2018 12:39
New version Binary tree
#[derive(Debug, Default)]
struct Tree {
root: Option<Node>,
}
impl Tree {
pub fn add_node(&mut self, value: i32) {
let new_node = Node {
value,
..Default::default()
@mariiillo
mariiillo / Gemfile
Created June 3, 2017 00:55
Code challenge
source "https://rubygems.org"
gem "rspec"
@mariiillo
mariiillo / tmux-cheatsheet.markdown
Created February 16, 2016 18:43 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@mariiillo
mariiillo / README.md
Last active August 29, 2015 14:22 — forked from radarek/README.md
@mariiillo
mariiillo / custom_mailer.rb
Created May 20, 2015 21:13
Devise Custom Mailer
/mailers/devise/custom_mailer.rb
class Devise::CustomMailer < Devise::Mailer
def headers_for(action, opts={})
super.tap do |hash|
hash.merge!({
:subject => 'Subject',
:from => 'QWE',#mailer_sender(devise_mapping),
:to => 'ASD',#resource.email,
@mariiillo
mariiillo / app.js
Last active August 29, 2015 14:06 — forked from dskanth/app.js
var app = require('express').createServer()
var io = require('socket.io').listen(app);
var fs = require('fs');
app.listen(8008);
// routing
app.get('/', function (req, res) {
res.sendfile(__dirname + '/chat.html');
});