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
| // ajax | |
| var xhr = new XMLHttpRequest(); | |
| xhr.open(method, url, true); | |
| xhr.withCredentials = true; | |
| [...] | |
| // htaccess | |
| SetEnvIf Origin "http(s)?://(www\.)?(example.org)$" AccessControlAllowOrigin=$0 | |
| Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin | |
| Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS" |
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
| # BEGIN WordPress | |
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteBase / | |
| RewriteCond %{REQUEST_URI} ^/$ | |
| RewriteRule ^$ "http://example.org" [R=301,L] | |
| RewriteRule ^index\.php$ - [L] | |
| RewriteCond %{REQUEST_FILENAME} !-f |
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
| function is_cnpj(c) { | |
| var b = [6,5,4,3,2,9,8,7,6,5,4,3,2]; | |
| if((c = c.replace(/[^\d]/g,"")).length != 14) | |
| return false; | |
| if(/0{14}/.test(c)) | |
| return false; | |
| for (var i = 0, n = 0; i < 12; n += c[i] * b[++i]); |
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
| wp: | |
| image: wordpress:latest | |
| ports: | |
| - 80:80 | |
| volumes: | |
| - ./html:/var/www/html/ | |
| environment: | |
| WORDPRESS_DB_NAME: wp | |
| WORDPRESS_DB_USER: root | |
| WORDPRESS_DB_PASSWORD: 123 |
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
| FROM php:5.6-apache | |
| # instala modulos do Apache | |
| RUN a2enmod headers \ | |
| && a2enmod rewrite | |
| # instala extensões do PHP5 | |
| RUN apt-get update && apt-get install -y libmcrypt-dev libpng12-dev libjpeg-dev libpq-dev imagemagick libxml2-dev libfreetype6-dev\ | |
| && rm -rf /var/lib/apt/lists/* \ | |
| && docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr --with-php-config=/usr/local/bin/php-config --with-freetype-dir=/usr/ --enable-gd-native-ttf \ |
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
| // detecta todas as teclas que estão sendo pressionadas | |
| $(document).unbind('keydown').bind('keydown', function (event) { | |
| // filtra apenas a tecla <backspace> | |
| if (event.keyCode === 8) { | |
| // variável que decidirá se a tecla será bloqueada | |
| var doPrevent = true; | |
| // tipos de campos permitidos |
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
| httpd: | |
| image: php5.6 | |
| ports: | |
| - 80:80 | |
| volumes: | |
| - ./home:/home | |
| - ./html:/var/www/html/app | |
| - ./config/apache2:/etc/apache2 | |
| - ./config/php:/usr/local/etc/php | |
| - ./log:/var/log/apache2 |
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
| FROM php:5.6-apache | |
| # install apache modules | |
| RUN a2enmod headers \ | |
| && a2enmod rewrite | |
| # install mongo php driver | |
| RUN apt-get update && apt-get install -y libssl-dev | |
| RUN pecl install mongo |
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
| /** | |
| * Acumulador de alertas | |
| * > use (alert.cumulative = true) para ativar a função acumuladora. | |
| * > use alert.show() para mostrar todas as mensagens acumuladas em um único alert. | |
| * > as mensagens acumuladas ficam armazenadas no array alert.messages. | |
| * | |
| * @author Arthur Araújo | |
| * @date 03/10/2016 | |
| */ | |
| var __alert = alert; |
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
| # lista imagens instaladas | |
| docker images | |
| # remove imagem | |
| docker rmi [ID] | |
| # lista todos os containers criados | |
| docker ps -a | |
| # lista containers ativos |