Skip to content

Instantly share code, notes, and snippets.

View vinicius73's full-sized avatar
🤓
"Those who cannot acknowledge themselves, will eventually fail."

Vinicius Reis vinicius73

🤓
"Those who cannot acknowledge themselves, will eventually fail."
View GitHub Profile
@vinicius73
vinicius73 / post.md
Created November 22, 2016 12:26
["LÓGICA DE PROGRAMAÇÃO" É BOBAGEM, e explicarei porquê.]

#["LÓGICA DE PROGRAMAÇÃO" É BOBAGEM, e explicarei porquê.]

Se preparem que o texto é longo.

Várias vezes chegam novatos aqui perguntando como começar, e a galera diz "estuda lógica primeiro, depois vai pra linguagem X". Vivo dizendo que é bobagem. Ontem, em particular, falei isso, e vieram várias pessoas por inbox me perguntar porquê (e uma pra me xingar, achando que falei por arrogância).

Pra facilitar, eu vou escrever uma boa explicação de porquê "lógica de programação" é furada, doa a quem doer, e postar na APDA e no fórum da EnergyLabs (para futuras referências, porque esse assunto vai voltar, ctz).

@vinicius73
vinicius73 / async-examples.js
Created October 21, 2016 09:58 — forked from developit/async-examples.js
Async Array utilities in async/await. Now available as an npm package: https://github.com/developit/asyncro
/** Async version of Array.prototype.reduce()
* await reduce(['/foo', '/bar', '/baz'], async (acc, v) => {
* acc[v] = await (await fetch(v)).json();
* return acc;
* }, {});
*/
export async function reduce(arr, fn, val, pure) {
for (let i=0; i<arr.length; i++) {
let v = await fn(val, arr[i], i, arr);
if (pure!==false) val = v;
@vinicius73
vinicius73 / perfectelementary.bash
Created October 18, 2016 03:51
HowTo Install the perfect Elementary-OS
#Download Elementary OS from here:
#http://sourceforge.net/projects/elementaryos/files/stable/
#First you update your system
sudo apt-get update && sudo apt-get dist-upgrade
#Install Google Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
@vinicius73
vinicius73 / an-component.vue
Created October 1, 2016 18:41
Helpers to filter collections
<script>
// an component
import { orderBy, isEmpty } from 'lodash';
import filterByName from '../helpers/filters/by-name';
// omit
computed: {
listOrdened() {
const { orderBy as by, order } = this.configs;
<script>
import UseModal from './shared/modal/UseModalMixin.js';
export default {
mixins: [UseModal],
};
</script>
<template>
<modal size="md" v-ref:modal>
<script>
import { defaultsDeep, forEach, has, set } from 'lodash';
import { loadAddGrids, setAvgGrid } from './helpers/grids';
import defaults from './defaults/index.js';
import applyCustomValuesInC3Instanse from './helpers/apply-custom-values-in-c3-instanse.js';
import formatTooltipValue from './helpers/format-tooltip-value';
const charts = {};
export default {
@vinicius73
vinicius73 / modal.vue
Created September 4, 2016 23:48
Bootstrap modal with vue
<script>
const INSTANCE = {};
export default {
data() {
const instance = Symbol('modal');
return { instance };
},
ready() {
INSTANCE[this.instance] = jQuery(this.$els.modal);
<?php
use Illuminate\Database\Seeder;
use App\Domains\ActLogs\ActLog;
use App\Domains\Finance\Account;
class LogsTableSeeder extends Seeder
{
/**
* Run the database seeds.
@vinicius73
vinicius73 / atom.md
Last active July 13, 2020 21:44
My default Atom packages and theme