This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
######################### | |
# airbnb-search.py | |
######################### | |
# by prehensile, 18/07/17 | |
######################### | |
# Crawl airbnb search results (descriptions and reviews) for keywords. | |
# A quick, dirty and brittle set of hacks. | |
# Very likely to break the next time anything changes in airbnb's HTML. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Seen Too Much | |
Broken Zanti | |
Living On The Edge | |
Wild Thing | |
Wild Thing Edge | |
The Click | |
Zapata | |
Blue Zinger | |
Petting Zoo | |
Red Tide |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
## | |
# kube-resources.py | |
# Collate and report Kubernetes pod usages vs. node limits. | |
# | |
# Assumes `kubectl` is installed and available. | |
# | |
# Author: Henry Cooke, [email protected] | |
# Version: 20150816 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
def chunk_string( str_in, max_chunk_length ): | |
l = len(str_in) | |
chunks =[] | |
if l <= max_chunk_length: | |
chunks = [str_in] | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urlparse | |
import urllib2 | |
import BeautifulSoup as Soup | |
import random | |
class BingSource: | |
def __init__( self ): | |
self.rss_url = "http://www.bing.com/news/?format=RSS" | |
def get_image_url( self ): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" | |
"http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>prehensile.networkwatcher</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/bin/python</string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BigPicture.py | |
# | |
# A Python script to download the latest image from Boston Big Picture's RSS. | |
# I use it from a launchd job to set the wallpaper on my Mac ;) | |
# | |
# Requires: | |
# Universal Feed Parser (http://www.feedparser.org/) | |
# for RSS fetch & parse | |
# BeautifulSoup (http://www.crummy.com/software/BeautifulSoup/) | |
# for parsing HTML in the RSS feed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Growl | |
# set up a new GrowlNotifier with our name and a list of the notifications we'll be posting | |
gn = Growl.GrowlNotifier( "YourAppName", ["A readable notification name", "another readable notification name"] ) | |
# register the notifier with Growl | |
gn.register() | |
# post a notification | |
gn.notify( "Notification name from the list we registered earlier", "Notification Title", "Notification body" ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; | |
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; | |
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL'; | |
DROP SCHEMA IF EXISTS `verbivoredb` ; | |
CREATE SCHEMA IF NOT EXISTS `verbivoredb` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci ; | |
USE `verbivoredb`; | |
-- ----------------------------------------------------- | |
-- Table `verbivoredb`.`words` |
NewerOlder