Skip to content

Instantly share code, notes, and snippets.

Avatar

Eloy Zuniga Jr. eloyz

View GitHub Profile
@eloyz
eloyz / value-investing-tesla.md
Last active Mar 1, 2018
Value Investing Tesla Presentation
View value-investing-tesla.md

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

Value Investing - Tesla

TSLA: 343.06

@eloyz
eloyz / code.py
Created Dec 5, 2016
Alexa Skill: Math Drills
View code.py
"""
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 Sep 26, 2016
Weightlifting: One rep max based on weight and repetitions
View brzycki.py
#!/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)))
@eloyz
eloyz / json_with_uuid_support.py
Last active Nov 6, 2015
JSON with UUID serialization support
View json_with_uuid_support.py
from utils import json
from uuid import uuid4
json.dumps({'id': uuid4()})
@eloyz
eloyz / uri.js
Last active Aug 29, 2015 — forked from jlong/uri.js
URI Parsing with Javascript
View uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@eloyz
eloyz / is_none.py
Last active Aug 29, 2015
Function that tests if all values in dictionary are a None type object
View is_none.py
def is_none(d):
"""Returns True if dictionary contains
all None type objects
"""
for i in d.itervalues():
if i is not None:
return False
return True
@eloyz
eloyz / download_image.py
Last active Aug 29, 2015
A script that downloads images. Script was design with the intent of teaching basic Python programming skills
View download_image.py
import os
import StringIO
# import the request module
import requests
from PIL import Image
# Storing the image URL in a constant variable
IMAGE_URL = 'http://www.distractify.netdna-cdn.com/wp-content/uploads/2014/08/slugsolos-1-620x.jpg'
View .gitconfig
# Alternatively don't use slog but something else. I just like that more.
[alias]
slog = log --pretty=format:"%C(auto,yellow)%h%C(auto)%d\\ %C(auto,reset)%s\\ \\ [%C(auto,blue)%cn%C(auto,reset),\\ %C(auto,cyan)%ar%C(auto,reset)]"
addprx = "!f() { b=`git symbolic-ref -q --short HEAD` && \
git fetch origin pull/$1/head:pr/$1 && \
git fetch -f origin pull/$1/merge:PR_MERGE_HEAD && \
git rebase --onto $b PR_MERGE_HEAD^ pr/$1 && \
git branch -D PR_MERGE_HEAD && \
git checkout $b && echo && \
git diff --stat $b..pr/$1 && echo && \
View tendenci-plugin-pypi-stats.sh
# https://warehouse.python.org/project/pypi-cli/
$ sudo pypi stat tendenci-case-studies
Fetching statistics for 'http://pypi.python.org/pypi/tendenci-case-studies'. . .
Download statistics for tendenci-case-studies
=============================================
Downloads by version
1.0.0 13/02/25 [ 1,000 ] *******************************************
View xml_serialize_document.js
var serializer = new XMLSerializer(),
html = serializer.serializeToString(document);
You can’t perform that action at this time.