Skip to content

Instantly share code, notes, and snippets.

Avatar

Arjon Jason Castro ajcastro

View GitHub Profile
@ajcastro
ajcastro / country_dial_info.json
Created Mar 17, 2021 — forked from DmytroLisitsyn/country_dial_info.json
A JSON dataset of entities containing country name, code, dial (phone) code and flag emoji icon.
View country_dial_info.json
[{"name":"Afghanistan","flag":"🇦🇫","code":"AF","dial_code":"+93"},{"name":"Åland Islands","flag":"🇦🇽","code":"AX","dial_code":"+358"},{"name":"Albania","flag":"🇦🇱","code":"AL","dial_code":"+355"},{"name":"Algeria","flag":"🇩🇿","code":"DZ","dial_code":"+213"},{"name":"American Samoa","flag":"🇦🇸","code":"AS","dial_code":"+1684"},{"name":"Andorra","flag":"🇦🇩","code":"AD","dial_code":"+376"},{"name":"Angola","flag":"🇦🇴","code":"AO","dial_code":"+244"},{"name":"Anguilla","flag":"🇦🇮","code":"AI","dial_code":"+1264"},{"name":"Antarctica","flag":"🇦🇶","code":"AQ","dial_code":"+672"},{"name":"Antigua and Barbuda","flag":"🇦🇬","code":"AG","dial_code":"+1268"},{"name":"Argentina","flag":"🇦🇷","code":"AR","dial_code":"+54"},{"name":"Armenia","flag":"🇦🇲","code":"AM","dial_code":"+374"},{"name":"Aruba","flag":"🇦🇼","code":"AW","dial_code":"+297"},{"name":"Australia","flag":"🇦🇺","code":"AU","dial_code":"+61"},{"name":"Austria","flag":"🇦🇹","code":"AT","dial_code":"+43"},{"name":"Azerbaijan","flag":"🇦🇿","code":"AZ","dial_code":"+9
View Laravel Standard Install.txt
composer create-project --prefer-dist laravel/laravel <project_name>
composer require garygreen/pretty-routes predis/predis laravel/telescope tymon/jwt-auth mxl/laravel-job laravel/helpers
composer require --dev styde/enlighten
@ajcastro
ajcastro / cypress_seed.js
Last active Feb 18, 2020
Cypress seed api
View cypress_seed.js
// cy.seed(...) to call a seeder from api
Cypress.Commands.add('seed', (seeder) => {
// here you will notice that we namespaced our seeders for e2e tests
cy.request('GET', Cypress.config().apiUrl + 'seed?seeder=' + 'Seeds\\E2E\\' + seeder)
})
// routes/web.php
if (app()->environment() !== 'production') {
Route::get('/seed', function ($model) {
\Artisan::call('db:seed', ['--class' => request('seeder')]);
@ajcastro
ajcastro / Component.vue
Last active Jan 21, 2020 — forked from christian-smith/Component.vue
Quasar QTable Bottom Pagination
View Component.vue
<q-table
:data="data"
:pagination="pagination"
@request="paginationRequest"
:columns="columns"
>
<template v-slot:top-left="props">
<TablePagination
:pagination="props.pagination"
:filter="table.filter"
@ajcastro
ajcastro / varexport.php
Created Sep 5, 2019
PHP var_export() with short array syntax (square brackets) indented 4 spaces
View varexport.php
<?php
function varexport($expression, $return=FALSE) {
$export = var_export($expression, TRUE);
$export = preg_replace("/^([ ]*)(.*)/m", '$1$1$2', $export);
$array = preg_split("/\r\n|\n|\r/", $export);
$array = preg_replace(["/\s*array\s\($/", "/\)(,)?$/", "/\s=>\s$/"], [NULL, ']$1', ' => ['], $array);
$export = join(PHP_EOL, array_filter(["["] + $array));
if ((bool)$return) return $export; else echo $export;
}
View BaseCrudController.php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Services\Paginator\Paginator;
use Illuminate\Database\QueryException;
use Illuminate\Validation\ValidationException;
abstract class BaseCrudController extends Controller
@ajcastro
ajcastro / Car.php
Created Aug 12, 2019 — forked from jgrossi/Car.php
How to use Eloquent (from Laravel) inside Wordpress
View Car.php
<?php // File location: /wp-content/themes/my-theme/src/Models/
namespace App\Models;
use Illuminate\Database\Eloquent\Model as Eloquent;
class Car extends Eloquent
{
protected $table = 'cars';
protected $primaryId = 'id';
View axios.cancellable.js
import axios from 'axios'
export default class Cancellable {
constructor(cancelMessage) {
this.cancelMessage = cancelMessage
this.cancelToken = null
}
axios(fn) {
if (this.cancelToken) {
View mysql_gzip.txt
gzip -dc ~/Projects/ | mysql -u 'homestead' -p simmfins_laravel
gzip -dc ~/Projects/ | mysql <db>
View vbox_help.txt
https://askubuntu.com/questions/900118/vboxdrv-sh-failed-modprobe-vboxdrv-failed-please-use-dmesg-to-find-out-why
https://stegard.net/2016/10/virtualbox-secure-boot-ubuntu-fail/
https://askubuntu.com/a/802682