Skip to content

Instantly share code, notes, and snippets.

View githubnando's full-sized avatar
💤
I may be slow to respond.

Ernando José githubnando

💤
I may be slow to respond.
View GitHub Profile
@githubnando
githubnando / black-panther.md
Last active September 8, 2020 18:01
All Black Panther Comic Books for Free

To get all 256 issues in a few minutes:

  1. Go here: US or EU
  2. Right click (anywhere) > Inspect Element > Console
  3. Paste (sometimes you need to refresh the page and paste again, but will be quicker the second time):
    var buttons = document.getElementsByClassName('action-button buy-action primary-action');
    
 function sleep(delay) {
@githubnando
githubnando / mojave-rubygem-install.md
Last active October 2, 2018 14:17
Usage of gem package installation without sudo on MacOS Mojave
$ brew install rbenv ruby-build
$ echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.zshrc
$ source ~/.zshrc

Install Ruby

$ rbenv install 2.5.0
$ rbenv global 2.5.0
$ ruby -v
@githubnando
githubnando / ubuntu17.10-afterinstall
Last active December 27, 2017 00:44
Ubuntu 17.10 afterinstall
#!/bin/bash
NC='\033[0m'
CO='\033[0;31m'
USER='ernjs'
function display {
echo -e "$CO $1 $NC"
}
@githubnando
githubnando / docker-compose-environment.sh
Last active May 3, 2018 16:23
Docker compose scaffold with MariaDB + PHP 7 + Composer + Yarn
# Docker compose environment scaffold using MariaDB and PHP 7, with Data Container for
# the database and without permission issues with mounted volumes (docker -v)
########################
###### Dockerfile ######
########################
```
FROM php:7.0.18-apache
# Basic tools and dependencies
@githubnando
githubnando / windows10-uefi-stick.sh
Last active July 20, 2017 13:55
Make a bootable Windows 10 UEFI USB Stick
# Let the device unmounted
sudo umount /dev/sdb
# Optional: change the content to zeros
sudo dd if=/dev/zero of=THE_DEVICE bs=512 count=1
# Normally this is not nessecary. Then to create a new layout on the drive:
sudo fdisk /dev/THE_DEVICE
# Then:
@githubnando
githubnando / strpad-left.js
Created June 28, 2017 19:10
Pad left a string with a given number of characters
strPadLeft(string, length, char) {
const str = '' + string;
let pad = '';
for (let i = 0; i < length; i++) {
pad += char;
}
return pad.substring(0, pad.length - str.length) + str;
@githubnando
githubnando / php-function-singleton.php
Last active July 20, 2017 13:56
Returns each time called the same instance using functions, not methods in OOP
<?php
# Returns each time called the same instance using functions, not methods in OOP
if ( ! function_exists('logger')) {
function logger() {
static $logger;
if ( ! $logger) {
$logger = new Logger('starlight');
@githubnando
githubnando / utf8.php
Last active June 23, 2017 13:38
Recursively encode to UTF-8 a given array
<?php
# Recursively encode to UTF-8 a given array
public function utf8(array $array)
{
array_walk_recursive($array, function(&$item, $key) {
if(is_string($item) && ! mb_detect_encoding($item, 'utf-8', true)) {
$item = utf8_encode($item);
}
@githubnando
githubnando / fedora25-afterinstall.sh
Last active October 4, 2017 18:25
Fedora 25|26 Afterinstall - Things TODO
#!/bin/bash
NC='\033[0m'
CO='\033[0;31m'
function display {
echo -e "$CO $1 $NC"
}
display "RPM FUSION FREE AND NONFREE"
@githubnando
githubnando / gtrack.md
Last active August 18, 2017 20:48
Alias for automatically setup tracking for origin in new branches and other useful git commands
# Automatically setup remote tracking for new branches

$ git config --global push.default current



# Make local repository current branch exactly like remote

$ currentBranch=git rev-parse --abbrev-ref HEAD