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 | |
$options = getopt('p:'); | |
$prefix = empty($options['p']) | |
? realpath('.') | |
: realpath($options['p']); | |
if (empty($prefix)) { | |
die("Bad prefix. Try again.\n"); | |
} |
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 | |
$output = ''; | |
$tElementClass = !empty($tElementClass) ? $tElementClass : 'modSnippet'; | |
$tStart = $modx->getMicroTime(); | |
if (!empty($tElement)) { | |
switch ($tElementClass) { | |
case 'modChunk': | |
$output = $modx->getChunk($tElement, $scriptProperties); | |
break; |
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
function video_image($url){ | |
$image_url = parse_url($url); | |
$ch = curl_init('http://vimeo.com/api/v2/video/'.substr($image_url['path'], 1).'.php'); | |
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1); | |
$a = curl_exec($ch); | |
$hash = unserialize($a); | |
return $hash[0]["thumbnail_medium"]; | |
} |
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
Snippet: [[SnippetName]] | |
Chunk: [[$ChunkName]] | |
System Setting: [[++SettingName]] | |
TV: [[*fieldName/TvName]] | |
Link tag: [[~PageId? ¶mName=`value`]] | |
Placeholder: [[+PlaceholderName]] | |
<?php |
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 | |
/* | |
* A small MODX snippet to extract POST, GET, SESSION & COOKIE values - (c) 2012-2016 ackwa.fr | |
* | |
* @version : 1.0.4 | |
* @see : https://gist.github.com/gists/2853625 | |
* @name : argv.php | |
* @author : g.noel@ackwa.fr | |
* @usage : [[!argv?key=`myparam`&default=`1`]] -> return the value | |
* [[!argv?key=`myparam`&default=`1`&toph=`1`]] -> set [[+argv.myparam]] |
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
My Big List of Links | |
================================ | |
**Q. Does this link belong in this list?** | |
1. Yes, if it is a regular source of reference | |
2. Yes, if it contains important knowledge I want to learn | |
3. Yes, if it sets the standards I aspire to work by | |
4. Yes, if its content will push my boundaries | |
5. Yes, if it provides inspiration |
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
CREATE TABLE IF NOT EXISTS `continents` ( | |
`code` CHAR(2) NOT NULL COMMENT 'Continent code', | |
`name` VARCHAR(255), | |
PRIMARY KEY (`code`) | |
) ENGINE=InnoDB; | |
INSERT INTO `continents` VALUES | |
('AF', 'Africa'), | |
('AS', 'Asia'), | |
('EU', 'Europe'), |
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
Snippet: [[SnippetName]] | |
Chunk: [[$ChunkName]] | |
System Setting: [[++SettingName]] | |
TV: [[*fieldName/TvName]] | |
Link tag: [[~PageId? ¶mName=`value`]] | |
Placeholder: [[+PlaceholderName]] | |
<?php |
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
/* | |
#ie10 will only be red in MSIE 10, | |
both in high contrast (display setting) and default mode | |
*/ | |
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { | |
#ie10 { color: red; } | |
} |
OlderNewer