Skip to content

Instantly share code, notes, and snippets.

Avatar

John Johnston troutcolor

View GitHub Profile
@troutcolor
troutcolor / Fargo Flickr Search
Last active Aug 29, 2015
Using the currently selected outline text as a tag, searches flicker and adds the first 5 images found below with the html returned.
View Fargo Flickr Search
@troutcolor
troutcolor / Fargo My Flickr-menu
Last active Aug 29, 2015
Script menu script for Fargo. inserts last 10 flickr photos from user (replace my id for yours) into a series of headlines below current.
View Fargo My Flickr-menu
My Flickr-medium
var theurl = "https://api.flickr.com/services/feeds/photos_public.gne?id=71428177@N00&format=opml";
http.readUrl(theurl,
function(data) {
xmlDoc = $.parseXML(data);
var ii = 0;;
$xml = $(xmlDoc),
$xml.find("entry").each(function() {
ii++;
if (ii > 10) {
@troutcolor
troutcolor / tablinks to clip
Created Jun 13, 2015
Safari Tab Links to clipboard, html
View tablinks to clip
@troutcolor
troutcolor / Safari Tab links to markdown list
Created Jun 13, 2015
create markdown list of Safari tabs
View Safari Tab links to markdown list
@troutcolor
troutcolor / image to width
Created Jul 9, 2015
resize images selected in finder (I use in Fast Scripts)
View image to width
tell application "Finder"
set files_ to selection
set w to the text returned of (display dialog "What width?" default answer "500")
repeat with file_ in files_
repeat 1 times
--set imgkind to (kind of file_)
--if (imgkind does not contain "Image") then
-- exit repeat -- 1 times
@troutcolor
troutcolor / Find Flickr Photo.scpt
Last active Oct 22, 2015
Apple Script to find where a flickr photo (or photos) selected in the finder comes from. See http://cogdogblog.com/2015/10/21/flickr-trickr/ I use FastScripts to run this sort of thing.
View Find Flickr Photo.scpt
tell application "Finder"
set files_ to selection
repeat with file_ in files_
set imgkind to (kind of file_)
repeat 1 times
set imgkind to (kind of file_)
if (imgkind does not contain "Image") then
@troutcolor
troutcolor / pinboardrecent.py
Last active Jan 10, 2016
A python script that makes a webpage, https://dl.dropboxusercontent.com/u/81715/pinboard.html, from my pinboard links with thumbnails. Most of the script borrowed from http://leancrew.com/all-this/2015/12/homemade-rss-aggregator-followup. Need webkit2png
View pinboardrecent.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#Most of this based on a script from http://leancrew.com/all-this/2015/12/homemade-rss-aggregator-followup/
#I added the thumbnailing with webkit2png and cut it down to one feed.
#TODO clean up old images, don't regenerate existing images, spearate css from template
import feedparser
import time
from datetime import datetime, timedelta
import pytz
@troutcolor
troutcolor / Sync gh-pages + master branches
Created Apr 6, 2016 — forked from mandiwise/Sync gh-pages + master branches
Keep gh-pages up to date with a master branch
View Sync gh-pages + master branches
// Reference: http://lea.verou.me/2011/10/easily-keep-gh-pages-in-sync-with-master/
$ git add .
$ git status // to see what changes are going to be commited
$ git commit -m 'Some descriptive commit message'
$ git push origin master
$ git checkout gh-pages // go to the gh-pages branch
$ git rebase master // bring gh-pages up to date with master
$ git push origin gh-pages // commit the changes
@troutcolor
troutcolor / isRetina.scpt
Created Feb 12, 2017
detect retina display for applescript
View isRetina.scpt
on isRetina()
set ret to (do shell script "system_profiler SPDisplaysDataType | awk '/Retina:/{print $2}'")
if ret is "Yes" then
return true
else
return false
end if
end isRetina
@troutcolor
troutcolor / auto-complete-gifs
Last active Feb 12, 2017
Makes auto complete google search gifs, needs gifsicle
View auto-complete-gifs
--needs gifsicle http://www.lcdf.org/gifsicle/
-- updated for retina screen
set thetext to text returned of (display dialog "What do you want to autocomplete?" default answer "I hate")
set theFileName to change_case_of(thetext, "lower") & ".gif"
set tempdir to POSIX path of (path to temporary items from user domain) & "autogifs/"
try
do shell script "mkdir " & tempdir
end try
You can’t perform that action at this time.