Skip to content

Instantly share code, notes, and snippets.

@fomigo
fomigo / Antonyms.md
Created August 20, 2019 06:53 — forked from maxtruxa/Antonyms.md
A list of common terms used in programming and their respective antonyms.

Antonym List

Note: The table headings (positive/negative) are not necessarily meaningful.

Positive Negative
acquire release
add remove (e.g. an item), subtract (arithmetic)
advance retreat
allocate deallocate (correct), free (common)
allow deny
@fomigo
fomigo / wp-query-ref.php
Last active August 29, 2015 14:26 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(
Snippet: [[SnippetName]]
Chunk: [[$ChunkName]]
System Setting: [[++SettingName]]
TV: [[*fieldName/TvName]]
Link tag: [[~PageId? &paramName=`value`]]
Placeholder: [[+PlaceholderName]]
<?php
<?php
/**
* =========================
* defaultTemplateByParentTv
* =========================
*
* Plugin for modX Revolution
* Set default template for children of a ressource
*
* Author:
@fomigo
fomigo / paging.php
Created August 20, 2014 08:36 — forked from sloped/paging.php
<?php
//Use this function to create pagingation links that are styleable with Twitter Bootstrap
function paging() {
global $wp_query;
$total_pages = $wp_query->max_num_pages;
if ($total_pages > 1){
$current_page = max(1, get_query_var('paged'));
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/final-proposal
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.
@fomigo
fomigo / gist:5559983
Last active May 15, 2016 01:02
просмотренные страницы
<?php
$id = $modx->resource->id;
$tpls = explode(',', $modx->getOption('minishop.goods_tpl'));
if (!isset($limit)) {$limit = 10;}
if (!isset($tpl)) {$tpl = 'tpl.msGoods.row';}
// Вносим ID просмотренных товаров
if (in_array($modx->resource->template, $tpls)) {
if (!isset($_SESSION['viewed'])) {
Snippet: [[SnippetName]]
Chunk: [[$ChunkName]]
System Setting: [[++SettingName]]
TV: [[*fieldName/TvName]]
Link tag: [[~PageId? &paramName=`value`]]
Placeholder: [[+PlaceholderName]]
<?php
@fomigo
fomigo / import.php
Created November 27, 2012 14:05
Advanced miniShop console import
<?php
// Вывод ошибок
ini_set('display_errors', 1);
ini_set('memory_limit', '512M');
error_reporting(E_ERROR);
// Подключаем
define('MODX_API_MODE', true);
require dirname(dirname(dirname(__FILE__))).'/index.php';
@fomigo
fomigo / modx-snippets.php
Created November 5, 2012 04:33 — forked from christianhanvey/modx-snippets.php
Useful snippets for MODX Revo
Snippet: [[SnippetName]]
Chunk: [[$ChunkName]]
System Setting: [[++SettingName]]
TV: [[*fieldName/TvName]]
Link tag: [[~PageId? &paramName=`value`]]
Placeholder: [[+PlaceholderName]]
<?php