Skip to content

Instantly share code, notes, and snippets.

View eloyz's full-sized avatar
🎯
Focusing

Eloy Zuniga Jr. eloyz

🎯
Focusing
View GitHub Profile
@eloyz
eloyz / django_file_response.py
Created September 17, 2012 20:41
Python String to Django File Object
"""
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
@eloyz
eloyz / pw_reset_link.py
Created September 15, 2011 17:39
Create Password Reset Link in Django
@eloyz
eloyz / value-investing-tesla.md
Last active March 1, 2018 14:42
Value Investing Tesla Presentation

footer: @eloy, 2018 slidenumbers: true slidecount: true

Value Investing - Tesla

TSLA: 343.06

@eloyz
eloyz / basic_search_algorithms.py
Last active September 16, 2017 02:12
Depth First Search and Breath First Search Algorithm http://youtu.be/zLZhSSXAwxI
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.
"""
@eloyz
eloyz / code.py
Created December 5, 2016 16:08
Alexa Skill: Math Drills
"""
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
@eloyz
eloyz / brzycki.py
Created September 26, 2016 15:43
Weightlifting: One rep max based on weight and repetitions
#!/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)))
function CheckTestForm (intTryNum) {
var strSessionTime;
if (blnSubmitClicked) {
return;
<!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>
<!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>
@eloyz
eloyz / make_locations.py
Created November 5, 2013 20:32
Make a CSV file with 100 random locations
"""
pip install fake-factory
"""
from faker import Faker
fake = Faker()
with open('location.csv', 'wb') as f: