ssh github

At command line:

ssh-keygen

cd .ssh

vi id_rsa.pub

copy contents of id_rsa.pub

close file

go to GitHub settings

SSH and GPG keys

click New SSH key

give it a name and paste the contents of id_rsa.pub

go to GitHub clone or download; choose ssh and copy link

At command line:

ssh-add .ssh/id_rsa

git remote set-url origin (paste link)

git remote -v  (to confirm)

 

Clone repo and set it up as new repo on your own GitHub

When you clone a repository, it is added as a remote of yours, under the name origin. What you need to do now (as you’re not using the old source anymore) is change origin’s URL:

$ git remote set-url origin http://github.com/YOU/YOUR_REPO

If the original repository would update often and you want to get those updates from time to time, then instead of editing origin it would be best to add a new remote:

$ git remote add personal http://github.com/YOU/YOUR_REPO

Or maybe even call the old one upstream:

$ git remote rename origin upstream
$ git remote add origin http://github.com/YOU/YOUR_REPO

Then, whenever you want to get changes from upstream, you can do:

$ git fetch upstream

Using Git-ftp

View project on GitHub

https://github.com/git-ftp/git-ftp

git-ftp.github.io

Installation

brew install git-ftp

Setup

git config git-ftp.url ftp.example.net
git config git-ftp.user ftp-user
git config git-ftp.password secr3t

FTP

# Upload all files
git ftp init

# Or if the files are already there
git ftp catchup

# Work and deploy
git ftp push

My workflow… make edits in sublime, push to github (git push origin master), and then ftp push (git ftp push).

Negotiating

Negotiations make both parties feel better. If a company offers you 80K and you accept it without negotiating, they will wonder if they could have gotten you for 70K. This may leave them questioning whether they got a good value. Negotiating makes everyone feel they got the best deal possible. Consider this… if you ask for 95K, and they counter with 90K (and you accept), they will think they got a better deal than if they offered and you accepted 85K without negotiating.

Your perceived value will increase if you negotiate. What value do you add? Use that as a negotiation tool. But do not make the process adversarial. Make sure you acknowledge any concerns they have about your skills, experience, value, but then convince them and provide examples of how you add value and fill the needs they have.

If salary is not flexible, try to negotiate for other things like more vacation, working fewer hours, working from home, new equipment. Don’t forget signing bonus, stock shares and stock options. Read the fine print, not just because you should, but because it shows that you care about the details, and that send a positive message about what kind of person/employee you are.

Be sure to do your research and know what a fair market salary is for the position based on location, size of company, industry. Try to avoid being the first to say a number, especially early on in the process. You can redirect with statements like “I’m sure we can come to an agreement on salary when that time comes, but right now I’m more interested in learning more about the position and figuring out if it is a good fit for both of us.” If you do say a number later on in the process, make sure it is higher than what you are willing to take.

Notes from Pro Skills:

When they say a number, validate (great, I’m excited about working with you, love the team, company, etc).

Come back with a range. If you are happy with salary, still come back with range (5-10K) starting at 5K more than their number.

Ask what is the flexibility of salary. What salary do you have in mind for this position? How much is budgeted for this position? If they are not flexible on salary, what things are they flexible on such as vacation time, signing bonus, equity, remote, Fridays off, revisiting salary increase in 6 months.

If they question your value (junior position, entry level), ask for opportunity to demonstrate your skills in the form of a coding challenge or small task.

Validate again. Say you want to learn more about position, compare with other offers. Show appreciation and say that you are certain you can come to an agreement on compensation.

 

 

Notes from Pro Skills Series

Tentative Language

Avoid starting sentences with tentative language such as I think, I believe, I hope, and stay away from filler words like um, well, and so. It’s much more effective to state something as fact. It will make you sound more confident and send a message that you know what you’re talking about.

Active Listening

Do not stare expressionless when listening to someone speak. Instead, nod in agreement or show facial expressions as appropriate. Paraphrasing or asking a question related to what they just said shows that you were listening and care about what they have to say.

Going from This to That

When networking, the ability to steer the conversation from any topic to the message you want to get across is an important skill. For example, when talking about something as mundane as the traffic, you should try to move the conversation to your profession as naturally as possible. Saying something about being a software engineer and your preference for remote work because you don’t like driving during rush hour is an honest and casual way bring up your current job search.

 

Editing Commit Messages

Amend most recent commit message

$ git commit --amend

If you have already pushed the commit, you will need to force push (not best practice) the amended message.

$ git push --force example-branch-name

Amend older or multiple commit messages
To amend the message for multiple commits or an older commit, you can use interactive rebase. The following will display a list of the last three commit messages.

$ git rebase -i HEAD~3

The list will look something like this.

pick e499d89 Delete CNAME
pick 0c39034 Better README
pick f7fde4a Change the commit message but push the same commit.

# Rebase 9fdb3bd..f7fde4a onto 9fdb3bd
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
# However, if you remove everything, the rebase will be aborted.
#
# Note that empty commits are commented out

Replace pick with reword before each commit message you want to change.

pick e499d89 Delete CNAME
reword 0c39034 Better README
reword f7fde4a Change the commit message but push the same commit.

Again, if you have already pushed the commit(s), you will need to force push (not best practice) the amended message(s).

$ git push --force example-branch-name

JavaScript Promises

Promises are used to make your code asynchronous. The idea is to run the promise code after something has completed without blocking execution of the rest of the code. This can also be accomplished with callbacks, but promises make the code easier to read and offer a few additional benefits.

Learn more about promises from MDN.

Relational Databases

Relational databases contain data organized in tables made of rows and columns, with each table column containing a specific data type. Transactions support ACID (Atomic, Consistent, Isolated, Durable) properties, assuring that all transaction are processed reliably.

Atomic means that if any part of the transaction fails, the entire transaction fails. All data is brought back to its state prior to the failed transaction.

Consistent means that everything written to the database must be valid according to all defined rules including constraints, cascades, and triggers.

Isolated means that the effects of a transaction are not visible to other transactions until the transaction is complete.

Durable means that all committed transactions are stored permanently and will persist even if there is a loss of power or the database crashes.

Time Complexity

An algorithm’s time complexity if often expressed using big O notation. Below are some common types of algorithmic time complexity.

O(1) — With constant time complexity, as the input size grows, the number of steps remains the same. This is the most desirable type of time complexity. Looking up an item at a specific index of an array is an example of constant time. No matter how large the array, the lookup is a single operation.

O(log n) — With logarithmic time complexity, the number of steps increase as the input size increases, but at a slower rate as the size grows larger and larger. Binary search is an example of logarithmic time because we can divide the problem in half with each iteration. As we double the input size, only one additional step is required.

O(n) — With linear time complexity, the size of the input and the number of steps grow proportionally. Iterating through an array is an example of linear time because each additional item in the array requires one additional iteration.

O(n^2) — With quadratic time complexity, the number of steps is proportional to the square of the input size. An example of quadratic time is when we have a loop inside of a loop. If we iterate through an array of items, and on each iteration we iterate through all items in the array again, that would be quadratic time complexity. A loop inside a loop inside a loop would be O(n^3).

O(C^n) — With exponential time complexity, the number of steps increases exponentially with each increase of input size. This might be fine for very small input sizes, but as input size grows larger and larger, the time complexity may quickly become unacceptable. An example of exponential time would be a recursive solution to find the nth fibonacci number.