Skip to content

Instantly share code, notes, and snippets.

View andilabs's full-sized avatar
👨‍💻
still in love with coding!

Andrzej Kostanski andilabs

👨‍💻
still in love with coding!
View GitHub Profile
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.
#!/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')
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
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)
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))))
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
# 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
#!/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)
<?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"/>