Skip to content

Instantly share code, notes, and snippets.

View ludndev's full-sized avatar
💭
I may be slow to respond.

Judicaël AHYI ludndev

💭
I may be slow to respond.
View GitHub Profile

endpoint: https://gql.hashnode.com/?source=legacy-api-page

query:

{
  user(username: "ludndev") {
    username
    posts(pageSize: 10, page: 1) {
 edges {
@ludndev
ludndev / genpw.js
Created July 15, 2024 20:09 — forked from kitihounel/genpw.js
Funny little NodeJS script to generate passwords
/**
* This is a small program used to generate passwords given an alphabet and a target length.
*
* A bit of math and programming.
* We have an alphabet of size A and we want a password of length P.
* We need to generate an integer bound by (A^P) and convert it to base A using the standard base
* conversion algorithm with our alphabet symbols as the digits.
*
* (A^P) is our upper bound because (A^P) has P+1 digits in base A and we need P digits (symbols).
* For example, in base 10, 10^2 = 100 has 3 digits. In base 2, 16 = 2^4 = 10000 has 5 symbols, etc.
name: Laravel CI/CD
on:
pull_request:
branches:
- main
types:
- closed
jobs:
@ludndev
ludndev / acme.sh-example.md
Created May 23, 2024 16:40
acme.sh example for a project on CPanel

Example with example.com

Note that you need to update the webroot based on your project. Some will simply be ~/example.com.

acme.sh --issue --force -d example.com -d www.example.com --webroot ~/example.com/public
acme.sh --install-cert -d example.com -d www.example.com
acme.sh --deploy --deploy-hook cpanel_uapi -d example.com -d www.example.com
def spectre(F, Deltat):
Ne = len(Deltat)
coeffComplex = np.fft.fft(Deltat)
coeffReel = np.absolute(coeffComplex)
freq = []
for i in range(Ne):
if Deltat[i] == 0:
freq.append(0)
else:
freq.append(i / Deltat[i])
@ludndev
ludndev / get.sh
Last active May 18, 2024 14:07
Extract repositories from a GitHub profile or organisation
#!/bin/bash
# required jq and gh
# jq : https://jqlang.github.io/jq/download/
# gh : https://cli.github.com/
# Check if required argument is provided
if [ -z "$1" ]; then
echo "Error: Please provide the organization name as an argument."
echo "Usage: $0 <organization_name>"
@ludndev
ludndev / gist:27cbe10cf1ec344a33ef52c997173c0d
Created May 16, 2024 09:40
judicael-ahyi-public-gpg-key
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGZF0/8BEAC3RhHk/wCn01LNzJcOQZbNZU1yT8ToYHLQzDJui3tS84/ucmY/
t0Ql7wrOKIfeV2Rz+43dhjh1FWd5o2ERRXbZLXRgiWS/9a7gI/co+DBCKr+81mMk
XhJ8WWzbsfVKaOJ1NG8htRSoMcAazyNYBQG0rFVUEbB4EPGY+h+/qA2CLZEqHiZ6
eARUIhzxGSH+dgqKyl7t4TT6YY9bvTStQmDLZJ5UK40Wm5qhPYv55VjZ91Ky5ABv
jbOaKv15AGbsbEpfnIlPbiMdLrin4Ff7et3YPABBOaSmUJDuuyxKNq+9iJXM39NR
uwbmJIS7t3wLMjW//W3GF201j8rzKpG+MeSRMF8jGu8dZBGs++PjhyBKFHdiEfkl
iLBs/6mFj3CZF978mgBXvh56UWIhdhzuzeU6mSa1lVJGI9DF5/rFpSWrpzsf7vNe
/WPN3zs9qaPn03iCqg4EPfAsglFaOG2+QreyBxq91cYNZ257al5q+CZ/rg/A30RI
@ludndev
ludndev / get.cmd
Last active April 23, 2024 01:36
Download all repositories from GitHub account
@echo off
REM required jq and gh
REM jq : https://jqlang.github.io/jq/download/
REM gh : https://cli.github.com/
IF NOT DEFINED org_name SET "org_name=my_org"
FOR /F "tokens=*" %%G IN ('gh repo list %org_name% --limit 9999 --json url ^| jq ".[].url"') DO (
SET "folderName=%%~nxG"
function roundUpToAny(n, up = 5) {
return Math.round((n + (up / 2)) / up) * up;
}
console.log(roundUpToAny(1881));

Unable to found npm from your script file during CI/CD cycle ? Add this before using npm.

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion