Skip to content

Instantly share code, notes, and snippets.

@ricn
ricn / README.md
Created February 4, 2014 17:35 — forked from dergachev/README.md

Vagrant Setup

This tutorial guides you through creating your first Vagrant project.

We start with a generic Ubuntu VM, and use the Chef provisioning tool to:

  • install packages for vim, git
  • create user accounts, as specified in included JSON config files
  • install specified user dotfiles (.bashrc, .vimrc, etc) from a git repository

Afterwards, we'll see how easy it is to package our newly provisioned VM

==> Summary
🍺 /usr/local/Cellar/erlang/17.1_1: 7377 files, 282M
==> Installing elixir
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/elixir-0.15.1.mavericks.bottle.tar.gz
Already downloaded: /Library/Caches/Homebrew/elixir-0.15.1.mavericks.bottle.tar.gz
==> Pouring elixir-0.15.1.mavericks.bottle.tar.gz
🍺 /usr/local/Cellar/elixir/0.15.1: 322 files, 4.2M
air:~ ricn$ iex
Erlang R16B (erts-5.10.1) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
@ricn
ricn / blah
Created May 11, 2015 17:21
Phoenix 0.13
Air:bitdoc ricn$ mix deps.get
Running dependency resolution
Dependency resolution completed successfully
All dependencies up to date
Air:bitdoc ricn$ mix phoenix.server
lib/phoenix_html.ex:1: warning: redefining module Phoenix.HTML
lib/phoenix_html/engine.ex:1: warning: redefining module Phoenix.HTML.Engine
lib/phoenix_html/form_data.ex:1: warning: redefining module Phoenix.HTML.FormData
lib/phoenix_html/form.ex:1: warning: redefining module Phoenix.HTML.Form
==> phoenix_html
@ricn
ricn / mix.exs
Created May 11, 2015 17:25
mix.exs
defmodule Bitdoc.Mixfile do
use Mix.Project
def project do
[app: :bitdoc,
version: "0.0.1",
elixir: "~> 1.0",
elixirc_paths: elixirc_paths(Mix.env),
compilers: [:phoenix] ++ Mix.compilers,
build_embedded: Mix.env == :prod,
require "rubygems"
require "crack"
require "couchrest"
db = CouchRest.database!('http://127.0.0.1:5984/ruby_jobmotel')
jobs_as_xml = Net::HTTP.get_response(URI.parse('http://ruby.jobmotel.com/jobs.xml')).body
parsed_jobs = Crack::XML.parse(jobs_as_xml)
require "rubygems"
require "faker"
require "couchrest"
DB = CouchRest.database!('http://127.0.0.1:5984/contacts')
class Contact < CouchRest::ExtendedDocument
use_database DB
property :first_name
config/database.yml
config/*.sphinx.conf
config/s3_credentials.yml
*~
*.cache
*.log
*.pid
tmp/**/*
.DS_Store
db/cstore/**
> npm config get root
npm it worked if it ends with ok
npm cli [ 'config', 'get', 'root' ]
npm version 0.1.23
npm config file /Users/ricn/.npmrc
npm config file /usr/local/Cellar/node/0.1.104/etc/npmrc
/usr/local/lib/node
npm ok
defmodule Bookmarks.Bookmark do
use Bookmarks.Web, :model
schema "bookmarks" do
field :href, :string
field :title, :string
field :description, :string
timestamps
end
Test error:
3) test deletes chosen resource (Bookmarks.BookmarkControllerTest)
test/controllers/bookmark_controller_test.exs:66
** (ArgumentError) argument error
stacktrace:
:erlang.apply(695, :id, [])
test/controllers/bookmark_controller_test.exs:68
Test code: