Skip to content

Instantly share code, notes, and snippets.

View erikfig's full-sized avatar
🏠
Working from home

Erik Figueiredo erikfig

🏠
Working from home
View GitHub Profile
public function getAll()
{
$data = [];
foreach ($this as $k=>$v) {
$first = (substr($k, 0, 1));
if ($first !== '_')
$data[$k]=$v;
}
/users/
/users/2
GET
POST
PUT
DELETE
- /users/2 - GET - Retornar 1 usuário
- /users/ - GET - Retornar varios usuários
var my_app = angular.module('myApp', [/* dependencies */]);
my_app.config(function($httpProvider) {
$httpProvider.defaults.xsrfHeaderName = 'X-CSRFToken';
});
function tirarAcentos($string){
return preg_replace(array("/(á|à|ã|â|ä)/","/(Á|À|Ã|Â|Ä)/","/(é|è|ê|ë)/","/(É|È|Ê|Ë)/","/(í|ì|î|ï)/","/(Í|Ì|Î|Ï)/","/(ó|ò|õ|ô|ö)/","/(Ó|Ò|Õ|Ô|Ö)/","/(ú|ù|û|ü)/","/(Ú|Ù|Û|Ü)/","/(ñ)/","/(Ñ)/"),explode(" ","a A e E i I o O u U n N"),$string);
}
echo tirarAcentos($string);
<?php
namespace Core\BancoDeDados;
class BancoDeDados
{
private $config, $pdo;
public function __construct(Array $config)
{
$this->config = $config;
}
public function conecta()
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
$path_info = (isset($_SERVER['PATH_INFO']))? $_SERVER['PATH_INFO']: '/';
$path = parse_url($path_info, PHP_URL_PATH);
return $this->router_map->match($path, $_SERVER);
custo_variável
|_tipo1
|_tipo2
|_tributacao
custo_fixo
|_tipo1
|_tipo2
desconto
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true