Skip to content

Instantly share code, notes, and snippets.

View nagahshi's full-sized avatar
🤠
Yeah, I'm gonna take my horse to the old town road

Willian C. Klein nagahshi

🤠
Yeah, I'm gonna take my horse to the old town road
  • Brasil
  • Maringá-PR
View GitHub Profile
@5a494d
5a494d / clean.sh
Created August 4, 2020 19:21 — forked from Iman/clean.sh
Free up disk space on Ubuntu - clean log, cache, archive packages/apt archives, orphaned packages, old kernel and remove the trash
#!/bin/sh
#Check the Drive Space Used by Cached Files
du -sh /var/cache/apt/archives
#Clean all the log file
#for logs in `find /var/log -type f`; do > $logs; done
logs=`find /var/log -type f`
for i in $logs
@paulerickson
paulerickson / unzip.go
Last active April 11, 2025 19:11
Golang unzip implementation
package unzip
import "archive/zip"
/**
* Extract a zip file named source to directory destination. Handles cases where destination dir…
* - does not exist (creates it)
* - is empty
* - already has source archive extracted into it (files are overwritten)
* - has other files in it, not in source archive (not overwritten)
@nagahshi
nagahshi / gist:19fab2aacdf460e609b3c7b18f6f0b06
Last active May 11, 2022 20:44
configure git connect from ssh
# to list SSH keys
ls -al ~/.ssh
# generate u key pair, substituing by ur Email account (github, bitbucket)
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
# initialize ssh agent
eval "$(ssh-agent -s)"
# add ssh agent in key
ssh-add ~/.ssh/id_rsa
# append ur public key in access key github||bitbucket
~/.ssh/id_rsa.pub
# ~/.bashrc
nf () { git checkout develop && git pull --all && git checkout -b feature/"$@" && git push origin feature/"$@" && git commit --allow-empty -m " ${@} #in-progress " && git push --all;}
gc () { git add . && git commit -m " ${@} " && git push --all; }
cf () { git checkout develop && git merge feature/"$@" && git push origin develop && git commit --allow-empty -m " ${@} #test " && git push --all; }
<?php
namespace App\Http\Middleware;
use Closure;
use App\Services\Cache\ActionCacheManager;
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
/**
* Middleware that will cache controller action responses
@felladrin
felladrin / estados_brasileiros.html
Created March 18, 2014 00:08
Select com todos os estados brasileiros.
<label for="uf">Estado</label>
<select id="uf">
<option value="">-- Selecione --</option>
<option value="AC">Acre</option>
<option value="AL">Alagoas</option>
<option value="AP">Amapá</option>
<option value="AM">Amazonas</option>
<option value="BA">Bahia</option>
<option value="CE">Ceará</option>
<option value="DF">Distrito Federal</option>
@julionc
julionc / 00.howto_install_phantomjs.md
Last active August 31, 2025 01:22
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev