Skip to content

Instantly share code, notes, and snippets.

View FGRibreau's full-sized avatar
✍️
writing "#NoBullshit Tech-Lead" book https://getnobullshit.com

Francois-Guillaume Ribreau FGRibreau

✍️
writing "#NoBullshit Tech-Lead" book https://getnobullshit.com
View GitHub Profile
@FGRibreau
FGRibreau / suno-download-all-songs.js
Created June 24, 2024 20:03
Download all Suno (app.suno.ai) songs displayed on a page
// open your javascript console and paste this
copy([...$('[role="grid"]')[Object.keys($('[role="grid"]')).filter(x => x.startsWith('__reactProps'))[0]].children[0].props.values[0][1].collection].filter(x => x.value.audio_url).map(x => x.value.audio_url).join(' '))
// now you have a list of mp3 urls directly in your clipboard that you can pass to wget or a url downloader
### Keybase proof
I hereby claim:
* I am FGRibreau on github.
* I am fgribreau (https://keybase.io/fgribreau) on keybase.
* I have a public key whose fingerprint is 5C44 FB61 55CB 31BF 8CD7 9ED7 BD7F 1108 C2C8 5857
To claim this, I am signing this object:
@FGRibreau
FGRibreau / HeaderValueExt.rs
Last active September 29, 2023 16:15
Convert a HeaderValue into a rust String
/// Additional conversion methods for `HeaderValue`.
pub trait HeaderValueExt {
fn to_string(&self) -> String;
}
impl HeaderValueExt for HeaderValue {
fn to_string(&self) -> String {
self.to_str().unwrap_or_default().to_string()
}
}
@FGRibreau
FGRibreau / keycloak-route-patterns-to-keep-open.txt
Created February 8, 2020 11:55
Minimal Keycloak route patterns to keep open (whitelist)
/auth/realms/<realm>/protocol/openid-connect/token
/auth/realms/<realm>/protocol/openid-connect/logout
/auth/realms/<realm>/protocol/openid-connect/auth
/auth/realms/<realm>/login-actions/first-broker-login
/auth/realms/<realm>/broker/after-first-broker-login
@FGRibreau
FGRibreau / 1_stripe-schema.md
Last active September 7, 2024 14:46
Stripe database schema (extracted from their sigma product) as of 2019-10-09
jqn -r markdown-table 'map(x => "## " + x.name + "\n\n" + markdownTable(x.columns.map(y => [y.name, y.type]))  ) | join("\n\n")' < /tmp/stripe.json

accounts

id varchar
business_name varchar
business_url varchar
@FGRibreau
FGRibreau / cors-nginx.conf
Last active May 26, 2020 11:06 — forked from alexjs/cors-nginx.conf
Slightly tighter CORS config for nginx
#
# Slightly tighter CORS config for nginx
#
# A modification of https://gist.github.com/1064640/ to include a white-list of URLs
#
# Despite the W3C guidance suggesting that a list of origins can be passed as part of
# Access-Control-Allow-Origin headers, several browsers (well, at least Firefox)
# don't seem to play nicely with this.
#
@FGRibreau
FGRibreau / GCLOUD_SERVICE_ACCOUNT
Created April 16, 2018 22:16
"cat service_account.json | base64" will give you your GCLOUD_SERVICE_ACCOUNT
ewogICJ0eXBlIjogInNlcnZpY2VfYWNjb3VudCIsCiAgInByb2plY3RfaWQiOiAicHJvamVjdC0xMDAxMTAiLAogICJwcml2YXRlX2tleV9pZCI6ICIxYmQ2MDAwMDAzOTAwMDAwYmEwMDcxMjhiNzcwZDgzMWIyYjAwMDAwIiwKICAicHJpdmF0ZV9rZXkiOiAiLS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tXG5NSUlFdmdJQkFEQU5CZ2txaGtpRzl3MEJBUUVcbmhPbkx4UWE3cVByWkZMUCsyUzNSYVN1ZHNidW9jVm80YnlaSFxuNWU5Z3NEN056c0QvN0VDSkR5SW5iSDgrTUVKeEZCVy95WVVYNlhITS9kXG41T2lqeUlkQTQrTlBvNktwa0phMldWOEkvS1B0b05MU0s3ZDZvUmRFQVpcbjdFQ0pEeUluYkg4K01FSnhGQlcveVlVWDZYSE0vZFxuNU9panlJZEE0K05QbzZLcGtKYTJXVjhJL0tQdG9OTFNLN2Q2b1JkRUFaXG43RUNKRHlJbmJIOCtNRUp4RkJXL3lZVVg2WEhNL2RcbjVPaWp5SWRBNCtOUG82S3BrSmEyV1Y4SS9LUHRvTkxTSzdkNm9SZEVBWlxuN0VDSkR5SW5iSDgrTUVKeEZCVy95WVVYNlhITS9kXG41T2lqeUlkQTQrTlBvNktwa0phMldWOEkvS1B0b05MU0s3ZDZvUmRFQVpcbjdFQ0pEeUluYkg4K01FSnhGQlcveVlVWDZYSE0vZFxuNU9panlJZEE0K05QbzZLcGtKYTJXVjhJL0tQdG9OTFNLN2Q2b1JkRUFaXG43RUNKRHlJbmJIOCtNRUp4RkJXL3lZVVg2WEhNL2RcbjVPaWp5SWRBNCtOUG82S3BrSmEyV1Y4SS9LUHRvTkxTSzdkNm9SZEVBWlxuN0VDSkR5SW5iSDgrTUVKeEZCVy95WVVYNlhITS9kXG41T2lqeUlkQTQrTlBvNktwa0phMldWOEkv
@FGRibreau
FGRibreau / PostgresToSNSWorker.js
Created March 4, 2017 20:39
PostgresToSNSWorker
// Basic PostgresToSNSWorker worker
const pg = require ('pg');
const pgConString = process.env.POSTGRESQL_CONNECTIONSTRING;
pg.connect(pgConString, function(err, client) {
if(err) {
console.log(err);
}
client.on('notification', function(msg) {
@FGRibreau
FGRibreau / build.sh
Last active January 30, 2017 11:42
Moving our CI from npm to yarn, fresh install performance http://blog.fgribreau.com/2017/01/how-we-reduced-by-37-our-nodejs-project.html
time docker run --rm -v $(pwd):/src mkenney/npm npm install
12:04:14 real 3m33.500s
12:04:14 user 0m0.780s
12:04:14 sys 0m0.716s
time docker run --rm -v $(pwd):/workspace kkarczmarczyk/node-yarn yarn install
12:07:29 real 2m0.769s
12:07:29 user 0m0.164s
@FGRibreau
FGRibreau / circle.yml
Last active April 5, 2017 09:00
Cargo rust test for CircleCI
machine:
services:
- docker
test:
override:
# don't forget to replace "1.18" with your rust version
- docker run -it --rm -v $(pwd):/source -w /source scorpil/rust:1.18 cargo test