Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script class="jsbin" src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js" type="text/javascript"></script>
<script src="jquery.validate.cpf.js"></script>
<script type="text/javascript">
$(function () {
var $cpf = $("#id_cpf").attr("name");
var $params = {debug:false, rules:{}, messages:{}};
<?php
### --- Snip --- ###
App::after(function($request, $response)
{
// HTML Minification
if(App::Environment() != 'local')
{
if($response instanceof Illuminate\Http\Response)
@edyonil
edyonil / auth.markdown
Last active August 29, 2015 14:06 — forked from mlynch/auth.markdown

Single Page Apps are ruling the world and AngularJS is leading the charge. But many of the lessons we learned in the Web 2.0 era no longer apply, and few are as drastically different as authentication.

CORS

CORS is an oft-misunderstood feature of new browsers that is configured by a remote server. CORS stands for Cross-Origin-Resource-Sharing, and was designed to make it possible to access services outside of the current origin (or domain) of the current page.

Like many browser features, CORS works because we all agree that it works. So all major browsers like Chrome, Firefox, and IE support and enforce it. By using these browsers, you benefit from the security of CORS.

That means certain browsers do not enforce it, so it is not relevant there. One large example is a native Web View for things like Cordova and Phonegap. However, these tools often have configuration options for whitelisting domains so you can add some security that way.

loginCtrl.facebook = function () {
$cordovaOauth.facebook("MINHA_CHAVE", ['email']).then(function (result) {
displayData(result.access_token);
}, function (error) {
console.log(JSON.stringify(error))
});
};
@edyonil
edyonil / gulpfile.js
Created March 15, 2016 01:09 — forked from edouard-lopez/gulpfile.js
Gulp copy font-awesome files to dist/ directory
'use strict';
// Generated on 2014-04-14 using generator-leaflet 0.0.14
var gulp = require('gulp');
var open = require('open');
var wiredep = require('wiredep').stream;
// Load plugins
var $ = require('gulp-load-plugins')();
@edyonil
edyonil / local_scope_repositorio.php
Created March 16, 2016 23:41
local_scope_repositorio.php
<?php
use Illuminate\Database\Eloquent\Model;
class Telefone extends Model {
public function scopeFilter($query)
{
$value = session('key');
FROM php:7-fpm
RUN apt-get update && apt-get upgrade -y && apt-get autoremove -y \
&& pecl install xdebug \
&& rm -rf /tmp/pear \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)\n" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_enable=on\n" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_autostart=off\n" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_port=9001\n" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_host="/sbin/ip route|awk '/default/ { print $3 }' >> /usr/local/etc/php/conf.d/xdebug.ini
[
{
"id": 10,
"nome": "Mesa",
"categoria": {
"id": 1,
"nome": "Móveis"
},
"semelhantes": []
},
@edyonil
edyonil / mapping_client.json
Created August 30, 2017 13:58
Mapeamento dos dados de client
{
"settings": {
"analysis": {
"analyzer": {
"ascii_folding": {
"tokenizer": "standard",
"filter": [
"standard",
"asciifolding"
]