Skip to content

Instantly share code, notes, and snippets.

@millipedia
millipedia / calculate_reading_time.php
Last active December 20, 2021 12:23
Processwire hook to calculate article reading time
<?php
/**
*
* Calculate reading time on page save.
* Add this to your ready.php file.
* Uses a field called 'article_read_time' to store the value
* and the field 'page_content' as the readable content.
* You'll need to update those field names if yours are different.
*
@KazeroG
KazeroG / gist:ed8c88928e5a7a3383f606546a9fa3f4
Created December 3, 2019 06:39
GitHub Api download zip or tarball link
You can `wget` your way out of the GitHub repo to get a tar file ([archive][1]):
wget --no-check-certificate https://github.com/User/repo/archive/master.tar.gz
# better, if the certificate authorities are present:
wget https://github.com/User/repo/archive/master.tar.gz
will get you a file named 'master' from the user 'User''s repo 'repo'.
The [updated V3 API url][2] is:
@Marcono1234
Marcono1234 / Decompiling with MCPConfig.md
Last active August 13, 2024 05:00
Decompiling and deobfuscating Minecraft with MCPConfig (https://github.com/MinecraftForge/MCPConfig)

Disclaimer

I don't have much experience with Gradle and just found a way to get MCPConfig to decompile and deobfuscate Minecraft jar files. The described steps might be extremely inefficient and even wrong.

Any feedback is therefore welcome!

Usage

You can use the project MCPConfig-CSV-mappings afterwards to apply CSV mappings, however in that case you have to adjust the indentation used by fernflower as described in the "Usage with MCPConfig" section before using MCPConfig.

  1. Download the latest MCPConfig version from: https://github.com/MinecraftForge/MCPConfig
  2. Look in the versions folder and choose the version you want, in the following called ``, for example 1.13.1
@matthewzring
matthewzring / markdown-text-101.md
Last active November 13, 2024 18:15
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers:

@gwagroves
gwagroves / copy_git_diff.sh
Created September 12, 2017 18:14
Copy git modified files to another directory
cp -pv --parents `git diff --name-only master..develop -- source/directory` target/directory
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active November 16, 2024 22:55
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@sofaking
sofaking / adb.sh
Created March 3, 2017 10:48
Get battery level via adb
adb shell dumpsys battery | grep level
@Birdie0
Birdie0 / ifttt-webhooks-extended-guide.md
Last active November 1, 2024 08:43
How to use Discord Webhooks

⚠️ This gist is no longer updated! For maintained, improved and even more extended guide click here.


How to use Discord Webhook

It's a JSON

First, learn JSON. It's not programming language, not even close. Just follow syntax rules and you will be fine.

@munchicken
munchicken / htaccess
Last active December 16, 2022 10:56 — forked from dave1010/htaccess
HTTP Status Cats Apache (htaccess) config
# HTTP Status Cats
# Apache (htaccess) config originally created by @dave1010,
# rebuilt by Sarah Pierce (see modifications section)
# Licensed CC BY 2.0
# Images CC BY 2.0, from GirlieMac's photostream:
# http://www.flickr.com/photos/girliemac/sets/72157628409467125/with/6508023065/
# Usage: copy save this file as .htaccess or add it to your httpd.conf
--[[
Twitch.tv extension v0.0.2 by Stefan Sundin
https://gist.github.com/stefansundin/c200324149bb00001fef5a252a120fc2
The only thing that this extension does is to act as a helper to seek to the
correct time when you open a twitch.tv url that contains a timestamp.
You must have the playlist parser installed as well!
Usage:
1. Install the playlist parser: https://addons.videolan.org/p/1167220/