Skip to content

Instantly share code, notes, and snippets.

@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,
@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
==> 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 / comments.js.jsx
Created July 30, 2014 23:08
comments.js.jsx
/** @jsx React.DOM */
var Comment = React.createClass({
render: function () {
return (
<div className="comment">
<h2 className="commentAuthor">
{this.props.author}
</h2>
{this.props.comment}
</div>
@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

@ricn
ricn / cmis.rb
Last active December 21, 2015 21:58
require 'cmis'
require 'rika'
atom_url = "http://localhost:8080/alfresco/cmisatom"
user = "admin"
password = "admin"
session = CMIS::create_session(atom_url, user, password)
root = session.root_folder
image_folder = root.create_cmis_folder("Images")
@ricn
ricn / nginx.conf
Last active December 19, 2015 23:59
worker_processes 5;
events {}
http {
upstream database {
postgres_server 127.0.0.1 dbname=test user=ricn password=mypass;
}
server {
listen 8080;
server_name localhost;
<project>
...
<profiles>
<profile>
<id>qa</id>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
@ricn
ricn / Description
Created July 26, 2012 12:51
Authentication from scratch with Play 2 and Java
User authentication is required in almost every web application. This guide shows you step by step how to implement authentication from scratch with Play 2 and Java.
require "rubygems"
require "mongoid"
Mongoid.configure do |config|
name = "mongoid_bug"
host = "localhost"
config.master = Mongo::Connection.new.db(name)
config.persist_in_safe_mode = false
end