- Tipos de variáveis, escopo e closures (
var
,let
,const
, escoposfunction
e{}
) - Tipos e coerção (
Boolean
,null
,undefined
,Number
,String
,Object
,Symbol
e tabela de coerção) this
,prototype
s e classes- Assincronia (
event loop
,setTimeout
,setInterval
,setImmediate
,process.nextTick
,Promise
,function*
,coroutine
s easync
await
)
This file contains hidden or 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
#!/bin/bash | |
# pass name via $1 | |
ssh-keygen -t rsa -b 4096 -f ~/.ssh/$1 |
This file contains hidden or 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
--- program structure --- | |
// a Jack program is a collection of files, each should represent a class like the one below | |
class = "class" className '{' classVarDec* fnDec* '}' ; | |
classVarDec = ("static" | "field") type varName (',' varName)* ';' ; | |
fnDec = ("constructor" | "function" | "method") ("void" | type) fnName '(' paramList ')' fnBody ; | |
paramList = ( (type varName) (',' type varName)* )? ; | |
fnBody = '{' varDec* statements '}' ; | |
varDec = "var" type varName (',' type varName)* ';' ; | |
type = primitive | className ; |
This file contains hidden or 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
// Cargo.toml dependencies: | |
// hex = "0.4.3" | |
// ethabi = "16.0.0" | |
use ethabi::*; | |
use ethabi::ParamType::*; | |
use ethabi::StateMutability::*; | |
fn main() { |
This file contains hidden or 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
struct In { | |
a: bool, | |
b: bool, | |
} | |
#[derive(Debug, PartialEq)] | |
struct Out { | |
out: bool, | |
} |
This file contains hidden or 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
const assert = require('assert') | |
function test(title, fn) { | |
try { | |
fn() | |
console.log(`✅ '${title}' test passed`) | |
} catch (error) { | |
console.error(`❌ '${title}' test failed`) | |
throw error | |
} |
This file contains hidden or 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
const getChunk = (arr, from, size) => { | |
const clampedFrom = (from + size) > arr.length | |
// Trying to get chunk bigger than end of array. | |
// Here we reduce `from` so that the chunk size is always preserved. | |
? arr.length - size | |
: from | |
return arr.slice(clampedFrom, from + size) | |
} |
This file contains hidden or 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
document.querySelectorAll('ul.mn-invitation-list button.artdeco-button--secondary').forEach(btn => btn.click()) |
This file contains hidden or 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
class MyNumber extends Number implements Monoid<MyNumber> { | |
public x: Number; | |
constructor(x: Number) { | |
super(x) | |
this.x = x; | |
} | |
toString(): string { | |
return this.x.toString() | |
} |
This file contains hidden or 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
const data = [ | |
{ | |
category: 'action', | |
value: 'jorgs' | |
}, | |
{ | |
category: 'comedy', | |
value: 'lucians' | |
}, | |
{ |