Skip to content

Instantly share code, notes, and snippets.

View tomhermans's full-sized avatar
👻
tinkering

Tom Hermans tomhermans

👻
tinkering
View GitHub Profile
@nciske
nciske / clean_post_content.php
Last active January 4, 2016 07:59
Cleanup WP post content (e.g. after a migration from another CMS)
<?php
// Warning: this will overwrite every post in your database
// BACKUP FIRST!
clean_post_content();
function clean_post_content() {
$posts = get_posts(array(
'post_type' => array('post'), // or page, or cpt
'post_status' => 'publish', // or any, draft, etc
@jeffsebring
jeffsebring / _wordpress.sass
Created October 29, 2012 16:21
WordPress Core Styles SASS
.sticky,
.bypostauthor,
.gallery-caption
display: normal
.alignright
float: right
display: block
.alignleft
@davidmerrique
davidmerrique / zoomify.jsx
Last active April 14, 2017 06:17
Photoshop Script to save multiple sizes of an image. I use it for work.
var inFolder = Folder.selectDialog("Please select folder to process");
if(inFolder !== null) {
var fileList = inFolder.getFiles(/\.(jpg|tif|psd|)$/i);
var outfolderName = prompt('Folder name', 'zoom');
var outfolder = new Folder(decodeURI(inFolder) + "/" + outfolderName);
if (!outfolder.exists) outfolder.create();
for(var a = 0; a < fileList.length; a++) {
@Gaya
Gaya / responsive-svg-sprite-template.scss
Last active September 15, 2017 14:19
Responsive SVG Sprite Mixin
/*
* Generate a SVG-sprite mixin for Sass
* ====================================
*
* Gaya Kessler - http://gaya.ninja - http://twitter.com/GayaNinja
*
* SVGSprite is a wonderful package, but doesn't enable responsive sprites out of the box.
* This moustache template generates a sass file with a mixin for the generated SVG-sprite.
* Calculates the position and size of the background by filename.
* Included SVG image scales to width and height.
@hatefulcrawdad
hatefulcrawdad / foundation5-grid.css
Created June 18, 2013 17:31
Sneak peek at what we're thinking about for the Foundation 5 Grid.
/* Row and Column defaults */
.row { margin-left: auto; margin-right: auto; margin-top: 0; margin-bottom: 0; max-width: 62.5em; width: 100%; }
.row .row.collapse { margin-left: 0; margin-right: 0; max-width: none; width: auto; }
.row .row { margin-left: -0.9375em; margin-right: -0.9375em; max-width: none; width: auto; }
.row.collapse .column, .row.collapse .columns { padding-left: 0; padding-right: 0; float: left; }
.column, .columns { padding-left: 0.9375em; padding-right: 0.9375em; width: 100%; float: left; position: relative; }
/* Up to 640px */
@media only screen {
.small-1 { width: 8.33333% }
<?php
/**
* Add dummy query var which causes all languages to be shown
* in the queries.
* See https://github.com/polylang/polylang/blob/2ed446f92955cc2c952b944280fce3c18319bd85/include/query.php#L125-L134
*/
add_filter( 'pll_filter_query_excluded_query_vars', function( $excludes ) {
$excludes[] = 'allLanguages';
return $excludes;
@cblunt
cblunt / gulpfile.js
Created May 11, 2017 21:37
Gulpfile for simple static website prototyping
// $ npm install
// $ gulp serve
// $ open http://localhost:8080
var gulp = require('gulp'),
del = require('del'),
scss = require('gulp-sass'),
htmlmin = require('gulp-htmlmin'),
cleancss = require('gulp-clean-css'),
connect = require('gulp-connect'),
<?php
namespace YourPlugin\Blocks;
abstract class Block{
/**
* Block title
*
* @var string
{
"React Stateless Functional Component": {
"prefix": "rfac",
"body": [
"import React from 'react'",
"",
"const $TM_FILENAME_BASE = () => { ",
"\treturn (",
"\t\t<div>",
"",
@font-face {
font-family: 'Inter'; /* v3.11 */
font-style: normal;
font-weight: 400;
src: url("data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAADK8AA4AAAAAcuwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABHREVGAAAjJAAAACsAAAAuAkUCbUdQT1MAACNQAAAG2QAAHSa0FrhtR1NVQgAAKiwAAAiOAAAjFrGWVndPUy8yAAAhyAAAAFEAAABggKJ82GNtYXAAACIcAAAAOwAAAGAAGwJFZ2FzcAAAIxwAAAAIAAAACP//AANnbHlmAAABRAAAHOsAACo2iAHLmGhlYWQAAB/EAAAANgAAADYnUzaRaGhlYQAAIagAAAAfAAAAJB71EI9obXR4AAAf/AAAAasAAAMIOf6DtWxvY2EAAB5MAAABdwAAAYbyJ+fUbWF4cAAAHjAAAAAcAAAAIADZAOduYW1lAAAiWAAAAK0AAAFkGpw0V3Bvc3QAACMIAAAAEwAAACD+MwDAeNp9egFAVFX29z33vXkzGOowDIBFxjgIrGtGDgj9c42v1f1Ty7bYx6p/Q5sVIjQyZFFJTSciJcUiJZYIlRSVDAUVkxRtUlQssknRWJs1bKmPdWdr1tAGmHfnO/e9QSG/vsb3Zt6Pc88953fvOffc+yKUdPjcdKqOEIGMJgQEsxA8LjohfoplcmiIUaJ6Y4+x5PFFix7HS0f6kzX2n9z8gV/E5yNtmmShVkf00QRV6LVERwkhqDWOEMmO0D3kPkJMwSbBHGxKNCmXRVAurUm5gP+xY57smdc2j30eCZPT2flIeACfqA5v8GAkO5cOkyLZF/PkfVSXLntoktxGk9oowbusXG2MtMltAqHcixofkbICCIklD5KHCIGEKBJjGgthQTHRBP2KSkywhISKoWHmSRATFDZWCDFSURsSNA0S4ifBAyAEjYIQ41