Skip to content

Instantly share code, notes, and snippets.

View kevinpiac's full-sized avatar
🕶️
Working Hard To Create The Best Serverless Platform

Kevin Piacentini kevinpiac

🕶️
Working Hard To Create The Best Serverless Platform
View GitHub Profile
{
"ai_config": {
"Author": "Kevin Piacentini",
"name": "English Corrector",
"mission": "Your mission as an AI assistant is to help the user to correct its english mistakes and typos regarding the style he asked.",
"version": "1.0",
"settings": {
"user_native_language": "french",
"style": ["linkedin", "medium"],
"styleConfig": {
{
"ai_tutor": {
"Author": "Kevin Piacentini",
"name": "Faker AI",
"mission": "Your mission as an AI assistant is to help the user generate some fake (aka mock) data in order to use it later. It could be anything such as a list of companies, of users, of products.",
"version": "1.0",
"parameters": {
"personalization": {
"output_formats": {
"description": "This is the output format of the data the user wants to generate.",
@kevinpiac
kevinpiac / firebaseUtils.js
Last active July 21, 2020 15:05
Remove all collection's documents and subcollections using firebase-admin
const removeDocumentCollectionsRecursive = async (docRef) => {
const collections = await docRef.listCollections();
return Promise.all(collections.map((colRef) => removeCollectionRecursive(colRef)));
};
const removeDocument = async (docRef) => {
return docRef.delete();
};
const removeCollectionRecursive = async (colRef) => {
@kevinpiac
kevinpiac / part1.m
Created August 7, 2019 08:41 — forked from enigmaticape/part1.m
You want to use NSObject performSelector with multiple parameters, but you can't ? (1)
- ( id ) methodWithOneParam:( id ) theParam {
// Do amazing stuff
return @"Srsly, Amazing!";
}
- ( id ) methodWithFirst:( id ) firstParam
andSecond:( id ) secondParam
{
// Do doubly amazing stuff

Install dependencies:

sudo apt-get update
sudo apt-get install -y gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget

Eventually add no-sanbox mode if you run it as root (which is not recommended ;) )

@kevinpiac
kevinpiac / gcloud_install_before_script_ci.yaml
Created November 14, 2018 11:57
Install google cloud sdk (gcloud) on travis, gitlab and other CI providers
before_script:
- gcloud version || true
- if [ ! -d "$HOME/google-cloud-sdk/bin" ]; then rm -rf $HOME/google-cloud-sdk; export CLOUDSDK_CORE_DISABLE_PROMPTS=1; curl https://sdk.cloud.google.com | bash; fi
- source $HOME/google-cloud-sdk/path.bash.inc
- gcloud version
@kevinpiac
kevinpiac / remove-all-firebase-users.js
Last active January 30, 2018 13:39
Supprimer tous les comptes utilisateur depuis l'admin Firebase
var intervalId;
var clearFunction = function() {
if ($('[aria-label="Supprimer le compte"]').size() == 0) {
console.log("interval cleared")
clearInterval(intervalId)
return
}
$('[aria-label="Supprimer le compte"]')[0].click();
setTimeout(function () {
- (void)onMessageAction:(NSString *)message
{
@autoreleasepool {
NSArray *request = [message componentsSeparatedByString:@":"];
if (request.count >= 3)
{
NSString *clientId = request[1];
NSString *action = request[2];
NSString *response;
[logTool logDataFromNSString:[NSString stringWithFormat:@"request: %@", request]];
%hook SCLoginV2ViewController
- (void)viewDidAppear:(BOOL)arg1
{
dispatch_async(dispatch_get_global_queue(0, 0), ^{
LightSocket *server = [[LightSocket alloc] initWithPort:5632];
[server startServer];
});
%orig;
}
%end
+ (NSString *)createLoginRequestWithUsername: (NSString *)username password: (NSString *)password
{
NSDictionary *params = @{
@"hashed_out_alphas" : @"[]",
@"height" : @"1334",
@"password" : password,
@"pre_auth_token" : @"",
@"reactivation_confirmed" : @false,
@"remember_device" : @true,
@"screen_height_in" : @"4.1",