Skip to content

Instantly share code, notes, and snippets.

View FreeApp2014's full-sized avatar
🤬
aaaaaaaaaa

FreeApp2014

🤬
aaaaaaaaaa
View GitHub Profile
@FreeApp2014
FreeApp2014 / a.sh
Last active September 4, 2020 19:59
Library build
PLATFORMPATH="/Applications/Xcode.app/Contents/Developer/Platforms"
TOOLSPATH="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin"
export IPHONEOS_DEPLOYMENT_TARGET="11.0"
arch="arm64"
platform="iPhoneOS"
SDKVERSION="12.0"
clang++ -std=c++0x -O2 -arch $arch -isysroot $PLATFORMPATH/$platform.platform/Developer/SDKs/$platform$SDKVERSION.sdk -miphoneos-version-min=$IPHONEOS_DEPLOYMENT_TARGET -c brstm-main.cpp -o brstm-main.o
ar r openrevolution.a brstm-main.o
@FreeApp2014
FreeApp2014 / vlcCurrentSong.js
Created June 19, 2020 11:08
Get currently playing song information using vlc telnet rc interface
#!/usr/local/bin/node
let input = require("child_process").execSync('echo info | nc 127.0.0.1 4212').toString("utf-8");
let regex = /^\| album: (.*)/mg;
let album = regex.exec(input);
album = (album == null ? "Unknown Album" : album[1]);
regex = /^\| title: (.*)/mg;
let title = regex.exec(input);
title = ( title == null ? "Unknown Title" : title[1]);
if (title == "Unknown Title" || title == ""){
regex = /^\| filename: (.*)/mg;

Discord Bot GUI

This project is an attempt to replace the traditional "command-reply" architecture of a Discord bot and provide user a more verbose and real-time experience as well as sending less messages to chat.

How does this work

A user uses a command to summon an interactive menu which is a RichEmbed with reactions under it. Clicking reactions edits the message to reflect the current state. User input is handled by prompting for data in the main embed and letting the user send the message using a separate message which is automatically deleted after processed. The session is linked to a specific user so other messages do not affect the operation although its still a better idea to use a separate channel that does not get chat activity in it. After the operation the session may be closed with the main message getting deleted and all the temporary data for that session (views history or other stuff) cleared.

@FreeApp2014
FreeApp2014 / reample.bash
Created May 3, 2020 19:34
Resample brstm files using revolution (via ffmpeg)
newSR=48000 # The new sample rate
currentSR=$(./brstm_converter "$1" | grep "Sample rate" | grep -o -E [0-9]+);
currentLoop=$(./brstm_converter "$1" | grep "Loop start" | grep -o -E [0-9]+);
newLoopPoint=$(echo "scale=3;$currentLoop*($newSR/$currentSR)" | bc);
./brstm_converter "$1" -l $newLoopPoint --ffmpeg "-ar $newSR" -o "$1.new.brstm"

Keybase proof

I hereby claim:

  • I am freeapp2014 on github.
  • I am freeapp2014 (https://keybase.io/freeapp2014) on keybase.
  • I have a public key ASClLytFWVTohE6izt1beLp6zHdwb-jV_Kgy-lIuAR9g7wo

To claim this, I am signing this object:

@FreeApp2014
FreeApp2014 / en.json
Created December 27, 2017 09:17
Locale
{
"userFriendlyLocaleName":"English",
"possible8ball":["Yes", "No", "I don't know", "My sources tell it's true", "I am sorry, but I would rather not answer", "Most probably yes", "Most probably no", "Try again later"],
"welcoming":{
"welcomeMessageDef":"We've got a new member here! Welcome ##mention_user## to **##guild_name##**!",
"leaveMessageDef":"Unfortunately, **##user_name##** has left **##guild_name##** :sob:"
},
"servinfo":{
"EmbedTitle":"Server Information",
"GuildNameCatTitle":"Guild Name",
@FreeApp2014
FreeApp2014 / 8ball.rps.rand.js
Created April 16, 2017 18:21
The random number commands for discord.js
function getRandomInt(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min)) + min;
}
if (msg.content.toLowerCase().startsWith("*8ball")) { //The 8ball Message
var msg1 = Array(5);
msg1[1] = "Yes";
msg1[2] = "No";
msg1[3] = "Maybe :wink:";
function getRandomInt(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min)) + min;
}
if (msg.content.toLowerCase().startsWith("*say")) { //The say command
var a = msg.content.substring(5);
@FreeApp2014
FreeApp2014 / sharex_handler.php
Created April 14, 2017 18:21
PHP ShareX handler
<?php
//Defining Paths and Variables
$path = "/FreeAppSWServerFiles/screenshot/"; //The path to webroot of this server
$filename = basename($_FILES["file"]["name"]);
$protocol = "http://"; //The protocol used to download file. http or https
$domainname = "scr.freeappsw.ml"; //Domain name
$webroot = "/"; //The path on the website
$FileType = pathinfo($_FILES['file']['name'],PATHINFO_EXTENSION);
$shortname = $filename;
$localfilename = $path."/".$filename;
@FreeApp2014
FreeApp2014 / help.md
Created March 30, 2017 16:20
The Help

This is Help

Lol