This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import template | |
import re | |
register = template.Library() | |
@register.simple_tag | |
def youtube_embed(video): | |
YOUTUBE_REGEX = r'(https?://)?(www\.)?(youtube|youtu|youtube-nocookie)\.(com|be)/(watch\?v=|embed/|v/|.+\?v=)?([^&=%\?]{11})' | |
def _get_id(video): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import itertools | |
def get_provinces(): | |
data = requests.post('https://afiliate.psoe.es/Resource/GetProvinces') | |
return data.json() | |
def get_municipalities(province): | |
_id = province.get('Id') | |
data = requests.post('https://afiliate.psoe.es/Resource/GetMunicipalities', params = {'idProvince': _id}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put this snippet in your .bash_rc | |
if [ -f /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-completion.bash ]; then | |
. /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-completion.bash | |
fi | |
source /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-prompt.sh | |
PS1='\h:\W $(__git_ps1 "(%s)") \u$ ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
info = { | |
'seats' => 85, | |
'votes' => { | |
'psc' => 420623, | |
'jxsi' => 1107398, | |
'cup' => 254246, | |
'cs' => 579850, | |
'csqep' => 311612, | |
'pp' => 272280 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import multiprocessing | |
import os | |
import requests | |
BASE_URL = 'http://www.bigozine2.com/{folder}/GHlondon/GHlondon{song_id}.mp3' | |
SONGS = { | |
110: 'I Want To Tell You', | |
111: 'Old Brown Shoe', | |
112: 'Taxman', |