Skip to content

Instantly share code, notes, and snippets.

Avatar

Edaz edazpotato

View GitHub Profile
@jagregory
jagregory / gist:710671
Created Nov 22, 2010
How to move to a fork after cloning
View gist:710671
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear!
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy.
* Off the top of my head *
1. Fork their repo on Github
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it
git remote add my-fork git@github...my-fork.git
View performancemods.md

I do not maintain this list anymore:

Go to https://github.com/NordicGamerFE/usefulmods an updated version

Performance Mods

A list of performance-enhancing mods for most major-played versions.

Any suggestion/complaint?
~ Ping alkya#1273 in Modded Minecraft or use the gist comments.

Mods marked as "Dangerous" might be unstable, and cause some unexpected behaviour.

@EvieePy
EvieePy / error_handler.py
Last active Jun 27, 2022
Simple Error Handling for ext.commands - discord.py
View error_handler.py
"""
If you are not using this inside a cog, add the event decorator e.g:
@bot.event
async def on_command_error(ctx, error)
For examples of cogs see:
https://gist.github.com/EvieePy/d78c061a4798ae81be9825468fe146be
For a list of exceptions:
https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#exceptions
View GitHub spoiler markdown.md

Demo:

Spoiler warning

Spoiler text. Note that it's important to have a space after the summary tag. You should be able to write any markdown you want inside the <details> tag... just make sure you close <details> afterward.

console.log("I'm a code block!");
@amishshah
amishshah / discordjs.md
Created Oct 22, 2021
tl;dr i'm stepping down as owner of discord.js!
View discordjs.md

Hello! I'm Amish (also known as hydrabolt), and I am the creator of discord.js.

I created discord.js as a hobby/learning project for myself in August 2015 while I was still a teenager in school.

More than 6 years later, discord.js has become more popular than I could ever imagine, and I cannot express how grateful I am to the other contributors and the community for this amazing experience.

A few of my favourite highlights include:

  • The countless voice rewrites (I think we're done with that now 😉)
  • The April Fools' traditions
@msrose
msrose / combining-git-repositories.md
Last active Jun 16, 2022
How to combine two git repositories.
View combining-git-repositories.md

Combining two git repositories

Use case: You have repository A with remote location rA, and repository B (which may or may not have remote location rB). You want to do one of two things:

  • preserve all commits of both repositories, but replace everything from A with the contents of B, and use rA as your remote location
  • actually combine the two repositories, as if they are two branches that you want to merge, using rA as the remote location

NB: Check out git subtree/git submodule and this Stack Overflow question before going through the steps below. This gist is just a record of how I solved this problem on my own one day.

Before starting, make sure your local and remote repositories are up-to-date with all changes you need. The following steps use the general idea of changing the remote origin and renaming the local master branch of one of the repos in order to combine the two master branches.

@EvanHahn
EvanHahn / gist:2587465
Last active Jun 9, 2022
Caesar shift in JavaScript
View gist:2587465
/*
JavaScript Caesar shift
by Evan Hahn (evanhahn.com)
"Encrypt" like this:
caesarShift('Attack at dawn!', 12); // Returns "Mffmow mf pmiz!"
And "decrypt" like this:
@oze4
oze4 / v-cloak.css
Created Feb 9, 2019
v-cloak for vue.js loading
View v-cloak.css
[v-cloak] {
display: block;
padding: 50px 0;
}
@keyframes spinner {
to {
transform: rotate(360deg);
}
}
@RoccoDev
RoccoDev / hash.rs
Last active Feb 19, 2022
Minecraft SHA-1 complement hash calculation in Rust
View hash.rs
// Copyright (C) 2019 RoccoDev
// Licensed under the MIT license.
// <https://opensource.org/licenses/MIT>
// Bench results:
// First hash: 152ms
// Second hash: 1ms
// Third hash: 0ms
extern crate crypto; // Tested with 0.2.36
@alexdiliberto
alexdiliberto / get_random_bytes.js
Created Feb 25, 2016
Get random bytes in Javascript (Browser/Node)
View get_random_bytes.js
let getRandomBytes = (
(typeof self !== 'undefined' && (self.crypto || self.msCrypto))
? function() { // Browsers
var crypto = (self.crypto || self.msCrypto), QUOTA = 65536;
return function(n) {
var a = new Uint8Array(n);
for (var i = 0; i < n; i += QUOTA) {
crypto.getRandomValues(a.subarray(i, i + Math.min(n - i, QUOTA)));
}
return a;