Skip to content

Instantly share code, notes, and snippets.

@victornpb
victornpb / deleteDiscordMessages.js
Last active April 16, 2024 09:32
Delete all your messages from DM or Channel in Discord
/*
This file is now hosted here:
https://github.com/victornpb/undiscord
*/
@orion-v
orion-v / how-to.md
Last active May 18, 2023 00:16
Delete all messages of an user in a Discord channel or server

Delete discord user message history

This script allow for user specific message deletion from an entire server or a single channel using the browser console. This script uses discord search API and it will only delete messages of a chosen user.

How to use

1. Enable developer mode in discord

Go to user settings > appearance in discord and enable Developer mode.

2. Copy and paste the script to a file so you can change the server and author ids.

3. Replace the server and author ids with your own.

@aerrity
aerrity / client.js
Last active April 9, 2024 21:33
Node, Express & MongoDB: Button click example
console.log('Client-side code running');
const button = document.getElementById('myButton');
button.addEventListener('click', function(e) {
console.log('button was clicked');
fetch('/clicked', {method: 'POST'})
.then(function(response) {
if(response.ok) {
console.log('click was recorded');
@EvieePy
EvieePy / bot_example.py
Last active April 24, 2024 09:30
A Cogs Example for the rewrite version of - discord.py
import discord
from discord.ext import commands
import sys, traceback
"""This is a multi file example showcasing many features of the command extension and the use of cogs.
These are examples only and are not intended to be used as a fully functioning bot. Rather they should give you a basic
understanding and platform for creating your own bot.
These examples make use of Python 3.6.2 and the rewrite version on the lib.
#include <Windows.h>
#include "../../API/RainmeterAPI.h"
struct ACCENTPOLICY {
int nAccentState;
int nFlags;
int nColor;
int nAnimationId;
};
struct WINCOMPATTRDATA {
@veltman
veltman / premorph.js
Last active March 15, 2016 01:44
Morph pre-processing
var oldDistricts = require("./old-raw.geo.json"),
newDistricts = require("./new-raw.geo.json"),
_ = require("underscore"),
turf = require("turf"),
fs = require("fs");
// Clean up GeoJSON, sort districts in order
prep(oldDistricts);
prep(newDistricts);
@veltman
veltman / README.md
Last active May 26, 2021 20:50
Redistricting

Old vs. new proposed North Carolina congressional districts, data via WRAL.

Polygons were pre-processed for gentler animation as follows:

  1. For each district, find the difference n in the number of vertices between the old and new district.
  2. Add n vertices to whichever one has fewer, evenly spaced along the existing polyline, so the old and new shape each have the same number of vertices (not great for performance).
  3. For each pair of old/new district, wind the old district around to minimize the sum of the squared distances between point index i in the old district and point index i in the new district.
@Atlas7
Atlas7 / rails_app_postgresql_local_mac_remote_heroku.md
Last active July 10, 2019 06:16
Notes - Ruby-on-Rails app / PostgreSQL database / testable locally on Mac / deployable remotely on Heroku

After some fiddling / experimenting with creating a Ruby-on-Rails (with a PostgreSQL database) that is testable locally on a mac, and also deployable remotely on Heroku, I thought it might be wise to jot down some notes just in case I forget how to repeat this again!

(Note: I'm not a pro in Ruby/Rails/Postgres just yet - this post is meant to be for my own "rescuing" purposes. I'd recommend you use the official Heroku Getting started with Ruby / Rails tutorial to begin with. Use this post only for additional info / resolving issues when you get stuck. I've included some handy links below).

# Useful Tutorials and Articles

Some really important tutorials / articles - highly recommend to use these frequently:

On installing Ruby, Rails, rbenv

@leovoel
leovoel / basic_bot.py
Last active January 25, 2024 04:19
discord.py's basic_bot.py converted to use "cogs".
from discord.ext import commands
description = '''An example bot to showcase the discord.ext.commands extension
module.
There are a number of utility commands being showcased here.'''
# this specifies what extensions to load when the bot starts up
startup_extensions = ["members", "rng"]
@jorgemorgado
jorgemorgado / LICENSE.md
Last active December 8, 2022 08:54
Sparkline chart widget for Dashing

The MIT License (MIT)

Copyright (c) 2015 Jorge Morgado

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: