Skip to content

Instantly share code, notes, and snippets.

@chrisstubbs93
chrisstubbs93 / ffmpeg.sh
Last active April 28, 2024 19:25
auto-restart FFMPEG when it stops sending frames to youtube
#!/bin/sh
sleep 5
ffmpeg -re -f mjpeg -r 10 -i "http://localhost/?action=stream" -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -acodec aac -ab 1k -strict experimental -s 640x360 -vcodec h264 -pix_fmt yuv420p -g 20 -vb 500k -preset ultrafast -crf 31 -r 10 -f flv "rtmp://a.rtmp.youtube.com/live2/xxxx-xxxx-xxxx-xxxx" 2> /home/pi/ffmpeg.log
@DanielSWolf
DanielSWolf / Program.cs
Last active May 2, 2024 18:33
Console progress bar. Code is under the MIT License: http://opensource.org/licenses/MIT
using System;
using System.Threading;
static class Program {
static void Main() {
Console.Write("Performing some task... ");
using (var progress = new ProgressBar()) {
for (int i = 0; i <= 100; i++) {
progress.Report((double) i / 100);
@dieseltravis
dieseltravis / CryptoHelper.cs
Last active October 31, 2023 07:26
sample app that uses PGP Encryption using Bouncy Castle's C# API
// Assembly BouncyCastle.Crypto, Version=1.8.1.0
using Org.BouncyCastle.Bcpg;
using Org.BouncyCastle.Bcpg.OpenPgp;
using Org.BouncyCastle.Security;
using System;
using System.IO;
using System.Text;
namespace EncryptionSample
{
@artem-zinnatullin
artem-zinnatullin / MyApp.java
Last active January 15, 2023 13:04
If you need to set one font for all TextViews in android application you can use this solution. It will override ALL TextView's typefaces, includes action bar and other standard components, but EditText's password font won't be overriden.
public class MyApp extends Application {
@Override
public void onCreate() {
TypefaceUtil.overrideFont(getApplicationContext(), "SERIF", "fonts/Roboto-Regular.ttf"); // font from assets: "assets/fonts/Roboto-Regular.ttf
}
}
@ob-ivan
ob-ivan / cookiebot.js
Last active June 27, 2022 07:47 — forked from jeresig/cookiebot.js
A little bit intelligent Cookie Clicker bot.
CookieBot = {
// Inner-use enum constants //
INTERVAL_BAKE : 0,
INTERVAL_GOLDEN : 1,
INTERVAL_PRODUCT : 2,
INTERVAL_UPGRADE : 3,
INTERVAL_DRAGON : 4,
INTERVAL_SANTA : 5,
@jeresig
jeresig / cookiebot.js
Last active October 5, 2023 12:20
Simple bot for CookieClicker: http://orteil.dashnet.org/cookieclicker/ How to use: Paste the following into the JavaScript console in your browser and run it. To start the bot type: "CookieClicker.start();" to stop it do: "CookieClicker.stop();" (or just reload the page).
CookieClicker = {
start: function() {
this.clickInterval = setInterval(function(){
// Click the large cookie as fast as possible!
document.getElementById("bigCookie").click();
}, 1);
this.goldInterval = setInterval(function(){
// Click the golden cookie
var shimmer = document.getElementsByClassName("shimmer")[0];
@mwinckler
mwinckler / README.markdown
Created May 2, 2012 15:14
SQL Server: Generate a Data Dictionary

up_generate_data_dictionary

To use this sproc, after creating it in the database you want to document, execute it in SQL Management Studio and view the "Messages" tab. Copy the contents of the "message" tab out into a text file, save it with a .html extension, and open it in a web browser.