This file contains hidden or 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
#http://github.com/ahoward/open4 is an alternative that handles pid and exit status | |
#http://github.com/ahoward/session a more fleshed our shell utility | |
require 'open3' | |
Open3.popen3("dc") do |stdin, stdout, stderr| | |
t = Thread.new(stderr) do |terr| | |
while (line = terr.gets) | |
puts "stderr: #{line}" | |
end | |
end |
This file contains hidden or 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
task :production do | |
set :rails_env, "production" | |
role :app, "example.com", :master => true | |
role(:app) { |opts| compute_ec2_addresses(:app, opts) } | |
role(:db, :master => true) { |opts| compute_ec2_addresses(:db, opts) } | |
end | |
task :staging do | |
set :rails_env, "staging" | |
role :app, "staging.example.com", :master => true |
This file contains hidden or 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
/** | |
* We're going to create an infinite scrollable list. In this case, we're going to show a date. When you swipe left, | |
* you'll see yesterday. Then the day before yesterday, and so on. Swiping right shows you tomorrow, and so on. | |
*/ | |
var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); | |
var isAndroid = Ti.Platform.osname === 'android'; | |
/** | |
* Track where we are in the infinite scrollable views, and define how large of a step goes between each view. | |
*/ | |
var currentDate = new Date(), msIntervalBetweenViews = 1000/*ms*/ * 60/*s*/ * 60/*m*/ * 24/*h*/; |
This file contains hidden or 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
check process sequoia_dj2_delayed_job_0 | |
with pidfile /home/deploy/rails/sequoia/shared/pids/delayed_job.0.pid | |
start program = "/home/deploy/rails/sequoia/shared/delayed_job_runner.sh start production 0" | |
as uid deploy and gid deploy | |
stop program = "/home/deploy/rails/sequoia/shared/delayed_job_runner.sh stop production 0" | |
as uid deploy and gid deploy | |
check process sequoia_dj2_delayed_job_1 | |
with pidfile /home/deploy/rails/sequoia/shared/pids/delayed_job.1.pid | |
start program = "/home/deploy/rails/sequoia/shared/delayed_job_runner.sh start production 1" |
This file contains hidden or 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 is the Android version of the Tweetie-like pull to refresh table: | |
// http://developer.appcelerator.com/blog/2010/05/how-to-create-a-tweetie-like-pull-to-refresh-table.html | |
var win = Ti.UI.currentWindow; | |
var alertDialog = Titanium.UI.createAlertDialog({ | |
title: 'System Message', | |
buttonNames: ['OK'] | |
}); | |
var scrollView = Ti.UI.createScrollView({ |
This file contains hidden or 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
require "java" | |
require "netty-3.2.4.Final.jar" | |
# HELLO JAVA. I MISSED U. | |
java_import java.net.InetSocketAddress | |
java_import java.util.concurrent.Executors | |
java_import org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory | |
java_import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory | |
java_import org.jboss.netty.channel.ChannelFactory | |
java_import org.jboss.netty.channel.ChannelPipelineFactory |
This file contains hidden or 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
# Gemfile | |
… | |
gem 'uuidtools' | |
… |
This file contains hidden or 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
[DebuggerDisplay("Count = {Count}")] | |
[ComVisible(false)] | |
public class SafeObservableCollection<T> : ObservableCollection<T> | |
{ | |
private readonly Dispatcher dispatcher; | |
public SafeObservableCollection() | |
: this(Enumerable.Empty<T>()) | |
{ | |
} |
OlderNewer