Skip to content

Instantly share code, notes, and snippets.

View walesmd's full-sized avatar

Michael Wales walesmd

View GitHub Profile

Keybase proof

I hereby claim:

  • I am walesmd on github.
  • I am walesmd (https://keybase.io/walesmd) on keybase.
  • I have a public key whose fingerprint is B810 4894 0842 8ED7 C155 9765 6F76 BD21 17ED 0D34

To claim this, I am signing this object:

@walesmd
walesmd / example1.js
Created November 7, 2014 23:00
Fun Friday Challenge: Why do these two code examples work differently?
/* This example results in
* undefined is not a function
*/
doLog();
var doLog = function() {
console.log('Log!');
}
@walesmd
walesmd / hoisting.js
Created September 21, 2014 00:31
The differences between JavaScript function declarations and function expressions (and why variable hoisting is the reason for these differences).
// JavaScript code is run in two passes, the first pass
// does all the function declarations and determines the
// variables. The second pass actually executes your code.
// Example 1: Function Declaration
// Function declarations will always work because
// declarations are determined on the first pass and when
// you actually call the function is performed on the
// second pass.
foo();
@walesmd
walesmd / IconServiceAgent.md
Last active December 13, 2023 05:06
A lot of people are having issues with com.apple.IconServicesAgent. Since this is a very new issue, Google was no help and `man iconservicesd` is even more hilarious. I eventually fixed it, when I was working on a completely different issue (that is still not fixed). The instructions are below and on the Apple Support Forum, https://discussions.…

I was chasing down another issue (slow "Save As") and thought these two issues may have been related (with QuickLook being the common broken link). Unfortunately, my "Save As" dialog is still miserably slow on the initial load; but IconServicesAgent hasn't gone above 30MB and he rarely makes an appearance in the Console!

Some of these steps may not be necessary, but here are all of the steps I took that inadverdently put IconServicesAgent back in its place. Note: all commands are a single-line, if they appear to be multiple that's just the forum formatting.

  1. Check for any QuickLooks related .plist files. In a terminal: mdfind com.apple.quicklook. -name .plist

  2. I only had files at the system level (specifically within /System/Library/LaunchAgents/). If you have others, modify the directions below to take that into account (re-introducing plist files from the system level back up to the user).

  3. Make some temporary directories to store these plist files, just in case: mkdir ~/tmp-quicklook

# CanIUse.com Command Line Search Utility
# Michael Wales, http://github.com/walesmd
#
# A very basic bash function that quickly searches http://caniuse.com/
#
# Examples:
# caniuse
# caniuse border-radius
# caniuse "alpha transparency" counters "canvas drawings" html svg
@walesmd
walesmd / map.geojson
Created August 14, 2013 01:38
via:geojson.io
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@walesmd
walesmd / correct.json
Created August 14, 2013 01:31
Correct JSON-API Example Our response consists of a single array with the same name as our table. Notice this is using the ID format in that foreign keys return the primary key to the joined table. A URL format is available and preferred, so that the client can be completely unaware / agnostic in regards to the backend. In ID format, we must har…
{
"datacenters": [{
"id": "1",
"name": "Albany Center",
"lat": "42.64957",
"lng": "-73.77459",
"city": "Albany",
"state": "NY",
"zip": "12208",
"createdAt": "2013-06-24",
@walesmd
walesmd / map.geojson
Last active February 19, 2018 12:49
via:geojson.io
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@walesmd
walesmd / index.html
Created August 8, 2013 09:18
via:geojson.io
<!DOCTYPE html>
<html>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
.marker-properties {
border-collapse:collapse;
@walesmd
walesmd / mariadb.repo
Created May 31, 2013 19:41
wget [this_gist] -O /etc/yum.repo.d/mariadb.repo
# MariaDB 10.0 CentOS repository list - created 2013-05-31 19:29 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.0/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1