Skip to content

Instantly share code, notes, and snippets.

I'm Innocent

Innocent Udeogu Innarticles

I'm Innocent
Block or report user

Report or block Innarticles

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Rails Technical Challenge

Challenge Specs:

Using Ruby on Rails we would like you to create a simple blog api-only application. The application should fulfill the requirements below. Any one can create a blog with or without a loggedin account.

  • You can only comment as a authenticated user (logged in).
  • You can not commment on more than 2 blogs in a given day 24 hours period.
  • Your api must be in line with JsonAPI standards.
  • The source code must be placed in a public repo on GitHub.
  • The application should be deployable on Heroku.
View Vim Usage Cheatsheet.txt
h moves the cursor one character to the left.
j moves the cursor down one line.
k moves the cursor up one line.
l moves the cursor one character to the right.
0 moves the cursor to the beginning of the line.
$ moves the cursor to the end of the line.
w move forward one word.
b move backwards one word.
G move to the end of the file.
gg move to the beginning of the file.
View get_responses.rb
max = 0.0
if !QaCorp.where("question like ?", "%#{self.text}%").empty?
# Exact question exist in the database.
answer = QaCorp.where("question like ?", "%#{self.text}%").first.answer
max = 1.0
corpus = {|qa|}
d_question =
corpus << d_question
model =, :library => :nmatrix)
Innarticles /
Created Aug 25, 2018
Combine data from several csv files
import glob
import pandas as pd
path ='/' # use your path
allFiles = glob.glob("*.csv")
frame = pd.DataFrame()
list_ = []
for file_ in allFiles:
df = pd.read_csv(file_,index_col=None, header=None)
url = ""
from bs4 import BeautifulSoup
import requests
import csv
# Main Coding Sectio
start = 1
with open("Units.csv", 'wb') as save:
while True:
Innarticles / CSV_DB.rb
Created Jul 22, 2018
Rails Code Snippet on Creating Objects from CSV data
View CSV_DB.rb
csv_text ='lib', 'seeds', 'products.csv'))
csv = CSV.parse(csv_text, :headers => true, :encoding => 'ISO-8859-1')
csv.each do |row|
t = = row['id']
t.title = row['title']
t.brand = row['brand']
t.description = row['description']
t.main_image = row['picture']
t.condition = row['condition']
View Nigeria_States.js
var state_arr = new Array("Lagos", "Rivers", "FCT", "Abia", "Adamawa", "Akwa Ibom", "Anambra", "Bauchi", "Bayelsa",
"Benue", "Borno", "Cross River", "Delta","Ebonyi", "Edo", "Ekiti", "Enugu", "Gombe", "Imo", "Jigawa", "Kaduna", "Kano","Katsina", "Kebbi", "Kogi", "Kwara", "Nasarawa", "Niger", "Ogun", "Ondo", "Osun", "Oyo", "Plateau", "Sokoto", "Taraba", "Yobe", "Zamfara");
Innarticles /
Last active Feb 13, 2017
Flask code for Fashion Recognizer
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os.path
import re
import sys
import tarfile
import numpy as np
Innarticles /
Created Jan 14, 2017 — forked from erikbern/
Installing TensorFlow on EC2
# Note – this is not a bash script (some of the steps require reboot)
# I named it .sh just so Github does correct syntax highlighting.
# This is also available as an AMI in us-east-1 (virginia): ami-cf5028a5
# The CUDA part is mostly based on this excellent blog post:
# Install various packages
sudo apt-get update
View gist:db5f33480d74f5fecc30cedcf613d5f0
You can’t perform that action at this time.