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
$ 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]
@arcanoix
arcanoix / markdown-text-101.md
Created April 2, 2020 15:52 — forked from almeidx/markdown-text-101.md
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

Sweet Styles

Italics *italics* or _italics_

Underline italics __*underline italics*__

@arcanoix
arcanoix / ticket-php1.php
Last active March 24, 2020 17:03 — forked from evilnapsis/ticket-php1.php
Formato de ticket para impresora de ticket
<?php
include "fpdf/fpdf.php";
$pdf = new FPDF($orientation='P',$unit='mm', array(45,350));
$pdf->AddPage('P', array(80,350));
$pdf->SetFont('Arial','B',8); //Letra Arial, negrita (Bold), tam. 20
$textypos = 5;
$pdf->setY(2);
$pdf->setX(2);
$pdf->Cell(5,$textypos,"NOMBRE DE LA EMPRESA");
/************************************************
*
* 📩📩📩 window.postMessage() 📩📩📩
*
* The window.postMessage() method safely enables cross-origin communication
* between Window objects; e.g., between a page and a pop-up that it spawned,
* or between a page and an iframe embedded within it.
*
************************************************/
@arcanoix
arcanoix / mysql-docker.sh
Created September 8, 2019 16:27 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE