Skip to content

Instantly share code, notes, and snippets.

@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 26, 2024 14:08
Complete Recent Discord Quest

Complete Recent Discord Quest

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
  2. Join a vc
  3. Stream any window (can be notepad or something)
  4. Press Ctrl+Shift+I to open DevTools
  5. Go to the Console tab
  6. Paste the following code and hit enter:
let wpRequire;
@m1lkweed
m1lkweed / un_builtin.c
Last active April 26, 2024 14:05
Replacements for various gcc builtins using c23's `typeof` and c11's `_Generic`
// Compares types of both parameters. Returns true if the types are compatible, otherwise false.
// Parameter y may not be a variably-modified type.
// Designed to be a drop-in replacement for gcc's __builtin_types_compatible_p
#define types_compatible_p(x, y) _Generic(((typeof(x)*){}), typeof(y)*:1, default:0)
// Cast the bits of arg to type. Parameter type must be a type and must not be a literal or object with that type.
// Designed to be compatible with g++'s __builtin_bit_cast
#define bit_cast(type, ...) ( \
union{typeof(__VA_ARGS__) in; typeof(type) out; \
int enforce_type:_Generic((int(*)(int(type)))0, \
@daytonn
daytonn / .colors
Created January 28, 2014 21:50
Bash Color functions
# Colors
end="\033[0m"
black="\033[0;30m"
blackb="\033[1;30m"
white="\033[0;37m"
whiteb="\033[1;37m"
red="\033[0;31m"
redb="\033[1;31m"
green="\033[0;32m"
greenb="\033[1;32m"
@mmocny
mmocny / soft-navs.js
Last active April 26, 2024 14:04
Measure FCP/LCP + Soft Navs
const RATING_COLORS = {
"good": "#0CCE6A",
"needs-improvement": "#FFA400",
"poor": "#FF4E42",
"invalid": "#FFC0CB",
"default": "inherit", // Will default to this, anyway
};
function log(metric) {
const prettyScore = metric.value.toLocaleString(undefined, { maximumFractionDigits: 0 });
@lionwolfdev
lionwolfdev / download_slack_files.py
Last active April 26, 2024 14:03
A Python Script to download Files (e.g. images and videos) from a Slack channel.
"""
Downloads all images from a Slack channel.
Original from https://gist.github.com/igniteflow/170df9808ca5e68c3dc4ba16bb92cb64
Instructions:
=============
Visit this page and create a new application; choose "From an app manifest" in the dialogue: https://api.slack.com/apps
Paste the following manifest (everything between but without the ```) when prompted to do so.
@morteza-mori
morteza-mori / mikrotik
Created October 2, 2018 08:52
Mikrotik nslookup
put [resolve google.com server 8.8.8.8]
$exitCode = 0
if (![System.Environment]::Is64BitProcess)
{
# start new PowerShell as x64 bit process, wait for it and gather exit code and standard error output
$sysNativePowerShell = "$($PSHOME.ToLower().Replace("syswow64", "sysnative"))\powershell.exe"
$pinfo = New-Object System.Diagnostics.ProcessStartInfo
$pinfo.FileName = $sysNativePowerShell
$pinfo.Arguments = "-ex bypass -file `"$PSCommandPath`""
$pinfo.RedirectStandardError = $true