Skip to content

Instantly share code, notes, and snippets.

View HopperMCS's full-sized avatar

G. F. Hopper HopperMCS

View GitHub Profile
@HopperMCS
HopperMCS / JayEdmundson.md
Last active July 7, 2017 10:54
Interview for OOD

Interview with

Jay Edmundson

Notes (both programming AND consulting, double-whammy!!!!

Started about 100 years ago (lmao) in the mid-90s - in real estate and thought "This vb stuff looks relly cool" so took credit class for and learned programming

Works on gov't projects - solving problems

Problem solving, need to be lazy - find a better way to do it, all about shortcuts

@HopperMCS
HopperMCS / playground.rs
Created June 27, 2017 05:54 — forked from anonymous/playground.rs
Rust code shared from the playground
fn main() {
enum IsGender {
Yes,
No,
}
fn is_gender(is_gender: IsGender) -> String {
match is_gender {
IsGender::Yes => String::from("Status: Is A Gender"),
@HopperMCS
HopperMCS / playground.rs
Created July 1, 2017 03:47 — forked from anonymous/playground.rs
Rust code shared from the playground
enum Gender {
Agender,
}
struct Details {
name: String,
description: String,
sentence: String,
}
@HopperMCS
HopperMCS / logo.rs
Last active July 20, 2017 18:52
#WetA$$Code
extern crate cairo;
use std::error::Error;
use std::fs::File;
use std::io::prelude::*;
use std::path::Path;
use cairo::{Context, ImageSurface, Format};
use std::fs;
fn main() {
' Program Name: Pizza Project
' Program Description: Logs user in, then allows them to order a pizza with toppings. Calculates pizza price and delivery charges if applicable.
' This program also will show how many pizzas were ordered and deliveries that were made.
' Programmer: Matthew Gage Morgan
' Date: March 25th, 2019
Option Strict On
Public Class PizzaProject
' declare the two vars needed for running totals
Private GrandTotalPizzasOrdered As Integer
#------------------------------------------------------------------------------#
# OFFICIAL UBUNTU REPOS #
#------------------------------------------------------------------------------#
###### Ubuntu Main Repos
deb http://....archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://....archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
def self.get_headlines(query)
data = self.search_by_query(query)
data["articles"]
end
def self.api_public_key
begin
@@public = File.open(File.expand_path("~/.newsfeed_key")).read.strip
rescue
puts "No public key found. Please follow the instructions at https://newsapi.org to get your keys."
# create public key
puts "Please enter your public key:"
@@public = gets.strip
return if @@public == "exit"
def self.search_by_query(query)
query_f = ERB::Util.url_encode("#{query}")
url = "https://newsapi.org/v2/everything?qInTitle=#{query_f}&pageSize=10&page=1&apiKey=#{self.api_public_key}"
req = URI.open(url)
response_body = req.read
json = JSON.parse(response_body)
end
class Article
attr_accessor :title, :description, :url
@@all = []
def initialize(attributes)
@title = attributes["title"]
@description = attributes["description"]
@url = attributes["url"]
end