Skip to content

Instantly share code, notes, and snippets.

Avatar

Aaron Lo IllusionElements

  • Ottawa
View GitHub Profile
View index.html
<head>
<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
</head>
<body>
<div id="root"></div>
</body>
View FreeCodeCamp API Call (OFFLINE)
//GET STREAMS
{
"_links":{
"self":"https://api.twitch.tv/kraken/streams/freecodecamp",
"channel":"https://api.twitch.tv/kraken/channels/freecodecamp"
},
"stream":null
}
//GET USERS
View search.js
function replace(str, before, after) {
var aslice = after.slice(1);
if(before[0] === before[0].toUpperCase()){
var caps = after.charAt(0).toUpperCase() + aslice;
return str.replace(before, caps);
}
else if(after[0] === after[0].toUpperCase() && before[0] === before[0].toLowerCase()){
var low = after.charAt(0).toLowerCase() + aslice;
return str.replace(before, low);
}
You can’t perform that action at this time.