Provider | Singleton | Instantiable | Configurable |
---|---|---|---|
Constant | Yes | No | No |
Value | Yes | No | No |
Service | Yes | No | No |
Factory | Yes | Yes | No |
Decorator | Yes | No? | No |
Provider | Yes | Yes | Yes |
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
curl -fsSL https://get.docker.com -o get-docker.sh | |
sudo sh get-docker.sh | |
sudo groupadd docker | |
sudo usermod -aG docker $USER | |
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose |
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
$estados = array( "AC", "AL", "AM", "AP", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RO", "RS", "RR", "SC", "SE", "SP", "TO" ); |
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 removeAcento (text) | |
{ | |
text = text.toLowerCase(); | |
text = text.replace(new RegExp('[ÁÀÂÃ]','gi'), 'a'); | |
text = text.replace(new RegExp('[ÉÈÊ]','gi'), 'e'); | |
text = text.replace(new RegExp('[ÍÌÎ]','gi'), 'i'); | |
text = text.replace(new RegExp('[ÓÒÔÕ]','gi'), 'o'); | |
text = text.replace(new RegExp('[ÚÙÛ]','gi'), 'u'); | |
text = text.replace(new RegExp('[Ç]','gi'), 'c'); | |
return text; |
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 isEquivalent(a, b) { | |
// Create arrays of property names | |
var aProps = Object.getOwnPropertyNames(a); | |
var bProps = Object.getOwnPropertyNames(b); | |
// If number of properties is different, | |
// objects are not equivalent | |
if (aProps.length != bProps.length) { | |
return false; | |
} |
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 debounce(fn, delay){ | |
let timer = null | |
return function(){ | |
clearTimeout(timer) | |
setTimeout(function(){ | |
fn() | |
}, delay) | |
} | |
} |
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
# To host on root path just use "<Location />" for http://mydomainname.in | |
# To host on non-root path use "<Location /myreactapp>" for http://mydomainname.in/mypath | |
# If non-root path, don't forgot to add "homepage": "/myreactapp" in your app's package.json | |
<VirtualHost *:80> | |
ServerName mydomainname.in | |
DirectoryIndex index.html | |
DocumentRoot /var/www/html | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined |
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
<?php | |
/*-------------------------------------------------+ | |
| Checks if the http request is an AJAX call. | |
+-------------------------------------------------*/ | |
function is_ajax() { | |
return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && (strtolower(getenv('HTTP_X_REQUESTED_WITH')) === 'xmlhttprequest')); | |
} | |
?> |
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
/* Estilo que será visualizado por smartfones tanto em retrato como em paisagem */ | |
@media only screen | |
and (min-device-width : 320px) | |
and (max-device-width : 480px) { | |
/* Aqui vão os estilos*/ | |
} | |
/* Estilo que será visualizado por smartfones em paisagem */ | |
@media only screen | |
and (min-width : 321px) { |
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 picamera.array import PiRGBArray | |
from picamera import PiCamera | |
import time | |
import sys | |
import cv2 | |
import zbar | |
import Image | |
# Debug mode | |
DEBUG = False |
NewerOlder