Skip to content

Instantly share code, notes, and snippets.

View shinypb's full-sized avatar
☀️
I'm just happy to be here.

Mark Christian shinypb

☀️
I'm just happy to be here.
View GitHub Profile
@shinypb
shinypb / ExcludeBaseball.js
Created November 20, 2018 22:57
A very simple rule to filter out anything that mentions baseball
/**
* Removes baseball-y things.
* @param {FeedItem} item
* @return {Boolean} true if we should mark this item as read, false if not
*/
module.exports = function ExcludeBaseball(item) {
return (item.content.toLowerCase().indexOf('baseball') >= 0);
}
@shinypb
shinypb / DedupeLinks.js
Created November 20, 2018 22:54
A simple feedfilterer rule I originally wrote to de-dupe entries in the Pinboard "popular" feed (https://feeds.pinboard.in/rss/popular/)
@shinypb
shinypb / Makefile
Created April 12, 2016 20:16
Makefile with example install_deps task
#
# To use this Makefile with your version of magic-cli, change the value of
# PREFIX to whatever you have renamed the main command to.
#
PREFIX = magic-cli
#
# Where to install the tools
#
oh hi @group <!group> <!group|@group>
@shinypb
shinypb / git-pr
Created December 5, 2014 17:25
Create GitHub pull request from the command line
#!/usr/bin/env ruby
remote_url = `git config --get remote.origin.url`.strip
matches = remote_url.match(/github\.com:(.+)\/(.+)\.git/)
if matches
branch_name = `git rev-parse --abbrev-ref HEAD`.strip
exec "open https://github.com/#{matches[1]}/#{matches[2]}/compare/#{branch_name}?expand=1"
end
# Save this file as ~/bin/git-pr and then `chmod +x ~/bin/git-pr`.
@shinypb
shinypb / hogan-3.0.1.js
Created November 12, 2014 00:18
hogan-3.0.1.js → ES6
diff --git a/thirdparties/hogan-3.0.1.js b/thirdparties/hogan-3.0.1.js
index ebdcf43..a184136 100644
--- a/thirdparties/hogan-3.0.1.js
+++ b/thirdparties/hogan-3.0.1.js
@@ -15,737 +15,729 @@
-var Hogan = {};
-
expect(x).toEqual(y); compares objects or primitives x and y and passes if they are equivalent
expect(x).toBe(y); compares objects or primitives x and y and passes if they are the same object
expect(x).toMatch(pattern); compares x to string or regular expression pattern and passes if they match
expect(x).toBeDefined(); passes if x is not undefined
expect(x).toBeUndefined(); passes if x is undefined
2013 Canada Day
by Mark Christian and 4 collaborators
All Canadian tweeps are welcome to edit.
Add Playlist Edit Share Buy MP3s 68 songs (4:26:26)
1
4:46 CLEAN
Take Off
Doug McKenzie, Bob McKenzie - Great White North
@shinypb
shinypb / controller.js
Last active December 12, 2015 07:49 — forked from darobin/controller.js
var fallbacks = {}
, networks = {}
, cacheName = "OldSchoolAppCache"
, settings = {}
;
this.onmessage = function (e) {
var msg = e.data;
if (msg.type && msg.type === "manifest") {
var lines = msg.manifest.split(/\n+/)
@shinypb
shinypb / gist:4485878
Created January 8, 2013 17:32
Bookmarklet to reload CSS without reloading the entire page
(function(){
$('link[rel="stylesheet"]').each(function(i, elem) {
// Make an anchor tag with the stylesheet's href -- this is a weird/handy way of
// working with URLs in the browser.
var anchorTag = $('a').attr('href', elem.getAttribute('href'))[0];
// Rewrite the URL to have a cache busting parameter. This assumes
// that any query params weren't significant.
anchorTag.search = "ts=" + (+new Date);