Skip to content

Instantly share code, notes, and snippets.

View dengsauve's full-sized avatar
:octocat:
How much firepower is necessary to imbed a cherry in an acoustic ceiling tile?

Dennis Sauve dengsauve

:octocat:
How much firepower is necessary to imbed a cherry in an acoustic ceiling tile?
View GitHub Profile
@dengsauve
dengsauve / Little_Accountant.rb
Last active March 3, 2017 13:21
Challenge #304 [Easy] Little Accountant
$debug = false
# Creates Program Data References
calendar = {"JAN"=>0, "FEB"=>1, "MAR"=>2, "APR"=>3, "MAY"=>4, "JUN"=>5,
"JUL"=>6, "AUG"=>7, "SEP"=>8, "OCT"=>9, "NOV"=>10, "DEC"=>11}
chart, journal = {}, []
File.open('chart.txt').each { |line| chart[line.split(';')[0]]=line.split(';')[1] }
File.open('journal.txt').sort.each { |line| journal << line.chomp.split(';')}
# User Instructions + Input
@dengsauve
dengsauve / numbers_for_sale_interactive.rb
Last active March 12, 2017 11:21
Challenge #305 [Hard] Numbers for Sale created by dengsauve - https://repl.it/GQsh/6
def factorial(num) num==0 ? 1 : num * factorial(num-1) end
print 'You want the sum of all numbers in a number to be:'
n = gets.chomp.to_i
print 'You want the largest number to be 10 ^'
k_exp = gets.chomp.to_i
sigma, mu, n_k_l, k_l = 0, 10, n + k_exp - 1, k_exp - 1
(0..[k_exp, n/mu].min).each do |i|
@dengsauve
dengsauve / Right_triangle.rb
Last active March 12, 2017 11:36
Right_triangle.rb created by dengsauve
print "How long are the sides?: "
side_length = gets.chomp.to_i
if side_length > 0
puts "*"
(side_length - 2).times { |i| puts "*" + (" " * i) + "*" }
puts "*" * side_length
side_length.times { |i| (i+1).times { |n| print (n+1).to_s.rjust(side_length.to_s.length) }; puts }
puts " " * (side_length - 1) + "*"
@dengsauve
dengsauve / CIS283 Various Classes Assignment.rb
Last active April 19, 2017 16:45
CIS283 Ruby Various Classes Assignment
############################################################
#
# Name: Dennis Sauve
# Date: 04/16/17
# Assignment: Ruby Classes
# Class: CIS283
# Description: A Program that implements ruby classes to
# store object information. This is an
# exercise in learning about the nature of
# Classes, and therefore the attr_accessor
@dengsauve
dengsauve / Finding Point Nemo main.rb
Last active May 13, 2017 10:02
/r/dailyprogrammer Chalenge #314 [Hard] Finding Point Nemo created by dengsauve - https://repl.it/HwK9/6
require_relative('sea_cell')
fin = File.open('map.txt', 'r')
dims = fin.readline.strip.split(' ')
map = fin.readlines
fin.close
world = Nemo.new(map, dims)
sea_cells = []
map.each_with_index do |latitude, lat|
text = "R4, R4, L1, R3, L5, R2, R5, R1, L4, R3, L5, R2, L3, L4, L3, R1, R5, R1, L3, L1, R3, L1, R2, R2, L2, R5, L3, L4, R4, R4, R2, L4, L1, R5, L1, L4, R4, L1, R1, L2, R5, L2, L3, R2, R1, L194, R2, L4, R49, R1, R3, L5, L4, L1, R4, R2, R1, L5, R3, L5, L4, R4, R4, L2, L3, R78, L5, R4, R191, R4, R3, R1, L2, R1, R3, L1, R3, R4, R2, L2, R1, R4, L5, R2, L2, L4, L2, R1, R2, L3, R5, R2, L3, L3, R3, L1, L1, R5, L4, L4, L2, R5, R1, R4, L3, L5, L4, R5, L4, R5, R4, L3, L2, L5, R4, R3, L3, R1, L5, R5, R1, L3, R2, L5, R5, L3, R1, R4, L5, R4, R2, R3, L4, L5, R3, R4, L5, L5, R4, L4, L4, R1, R5, R3, L1, L4, L3, L4, R1, L5, L1, R2, R2, R4, R4, L5, R4, R1, L1, L1, L3, L5, L2, R4, L3, L5, L4, L1, R3"
directions = text.split(", ")
ox = 0
dx = 0
oy = 1
dy = 0
@dengsauve
dengsauve / EmailsController.cs
Created November 15, 2017 02:26
Email-Web-Api
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using MvcMovie.Models;
namespace MvcMovie.ApiControllers
@dengsauve
dengsauve / ios2finalproject.md
Created November 21, 2017 00:01
iOS Final Project

iOS 2 Final

RO-SHAM-BILL

  • Number guessing game
  • Initial number
  • Take it in turns
  • Too high/low
  • You got it right
  • Needs to look professional
@dengsauve
dengsauve / heresy.html
Created November 27, 2017 22:45
CSS Extractor
<!-- Need this for program to open - Code to be cleansed here -->
/* Notes based on the tutorial here: https://www.youtube.com/watch?v=2Y45vk7d_Bg
Covered Here:
- Saving to iCloud with CloudKit
- Querying iCloud with CloudKit
- Pull Motion Refresh
- Using a cell programatically instead of dequeing a model
Useful for quick coding