Skip to content

Instantly share code, notes, and snippets.

View Stefany93's full-sized avatar
💭
Web Accessibility Specialist, Advocate, and Trainer

Stefany Newman Stefany93

💭
Web Accessibility Specialist, Advocate, and Trainer
View GitHub Profile
import React from 'react';
const ExampleComponent = ({message}) => {
const showMessage = (event) => {
alert(`The message is: ${message}`);
};
return (
<div>
<a href="#" onClick={showMessage}>show me</a>
@mshafrir
mshafrir / states_hash.json
Created May 9, 2012 17:05
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@bennylope
bennylope / gist:1894706
Created February 23, 2012 19:50
Canonical URLs with Jekyll
<link rel="canonical" href="http://yourdomain.com{{ page.url | replace:'index.html','' }}" />
@ChrisMcKee
ChrisMcKee / GetSiteURLWithProtocol.php
Created October 13, 2011 11:54
Get site url with current protocol
<?php
function siteURL()
{
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
$domainName = $_SERVER['HTTP_HOST'].'/';
return $protocol.$domainName;
}
define( 'SITE_URL', siteURL() );
@rtripault
rtripault / gist:666112
Created November 7, 2010 12:58
Syntax exemple(s) to use &where param with MODx getResources
&where=`{ "template:IN" : [ 1,2,3 ] }
&where=`{ "template:NOT IN" : [ 1,2,3 ] }
&where=`{{"alias:LIKE":"foo%", "OR:alias:LIKE":"%bar"},{"OR:pagetitle:=":"foobar", "AND:description:=":"raboof"}}` (source: http://modxcms.com/forums/index.php?topic=52307.0)