Skip to content

Instantly share code, notes, and snippets.


Thiago Magalhães lagden

View GitHub Profile
lagden / pkg-cli.js
Last active January 20, 2021 14:01
Update all dependencies and devDependencies to latest version in package.json
View pkg-cli.js
#!/usr/bin/env node
'use strict'
const {resolve} = require('path')
const {createWriteStream} = require('fs')
const {promisify} = require('util')
const child_process = require('child_process')
const exec = promisify(child_process.exec)
lagden / a.mjs
Created August 3, 2018 20:00
ECMAScript Modules (import/export)
View a.mjs
const a = 'a'
export default a
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1">
<link href="./agrega/main.css" rel="stylesheet" type="text/css">
<!-- Folha de estilo do iframe do Nimble + FormAgrega -->
lagden / data.sql
Last active November 28, 2017 03:51
Using mysql module
View data.sql
-- MySQL dump 10.13 Distrib 5.7.16, for osx10.11 (x86_64)
-- Host: localhost Database: consulta_veiculo
-- ------------------------------------------------------
-- Server version 5.7.16
/*!40101 SET NAMES utf8 */;
lagden /
Created August 22, 2017 06:14
TypeScript + RxJS + Closure Compiler setup

I'm just going to make a note of this for Future Paul, because I spent way too long trying to get this working. If anyone has a better version of this workflow let me know.

Here's the rough idea:

  1. Have some TypeScript
  2. With some RxJS. Only include the bits of RxJS that we actually need because bundle sizes.
  3. Combine to a bundle using Closure Compiler (because it's super good at crushing down JS).

Because Future Paul will want it, here's the installs needed:

lagden / counter-mobx-react.js
Created January 21, 2017 01:56
Test react mobx state animation
View counter-mobx-react.js
import React, {Component} from 'react'
import {render} from 'react-dom'
import {TweenMax, Linear} from 'gsap'
import RoundPropsPlugin from 'gsap/RoundPropsPlugin'
import {observable, action, useStrict} from 'mobx'
import {observer} from 'mobx-react'
import DevTools from 'mobx-react-devtools'
lagden / server.js
Created November 10, 2016 06:23
Puro Server - Node.js
View server.js
'use strict'
const fs = require('fs')
const path = require('path')
const http = require('http')
const url = require('url')
const crypto = require('crypto')
const mimeTypes = require('mime-types')
const debug = require('debug')
lagden / index.jade
Created August 10, 2016 15:44
View index.jade
input.switchSlide__radio-0#concessionaria_0(name='concessionaria' type='radio' value='0' required)
input.switchSlide__radio-1#concessionaria_1(name='concessionaria' type='radio' value='1' required)
label(for='concessionaria_0') Não
label(for='concessionaria_1') Sim
lagden / for1.js
Last active August 1, 2016 20:56
Benchmark cache length
View for1.js
function for1() {
'use strict';
const a = [];
for (let i = 0; i < 9999999; i++) {
for (let c = 0; c < 1e3; c++) {
View gist:522be64213455c25ceaf
<svg preserveAspectRatio="xMinYMin" version="1.1" xmlns="" xmlns:xlink=""
viewBox="0 0 560 1388">
<mask id="canTopMask">
<image width="560" height="1388" xlink:href="img/can-top-alpha.png"></image>
<image mask="url(#canTopMask)" id="canTop" width="560" height="1388" xlink:href="can-top.jpg"></image>