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
@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';
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.
$(document).ready(function() {
$('#num').bind('paste', function() {
var hasNum = somenteNumeros( $(this).val() );
if( hasNum.length == 0 ) {
alert('Somente números');
} else {
console.log('legal');
}
});
function isNumber( $value ) {
var $inputs = document.getElementsByClassName('num-input');
for ( i = 0; i <= $inputs.length; i++ )
{
if(!isNaN( $inputs[i].value )){
exit();
} else {
alert('O número digitado não é válido');
$inputs[i].value = "";
}
@raank
raank / Test.php
Last active October 28, 2016 20:05
<?php
$at = 'teste';
$this->body = sprintf("[%s] %s in %s line %d\n\n%s\n\n%s", $at, $classname, $filename, $line, $message, $trace);
<?php
class Teste extends Model
{
protected $appends = [ 'num_processo' ];
function getNumProcessoAttribute() {
return $this->attributes['numero'];
}
}
<?php
namespace FlyingLuscas\BugNotifier;
class MessageTest extends TestCase
{
/**
* @dataProvider dataExceptionProvider
*/
public function testMessageTitleOutput($e)
<?php
namespace FlyingLuscas\BugNotifier;
class Message
{
/**
* The title of the message.
*
* @var string
@raank
raank / cmd
Created October 29, 2016 02:09
raank: /var/www/github/Laravel-BugNotifier (improv-msg-date)$ composer test
> phpunit
PHPUnit 5.6.2 by Sebastian Bergmann and contributors.
Runtime: PHP 7.0.12-1+deb.sury.org~xenial+1
Configuration: /var/www/github/Laravel-BugNotifier/phpunit.xml.dist
Error: No code coverage driver is available
......FFFF 10 / 10 (100%)
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: 29-Out-2016 às 21:01
-- Versão do servidor: 5.7.16-0ubuntu0.16.04.1
-- PHP Version: 7.0.12-1+deb.sury.org~xenial+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";