Skip to content

Instantly share code, notes, and snippets.

View jpalala's full-sized avatar
🔭
Looking for opportunities

Joe Palala jpalala

🔭
Looking for opportunities
View GitHub Profile
@jpalala
jpalala / README.md
Last active September 14, 2025 00:39
DEXEC.SH (NOW DEXEC IN C)

dexec

dexec is a small command‑line utility (written in C) that wraps Docker commands to make working with Docker Compose and docker exec easier. By default it runs docker compose, but when called with the -e (or --exec) flag, it runs docker exec.


Features

  • Checks that the docker binary exists before doing anything.
  • Default behavior: use docker compose with any arguments you pass.
@jpalala
jpalala / why zip.md
Last active September 9, 2025 22:38
Go zip
func Zip[T any](a, b []T) ([][2]T, error) {
    if len(a) != len(b) {
        return nil, fmt.Errorf("zip: lengths differ")
    }
    r := make([][2]T, len(a))
    for i, e := range a {
        r[i] = [2]T{e, b[i]}
    }
 return r, nil
@jpalala
jpalala / Laravel.dockerfile
Last active September 9, 2025 09:45
docker files for laravel
# Use the official PHP 8.4 FPM Alpine image as the base
FROM php:8.4-fpm-alpine
# Update and upgrade packages, then install basic dependencies
# The --no-cache option keeps the image size smaller
RUN apk update && apk upgrade --no-cache \
&& apk add --no-cache bash git
# Install PHP extensions
# This part assumes you have a script named install-php.sh in your .docker directory
@jpalala
jpalala / using_yajra_datatables_laravel.md
Created September 6, 2025 01:16
solving the problem with yajra datatable

Yes, it's definitely possible to present a Laravel API resource as a paginated DataTable, and libraries like Yajra DataTable make this process significantly easier!

You're on the right track by mentioning Yajra DataTable. It's a very popular and powerful package that handles exactly what you're looking to achieve.

Here's a general overview of how you'd approach this in Laravel using Yajra DataTable:

1. Install Yajra DataTable:

First, you'll need to install the package via Composer:

@jpalala
jpalala / cplusplus_remove_duplicates.md
Created September 1, 2025 23:29
remove duplicates c++

Using C++ how do you remove duplicates from a vector set

To remove duplicates from a std::vector in C++, the most common and efficient approach involves using std::sort and std::unique from the header, followed by std::vector::erase. This method modifies the original vector and sorts its elements.

#include <iostream>
#include <bits/stdc++.h>
using namespace std;
@jpalala
jpalala / gist.md
Last active August 23, 2025 02:57
hyde theme using tailwind

I asked Gemini to make me this and it came up with this.

@jpalala
jpalala / Git.md
Created June 29, 2025 01:24
Git and Symfony things

Undoing git stash

To undo a git stash, it depends on what exactly you mean by “undo”:


🔁 1. If you applied a stash and want to undo the changes:

git stash apply       # or git stash pop
@jpalala
jpalala / extracting_to_audio_only.md
Last active March 8, 2025 23:03
extract to m4a using yt dlp
>  yt-dlp -f "bestaudio/best" --extract-audio --audio-format m4a <you.tubeurl>
@jpalala
jpalala / rsync-up.sh
Created February 8, 2025 09:04
rsync from a file config
#!/bin/bash
# config file looks like:
## ```
# source=$PWD
# dest=/path/to/folder
### ```
# Check if .rsync file exists
CONFIG_FILE=".rsync"
if [[ ! -f "$CONFIG_FILE" ]]; then
@jpalala
jpalala / fetch todos.md
Created February 7, 2025 02:39
Fetching todos from a notion database guide

To fetch todos from a Notion database list using the Notion API, you'll need to follow these steps:

  1. Create a Notion integration to get an API key
  2. Share your database with the integration
  3. Use the "Query a database" endpoint to fetch the list of tasks

Here's a step-by-step guide with code examples: