Skip to content

Instantly share code, notes, and snippets.

View mccarlosen's full-sized avatar
:octocat:

Carlos Meneses mccarlosen

:octocat:
View GitHub Profile
@mccarlosen
mccarlosen / ffmpeg_mkv_mp4_conversion.md
Created May 28, 2023 18:31 — forked from jamesmacwhite/ffmpeg_mkv_mp4_conversion.md
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

@mccarlosen
mccarlosen / phpunit-assertions.md
Created April 7, 2022 23:17 — forked from briankip/phpunit-assertions.md
A list of PHPUnit assertions
  • assertArrayHasKey
  • assertArrayNotHasKey
  • assertContains
  • assertAttributeContains
  • assertNotContains
  • assertAttributeNotContains
  • assertContainsOnly
  • assertAttributeContainsOnly
  • assertNotContainsOnly
  • assertAttributeNotContainsOnly
@mccarlosen
mccarlosen / github_desktop_ubuntu.sh
Created March 30, 2022 19:46 — forked from berkorbay/github_desktop_ubuntu.md
To install Github Desktop for Ubuntu
## Follow this link for further updates to Github Desktop for Ubuntu https://github.com/shiftkey/desktop/releases/latest
# UPDATE (2021-10-18): Thanks to Amin Yahyaabadi's message, the updated code is as follows
sudo wget https://github.com/shiftkey/desktop/releases/download/release-2.9.3-linux3/GitHubDesktop-linux-2.9.3-linux3.deb
### Uncomment below line if you have not installed gdebi-core before
# sudo apt-get install gdebi-core
sudo gdebi GitHubDesktop-linux-2.9.3-linux3.deb
# UPDATE (2021-03-05): Thanks to PaoloRanzi81's comment, the updated code is as follows https://gist.github.com/PaoloRanzi81
@mccarlosen
mccarlosen / EventSystem.js
Created July 21, 2020 15:44 — forked from simonberger/EventSystem.js
Global event system for React.js
class EventSystem {
constructor() {
this.queue = {};
}
publish(event, data) {
let queue = this.queue[event];
if (typeof queue === 'undefined') {
return false;
@mccarlosen
mccarlosen / strong-passwords.php
Created July 4, 2020 21:50 — forked from tylerhall/strong-passwords.php
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
@mccarlosen
mccarlosen / getBrowser.php
Created September 13, 2018 15:32 — forked from james2doyle/getBrowser.php
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)) {
@mccarlosen
mccarlosen / bitly_api_v3_shorten.php
Created September 10, 2018 21:34 — forked from xhezairbey/bitly_api_v3_shorten.php
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);
@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>