Skip to content

Instantly share code, notes, and snippets.

@drunkensouljah
drunkensouljah / get_url.scpt
Created November 12, 2021 20:58 — forked from prashanthrajagopal/get_url.scpt
AppleScript to get url from Safari, Firefox and Chrome
display dialog "Name of the browser?" default answer "Safari"
set inp to text returned of result
tell application "System Events"
if inp is "Google Chrome" then
tell application "Google Chrome" to return URL of active tab of front window
else if inp is "Safari" then
tell application "Safari" to return URL of front document
else if inp is "Firefox" then
tell application "Firefox" to activate
@drunkensouljah
drunkensouljah / OSX-Dock-Spacers.md
Created November 12, 2021 20:51 — forked from lukeed/OSX-Dock-Spacers.md
OSX Dock Spacers

Huh?

Some MacOS users have very cluttered Docks & wish they could organize them without removing any App icons from the mix.

This snippet will add an empty "spacer" that you can drag around and use to separate icons into groups! See example.

Command

Paste this into your Terminal. Run the command for additional placeholders!

@drunkensouljah
drunkensouljah / TelekomDataUsage.js
Created September 7, 2021 21:47 — forked from Sillium/TelekomDataUsage.js
Telekom Data Usage - iOS 14 Widget for Scriptable app
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: pink; icon-glyph: exchange-alt;
const DEBUG = false
const log = DEBUG ? console.log.bind(console) : function () { };
// configure the library
const libraryInfo = {
name: 'TelekomDataUsageLibrary',
version: '1.0.3',
@drunkensouljah
drunkensouljah / wordpressPluginStats.js
Created September 7, 2021 21:46 — forked from danielmilner/wordpressPluginStats.js
WordPress plugin stat widget for iOS 14 and Scriptable app
/**
* Setup Begin
*/
const pluginSlug = "hey-notify";
const backgroundColor = "#009bff"; // In HEX format
const textColor = "#ffffff"; // In HEX format
/**
* Setup End
*/
@drunkensouljah
drunkensouljah / benzinpreis-widget.js
Created September 7, 2021 21:45 — forked from andreasRedeker/benzinpreis-widget.js
A Scriptable widget, that shows you the cheapest gas station near you (for germany only)
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: deep-blue; icon-glyph: gas-pump;
// share-sheet-inputs: plain-text;
// Script by Andreas Redeker <[email protected]>
// Get your own API key from https://creativecommons.tankerkoenig.de/
const apiKey = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
const radius = 3
const apiUrl = "https://pass.telekom.de/api/service/generic/v1/status"
let widget = await createWidget()
widget.backgroundColor = new Color("#777777")
if (!config.runsInWidget) {
await widget.presentSmall()
}
Script.setWidget(widget)
Script.complete()
@drunkensouljah
drunkensouljah / workflow-install.py
Created October 29, 2017 02:08 — forked from deanishe/workflow-install.py
Script to install/symlink Alfred workflows. Useful for workflow developers.
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2013 [email protected].
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2013-11-01
#
@drunkensouljah
drunkensouljah / README-Template.md
Created June 2, 2017 16:26 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

#coding: utf-8
import console
import keychain
import pickle
login = keychain.get_password('pinboard.in','pythonista')
if login is not None:
user, pw = pickle.loads(login)
else:
@drunkensouljah
drunkensouljah / simplePDFtableScraper.py
Created March 19, 2017 15:01 — forked from psychemedia/simplePDFtableScraper.py
Example Python code for a simple PDF table scraper
# 1. Add some necessary libraries
import scraperwiki
import urllib2, lxml.etree
# 2. The URL/web address where we can find the PDF we want to scrape
url = 'http://cdn.varner.eu/cdn-1ce36b6442a6146/Global/Varner/CSR/Downloads_CSR/Fabrikklister_VarnerGruppen_2013.pdf'
# 3. Grab the file and convert it to an XML document we can work with
pdfdata = urllib2.urlopen(url).read()