Skip to content

Instantly share code, notes, and snippets.

View d8vjork's full-sized avatar
💰
Focused on commercial projects

Ruben Robles d8vjork

💰
Focused on commercial projects
View GitHub Profile
@adamsbytes
adamsbytes / python-discord-events.md
Created December 28, 2021 22:44
Retrieving and creating Discord events with Python

Interacting with the Discord Events API using Python

As of writing this, documentation for the Discord events API is a little lacking and the feature is not yet integrated into Discord.py.

The Basics

This gist presents a basic class that performs a couple event actions against the Discord API.

To interact with the Discord API you need an async http client, for this gist it'll be aiohttp. You'll need a Discord bot created, and to have a token generated for that bot. Your bot will also need event permissions in the guilds/servers you are trying to create events in.

@KL13NT
KL13NT / aww.js
Last active October 6, 2023 05:11
A script to transform Animated Webp files into Webm files. Tested on Windows only. Depends on ffmpeg and libwebp. Make sure to add them to your PATH.
/**
* This script transforms animated webp files which are not widely supported yet
* to simple animated webm. Please state the source of your share this.
*
* # How this works
* This script depends on ffmpeg and libwebp provided by Google. Make sure
* they're in your PATH.
*
* The way this works is based off this answer https://askubuntu.com/a/1141049.
* It starts by extracting the input webp frames to a ./frames directory and,
@fhdalikhan
fhdalikhan / help.php
Created October 23, 2020 08:42
Functions to get current CPU load and memory usage under Windows and Linux.
https://www.php.net/manual/en/function.sys-getloadavg.php#118673
Function to get current CPU load as percentage value under Windows and Linux.
Note: Function is getServerLoad(). It will return a decimal value as percentage of current CPU load or NULL if something went wrong (e. g. insufficient access rights).
<?php
header("Content-Type: text/plain");
@ChristopherA
ChristopherA / brew-bundle-brewfile-tips.md
Last active April 19, 2024 06:56
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@diachedelic
diachedelic / deep-link-from-browser.js
Last active March 25, 2024 21:54
Deep link to a native app from a browser, with a fallback
@dvf
dvf / change-codec.md
Last active April 25, 2024 22:44
Enable High Quality mode on your headphones (Updated for macOS Catalina)

If you're using a high-end bluetooth headset on your Macbook Pro it's likely your mac is using an audio codec which favors battery efficiency over high quality. This results in a drastic degradation of sound, the SBC codec is the likely culprit, read more about it here.

Find out what codec you're using

  1. Play a song on your headphones
  2. Option (⌥) click the Bluetooth button at the top of your screen Inspect the Bluetooth Coded
  3. If you're using AAC or aptX, you can stop here—those are the highest quality codecs.

Change your codec to AAC or aptX

<?php
// php cluter-quick-check --host <host> --port <port> [--auth password]
function panicAbort($str_msg) {
fprintf(STDERR, "Error: $str_msg\n\n");
$bt = debug_backtrace();
fprintf(STDERR, "--- BACKTRACE ---\n");
foreach (debug_backtrace() as $frame => $frame_info) {
@laravel-shift
laravel-shift / .php-cs-fixer.php
Last active April 9, 2024 14:08
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
@qoomon
qoomon / conventional_commit_messages.md
Last active April 26, 2024 15:05
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@berkedel
berkedel / flow-error-icu4c-not-loaded.md
Created April 4, 2018 14:13
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib

How to solve dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib

brew uninstall --ignore-dependencies node icu4c
brew install node