Skip to content

Instantly share code, notes, and snippets.

@ellcom
ellcom / retina-canvas.js
Last active March 24, 2020 20:14
Retina Canvas Invisible Upscaling
(function(prototype) {
prototype.getContext = (function(_parent) {
return function(contextType, contextAttributes) {
var context = _parent.call(this, contextType, contextAttributes)
if (contextType != '2d') {
return context
}
if (this.hasAttribute('data-scaled')) {
return context
@ellcom
ellcom / remove_*@1x*.sh
Created September 4, 2014 10:40
Remove @1x from file names in a directory
#!/bin/sh
for f in *@1x.png; do
echo "$f"
echo "${f%@1x.*}.png"
mv "$f" "${f%@1x.*}.png"
done
@ellcom
ellcom / AppleScript.Spotify.PlayPause.scpt
Created August 2, 2014 17:02
Tell spotify to play/pause using AppleScript
using terms from application "Spotify"
if player state of application "Spotify" is paused then
tell application "Spotify" to play
else
tell application "Spotify" to pause
end if
end using terms from