Anotações de estudos de Javascript
Declaração de Arrays
var arr = [1, "string", boolean];
var = new Array();| ": | |
| " ███▄ █ ▓█████ ▒█████ ██▒ █▓ ██▓ ███▄ ▄███▓ | |
| " ██ ▀█ █ ▓█ ▀ ▒██▒ ██▒▓██░ █▒▓██▒▓██▒▀█▀ ██▒ | |
| " ▓██ ▀█ ██▒▒███ ▒██░ ██▒ ▓██ █▒░▒██▒▓██ ▓██░ | |
| " ▓██▒ ▐▌██▒▒▓█ ▄ ▒██ ██░ ▒██ █░░░██░▒██ ▒██ | |
| " ▒██░ ▓██░░▒████▒░ ████▓▒░ ▒▀█░ ░██░▒██▒ ░██▒ | |
| " ░ ▒░ ▒ ▒ ░░ ▒░ ░░ ▒░▒░▒░ ░ ▐░ ░▓ ░ ▒░ ░ ░ | |
| " ░ ░░ ░ ▒░ ░ ░ ░ ░ ▒ ▒░ ░ ░░ ▒ ░░ ░ ░ | |
| " ░ ░ ░ ░ ░ ░ ░ ▒ ░░ ▒ ░░ ░ | |
| " ░ ░ ░ ░ ░ ░ ░ ░ |
| version: "3" | |
| services: | |
| dev-gam-app-postgres-compose: | |
| image: postgres | |
| environment: | |
| POSTGRES_PASSWORD: "Postgres2019!" | |
| ports: | |
| - "15432:5432" | |
| volumes: |
| screen(){ | |
| ffmpeg \ | |
| -f x11grab -s 1366x768 -r 30 -i :0.0+0,0 \ | |
| -f pulse -ac 2 -ar 44100 -i music_sink.monitor \ | |
| -f pulse -ac 1 -ar 44100 -i alsa_input.usb-JABRA_GN_2000_MS_USB-00.analog-mono \ | |
| -filter_complex amix=inputs=2 \ | |
| -vcodec libx264 -preset ultrafast -crf 18 \ | |
| -acodec libmp3lame -ar 44100 -q:a 1 \ | |
| $1.mp4 | |
| } |
| version: '2' | |
| services: | |
| wordpress: | |
| depends_on: | |
| - db | |
| image: wordpress:latest | |
| restart: always | |
| volumes: | |
| - ./wp-content:/var/www/html/wp-content | |
| environment: |
| function chama_ancora(ancora) | |
| { | |
| //this.location = "#" + ancora; | |
| } | |
| function ajaxGet(url,elemento_retorno,exibe_carregando){ | |
| /****** | |
| * ajaxGet - Coloca o retorno de uma url em um elemento qualquer | |
| * Use a vontade mas coloque meu nome nos créditos. Dúvidas, me mande um email. | |
| * Versão: 1.2 - 20/04/2006 |
| live() { | |
| INRES="1680x1050" | |
| OUTRES="1280x720" | |
| FPS="30" | |
| GOP="60 | |
| GOPMIN="30" | |
| THREADS="2" | |
| CBR="2500k" | |
| QUALITY="superfast" | |
| AUDIO_RATE="44100" |
| *{ | |
| margin: 0; | |
| padding: 0; | |
| } | |
| body{ | |
| font-family: 'Open Sans', Arial, sans-serif; | |
| font-size: 15px; | |
| color: #fff; | |
| overflow: hidden; | |
| } |
| let loadUser = () => { | |
| const xhr = new XMLHttpRequest(); | |
| xhr.open('GET', 'https://api.github.com/users/leanfj', true); | |
| xhr.onload = () => { | |
| let user = JSON.parse(xhr.responseText) | |
| console.log(user); | |
| } | |
| xhr.send(); | |
| } | |
| loadUser(); |
| /* ================================================================== | |
| Contact Form | |
| ================================================================== */ | |
| $("#do-submit-btn").on('click',function() { | |
| var proceed = true; | |
| //simple validation at client's end | |
| //loop through each field and we simply change border color to red for invalid fields | |
| $("#contact-form input, #contact-form textarea").each(function(){ | |
| $(this).css('border-color',''); |