Skip to content

Instantly share code, notes, and snippets.

View ricardocanelas's full-sized avatar
🦈

Ricardo Canelas ricardocanelas

🦈
View GitHub Profile
@ricardocanelas
ricardocanelas / ds-ml-data-books.md
Last active November 1, 2022 22:10
data science - machine learning - data

Book

Year Tag Name Author
2013 Statistic Estat Johnson / Kuby
2017 Data Designing Data-Intensive Applications Martin Kleppmann
2022 Data Data Mesh Zhamak Dehghani
2012 Data Big Data: Principles and Best Practices of Scalable Realtime Data Systems Nathan Marz
2009 Statistical The Elements of Statistical Learning Trevor Hastie
@ricardocanelas
ricardocanelas / regex.md
Last active April 23, 2021 13:38
Regex - Basic information

Reference

Meta Sequences:

  • . (a dot) It denotes “any character except a newline”

Quantifiers:

  • + to the match one character after another.
  • ? is a quantifier by itself (zero or one), but if added after another quantifier (or even itself) it gets another meaning – it switches the matching mode from greedy --> to --> lazy.
@ricardocanelas
ricardocanelas / template-engine-simple.js
Last active October 28, 2020 17:54
Template Engine
export const template = function (tpl, data) {
if (typeof tpl !== 'string') return ''
if (typeof data !== 'object') return tpl
const interpolate = new RegExp('{{(.+?)}}', 'gi')
let result = tpl
result = result.replace(interpolate, (...args) => {
const values = args[1] ? args[1].trim().split('||') : ''
@ricardocanelas
ricardocanelas / VagrantFile
Last active September 17, 2020 05:45
Vagrant / PHP7.1 + MySQL5.6 + Apache
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "private_network", ip: "192.168.100.100"
config.vm.synced_folder "./www", "/var/www/", :nfs => { :mount_options => ["dmode=777","fmode=666"] }
<!DOCTYPE html>
<html>
<head>
<title>Preact</title>
</head>
<body>
<script type="module">
import {
html,
render,
@ricardocanelas
ricardocanelas / embedVideo.js
Created July 16, 2020 16:50
Embed Video (youtube & vimeo)
function stripParameters(str) {
// Split parameters or split folder separator
if (str.indexOf('?') > -1) {
return str.split('?')[0]
} else if (str.indexOf('/') > -1) {
return str.split('/')[0]
}
return str
}
@ricardocanelas
ricardocanelas / server.js
Created July 3, 2020 19:23
Https with Next.js
const { createServer } = require('https')
const { parse } = require('url')
const next = require('next')
const selfsigned = require('selfsigned')
// const fs = require('fs')
const dev = process.env.NODE_ENV !== 'production'
const app = next({ dev })
const handle = app.getRequestHandler()
@ricardocanelas
ricardocanelas / custom-checkbox-twbs.scss
Created July 1, 2020 12:03
get-boostrap-custom-checkbox
$custom-checkbox-color: $color-brand-wcag-3-1;
$custom-checkbox-size: 24px;
.custom-checkbox {
.custom-control-input {
opacity: 0;
width: $custom-checkbox-size;
height: $custom-checkbox-size;
}
@ricardocanelas
ricardocanelas / utilities.scss
Last active June 24, 2020 22:28
Utility-Class (like Bootstrap 5) buut.. in a simple way
$grid-breakpoints: (
xs: 0,
sm: 576px,
md: 768px,
lg: 992px,
xl: 1200px,
xxl: 1400px
);
$utilities: (