Skip to content

Instantly share code, notes, and snippets.

View wpscholar's full-sized avatar
😀
Happy

Micah Wood wpscholar

😀
Happy
View GitHub Profile
@dfwood
dfwood / wp-iso8601-datetime.php
Last active March 6, 2017 20:24
Datetime conversion functions for WordPress using the ISO8601 standard.
<?php
/**
* Why does this exist? http://xkcd.com/1179/ also because it makes sense to have a standard way in WordPress to work with
* dates and times so that plugin developers can create plugins that will work in any timezone worldwide.
*
* WordPress sets the default timezone during execution to UTC, reguardless of what the server is set to.
* This means that date( 'FORMAT' ) will always give you the current time in UTC, not the timezone you have set
* in the WP admin settings. Use date( 'FORMAT', current_time( 'timestamp' ) ) instead to get WP local time. Likewise,
* use current_time( 'timestamp' ) instead of time() for the local time.
*/
@taras
taras / gist:3acbed53702ce4e0d106
Created July 4, 2014 02:02
Where to start after you read Ember Guides?
You'll need proper development environment, learn about Ember CLI - https://www.youtube.com/watch?v=hygxGDjhGp8.
You might want to know about more about what's happening under the hood, watch Robert Jackson talk about Ember Magic - https://www.youtube.com/watch?v=OjqcI8KWesk.
Learn more about complex architecture in Ember https://www.youtube.com/watch?v=Kcij9lH2OyM
Learn more about Ember Data - https://www.youtube.com/watch?v=HL2bMjndviE.
You can get lost in the View layer, learn about Events and Actions from Luke Melia - https://www.youtube.com/watch?v=w6__hEUjqaw
@fversnel
fversnel / SmartSortable.js
Created December 30, 2014 11:36
React SmartSortable
var cloneWithProps = React.addons.cloneWithProps;
var SmartSortable = React.createClass({
getDefaultProps: function() {
return {component: "ul", childComponent: "li"};
},
render: function() {
var props = jQuery.extend({}, this.props);
@markjaquith
markjaquith / plugin-deploy.sh
Created November 16, 2012 05:04 — forked from scribu/plugin-deploy.sh
Plugin deploy script
#!/bin/bash
# args
MSG=${1-'deploy from git'}
BRANCH=${2-'trunk'}
# paths
SRC_DIR=$(git rev-parse --show-toplevel)
DIR_NAME=$(basename $SRC_DIR)
DEST_DIR=~/svn/wp-plugins/$DIR_NAME/$BRANCH
@earnjam
earnjam / .bash_profile
Created September 28, 2018 19:39
Custom bash profile
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
# 6. Networking
# 7. System Operations & Information
@wpscholar
wpscholar / wp-plugin-settings-link.php
Last active October 7, 2018 23:32
Add a settings link to your WordPress plugin
@thomasgriffin
thomasgriffin / api-helper.php
Last active March 13, 2019 13:46
API Helper to be used during API requests. Should be used as a must-use plugin in WordPress.
<?php
/**
* Plugin Name: TGM API Helper
* Plugin URI: https://thomasgriffin.io
* Description: Whitelists the plugins to be loaded during API requests to reduce overhead.
* Author: Thomas Griffin
* Author URI: https://thomasgriffin.io
* Version: 1.0.0
*/
(function (wp) {
//WordPress APIs
//Render function
var el = wp.element.createElement;
//Translations
var __ = wp.i18n.__;
//Text input control
var TextControl = wp.blocks.InspectorControls.TextControl;
//Create block
wp.blocks.registerBlockType('shelob9/metatest2', {
@wpscholar
wpscholar / cloudSettings
Last active July 18, 2020 18:11
Visual Studio Code Settings
{"lastUpload":"2020-07-18T18:11:37.497Z","extensionVersion":"v3.4.3"}
@nikolov-tmw
nikolov-tmw / multiple-roles-per-user.php
Last active October 5, 2021 03:56
Multiple roles per user WordPress plugin.
<?php
/**
* Plugin Name: Multiple Roles per User
* Description: Allows anyone who can edit users to set multiple roles per user. In a default WordPress environment that wouldn't have much of an effect, since the user would have the privileges of the top-privileged role that you assign to him. But if you have custom roles with custom privileges, this might be helpful.
* Version: 1
* Author: nikolov.tmw
* Author URI: http://paiyakdev.com/
* License: GPL2
*/
/*