Bash inside of ubuntu image
docker run -it -v /Users:/Users ubuntu bash
On boot
boot2docker up
// | |
// MyViewController.swift | |
// | |
// Created by Nate Armstrong on 4/15/15. | |
// Copyright (c) 2015 Nate Armstrong. All rights reserved. | |
// | |
import UIKit | |
import CoreData |
// usage | |
class MyViewController: UIViewController { | |
required init(coder aDecoder: NSCoder) { | |
super.init(coder: aDecoder) | |
setupTabBarItem("entries") | |
} | |
} | |
// where "entries" is the name of the image. | |
// should have 2 images named tabbar-entries and tabbar-entries-selected |
require 'csv' | |
require 'json' | |
date = 5 | |
file_name = "weather-2014-12-#{date}" | |
body = File.open("/path/to/file/#{file_name}.csv", 'rb').read | |
csv = CSV.new(body, :headers => true, :header_converters => :symbol, :converters => :all) | |
weather = csv.to_a.map {|row| row.to_hash } | |
File.open("/path/to/file/#{file_name}.json", 'w') { |f| f.write(weather.to_json) } |
// when the view is wired up using Storyboard and a custom xib, initWithCoder is called. | |
class MyViewController: UIViewController { | |
@IBOutlet var myView: MyView! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view. | |
} |
FROM ubuntu:latest | |
MAINTAINER Your Name <yourEmail@email.com> | |
RUN apt-get update | |
RUN apt-get -y upgrade | |
# Install apache, PHP, and supplimentary programs. curl and lynx-cur are for debugging the container. | |
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install apache2 libapache2-mod-php5 php5-mysql php5-gd php-pear php-apc php5-curl curl lynx-cur |
Bash inside of ubuntu image
docker run -it -v /Users:/Users ubuntu bash
On boot
boot2docker up
## One way to do it is from the rails console: | |
require 'db/migrate/MIGRATION_FILE_NAME.rb' | |
# if using def change | |
MigrationClass.new.migrate(:down) | |
# if using up or down | |
MigrationClass.up | |
## Another way is using a rake task |
class Post < ActiveRecord::Base | |
has_many :post_tags | |
has_many :tags, through: :post_tags | |
end |