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
Verifying that "emile.id" is my Blockstack ID. https://explorer.blockstack.org/name/emile.id |
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
Verifying my Blockstack ID is secured with the address 1N2QRLQj5RzuivZF3ivTRAbNadQL5WZYuR https://explorer.blockstack.org/address/1N2QRLQj5RzuivZF3ivTRAbNadQL5WZYuR |
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
from cStringIO import StringIO | |
@register.simple_tag | |
def thumbnail(image_url, width, height, quality=95): | |
""" | |
Given the URL to an image, resizes the image using the given width and | |
height on the first time it is requested, and returns the URL to the new | |
resized image. if width or height are zero then original ratio is | |
maintained. | |
""" | |
if not image_url: |
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
#define LED_PIN 13 | |
void setup () { | |
pinMode (LED_PIN, OUTPUT); // enable pin 13 for digital output | |
} | |
void loop () { | |
digitalWrite (LED_PIN, HIGH); // turn on the LED | |
delay (1000); // wait one second (1000 milliseconds) | |
digitalWrite (LED_PIN, LOW); // turn off the LED |
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
class ConvertError(ValueError): | |
message = 'Whoops - one of the values you entered cannot be converted to something that will work for these calculations. Try this again.' | |
class BadStuff(BaseException): | |
message = 'Something went wrong with this calculation. Maybe try passing in new values.' | |
class Zero(ZeroDivisionError): | |
message = 'Yeah, dividing with a 0 in the mix does not work.' |
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
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> | |
<script src="http://cdn.simplegeo.com/js/1.2/simplegeo.all.jq.min.js"></script> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
var client = new simplegeo.ContextClient('JSON_TOKEN'); //json code of simple geo | |
$(document).ready(function() { | |
var lat,lon, callback; |
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
<form action="{% url like_picture %}" method="post" accept-charset="utf-8" class="likeform">{% csrf_token %} | |
<input type="hidden" value="{{picture.id}}" name="id"/> | |
<button type="submit" id="like">Like Photo</button> | |
</form> |
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
def picture(request, picture_search, template_name="picture/picture.html"): | |
picture = get_object_or_404(Picture, cleaned_title=picture_search) |
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
def like_picture(request): | |
picture_id = request.POST.get('id', False) | |
picture = get_object_or_404(Picture, id=picture_id) | |
if picture.user == request.user: | |
return HttpResponseRedirect(reverse('home')) |
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
import xlrd, xlwt | |
from xlutils.copy import copy | |
import time | |
from simplegeo import Client, json, APIError | |
#from multiprocessing.pool import ThreadPool as Pool | |
from multiprocessing import Pool | |
client = Client('SbAc87cM7EK2qCvmjymQtXU66MdXGNPr','CNmJaCEGGY3V7Tq3NEJsvNJCdJZjvgfN') |
NewerOlder