Skip to content

Instantly share code, notes, and snippets.

View Innarticles's full-sized avatar
😇
I'm Innocent

Innocent Udeogu Innarticles

😇
I'm Innocent
View GitHub Profile
@Innarticles
Innarticles / nasa_code_results.csv
Last active November 24, 2015 22:36
Output of frequency of URL in NASA weblogs
/images/NASA-logosmall.gif 2140
/images/MOSAIC-logosmall.gif 1756
/images/USA-logosmall.gif 1748
/images/WORLD-logosmall.gif 1734
/images/ksclogo-medium.gif 1727
/ksc.html 1382
/images/KSC-logosmall.gif 1294
/ 627
/history/apollo/images/apollo-logo1.gif 606
/images/launch-logo.gif 562
import sys
import getopt
import csv
import argparse
def main(argv):
args = getopt.getopt(argv, "")
args = str(args[1][0])
print args
def get_cnt(lVals):
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
context "GET index" do
#context "POST create" do
#context "GET show" do
#context "PATCH update" do (or PUT update)
#context "DELETE destroy" do
#context "GET new" do
@Innarticles
Innarticles / rspec_model_testing_template.rb
Created September 11, 2016 14:11 — forked from SabretWoW/rspec_model_testing_template.rb
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
@Innarticles
Innarticles / gist:db5f33480d74f5fecc30cedcf613d5f0
Last active February 20, 2018 17:49
Code with Yaw: Oncenout
@Innarticles
Innarticles / install-tensorflow.sh
Created January 14, 2017 19:13 — forked from erikbern/install-tensorflow.sh
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:
# http://tleyden.github.io/blog/2014/10/25/cuda-6-dot-5-on-aws-gpu-instance-running-ubuntu-14-dot-04/
# Install various packages
sudo apt-get update
@Innarticles
Innarticles / flaskapp.py
Last active February 13, 2017 11:55
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
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
Innarticles / CSV_DB.rb
Created July 22, 2018 14:43
Rails Code Snippet on Creating Objects from CSV data
csv_text = File.read(Rails.root.join('lib', 'seeds', 'products.csv'))
csv = CSV.parse(csv_text, :headers => true, :encoding => 'ISO-8859-1')
csv.each do |row|
t = Product.new
t.id = row['id']
t.title = row['title']
t.brand = row['brand']
t.description = row['description']
t.main_image = row['picture']
t.condition = row['condition']
url = "http://integrity.ng/index.php/units/browse"
from bs4 import BeautifulSoup
import requests
import csv
# Main Coding Sectio
start = 1
with open("Units.csv", 'wb') as save:
while True:
try: