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 March 16, 2022 18:29
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
@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 April 29, 2024 07:03
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 March 6, 2024 13:38
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
@stefansundin
stefansundin / twitch-extension.lua
Last active November 26, 2023 13:32
VLC playlist parser for Twitch.tv - https://addons.videolan.org/p/1167220/
--[[
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/
@davebarnwell
davebarnwell / PHP composer tools.md
Last active April 3, 2024 09:11
Global installation of PHP tools with Composer

Global installation of PHP tools with Composer

To install a composer package globally, you run the usual require command, but with the addition of the global modifier. So to install PHPUnit, you would run:

$ composer global require phpunit/phpunit
$ composer global require phpunit/dbunit
$ composer global require phing/phing
$ composer global require phpdocumentor/phpdocumentor
$ composer global require sebastian/phpcpd