In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:
- Separate big codebases into multiple repositories.
<?php | |
// Parsing this spreadsheet: https://spreadsheets.google.com/pub?key=0Ah0xU81penP1dFNLWk5YMW41dkcwa1JNQXk3YUJoOXc&hl=en&output=html | |
$url = 'http://spreadsheets.google.com/feeds/list/0Ah0xU81penP1dFNLWk5YMW41dkcwa1JNQXk3YUJoOXc/od6/public/values?alt=json'; | |
$file= file_get_contents($url); | |
$json = json_decode($file); | |
$rows = $json->{'feed'}->{'entry'}; | |
foreach($rows as $row) { | |
echo '<p>'; |
[ | |
{ | |
line: "Сокольническая линия", | |
stations: ["Улица Подбельского", "Черкизовская", "Преображенская площадь", "Сокольники", "Красносельская", "Комсомольская", "Красные ворота", "Чистые пруды", "Лубянка", "Охотный ряд", "Библиотека имени Ленина", "Кропоткинская", "Парк культуры", "Фрунзенская", "Спортивная", "Воробьёвы горы", "Университет", "Проспект Вернадского", "Юго-Западная"] | |
}, | |
{ | |
line: "Замоскворецкая линия", | |
stations: ["Красногвардейская", "Домодедовская", "Орехово", "Царицыно", "Кантемировская", "Каширская", "Коломенская", "Автозаводская", "Павелецкая", "Новокузнецкая", "Театральная", "Тверская", "Маяковская", "Белорусская", "Динамо", "Аэропорт", "Сокол", "Войковская", "Водный стадион", "Речной вокзал"] | |
}, | |
{ |
<?php | |
/* | |
* Юзернейм | |
* | |
* Буквы, цифры, дефисы и подчёркивания, от 3 до 16 символов. | |
* Начинаться должно всегда с буквы латинского алффавита | |
*/ | |
preg_match('%^[a-z][a-z0-9_-]{3,16}$%', $userName); | |
/* |
<?php | |
/** | |
* @desc Parse Google Drive spreadsheet data via php | |
* @author Misha M.-Kupriyanov https://plus.google.com/104512463398531242371/ | |
* @link https://gist.github.com/3898429 | |
*/ | |
//Spreadsheet https://docs.google.com/spreadsheet/pub?key=0Akgh73WhU1qHdFg4UmRhaThfUFNBaFR3N3BMVW9uZmc&output=html | |
//JSON Representation |
<?php | |
///////Example usage////////// | |
//get object terms for $post->ID with taxonomies categories and tags, | |
//args set as fields all and exclude term with id 1 | |
$terms = wp_get_object_terms( | |
$post->ID, | |
array( |
<?php | |
/** | |
* Plugin Name: WooCommerce - List Products by Attributes | |
* Plugin URI: http://www.remicorson.com/list-woocommerce-products-by-attributes/ | |
* Description: List WooCommerce products by attributes using a shortcode, ex: [woo_products_by_attributes attribute="colour" values="red,black" per_page="5"] | |
* Version: 1.0 | |
* Author: Remi Corson | |
* Author URI: http://remicorson.com | |
* Requires at least: 3.5 | |
* Tested up to: 3.5 |
<?php | |
/* | |
Plugin Name: Really Simple CSV Importer Debugger add-on | |
Description: Enables to dry-run-testing with Really Simple CSV Importer. When this add-on plugin activated, csv data will not imported, just displayed on dashboard. | |
Author: Takuro Hishikawa | |
Version: 0.2 | |
*/ | |
class rscsvimporter_debug { | |
// singleton instance |
<?php | |
/* | |
* Virtual Themed Page class | |
* | |
* This class implements virtual pages for a plugin. | |
* | |
* It is designed to be included then called for each part of the plugin | |
* that wants virtual pages. | |
* | |
* It supports multiple virtual pages and content generation functions. |
<?php | |
/** | |
* Create a new custom yoast seo sitemap | |
*/ | |
add_filter( 'wpseo_sitemap_index', 'ex_add_sitemap_custom_items' ); | |
add_action( 'init', 'init_wpseo_do_sitemap_actions' ); | |
// Add custom index |