Skip to content

Instantly share code, notes, and snippets.

💭
Looking for improvements!

Matthias Günter matzeeable

💭
Looking for improvements!
Block or report user

Report or block matzeeable

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@spacedmonkey
spacedmonkey / Function.txt
Last active Feb 17, 2020
WordPress core private Functions and Classes.
View Function.txt
Functions
startElement
endElement
_wp_menu_output
_add_themes_utility_last
_wp_ajax_delete_comment_response
_wp_ajax_add_hierarchical_term
wp_link_manager_disabled_message
_wp_credits_add_profile_link
View .babelrc
{
"presets": [
[ "env", {
"modules": false,
"targets": {
"browsers": [
"last 2 Chrome versions",
"last 2 Firefox versions",
"last 2 Safari versions",
"last 2 iOS versions",
@heiswayi
heiswayi / repo-reset.md
Created Feb 5, 2017
GitHub - Delete commits history with git commands
View repo-reset.md

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
View reduce-node-modules-bloat.md

How you can help reduce node_modules bloat

This recent reddit thread reveals discontent among the web development community about the sheer volume of stuff in a typical node_modules dir. 140MB in this case!

Is it a design flaw in npm?

Opinions in the thread varied from "I'm surprised npm even works" to "everything is fine". I'm not going to offer an opinion, just these two observations:

  1. node_modules dirs typically do contain lots of stuff that doesn't need to be there.
  2. The latest version mitigates overall size by flattening the dependency tree, but some of the bloat is beyond npm's control.
@JustThomas
JustThomas / wordpress-multisite-internal-redirect-loop.md
Last active Jan 30, 2020
WordPress Multisite: How to fix error "too many redirects"
View wordpress-multisite-internal-redirect-loop.md

WordPress Multisite: How to fix error "Request exceeded the limit of 10 internal redirects"

I am running a WordPress multisite network with sub-directory setup. When I check my error.log file, it is full of entries like this one:

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'Limit InternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

The problem was, in my case, one specific rewrite rule in the .htaccess file.

Problem description

@mekwall
mekwall / bandwidth.js
Created Jan 4, 2013
How to measure bandwidth of a server in Node.js (and some other statistics)
View bandwidth.js
const net = require("net");
var server = net.createServer(function (c) {
var oldWrite = c.write;
c.write = function(d) {
if (!Buffer.isBuffer(d)) {
d = new Buffer(d);
}
oldWrite.call(this, d);
server.bytesSent += d.length;
@jbroadway
jbroadway / Slimdown.md
Last active Feb 20, 2020
Slimdown - A simple regex-based Markdown parser.
View Slimdown.md

Slimdown

A very basic regex-based Markdown parser. Supports the following elements (and can be extended via Slimdown::add_rule()):

  • Headers
  • Links
  • Bold
  • Emphasis
  • Deletions
You can’t perform that action at this time.