Berky115 / when-in-doubt

A repo of examples, urls and helpful things to know when stuck.

Home Page:https://when-in-doubt.herokuapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CircleCI

When In Doubt

A repository of code examples, useful refferences and helpful information.

JS

General

Stay updated:

Lodash

D3

React

RegEx

Testing

const assert = require('assert');

describe('Array', function() {
	describe('#indexOf()', function() {
		it('should return -1 when the value is not present', function(){
		  assert.equal(-1, [1,2,3].indexOf(4));
		});
	});
});

Enzyle testing

Official documentation - https://airbnxb.io/enzyme/docs/api/ReactWrapper/find.html General walk through and setup - https://scotch.io/tutorials/testing-react-components-with-enzyme-and-jest

it('Rank default values are passed on and rendered', () => {
    const wrapper = mount(<GameUI/>);
    expect(wrapper.find('.currentPoints').text()).toEqual('Points: 0');
    expect(wrapper.find('.currentRank').text()).toEqual('Rank: 1');
    expect(wrapper.find('.curretRankPoints').text()).toEqual('Rankpoints: 7');
  });

Express - The little server that could:

const express = require('express')
const app = express()
const port = 3000

app.get('/', (req, res) => res.send('Hello World!'))

app.listen(port, () => console.log(`Example app listening on port ${port}!`))

GIT

General

Python

Ruby

EZProxy

Proxy cheat sheet - https://help.oclc.org/Library_Management/EZproxy/Get_started/Evaluate_proxy_by_port_versus_proxy_by_hostname

Terminology - https://help.oclc.org/Library_Management/EZproxy/EZproxy_configuration/Understanding_URLs_and_database_stanzas

Stanzas - https://help.oclc.org/Library_Management/EZproxy/EZproxy_configuration/Introduction_to_database_stanza_directives

Bundler cheat codes

bundle install #install all gems

bundle update #update all gems to latest possible version. This ignores gemfile.lock, very possibly that it causes issues.

bundle init #non-rails way to init a gemFile

gem install bundler -v "~>1.0"  #If you NEED a version of bundler that is older use this...

CSS

Web templates

html5Up w3 schools

Asp.net

General

Terminal

User-Agent setup - https://dev.to/levivm/how-to-use-ssh-and-ssh-agent-forwarding-more-secure-ssh-2c32 shell commands - https://www.makeuseof.com/tag/mac-terminal-commands-cheat-sheet/

Useful commands to memorize:

Ctrl + A	#Go to the beginning of the line you're currently typing on
Ctrl + E	#Go to the end of the line you're currently typing on
Ctrl + U	#Clear the line before the cursor

Ctrl + D	#Exit the current shell

end task on port #kill -kill `lsof -t -i tcp:3000`

Containers, VM's and beyond:

Docker Cheat Sheet

WebDev

General

Short version:

You enter a URL into a web browser. 

1 type desired url
2 convert to IP
3 check caches/ lookup DNS query if necessary
4 Handshake established
5 Send request (Get)
6: Server translates request and builds response
7: Server sends response with page and status code
8: Browser buils page based on html blueprint. Then reads in associated CSS/Javascript

Security

Fun Facts

skeuomorphic - where an object in software mimics its real world counterpart. The “trash can” is, perhaps, the most recognizable skeuomorphic object.

Gauntlet of the damned

  • What is the difference between local and session storage?
Local Storage
Local storage is used for storing data locally on a user’s browser, like saving user preferences or other settings. It is persisted through page reloads and stays with the browser until it is cleared manually or through a setting.

Session Storage
Session storage acts in a similar way to local storage. The only difference here is that while data stored in local storage has an expiration date, the data stored in session storage will expire as soon as the page’s session ends, that’s it, when the page is closed.
  • What is the most concurrent users you've had to account for?
  • What is the most complicated application you've worked on?
  • What's a project you've worked on that you are particularly proud of?
  • What are you looking for in your next role?

VScode

VSCode settings - https://code.visualstudio.com/docs/getstarted/settings

General Challenges:

About

A repo of examples, urls and helpful things to know when stuck.

https://when-in-doubt.herokuapp.com/


Languages

Language:JavaScript 49.0%Language:HTML 34.2%Language:CSS 16.8%