Skip to content

Instantly share code, notes, and snippets.

Avatar

cheddar chadwithuhc

View GitHub Profile
View Coding Garden Chat Commands.md

Coding Garden Chat Commands

Live Stream / Live Chat

Command Description
!project !workingon A quick description or link to the current project or thing we are working on
!badges Describe all the badge options available in the live chat window
!team [name] Set your team badge using the name of a Font Awesome brand: https://fontawesome.com/cheatsheet/free/brands - Ex: !team vuejs
!flag [country-code] Set the flag of your country in live chat. country list: https://restcountries.eu/rest/v2/all Ex: !flag us, !flag usa, !flag Germany
!setstatus [message] Sets your status message in live chat window
@chadwithuhc
chadwithuhc / xcode-ios-simulator-install.md
Created Jun 22, 2018
XCode and iOS Simulator install
View xcode-ios-simulator-install.md

XCode and iOS Simulator install instructions

  1. Install XCode
  2. Open XCode, go to Preferences > Components > download simulator of choice
  3. In Preferences > Locations > Command Line Tools ensure your XCode version is selected
@chadwithuhc
chadwithuhc / katas.md
Last active Nov 1, 2019
Code Katas I enjoyed solving
View katas.md
View dom-selection-manipulation.js
// Refactor to use `querySelector()` instead
document.getElementsByClassName("message")[0].innerHTML = 'Hello World'
// Solution
// `querySelector()` will select the first item it finds
document.querySelector(".message").innerHTML
// ---
View sample-tech-screen-questions.md

CSS

  • What are CSS selectors?
  • What is the specificity of those selectors?
  • What is the difference between .class1.class2 and .class1 .class2 as a selector?
  • How do you center something in CSS?
  • How do floats work?
  • How do you get something to not display using CSS?

JS

View url-params.js
// Challenge: Pull out the "character" value from the following URL string
// http://localhost:3000/characters/new?character=Art+Vandelay
// Using the `URL()` API, we can pull out the search params without needing to regex, split, or other wonkery
const params = (new URL(url)).searchParams
params.get('character') // Art Vandelay
// `URL()` will also handle uri decoding -- urls with %20, +, etc.
@chadwithuhc
chadwithuhc / build-a-diamond.txt
Last active Jun 29, 2018
Whiteboarding Questions
View build-a-diamond.txt
Build the following triangle in code
*
* *
* * *
* * * *
* * * * *
We could call it with `printTriangle(5)` where `5` is the number of rows to make
@chadwithuhc
chadwithuhc / declaring-values-in-function.js
Last active Feb 7, 2018
React Refactors for Clean Code
View declaring-values-in-function.js
// Challenge: Refactor the `render()` method with declare all variables at top
render() {
return (
<li>
<div className="profile-card">
<header className="profile-header" onClick={this.toggleClass}>
<img src={this.props.profile.image} alt={this.props.profile.name} />
<h2>{this.props.profile.name}</h2>
</header>
@chadwithuhc
chadwithuhc / index.html
Created Nov 10, 2017
DOM Events Sample
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
nav {background: tomato}
</style>
View LocalStorage Angular Service.js
(function() {
'use strict'
angular.module('app')
.service('houseService', function () {
this.houses = [
{id: 1, name: 'Spacious two bedroom', address: '10 Main St'},
]
this.seedHouses = function() {