- 1 (15 ounce) can chickpeas
- 1 onion, chopped
- 1 tomato, chopped
- 1 green chili pepper, chopped
- 4-5 garlic cloves, chopped
- 1 inch ginger root, chopped
| <?php | |
| /** | |
| * Grab latest post title by an author! | |
| * | |
| * @param array $data Options for the function. | |
| * @return string|null Post title for the latest, * or null if none. | |
| */ | |
| function my_awesome_func( $data ) { | |
| $posts = get_posts( array( |
| <?php | |
| // Please see https://github.com/Lewiscowles1986/WordPressSVGPlugin from now on |
| INITIALISATION | |
| ============== | |
| load wp-config.php | |
| set up default constants | |
| load wp-content/advanced-cache.php if it exists | |
| load wp-content/db.php if it exists | |
| connect to mysql, select db | |
| load object cache (object-cache.php if it exists, or wp-include/cache.php if not) | |
| load wp-content/sunrise.php if it exists (multisite only) |
| <?php | |
| /** | |
| * Calculate the distance between two points. | |
| */ | |
| class DistanceCheck { | |
| /** | |
| * Calculate |
| #Get the size of each table, ordered by largest to smallest | |
| SELECT table_name AS "Tables", | |
| round(((data_length + index_length) / 1024 / 1024), 2) "Size in MB" | |
| FROM information_schema.TABLES | |
| WHERE table_schema = "YOU+TABLE+NAME+HERE" | |
| ORDER BY (data_length + index_length) DESC; | |
| #Get the size of the entire DB | |
| SELECT table_schema "DB Name", | |
| Round(Sum(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" |
| <?php | |
| /** | |
| * Using BuddyPress Member types API | |
| * | |
| * see codex: https://codex.buddypress.org/developer/member-types/ | |
| * | |
| * Required config: | |
| * - WordPress 4.1 | |
| * - BuddyPress 2.2 | |
| * |
| <?php | |
| /** | |
| * Plugin Name: (WCM) Backbone/Underscore template loader | |
| * Description: Loads Underscore (or other) templates using the WP Dependency API | |
| */ | |
| /** | |
| * @author Franz Josef Kaiser http://unserkaiser.com/ | |
| * @link http://chat.stackexchange.com/transcript/message/19439060#19439060 | |
| */ |
This document is in draft status, and is being made available for peer review. If you have feedback, comment on this gist or email me.
Let's say you're a web developer. A client of yours is a gemstone dealer in Manhattan. This dealer has an inventory of gemstones that they'd like to put on their website.
Gemstones have a plethora of attributes: type of gemstone (e.g. sapphire or emerald), price, weight, width, height, depth, color, shape, country of origin, treatment (if it's heat treated), who certified these details, whether the stone is a single stone or a pair.
You're offered the task to make a website to display the gemstone inventory, which will include a search interface. So a user can say "I want to see sapphires that are no heavier than 1.33 karats that are oval, between $750 and $1250, between 1.11mm and 1.20mm that weren't heat treated, because heat treatment is cheap."