Skip to content

Instantly share code, notes, and snippets.

View dlnr's full-sized avatar

Niels Roozemond dlnr

View GitHub Profile
@jeromecoupe
jeromecoupe / webstoemp-gulpfile.js
Last active March 7, 2026 05:03
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
@tcrammond
tcrammond / nvm-auto-run.md
Created October 23, 2017 08:01
Automatically nvm use when entering directory

Calling nvm use automatically in a directory with a .nvmrc file

Put this into your $HOME/.zshrc to call nvm use automatically whenever you enter a directory that contains an .nvmrc file with a string telling nvm which node to use:

place this after nvm initialization!

@yunusga
yunusga / gist:33cf0ba9e311e12df4046722e93d4123
Created April 5, 2017 11:55
Debug WordPress 404 issues (permalinks, rewrite rules, etc.)
/* Produces a dump on the state of WordPress when a not found error occurs */
/* useful when debugging permalink issues, rewrite rule trouble, place inside functions.php */
ini_set( 'error_reporting', -1 );
ini_set( 'display_errors', 'On' );
echo '<pre>';
add_action( 'parse_request', 'debug_404_rewrite_dump' );
function debug_404_rewrite_dump( &$wp ) {
@adamsdesk
adamsdesk / gnome-rotate-wallpaper.service
Last active March 26, 2025 15:01
Rotate the Gnome desktop wallpaper using Systemd user unit and timer.
[Unit]
Description=Gnome rotate wallpaper
[Service]
Type=oneshot
Environment=DISPLAY=:0
Environment=WALLPAPER_DIR=%h/Pictures/wallpaper
EnvironmentFile=-%h/.config/systemd/user/gnome-rotate-wallpaper.conf
ExecStart=/bin/bash /usr/local/bin/gnome_rotate_wallpaper
@tonykevin
tonykevin / archlinux-virtualbox.sh
Created March 9, 2016 21:42 — forked from GabLeRoux/archlinux-virtualbox.sh
Virtualbox archlinux notes
# sudo /sbin/rcvboxdrv -h
# Unloading modules:
# Loading modules: modprobe: FATAL: Module vboxnetadp not found in directory /lib/modules/4.4.3-1-ARCH
# modprobe: FATAL: Module vboxnetflt not found in directory /lib/modules/4.4.3-1-ARCH
# modprobe: FATAL: Module vboxpci not found in directory /lib/modules/4.4.3-1-ARCH
# modprobe: FATAL: Module vboxdrv not found in directory /lib/modules/4.4.3-1-ARCH
# Solution
# from https://forum.antergos.com/topic/818/can-t-run-my-vitualbox/4
@JRGould
JRGould / give-it-a-rest-plugin.php
Last active August 2, 2016 14:45
Give it a REST WordPress plugin component
<?php
/*
Plugin Name: Give It A REST API Plugin
Plugin URI: http://deliciousbrains.com/blog
Description: Enables the Give it a REST API
Author: Jeff Gould
Version: 0.1
Author URI: http://deliciousbrains.com
*/
@p3t3r67x0
p3t3r67x0 / pseudo_elements.md
Last active February 24, 2026 02:08
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@chuycepeda
chuycepeda / .zshrc
Created November 26, 2014 23:12
.zshrc edits for gcloud sdk and gcloud-zsh-completion
#If zsh installed, gcloud may not work, thus add the following lines to .zshrc file (aka on Terminal run $ vi /.zshrc)
#zsh install: https://github.com/robbyrussell/oh-my-zsh/
#gcloud sdk install: https://cloud.google.com/sdk/
#gcloud zsh completion install: https://github.com/littleq0903/gcloud-zsh-completion
#gcloud
export PATH="/path/to/google-cloud-sdk/bin:$PATH"
#gcloud zsh completion
fpath=(/path/to/gcloud-zsh-completion/src $fpath)
@dwchiang
dwchiang / .zshrc
Created April 16, 2014 10:30
gcloud with zsh
# The next line updates PATH for the Google Cloud SDK.
source /Users/dwchiang/google-cloud-sdk/path.zsh.inc
# The next line enables zsh completion for gcloud.
source /Users/dwchiang/google-cloud-sdk/completion.zsh.inc
@dlh01
dlh01 / WordPress parent and child themes with Sass, Compass, and Grunt.md
Last active March 17, 2023 11:57
Maintaining stylesheets for WordPress parent and child themes using Sass, Compass, and Grunt

This post outlines a way to use Sass, Compass, and Grunt to maintain stylesheets for a WordPress parent and child theme.

Sass is useful for many reasons, but for our purposes, the two most helpful features are partials and variables. We'll also take advantage of the importPath setting of Compass and Grunt.

Comments and improvements are always welcome.

Step 1: Create your parent stylesheet

Create a new Compass project in your theme and style away. When you're finished, your theme directory (called parent here) might look something like this: