Skip to content

Instantly share code, notes, and snippets.

View mccarlosen's full-sized avatar
:octocat:

Carlos Meneses mccarlosen

:octocat:
View GitHub Profile
use App\Http\Livewire\Component;
Route::middleware('auth:web')->group(function () {
Route::get('/zona-privilegiada/{id}', Component::class)->name('routeName');
});
@berkorbay
berkorbay / github_desktop_ubuntu.md
Last active June 24, 2024 00:44
To install Github Desktop for Ubuntu

IMPORTANT

See the following links for further updates to Github Desktop for Ubuntu. These are official instructions. (also mentioned by fetwar on Nov 3, 2023)

For the sake of "maintaining the tradition" here is the updated version.

@mccarlosen
mccarlosen / Boleta.xml
Created July 26, 2018 19:28 — forked from giansalex/Boleta.xml
Comprobantes Facturacion Electronica SUNAT UBL 2.1 (Factura, Boleta, Nota de Crédito, Nota de Débito)
<?xml version="1.0" encoding="UTF-8"?>
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ccts="urn:un:unece:uncefact:documentation:2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" xmlns:udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ext:UBLExtensions>
<ext:UBLExtension>
<ext:ExtensionContent>
</ext:ExtensionContent>
</ext:UBLExtension>
</ext:UBLExtensions>
<cbc:UBLVersionID>2.1</cbc:UBLVersionID>
<cbc:CustomizationID>2.0</cbc:CustomizationID>
@giansalex
giansalex / Boleta.xml
Last active March 25, 2024 20:43
Comprobantes Facturación Electrónica SUNAT UBL 2.1 (Factura, Boleta, NCR, NDB, ICBPER, Forma Pago), generados con Greenter https://greenter.dev/
<?xml version="1.0" encoding="UTF-8"?>
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2">
<ext:UBLExtensions>
<ext:UBLExtension>
<ext:ExtensionContent />
</ext:UBLExtension>
</ext:UBLExtensions>
<cbc:UBLVersionID>2.1</cbc:UBLVersionID>
<cbc:CustomizationID>2.0</cbc:CustomizationID>
<cbc:ID>B001-1</cbc:ID>
@jamesmacwhite
jamesmacwhite / ffmpeg_mkv_mp4_conversion.md
Last active June 29, 2024 01:09
Easy way to convert MKV to MP4 with ffmpeg

Converting mkv to mp4 with ffmpeg

Essentially just copy the existing video and audio stream as is into a new container, no funny business!

The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.

With ffmpeg this can be achieved with -c copy. Older examples may use -vcodec copy -acodec copy which does the same thing.

These examples assume ffmpeg is in your PATH. If not just substitute with the full path to your ffmpeg binary.

Single file conversion example

@rdgutierrez
rdgutierrez / gist:b06fae22348cd0376836
Last active February 14, 2024 20:30
Fechas en español con Carbon en Laravel 5
Using a library as Laravel-Date you will just need to set the language of the app in the Laravel app config file and use its functions to format the date as you want.
Set the language in /app/config/app.php
...
'locale' => 'es',
...
I've found this library pretty useful and clean. To use it, you can write something like the example in the library readme file. I leave the results in spanish.
...
echo Date::now()->format('l j F Y H:i:s'); // domingo 28 abril 2013 21:58:16
echo Date::parse('-1 day')->diffForHumans(); // 1 día atrás
@briankip
briankip / phpunit-assertions.md
Last active February 9, 2024 18:42
A list of PHPUnit assertions
  • assertArrayHasKey
  • assertArrayNotHasKey
  • assertContains
  • assertAttributeContains
  • assertNotContains
  • assertAttributeNotContains
  • assertContainsOnly
  • assertAttributeContainsOnly
  • assertNotContainsOnly
  • assertAttributeNotContainsOnly
@james2doyle
james2doyle / getBrowser.php
Last active February 20, 2024 06:06
a PHP function to sniff the user agent of the browser and return a nice object with all the information
<?php
// http://www.php.net/manual/en/function.get-browser.php#101125
function getBrowser() {
$u_agent = $_SERVER['HTTP_USER_AGENT'];
$bname = 'Unknown';
$platform = 'Unknown';
$version= "";
// First get the platform?
if (preg_match('/linux/i', $u_agent)) {
@xhezairbey
xhezairbey / bitly_api_v3_shorten.php
Created October 27, 2011 23:42
BitLy API v3 Shorten PHP
<?php
function bitly_shorten($url) {
$login = "bitly_login";
$apikey = "bitly_apikey";
$format = "json";
$query = array("login" => $login,
"apiKey" => $apikey,
"longUrl" => urlencode($url),
"format" => $format);
@tylerhall
tylerhall / strong-passwords.php
Created August 12, 2010 21:38
A user friendly, strong password generator PHP function.
<?PHP
// Generates a strong password of N length containing at least one lower case letter,
// one uppercase letter, one digit, and one special character. The remaining characters
// in the password are chosen at random from those four sets.
//
// The available characters in each set are user friendly - there are no ambiguous
// characters such as i, l, 1, o, 0, etc. This, coupled with the $add_dashes option,
// makes it much easier for users to manually type or speak their passwords.
//
// Note: the $add_dashes option will increase the length of the password by