Deriving a new Array from an existing Array:
['■','●','▲'].slice(1, 3) ⟼ ['●','▲']
['■','●','■'].filter(x => x==='■') ⟼ ['■','■']
['▲','●'].map(x => x+x) ⟼ ['▲▲','●●']
['▲','●'].flatMap(x => [x,x]) ⟼ ['▲','▲','●','●']
nest new hello-nest
yarn install
If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:
let
and const
statements. For the purposes of the React documentation, you can consider them equivalent to var
.class
keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this
in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Javconst TAPI_SECRET = '1ebda7d457ece1330dff1c9e04cd62c4e02d1835968ff89d2fb2339f06f73028'; | |
const EXPECTED_TAPI_MAC = '7f59ea8749ba596d5c23fa242a531746b918e5e61c9f6c8663a699736db503980f3a507ff7e2ef1336f7888d684a06c9a460d18290e7b738a61d03e25ffdeb76'; | |
const MESSAGE = '/tapi/v3/?tapi_method=list_orders&tapi_nonce=1'; | |
const crypto = require('crypto'); | |
const hmac = crypto.createHmac('sha512', TAPI_SECRET); | |
hmac.update(MESSAGE); | |
const TAPI_MAC = hmac.digest('hex'); |
## Forked from https://gist.github.com/dersam/0ec781e8fe552521945671870344147b | |
## Also received help from https://twitter.com/gitkraken/status/691675309725368321 | |
## Open GitKraken using the current repo directory. | |
## This code is for fish shell. The same thing can be done in bash | |
## by creating an alias with the command below. | |
## `1>/dev/null` directs logs from the terminal | |
## `&` allows use of the same terminal instance to do other things |
CREATE TABLE `clientes` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`nome` varchar(500) NOT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
<?php | |
if (!function_exists('array_group_by')) { | |
/** | |
* Groups an array by a given key. | |
* | |
* Groups an array into arrays by a given key, or set of keys, shared between all array members. | |
* | |
* Based on {@author Jake Zatecky}'s {@link https://github.com/jakezatecky/array_group_by array_group_by()} function. | |
* This variant allows $key to be closures. |
<select> | |
<option value="">Selecione</option> | |
<option value="AC">Acre</option> | |
<option value="AL">Alagoas</option> | |
<option value="AP">Amapá</option> | |
<option value="AM">Amazonas</option> | |
<option value="BA">Bahia</option> | |
<option value="CE">Ceará</option> | |
<option value="DF">Distrito Federal</option> | |
<option value="ES">Espirito Santo</option> |
<?php | |
/* | |
* Password protect a WordPress site, with a redirect to the requested URL after successful login | |
* | |
* Based on: | |
* http://wordpress.stackexchange.com/a/64999 | |
* http://kovshenin.com/2012/current-url-in-wordpress/ | |
* | |
**/ |
// first go to https://www.facebook.com/groups/XXXX/members/ | |
// then paste this in the javascript console | |
deleteAll = []; | |
deleteAll.elms = []; | |
deleteAll.canClick = function (el) { | |
return (typeof el != 'undefined') && (typeof el.click != 'undefined'); | |
} | |
deleteAll.load = function() { |