- Don't copy files into current document root
- Let existing requests finish on old code
- New requests start on new code
- Avoid clearing your opcode cache
- Minimal impact on production traffic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Helps with this problem: | |
// http://stackoverflow.com/questions/8059914/express-js-hbs-module-register-partials-from-hbs-file | |
var hbs = require('hbs'); | |
var fs = require('fs'); | |
var partialsDir = __dirname + '/../views/partials'; | |
var filenames = fs.readdirSync(partialsDir); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// REMOVE WP-CONTENT | |
// Rewrites DO NOT happen for child themes | |
// Add .htaccess rewrite rules to convert urls | |
// like "http://example.com/wp-content/themes/theme-name/path" into "http://example.com/path" | |
/* | |
in case your wordpress is in a folder, | |
and you change the site_url to the root of the domain, | |
add the folder name in lines 29 to 34, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MultiExporter.jsx | |
// Version 0.1 | |
// Version 0.2 Adds PNG and EPS exports | |
// Version 0.3 Adds support for exporting at different resolutions | |
// Version 0.4 Adds support for SVG, changed EPS behaviour to minimise output filesize | |
// Version 0.5 Fixed cropping issues | |
// Version 0.6 Added inner padding mode to prevent circular bounds clipping | |
// | |
// Copyright 2013 Tom Byrne | |
// Comments or suggestions to tom@tbyrne.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pmpro_currencies_ruble($currencies) | |
{ | |
$currencies['RUB'] = __('Russian Ruble (RUB)', 'pmpro'); | |
return $currencies; | |
} | |
add_filter('pmpro_currencies', 'pmpro_currencies_ruble'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function json_api_prepare_post( $post_response, $post, $context ) { | |
$field = get_post_custom($post['ID']); | |
$post_response['custom-fields'] = $field; | |
return $post_response; | |
} | |
add_filter( 'json_prepare_post', 'json_api_prepare_post', 10, 3 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MyPost extends TimberPost { | |
public function __construct( $post_id = null, $post_type = 'post' ) { | |
if ( is_string( $post_id ) ) { | |
// If $post_id is a string, we'll consider it a slug and try to get the ID | |
$args = array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# first: | |
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done | |
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.* | |
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following: | |
# go to /usr/local/lib and delete any node and node_modules | |
cd /usr/local/lib | |
sudo rm -rf node* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import $ from 'jquery'; | |
import plugin from './plugin'; | |
class ScrollToTop { | |
constructor(element, options) { | |
const $element = $(element); | |
$(window).scroll(function () { | |
if ($(this).scrollTop() > options.offset) { | |
$element.fadeIn(); |
OlderNewer