Skip to content

Instantly share code, notes, and snippets.

Paulo Diovani Gonçalves paulodiovani

Block or report user

Report or block paulodiovani

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@paulodiovani
paulodiovani / Gemfile
Last active Jun 8, 2018
Arrange Matrix by Diagonals -- OMG
View Gemfile
source 'https://rubygems.org'
gem 'rspec'
@paulodiovani
paulodiovani / using_async_await.js
Last active Apr 25, 2018
Example of progressive rollback
View using_async_await.js
/*
* Example of handling promises with progressive rollback
* Usage: node using_async_await.js 5
*/
// await doesn't work in global scope, must wrap
(async function() {
const errored = process.argv[2] //get from command line argument
function timeout(ms) {
@paulodiovani
paulodiovani / excuses.txt
Created Apr 19, 2018 — forked from fortytw2/excuses.txt
programming excuses
View excuses.txt
Actually, that's a feature
Don't worry, that value is only wrong half of the time
Even though it doesn't work, how does it feel?
Everything looks fine my end
How is that possible?
I broke that deliberately to do some testing
I can have a look but there's a lot of if statements in that code!
I can't make that a priority right now
I can't test everything
I couldn't find any examples of how that can be done anywhere else in the project
@paulodiovani
paulodiovani / fate_rpg_schools_of_magic.md
Last active Mar 13, 2018
Escolas de Magia é um sistema simples para usar magias em jogos FATE Core.
View fate_rpg_schools_of_magic.md

Escolas de Magia

Notas de Design

Escolas de Magia é um sistema simples para usar magias em jogos FATE Core e voltado principalmente para cenários de fantasia medieval. Ele é inspirado em sistemas de outros jogos FATE, incluindo as regras de Stormcallers do FATE System Toolkit e Dresden Files Accelerated.

Ela depende da nova perícia Canalizar e pelo menos um Aspecto, custa 2 pontos

@paulodiovani
paulodiovani / csd-wrapper.sh
Created Jan 17, 2018 — forked from l0ki000/csd-wrapper.sh
Cisco Anyconnect CSD wrapper for OpenConnect (exhanced to autodownload and autoupdate hostscan)
View csd-wrapper.sh
#!/bin/bash
# Cisco Anyconnect CSD wrapper for OpenConnect
# Enter your vpn host here
CSD_HOSTNAME=
if [[ -z ${CSD_HOSTNAME} ]]
then
echo "Define CSD_HOSTNAME with vpn-host in script text. Exiting."
exit 1
fi
@paulodiovani
paulodiovani / npm-5-benchmarks.md
Last active May 31, 2017
npm Vs yarn time comparison
View npm-5-benchmarks.md

NPM@5 Vs Yarn

  npm install yarn install
clean install (no cache) 10.80s 6.93s
cached 7.82s 4.89s
cached and lockfile present 5.43s 2.10s
cached and node_modules present 2.22s 4.18s
cached, lockfile and node_modules present 2.07s 0.67s
View .env.example
GCLOUD_PROJECT_ID=
GCLOUD_KEY_FILENAME=
QUANTITY=3
RESOLUTION=1024/576
View magic_in_dfrpg.md

💡 Update: Nova versão em http://blog.diovani.com/tabletop-games/2017/01/26/magic-in-dresden-files-rpg.html

Magia em Dresden Files RPG

Prometi fazer um resumo dos sistemas de magia no DFRPG para auxiliar meu grupo. Vou tentar ser bem breve, para permitir um leitura e entedimento rápido.

Obviamente, para entender como funcionam os testes é necessário conhecer as regras do FATE RPG, mais precisamente como são realizados os testes em conflitos, por isso vou fazer um resumo breve das regras antes, assim como como funcionam os níveis de armas e armaduras.

Conteúdo

@paulodiovani
paulodiovani / promise-from-callback.js
Last active Jul 29, 2016
Callback to promise example
View promise-from-callback.js
'use strict';
const Http = require('http');
Promise.resolve() //upper promise
.then(() => {
//wrapping promise for resolving
//callbacks
return new Promise((resolve, reject) => {
@paulodiovani
paulodiovani / promise-chain.js
Created Jul 29, 2016
Promise chain example
View promise-chain.js
'use strict';
new Promise((resolve, reject) => {
//resolve after 1 sec
setTimeout(() => {
resolve('chain 1');
}, 1000);
})
You can’t perform that action at this time.