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
<?php | |
public function onCep($param) | |
{ | |
$obj = new Cliente; // create an empty object | |
$obj->fromArray( (array) $param); // load the object with data | |
if (!empty($obj->cep)) { | |
$cep = preg_replace('/\D/', '', $obj->cep); | |
$rest = @file_get_contents( | |
"https://viacep.com.br/ws/{$cep}/json/" |
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
<?php | |
use Illuminate\Database\Capsule\Manager as Capsule; | |
use Illuminate\Events\Dispatcher; | |
use Illuminate\Container\Container; | |
/** | |
* Slim 3.x shipped with the Pimple container implementation and enabled the following synthax | |
*/ | |
$app = new \Slim\App([...]); |
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
#!/bin/bash | |
{ # This ensures the entire script is downloaded | |
ROOT_UID=0 | |
ARRAY_SEPARATOR="#" | |
OS="" | |
OS_VERSION="" | |
PROJECT="" | |
PACKAGE="" |
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
#!/bin/bash | |
# | |
# This script remove malware of PHP files. | |
# | |
# In this case it will remove some malicious code | |
# from all Wordpress PHP files that is at top of | |
# every PHP file. | |
# | |
# The string at the top of every file is: | |
# |
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
/*! | |
* Classe SagaWebSocket | |
* | |
* @author Ramon Barros [contato@ramon-barros.com] | |
* @date 2018-03-16 | |
* Copyright (c) 2018 Ramon Barros | |
*/ | |
/* jslint devel: true, unparam: true, indent: 2 */ | |
(function (window, $, Promise) { | |
'use strict'; |
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
# File: ~/bash_aliases | |
# Author: Oliver Michels <oliver.michels@gmx.net> | |
# Desc: Definition of some useful aliases for the bash | |
# Some common shortcuts for file-/directory commands | |
alias ls='ls --color=auto' | |
alias la='ls -a' | |
alias ll='ls -l' | |
alias lla='ls -la' | |
alias l='ls' |
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
/** | |
* Emulate FormData for some browsers | |
* MIT License | |
* (c) 2010 François de Metz | |
*/ | |
/* jslint devel: true, unparam: true, quotmark: double, indent: 2 */ | |
(function(w) { | |
"use strict"; | |
if (w.FormData) { | |
return; |
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
/*! | |
* Name JavaScript Plugin/Library v0.0.0 | |
* http://public.ramon-barros.com/ | |
* | |
* Copyright 2012, Ramon Barros | |
* Licensed | |
* | |
* Includes .js | |
* http://.com/ | |
* Copyright 2011, |
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
// Author: Ramon Barros <contato@ramon-barros.com> | |
/* jslint devel: true, unparam: true, indent: 4 */ | |
/* global $,document,window,event,url,introJs,XMLHttpRequest,ActiveXObject,onlyNumbers */ | |
function validarCPF(doc) { | |
'use strict'; | |
var i, cpf = doc.replace(/\D/g, ''), pattern = /^(\d{1})\1{10}$/, sum, mod, digit; | |
if (cpf.length !== 11) { | |
return false; | |
} |
NewerOlder