Skip to content

Instantly share code, notes, and snippets.

View iGoodie's full-sized avatar
🍀
Rocking

Anılcan Metinyurt iGoodie

🍀
Rocking
View GitHub Profile
@SizableShrimp
SizableShrimp / README.md
Last active March 21, 2025 21:36
How to setup shading with Minecraft Forge

How to setup shading with Minecraft Forge

Shading is the concept of packing external dependencies inside your jar so that they exist in production. Without this, using external libraries would produce ClassNotFoundExceptions when you run your mod jar outside of an IDE. This guide explains how to setup shading through Gradle.

Assumptions

This guide assumes that:

  • You are on ForgeGradle 5 or higher
  • You are on Gradle 7.0 or higher
@anatawa12
anatawa12 / shadowing-and-relocating.gradle.kts
Created March 21, 2021 06:02
the example script to shadow and relocate kotlin for ForgeGradle
import com.anatawa12.javaStabGen.gradle.GenerateJavaStab
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
kotlin("jvm") version "<version>"
id("com.github.johnrengelman.shadow") version "6.1.0"
}
val shade by configurations.creating
configurations.compile.get().extendsFrom(shade)
@alexandrebodin
alexandrebodin / index.js
Created June 6, 2019 13:55
Uploading images to strapi with react and axios
import React, { Component } from 'react';
import axios from 'axios';
import './App.css';
class App extends Component {
constructor() {
super();
this.state = {
images: [],
@rambabusaravanan
rambabusaravanan / detect-react-object.js
Created March 12, 2018 07:42
Detect React Objects - Components and Elements
function isClassComponent(component) {
return typeof component === 'function'
&& !!component.prototype.isReactComponent
}
function isFunctionComponent(component) {
return typeof component === 'function'
// && !!String(component).includes('return React.createElement') // may fails
&& React.isValidElement(Component())
}
@Maqsim
Maqsim / 413-payload-too-large-fix.js
Last active January 21, 2025 12:10
HOW TO FIX "413 Payload too large" in NodeJS (Express)
const express = require('express');
const bodyParser = require('body-parser');
...
// Express 4.0
app.use(bodyParser.json({ limit: '10mb' }));
app.use(bodyParser.urlencoded({ extended: true, limit: '10mb' }));
// Express 3.0
@ldclakmal
ldclakmal / Stemmer.java
Created January 21, 2018 02:47
Stemmer, implementing the Porter Stemming Algorithm
package DM;
/*
Porter stemmer in Java. The original paper is in
Porter, 1980, An algorithm for suffix stripping, Program, Vol. 14,
no. 3, pp 130-137,
See also http://www.tartarus.org/~martin/PorterStemmer
@AVGP
AVGP / wat.js
Created September 6, 2017 22:17
ffmpeg.js converting webm from a media recorder into mp4
var ffmpeg = require('ffmpeg.js/ffmpeg-mp4.js')
document.querySelector('button').addEventListener('click', (evt) => {
document.querySelector('[camera]').setAttribute('animation', {
property: 'rotation',
to: '0 360 0',
dur: 10000,
easing: 'linear'
})
@gunjanpatel
gunjanpatel / revert-a-commit.md
Last active April 27, 2025 09:56
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@igorkulman
igorkulman / configuration.xml
Last active May 5, 2025 05:16
Office 2016 configuration to only install Word, Excel, PowerPoint and OneNote.
<!-- Office 365 client configuration file sample. To be used for Office 365 ProPlus 2016 apps,
Office 365 Business 2016 apps, Project Pro for Office 365 and Visio Pro for Office 365.
For detailed information regarding configuration options visit: http://aka.ms/ODT.
To use the configuration file be sure to remove the comments
For Office 365 client apps (verion 2013) you will need to use the 2013 version of the
Office Deployment Tool which can be downloaded from http://aka.ms/ODT2013
The following sample allows you to download and install Office 365 ProPlus 2016 apps
@vegaasen
vegaasen / supress-warning-idea.md
Created November 27, 2015 12:59
SuppressWarnings with IntelliJ Idea

@SuppressWarnings - IntelliJ modes

Information

This list may grow each year with either new versions or patches. Enjoy!

Usage

Following is an example related to the usage of the various ignore capabilities.