This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// react-gtm-module setup | |
import TagManager from 'react-gtm-module'; | |
const tagManagerArgs = { | |
gtmId: 'GTM-XXXXXXX', | |
}; | |
TagManager.initialize(tagManagerArgs); | |
// react-gtm-module event | |
const dataLayer = window.dataLayer || []; | |
dataLayer.push({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query findCompany { | |
apple: company(id: "2") { | |
...companyDetails | |
} | |
google: company(id: "1") { | |
...companyDetails | |
} | |
} | |
fragment companyDetails on Company { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.sortLetters = function() { | |
return this.toLowerCase().split('').sort().join(''); | |
} | |
var isAnagram = function(test, original) { | |
return test.sortLetters() == original.sortLetters(); | |
}; | |
// This is to show how to make a simple String Prototype for an anagram. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Nox() { | |
const [data, setData] = React.useState({}); | |
React.useEffect(() => { | |
axios.get('/nox-daily-message').then(({ data }) => { | |
setData(data); | |
}); | |
}, []); | |
return data.ywmib ? <strong>{data.ywmib}</strong> : <div>Loading...</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import CommentBox from "../CommentBox"; | |
it("shows a comment box ", () => { | |
// make a div | |
const div = document.createElement("div"); | |
// shows the div we created | |
ReactDOM.render(<App />, div); | |
// Looks inside the div |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function perimeter(num) { | |
let a = 1, | |
b = 0, | |
temp, | |
arr = []; | |
while (num >= 0) { | |
temp = a; | |
a = a + b; | |
b = temp; | |
arr.push(b); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function numberToDashes(num) { | |
let array = []; | |
for (let i = 0; i < num; i++) { | |
const element = array.push("-"); | |
} | |
return array.join('') | |
} | |
function numToDashes(num) { | |
return "-".repeat(num); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function copyAndSortNumbers(numbers) { | |
return numbers.concat().sort(); | |
} | |
/* Do not modify code below this line */ | |
const original = [1, 7, 3, 5]; | |
const sortedCopy = copyAndSortNumbers(original); | |
console.log(original, '<-- should be [1, 7, 3, 5]'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getAverageTestScore(scores) { | |
var total = 0; | |
for (var i = 0; i < scores.length; i++) { | |
total += scores[i]; | |
} | |
const avg = total / scores.length; | |
// const avg = scores.reduce((a, b) => a+b )/ scores.length; | |
return avg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.hexagon { | |
position: relative; | |
width: 100px; | |
height: 57.74px; | |
background-color: #6a08ca; | |
margin: 28.87px 0; | |
box-shadow: 0 0 20px rgba(222,189,255,0.45); | |
border-left: solid 4px #333333; | |
border-right: solid 4px #333333; | |
} |
NewerOlder