Skip to content

Instantly share code, notes, and snippets.

View krolow's full-sized avatar

Vinícius Krolow krolow

View GitHub Profile
@krolow
krolow / brasileirao-ical.js
Last active August 25, 2016 02:04
Brasileirao em node.js
var request = require('request');
var Handlebars = require('handlebars');
var crypto = require('crypto');
var CHAMPIONSHIP_URL = 'https://webtask.it.auth0.com/api/run/wt-krolow-gmail_com-0/brasileirao?serie=%serie%';
function fetchChampionship (serie) {
return new Promise(function (resolve, reject) {
@krolow
krolow / Readme.md
Created August 15, 2016 17:21 — forked from rauchg/Readme.md

Minimum Viable Async with Node 6

With the release of Node 6.0.0, the surface of code that needs transpilation to use ES6 features has been reduced very dramatically.

This is what my current workflow looks like to set up a minimalistic and fast microservice using micro and async + await.

The promise

@krolow
krolow / Meta.php
Created December 2, 2012 16:45
PHP Adding method dynamically, meta programming example in PHP 5.3
<?php
/**
* Example in PHP 5.3
*/
class Meta
{
private $methods = array();
public function addMethod($methodName, $methodCallable)
@krolow
krolow / .git-commit-template.txt
Last active May 23, 2016 03:45
Git template
# [Title] Capitalized, short (50 chars or less) summary, write message in imperative
# [Body] Detailed explanation (72 chars or less), can make usage of markdow, bullet lists...
# [Number/Ticket/Issue] References to issues solved
@krolow
krolow / PHP_Exceptions.md
Last active December 12, 2015 04:08
PHP Exceptions

BadFunctionCallException

Exception thrown if a callback refers to an undefined function or if some arguments are missing.

BadMethodCallException

Exception thrown if a callback refers to an undefined method or if some arguments are missing.

DomainException

h1, h2, h3, h4, h5, h6 {
font-family: 'OfficinaSerifStd-Bold', 'Baskerville', 'Cambria', 'Constantia', 'Palatino Linotype', 'Palatino', 'Georgia', 'Times', 'Times New Roman', serif;
font-weight: bold;
color: rgb(51, 51, 51);
line-height: 30px;
}
p {
margin: 15px 0;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 14px;
@krolow
krolow / qa.sh
Created December 10, 2012 13:55
Quality Assurance PHP
#!/bin/bash
echo "======================================================================================="
echo "Fixing code standard"
echo "======================================================================================="
php-cs-fixer fix $PWD/src/
echo "Ok done ;)"
echo ""
echo "======================================================================================="
echo "Lets see the mess in our code"
echo "======================================================================================="
@krolow
krolow / FacebookCake.php
Created May 14, 2012 16:54
Facebook Cake bridge
<?php
if (!session_id()) { session_start(); }
App::import('Vendor', 'Facebook');
class FacebookCake
{
public function __construct($name = '')
{