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 / implem.php
Created October 23, 2023 23:47
memoize
<?
$memoizedAdd = memoize(
function ($num) {
return $num + 10;
}
);
@joparara
joparara / get_transactions_remove_nonpublic_fields.php
Created November 7, 2023 13:55
how to remove unnecessary fields
<?php
$transactions = [
["id" => 1, "name" => "John Smith", "x" => "y"],
["id" => 2, "name" => "Joe Adam", "z" => "a"],
];
$fields = ["id", "name"];
$callback = function ($transaction) use ($fields) {
$keys = array_keys($transaction);
foreach ($keys as $key) {
@joparara
joparara / Response.php
Created November 17, 2023 23:35 — forked from jeffochoa/Response.php
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@joparara
joparara / gitnah.sh
Last active February 15, 2024 22:50
git-nah function
# Bash function ⬇️
nah () {
git reset --hard
git clean -df
if [ -d ".git/rebase-apply" ] || [ -d ".git/rebase-merge" ]; then
git rebase --abort
fi
}
@joparara
joparara / .env.local.php
Created February 19, 2024 10:50 — forked from petehouston/.env.local.php
[Laravel 4.2] The environment dotfile configuration
<?php
//file: /.env.local.php
// return the configuration for the 'local' environment
return array(
'db_host' => '127.0.0.1',
'db_name' => 'DB_NAME', // specify database name
'db_user' => 'DB_USER', // specify database username
'db_pass' => 'DB_PASS', // specify database password
);
@joparara
joparara / gotta.go
Created March 7, 2024 22:13
gotta go - a simple readme markdown output to an html page
package main
import (
"fmt"
"io/ioutil"
"os"
"github.com/microcosm-cc/bluemonday"
"github.com/russross/blackfriday/v2"
)
@joparara
joparara / .php_cs
Created March 8, 2024 03:00 — forked from jannejava/.php_cs
PHPCS Fixer for VSCode and Laravel
<?php
return PhpCsFixer\Config::create()
->setRules(array(
'@PSR2' => true,
'binary_operator_spaces' => true,
'blank_line_after_namespace' => true,
'blank_line_after_opening_tag' => true,
'blank_line_before_return' => true,
'braces' => true,
@joparara
joparara / apply_now.md
Last active August 23, 2024 14:39
[PH, Makati] Engineering Lead opening at Gappify, a cloud-based software provider of accrual automation solutions

Please be sure to read all the qualifications and requirements before applying

Open only to people from METRO MANILA who are willing to report to our MAKATI OFFICE 2x a week!


Role Description:

We are seeking a Lead Developer. Please open https://laravelphilippines.org/jobs/opening.html for the details

@joparara
joparara / how-to-use-concat.sql.md
Created April 17, 2024 03:50
how to concat sql

Concat to column new data (append) (instead of getting the data then appending to it)

UPDATE `table_name` SET =concat(, 'newData')

@joparara
joparara / laravel-aliases.sh
Created April 27, 2024 08:55
aliases for running laravel related commands
alias pa=’php artisan’
alias pas=’php artisan serve’
alias pam=’php artisan migrate’
alias pamf=’php artisan migrate:fresh’
alias pamm=’php artisan make:migration’
alias model=’php artisan make:model’
alias cntrl=’php artisan make:controller’
alias policy=’php artisan make:policy’
alias middleware=’php artisan make:middleware’
alias routes=’php artisan route:list’