###The Problem
$ time rails runner "puts 1"
1
real 0m14.917s
user 0m10.923s
sys 0m3.007s[/code]
| import Skype4Py | |
| skype = Skype4Py.Skype() | |
| skype.Attach() | |
| number = '+972...' | |
| sms = skype.CreateSms(Skype4Py.smsMessageTypeOutgoing, number) | |
| sms.Body = 'Test SMS from Python!' | |
| sms.Send() |
| /* | |
| See: http://www.arikfr.com/blog/how-to-create-a-teapot-with-php.html for more details. | |
| Thanks to @toolmantim for the inspiration (http://toolmantim.com/articles/im_a_little_teapot) | |
| */ | |
| $method = $_SERVER['REQUEST_METHOD']; | |
| if ($method == 'BREW') { | |
| header("HTTP/1.1 418 I'm a teapot"); | |
| die("We do serve ICE Tea, though.\n"); |
| from google.appengine.ext import deferred | |
| from google.appengine.runtime import DeadlineExceededError | |
| class Mapper(object): | |
| # Subclasses should replace this with a model class (eg, model.Person). | |
| KIND = None | |
| # Subclasses can replace this with the property the entities should be ordered by. | |
| ORDER_BY = '__key__' |
| import base64 | |
| from django.utils import simplejson | |
| import urllib | |
| from google.appengine.api import urlfetch | |
| def track(event, properties=None): | |
| """ | |
| A simple function for asynchronously logging to the mixpanel.com API on App Engine | |
| (Python) using RPC URL Fetch object. | |
| @param event: The overall event/category you would like to log this data under |
| set mailserver smtp.gmail.com port 587 username "user@domain.com" password "password" using tlsv1 with timeout 30 seconds |
| window do | |
| before { run 'cd ~/dev/Wix/rails3' } | |
| tab "rails server" do | |
| run 'rails s thin --debugger' | |
| end | |
| tab "solr" do | |
| run 'rake sunspot:solr:run' | |
| end |
| Asset.find_in_batches do |group| | |
| group.each do |asset| | |
| if asset.is_image? | |
| current_url = asset.resource.path | |
| new_url = asset.resource.path(:large) | |
| if AWS::S3::S3Object.exists? current_url, S3Config['bucket_name'] | |
| begin | |
| AWS::S3::S3Object.copy current_url, new_url, S3Config['bucket_name'], :copy_acl => :true | |
| puts "File copied [#{current_url}] => [#{new_url}]." |
| # create rvmrc file | |
| create_file ".rvmrc", "rvm use 1.9.2-patched@#{app_name}" | |
| run "rvm gemset create #{app_name}" | |
| run "rvm use 1.9.2-patched@#{app_name}" | |
| gem "compass" | |
| gem 'compass-less-plugin' | |
| gem 'barista' | |
| gem "jquery-rails" |
| class Utils | |
| @stripTags: (html) -> | |
| html.replace(/<\/?[^>]+>/gi, '') | |
| alert(Utils.stripTags('<html>test</html>')); |
###The Problem
$ time rails runner "puts 1"
1
real 0m14.917s
user 0m10.923s
sys 0m3.007s[/code]