Skip to content

Instantly share code, notes, and snippets.

Working from home

Alfred Francis alfredfrancis

Working from home
View GitHub Profile
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.naive_bayes import MultinomialNB
from sklearn.pipeline import Pipeline
from NLTKPreprocessor import NLTKPreprocessor
import os
import json
PATH = "new.model"
model = Pipeline([
View personal.json
"text": "How would you describe yourself?",
"intentName": "personal-bio"
"text": "When is your birthday?",
"intentName": "personal-birthday"
View random_colors.js
var colors = {
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
alfredfrancis / react-firebase-auth.js
Created Jan 30, 2017 — forked from nateinaction/react-firebase-auth.js
This is a version of Facebook's React Conditional Rendering example modified to support firebase authentication.
View react-firebase-auth.js
* This is a version of Facebook's React Conditional Rendering
* example modified to support firebase authentication.
import React, { Component, PropTypes } from 'react';
import * as firebase from 'firebase';
function UserAvatar(props) {
import logging
import logging.handlers
import time
format='%(asctime)s %(levelname)-8s %(message)s')
logging.getLogger().addHandler(logging.handlers.DatagramHandler('localhost', 8045))
while True:
import pymongo
import sys
connection = pymongo.Connection("mongodb://localhost", safe=True)
coll = db.nooracollection
alfredfrancis / people.txt
Last active Apr 14, 2017
Spark sql example
View people.txt
Michael, 29
Andy, 30
Justin, 19
Arun, 20
Alfred, 22
View pdfWaterMark.vb
Imports iTextSharp.text.pdf
Imports iTextSharp.text
Imports System.IO
Imports System.Drawing
Imports System.Drawing.Imaging
Imports System
Imports System.Collections.Generic
Imports System.Windows.Forms
alfredfrancis / currency_code_vs_currency_name.json
Created Apr 20, 2017
JSON of common currency codes vs Currency names
View currency_code_vs_currency_name.json
"currencycode": "Afghani",
"code": "AFN"
"currencycode": "Euro",
"code": "EUR"
alfredfrancis /
Created Apr 21, 2017 — forked from mattupstate/
JSON Patch SQLAlchemy models w/ Flask
from dictalchemy import make_class_dictable
from flask import Flask, request, jsonify, json
from flask_sqlalchemy import SQLAlchemy
from jsonpatch import JsonPatch, JsonPatchException
app = Flask(__name__)
app.debug = True
db = SQLAlchemy(app)