- HTML
<div *ngIf="item.length > 0">
// create a bookmark and use this code as the URL, you can now toggle the css on/off | |
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3 | |
javascript: (function() { | |
var domStyle = document.createElement("style"); | |
domStyle.append( | |
'* { color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }\ | |
* * { background-color: rgba(0,255,0,.2) !important; }\ | |
* * * { background-color: rgba(0,0,255,.2) !important; }\ | |
* * * * { background-color: rgba(255,0,255,.2) !important; }\ | |
* * * * * { background-color: rgba(0,255,255,.2) !important; }\ |
[alias] | |
ci = commit | |
co = checkout | |
cm = checkout master | |
cb = checkout -b | |
st = status -sb | |
sf = show --name-only | |
lg = log --pretty=format:'%Cred%h%Creset %C(bold)%cr%Creset %Cgreen<%an>%Creset %s' --max-count=30 | |
incoming = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u}) | |
outgoing = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..) |
// time and time end | |
console.time("This"); | |
let total = 0; | |
for (let j = 0; j < 10000; j++) { | |
total += j | |
} | |
console.log("Result", total); | |
console.timeEnd("This"); | |
// Memory |
TypeScript 25 hrs 24 mins βββββββββββββββββββββ 79.7% | |
JavaScript 2 hrs 45 mins βββββββββββββββββββββ 8.7% | |
Docker 1 hr 28 mins βββββββββββββββββββββ 4.6% | |
Markdown 36 mins βββββββββββββββββββββ 1.9% | |
Other 36 mins βββββββββββββββββββββ 1.9% |
const numbers = [ 2, 4, 8, 9 ] | |
const addTwo = number => number + 1 | |
const isMoreThan5 = number => number > 5 | |
const result = | |
//numbers.filter(isMoreThan5) | |
filterArray(isMoreThan5, numbers) | |
//mapArray(addTwo, numbers | |
result | |
function filterArray(predicate, array) { |
const isMoreThan5 = number => number > 5 | |
const numbers = [ 2, 4, 8, 9 ] | |
const result = filter(isMoreThan5, numbers) | |
const addThree = number => number + 3 | |
const result = map(addThree, numbers) | |
result | |
function map(transform, array) { | |
const initialArray = [] | |
const mapReducer = (mappedArray, currentItem) => |
import { useRef } from 'react'; | |
const usePromise = () => { | |
const ref = []; | |
const container = useRef(ref); | |
ref[0] = new Promise((resolve, reject) => { | |
ref[1] = resolve; | |
ref[2] = reject; | |
}); |