Skip to content

Instantly share code, notes, and snippets.

View jpalala's full-sized avatar
🎯
Focusing

Joe Palala jpalala

🎯
Focusing
View GitHub Profile
@jpalala
jpalala / reactsvelteacomparison.md
Created February 29, 2024 09:42
React vs Svelte a comparison

React vs. Svelte: A Comparison

Both React and Svelte are popular JavaScript frameworks used to build user interfaces, but they differ in their approach and have distinct strengths:

React:

  • Strengths:
    • Mature and well-established: With a larger community and extensive ecosystem of libraries and tools, React offers more resources and established practices.
    • Component-based architecture: Enables efficient organization and reusability of UI components.
  • Virtual DOM: Optimizes performance by efficiently updating only the parts of the DOM that have changed.
@jpalala
jpalala / csv.php
Created December 23, 2023 00:31
simple helper
<?php
function csv_write($filename, $data){
$fp = fopen($filename, 'w');
foreach ($data as $fields) {
fputcsv($fp, $fields);
}
fclose($fp);
}
@jpalala
jpalala / zat.js
Created November 15, 2023 01:00
zat
# some utility function to copy changed files to a backup folder
var shell = require('shelljs');
if (!shell.which('git')) {
shell.echo('Sorry, this script requires git');
shell.exit(1);
}
if (shell.exec("git status porcelain | awk 'print $2' > tempfile").code !== 0) {
shell.echo("check tempfile");
@jpalala
jpalala / setting-up-captcha.md
Created November 1, 2023 10:54
laravel how to captcha

You can add a CAPTCHA to your Laravel application to protect against spam in your contact form by using Google's reCAPTCHA service. Here's a step-by-step guide on how to do this:

  1. Register Your Site with Google reCAPTCHA:

    Visit the Google reCAPTCHA website and sign in with your Google account. Then, register your website or app to get the necessary API keys.

    • Choose "reCAPTCHA v2" and "I'm not a robot" Checkbox.
    • Enter the domains where you want to use reCAPTCHA.
  2. Get Your API Keys:

@jpalala
jpalala / wordpress-linux-azure.sh
Created November 1, 2023 10:44 — forked from mikepfeiffer/wordpress-linux-azure.sh
Build a Standalone Wordpress LAMP Server on Azure
#!/bin/bash
# Tutorial: Install a LAMP stack on an Azure Linux VM
# https://docs.microsoft.com/en-us/azure/virtual-machines/linux/tutorial-lamp-stack
# Create the VM Resource Group
az group create --name LAMP-STACK-RG --location westus2
# Create the VM
az vm create \
@jpalala
jpalala / setup_mac.sh
Created July 26, 2023 05:07 — forked from TheGU/setup_mac.sh
Setup mac (brew,git, zsh with prezto, iterm2 and default app)
#!/bin/bash
# Brew : The missing package manager for macOS
# https://brew.sh/
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Git
brew install git
git config --global core.autocrlf input
@jpalala
jpalala / deploy.sh
Last active July 23, 2023 00:03 — forked from kuya-joe/deploy.sh
Laravel deploy script
FORGE_SITE_BRANCH=master #change this to the branch that is needed to be deployted
PROJECT_DIR="/var/www/html" # Path to Project directory
ENV_BKP_DIR="../"
cd $PROJECT_DIR
cp .env $ENV_BKP_DIR/.env.bkp
# Maintenance mode
php artisan down || true
@jpalala
jpalala / react_samples_list.md
Last active April 2, 2023 22:22 — forked from leecade/react_samples_list.md
React Samples List
@jpalala
jpalala / katalystdot.md
Created December 18, 2022 06:56
How to internal retool to web or programming
  • onboard culture (meet tech leads/product managers)
  • onboard agile process and technical excellences
  • product/domain KT and showing tools (team or video effort)
    • performance metrics and timesheet
    • introduce kaizen / improvement culture
@jpalala
jpalala / react_redux_cheatsheet.jsx
Created February 8, 2017 17:48
React+Redux cheat sheet
// ************************************** redux **********************************************
import { applyMiddleware, createStore } from 'redux';
const reducer = (state, action) => {
switch (action.type) {
case 'FOO': { return action.bar; }
};
return state;
};