Skip to content

Instantly share code, notes, and snippets.


Javier "Ciberman" Mora jhm-ciberman

View GitHub Profile
jhm-ciberman /
Last active Aug 22, 2021 HandyControl Spanish
<?xml version="1.0" encoding="utf-8"?>
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
jhm-ciberman /
Created Jul 12, 2021
Laravel deploy script
# Change to the project directory
cd /var/www/your-laravel-app
# Turn on maintenance mode
php artisan down || true
# Pull the latest changes from the git repository
git reset --hard
git clean -df
git pull origin master
View WeightedRandom.cs
using System.Collections.Generic;
// Author: Javier "Ciberman" Mora
// License: MIT
// Enjoy!
public class WeightedRandom<T>
private struct Value
public T value;
jhm-ciberman / NovaResourcesTest.php
Created Apr 28, 2019
Simple Automatic Test for Laravel Nova Resources
View NovaResourcesTest.php
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Http\Request;
use Laravel\Nova\Nova;
use Laravel\Nova\Resource;
View LaravelValidationError.ts
This is a typical Laravel API JSON validation error.
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."