Skip to content

Instantly share code, notes, and snippets.


Nick Cernis nickcernis

  • Innsbruck, Austria
View GitHub Profile
westonruter / shutdown-handler.php
Last active Mar 22, 2019
Disable WSOD detection on WordPress 5.1 so that fatal errors during development don't constantly cause plugins to suspend
View shutdown-handler.php
<?php // phpcs:disable WordPress.Files.FileName.InvalidClassFileName
* Plugin Name: Non-Handling Shutdown Handler
* Description: Disable WSOD protection so that plugins will not auto-suspend during development while errors often occur.
* Plugin URI:
* Plugin Author: Weston Ruter
pento / php-block.js
Last active Mar 23, 2021
Converting a shortcode to a block: this method is fast to do, but a mediocre UX. You should only use this as a stopgap until you can implement a full block UI.
View php-block.js
// License: GPLv2+
var el = wp.element.createElement,
registerBlockType = wp.blocks.registerBlockType,
ServerSideRender = wp.components.ServerSideRender,
TextControl = wp.components.TextControl,
InspectorControls = wp.editor.InspectorControls;
* Here's where we register the block in JavaScript.
jordwalke /
Last active Sep 19, 2018
Watcher Script Using Unix Find.
# Invoke like this:
# ./ my command here
# And it will run 'my command here' once, and then when it detects changes.
# TODO: Don't just search in the last second. Search for updates since the last
# completed build. Otherwise for big directories, midway through your search
# you've already taken 1s and you will miss updates.
ErisDS /
Last active Mar 29, 2021
Deployment tools for Ghost themes

Gulp tools to deploy a Ghost theme

To set it up:

  • copy gulp-config.json.example to gulp-config.json
  • enter the blog admin url, no trailing slash, e.g.
  • grab the client secret for the frontend from the source of any page of the blog
  • enter the email address & password you use to login to the blog (must be administrator-level)

To deploy:

reborg /
Last active May 8, 2021
A curated collection of answers that Rich gave throughout the history of Clojure

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.

How to use:

  • The link in the table of content jumps at the copy of the answer on this page.
  • The link on the answer itself points back at the original post.

Table of Content


Aligning images

left alignment

This is the code you need to align images to the left:

<img align="left" width="100" height="100" src="">
alekseykulikov /
Last active Aug 8, 2020
Principles we use to write CSS for modern browsers

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

GaryJones / PluginTest.php
Last active Aug 2, 2016
Test that plugin called `load_plugin_textdomain()` correctly.
View PluginTest.php
namespace GAA\CorpManager;
use WP_UnitTestCase;
class PluginTest extends WP_UnitTestCase {
private $domain;
private $mofile;
bmhatfield / .profile
Last active May 13, 2021
Automatic Git commit signing with GPG on OSX
View .profile
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
rauchg /
Last active Feb 19, 2021