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
#! /bin/sh | |
# On alternate invocations, this script | |
# saves the path of the source file currently open in Xcode | |
# and restores the file at that path in Xcode. | |
# | |
# By setting Xcode (in Behaviors) to run this script when "Run Starts" | |
# and when "Run Completes", you can prevent it from switching to main.m | |
# when a run finishes. | |
# See http://stackoverflow.com/questions/7682277/xcode-4-2-jumps-to-main-m-every-time-after-stopping-simulator |
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
(* | |
Running this script will cause Instruments to become active | |
and switch from the Script view (where you edit your UIAutomation script) | |
to the Editor Log view (where you see the logs of executing those scripts) | |
or vice versa. | |
*) | |
-- JW: This block only needs to be executed once, and can then be removed. | |
-- I don't know if leaving it in might cause a performance hit; |
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
# Clears Xcode's console, | |
# then switches back to the iOS Simulator. | |
activate application "Xcode" | |
tell application "System Events" | |
tell process "Xcode" | |
click menu item "Clear Console" of menu 1 of menu item "Debug" of menu 1 of menu bar item "Product" of menu bar 1 | |
end tell | |
end tell | |
activate application "iPhone Simulator" |
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 | |
""" | |
Given the current directory contains multiple repositories, each with a | |
requirements/project.txt file, build a report of all requirements. | |
""" | |
import os | |
reqs = {} |
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
# hn_screen_scraper.py | |
# A screen scraper for the front page of hacker news done out of a fit of boredom. | |
from urllib import request | |
import re | |
# read in the data and split it into a raw list of entries | |
url_path = "http://news.ycombinator.com" | |
sock = request.urlopen(url_path) | |
raw_data = str(sock.read()) | |
data_set = re.split("arrow\.gif", raw_data) |
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
the_app=$( | |
osascript 2>/dev/null <<EOF | |
tell application "System Events" | |
name of first item of (every process whose frontmost is true) | |
end tell | |
EOF |
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
<?php | |
// Add this to template-functions.php | |
// Disclaimer: I based icl_get_anchor_attributes on the _stringify_attributes function on CodeIgniter framework. I made my own function, but I believe this function is just better (and proved to work fine) | |
function icl_get_anchor_attributes($attributes) { | |
if (is_object($attributes) && count($attributes) > 0) { | |
$attributes = (array) $attributes; | |
} | |
if (is_array($attributes)) { |
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
from threading import Thread | |
from selenium import webdriver | |
import time | |
API_KEY = "key" | |
API_SECRET = "secret" | |
def get_browser(caps): | |
return webdriver.Remote( | |
desired_capabilities=caps, |
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 | |
import datetime | |
import feedparser | |
import json | |
import os | |
from urlparse import urlparse | |
def readConfigFile(): | |
"""Read the config file ~/.youtube-rss and return a dictionary""" |
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
/* | |
* Copyright (C) 2011 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
OlderNewer