Skip to content

Instantly share code, notes, and snippets.

@philgruneich
philgruneich / kirby_video.php
Last active February 26, 2024 07:00
This extension includes the HTML5 video tag as kirbytext and has several optional parameters. It accepts input of .ogg, .webm and custom fallback. If you don't choose width and height, it picks the one in the config.php file. It also supports class and title.
<?php
class kirbytextExtended extends kirbytext {
function __construct($text, $markdown=true) {
parent::__construct($text, $markdown);
$this->addTags('video');
# -*- coding: utf-8 -*-
from json import loads
from requests import get
import location
from datetime import date
import time
from console import alert
# Customization here
APItoken = 'Insert your API token here'
@philgruneich
philgruneich / Toggle Invisible Files.scpt
Created March 16, 2014 05:06
Show/Hide invisible files in Finder. Add to ~/Library/Application Support/Launchbar/Scripts to launch from Launchbar.
set stateMent to do shell script "defaults read com.apple.finder AppleShowAllFiles"
if stateMent = "TRUE" then
do shell script "defaults write com.apple.finder AppleShowAllFiles FALSE"
else
do shell script "defaults write com.apple.finder AppleShowAllFiles TRUE"
end if
tell application "Finder" to quit
delay 2
launch application "Finder"
javascript:(function(){var p=document.createElement("p");p.innerHTML="<strong>Loading&hellip;</strong>";p.id="loadingp";p.style.padding="20px";p.style.background="#fff";p.style.left="20px";p.style.top=0;p.style.position="fixed";p.style.zIndex="9999999";p.style.opacity=".85";document.body.appendChild(p);document.body.appendChild(document.createElement("script")).src="https://gist.github.com/ttscoff/6109434/raw/Bullseye.js?x="+(Math.random());})();
@philgruneich
philgruneich / SafariEvernote.bookmarklet.js
Last active February 26, 2024 07:00
Bookmarklet to save articles from the web to Evernote using Safari on iOS
// Credits to Phillip Gruneich, Brett Terpstra and Jonathon Duerig.
// This bookmarklet requires Drafts by Greg Pierce/Agile Tortoise.
javascript:(function()%7Bvar%20request=new%20XMLHttpRequest();request.open(%22GET%22,%22http://heckyesmarkdown.com/go/?read=1&preview=0&showframe=0&output=url&u=%22+encodeURIComponent(location.href),true);request.send();request.onreadystatechange=function()%7Blocation.href=%22drafts://x-callback-url/create?text=%22+request.responseText+%22&action=Markdown%20to%20Evernote%22%7D;%7D)();
// Version without triggering the Markdown to Evernote action on Drafts
javascript:(function()%7Bvar%20request=new%20XMLHttpRequest();request.open(%22GET%22,%22http://heckyesmarkdown.com/go/?read=1&preview=0&showframe=0&output=url&u=%22+encodeURIComponent(location.href),true);request.send();request.onreadystatechange=function()%7Blocation.href=%22drafts://x-callback-url/create?text=%22+request.responseText%7D;%7D)();
@philgruneich
philgruneich / latest_draft.py
Created November 16, 2014 06:19
Open latest Draft article on either Byword or 1Writer
from requests import get
from json import loads
from urllib import quote
from webbrowser import open
email = 'YOUR EMAIL'
password = 'YOUR PASSWORD'
r = get('https://draftin.com/api/v1/documents.json', auth=(email,password))
@philgruneich
philgruneich / sendFeedToPinboard.py
Created November 17, 2014 02:22
Send entire feed to Pinboard
#coding: utf-8
import feedparser
import urllib
import bs4
import keychain
import console
import pickle
# Get your token at:
# http://pinboard.in/settings/password
@philgruneich
philgruneich / cleanLinksRiposte.js
Created November 17, 2014 03:13
Sends URL to Clean Links and generates a Markdown link for Riposte
javascript:window.location='clean-links://x-callback-url/clean?url='+encodeURIComponent(location.href)+'&x-success='+encodeURIComponent('drafts4://x-callback-url/runAction?text='+encodeURIComponent('['+document.title+'](||clipboard||)')+'&action=Send%2520to%2520Riposte&afterSuccess=Delete')
@philgruneich
philgruneich / sourceCodeTextastic.js
Created November 17, 2014 03:16
Opens the source code from the current page on Textastic
javascript:location.href=(function(){var href=location.href;return "textastic"+href.substring(href.indexOf("://"));})();
@philgruneich
philgruneich / evernoteWebclipperDrafts.js
Created November 17, 2014 03:22
Cleans the content of your current page and sends it to Drafts, which creates a new note in Evernote and includes geolocation. Requires the Markdown to Evernote action.
javascript:(function(){var request=new XMLHttpRequest();request.open("GET","http://heckyesmarkdown.com/go/?read=1&preview=0&showframe=0&output=url&u="+encodeURIComponent(location.href),true);request.send();request.onreadystatechange=function(){location.href="drafts4://x-callback-url/runAction?text="+encodeURIComponent(window.document.title + "\n")+request.responseText+"&action=Markdown To Evernote"};})();