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:
I deployed to Heroku and custom fonts didn't work. Details of my starting point below. | |
Fixed in 2 steps: | |
1. In application.rb file, in class Application < Rails::Application, added: | |
config.assets.paths << Rails.root.join("app","assets","fonts") | |
2. In application.scss file, in @font-face, changed src: url('...') to font-url('...'); e.g.: | |
src: font-url('Aileron/Aileron-Regular.otf') format('opentype'); | |
Redeployed to Heroku and custom fonts worked. | |
--- | |
Starting point details (this all worked for a local deploy, but not when deployed on Heroku): |
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 |
I hereby claim:
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
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}!" |
# resource: https://youtu.be/8ext9G7xspg?t=431 | |
import random | |
min = int(input("What's the minimum integer for the number guessing game?: ")) | |
max = int(input("What's the maximum integer for the number guessing game?: ")) | |
# choose which game to play by calling it (end of this file - scroll down) | |
# player guesses which number the computer randomly chose from a range | |
def guess(min, max): |
# select letters one at a time to guess mystery word | |
import string | |
import random | |
from words_json import words | |
def get_valid_word(words): | |
word = random.choice(words) | |
while '-' in word or ' ' in word: | |
word = random.choice(words) |
import string | |
import random | |
from words_json import words | |
# randomly select word from words list | |
# don't allow words with spaces or dashes | |
def get_valid_word(words): | |
word = random.choice(words) | |
while ' ' in word or '-' in word: | |
word = random.choice(words) |