Skip to content

Instantly share code, notes, and snippets.

View Japh's full-sized avatar

Japh Japh

View GitHub Profile
<!DOCTYPE HTML>
<html>
<head>
<title>T11</title>
<style>
body {
margin: 0;
padding: 0;
background-color: #000000;
@Japh
Japh / 0_reuse_code.js
Created June 16, 2014 12:03
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
/*
* Plugin Name: Commercial Client
* Plugin URI: http://pento.net/
* Description: A sample client plugin for showing updates for non-WordPress.org plugins
* Author: pento
* Version: 0.1
* Author URI: http://pento.net/
* License: GPL2+
*/
/**
* This gist demonstrates how to properly load jQuery within the context of WordPress-targeted JavaScript so that you don't
* have to worry about using things such as `noConflict` or creating your own reference to the jQuery function.
*
* @version 1.0
*/
(function( $ ) {
"use strict";
$(function() {
<?php
/**
* Allows activation of plugins via WP Bulter using the "activate" keyword (ie "activate Gravity Forms")
*
*/
add_filter('wp_butler_ajax_keyword_actions', 'wp_butler_switch_plugins_action');
function wp_butler_switch_plugins_action($term_and_actions) {
list($term, $actions) = $term_and_actions;
@Japh
Japh / gist:4564616
Created January 18, 2013 13:45 — forked from spivurno/gist:4560722
<?php
add_filter('wp_butler_ajax_keyword_actions', 'wp_butler_switch_plugins_action', 10, 2);
function wp_butler_switch_plugins_action($term_and_actions) {
list($term, $actions) = $term_and_actions;
$term_words = explode( ' ', $_REQUEST['term'] );
$keyword = $term_words[0];
@Japh
Japh / bad-loop.php
Created September 3, 2012 00:33 — forked from pippinsplugins/gist:3548646
An example of how NOT to write your WordPress theme's Loop
<?php
#
# rt-theme loop
#
global $args,$content_width,$paged;
add_filter('excerpt_more', 'no_excerpt_more');
//varialbles
$video_width = ($content_width =="960") ? 940 : 606;
@Japh
Japh / circle.js
Created January 9, 2012 06:18 — forked from ryan-allen/circle.js
var Circle = function(radius) {
var calculateDiameter = function() {
return radius * 2
}
// here's a new 'circle'
return {
radius: radius,
calculateDiameter: calculateDiameter
}