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 ruby | |
# nokogiri is required below unless --no-modify option is specified | |
require 'optparse' | |
require 'tempfile' | |
@options = {} | |
OptionParser.new do |opts| | |
opts.banner = "Usage: svgoptimize [options] <path-to-svg-file>" |
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 | |
# | |
# Update Textmate bundles | |
# Standard OS X Textmate bundle Verzeichnis | |
TEXTMATE_BUNDLES="$HOME/Library/Application Support/Textmate/Bundles" | |
# … ins Verzeichnis wechseln | |
echo "\n*** Wechsle ins Textmate bundle Verzeichnis..." |
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
// this little snippet demonstrates how you can handle multiple sounds with just one play button | |
// switch through the sounds with a simple scroll gesture (by using a ScrollableView | |
// this code is not complete!! Use it on your own risk. :-) | |
function createSound(url) { | |
var file = Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory, url); | |
return Titanium.Media.createSound({sound:file}); | |
}; | |
// called once, loading the first sound to play | |
var sound = createSound('myfile.mp3'); |
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
Titanium.Yahoo.yql('select * from yahoo.maps.findLocation where q="'+latitude+','+longitude+'" and gflags="R"',function(e) { | |
var woeid = e.data.ResultSet.Results.woeid; | |
Titanium.API.info(woeid); | |
}); |
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
var screenshot = win.toImage(); // make sure to change 'win' to whatever your window/view is called | |
var file = Ti.Filesystem.createTempFile(Ti.Filesystem.resourcesDirectory); // create a temporary file | |
file.write(screenshot); // write the 'screenshot' to that file. | |
var w = Ti.UI.createWindow({ | |
backgroundImage:file.nativePath // use the native path of the temp file | |
}); |