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;
$ 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 / 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
@arcanoix
arcanoix / create_registry_user.sh
Created May 2, 2020 23:41 — forked from ibonkonesa/create_registry_user.sh
Create docker private registry ui and repository users
#!/bin/bash
username=$1;
password=$2;
#CREATE USER IN REGISTRY
docker run --rm -it -v $(pwd):/data httpd htpasswd -Bb /data/registrypasswords $username $password
#CREATE USER IN CATALOG
docker run --rm -it -v $(pwd):/data httpd htpasswd -b /data/auth $username $password
#UPDATE REGISTRY USERS
pass=`cat registrypasswords| base64 -w 0`
sed "s/^\(\s*htpasswd\s*:\s*\).*/\1 ${pass}/" secret.yaml > deploy.yaml
@arcanoix
arcanoix / facebook-birthdays.py
Created April 19, 2020 00:21 — forked from DeepanshKhurana/facebook-birthdays.py
Python script to create a .csv from Facebook's Event Data to list Birthdays.
# Imports
import requests
import re
import pandas as pd
import numpy as np
# Initialising Variables
names = []
@arcanoix
arcanoix / GQL_example.js
Created April 18, 2020 15:06 — forked from konami12/GQL_example.js
EejemploObjectGQL.gql
// al usar Type indica que esto es un objeto
type Curso {
// al usar el signo ! indica que
// el valor es obligatrio
id: ID!
descripcion: String
// la utilizar [] indica que es una lista
// los que nos indica que puedes tener 1 o mas
// profesores
profesores: [Profesor]