Skip to content

Instantly share code, notes, and snippets.

View omarkdev's full-sized avatar

Marcos Felipe omarkdev

View GitHub Profile
@omarkdev
omarkdev / sendContactVanilla.js
Created January 31, 2017 00:34
Send form contact with vanilla js
var formFooter = document.getElementById("form-footer");
formFooter.addEventListener("submit", function(evt) {
evt.preventDefault();
formFooter.classList.add("form-submit");
var name = document.getElementById("name");
var email = document.getElementById("email");
var telephone = document.getElementById("telephone");
var cellphone = document.getElementById("cellphone");
<?php
namespace Smart\Traits\Models;
use File;
use Illuminate\Http\UploadedFile;
trait CoverTrait{
/**
* Upload image when image is set
*
<?php
namespace Sherlock\Traits;
trait DateTrait {
protected $months = [
'Jan' => 'janeiro',
'Feb' => 'fevereiro',
'Mar' => 'março',
'Apr' => 'abril',
'May' => 'maio',
<?php
namespace App\Http\Controllers\Auth;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Models\User;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Auth;
use SammyK\LaravelFacebookSdk\LaravelFacebookSdk;
<?php
namespace ArtisanPlus\Repositories;
use Illuminate\Support\Facades\Schema;
use Carbon\Carbon;
class TableRepository {
/**
* Implements orderBy in query
*
const quiz = new Vue({
el: "#quiz",
data() {
return {
product: {},
show: {},
choices: {
questions: [],
options: []
},
<?php
Validator::extend('cpf', function($attribute, $value, $params, $validator){
$cpf = $value;
$cpf = preg_replace('/[^0-9]/', '', $cpf);
$cpf = str_pad($cpf, 11, '0', STR_PAD_LEFT);
if (strlen($cpf) != 11)
return false;
$cpfsCheck = [
'00000000000',
'11111111111',
@omarkdev
omarkdev / vuejs-filter-camel-case-filter.js
Created December 16, 2016 14:52
VueJS filter camel case
/**
* Converts a string to camel case.
* Example: fucking_string => fuckingString
*
* @param {String} str the string to convert
* @return {String}
*/
Vue.filter('camelCase', function (str) {
return str.toLowerCase()
.replace( /[-_]+/g, ' ')
<?php
namespace Smart\Traits\Models;
trait RoleTrait {
/**
* Roles existed in application
*
* @var
*/
protected $configRoles;
@omarkdev
omarkdev / FreightPostOfficeService.php
Last active December 14, 2016 21:13
Calcular frete dos correios com Laravel
<?php
class FreightPostOfficeService {
/**
* Source zip code to calculate the freight
*
* @var
*/
public $sourceZipCode;
/**