Skip to content

Instantly share code, notes, and snippets.

Johan Sundström johan

Block or report user

Report or block johan

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
View Inglehart_Values_Map2.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@johan
johan / mix-warn
Created Apr 18, 2015
mixed-content warnings finder
View mix-warn
#! /usr/bin/env phantomjs
var webpage = require('webpage')
, system = require('system')
, fs = require('fs')
, _ = require('underscore')
, URLS, MULTIPLE, OPTS = {}, OPTIONS =
{ '-v': 'verbose'
};
@johan
johan / list-app-widgets
Last active Aug 29, 2015
Two osascript hacks to inventory osx application object models, for osascripting them from shell scripts
View list-app-widgets
#! /bin/sh
# lists all widgets of the app named $1 to stdout
# You will probably need to first add Terminal.app here (osx Yosemite; 10.10.3):
# System Preferences -> Security & Privacy -> Privacy -> Accessibility
osascript \
-e 'tell application "'$1'" to activate' \
-e 'tell application "System Events" to tell process "'$1'" to set output to entire contents of front window' \
@johan
johan / reader
Last active Aug 29, 2015
Osascript shell hack to engage "Reader View" after loading a url in Safari
View reader
#! /usr/bin/osascript
# opens url $1 in Safari and tries to engage its Reader View (if it shows up within 15s)
# You will probably need to first add Terminal.app here (osx Yosemite; 10.10.3):
# System Preferences -> Security & Privacy -> Privacy -> Accessibility
on run argv
set article_url to item 1 of argv
View README.md

Hourly solar analemmas (ignoring daylight savings time) as seen from San Francisco in 2014.

@johan
johan / README.md
Last active Aug 29, 2015
Solar Analemmas Anywhere
View README.md

Hourly solar analemmas (ignoring daylight savings time) as seen from anywhere in the world in 2014.

@johan
johan / index.html
Last active Aug 29, 2015
Sleep visualization based on massaged data excerpts from Sleep Time app
View index.html
<div id="sleep"></div>
@johan
johan / README.md
Last active Aug 31, 2015
Movielens guesses as to how I'd rate HBO now movies
View README.md

Cross-referencing HBO movies with Movielens data

I decided to try that free month of HBO Now this weekend. It didn't have more than 377 movies when I checked, and it had no way of guessing at what I'd like. Fortunately for me, I have an old Movielens account, which has a fair idea of things I like, so I figured I'd cross-reference the HBO inventory with their guesses at what I'd like, given what I've seen and liked or disliked.

View GM-purpose
User scripts, ultimately, serve whatever purposes scriptwrights and user script
users have.
On a higher level, though, they evolve and democratize the web faster and sooner
-- by letting anyone and everyone partake in extending, improving, specializing,
generalizing and/or otherwise fitting it better to their needs and wants, by
themselves, without (at least technically) ever needing to ask anyone's
permission, or having any privileged access to the servers that deliver web
content and functionality.
@johan
johan / Github-unfold-commit-history.user.js
Created May 25, 2010
Userscript that adds an "unfold all changesets" button on Commit History pages at github, which lets you browse the source changes without leaving the page. (Click a commit header again to re-fold it.)
View Github-unfold-commit-history.user.js
// ==UserScript==
// @name Github: unfold commit history
// @namespace http://github.com/johan/
// @description Adds an "unfold all changesets" button on Commit History pages at github, which lets you browse the source changes without leaving the page. /Click a commit header again to re-fold it.)
// @include https://github.com/*/commits/*
// @include http://github.com/*/commits/*
// ==/UserScript==
(function() {
if ('undefined' == typeof __PAGE_SCOPE_RUN__) { // unsandbox, please!
You can’t perform that action at this time.