footer: @eloy, 2018 slidenumbers: true slidecount: 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
""" | |
Using Amazon S3 with filename to get data in string and convert to file object | |
then returning HTTP response from file object with mime type. | |
""" | |
import os | |
import mimetypes | |
from django.http import Http404, HttpResponse | |
from django.core.files.base import ContentFile | |
from django.core.files.storage import default_storage |
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
# template tag: {% url django.contrib.auth.views.password_reset_confirm uidb36=uidb36 token=token %} | |
from django.utils.http import int_to_base36 | |
from django.contrib.auth.tokens import default_token_generator | |
from django.contrib.auth.models import User | |
user = User.objects.get(pk=1) | |
context = { | |
'uidb36': int_to_base36(user.pk), | |
'token' = default_token_generator.make_token(user), |
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 dfs(graph, start, result=[]): | |
""" | |
Depth First Search | |
Follow each path in depth until | |
there are no more unvisted nodes. | |
Then reverse until we find an unvisited | |
node and continue to the depth of that path. | |
Repeat until there are no more unvisted nodes. | |
""" |
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
""" | |
This sample demonstrates a simple skill built with the Amazon Alexa Skills Kit. | |
The Intent Schema, Custom Slots, and Sample Utterances for this skill, as well | |
as testing instructions are located at http://amzn.to/1LzFrj6 | |
For additional samples, visit the Alexa Skills Kit Getting Started guide at | |
http://amzn.to/1LGWsLG | |
""" | |
from __future__ import print_function | |
from random import randint |
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/env python3.5 | |
# Brzycki in Python | |
# 1 Rep Max Formula | |
def brzycki(weight, reps): | |
"""One rep max formula based on weight.""" | |
return int(weight) * (36 / (37 - int(reps))) |
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
function CheckTestForm (intTryNum) { | |
var strSessionTime; | |
if (blnSubmitClicked) { | |
return; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.js"></script> | |
<script src="http://builds.emberjs.com.s3.amazonaws.com/tags/v1.0.0/ember.js"></script> | |
<meta charset=utf-8 /> | |
<script src="https://bitbucket.org/cetir/catcher/raw/0199a325eb50128dbf68c4e6a90af87efd3cc8ae/static/catcher/js/data.utils.js"></script> | |
<title>JS Bin</title> | |
</head> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-latest.js"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.js"></script> | |
<script src="http://builds.emberjs.com.s3.amazonaws.com/tags/v1.0.0/ember.js"></script> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
</head> |
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
""" | |
pip install fake-factory | |
""" | |
from faker import Faker | |
fake = Faker() | |
with open('location.csv', 'wb') as f: |
NewerOlder