Skip to content

Instantly share code, notes, and snippets.

View lricoy's full-sized avatar

Lucas Ricoy lricoy

View GitHub Profile
@lricoy
lricoy / ubuntu-installation-stuff.md
Last active October 16, 2018 19:46
Things I did with my installation of Ubuntu 18.04

General

@lricoy
lricoy / fold.ts
Created April 24, 2018 10:09
Understanding fold
// ref: https://sidburn.github.io/blog/2017/03/19/understanding-fold
const eql = (expected, value) => {
if (expected !== value) {
throw new Error(`${expected} not equal to ${value}`);
}
};
eql('abc', 'abc');
eql(1, 1);
@lricoy
lricoy / lista-exemplo.ts
Created April 15, 2018 20:37
Exemplo de lista encadeadas para grupo de estudos
class Nodo {
public data: number; // Valor que o elemento contem
public proximo: Nodo; // referencia para o próximo item da lista
constructor(data, proximo?) {
this.data = data;
this.proximo = proximo;
}
}
@lricoy
lricoy / netSalary.js
Last active February 7, 2018 00:43
Over simplified way to calculate IRRF/netSalary
const calculateIRRF = baseAmount => {
if (baseAmount <= 1903.98) {
return 0;
}
let value = 0;
if (baseAmount <= 2826.65) {
value = baseAmount * 0.075 - 142.8;
} else if (baseAmount <= 3751.05) {
@lricoy
lricoy / react-with-jsx.html
Last active February 6, 2018 00:51
React Component with JSX
<!DOCTYPE html>
<html>
<script src="https://fb.me/react-with-addons-15.1.0.js"></script>
<script src="https://fb.me/react-dom-15.1.0.js"></script>
<script src="https://unpkg.com/babel-standalone@6.26.0/babel.js"></script>
<body>
<div id="myApp"></div>
<script type="text/babel">
const rootElement = document.getElementById('myApp')
const Message = (
@lricoy
lricoy / react-without-jsx.html
Last active February 7, 2018 16:02
React createElement without JSX
<!DOCTYPE html>
<html>
<script src="https://fb.me/react-with-addons-15.1.0.js"></script>
<script src="https://fb.me/react-dom-15.1.0.js"></script>
<body>
<div id="myApp"></div>
<script type="text/javascript">
const rootElement = document.getElementById('myApp')
const message = React.createElement(
'span',
@lricoy
lricoy / plain-html.html
Last active February 5, 2018 23:41
Simple Plain JS/HTML create element
<!DOCTYPE html>
<html>
<body>
<div id="myApp"></div>
<script type="text/javascript">
const rootElement = document.getElementById('myApp')
const message = document.createElement('span')
message.className = 'stylish-message'
message.innerText = 'Simple HTML'
rootElement.appendChild(message)
import { Component } from '@angular/core';
import { NgbDateStruct, NgbDateParserFormatter } from '@ng-bootstrap/ng-bootstrap';
const now = new Date();
function toInteger(value: any): number {
return parseInt(`${value}`, 10);
}
function isNumber(value: any): value is number {
@lricoy
lricoy / gist:413150462eea3bfabee77a658a198aa0
Created August 24, 2017 17:04
Run remotedev as service
docker run -d -p 9999:9999 --name remotedev-service --env-file=remotedev.env --restart=unless-stopped jhen0409/remotedev-server

Keybase proof

I hereby claim:

  • I am lricoy on github.
  • I am lucasramos (https://keybase.io/lucasramos) on keybase.
  • I have a public key ASAF7DGSA4p6wiUF5XR4XchWw7RPYM36zdmYuyPf55gqCQo

To claim this, I am signing this object: