Skip to content

Instantly share code, notes, and snippets.

View feliperyan's full-sized avatar

Felipe Ryan feliperyan

View GitHub Profile
def theThing():
return "rrraaawww"
#This assumes you downloaded the PostgreSQL app,
#Python 3, the Heroku Toolbelt and Sublime Text 3.
#Create and activate virtual environment
pyvenv ~/virtualevns/wagtailenv
source ~/virtualenvs/wagtailenv/bin/activate
#Allow Sublime Text to be opened from the Terminal
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime
@feliperyan
feliperyan / gist:27a1347136a109cbbabf
Created June 7, 2015 00:19
Fully customised Twitter Widget using twitterFetch.js
<script type="text/javascript" src="js/twitterFetch.js"></script>
<script>
// ID of the Twitter List
var id = '606429765768081409';
// Settings for what the js library will output to the corresponding
// element. Not an exhaustive list.
var config5 = {
"id": '606429765768081409',
@feliperyan
feliperyan / round_robin.py
Created January 30, 2017 06:18
Round Robin Algo
from copy import deepcopy
def go_round_robin(list_of_lists):
robin = deepcopy(list_of_List)
i = len(robin)
while len(robin) > 0:
j = i % len(robin)
try:
#!/usr/bin/python
import Queue
import threading
import time
exitFlag = 0
class myThread (threading.Thread):
@feliperyan
feliperyan / exif.py
Created October 22, 2017 11:15 — forked from ishahid/exif.py
Read EXIF data from an image
#!/usr/local/bin/python
"""Read EXIF data from an image
https://gist.github.com/ishahid/137f8724d8cff2304dffd69f3ade26d7
"""
try:
import os, sys
# import json
from PIL import Image
@feliperyan
feliperyan / get_lat_lon_exif_pil.py
Created October 23, 2017 12:53 — forked from erans/get_lat_lon_exif_pil.py
Get Latitude and Longitude from EXIF using PIL
from PIL import Image
from PIL.ExifTags import TAGS, GPSTAGS
def get_exif_data(image):
"""Returns a dictionary from the exif data of an PIL Image item. Also converts the GPS Tags"""
exif_data = {}
info = image._getexif()
if info:
for tag, value in info.items():
decoded = TAGS.get(tag, tag)
@feliperyan
feliperyan / make_model.py
Created February 13, 2018 23:39
Using scikit-learn to do text categorisation and to save a model and a one-hot encoder
import pickle
import pandas as pd
import re
import numpy as np
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.ensemble import RandomForestClassifier
from sklearn import metrics
from sklearn.model_selection import train_test_split
from time import time
@feliperyan
feliperyan / load_modle_from_pickle_v2.ipynb
Created February 14, 2018 00:08
Jupyter notebook showing how to load a model and vectoriser and apply it. Results in 2 csv files one with predicted data and one with words that the model has never seen before.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
### Keybase proof
I hereby claim:
* I am feliperyan on github.
* I am fryan (https://keybase.io/fryan) on keybase.
* I have a public key ASAjRo41sVidSbYZfUdkXjsAYJPUbvEi2IuzTmr0-g0-pQo
To claim this, I am signing this object: