Skip to content

Instantly share code, notes, and snippets.

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

Matt Walters mwalters

📟
.... .- -.-. -.- / - .... . / .--. .-.. .- -. . -
View GitHub Profile
@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

@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']);
{
"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,
var idx = null;
var resultDetails = [];
var $searchResults;
var $searchInput;
var $headerSearch;
window.onload = function () {
var request = new XMLHttpRequest();
var query = '';
<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 >}}
@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 / 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 / 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
/* For modern browsers */
.cf:before,.cf:after {content:"";display:table;}
.cf:after {clear:both;}
/* For IE 6/7 (trigger hasLayout) */
.cf {zoom:1;}