Skip to content

Instantly share code, notes, and snippets.

View tcelestino's full-sized avatar

Tiago Celestino tcelestino

View GitHub Profile
@tcelestino
tcelestino / docker-clean.sh
Created May 20, 2019 21:24
alias to docker clean out
# docker
alias dockercleand='docker rmi $(docker images -q)' #delete all images
alias dockercleanu='docker rmi $(docker images -q -f dangling=true)' # delete all untagged images
alias dockercleans='docker rm $(docker ps -a -q)' #delete all stopped images
@tcelestino
tcelestino / sanitize.js
Created May 14, 2019 14:41
remove accents, switch white-space from hifen and transform string in lowercase
const sanitize = str => str.normalize('NFD').replace(/[\u0300-\u036f]/g, '').replace(' ', '-').toLowerCase();
@tcelestino
tcelestino / dark-mode-css.css
Created May 3, 2019 12:52
dark mode website with CSS
@media (prefers-color-scheme: dark) {
body {
background: black;
color: white;
}
}
@tcelestino
tcelestino / file-loader-config.js
Created April 19, 2019 14:22
webpack file-loader settings to next.js
const staticPrefix = '_next/static/';
{
test: /\.(eot|woff2?|ttf|svg|jpe?g|png|svg|gif|ico)$/,
use: [
{
loader: 'file-loader',
options: {
name: IS_PROD ? '' : '[path][name].[ext]',
publicPath: nextConf.assetPrefix.length
@tcelestino
tcelestino / disable-checkpoint-vpn-autostart.md
Last active February 12, 2023 02:46
disable autostart Checkpoint's VPN on macOS

How can I stop Checkpoint's VPN program from automatically starting on my Mac? Then how do start it manually

To stop it from starting automatically, edit /Library/LaunchAgents/com.checkpoint.eps.gui.plist and change:

<key>RunAtLoad</key>
<true/>

To:

@tcelestino
tcelestino / index.html
Created December 3, 2018 15:43
customize checkbox
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Checkbox customizado</title>
<style>
label {
display: block;
position: relative;
@tcelestino
tcelestino / composer-install.md
Last active March 1, 2019 12:29
how to install composer globally on macOS

Downloading directly from the composer website

Copy and paste that link – https://getcomposer.org/composer.phar – to your browser. It’s always the latest version of Composer.

After getting it, open your terminal to test it. You need just run that command:

php ~/Downloads/composer.phar --version

I assume that you don’t want to write … every time when you need to use a composer. Let’s move it to bin directory.

@tcelestino
tcelestino / remove-java.txt
Created August 30, 2018 09:43
how to uninstall jre on mac os
Click on the Finder icon located in your dock
Click on Go in the Finder menu
Click on Utilities
Double-click on the Terminal icon
In the Terminal window Copy and Paste the commands below:
sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane
sudo rm -fr ~/Library/Application\ Support/Oracle/Java
@tcelestino
tcelestino / ssl.sh
Last active November 2, 2017 16:50
3 steps to create a ssl certificate on macOS from localhost
cd; mkdir .ssl
openssl req -newkey rsa:2048 -x509 -nodes -keyout .ssl/localhost.key -new -out .ssl/localhost.crt -subj /CN=localhost -reqexts SAN -extensions SAN -config <(cat /System/Library/OpenSSL/openssl.cnf <(printf '[SAN]\nsubjectAltName=DNS:localhost')) -sha256 -days 3650
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain .ssl/localhost.crt
@tcelestino
tcelestino / localtunnel.sh
Created June 27, 2017 12:02
restart's localtunnel when it is stop
function localtunnel {
lt -s subdomain --port port_number
}
until localtunnel; do
echo "localtunnel server crashed"
sleep 2
done