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
Automator > Service | |
=================== | |
* Put the code bellow inside a "Run Shell Script" action | |
** Change the paths to TTYtter and growl | |
** TTYtter: http://www.floodgap.com/software/ttytter/ | |
** growl.sh: http://hints.macworld.com/dlfiles/growl_sh.txt | |
cat > ~/Library/Caches/tn.cache | |
AAA=`wc -m ~/Library/Caches/tn.cache | awk '{print $1}'` |
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
tell application "System Events" | |
if (name of processes) contains "Adium" then | |
tell application "Adium" | |
set acc to (some account whose name is "#####") | |
tell acc | |
set enabled to true | |
go online | |
end tell | |
end tell | |
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 theScript to quoted form of POSIX path of (path to resource "compositeImages.py" in directory "Scripts") | |
on open these_items | |
set theScript to quoted form of POSIX path of (path to resource "compositeImages.py" in directory "Scripts") | |
set f1 to (quoted form of POSIX path of (first item of these_items)) | |
set f2 to (quoted form of POSIX path of (item 2 of these_items)) | |
choose file name with prompt "Destination:" default name "Images.png" without invisibles | |
set theFile to quoted form of POSIX path of result |
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/python | |
# -*- coding: utf-8 -*- | |
import math | |
import sys | |
from bs4 import BeautifulSoup | |
def distance_on_unit_sphere(lat1, long1, lat2, long2): | |
# Convert latitude and longitude to |
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 codecs | |
from bs4 import BeautifulSoup | |
import sys | |
contents = open(sys.argv[1]).read() | |
soup = BeautifulSoup(contents, features="xml") | |
allLineStrings = soup.find_all("LineString") |
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 | |
# -*- coding: utf-8 -*- | |
import json | |
import codecs | |
import sys | |
import locale | |
from subprocess import Popen, PIPE, STDOUT | |
import argparse |
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
package com.example.SectionedAdapterTest; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.Adapter; | |
import android.widget.BaseAdapter; | |
import java.util.ArrayList; | |
import java.util.List; | |
abstract public class SectionedAdapter extends BaseAdapter { |
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
public static class DownloadResult { | |
public void onFile(String path) {}; | |
public void onString(String string){}; | |
public void onFail() {}; | |
} | |
/** | |
* This class handles the download of stuff from the tubes. | |
* It's an extension of AsyncTask, so it will download asynchronously. |
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
<!doctype html> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<title>A 500px photo</title> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> | |
<style type="text/css"> | |
img { | |
width: 100% | |
} | |
.photo, a.photo { |
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
property enteredWidth : 0 | |
property newPath : "" | |
on run {input, parameters} | |
repeat with fileAlias in input | |
try | |
display dialog "Enter width for 1x of " & (POSIX path of fileAlias) & ":" default answer "" | |
set dialogInfo to result | |
set enteredWidth to (text returned of dialogInfo as integer) | |
set the newPath to my replace_chars((POSIX path of fileAlias), ".png", "@2x.png") |
OlderNewer