Skip to content

Instantly share code, notes, and snippets.

View mhulse's full-sized avatar
👋
👁 ❤️ open source software …

Michael Hulse mhulse

👋
👁 ❤️ open source software …
  • Instructure Inc.
  • Eugene, Oregon
View GitHub Profile
#!/usr/bin/env bash #adding this to force silly gist highlighting. REMOVE THIS
# This is a modified version of the script generated by https://docs.npmjs.com/cli/completion to include `npm install` autocompletion.
# Basically we added `if` blocks to check for `install` subcommand.
###-begin-npm-completion-###
#
# npm command completion script
#
# Installation: npm completion >> ~/.bashrc (or ~/.zshrc)
@andersdn
andersdn / _tlp-dashboard.html
Last active January 29, 2017 06:48
Basic (jquery) ajax template loading for underscore js
<html>
<body>
<h1>Foo is <%= foo %></h1>
<% _.each(baz,function(value,index){ %>
<h2>Baz <%= index %> is <%= value %>
<h2>
<% }) %>
</body>
</html>
@matthew-macgregor
matthew-macgregor / smartquotes.py
Last active April 25, 2023 05:15 — forked from davidtheclark/dumb_to_smart_quotes.py
Convert dumb quotes to smart quotes in Python
#!/usr/bin/env python3
"""
Inspired by : https://gist.github.com/davidtheclark/5521432
Converts dumb quotes to smart quotes, -- to EM_DASH and ... to ELLIPSES.
"""
import sys
import re
import os
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rarylson
rarylson / automator_new_file.scpt
Last active March 1, 2024 01:03
AppleScript to create a new file in Finder (to be used in Automator)
-- AppleScript to create a new file in Finder
--
-- Use it in Automator, with the following configuration:
-- - Service receives: no input
-- - In: Finder.app
--
-- References:
-- - http://apple.stackexchange.com/a/129702
-- - http://stackoverflow.com/a/6125252/2530295
-- - http://www.russellbeattie.com/blog/fun-with-the-os-x-finder-and-applescript
@daluu
daluu / loadUrlSynchronously.jsx
Created April 8, 2015 22:10
Loads data from a URL in Adobe Illustrator, synchronously! (Uses Bridge behind the scenes)
BridgeTalk.prototype.sendSynch = function(timeout) {
var self = this;
self.onResult = function(res) {
this.result = res.body;
this.complete = true;
}
self.complete = false;
self.send();
if (timeout) {
@jpoehnelt
jpoehnelt / Angular Blur Directive
Created November 25, 2014 00:37
For blurring angular ng-click elements on click.
app.directive('blur', [function () {
return {
restrict: 'A',
link: function (scope, element) {
element.on('click', function () {
element.blur();
});
}
};
}]);
@niyazpk
niyazpk / pQuery.js
Created October 25, 2014 14:03
Add or update query string parameter
// Add / Update a key-value pair in the URL query parameters
function updateUrlParameter(uri, key, value) {
// remove the hash part before operating on the uri
var i = uri.indexOf('#');
var hash = i === -1 ? '' : uri.substr(i);
uri = i === -1 ? uri : uri.substr(0, i);
var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
var separator = uri.indexOf('?') !== -1 ? "&" : "?";
if (uri.match(re)) {

Screencapture and animated gifs

I say "animated gif" but in reality I think it's irresponsible to be serving "real" GIF files to people now. You should be serving gfy's, gifv's, webm, mp4s, whatever. They're a fraction of the filesize making it easier for you to deliver high fidelity, full color animation very quickly, especially on bad mobile connections. (But I suppose if you're just doing this for small audiences (like bug reporting), then LICEcap is a good solution).

Capturing (Easy)

  1. Launch quicktime player
  2. do Screen recording

screen shot 2014-10-22 at 11 16 23 am

@mhulse
mhulse / +fix-2-step.user.js
Last active May 16, 2017 16:24
UPDATED for the 2017 Google login page redesign. +fix-2-step.user.js: Firefox GreaseMonkey or Chrome Tampermonkey script: Google "2-step verification" fix: Uncheck "don't ask" and never "trust (this) device".
// ==UserScript==
// @name Google "2-step verification" fix: Uncheck "don't ask" and never "trust (this) device".
// @namespace http://mky.io
// @include https://accounts.google.com/signin*
// @description When "2-step verfication" is turned on, this disables the "Don't ask again on this computer" checkbox.
// @grant none
// @version 20160728
// ==/UserScript==
(function() {