Skip to content

Instantly share code, notes, and snippets.

View laravellously's full-sized avatar

Martins 'Laravellous Michael laravellously

View GitHub Profile
@laravellously
laravellously / surprise_tutorial.py
Created February 3, 2019 01:29 — forked from mahermalaeb/surprise_tutorial.py
The easy guide for building python collaborative filtering recommendation system in 2017
import zipfile
from surprise import Reader, Dataset, SVD, evaluate
# Unzip ml-100k.zip
zipfile = zipfile.ZipFile('ml-100k.zip', 'r')
zipfile.extractall()
zipfile.close()
# Read data into an array of strings
with open('./ml-100k/u.data') as f:
Setting Up A Localhost Self-signed Certificate For Local Https Development
==========================================================================
- GENERATE THE CERTIFICATE
# 1. generate key
- create an 'ssl' folder somewhere
- cd to it
@paulferrett
paulferrett / ordinal_suffix.php
Last active July 2, 2018 21:23
Here's a function to get the ordinal suffix of an integer in PHP.
<?php
/**
* Get the ordinal suffix of an int (e.g. th, rd, st, etc.)
*
* @param int $n
* @param bool $return_n Include $n in the string returned
* @return string $n including its ordinal suffix
*/
function ordinal_suffix($n, $return_n = true) {