Source : Learn to combine RxJs sequences with super intuitive interactive diagrams
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
def run_pg_fouine(): | |
info = host_info[env.host_string] | |
db_name = info.tags.get('Name') | |
sudo('perl -pi -e "s/log_min_duration_statement = .*/log_min_duration_statement = 0/" /etc/postgresql/9.*/main/postgresql.conf') | |
sudo('/etc/init.d/postgresql reload') | |
time.sleep(30) | |
sudo('perl -pi -e "s/log_min_duration_statement = .*/log_min_duration_statement = 500/" /etc/postgresql/9.*/main/postgresql.conf') | |
sudo('/etc/init.d/postgresql reload') | |
run('tail -n 100000 /var/log/postgresql/postgresql-9.*-main.log > /tmp/pgfouine.txt') | |
run('gzip -f /tmp/pgfouine.txt') |
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
Complete installation process: | |
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get install -y python-software-properties python make build-essential g++ curl libssl-dev apache2-utils git libxml2-dev | |
sudo apt-get update | |
sudo apt-get upgrade | |
cd ~ | |
mkdir git | |
cd ~/git |
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
package main | |
import ( | |
"fmt" | |
"reflect" | |
) | |
type Foo struct { | |
FirstName string `tag_name:"tag 1"` | |
LastName string `tag_name:"tag 2"` |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Folder Structure</title> | |
<style> | |
.container { | |
display: block; |
We need to create a virtual env for our app to run in: More Here Run this command in whatever folder you want to create your venv folder
python -m venv ./venv
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
const getDataFromInscricao = ( inscricao ) => [ | |
inscricao.substr( inscricao.length - 2, 2 ), | |
inscricao.substr( inscricao.length - 4, 2 ), | |
inscricao.substr( 0, inscricao.length - 2 ) | |
] | |
const calcSum1 = ( titulo ) => | |
titulo.substr( 0, 8 ).split( '' ).reduce( ( total, val, i ) => total += val * ( 9 - i ), 0 ) | |
const fixDigit = ( exce ) => ( dig ) => |
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
const getDigit = ( cpf ) => cpf.slice( 9 ) | |
const mod11 = ( num ) => num % 11 | |
const generateArrayOfLength = ( length ) => Array.from( { length }, ( v, k ) => k ) | |
const invalidCpfs = generateArrayOfLength( 10 ).map( val => `${ val }`.repeat( 11 ) ) | |
const isEqual = ( val1 ) => ( val2 ) => val1 === val2 | |
const isIn = ( list ) => ( num ) => list.findIndex( isEqual( num ) ) >= 0 | |
const isInInvalidCpf = isIn( invalidCpfs ) | |
const NOT = ( val ) => !val | |
const getCpfAsArrayWithoutDigit = ( cpf ) => cpf.split( '' ).slice( 0, 9 ) | |
const calcSumDigit = ( multiplier, digit, sum ) => sum + ( digit * multiplier ) |
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
const ehMultiplo = ( multiplo ) => ( ano ) => ano % multiplo === 0 | |
const nao = ( entrada ) => !entrada | |
const ehMultiploDe400 = ehMultiplo( 400 ) | |
const ehMultiploDe4 = ehMultiplo( 4 ) | |
const ehMultiploDe100 = ehMultiplo( 100 ) | |
const ehBissexto = ( ano ) => (ehMultiploDe400( ano ) || (ehMultiploDe4( ano ) && nao(ehMultiploDe100( ano )))) | |
console.log(ehBissexto(2016)) | |
console.log(ehBissexto(1600)) |
NewerOlder