Skip to content

Instantly share code, notes, and snippets.

@pruppert
pruppert / WeMo.py
Last active June 23, 2023 08:57
This is a python script that can control a local WeMo switch as long as you know the local IP of the WeMo. The script is a fork of pdumoulin's blinky: https://github.com/pdumoulin/blinky.
#!/usr/bin/python
import re
import urllib2
# Configuration:
# Enter the local IP address of your WeMo in the parentheses of the ip variable below.
# You may have to check your router to see what local IP is assigned to the WeMo.
# It is recommended that you assign a static local IP to the WeMo to ensure the WeMo is always at that address.
# Uncomment one of the triggers at the end of this script.
@omz
omz / Dropbox File Picker.py
Last active May 17, 2020 21:47
Dropbox File Picker.py
# IMPORTANT SETUP INSTRUCTIONS:
#
# 1. Go to http://www.dropbox.com/developers/apps (log in if necessary)
# 2. Select "Create App"
# 3. Select the following settings:
# * "Dropbox API app"
# * "Files and datastores"
# * "(No) My app needs access to files already on Dropbox"
# * "All file types"
# * (Choose any app name)
@ixgeek
ixgeek / smokemtr.py
Last active February 1, 2019 15:42 — forked from empireshades/smokemtr.py
Script updated to work when 'edgetrigger = yes.' Further, compensates for an apparent smokeping bug that causes the sixth arg not to pass on the 'cleared' alert.
#!/bin/env python
'''This is a script which runs an MTR (matt's traceroute)
against a target hosts - meant to be triggered by a
smokeping alert. Output is emailed and saved to log.'''
import argparse, datetime, subprocess, smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
@viticci
viticci / Launch Center Pro action menu
Created February 4, 2014 16:18
iOS bookmarklet for Launch Center Pro
javascript:window.location='launchpro://?url='+encodeURIComponent('launchpro://?url=[list:URL: ' +location.href+'|🔵 Tweetbot=tweetbot://viticci/post?text={{'+location.href+'}}|📌 Pinswift=pinswift://x-callback-url/add?url={{'+location.href+'}}|✅ To Check Out=drafts://x-callback-url/create?text={{'+location.href+'}}&action={{Stuff To Check Out}}|🔴 Reminder=fantastical2://parse?sentence={{'+location.href+'}}&reminder=1|🔒 Open In 1Password=op'+location.href+'|🔗 Clean Link=clean-links://x-callback-url/clean?url={{'+location.href+'}}]')
@goldsmith
goldsmith / python_mavericks_guide.sh
Last active June 3, 2020 12:18
When I upgraded my Mac to OS X Mavericks, a lot of utilities (like Python, virtualenv, Xcode) broke, and it was pretty stressful trying to get it all set back up. Hopefully this guide can spare you some of that pain.Note: I'm by no means a Linux or Mac expert, so please fork and let me know if anything is redundant, incorrect, or missing!
# A guide to prevent pain and suffering while upgrading to OS X Mavericks
# This will vary greatly depending on system set up, so read the instructions carefully
# Back up Virtulenvs
####################
# Very important!
# For each virtualenv you have, run "pip freeze > requirements.txt" while in the activated virtualenv
# in order to prevent loss of dependencies during the upgrade.

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@thomasmb
thomasmb / statusboard-serverstats.php
Created April 10, 2013 14:05
A simple script for getting and displaying server stats in StatusBoard
<?php
//add your server aliases here
$servers = array(
"185.14.184.234" => "mcfly.bensmann.no",
"185.14.184.xxx" => "another.server.com",
);
//this script is triggered by this command from the terminal or cron:
//echo "time=`uptime`&df=`df -h`" | curl -s -d @- http://domain.com/path/to/script.php
@valpackett
valpackett / Alfred-Pinboard-INSTANT.md
Last active September 7, 2023 21:01
INSTANT Pinboard search from Alfred 2

INSTANT Pinboard search from Alfred 2

I've had a Python script that makes an HTML Bookmarks file for LaunchBar.
Now that I use Alfred 2, I modified it to make XML for Alfred.
This allows me to search my bookmarks with GREP SPEED!

Installation

First, add your token (from pinboard.in/settings/password) to ~/.netrc

@macolyte
macolyte / today_i_learned.py
Last active December 11, 2015 21:39
Learn something new every day with Pythonista
from datetime import date
import webbrowser
import console
def main():
result = console.alert("Today I Learned", "Choose your path", "reddit", "today", "random")
today = date.today().strftime("%B_%d")
urls = ["http://www.reddit.com/r/todayilearned", ("http://en.wikipedia.org/wiki/%s" % today), "http://en.wikipedia.org/wiki/Special:Random"]
@dlo
dlo / allpinboard.py
Last active September 5, 2019 15:26 — forked from ttscoff/allpinboard.rb
Python version of https://gist.github.com/3773519 that pulls all bookmarks on the first sync, and does incremental updates afterwards. Also uses the Mac OS X keychain to retrieve your password so it doesn't need to live in a file on your computer in plain text.
#!/usr/bin/env python
"""
This script is designed to generate a simple html file with _all_ of your
Pinboard.in bookmarks The HTML file can be added to Launchbar's index as a
custom bookmark file and you can search your entire Pinboard.in collection
instantly from Launchbar (by title only). It includes any applied tags as part
of the title to aid in searching.
You should edit the `username`, `bookmark_filename`, and `local_timezone`