Skip to content

Instantly share code, notes, and snippets.

View aboutdavid's full-sized avatar

David M aboutdavid

View GitHub Profile
@AR-Student824
AR-Student824 / MAIN.md
Created August 5, 2021 04:16
I made 1 JavaScript project a day for a week

I made 1 JavaScript-powered project a day for a week, here are the results

Rules

  • The project must be at a working state or I fail the challenge and I have to start over (luckily didn't happen)
  • Each project must be open source
  • I can edit any one of those projects after the week ends, but I can only edit the day's project during the week
  • All projects must involve some sort of JavaScript, so I can't just make some static website and call it a day
  • The projects don't have to be fully complete, they just have to be at a working state

Now that is out of the way, here are the projects I made, and the link to the final commit of the day the projects were made. NOTE: I do not recommend you run the code from the final commit of the day because when the week is over, I am adding improvements to the projects, and it's always recommended to use the latest version. This is just to prove that I didn't cheat.

@advaith1
advaith1 / discordjs-slash-commands.md
Last active April 20, 2024 05:39
Slash Commands in Discord.js

Hello there, I regret to inform you that back in June, the glitch team noticed that pinging services affected the stability of glitch by a significant amount so they took action by banning all traffic that appeared to originate from a pinging service. Pinging services may or may not have also been the causes of the frequent outages as outages now happen a lot less frequently after the ban. Another reason was that a lot of money was being wasted, because most projects spend a lot of idle time waiting for requests or in the case of discord bots responding to gateway ping events. The glitch project wakeup system is designed so that a project with no requests in 5 minutes will sleep allowing more apps to run on the platform concurrently and ensuring better stability. You might argue that discord bots don't do that, and you might be right if your discord bot is in a large amount of servers(>=1000). In that case you should be getting glit

@Allvaa
Allvaa / ExtendedMessage.js
Last active April 16, 2024 18:28
Discord.js v12 Inline Replies
const { APIMessage, Structures } = require("discord.js");
class ExtAPIMessage extends APIMessage {
resolveData() {
if (this.data) return this;
super.resolveData();
const allowedMentions = this.options.allowedMentions || this.target.client.options.allowedMentions || {};
if (allowedMentions.repliedUser !== undefined) {
if (this.data.allowed_mentions === undefined) this.data.allowed_mentions = {};
Object.assign(this.data.allowed_mentions, { replied_user: allowedMentions.repliedUser });

Going static isn't so bad

In fact some people called it a stack called JAMStack. Here are ways you can make static apps that are still as cool as server side apps.

How do I make stuff only show when someone enters a password

  1. Encrypt something with your password as the key
  2. Put it on the webpage. When someone enters the password attempt to decrypt using the same key(please use non-bruteforcable encryption so don't use the Vigenere cipher for this). If it's successful show the decrypted content.

Suppose someone is answering a math problem how do I make it so they can't just hack and find the answer without checking the answer on the server side

Hash the answer and when the user presses a button to check their answers just hash their input and compare. In addition, use a similiar method like the blockchain and add a really long salt to make computation slower so it isn't bruteforcable.

How do I make it so people can load data and save data from other people

  • You c
@loretoparisi
loretoparisi / ffmpeg_frames.sh
Last active April 19, 2024 05:17
Extract all frames from a movie using ffmpeg
# Output a single frame from the video into an image file:
ffmpeg -i input.mov -ss 00:00:14.435 -vframes 1 out.png
# Output one image every second, named out1.png, out2.png, out3.png, etc.
# The %01d dictates that the ordinal number of each output image will be formatted using 1 digits.
ffmpeg -i input.mov -vf fps=1 out%d.png
# Output one image every minute, named out001.jpg, out002.jpg, out003.jpg, etc.
# The %02d dictates that the ordinal number of each output image will be formatted using 2 digits.
ffmpeg -i input.mov -vf fps=1/60 out%02d.jpg
@davps
davps / install-nodejs-on-raspberrypi-armv6.md
Last active March 20, 2024 23:42
Steps to install nodejs on Raspberry Pi B+ (armv6)

Steps to install nodejs v6.2 on Raspberry Pi B+ (armv6)

cd ~
wget http://nodejs.org/dist/v6.2.1/node-v6.2.1-linux-armv6l.tar.gz
tar -xzf node-v6.2.1-linux-armv6l.tar.gz
node-v6.2.1-linux-armv6l/bin/node -v

The last command should print v6.2.1.

Now you can copy it to /usr/local

@jasonrudolph
jasonrudolph / 00-about-search-api-examples.md
Last active April 23, 2024 12:01
5 entertaining things you can find with the GitHub Search API