Skip to content

Instantly share code, notes, and snippets.

View fchevitarese's full-sized avatar

Frederico Rodrigues Chevitarese fchevitarese

View GitHub Profile
@fchevitarese
fchevitarese / Pessoa.py
Created February 13, 2016 11:21
Cria objetos à partir de uma tupla com os dados do mesmo.
from collections import namedtuple
Pessoa = namedtuple('Pessoa', 'nome idade flag')
pessoas = [('João', 32, False), ('Maria', 21, False), ('Paulo', 50, True)]
pessoas = (Pessoa(*p) for p in pessoas)
print(list(pessoas))
@fchevitarese
fchevitarese / html_for_international_calling coes.htm
Created January 13, 2016 01:25 — forked from andyj/html_for_international_calling coes.htm
HTML <select> international calling codes for each country
<!-- country codes (ISO 3166) and Dial codes. -->
<select name="countryCode" id="">
<option data-countryCode="GB" value="44" Selected>UK (+44)</option>
<option data-countryCode="US" value="1">USA (+1)</option>
<optgroup label="Other countries">
<option data-countryCode="DZ" value="213">Algeria (+213)</option>
<option data-countryCode="AD" value="376">Andorra (+376)</option>
<option data-countryCode="AO" value="244">Angola (+244)</option>
<option data-countryCode="AI" value="1264">Anguilla (+1264)</option>
<option data-countryCode="AG" value="1268">Antigua &amp; Barbuda (+1268)</option>
@fchevitarese
fchevitarese / git-dropbox-fix.sh
Created January 9, 2016 09:31 — forked from hasantayyar/git-dropbox-fix.sh
Solution if you are using dropbox and git same time and if you get this error "fatal: Reference has invalid format: refs/heads/master conflicted copy"
find . -type f -name "* conflicted copy*" -exec rm -f {} \;
awk '!/conflicted/' .git/packed-refs > temp && mv temp .git/packed-refs
$scope.checkAll = function(){
if ($scope.selectedAll) {
$scope.selectedAll = true;
}
else {
$scope.selectedAll = false;
}
angular.forEach($scope.questionnaires, function(form) {
form.selected = $scope.selectedAll;
@fchevitarese
fchevitarese / install_monaco_font.sh
Created December 29, 2015 15:47 — forked from rogerleite/install_monaco_font.sh
Install Monaco font in Linux
#!/bin/bash
#script extraido de: http://paulocassiano.wordpress.com/2008/08/29/deixando-o-gedit-com-a-cara-do-textmate/
#tip for better "resolution" here: http://blog.siverti.com.br/2008/05/22/fonte-monaco-no-ubuntugedit/
cd /usr/share/fonts/truetype/
#TODO: put validation if folder already exists
sudo mkdir ttf-monaco
@fchevitarese
fchevitarese / main.js
Created December 17, 2015 21:14
error.js
$scope.test_data = [
{"nome": "Fred Chevitarese", "email": "fchevitarese@gmail.com", "plano": "OnDemand"},
{"nome": "Datagoal", "email": "daniel@datagoal.com.br", "plano": "OnDemand"},
{"nome": "Fulano", "email": "fulano@somemail.com", "plano": "Free"},
{"nome": "Siclano", "email": "siclano@somemail.com", "plano": "Free"},
{"nome": "Beltrano", "email": "beltrano@somemail.com", "plano": "Free"},
]
};
@fchevitarese
fchevitarese / base.html
Created November 21, 2015 15:07
index.html
<!DOCTYPE html>
<html ng-app="CVCuidar">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Cuidar - Lista de contatos</title>
<link rel="stylesheet" href="{{ STATIC_URL }}node_modules/bootstrap/dist/css/bootstrap.min.css">
{% block extrahead %}
<html>
<title>Test D3js</title>
<head>
<script src="{{ STATIC_URL}}datagoal/node_modules/d3/d3.min.js" charset="utf-8"></script>
<script>
define(['d3', 'wq/pandas'], function(d3, pandas) {
pandas.get('/static/datagoal/node_modules/df1.csv', render);
function render(error, data) {
d3.select('svg')
@fchevitarese
fchevitarese / asterisk.py
Created November 17, 2015 10:20 — forked from jfinstrom/asterisk.py
Example of using the Asterisk Manager API in python...
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# asterisk.py
#
# Copyright 2014 James Finstrom<jfinstrom at gmail>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@fchevitarese
fchevitarese / reporter.py
Created November 6, 2015 15:44
reporter.py
# coding=utf-8
import numpy
import pandas as pd
from user.models import User
from form.models import Form
from ..models import Harvest