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
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") |
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
(* | |
Pull Android app's database file from device to computer and open. Terminal version. | |
You can use it by running the command line | |
osascript pathtoscript.scpt packagename dbfilename.db | |
(make an alias for it) or by setting the properties on the top of the file and saving as an app. | |
*) | |
property package : "pt.company.app" | |
property dbname : "databasename.db" |
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 sublime, sublime_plugin | |
class IdeaCommentCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
self.view.run_command("toggle_comment") | |
if self.view.sel()[0].a == self.view.sel()[0].b: | |
(row,col) = self.view.rowcol(self.view.sel()[0].begin()) | |
target = self.view.text_point(row+1, col) | |
self.view.sel().clear() | |
self.view.sel().add(sublime.Region(target)) |
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/local/bin/convert +append $1 $2 $(dirname $1)/merged.png |
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 pt.beware.remotelogging; | |
import android.content.Context; | |
import com.carlosefonseca.common.utils.CodeUtils; | |
import com.carlosefonseca.common.utils.Log; | |
import java.lang.reflect.Array; | |
import java.lang.reflect.Constructor; | |
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; |
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 bash | |
plist="/tmp/BAMInfo.plist" | |
zippath=`unzip -l $1 | egrep -o "Payload/.*app/Info.plist"` | |
unzip -p $1 $zippath > $plist | |
version=`/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" $plist` |
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
on run {input, parameters} | |
set input to (first item of input) | |
tell script "_string" to set input to trimBoth(input) | |
set lst to every paragraph of input | |
tell application "Reminders" | |
activate | |
set aList to (name of lists) | |
set theList to some list whose name is (first item of (choose from list aList)) |
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 sys | |
import re | |
import simplekml | |
import argparse | |
import random | |
def splitByLines(wkt): |
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 python3 | |
# coding=utf-8 | |
import json | |
import sys | |
# only reads from stdin | |
j = json.loads(sys.stdin.read()) | |
# reads a list of column names from the argument "col1,col2" etc |