Skip to content

Instantly share code, notes, and snippets.

View hulbert's full-sized avatar
👋

Scott Hulbert hulbert

👋
View GitHub Profile
@hulbert
hulbert / toggle-scroll-direction.scpt
Created November 24, 2020 00:23
AppleScript to reverse scroll direction
# Paste into Script Editor and export as an Application, then you can run via Spotlight (⌘ + Space)
tell application "System Preferences"
reveal anchor "trackpadTab" of pane id "com.apple.preference.trackpad"
end tell
tell application "System Events" to tell process "System Preferences"
click radio button 2 of tab group 1 of window 1
click checkbox 1 of tab group 1 of window 1
end tell
@hulbert
hulbert / edlio_loader.js
Last active December 24, 2015 13:19
IE8 async script loading issue
/*
* Edlio script loader
*
* This is a basic asynchronous script loading that will *execute* the scripts
* loaded via the loader in order BUT does not guarantee that code included by other
* means will have access to these scripts. Generally that means for a feature
* or page that you should either load *everything* through this, OR have all
* the scripts be designed to work independently, OR have everything execute
* on DOM ready.
*
@hulbert
hulbert / twitter-filters.js
Created June 29, 2011 05:33
Javascript functions to filter out replies from Twitter API JSON
// This filters out replies (that Twitter understands are replies)
function has_in_reply_to_status_id(tweet) {
if (tweet.in_reply_to_status_id === null) return false;
else return true;
}
// This filters out tweets that start with a mention, which are almost always replies
function is_user_mention_at_start(tweet) {
if (tweet.entities.user_mentions.length > 0) {
if (tweet.entities.user_mentions[0].indices[0] === 0) return true;
@hulbert
hulbert / paragraph-fade.html
Created June 9, 2011 03:26
Fade out the paragraph that contains a link
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
jQuery(document).ready(function($) {
$('a').bind('mouseenter', function(e) {
var $el = $(this);
$el.parent().addClass('linkover');
})
$('a').bind('mouseleave', function(e) {
$(this).parent().removeClass('linkover');
@hulbert
hulbert / instapaper_likes.php
Created June 3, 2011 08:18
Super Simple Instapaper Likes List with Simplepie
<?php
@include 'php/simplepie/simplepie.inc';
$instapaper_url = "YOUR INSTAPAPER RSS FEED HERE";
$feed = new SimplePie();
$feed->set_feed_url($instapaper_url);
// $feed->enable_cache(false); // for use before setting up caching
$feed->set_cache_location($_SERVER['DOCUMENT_ROOT'] . '/php/simplepie/cache');
$feed->set_cache_duration(60*15);