- start locally:
git init
- intialize new git repository in the current directorygit remote add origin <address-in-github>
git push origin HEAD
push current branch to a corresponding branch in git
- download from the web (remote repository):
git clone <repository address>
- locally download existing repository from the web
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import copy | |
import os | |
class Part(): | |
def __init__(self) -> None: | |
self.digits = [] | |
self.positions = set() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import sys | |
class DayOne: | |
_num_words_to_numbers = { | |
'one': '1', | |
'two': '2', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { KJUR } from "jsrsasign"; | |
function currentTimeInSeconds(): number { | |
return Math.floor(Date.now() / 1000); | |
} | |
class Payload { | |
iss: string; | |
sub: string; | |
email: string; |
- type your question into the class slack channel.
- remember that internet was created by programmers and there’s lots of resources there for us.
- do a google search.
- check w3schools.com.
- check stack-overflow.com.
- read the python3 docs.
- run
help(<function>)
(e.g.help(sum)
) in colab, a python file or in the python console. - command click (ctrl-click on windows) in pycharm (links to documentation).
- take a break - usually between 5 minutes and 2 days is best. Sometimes your subconscious mind will help you find the solution you’re looking for - here’s a great presentation about this.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package util | |
import ( | |
"bytes" | |
"context" | |
"encoding/json" | |
"io/ioutil" | |
"net" | |
"net/http" | |
"time" |
The concept of "SOFT"-ware is that it is something which should be easy to change and update (or roll-back).
Before you wrote code you've probably collaborated with other people on word documents or spreasheets.
- Have you ever kept multiple versions of a file, in case you wanted to go back and get things you might have previously deleted or changed?
- Have you ever emailed around versions of a file between several people and struggled to keep everone in sync without overwriting anything, or having changes and contributions get lost?
- Have you ever had trouble with multiple people editing the same files and trying to merge together all their work?
- IDE - Integrated Development Environment - E.G. PyCharm
- REPL - Read Eval Print Loop - E.G. Python Console
- Debugger - Included in PyCharm allows you to pause and execute
CTRL-SHIFT-A
(COMMAND-SHIFT-A
on Mac) - find a shortcut
DOUBLE-SHIFT
(press fast) - search for a class, file or function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
function printemphasized { | |
printf "\n**$1**\n\n" | |
} | |
function checkoutpull { | |
git checkout "$1" | |
git merge --ff-only @{u} | |
} |
Like Harvard CS50.
Apple "Notes" is ok, but Joplin is better.
NewerOlder