Skip to content

Instantly share code, notes, and snippets.

View trentwiles's full-sized avatar
🏁
who watches the watchmen?

Trent Wiles trentwiles

🏁
who watches the watchmen?
View GitHub Profile
def handle_call({:publish, message}, _from, %{sessions: sessions}=state) do
Enum.each(sessions, &send(&1.pid, message))
{:reply, :ok, state}
end
@crittermike
crittermike / wget.sh
Last active March 28, 2025 18:44
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
@Mo45
Mo45 / discord.msg.send.php
Last active September 2, 2024 14:57
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
@Utopiah
Utopiah / glitch_backup.js
Created March 25, 2019 20:31
Download all your Glitch projects
// cf https://support.glitch.com/t/exporting-all-projects/9367/2
const fetch = require('node-fetch');
const wget = require('node-wget');
// cf localStorage.cachedUser in Glitch editor
var OWNER_TOKEN = "xxxx-yyyy-zzzzz-aaaa-bbbbb"
var USER_ID = "123456"
var PROJECT_ID = ""
var urlAllProjects = `https://api.glitch.com/users/${USER_ID}?authorization=${OWNER_TOKEN}`
@youngchief-btw
youngchief-btw / HTTP --> HTTPS.js
Last active December 8, 2021 00:13
HTTP --> HTTPS enforcement in Javascript
// HTTP --> HTTPS
if (location.protocol === "http:") {
location.replace(window.location.href.replace("http:", "https:"));
}
@youngchief-btw
youngchief-btw / getUrlVars.js
Last active July 8, 2020 19:11
Get URL Parameters in JS
function getUrlVars() {
var vars = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(
m,
key,
value
) {
vars[key] = value;
});
return vars;
@advaith1
advaith1 / top bots.md
Last active April 28, 2025 09:44
The top Discord bots ranked by server count
Rank Bot Approximate Server Count Library
1 MEE6 21,300,000 Custom Python
2 Rythm 🪦 15,200,000 JDA
3 carl-bot 🅱️ 10,900,000 Pycord
4 Groovy 🪦 10,100,000 JDA, Discord4J
5 Dyno
@sgolemon
sgolemon / php-8.0.0alpha1.manifest
Created June 23, 2020 17:30
PHP 8.0.0 Alpha1 Manifest
php-8.0.0alpha1.tar.gz
SHA256 hash: dbc1df78f4b4bf758d796c0265b05500ab5e8d501543c5d7f42aeb67c9bbaa13
PGP signature:
-----BEGIN PGP SIGNATURE-----
iQJEBAABCgAuFiEEFyn4OTjaROJ7oPTT29s5dHDRIXIFAl7yOLMQHHBvbGxpdGFA
cGhwLm5ldAAKCRDb2zl0cNEhcgXhEACHhj72vnMzXA5hHHCqP9OHO68kIpsf7M3Z
T+FnAH0YcsCBwo3F7DYE46+gp6bbY8+L0glJYGqJ/ff+WpMX6bE8OzWwOZsfhn7j
pn4LC7FElO75He2CtJR03Mgta3ZTrK3eRyDqr8PFbCF4Gcywlbk/BNuGmERLYwqE
jgR/oEd5ExiF/R/5aWEviThZv5WkNGzVwd4m5pd7PKw0b5C5ujTlYbOB8JboSuOC
@medvednikov
medvednikov / gitlab.md
Created July 4, 2020 20:31
GitLab disk usage

GitLab is pretty hard to install, that's why prebuilt packages and Docker modules are widely used.

I couldn't install the Ubuntu package, so I went for the official Docker image:

https://hub.docker.com/r/gitlab/gitlab-ce

docker pull gitlab/gitlab-ce