-
Install redis on OSX (10.7) Lion I used:
$ brew install redis
-
In the project and virtualenv I wanted to use django-celery in I installed the following.
This file contains hidden or 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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Mathieu 'p01' Henri - http://www.p01.org/releases/ | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
This file contains hidden or 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
# https://gist.github.com/1776202 | |
from os.path import join | |
from django.http import HttpResponse | |
from django.views.static import serve | |
from django.conf import settings | |
USE_X_ACCEL_REDIRECT = getattr(settings, 'USE_X_ACCEL_REDIRECT', False) | |
X_ACCEL_REDIRECT_PREFIX = getattr(settings, 'X_ACCEL_REDIRECT_PREFIX', '') |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
from django import forms | |
from crispy_forms.helper import FormHelper | |
from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field | |
from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions | |
class MessageForm(forms.Form): | |
text_input = forms.CharField() |
This file contains hidden or 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
brew update | |
brew versions FORMULA | |
cd `brew --prefix` | |
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions" | |
brew install FORMULA | |
brew switch FORMULA VERSION | |
git checkout -- Library/Formula/FORMULA.rb # reset formula | |
## Example: Using Subversion 1.6.17 | |
# |
This file contains hidden or 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
600##GSM/DCS#Asignado#VODAFONE ESPAÑA, S.A.U.#19/11/1998 | |
601#0# #Compartido#TENARIA, S.A.#19/10/2007 | |
601#0#GSM#Asignado#CABLEUROPA, S.A.U.#24/05/2007 | |
601#1# #Compartido#TENARIA, S.A.#19/10/2007 | |
601#1#GSM#Asignado#CABLEUROPA, S.A.U.#24/05/2007 | |
601#2# #Compartido#TENARIA, S.A.#19/10/2007 | |
601#2#GSM#Asignado#CABLEUROPA, S.A.U.#24/05/2007 | |
601#6# #Subasignado 0,1,2,3,4,5,6,7,8,9#LEAST COST ROUTING TELECOM, S.L.#22/02/2012 | |
601#6#Sin definir#Asignado#FRANCE TELECOM ESPAÑA, S.A. UNIPERSONAL#22/02/2012 | |
602#1#Sin definir#Asignado#LYCAMOBILE, S.L.#20/12/2011 |
This file contains hidden or 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
(function(d) { | |
var dl = d.createElement('a'); | |
dl.innerText = 'Download MP3'; | |
dl.href = "http://media.soundcloud.com/stream/"+d.querySelector('#main-content-inner img[class=waveform]').src.match(/\.com\/(.+)\_/)[1]; | |
dl.download = d.querySelector('em').innerText+".mp3"; | |
d.querySelector('.primary').appendChild(dl); | |
dl.style.marginLeft = '10px'; | |
dl.style.color = 'red'; | |
dl.style.fontWeight = 700; | |
})(document); |
This file contains hidden or 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
#!/usr/bin/env python | |
from lxml.html.clean import Cleaner | |
from lxml.html import defs | |
class AttrWhitelistCleaner(Cleaner): | |
"""An HTML Cleaner that can use an attribute whitelist. Defaults to using | |
the attributes that are whitelisted by default with ``safe_attrs_only`` | |
turned on.""" | |
def __init__(self, **kw): |
This file contains hidden or 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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
This file contains hidden or 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
function fetchSongInfo(track) { | |
info('Getting song info for ' + track.name + ' by ' + track.artists[0].name); | |
var url = 'http://developer.echonest.com/api/v4/track/profile?api_key=N6E4NIOVYMTHNDM8J&callback=?'; | |
var track_id = fromSpotify(track.uri); | |
$.getJSON(url, { id: track_id, format:'jsonp', bucket : 'audio_summary'}, function(data) { | |
if (checkResponse(data)) { | |
info(""); | |
showTrackInfo(data.response.track); | |
fetchAnalysis(data.response.track); |