Skip to content

Instantly share code, notes, and snippets.

View jpalala's full-sized avatar
🔭
Lets build something useful

Joe Palala jpalala

🔭
Lets build something useful
View GitHub Profile
@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:

@jpalala
jpalala / instructions.md
Created January 25, 2025 05:38
poc java lambda writing to s3 file

Upload base64 encoded file to S3

  1. Encrypt the .env file locally (on linux / mac):
    base64 your-env-file.env > encrypted-env-file.env
  2. Upload the encrypted-env-file.env to S3 (via aws-cli)

Notes for Production

@jpalala
jpalala / poc_feature_flag_loader_from_file.php
Last active January 25, 2025 03:21
launch iterably wip
<?php
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\Config;
// get data from an api that uses basic auth then decode it as a .env file
function get_features($url, $creds, $segment = []) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/xml', $additionalHeaders));
@jpalala
jpalala / readme.md
Last active December 26, 2024 10:33
docker hints

To show only running containers use the given command:

  docker ps

To show all containers use the given command:

 docker ps -a
@jpalala
jpalala / enough.scss
Created December 24, 2024 09:39
Sassy Enough.CSS
body {
font: 22px/1.6 system-ui,sans-serif;
margin: auto;
max-width: 35em;
padding: 0 1em;
}
img, video {
max-width: 100%;
height: auto;