Skip to content

Instantly share code, notes, and snippets.

View ggodreau's full-sized avatar
🛴
don't FB my GH

Gregory Godreau ggodreau

🛴
don't FB my GH
View GitHub Profile
@ggodreau
ggodreau / pystack.py
Last active July 21, 2017 19:17
Simple python stack class with a sorting method
class Stack:
def __init__(self):
self.data = []
def push(self, item):
self.data.append(item)
def pop(self):
return self.data.pop()
@ggodreau
ggodreau / stackScript.sh
Created July 21, 2017 19:20
Demo script for the pystack.py module
#!/usr/bin/python
import sys
sys.path.append('./pystack.py')
from pystack import Stack
# initialize Stack class object
myStack = Stack()
print "Initial stack (empty): ", myStack.show()
@ggodreau
ggodreau / fib_iter.sh
Created July 21, 2017 19:23
Bash script which generates n elements of the Fibonacci sequence, iteratively
#!/bin/bash
# source https://en.wikipedia.org/wiki/Fibonacci_number
# assuming F_1 = 1 and F_2 = 1 for seed values
read -p "Enter Count of Fibonacci Terms: " F_count
# input checking
re='^[0-9]+$'
if ! [[ $F_count =~ $re ]] ; then
@ggodreau
ggodreau / fib_recur.sh
Created July 21, 2017 19:24
Bash script which generates n elements of the Fibonacci sequence, recursively
#!/bin/bash
# source https://en.wikipedia.org/wiki/Fibonacci_number
# assuming F_1 = 1 and F_2 = 1 for seed values
# recursion function
function fib_recur_func(){
local F_n F_1 F_2 # Avoid leaking to main scope
F_n=$1
@ggodreau
ggodreau / task2.ipynb
Created July 25, 2017 15:52
GA Task 2 - see full repo at https://github.com/ggodreau/ga
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ggodreau
ggodreau / task1.ipynb
Created July 25, 2017 15:54
GA Task 1 - see full repo at https://github.com/ggodreau/ga
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ggodreau
ggodreau / c4t2_bd.ipynb
Last active July 28, 2017 20:45
c4t2_bd.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ggodreau
ggodreau / TriflingUnluckyDegu.js
Created January 31, 2018 03:01
TriflingUnluckyDegu created by anonymous - https://repl.it/repls/TriflingUnluckyDegu
var contacts = [
{
"firstName": "Akira",
"lastName": "Laine",
"number": "0543236543",
"likes": ["Pizza", "Coding", "Brownie Points"]
},
{
"firstName": "Harry",
"lastName": "Potter",
@ggodreau
ggodreau / gist-reveal.it-slides.html
Last active July 18, 2018 00:36 — forked from ryanj/gist-reveal.it-slides.html
Gist-powered Revealjs slideshow presentations http://gist-reveal.it
<section data-background-transition='zoom' data-transition='concave' data-background='http://ryanjarvinen.com/presentations/shared/img/broadcast_reveal_dark.png' data-state='blackout'>
<h2>Greg-Powered</h2>
<h1>Reveal.js</h1>
<h2>Slideshow Presentations</h2>
<br/>
<h1 class='fragment grow'><a style='color:deepskyblue;' href='http://gist-reveal.it'>gist-reveal.it</a></h1>
</section>
<section data-background-transition='zoom' data-transition='linear' id='try-it'>
<h2>Try it out!</h2>
<p>Create your own deck by forking a copy of <a href='https://gist.github.com/ryanj/af84d40e58c5c2a908dd'>this github gist</a>: <br /><a href='https://gist.github.com/ryanj/af84d40e58c5c2a908dd'>https://gist.github.com/ryanj/af84d40e58c5c2a908dd</a></p>
@ggodreau
ggodreau / except.sql
Created July 23, 2018 11:58
mySQL vs PostgreSQL exception join example
/* All product subcategory IDs
* for non bicycle frame items
* mySQL example using WHERE / NOT IN
*/
SELECT p.Name, p.Color, p.ProductSubcategoryID
FROM Product p
LEFT JOIN ProductSubcategory ps on ps.ProductSubcategoryID = p.ProductSubcategoryID
WHERE ps.ProductSubcategoryID NOT IN
(SELECT ProductSubcategoryID FROM ProductSubcategory WHERE Name LIKE '%Frame%')