Skip to content

Instantly share code, notes, and snippets.

View brunogarcia's full-sized avatar
📚
Always learning

Bruno brunogarcia

📚
Always learning
View GitHub Profile
I am attesting that this GitHub handle brunogarcia is linked to the Tezos account tz29WSy51ynZQ49YrQVZS2Ws4Ry4wPGQ4nNH for tzprofiles
sig:spsig15pmYEzTzwBt8v3KFJhdYuXANFSyFqWTrEZtu7GQLczb9bA6hgxfvASFL2fVAU1DjS8C5LJ73rSwQnc6wvGBkoExhZSySJ
@brunogarcia
brunogarcia / polling-typescript.ts
Last active August 31, 2022 14:32
Polling implementation in Typescript
type Fn<T> = (payload: any) => T
type PromiseFn<T> = () => Promise<T>
type Options = {
maxAttempts?: number,
timeout?: number,
delta?: number,
validate?: Fn<boolean> | null,
}
/**
@brunogarcia
brunogarcia / machine.js
Created December 2, 2021 09:18
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@brunogarcia
brunogarcia / es5-subclasses.js
Last active April 30, 2018 15:36
ES6/ES5 subclasses
// ### Psuedoclassical Subclassing ###
// This combines the name defined by `class` with the code defined in `constructor`:
function Tree(size, leaves) {
this.size = (typeof size === "undefined")? 10 : size;
const defaultLeaves = {spring: 'green', summer: 'green', fall: 'orange', winter: null};
this.leaves = (typeof leaves === "undefined")? defaultLeaves : leaves;
this.leafColor = null;
}
// The "instance" method:
- sudo apt-get update
- sudo add-apt-repository ppa:webupd8team/java
- sudo apt-get update
- sudo apt-get install oracle-java8-installer
- sudo update-alternatives --config java
- java -version
@brunogarcia
brunogarcia / codelite.md
Last active October 9, 2017 16:51
Codelite Configuration

Bin

  • Create bin folder
  • Go to Settings/General and update:
    • Output file: /bin/$(ProjectName)
    • Working directory: /bin
  • Test it!

Source

  • Delete main.c
  • Create source folder
@brunogarcia
brunogarcia / myComponent.scss
Created August 12, 2016 07:45
CSS Modules + composes
// myComponent.scss
.myStyle {
composes: some-helper from '_helpers.scss';
}
// _helpers.scss
.some-helper {
color: red
}
@brunogarcia
brunogarcia / Dev-tools-for-Ubuntu.sh
Last active November 23, 2021 10:41
Linux Front-end Tools
###############
# GIT
###############
sudo add-apt-repository -y ppa:git-core/ppa
sudo apt-get update
sudo apt-get install -y git
# Configuration
$ nano ~/.gitconfig
/*
Bower copy
Scrupulously manage file locations for bower dependencies.
https://www.npmjs.com/package/grunt-bowercopy
*/
'bowercopy': {
libs: {
options: {
destPrefix: '<%= config.dev %>/assets/js/vendors'
},
/*
FTP Deploy
Grunt task for code deployment over ftp
https://github.com/zonak/grunt-ftp-deploy
*/
'ftp-deploy': {
build: {
auth: {
host: 'ftp.TU_DOMINIO.com',
port: 21,