Skip to content

Instantly share code, notes, and snippets.

@manniru
manniru / curl.md
Created February 27, 2022 11:32 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@olasd
olasd / stream_to_youtube.sh
Created March 28, 2014 19:58
Stream video to youtube via ffmpeg
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
@manniru
manniru / stream_to_youtube.sh
Created March 31, 2022 17:31 — forked from olasd/stream_to_youtube.sh
Stream video to youtube via ffmpeg
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
@manniru
manniru / mongo-auth.ts
Created July 30, 2022 18:36 — forked from Macarthurval/mongo-auth.ts
A typescript class to manage Baileys auth states in Mongo database
import { WAProto } from '@adiwajshing/baileys';
import { BufferJSON, initAuthCreds } from '@adiwajshing/baileys/lib/Utils';
import { Collection, Document, MongoClient } from 'mongodb';
import chalk from 'chalk';
export class MongoDbAuth{
static mongoUrl = "mongodb+srv://your-mongodb-url/DBName/?retryWrites=true&w=majority"
sim: string
private collection: Collection
@manniru
manniru / load_json_to_firstore.js
Created September 17, 2022 15:58 — forked from gregfenton/load_json_to_firstore.js
FIRESTORE: a node/javascript command-line script that loads JSON data into a Firestore database (could be cloud or local emulator)
/**
* load_json_to_firstore.js
*
* This code is a "node script" used to load data into your Firestore database, either in "the cloud" or the emulator.
*
* The script is a "client app", so it logs in with Firebase Auth using email/password from the variable USER1.
*
* The USER1 user (the.admin.guy@test.com) must exist in your Firebase project and have write access
* to the collection(s) you are populating. You can create that account via Firebase Console >> Authentication.
*
https://modularfirebase.web.app/common-use-cases/firestore/#crud-operations
const XLSX = require('xlsx');const data = [
{ name: 'Diary', code: 'diary_code', author: 'Pagorn' },
{ name: 'Note', code: 'note_code', author: 'Pagorn' },
{ name: 'Medium', code: 'medium_code', author: 'Pagorn' },
]const workSheet = XLSX.utils.json_to_sheet(data);
const workBook = XLSX.utils.book_new();XLSX.utils.book_append_sheet(workBook, workSheet, "Sheet 1");
XLSX.writeFile(workBook, "./temp/sample.xlsx");
@manniru
manniru / gotify_web_sample.html
Created September 20, 2022 20:10 — forked from erfg12/gotify_web_sample.html
Gotify web app sample code for send and receive.
<html>
<header>
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script>
// VARIABLES, PLEASE CHANGE
var APP_TOKEN = "AhCGJ-BEC3z.g8Q";
var CLIENT_TOKEN = "C25iT7U7E1xlzSk";
var GOTIFY_SERVER = "localhost:80";
// SEND INFO TO MSG SERVER