Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
from apiclient.discovery import build | |
from django.conf import settings | |
def translate(word, from_l, to_l): | |
if isinstance(word, unicode) is False: | |
word = unicode(word, 'utf-8') |
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
rm -rf accounts/migrations | |
rm -rf core/migrations | |
rm -rf www/migrations | |
# rm -rf ~/.virtualenvs/spots/lib/python2.7/site-packages/easy_thumbnails/migrations/ | |
# rm -rf ~/.virtualenvs/spots/lib/python2.7/site-packages/easy_thumbnails/south_migrations/ | |
# python manage.py schemamigration easy_thumbnails --initial --settings=mbf.settings.andi | |
python manage.py schemamigration accounts --initial --settings=mbf.settings.andi | |
python manage.py schemamigration core --initial --settings=mbf.settings.andi |
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 qrcode | |
import qrcode.image.svg | |
img = qrcode.make('http://', image_factory=qrcode.image.svg.SvgImage) | |
with open('/Users/andi/dupa.svg', 'w') as f: | |
img.save(f) | |
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
def nearby_spots_old(request, lat, lng, radius=5000, limit=50): | |
""" | |
WITHOUT use of any external library, using raw MySQL and Haversine Formula | |
http://en.wikipedia.org/wiki/Haversine_formula | |
""" | |
radius = float(radius) / 1000.0 | |
query = """SELECT id, (6367*acos(cos(radians(%2f)) | |
*cos(radians(latitude))*cos(radians(longitude)-radians(%2f)) | |
+sin(radians(%2f))*sin(radians(latitude)))) |
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
export CFLAGS=-Qunused-arguments | |
export CPPFLAGS=-Qunused-arguments |
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
# You may want to call this something more specific - for example, in | |
# Latter, this is called 'GameModal' | |
class ApplicationModal | |
constructor: (options) -> | |
@options = $.extend { | |
header: 'Modal Heading' | |
content: '' | |
open_now: true |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import MySQLdb | |
dir_texts = 'raw_text_gumtree_opis' | |
def write_to_file(with_name, write_this): | |
with_name = dir_texts +"/"+ str(with_name) | |
with open(with_name, "w") as F: | |
F.write(write_this) |
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
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<process version="5.3.015"> | |
<context> | |
<input/> | |
<output/> | |
<macros/> | |
</context> | |
<operator activated="true" class="process" compatibility="5.3.015" expanded="true" name="Process"> | |
<parameter key="logverbosity" value="init"/> | |
<parameter key="random_seed" value="2001"/> |