Skip to content

Instantly share code, notes, and snippets.

View revisualize's full-sized avatar

Joseph revisualize

  • Seattle, Washington, USAmerica, North America, Terra, Sol, Local Interstellar Cloud, Local Bubble, Gould Belt, Orion-Cygnus Arm, Milky Way, Milky Way Subgroup, Local Galactic Group, Virgo Supercluster, Laniakea Supercluster, Observable Universe, Universe
View GitHub Profile
// Turn all HTML <a> elements into client-side router links, no special framework-specific <Link> component necessary!
function useLinkHandler() {
function handleClick(e) {
const link = e.target.closest('a');
const isAnchorLink = link && link.href && link.href.startsWith('#');
// Check if the clicked element is a valid <a> tag and meets the navigation criteria
if (
link &&
Within the Dwarven Kingdom there holds a sacred pact that transcends beyond bloodlines, clan, house, and even beyond Dwarven Tides of War. There is a group derived from volunteer applicants that are designated in aiding any Dwarf that ventures too high on the peaks or too far below the depths. The group's focus is on getting every Dwarf (or anyone for that matter) that calls for aid to safety. Much like a group of special forces team members that train in peak or depth rescue.
Dvom’s focus was on frozen peak rescue and escorting noble clans leaders into adjacent Kingdoms. From his travels he had grown a desire to fly and travel the world.
@revisualize
revisualize / clone_all_github.sh
Created May 6, 2018 07:51
Complete clone of all Github repos
ORGANIZATION=xxx
USERSORGS=[users|orgs]
curl -s https://api.github.com/$USERSORGS/$ORGANIZATION/repos?per_page=300 | grep clone_url | awk -F '"' '{print $4}' | xargs -n 1 -P 4 git clone

Accessing values in Objects.

Dot Notation is converting the value to a string (string literal). Example: myObj.name; is the same as myObj["name"]; and as we all know quotes define strings.

If you want to use a variable for accessing the value of object properties you cannot use Dot Notation. You have to use Bracket Notation. Example: var num = 42; myObj[num];

There are a few other limitations when accessing an object property. If the object key has a space or number in it, you cannot use dot notation.

var myObj = {

Convert Celsius to Fahrenheit

To test your learning, you will create a solution "from scratch". Place your code between the indicated lines and it will be tested against multiple test cases.

The algorithm to convert from Celsius to Fahrenheit is the temperature in Celsius times 9/5, plus 32.

You are given a variable celsius representing a temperature in Celsius. Use the variable fahrenheit already defined and apply the algorithm to assign it the corresponding temperature in Fahrenheit.

Note:

Side Question:
```js
function getName() { return "Happy Feet"; }
var name = getName();
console.log(name);
```
What do **you** think is output to the console when you log the variable `name`?
Why do you think that is? ... How does that relate to your question and to the challenge that you're working on?
Strings are Immutable. You have to completely reassign the string or create a new string.
@revisualize
revisualize / FreeCodeCamp - Word_Blanks.md
Last active June 14, 2017 18:30
The FreeCodeCamp challenge Word Blanks with instructions and extra information. https://www.freecodecamp.com/challenges/word-blanks

Word Blanks

You will need to use string operators to build a new string, result,

using the parameters: myNoun, myAdjective, myVerb, and myAdverb.

Parameters are variables that represent the values that get passed into your function from the function call.

Image of function

My recommended learning resources for web development. (Note this may be a little too much.)
This is over 80 lines of text.
This is a good video:
How to Become a Master Web Developer
https://www.youtube.com/watch?v=0yzRW8yqN4M
2016/2017 MUST-KNOW WEB DEVELOPMENT TECH - Watch this if you want to be a web developer
https://www.youtube.com/watch?v=sBzRwzY7G-k 22:51
@revisualize
revisualize / FreeCodeCamp - Nesting For Loops.js
Last active May 25, 2017 20:14
Challenge discussion for FreeCodeCamp.com - Nesting For Loops challenge: https://www.freecodecamp.com/challenges/nesting-for-loops
/* FreeCodeCamp - Nesting For Loops Challenge.
Total: 75 Lines on Gist.
Before we get into the challenge instructions and process,
I'd like to have an extended review for Accessing Complex Arrays &
iterating across arrays using for loops. Then we'll move into the complex arrays.
For this process, let's first create an array:
var arr = ["B", "D", "F", "H", "J", "L"]; // Even letters.
To access "B" we use arr[0]; and "J" is arr[4];

Gist for the FreeCodeCamp Profile Lookup Challenge. Instructions as comments. Total: 39 lines.

We have an array of objects representing different people in our contacts lists.

Example: var contacts = [ { ... } , { ... } , { ... } , { ... } ];

// A lookUpProfile function that takes
// firstName and a property (prop)