Skip to content

Instantly share code, notes, and snippets.

View pawelmadeja's full-sized avatar
🤠

Paweł Madeja pawelmadeja

🤠
View GitHub Profile
@thisislawatts
thisislawatts / acfphp2json.php
Last active June 8, 2017 20:25
Convert ACF php files to ACFJSON
<?php
function convert_ACF_PHP_2_Json() {
$status = [];
$theme_dir = get_stylesheet_directory();
$json_output_dir = $theme_dir . '/acf-json/';
if (!file_exists($json_output_dir)) {
die('Create a acf-json/ directory in your current theme.');
@JacobBennett
JacobBennett / blog.md
Last active June 7, 2024 17:42
Clean up your Vue modules with ES6 Arrow Functions

Recently when refactoring a Vue 1.0 application, I utilized ES6 arrow functions to clean up the code and make things a bit more consistent before updating to Vue 2.0. Along the way I made a few mistakes and wanted to share the lessons I learned as well as offer a few conventions that I will be using in my Vue applications moving forward.

The best way to explain this is with an example so lets start there. I'm going to throw a rather large block of code at you here, but stick with me and we will move through it a piece at a time.

<script>

// require vue-resource...

new Vue({
@mattclements
mattclements / function.php
Last active July 2, 2024 15:32
Wordpress Disable Comments (add to function.php)
<?php
add_action('admin_init', function () {
// Redirect any user trying to access comments page
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url());
exit;
}