Skip to content

Instantly share code, notes, and snippets.

View QWp6t's full-sized avatar
😏
Feel free to ask for a refund.

QWp6t QWp6t

😏
Feel free to ask for a refund.
View GitHub Profile
@chrisguitarguy
chrisguitarguy / proper.php
Last active May 22, 2019 16:39
How to properly do a `save_post` callback
<?php
add_action('save_post', 'cgg_proper_save_post', 10, 2);
// first off: it doesn't matter if you return anything from this function
// `save_post` is an action, nothing is done with the return values of its
// callbacks. You're free to return $post_id if you want, obviously, but
// it's not a filter.
function cgg_proper_save_post($post_id, $post)
{
@hofmannsven
hofmannsven / README.md
Last active April 19, 2024 13:17
Git CLI Cheatsheet
@rjmoggach
rjmoggach / webfaction_gitlab.md
Last active October 8, 2023 08:39
Webfaction GitLab Install

Install Gitlab on webfaction

November 2014

I wanted to install gitlab on my shared hosting server at webfaction and here's how I did it. Be warned it's a memory hog. I couldn't get it below 450Mb. Also... this is for their newer 64 bit servers. I tried on a 32 bit server and didn't want to waste a day tracking down dependencies.

Create app for gitlab

Create a new app (using python)

@discordier
discordier / gist:ed4b9cba14652e7212f5
Created December 4, 2014 06:23
options for phpStorm @noinspection annotation
javascript
ES6ValidationInspection
JSAccessibilityCheckInspection
JSBitwiseOperatorUsageInspection
JSCheckFunctionSignaturesInspection
JSClosureCompilerSyntaxInspection
JSCommentMatchesSignatureInspection
JSComparisonWithNaNInspection
JSConsecutiveCommasInArrayLiteralInspection
@guedressel
guedressel / font-awesome-mime-type-icons.php
Last active October 13, 2022 09:30
Font Awesome File Icons: Mapping MIME Types to correct icon classes
<?php
/**
* Get font awesome file icon class for specific MIME Type
* @see https://gist.github.com/guedressel/0daa170c0fde65ce5551
*
*/
function font_awesome_file_icon_class( $mime_type ) {
// List of official MIME Types: http://www.iana.org/assignments/media-types/media-types.xhtml
@tomjn
tomjn / behave.js
Last active April 17, 2018 19:45
Adds a shortcode to WordPress that lets you test escaping and sanitising functions on content
/*
* Behave.js
*
* Copyright 2013, Jacob Kelley - http://jakiestfu.com/
* Released under the MIT Licence
* http://opensource.org/licenses/MIT
*
* Github: http://github.com/jakiestfu/Behave.js/
* Version: 1.5
*/
@jasonmelgoza
jasonmelgoza / bauhausian.json
Created May 25, 2016 00:24
CSScomb with sort order from @mdo's Code Guide
{
"config": {
"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "lower",
"block-indent": " ",
"color-shorthand": true,
"element-case": "lower",
"eof-newline": true,
"leading-zero": false,
@Log1x
Log1x / debloatNox.md
Last active April 24, 2024 13:06
Debloating & Optimizing Nox

Debloating Nox

Nox, despite being the most feature-filled Android emulator, has a lot of negativity surrounding it due to their antics when it comes to making income off of their program. It is known for running repeated advertisments in the background, calling home and passing along system information (outside of your Android instance) as well as a vast amount of potentially sensitive data in an encrypted payload back to their multitude of servers. With the following preventitive measures, we can stop a majority of this happening as well as greatly improve the overall performance.

  1. Download and Install a fresh copy of Nox. The latest version is fine (for now). If you already have it installed, that is fine too. No need to reinstall.

  2. Enable Root Mode on Nox by clicking the gear icon and then checking the Root Startup box.

  3. Install a new Launcher from the Play Store. ANYTHING but Nox's default. I suggest [Nova Launcher](https://play.google.com/s

@joepie91
joepie91 / es-modules-are-terrible-actually.md
Last active April 14, 2024 04:25
ES Modules are terrible, actually

ES Modules are terrible, actually

This post was adapted from an earlier Twitter thread.

It's incredible how many collective developer hours have been wasted on pushing through the turd that is ES Modules (often mistakenly called "ES6 Modules"). Causing a big ecosystem divide and massive tooling support issues, for... well, no reason, really. There are no actual advantages to it. At all.

It looks shiny and new and some libraries use it in their documentation without any explanation, so people assume that it's the new thing that must be used. And then I end up having to explain to them why, unlike CommonJS, it doesn't actually work everywhere yet, and may never do so. For example, you can't import ESM modules from a CommonJS file! (Update: I've released a module that works around this issue.)

And then there's Rollup, which apparently requires ESM to be u