Skip to content

Instantly share code, notes, and snippets.

View codecandies's full-sized avatar
😸
Pffffft.

Nico Brünjes codecandies

😸
Pffffft.
View GitHub Profile
@codecandies
codecandies / prefers-reduced-motion-listener.js
Created July 19, 2019 06:53
Prefers reduced motion listener
/*
* Generally look for prefers reduced motion
* with a listener on the media query
* as seen on: https://www.scottohara.me/note/2019/07/12/reduced-motion-video.html
*/
var motionQuery = matchMedia('(prefers-reduced-motion)');
function reducedMotionCheck() {
if ( motionQuery.matches ) {
// code to run if "reduced" is true
}
@codecandies
codecandies / prtemplate.md
Last active September 13, 2018 11:55
Pull Request Template

Github Pull Request Template

What this PR does

Where to start

How to test manually

Screenshots

@codecandies
codecandies / wordpress.permissions.md
Last active April 3, 2018 11:13
Setting file permissions for wordpress

Changing file permissions for wordpress

  1. Set apache as owner chown www-data:www-data -R *
  2. Change directory permissions rwxr-xr-x find . -type d -exec chmod 755 {} \;
  3. Change file permissions rw-r--r-- find . -type f -exec chmod 644 {} \;

After setup process you may want

  1. Let your useraccount be owner
@codecandies
codecandies / has_variables.css
Created March 23, 2018 11:23
css variable support test
@supports (color: var(--)) {
...
}
@codecandies
codecandies / wp-cli.sh
Last active April 6, 2018 13:32
WP CLI Collection
# empty comment trash
wp comment delete $(wp comment list --status=trash --format=ids)
# delete all spam comments
wp comment delete $(wp comment list --status=spam --format=ids)
# show config
wp config get
# show db sizes
@codecandies
codecandies / wp-config.php
Created March 5, 2018 09:42
Wordpress behind a reverse proxy
// Code for showing correct client IP address
if ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
$zon_xforwarded = explode( ',', $_SERVER['HTTP_X_FORWARDED_FOR'] );
$_SERVER['REMOTE_ADDR'] = $zon_xforwarded[0];
}
@codecandies
codecandies / responsive-voice.js
Created February 27, 2018 13:43 — forked from anchetaWern/responsive-voice.js
responsive-voice.js
//Look for other responsivevoice instances
/*if (window.parent != null) {
var iframes = window.parent.document.getElementsByTagName('iframe');
for (var i = 0; i < iframes.length; i++) {
//iframes[i].style.width = "300px"
}
}*/
if (typeof responsiveVoice != 'undefined') {
console.log('ResponsiveVoice already loaded');
@codecandies
codecandies / fix-zepto.html
Created September 20, 2017 13:13
Test file to check for pseudo element support in Zepto in podlove button
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href='http://fonts.googleapis.com/css?family=Roboto:400,700' rel='stylesheet' type='text/css'>
<style>
body {
font-family: 'Roboto';
color: #444;
height: 100%;

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@codecandies
codecandies / systemfont.css
Created April 10, 2017 08:19
Systemfont CSS
body {
font-family: -apple-system, BlinkMacSystemFont, “Segoe UI”, Roboto, Helvetica, Arial, sans-serif;
}