Skip to content

Instantly share code, notes, and snippets.

View diegogurpegui's full-sized avatar
🤔
Existing

Diego H. Gurpegui diegogurpegui

🤔
Existing
View GitHub Profile
@diegogurpegui
diegogurpegui / export_file_qr.sh
Created February 27, 2021 22:34
Export file to QR images (in 2kb parts)
#!/bin/bash
############################################################################
# Export a file to several QR files
#
# Requirements:
# - qrencode (https://github.com/fukuchi/libqrencode)
#
# How to use
# $ export_file_qr.sh name.of.your.file
@diegogurpegui
diegogurpegui / tasks.json
Created June 13, 2019 13:08
VS Code tasks for React Native dev
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "android-emulator",
"type": "shell",
// <USERNAME> is your Windows username. Otherwise you shold enter the full path for the emulator binary
// <AVD> is the Android AVD name you want to use. For example: 'Nexus_5X_API_24_x86'
@diegogurpegui
diegogurpegui / docker_commands_cheatseet.sh
Last active May 24, 2019 22:01
Docker commands cheatseet
# Access bash inside a container
docker exec -it "container_name" /bin/bash
# Build composer clean
docker-compose build --no-cache
@diegogurpegui
diegogurpegui / gh-page deploy.sh
Last active June 10, 2019 01:13
Project deploy to gh-pages
# Assume a branch called 'gh-pages' and a directory called 'dist'
git subtree push --prefix=dist origin gh-pages
@diegogurpegui
diegogurpegui / crontab
Last active January 3, 2019 14:09
MySQL backup script. Could be used to automate the process with cron.
0 0 * * * sh /route/to/script/mysql_backup.sh >> /var/log/myapp/mysql_backup.log 2>&1
@diegogurpegui
diegogurpegui / country_iso_mapping_array.php
Last active December 13, 2018 13:43
Mapping arrays for countries ISO 3166-1 alpha-2 and alpha-2 codes
<?php
/**
* Mapping arrays for
* ISO 3166-1 alpha-2 and alpha-2
*/
// Mapping from ISO alpha-2 to ISO alpha-3
$countryIsoMapping2to3 = [
'AF' => 'AFG',
'AX' => 'ALA',
Verifying my Blockstack ID is secured with the address 12wEcUDCwYZVRzY2aemhU5uF33uvkxotzM https://explorer.blockstack.org/address/12wEcUDCwYZVRzY2aemhU5uF33uvkxotzM
@diegogurpegui
diegogurpegui / laravel_deploy.sh
Last active July 11, 2018 13:39
Script to deploy a Laravel project from a Git repository
#!/bin/bash
# Fetch from repository
git fetch origin
reslog=$(git log HEAD..origin/master --oneline)
git reset --hard origin/master
if [ "${reslog}" != "" ] ; then
git merge origin/master # completing the pull
# Project dependencies install/update
@diegogurpegui
diegogurpegui / symfony_deploy.sh
Last active October 11, 2018 23:14
Script to deploy a Symfony project from a Git repository
#!/bin/bash
# Fetch from repository
git fetch origin
reslog=$(git log HEAD..origin/master --oneline)
git reset --hard origin/master
if [ "${reslog}" != "" ] ; then
git merge origin/master # completing the pull
# Symfony deployment
# Redmine - project management software
# Copyright (C) 2006-2014 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of