Skip to content

Instantly share code, notes, and snippets.

@BigWhale
BigWhale / tailwind-config.js
Last active June 27, 2019 13:50
Tailwind more pseudo classes and variants
variants: {
margin: ['responsive', 'last-child', 'first-child', 'odd-child', 'even-child'],
},
plugins: [
function({ addVariant, e }) {
addVariant('first-child', ({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `.${e(`first-child${separator}${className}`)}:first-child`
})
})
@westonruter
westonruter / shutdown-handler.php
Last active March 22, 2019 18:48
Disable WSOD detection on WordPress 5.1 so that fatal errors during development don't constantly cause plugins to suspend
<?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: https://gist.github.com/westonruter/583a42392a0b8684dc268b40d44eb7f1
* Plugin Author: Weston Ruter
*/
/**
@lukecav
lukecav / Command
Last active June 6, 2023 20:50
Delete all Action Scheduler posts using WP-CLI
wp post delete $(wp post list --post_type='scheduled-action' --format=ids)
wp post delete $(wp post list --post_status=trash --format=ids)
@dehuszar
dehuszar / detokenize
Created November 8, 2016 15:44
Use to extract extra values from your token
/* Usage
* {{detokenize 'extraValue'}} */
import Ember from 'ember';
const { get, inject } = Ember;
export default Ember.Helper.extend({
session: inject.service(),
compute(params) {
@BrianSipple
BrianSipple / ember-addon-essentials.md
Last active April 17, 2017 18:27
Ember Addon Essentials -- A checklist of some of the finer details to keep in mind when developing Ember addons

Ember Addon Essentials

This document is meant to be a brief "checklist" of things to setup for your Ember addon when beginning development in order to have the best possible architecture and workflow out of the gate. For more comprehensive material, the following are bookshelf-caliber:

Filling out package.json

import traceback
import re
def debug_var(a):
s = traceback.extract_stack(limit=2)[0][3]
g = re.match("\w+\((\w+)\)", s)
print("%s = %r" % (g.group(1), a))
def main():
foo=1
@AndrewChamp
AndrewChamp / docx_editor.php
Created July 27, 2015 15:05
Edit a Microsoft Word .docx file using PHP and the zip extension.
<?php
/**
* Edit a Word 2007 and newer .docx file.
* Utilizes the zip extension http://php.net/manual/en/book.zip.php
* to access the document.xml file that holds the markup language for
* contents and formatting of a Word document.
*
* In this example we're replacing some token strings. Using
* the Office Open XML standard ( https://en.wikipedia.org/wiki/Office_Open_XML )
* you can add, modify, or remove content or structure of the document.
@max-mapper
max-mapper / readme.md
Last active May 14, 2022 09:12
list of interdisciplinary open source conferences

Interdisciplinary Open Source Community Conferences

Criteria

  • Must be an event that someone involved in open source would be interested in attending
  • Must be a community oriented event (no corporate owned for-profit events here please)
  • Can't be about a specific language/framework.

Leave suggestions in the comments below

@rafibomb
rafibomb / 2-column-stacking
Created November 15, 2014 01:20
2 Column Stacking Inline Links on Mobile - Ink Responsive HTML Email
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width"/>
<link rel="stylesheet" href="ink.css"> <!-- For testing only -->
<link type="text/css" rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/foundation-icons.css" />
<style type="text/css">
@mosne
mosne / gist:75b3ce1f0098663f2b1a
Last active August 17, 2018 18:37
Migrate images form a Magic Fields to ACF (inside a wordpress loop)
<?php
$photo_name = get_field("cover");
if ($photo_name != "") {
$ff = '/Users/mosne/Sites/Dropbox/mosne.local/wp-content/files_mf/' . $photo_name;
$handle = fopen($ff, "r");
$ffcontents = fread($handle, filesize($ff));
$attachment = wp_upload_bits($photo_name, null, $ffcontents);