Skip to content

Instantly share code, notes, and snippets.

View msyvr's full-sized avatar
🎯
Focusing

Monica Spisar msyvr

🎯
Focusing
View GitHub Profile
This details how best to manage assets in the rails pipeline for deployment to heroku:
http://www.akitaonrails.com/2017/06/28/rails-5-1-heroku-deployment-checklist-for-heroku
"
Make sure you have 2 boot files, first the canonical Procfile to be used by Heroku in production:
1 web: bin/rails server -p $PORT -b 0.0.0.0
Second, a Procfile.dev to be used only in your development environment:
1 web: ./bin/rails server

Keybase proof

I hereby claim:

  • I am msyvr on github.
  • I am msyvr (https://keybase.io/msyvr) on keybase.
  • I have a public key ASA5Asjl0IcJvQ0lW5gTNdCJQtPaOPcXeInFC6ZdjLO1hQo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am msyvr on github.
  • I am msyvr (https://keybase.io/msyvr) on keybase.
  • I have a public key ASA5Asjl0IcJvQ0lW5gTNdCJQtPaOPcXeInFC6ZdjLO1hQo

To claim this, I am signing this object:

@msyvr
msyvr / tictactoe.py
Last active September 2, 2021 19:45
import random
rowIndex = [1,2,3]
colIndex = [1,2,3]
diagset=[(1,1), (2,2), (3,3)]
antidiagset=[(1,3), (2,2), (3,1)]
availablePositions=[]
playerPositions=[]
computerPositions=[]
pDiagCount=0
pAntiDiagCount=0
resource: https://opensource.com/article/19/5/python-3-default-mac
---
essentials:
1. Install pyenv:
$ brew install pyenv
2. Install desired version of python:
$ pyenv install 3.9.0
3. Set global default version
$ pyenv global 3.9.0
4. Verify it worked
# resource: https://youtu.be/8ext9G7xspg
# simple madlibs game: player chooses some words that get inserted into predefined sentence
adj = input("Adjective: ")
verb1 = input("Verb: ")
verb2 = input("Another verb: ")
famous_person = input("Famous person: ")
madlib = f"Computer programming is so {adj}! It makes me so excited because I love to {verb1}. Stay hydrated and {verb2} like you are {famous_person}!"
@msyvr
msyvr / gcden.py
Created September 14, 2021 22:41
python: function: greatest common denominator
def gcden(x, y):
while x % y != 0:
oldx = x
oldy = y
x = oldy
y = oldx % oldy
return y
@msyvr
msyvr / inheritnc.py
Last active September 14, 2021 23:02
python: basic inheritance
class Point:
def __init__(self, initX, initY):
self.x = initX
self.y = initY
def distanceFromOrigin(self):
return ((self.x ** 2) + (self.y ** 2)) ** 0.5
def __str__(self):
@msyvr
msyvr / xtendng.py
Created September 14, 2021 23:06
python: extending via super()
class Point:
def __init__(self, initX, initY):
self.x = initX
self.y = initY
def distanceFromOrigin(self):
return ((self.x ** 2) + (self.y ** 2)) ** 0.5
def __str__(self):
@msyvr
msyvr / cmpstn.py
Created September 14, 2021 23:08
python: composition (alternative to inheritance for reusing code)
class Point:
def __init__(self, initX, initY):
self.x = initX
self.y = initY
def distanceFromOrigin(self):
return ((self.x ** 2) + (self.y ** 2)) ** 0.5
def __str__(self):