Skip to content

Instantly share code, notes, and snippets.

@dave1010
dave1010 / htaccess
Created December 14, 2011 13:07
HTTP Status Cats Apache (htaccess) config
# HTTP Status Cats
# Apache (htaccess) config created by @dave1010
# 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
ErrorDocument 404 '<a href="http://www.flickr.com/photos/girliemac/6508022985/" title="404 - Not Found by GirlieMac, on Flickr"><img src="http://farm8.staticflickr.com/7172/6508022985_b22200ced0.jpg" width="500" height="400" alt="404 - Not Found"></a>'
@ozh
ozh / Directory.reg
Created November 9, 2012 20:46
Regedit keys: Git GUI & Git Bash context menus
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\git]
@="* Guit Bash"
"NoWorkingDirectory"=""
[HKEY_CLASSES_ROOT\Directory\Background\shell\git\command]
@="C:\\Program Files (x86)\\Console2\\Console.exe -t \"Git\" -d \"%V\""
[HKEY_CLASSES_ROOT\Directory\Background\shell\git_gui]
@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
@visitdigital
visitdigital / webhook.php
Last active September 20, 2022 02:51
Very Simple Facebook Chat Bot PHP Webhook Script Example
<?php
$challenge = $_REQUEST['hub_challenge'];
$verify_token = $_REQUEST['hub_verify_token'];
// Set this Verify Token Value on your Facebook App
if ($verify_token === 'testtoken') {
echo $challenge;
}
$input = json_decode(file_get_contents('php://input'), true);
@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
@jbuncle
jbuncle / jquery.toggle-attribute.js
Created November 26, 2015 23:32
jQuery Plugin to toggle an elements attribute
/*!
* jQuery Toggle Attribute
*
* Copyright 2013 James Buncle
*
* Released under the MIT license.
* http://jquery.org/license
*
*/
(function($) {
@DavidRockin
DavidRockin / Mailer.php
Created August 2, 2014 21:53
PHPMailer save emails to IMAP folder
<?php
class Mailer extends PHPMailer {
/**
* Save email to a folder (via IMAP)
*
* This function will open an IMAP stream using the email
* credentials previously specified, and will save the email
* to a specified folder. Parameter is the folder name (ie, Sent)
@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