Skip to content

Instantly share code, notes, and snippets.

View raank's full-sized avatar

Felipe Rank raank

  • Self-Employeer
  • SC - BR
View GitHub Profile
$(document).ready(function() {
$('#num').bind('paste', function() {
var hasNum = somenteNumeros( $(this).val() );
if( hasNum.length == 0 ) {
alert('Somente números');
} else {
console.log('legal');
}
});
var url = "get_data.php";
var params = "lorem=ipsum&name=binny";
http.open("POST", url, true);
//Send the proper header information along with the request
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");
http.onreadystatechange = function() {//Call a function when the state changes.
@raank
raank / Event.php
Last active October 25, 2016 00:10
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Event extends Model
{
protected $table = 'events';
@raank
raank / events.php
Last active October 24, 2016 23:40
<?php
public function test()
{
return $this->hasMany(ModelConfirmeds::class, 'idanunciante');
}
<?php
Route::group([
'prefix' => 'anunciante',
'middleware' => 'anun'
], function() {
Route::get('', 'Anunciante@index');
});
Route::group([
@raank
raank / myChart.js
Last active October 18, 2016 18:11
var myChart9Theme = {
type: 'bar',
data: {
labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
datasets: [{
label: '# of Votes',
data: [12, 19, 3, 5, 2, 3],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use DB, Auth, Redirect;
use App\User;
use App\Anunciante;
use Illuminate\Support\Facades\Input;
use App\Http\Requests;
<!DOCTYPE html>
<html>
<head>
<title>GO2FUN </title>
<link href="/css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
<link rel="stylesheet" href="/vendor/bootstrap/css/bootstrap.css"/>
<link rel="stylesheet" href="/dist/css/formValidation.css"/>
<link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
<style>
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Support\Facades\Auth;
class RedirectIfAuthenticated
{
/**
<?php
Route::get('redirecting', function() {
if(\Auth::user()->permission == 'anunciante') {
return redirect('anunciante/home');
} else {
return redirect('user/home');
}
});