Skip to content

Instantly share code, notes, and snippets.

View btalanski's full-sized avatar

Bruno Talanski btalanski

View GitHub Profile
@Mo45
Mo45 / discord.msg.send.php
Last active May 5, 2024 17:25
PHP - Send message to Discord via Webhook
<?php
//=======================================================================================================
// Create new webhook in your Discord channel settings and copy&paste URL
//=======================================================================================================
$webhookurl = "YOUR_WEBHOOK_URL";
//=======================================================================================================
// Compose message. You can use Markdown
// Message Formatting -- https://discordapp.com/developers/docs/reference#message-formatting
@Stanback
Stanback / nginx.conf
Last active May 3, 2024 12:01 — forked from michiel/cors-nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@jakebellacera
jakebellacera / ICS.php
Last active April 19, 2024 09:06
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
@auchenberg
auchenberg / index.js
Created March 31, 2024 23:25
Script to delete all Google Photos from console (2024)
const maxCount = 500;
const counterSelector = '.rtExYb';
const checkboxSelector = '.ckGgle[aria-checked=false]';
const photoDivSelector = ".yDSiEe.uGCjIb.zcLWac.eejsDc.TWmIyd";
const deleteButtonSelector = 'button[aria-label="Delete"]';
const confirmationButtonSelector = '#yDmH0d > div.VfPpkd-Sx9Kwc.cC1eCc.UDxLd.PzCPDd.V639qd.bvQPzd.oEOLpc.A9Uzve.VfPpkd-Sx9Kwc-OWXEXe-FNFY6c > div.VfPpkd-wzTsW.O4g5Md.iWO5td > div > div.VfPpkd-cnG4Wd.m5OsGf > div > div.VfPpkd-T0kwCb.IdSMxc > button.VfPpkd-LgbsSe.VfPpkd-LgbsSe-OWXEXe-k8QpJ.nCP5yc.AjY5Oe.LQeN7.kDryjd';
async function deleteGooglePhotos() {
// Retrieves the current count of selected photos
const getCount = () => {
@mynameispj
mynameispj / Props
Created July 24, 2012 14:55
Estimated reading time in PHP, by Brian Cray
Total props to Brian Cray: http://briancray.com/posts/estimated-reading-time-web-design/
@TooTallNate
TooTallNate / transcode.js
Last active April 6, 2024 14:03
Transcode an OGG Vorbis audio file to an MP3 using node-ogg, node-vorbis and node-lame
/**
* Module dependencies.
*/
var fs = require('fs');
var ogg = require('ogg');
var lame = require('lame');
var vorbis = require('vorbis');
@Treeki
Treeki / TurnipPrices.cpp
Last active April 5, 2024 13:55
AC:NH turnip price calculator
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
// munged from https://github.com/simontime/Resead
namespace sead
{
class Random
{
@wildrun0
wildrun0 / compile-ffmpeg.sh
Last active March 25, 2024 09:21
Compiling ffmpeg for Raspberry Pi 4 (script only works fine on RPi OS 32bit). x64 does not support mmal (see https://github.com/raspberrypi/userland/issues/688)
#!/bin/bash
# Note that there's no libdrm because this lib cause errors
sudo apt update -y && sudo apt upgrade -y
sudo apt-get -y install \
autoconf \
automake \
build-essential \

Livestreaming via PS4 / Xbox to a local RTMP server

Live stream from your PS4 / Xbox to a local computer running an RTMP server by intercepting the twitch.tv stream.

Requirements

  • DD-WRT enabled Router (or router with iptables compatibility)
  • nix Envirment
  • nginx with the nginx-rtmp-module
@daurnimator
daurnimator / webrtc.js
Last active November 7, 2023 07:10
Playing with WebAudio and WebRTC
// Browser compat
window.AudioContext = window.AudioContext || window.webkitAudioContext;
window.RTCPeerConnection = window.RTCPeerConnection || window.webkitRTCPeerConnection || window.mozRTCPeerConnection;
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia;
var key = window.location.hash.substring(1);
var audio_context = new AudioContext();
var local_output = audio_context.createMediaStreamDestination();