Skip to content

Instantly share code, notes, and snippets.

View joparara's full-sized avatar

Joe Palala joparara

View GitHub Profile
@joparara
joparara / run_the_app_email_service_provider.md
Created December 27, 2024 07:05
how to run email driver java

Your code defines a producer method in the EmailServiceProvider class that dynamically creates and provides an implementation of EmailService based on the configuration (email.driver). The choice of the email client to be used (e.g., SqsEmailServiceImpl or LocalSmtpEmailServiceImpl) is determined by the email.driver value.


How to Use This in Your Application

The produced EmailService can be injected wherever it's needed within your application. Here's a breakdown of the steps:


@joparara
joparara / gist:bf2751060c2075290d66b8ac7dafec84
Last active December 26, 2024 11:02
running java app with quarkus

First install java!

  sdk install java 17.0.11-graal

Run:

  ./gradlew wrapper --gradle-version=8.1.1 --distribution-type=bin
@joparara
joparara / rungradle.md
Last active December 13, 2024 01:50
run gradle

Run

./gradlew wrapper --gradle-version=8.1.1 --distribution-type=bin

Builds to 8.1.1

./build
./uberjar
@joparara
joparara / massInsertOrUpdate.php
Created December 11, 2024 23:14 — forked from RuGa/massInsertOrUpdate.php
Mass (bulk) insert or update on duplicate for Laravel 4/5
/**
* Mass (bulk) insert or update on duplicate for Laravel 4/5
*
* insertOrUpdate([
* ['id'=>1,'value'=>10],
* ['id'=>2,'value'=>60]
* ]);
*
*
* @param array $rows
@joparara
joparara / readme.md
Created November 14, 2024 03:04
launchdarkly lighter clone

launchdarkly-clone

For a lighter LaunchDarkly-style feature toggling service on AWS, you could focus on these essential features:

Feature Flag Management: Enable users to create, update, and delete feature flags, with options for boolean (on/off), multivariate (e.g., A/B tests), and gradual rollout.

Targeting Rules: Allow users to set rules based on attributes (e.g., user groups, environment, geographic location). This could involve assigning attributes to toggle specific users or cohorts.

Environment Support: Provide support for managing flags across multiple environments (e.g., development, staging, production), allowing easy promotion of configurations between them.

@joparara
joparara / mysql_downgrade.txt
Created October 28, 2024 01:07 — forked from 6temes/mysql_downgrade.txt
Downgrade MySQL version with brew
# Kill rails server and guard
bin/spring stop
brew services stop mysql
brew uninstall mysql
brew install mysql@5.5
brew link mysql@5.5 --force
brew services start mysql@5.5
rbenv uninstall 2.3.3
rbenv install 2.3.3
gem install bundle
@joparara
joparara / run_uniqid_node.js
Created October 25, 2024 11:42
nodejs random uniqid
function uniqid(prefix = "", random = false) {
const sec = Date.now() * 1000 + Math.random() * 1000;
const id = sec.toString(16).replace(/\./g, "").padEnd(14, "0");
return `${prefix}${id}${random ? `.${Math.trunc(Math.random() * 100000000)}`:""}`;
};
@joparara
joparara / setting-up-bootstrap-laravel.md
Last active October 21, 2024 23:00
setting up bootstrap laravel.md
  1. Install Laravel

    composer create-project laravel/laravel example-app

  2. Use in project folder

    npm i bootstrap

  3. Copy the css and js folders from the following locations

@joparara
joparara / embellished_ll_command.sh
Created October 16, 2024 23:23
embellished ll command
ll will usually ls, but if you add any argument, it will run bat (fzf) (to view the file)
```bash
ll () {
if (( $# == 0 )); then
ls -alF
else
bat $(fzf) $1
fi
}
@joparara
joparara / output_log.txt
Created October 7, 2024 03:22 — forked from HugsLibRecordKeeper/output_log.txt
Rimworld output log published using HugsLib
Log uploaded on Monday, October 7, 2024, 4:17:54 AM
Loaded mods:
Harmony(brrainz.harmony)[mv:2.3.1.0]: 0Harmony(2.3.3), HarmonyMod(2.3.1)
Core(Ludeon.RimWorld): (no assemblies)
Royalty(Ludeon.RimWorld.Royalty): (no assemblies)
Ideology(Ludeon.RimWorld.Ideology): (no assemblies)
Biotech(Ludeon.RimWorld.Biotech): (no assemblies)
Anomaly(Ludeon.RimWorld.Anomaly): (no assemblies)
HugsLib(UnlimitedHugs.HugsLib)[ov:11.0.4]: 0Harmony(av:2.3.3,fv:1.2.0.1), HugsLib(av:1.0.0,fv:11.0.4)
(Dirty) Windows(ANumeric.dirtyWindows): OpenTheWindows(av:2.7.6,fv:2.7.6)