Skip to content

Instantly share code, notes, and snippets.

@adamvr
adamvr / audiobook.sh
Created July 9, 2011 04:59
Creating an m4b audiobook from a bunch of mp3s
find . -name '*.mp3' -print0 | xargs -0 -I {} sh -c 'echo "{}"; n="{}~"; cp "{}" "$n"; id3v2 -D "$n"; cat "$n" >> comb.mp3; rm "$n"'; ffmpeg -i comb.mp3 -acodec libfaac audiobook.m4a; mv audiobook.m4a audiobook.m4b
@Zegnat
Zegnat / README.md
Created February 24, 2012 12:03
Fixing your skip links. [JS]

Fixing your skip links.

Read Damon Muma on this. He proposes the following jQuery solution (inspired by Thompson, fixed by me):

// Apply focus properly when accessing internal links with keyboard in WebKit browsers.
$("a[href^='#']").not("a[href='#']").click(function() {
   $("#"+$(this).attr("href").slice(1)+"").focus();
});
@christianhanvey
christianhanvey / modx-snippets.php
Last active June 14, 2023 13:02
Useful snippets for MODX Revo
Snippet: [[SnippetName]]
Chunk: [[$ChunkName]]
System Setting: [[++SettingName]]
TV: [[*fieldName/TvName]]
Link tag: [[~PageId? &paramName=`value`]]
Placeholder: [[+PlaceholderName]]
<?php
@krismas
krismas / argv.php
Last active August 3, 2019 16:37
A small MODX snippet to extract POST, GET, SESSION & COOKIE values
<?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 : [email protected]
* @usage : [[!argv?key=`myparam`&default=`1`]] -> return the value
* [[!argv?key=`myparam`&default=`1`&toph=`1`]] -> set [[+argv.myparam]]
@gadamiak
gadamiak / LangRouter.php
Created October 1, 2012 16:31
Language context router for use with Babel extra for MODX Revolution
<?php
/* LangRouter
* ==========
*
* This plugin is meant to be used with Babel extra for MODX Revolution. It
* takes care of switching contexts, which hold translations, depending on URL
* requested by client. LangRouter works with so called subfolder based setup,
* in which many languages are served under a single domain but are
* differentiated by a virtual subfolder indicating the language, eg.
* mydomain.com/pl/.
@silentworks
silentworks / gist:5058812
Last active December 14, 2015 08:38
This is how you could return your processor with specific system settings.
<?php
class MyGetListProcessor extends modObjectGetProcessor {
public $classKey = 'className';
public function process() {
$data = array();
$settings = array(
'emailsender' => $this->modx->getOption('emailsender')
);
$data['total'] = count($settings);
@tterb
tterb / README-badges.md
Last active November 11, 2024 03:35
A collection of README badges

Badges

License

MIT License GPLv3 License AGPL License

Version

Version GitHub Release

@kongondo
kongondo / processwire_api_visual_studio_code_snippets.json
Last active December 16, 2018 12:23
ProcessWire API Visual Studio Code Snippets
{
"pages->find(\"selector\")": {
"prefix": "pages find(\"selector\")",
"body": [
"\\$${1:pages}->find(\"${2:selector}\");"
],
"description": "Find and return all pages matching the given selector string. Returns a filtered PageArray unless an include mode is specified."
},
"pages->count(\"selector\")": {
"prefix": "pages count(\"selector\")",