Skip to content

Instantly share code, notes, and snippets.

View jpalala's full-sized avatar
🎯
Focusing

Jose Palala jpalala

🎯
Focusing
View GitHub Profile
@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 / 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 / blah.js
Created July 1, 2022 05:48
get-relative-date blah blah blah
...require('moment') library
if ( isRelative ) {
moment(dueAt).diff(moment(Date.now()), 'days')
}
@jpalala
jpalala / package.json
Created June 30, 2022 13:52 — forked from defenestrator/package.json
Laravel Tailwind and Svelte 3: simple configuration.
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"