Skip to content

Instantly share code, notes, and snippets.

View joparara's full-sized avatar
👋
hello world!

Joe Palala joparara

👋
hello world!
View GitHub Profile
@joparara
joparara / git-aliases.md
Created April 28, 2024 21:54 — forked from mwhite/git-aliases.md
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@joparara
joparara / setup_v.md
Created May 10, 2024 01:22
what is v

depends on fzf-tmux and nvim being installed

alias v='fd --type f --hidden --exclude .git | fzf-tmux -p --reverse | xargs nvim'
@joparara
joparara / deploy-laravel-app.sh
Created May 12, 2024 03:36 — forked from ChrisHardie/deploy-laravel-app.sh
Simple Bash script to deploy a Laravel App
#!/bin/bash
version=`php artisan --version`
if [[ ${version} != *"Laravel Framework"* ]]; then
echo "Not a Laravel app, exiting."
exit;
fi
# Turn on maintenance mode
@joparara
joparara / Dockerfile
Created May 13, 2024 00:45 — forked from alext234/Dockerfile
A simple ubuntu container with gcc and cmake
FROM ubuntu:xenial
MAINTAINER alex
# update and install dependencies
RUN apt-get update \
&& apt-get install -y \
software-properties-common \
wget \
&& add-apt-repository -y ppa:ubuntu-toolchain-r/test \
&& apt-get update \
@joparara
joparara / sluggify.php
Created May 20, 2024 22:08
sluggify helper
<?php
function slugify($text) {
$text = preg_replace('~[^\pL\d]+~u', '-', $text);
$text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);
$text = preg_replace('~[^-\w]+~', '', $text);
$text = preg_replace('~-+~', '-', $text);
$text = strtolower($text);
$text = trim($text, " \t\n\r\0\x0B-");
if (empty($text)) {
@joparara
joparara / TailLog.php
Created May 25, 2024 00:04 — forked from spidgorny/TailLog.php
Display only the last error from the Laravel log file and simplify output so that it fits the single screen output. Like "tail -f storage/logs/laravel.log", but smart
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Storage;
class TailLog extends Command
{
/**
@joparara
joparara / gist:0e3fd6ea723267a9e5b543ff7f69bbd0
Created June 12, 2024 06:49 — forked from djaiss/gist:85a0ada83e6bca68e41e
Block Twitter/Facebook in your /etc/hosts
# Block Facebook IPv4
127.0.0.1 www.facebook.com
127.0.0.1 facebook.com
127.0.0.1 login.facebook.com
127.0.0.1 www.login.facebook.com
127.0.0.1 fbcdn.net
127.0.0.1 www.fbcdn.net
127.0.0.1 fbcdn.com
127.0.0.1 www.fbcdn.com
127.0.0.1 static.ak.fbcdn.net
@joparara
joparara / std.md
Created June 24, 2024 03:00 — forked from turbo/std.md
Git Commit Message Standard

Merged from https://github.com/joelparkerhenderson/git_commit_message and https://chris.beams.io/posts/git-commit/

General Rules

  • Commit messages must have a subject line and may have body copy. These must be separated by a blank line.
  • The subject line must not exceed 50 characters
  • The subject line should be capitalized and must not end in a period
  • The subject line must be written in imperative mood (Fix, not Fixed / Fixes etc.)
  • The body copy must be wrapped at 72 columns
  • The body copy must only contain explanations as to what and why, never how. The latter belongs in documentation and implementation.
@joparara
joparara / index.md
Last active September 17, 2024 01:40
fixing issues with homebrew mac mysql

add tmp directory in my.cnf

tmpdir          = /tmp

Note: Mariadb does not need this.

Grant permissions

sudo chmod 0777 /tmp
sudo chmod 0777 /opt/homebrew/var/mysql/{your_mac_profile}..err