Skip to content

Instantly share code, notes, and snippets.

View bengitiger's full-sized avatar
🐶
I may be slow to respond.

Bengi bengitiger

🐶
I may be slow to respond.
View GitHub Profile
@bengitiger
bengitiger / flutter_setup.md
Created May 28, 2020 11:52 — forked from bradtraversy/flutter_setup.md
Flutter dev setup & notes
@bengitiger
bengitiger / cloudSettings
Last active June 11, 2020 16:33 — forked from psychonetic/CustomVeeValidator
Vue-Dropzone and Vee-Validate
{"lastUpload":"2020-06-11T16:33:41.676Z","extensionVersion":"v3.4.3"}
@bengitiger
bengitiger / laravel-global-exception-handler.php
Created January 18, 2019 13:02 — forked from cballou/laravel-global-exception-handler.php
Global handling of Laravel exceptions to better support AJAX requests.
<?php namespace App\Exceptions;
use Log;
use Mail;
use Config;
use Exception;
use Illuminate\Auth\Access\UnauthorizedException;
use Illuminate\Session\TokenMismatchException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
// Make sure to put this at the top of your AppServiceProvider: use Illuminate\Support\Facades\Validator;
Validator::extend('youtube', function ($attribute, $value, $parameters, $validator) {
preg_match("#(?<=v=)[a-zA-Z0-9-]+(?=&)|(?<=v\/)[^&\n]+(?=\?)|(?<=v=)[^&\n]+|(?<=youtu.be/)[^&\n]+#", $value, $matches);
return count($matches) > 0;
}, "Sorry, this doesn't look like a valid youtube URL");
@bengitiger
bengitiger / pull-request-template.md
Created December 27, 2018 10:16 — forked from Lordnibbler/pull-request-template.md
Sample Pull Request Template

Status

READY/IN DEVELOPMENT/HOLD

Migrations

YES | NO

Description

A few sentences describing the overall goals of the pull request's commits.

Related PRs

@bengitiger
bengitiger / eloquent-cheatsheet.php
Created October 11, 2018 17:23 — forked from hassansin/eloquent-cheatsheet.php
Laravel 5 Eloquent CheatSheet #laravel #eloquent
Model::
/*Select*/
select('col1','col2')
->select(array('col1','col2'))
->select(DB::raw('businesses.*, COUNT(reviews.id) as no_of_ratings, IFNULL(sum(reviews.score),0) as rating'))
->addSelect('col3','col4')
->distinct() // distinct select
/*From*/
@bengitiger
bengitiger / README.md
Created January 15, 2018 02:01
Sequelize + Express + Migrations + Seed Starter
@bengitiger
bengitiger / gist:1a1a0ded3de9f042fa3a9f7d29d28e0a
Created January 13, 2018 10:54 — forked from pranildasika/gist:2964211
Virtual fields using getter and setter methods in sequelize
var Sequelize = require('sequelize')
var sequelize = new Sequelize('sequelize_test', 'root')
//Note that the model definition does not have "fullName"
var User = sequelize.define('User', {
email: Sequelize.STRING,
firstName: Sequelize.STRING,
lastName: Sequelize.STRING,
},
{
@bengitiger
bengitiger / .eslintrc.js
Created March 15, 2017 00:48 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@bengitiger
bengitiger / ezpdo.php
Last active August 29, 2015 14:25 — forked from kijin/ezpdo.php
<?php
/**
* Easy PDO for PHP 5.x
* Version 1.2
*
* Copyright (c) 2009-2014 Kijin Sung <kijin@kijinsung.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal