Skip to content

Instantly share code, notes, and snippets.

View arcanoix's full-sized avatar
:octocat:
Developer Code Now Work

Gustavo Herrera arcanoix

:octocat:
Developer Code Now Work
View GitHub Profile
@arcanoix
arcanoix / git-ssh-error-fix.sh
Created November 18, 2022 23:34 — forked from Tamal/git-ssh-error-fix.sh
Solution for 'ssh: connect to host github.com port 22: Connection timed out' error
$ git clone git@github.com:xxxxx/xxxx.git my-awesome-proj
Cloning into 'my-awesome-proj'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
$ # This should also timeout
$ ssh -T git@github.com
ssh: connect to host github.com port 22: Connection timed out
$ # but this might work
@arcanoix
arcanoix / readcfdi.php
Created April 19, 2021 16:47 — forked from goedecke/readcfdi.php
Extraer información de CFDI XML facil con simplexml
<?php
$xml = simplexml_load_file('test.xml');
$ns = $xml->getNamespaces(true);
$xml->registerXPathNamespace('c', $ns['cfdi']);
$xml->registerXPathNamespace('t', $ns['tfd']);
//EMPIEZO A LEER LA INFORMACION DEL CFDI E IMPRIMIRLA
foreach ($xml->xpath('//cfdi:Comprobante') as $cfdiComprobante){
echo $cfdiComprobante['version'];
@arcanoix
arcanoix / init-rn.md
Created April 7, 2021 19:45 — forked from Klerith/init-rn.md
Comando para crear aplicación de React Native con TypeScript

Comando para crear un proyecto de RN con TS

npx react-native init AwesomeTSProject --template react-native-template-typescript
@arcanoix
arcanoix / cerToPem.php
Created March 24, 2021 23:27 — forked from brankoajzele/cerToPem.php
Converting .cer to .pem via pure PHP, (no system, backticks, shell_exec, exec, etc.) to get the same result as with "openssl x509 -inform der -in cert.cer -out cert.pem". Note, I am not expert on certificates, etc. This specific certificate conversion simply worked for me.
<?php
$certificateCAcer = '/certificate.cer';
$certificateCAcerContent = file_get_contents($certificateCAcer);
/* Convert .cer to .pem, cURL uses .pem */
$certificateCApemContent = '-----BEGIN CERTIFICATE-----'.PHP_EOL
.chunk_split(base64_encode($certificateCAcerContent), 64, PHP_EOL)
.'-----END CERTIFICATE-----'.PHP_EOL;
@arcanoix
arcanoix / git.txt
Created December 28, 2020 23:58
Git en rama incorrecta, Solucion..!!!
#Git ¿Hiciste un commit en la rama incorrecta y no sabes cómo arreglarlo? Don't panic! 😱
1️⃣ Ejecuta "git log" para ver tu historial de commits
2️⃣ Copia el hash del commit
3️⃣ Ve a la rama correcta y ejecuta "git cherry-pick" 🍒
+ el hash
@arcanoix
arcanoix / 📊 Weekly development breakdown
Last active January 5, 2021 00:16
Weekly development breakdown
Blade Template 38 mins ███████▌░░░░░░░░░░░░░ 35.8%
YAML 35 mins ██████▉░░░░░░░░░░░░░░ 32.9%
PHP 26 mins █████▏░░░░░░░░░░░░░░░ 24.6%
Other 7 mins █▍░░░░░░░░░░░░░░░░░░░ 6.8%
$ cd ~
$ sudo curl -sS https://getcomposer.org/installer | sudo php
$ sudo mv composer.phar /usr/local/bin/composer
$ sudo ln -s /usr/local/bin/composer /usr/bin/composer
then you can run
$ sudo composer install
@arcanoix
arcanoix / index.vue
Created August 13, 2020 00:50
componente padre index.vue con notice hijo
<template>
<div>
<card>
<span slot="tools">
<a href="#dlgNewNotice" class="btn btn-icon-toggle" data-toggle="modal">
<i class="fa fa-plus-square"></i>
</a>
</span>
<span slot="title">Avisos</span>
@arcanoix
arcanoix / repo-reset.md
Created July 17, 2020 15:31 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@arcanoix
arcanoix / enable-design-mode-chrome.md
Created July 16, 2020 23:10 — forked from ddffx/enable-design-mode-chrome.md
Turn on design mode on Google Chrome to enable webpage editing
  1. Open Chrome, open any webpage
  2. Right click on the page and select Inspect from the Context menu to open the Developer Console
  3. Go to Console tab and type:
document.designMode = 'on'
  1. Start editing the page by clicking anywhere