Roll Your Own Social Media Buttons

I recently tested out several WordPress’s social media share plug-ins and disappointed with unnecessary injections of JavaScripts and CSS. Some services even use their own site as a gateway to server up the social media services. I was frustrated and ended up rolling my own, thanks to this blog post. Here’s my customized codes:

<a href="https://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t=<?php the_title(); ?>" target="_blank"><img src="facebook.png" alt="Share on Facebook"></a>

<a href=”https://plusone.google.com/_/+1/confirm?hl=en-US&url=<?php the_permalink() ?>” target=”_blank”><img src=”google-plus.png” alt=”Share on Google+”></a>

<a href=”https://twitter.com/share?text=<?php the_title(); ?> -&url=<?php the_permalink() ?>” target=”_blank”><img src=”twitter.png” alt=”Share on Twitter”></a>

<a href=”https://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink() ?>” target=”_blank”><img src=”linkedin.png” alt=”Share on LinkedIn”></a>

Sass

$ sass --watch style.scss:style.css --style compressed

// Import
@import "normalize";

// Variables
$body_font: 'Georgia', serif;

// Mixin
@mixin rounded_corners($rounding) {
-webkit-border-radius:$rounding;
-moz-border-radius: $rounding;
-o-border-radius: $rounding;
border-radius: $rounding; }

Apache Rewrites

Redirect non-www to www with .htaccess


RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]

Example: law.gmu.edu to www.law.gmu.edu


Add trailing slash (/) to URL:


RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ https://www.sample.com/$1/ [QSA,L,R=301]

Example: law.gmu.edu to law.gmu.edu/

LRWA Online Document Submission

URL: https://www.law.gmu.edu/academics/lrwa

  1. In MODX tree menu, browse to: Academics > LRWA Online Document Submission
  2. Duplicate an existing form. Example: 2012 Fall Law 097 LRWA II and rename to the new semester.
  3. Edit instructors’ email
  4. update this chunk name: &tpl=`eForm.lrwa2012fall097.form` (Also pay attention to these chunks: &report=`eForm.lrwa.email` &thankyou=`eForm.lrwa.thankyou`
  5. Navigate to “Chunks” under “Manage Elements” and duplicate an existing chunk. Example: eForm.lrwa2012fall097.form
  6. Update faculty names in the drop down box.

Validation messages lives in english.inc.php. Update validation message via command lines:
cd /home/lawdevlaw/public_html/assets/snippets/eform/lang/
chmod 755 english.inc.php
vi english.inc.php
chmod 444 english.inc.php (read only)