Skip to content

Instantly share code, notes, and snippets.

🖐
👁❤️open source software …

Michael Hulse mhulse

🖐
👁❤️open source software …
Block or report user

Report or block mhulse

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@matthew-macgregor
matthew-macgregor / smartquotes.py
Last active Aug 7, 2016 — forked from davidtheclark/dumb_to_smart_quotes.py
Convert dumb quotes to smart quotes in Python
View smartquotes.py
#!/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
View ColourTSP.ipynb
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 Sep 1, 2019
AppleScript to create a new file in Finder (to be used in Automator)
View automator_new_file.scpt
-- 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 Apr 8, 2015
Loads data from a URL in Adobe Illustrator, synchronously! (Uses Bridge behind the scenes)
View loadUrlSynchronously.jsx
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 Nov 25, 2014
For blurring angular ng-click elements on click.
View Angular Blur Directive
app.directive('blur', [function () {
return {
restrict: 'A',
link: function (scope, element) {
element.on('click', function () {
element.blur();
});
}
};
}]);
@niyazpk
niyazpk / pQuery.js
Created Oct 25, 2014
Add or update query string parameter
View pQuery.js
// 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)) {
View how to screencapture and make animated gifs or whathaveyou.md

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
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".
View +fix-2-step.user.js
// ==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() {
@jstuckey
jstuckey / Bash Prompt with Git and Emoji
Last active May 15, 2019
Bash Prompt with Git and Emoji - Add to ~/.bash_profile
View Bash Prompt with Git and Emoji
git_branch='`git rev-parse --abbrev-ref HEAD 2> /dev/null | sed s/^/\ \|\ /`'
emojis=(🐶 🐺 🐱 🐭 🐹 🐰 🐸 🐯 🐨 🐻 🐷 🐮 🐵 🐼 🐧 🐍 🐢 🐙 🐠 🐳 🐬 🐥)
emoji='`echo ${emojis[$RANDOM % 22]}`'
PS1="\[\033[0;36m\]\T | \W$git_branch | $emoji > \[\e[0m\]"
View gist:7863c6c248f76e14a3a8
# strip out iBooks citation
sed -E -e 's/^[ ]?[0-9]* //g' | sed -E -e 's/“[ ]?[0-9]?[ ]?//g' | sed -E -e 's/”$//g' | sed -E -e 's/^(Excerpt From).*//g'
You can’t perform that action at this time.