Skip to content

Instantly share code, notes, and snippets.

View sandaruonline's full-sized avatar
🏠
Working from home

Sandaru Fernando sandaruonline

🏠
Working from home
View GitHub Profile
@kristofgilicze
kristofgilicze / terminal-line-cursor-effect.css
Created March 30, 2021 13:07
Terminal cursor style blinking dash at the end of the element with pure css
.terminal-line-cursor-effect::after {
content: ' _';
animation: animate 1.5s linear infinite;
}
@keyframes animate {
0% {
opacity: 0;
}
50% {
@mattupham
mattupham / @mattupham Omegle IP Location Finder
Last active May 12, 2024 15:05
@mattupham Omegle IP Location Finder - Ask Questions in our Discord, links below
// Subscribe on YouTube, and follow on TikTok (@mattupham)! Socials found below:
// https://mattupham.com/links
// @ me on Discord with any questions!
https://link.mattupham.com/discord
// --------------------------------------------
// PLEASE REPLACE "your-api-key-here" WITH AN
// API KEY FROM https://ipgeolocation.io/
let apiKey = "your-api-key-here";
@advaith1
advaith1 / discordjs-slash-commands.md
Last active April 20, 2024 05:39
Slash Commands in Discord.js
@advaith1
advaith1 / intents.md
Last active July 6, 2024 19:32
Discord Gateway Intents Explainer

Intents Explainer

If you're wondering what Gateway Intents are, what Privileged Intents are, why your bot can't see statuses, or why your bot can't see member joins anymore, then this page should explain it to you!

if you do not know what intents are, please read this entire page

Intro

First, a short explanation of how bots work: bots can make requests over the REST (HTTP) API to retreive information and do actions, and they get real-time updates from Discord in the form of websocket gateway events. They can also fetch server members via the gateway.

Examples of gateway events you are probably familiar with are Message Create (a message was sent) and Guild Member Add (a user joined a server).

  • LOADING_LINE_1: "Discord was almost called Bonfire before we picked our name. It was meant to be nice and cozy."
  • LOADING_LINE_2: "Discord was almost called Wyvern before we picked our name. Not too proud of that one."
  • LOADING_LINE_3: "Our logo's name is Clyde."
  • LOADING_LINE_4: 'There are a bunch of hidden "Easter Eggs" in the app that happen when you click certain things...'
  • LOADING_LINE_5: "Discord started as a game company making a mobile game called Fates Forever."
  • LOADING_LINE_6: "Discord’s official birthday is May 13, 2015."
  • LOADING_LINE_7: "We came up with the idea of Discord Nitro over morning breakfast potatoes."
  • LOADING_LINE_8: "Our mascot, Wumpus, was originally created as a character with no friends :("
  • LOADING_LINE_9: "In Discord's early days, light theme was the only theme. Scary times."
  • LOADING_LINE_10: "In the ancient days, Discord started as a browser-only app."
@icourt
icourt / 1ready.js
Last active September 16, 2021 01:58
How to create a DiscordJS Invite Tracker
// Welcome to my gist! This is how you can create an invite tracker using JavaScript and Discord.JS!
// First we are going to statt off in our ready event.
// Create a new Collection called guildInvites and add it to your client
// client is the new Client you created in your main file. If you're using an event handler, make sure to pass the client into this file.
const { Collection } = require("discord.js");
// Collection is an enhanced Map which we are going to save our invites to.
const guildInvites = new Collection();
client.invites = guildInvites;
@jackpittenger
jackpittenger / github_webook.js
Created January 10, 2020 02:50
Example webhook for processing on-push updates from GitHub in Node.js
//github.com/realSaddy
// This uses pm2 by default, feel free to change any of the pipeline commands
const secret = "";
const repo = "/location";
const branch = "master"
const pipeline = [
'pm2 stop server',
'cd ' + repo + ' && git pull origin master',
`cd `+repo+` && npm install`,
`cd `+repo+` && pm2 restart server`
@fredrikbergqvist
fredrikbergqvist / Rss.ts
Created November 29, 2019 15:21
How to create an RSS feed for next.js
import React from "react";
import { NextPageContext } from "next";
const blogPostsRssXml = (blogPosts: IBlogPost[]) => {
let latestPostDate: string = "";
let rssItemsXml = "";
blogPosts.forEach(post => {
const postDate = Date.parse(post.createdAt);
if (!latestPostDate || postDate > Date.parse(latestPostDate)) {
latestPostDate = post.createdAt;
@Fabricio20
Fabricio20 / Iptables.md
Last active December 4, 2020 11:36
Iptables cheatsheet.

Iptables cheatseet

Good to know: Iptables reads rules from top to bottom, stopping at the first rule that matches.

Terms

chain: group of rules (Default ones are INPUT, OUTPUT and FORWARD).

target: What to do with a packet (Often used are ACCEPT, DROP (No echo/"offline"), REJECT (Echoes back 'not authorized icmp')).

Targets