Skip to content

Instantly share code, notes, and snippets.

View jentanbernardus's full-sized avatar
:shipit:
Coding everyday keeps the doctor away!

Jentan Bernardus jentanbernardus

:shipit:
Coding everyday keeps the doctor away!
View GitHub Profile
<?php
/**
* Custom browser check
*
* Uses https://github.com/cbschuld/Browser.php
*/
function b5f_browser_check($what) {
global $browser, $browver;
switch ($what) {

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
namespace: "flex-", //{NEW} String: Prefix string attached to the class of every element generated by the plugin
selector: ".slides > li", //{NEW} Selector: Must match a simple pattern. '{container} > {slide}' -- Ignore pattern at your own peril
animation: "fade", //String: Select your animation type, "fade" or "slide"
easing: "swing", //{NEW} String: Determines the easing method used in jQuery transitions. jQuery easing plugin is supported!
direction: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical"
reverse: false, //{NEW} Boolean: Reverse the animation direction
animationLoop: true, //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end
smoothHeight: false, //{NEW} Boolean: Allow height of the slider to animate smoothly in horizontal mode
startAt: 0, //Integer: The slide that the slider should start on. Array nota
// ==UserScript==
// @name Harvest Timer Growl Reminder
// @namespace http://harvestapp.com
// @description Displays Growl notifications at a user defined interval, reminding you to track your time.
// @include *
// @author Mike Green
// @version 0.1.1
// ==/UserScript==
(function () {
<div class="author-box">
<div class="author-pic"><?php echo get_avatar( get_the_author_email(), '80' ); ?></div>
<div class="author-name"><?php the_author_meta( "display_name" ); ?></div>
<div class="author-bio"><?php the_author_meta( "user_description" ); ?></div>
</div>
<?php
$author_posts = new WP_Query( array(
'posts_per_page' => 3,
'author' => get_the_author_meta( 'ID' )
) );
if ( $author_posts->have_posts() ) while ( $author_posts->have_posts() ) : $author_posts->the_post();
// loop
endwhile;
wp_reset_query();
<?php
/**
* Enqueue scripts and styles
*/
function load_scripts() {
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js' );
$dir = get_stylesheet_directory_uri();
wp_enqueue_script( 'jquery-masonry', $dir.'/js/jquery.masonry.min.js', array('jquery'), false, true );
<?php
/*
Plugin Name: Plugin Boilerplate
Version: 0.1-alpha
Description: This is how I like to make sense of the WordPress plugin architecture
Author: Adam Davis
Author URI: http://admataz.com
Plugin URI: http://admataz.com
Text Domain: admataz-plugin-boilerplate
Domain Path: /languages
@jentanbernardus
jentanbernardus / responsive_jquery_cycle.html
Created December 4, 2012 04:51
@malsup's jQuery Cycle in a Responsive Layout
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Responsive Cycle</title>
<style>
@jentanbernardus
jentanbernardus / gist:3930737
Created October 22, 2012 10:04 — forked from mikejolley/gist:1565309
WooCommerce - Filters to add custom currencies and symbols
add_filter( 'woocommerce_currencies', 'add_my_currency' );
function add_my_currency( $currencies ) {
$currencies['ABC'] = __( 'Currency name', 'woocommerce' );
return $currencies;
}
add_filter('woocommerce_currency_symbol', 'add_my_currency_symbol', 10, 2);
function add_my_currency_symbol( $currency_symbol, $currency ) {