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
'use strict'; | |
angular.module('app') | |
.directive('sgSlick', ['$timeout', function ($timeout) { | |
return { | |
restrict: 'AE', | |
scope: { | |
images: '=', |
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
// Using JW_Post_Type.php | |
$product = new PostType("movie"); | |
$product->add_taxonomy('Actor'); | |
$product->add_taxonomy('Director'); | |
$product->add_meta_box('Movie Info', array( | |
'name' => 'text', | |
'rating' => 'text', | |
'review' => 'textarea', | |
'Profile Image' => 'file' |
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 | |
// include this JW_Post_Type.php into function.php | |
session_start(); | |
/** | |
* JW Post Types | |
* @author Jeffrey Way | |
* @link http://jeffrey-way.com | |
*/ |
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
// Details here: http://codex.wordpress.org/Moving_WordPress | |
// For safe database changes: | |
// 1. Only perform a search and replace on the wp_posts table to not break the serialized data. | |
// 2. OR Use a utility script: https://github.com/interconnectit/Search-Replace-DB |
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
Object.toType = (function toType(global) { | |
return function(obj) { | |
if (obj === global) { | |
return "global"; | |
} | |
return ({}).toString.call(obj).match(/\s([a-z|A-Z]+)/)[1].toLowerCase(); | |
} | |
})(this) |
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
var someModule = function(){ | |
//private attributes | |
var privateVar = 5; | |
//private methods | |
var privateMethod = function(){ | |
return 'Private Test'; | |
}; | |
return { | |
//public attributes |
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
var SingletonTester = (function() | |
{ | |
//args: an object containing arguments for the singleton | |
function Singleton(args) { | |
//set args variable to args passed or empty object if none provided. | |
var args = args || {}; | |
//set the name parameter | |
this.name = 'SingletonTester'; | |
//set the value of pointX | |
this.pointX = args.pointX || 6; //get parameter from arguments or set default |
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
/* | |
The idea here is that you have private methods | |
which you want to expose as public methods. | |
What are are doing below is effectively defining | |
a self-executing function and immediately returning | |
the object. | |
*/ | |
var myRevealingModule = function(){ | |
var name = 'John Smith'; |
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
// No need for capitalization as it's not a constructor | |
var someCar = { | |
drive: function() {}; | |
name: 'Mazda 3' | |
}; | |
// Use Object.create to generate a new car | |
var anotherCar = Object.create(someCar); | |
anotherCar.name = 'Toyota Camry'; |
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
$heading_image = get_post_meta($post->ID,"pageThumb",true); |
OlderNewer