Skip to content

Instantly share code, notes, and snippets.

View mwalters's full-sized avatar
📟
.... .- -.-. -.- / - .... . / .--. .-.. .- -. . -

Matt Walters mwalters

📟
.... .- -.-. -.- / - .... . / .--. .-.. .- -. . -
View GitHub Profile
@mwalters
mwalters / grammar-reminders.md
Last active May 16, 2016 00:27
Grammar Reminders

Grammar Reminders

Em, En, and Hyphen

Em Dash (—)

  • Denotes a pause in thought, a parenthetical statement, or — more casually — an afterthought
  • Shift + Option + -

En Dash (–)

  • Denotes a range, especially of numbers, such as $100–150
@mwalters
mwalters / tsping.sh
Last active December 10, 2015 14:28
Ping a provided hostname/IP and show a timestamp along with the ping response
ping -i 5 $1 | while read pong; do echo "$(date '+%Y-%m-%d %T'): $pong"; done
@mwalters
mwalters / jquery-crash-course.md
Last active July 25, 2023 17:00
A friend needed a crash course in jQuery basics. I thought it might be helpful to capture it. Feel free to suggest corrections / modifications / additions.

Ok, crash course in jQuery and stuff:

Accessing jQuery

jQuery makes a global object, typically referenced by "$". There's also something called no-conflict mode where you'd reference it by "jQuery", but you won't see that too often in what we're doing, but just in case you encounter it, essentially these are the same:

$('.article')
jQuery('.article')

Element Selection

/* For modern browsers */
.cf:before,.cf:after {content:"";display:table;}
.cf:after {clear:both;}
/* For IE 6/7 (trigger hasLayout) */
.cf {zoom:1;}
@mwalters
mwalters / routing.php
Created August 27, 2013 16:00
Snippet: Poor Mans PHP Routing
<?php
// CONFIG: Path to Controllers, including trailing slash
$contollerPath = './Controllers/';
// If there is a query string, then get its position so it can be separated from the Controller/Method requested
if (strpos($_SERVER['REQUEST_URI'], '?')) {
$queryOffset = strpos($_SERVER['REQUEST_URI'], '?') - ($_SERVER['REQUEST_URI'] + 1);
} else {
$queryOffset = strlen($_SERVER['REQUEST_URI']);
@mwalters
mwalters / wp-upgrade.sh
Created September 24, 2013 19:21
Updates WordPress submodule tag (for upgrading WP core when it is a submodule)
tag_version="$1"
cd wp && git fetch --tags && git checkout $tag_version && cd .. && git add wp && git commit -m "Updates WordPress to version: $tag_version" && git push
@mwalters
mwalters / keybase.md
Last active February 14, 2019 02:38
keybase.md

Keybase proof

I hereby claim:

  • I am mwalters on github.
  • I am mwalters (https://keybase.io/mwalters) on keybase.
  • I have a public key ASAQVv2A6RsGKKnexzIGfI_xQbLWw1kK8gmLYYhTo6Cj-Qo

To claim this, I am signing this object:

@mwalters
mwalters / Contract Killer 3.md
Last active August 29, 2015 14:27 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

var idx = null;
var resultDetails = [];
var $searchResults;
var $searchInput;
var $headerSearch;
window.onload = function () {
var request = new XMLHttpRequest();
var query = '';
---
title: "Search"
date: 1999-01-01
layout: page
exclude_search: true
---
{{< searchpage >}}