Skip to content

Instantly share code, notes, and snippets.

View daniellima's full-sized avatar
🙂

Daniel Lima dos Santos daniellima

🙂
  • Lisbon, Portugal
View GitHub Profile
@daniellima
daniellima / trello2sheets.gs
Last active September 11, 2018 14:21
An example of using Trello API to fill data in Google Sheets
/** CONSTANTS **/
var BOARD_ID = "XXX";
var APP_KEY = "XXX";
var USER_TOKEN = "XXX";
var NO_LABEL_CATEGORY_NAME = 'No label'
var LIST_2_ID = "XXX"
var LIST_1_ID = "XXX"
// Add a new menu to trigger the sheet update
function onOpen() {
@daniellima
daniellima / .Git Live Refresh
Last active May 26, 2018 20:54
Snippets to show git info live while you execute git commands. Good for demonstration
Snippets to show git info live while you execute git commands. Good for demonstration
@daniellima
daniellima / main.go
Created October 30, 2017 11:10
Experiment to learn how go handle Unicode
package main
import (
"fmt"
"io/ioutil"
"strings"
)
func main() {
@daniellima
daniellima / decorator.py
Created February 10, 2017 12:49
Alternative to the login_required of Django for use in AJAX APIs
from django.http import HttpResponse
def ajax_aware_login_required(f):
def decoration(request):
if request.user.is_authenticated:
return f(request)
else:
return HttpResponse(status=401)
@daniellima
daniellima / .easer_route_generator.php
Created April 22, 2016 23:42
Vc pode usar então {{ ProcessoController::getAddURL(1,2) }}
// Vc pode usar então {{ ProcessoController::getAddURL(1,2) }}
// e será o equivalente à {{ action('ProcessoController@getAdd', array(1, 2)) }}
// 15 caracteres a menos
// Não é possivel errar o nome do controller, e ele pode ser autocompletado
public static function __callStatic($name, $arguments)
{
if(substr($name, -3) == "URL"){
$actionName = substr($name, 0, -3);
@daniellima
daniellima / .Laravel Trusted Host Middleware
Last active March 28, 2016 18:55
A middleware to avoid opening your site to be accessed by arbitrary domains
A middleware to avoid opening your site to be accessed by arbitrary domains
@daniellima
daniellima / .Vue.js Code
Last active March 28, 2016 18:52
Vue.js code, made in a prototype project. Saved here just for remembering
Vue.js code, made in a prototype project. Saved here just for remembering
@daniellima
daniellima / .Laravel Alternative way of view data passing
Last active March 28, 2016 18:55
A controller that allows you to pass data to views using the controller instance variables
A controller that allows you to pass data to views using the controller instance variables
@daniellima
daniellima / .Laravel Date Utils
Last active March 28, 2016 18:48
A collection of things that can be done to make handling dates in Laravel much easier (if you deal with date formats that are not english)
A collection of things that can be done to make handling dates in Laravel much easier (if you deal with date formats that are not english)
@daniellima
daniellima / .Laravel Excel Exporter with CSV support
Last active March 28, 2016 18:54
LaravelExcel modifications to output CSV files with BOM and a helper class to abstract it
LaravelExcel modifications to output CSV files with BOM and a helper class to abstract it