Skip to content

Instantly share code, notes, and snippets.

View micheleriva's full-sized avatar
🍄
Building Orama

Michele Riva micheleriva

🍄
Building Orama
View GitHub Profile
JavaScript 5 hrs ███████▎░░░░░░░░░░░░░ 35.1%
TypeScript 4 hrs 56 mins ███████▎░░░░░░░░░░░░░ 34.6%
JSON 1 hr 4 mins █▌░░░░░░░░░░░░░░░░░░░ 7.5%
Go 52 mins █▎░░░░░░░░░░░░░░░░░░░ 6.1%
Other 36 mins ▉░░░░░░░░░░░░░░░░░░░░ 4.3%
@micheleriva
micheleriva / jsmonday-carbon.json
Created July 22, 2019 20:08
JSON configuration for the JSMonday Carbon template
{
"paddingVertical":"0px",
"paddingHorizontal":"0px",
"marginVertical":"45px",
"marginHorizontal":"45px",
"backgroundImage":null,
"backgroundImageSelection":null,
"backgroundMode":"color",
"backgroundColor":"rgba(255,255,255,0)",
"dropShadow":true,
[1, 2, 3, 4, 5].map((item) => {
const evenOrOdd = item % 2 > 0 ? "odd" : "even";
console.log(`${item} is ${evenOrOdd}`)
})
// 1 is odd
// 2 is even
// 3 is odd
[1, 2, 3, 4, 5].map((item) => {
const evenOrOdd = item % 2 > 0 ? "odd" : "even";
console.log(`${item} is ${evenOrOdd}`)
return evenOrOdd;
})
// 1 is odd
// 2 is even
const integers = [1, 2, 3, 4, 5].map((item) => item * 2);
// [2, 4, 6, 8, 10]
const strings = ["one", "two", "three"].map((item, index) => `${index + 1} ${item}`)
// ["1 one", "2 two", "3 three"]
const mixedTypes = [undefined, null, "foo", 123, NaN, Symbol].map((item) => typeof item)
// ["undefined", "object", "string", "number", "number", "function"]
var arr = [0, 1, 2, 3, 4, 5];
var newArray = [];
for (var i = 0; i < arr.length; i++) {
newArray.push(i * 2);
}
const arr = [0, 1, 2, 3, 4, 5]
const newArray = arr.map((number) => number * 2)
var arr = [0, 1, 2, 3, 4, 5];
for (var i = 0; i < arr.length; i++) {
arr[i] = i * 2;
}
<template>
<div ref="content"> Hi! </div>
</template>
<script>
export default {
name: "someComponent",
data() {
return {
contentClass: ""
<div id="content"> Hi! </div>
<script type="text/javascript">
var content = $("#content");
content.addClass("foo")
</script>