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
// extension should be: | |
// "quokka-snippets.code-snippets" | |
// is json for gist formatting. | |
{ | |
"Quokka Expression": { | |
"scope": "javascript,typescript", | |
"prefix": "/}", | |
"body": "/*? $1$ */", | |
"description": "Log expression result" |
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
//Given an array that was once sorted in ascending order is rotated at some pivot unknown to you beforehand (so [0,2,4,7,9] //might become [7,9,0,2,4], for example). Find the minimum value in that array in O(n) or less. | |
const arr = [7, 9, 0, 2, 4]; | |
const getMinValue = (arr) => { | |
let left = 1; | |
let right = arr.length - 1; | |
let min = arr[0]; | |
while (left < right) { |
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
//media queries breakpoints | |
@mixin bp($class) { | |
@if $class == xs { | |
@media (max-width: 767px) { @content; } | |
} | |
@else if $class == sm { | |
@media (min-width: 768px) { @content; } | |
} | |