Skip to content

Instantly share code, notes, and snippets.

View neehad's full-sized avatar
🎯
Focusing

Nihad Obralic neehad

🎯
Focusing
View GitHub Profile
Seven different types of CSS attribute selectors
// This attribute exists on the element
[value]
// This attribute has a specific value of cool
[value='cool']
// This attribute value contains the word cool somewhere in it
[value*='cool']
@netProphET
netProphET / babelContextRouter.plugin.php
Last active October 19, 2023 07:08
MODX Cloud web rules example for Babel with two languages.In this example, German is the default language with resources in the 'web' context; English is the secondary language, set up in the 'en' context.This technique is based on the "SEO Friendly Multilingual Websites" article archived here: https://web.archive.org/web/20180927220103/http://w…
<?php
if($modx->context->get('key') != "mgr"){
/* grab the current langauge from the cultureKey request var */
switch ($_REQUEST['cultureKey']) {
case 'en':
/* switch the context */
$modx->switchContext('en');
break;
default:
/* Set the default context here */
@keeguon
keeguon / countries.json
Created April 5, 2012 11:11
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},