Skip to content

Instantly share code, notes, and snippets.

View FelipeSBarros's full-sized avatar

Felipe Sodré M. Barros FelipeSBarros

View GitHub Profile
@albert-decatur
albert-decatur / batch-geocode.sh
Created November 24, 2010 19:15
collection of BASH scripts for GIS
#!/bin/bash
#geocode a CSV file using both Google and Yahoo! APIs, send output to either KMl or ESRI Shapefile
# example Yahoo geocode request: http://where.yahooapis.com/geocode?q=950+main+street,+Worcester,+ma&appid=[yourappidhere]
# example Google geocode request: http://maps.googleapis.com/maps/api/geocode/xml?address=950+main+st,+worcester,+MA&sensor=true
# get working directory
WORKING_DIR=`pwd`
@seanlin
seanlin / helpers.py
Created November 17, 2011 06:48
Automatic geocoding in Django model
## Helper file to geocode address using Google Geocoder
import urllib, urllib2, simplejson
from django.utils.encoding import smart_str
def get_lat_lng(location):
# Reference: http://djangosnippets.org/snippets/293/
location = urllib.quote_plus(smart_str(location))
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 23, 2024 19:59
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@rxaviers
rxaviers / gist:7360908
Last active July 23, 2024 21:25
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@leobarone
leobarone / dilma_senado.R
Created August 29, 2016 14:12
Discurso da presidenta Dilma - Senado Federal 29/08/16
library(XML)
library(tm)
library(SnowballC)
library(wordcloud)
url <- "http://jota.uol.com.br/o-discurso-de-dilma-rousseff-no-julgamento-impeachment-no-senado"
pagina <- xmlRoot(htmlParse(readLines(url)))
texto_paragrafos <- xpathSApply(pagina, "//div[@class = 'first-letter']/p", xmlValue)
texto <- c()
for (i in 1:length(texto_paragrafos)){
# data from http://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/population-distribution-demography/geostat
# Originally seen at http://spatial.ly/2014/08/population-lines/
# So, this blew up on both Reddit and Twitter. Two bugs fixed (southern Spain was a mess,
# and some countries where missing -- measure twice, submit once, damnit), and two silly superflous lines removed after
# @hadleywickham pointed that out. Also, switched from geom_segment to geom_line.
# The result of the code below can be seen at http://imgur.com/ob8c8ph
library(tidyverse)
@nportinari
nportinari / pesquisas-eleitorais.ipynb
Last active June 14, 2020 23:30
Pesquisas eleitorais
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@darribas
darribas / networkW.ipynb
Last active June 23, 2021 03:07
Spatial Weights Matrices as bundled networks
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rg3915
rg3915 / README.md
Last active November 29, 2023 16:26
Django padrão de nomenclatura - singular plural

Escreva quase tudo no singular, é mais fácil.

  • project: singular
  • app: singular
  • model: singular
  • field: singular
  • FK related_name: plural
  • url: plural
  • views: singular
@nelsondev19
nelsondev19 / google_calendar_python.py
Last active July 8, 2022 14:37
Google Calendar API con Python
from os import path
import pickle
from google.auth.transport.requests import Request
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient.discovery import build
# IF YOU MODIFY THE SCOPE DELETE THE TOKEN.TXT FILE
SCOPES = ['https://www.googleapis.com/auth/calendar.events',
'https://www.googleapis.com/auth/calendar']