We'll assume an OS X Mavericks (10.9) box here.
You'll need:
- Vagrant
- Vagrant's VMware Fusion provider
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |
| def format_time(secs): | |
| return "%d:%02d" % (secs / 60, secs % 60) | |
| def invert(arr): | |
| """ | |
| Make a dictionary that with the array elements as keys and | |
| their positions positions as values. | |
| >>> invert([3, 1, 3, 6]) |
| # lib/custom_logger.rb | |
| class CustomLogger < Logger | |
| def format_message(severity, timestamp, progname, msg) | |
| "#{timestamp.to_formatted_s(:db)} #{severity} #{msg}\n" | |
| end | |
| end | |
| logfile = File.open("#{Rails.root}/log/custom.log", 'a') # create log file | |
| logfile.sync = true # automatically flushes data to file | |
| CUSTOM_LOGGER = CustomLogger.new(logfile) # constant accessible anywhere |
| var app = require('express').createServer(), | |
| mbtiles = require('mbtiles'), | |
| tilelive = new (require('tilelive').Server)(mbtiles); | |
| app.get('/:z/:x/:y.*', function(req, res) { | |
| var options = { | |
| x: req.param('x'), | |
| y: req.param('y'), | |
| z: req.param('z'), | |
| format: req.params[0], |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| <modelVersion>4.0.0</modelVersion> | |
| <groupId>com.example</groupId> | |
| <artifactId>my-project</artifactId> | |
| <version>0.0.1-SNAPSHOT</version> | |
| <dependencies> | |
| <!-- none yet --> |
| using System; | |
| using System.Diagnostics; | |
| using System.IO; | |
| using System.Text; | |
| namespace CiscoVpnConnect | |
| { | |
| internal class CiscoVpnClientWrapper | |
| { | |
| private readonly string path; |
| # Start the old vagrant | |
| $ vagrant init centos-6.3 | |
| $ vagrant up | |
| # You should see a message like: | |
| # [default] The guest additions on this VM do not match the install version of | |
| # VirtualBox! This may cause things such as forwarded ports, shared | |
| # folders, and more to not work properly. If any of those things fail on | |
| # this machine, please update the guest additions and repackage the | |
| # box. |
| FROM base | |
| RUN echo "deb http://archive.canonical.com/ubuntu precise partner" >> /etc/apt/sources.list | |
| RUN echo "deb-src http://archive.canonical.com/ubuntu precise partner" >> /etc/apt/sources.list | |
| RUN echo "deb http://archive.ubuntu.com/ubuntu precise universe" >> /etc/apt/sources.list | |
| RUN echo "deb-src http://archive.ubuntu.com/ubuntu precise universe" >> /etc/apt/sources.list | |
| RUN apt-get update | |
| RUN apt-get --yes install ksh |
| package com.neolitec.examples; | |
| import org.apache.commons.codec.binary.Base64; | |
| import org.apache.commons.lang.StringUtils; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import javax.servlet.*; | |
| import javax.servlet.http.HttpServletRequest; | |
| import javax.servlet.http.HttpServletResponse; |