Skip to content

Instantly share code, notes, and snippets.

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

Matt Walters mwalters

📟
.... .- -.-. -.- / - .... . / .--. .-.. .- -. . -
View GitHub Profile
{
"always_prompt_for_file_reload": true,
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Boxy Theme/schemes/Boxy Tomorrow.tmTheme",
"detect_indentation": true,
"ensure_newline_at_eof_on_save": true,
"fade_fold_buttons": false,
"font_size": 13,
"highlight_line": true,
<script src="https://unpkg.com/lunr@2.3.8/lunr.js"></script>
<script src="/search.js"></script>
<div>
<input id="search-input" type="text" placeholder="What are you looking for?" name="search-input" class="form-control">
</div>
<div id="search-results" class="container"></div>
---
title: "Search"
date: 1999-01-01
layout: page
exclude_search: true
---
{{< searchpage >}}
var idx = null;
var resultDetails = [];
var $searchResults;
var $searchInput;
var $headerSearch;
window.onload = function () {
var request = new XMLHttpRequest();
var query = '';
@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

@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 / 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 / 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']);
/* 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 / 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