Skip to content

Instantly share code, notes, and snippets.

View darkofabijan's full-sized avatar

Darko Fabijan darkofabijan

View GitHub Profile
resources :containers
namespace :admin do
resources :containers
end
containers GET /containers(.:format) containers#index
POST /containers(.:format) containers#create
new_container GET /containers/new(.:format) containers#new
edit_container GET /containers/:id/edit(.:format) containers#edit
@darkofabijan
darkofabijan / speaker.md
Last active August 29, 2015 13:57 — forked from matiaskorhonen/speaker.md
Creating a blog in 15 minutes with Phoenix

Darko Fabijan

Contact details

Speaker bio

I am developer and cofounder of Rendered Text, a company that you might know by Semaphore, hosted continuous integration service. I have been working with Rails since 2008, and got pushed into distributed systems arena while trying solve problems of fault-tolerant nodes, realtime updates and fast multi-node deployments that we were facing on Semaphore. While exploring distributed systems I discovered Elixir and joined the Phoenix core team.

@darkofabijan
darkofabijan / install.sh
Last active August 29, 2015 14:09
Upgrade phantomjs
sudo rm -rf /usr/local/phantomjs-1.9.7-linux-x86_64/bin/phantomjs
sudo rm -rf /usr/local/bin/phantomjs
curl -OL https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2
sudo tar -xjf phantomjs-1.9.8-linux-x86_64.tar.bz2 -C /usr/local/
sudo ln -s /usr/local/phantomjs-1.9.8-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs
rm -rf phantomjs-1.9.8-linux-x86_64.tar.bz2
@darkofabijan
darkofabijan / cs.md
Last active August 29, 2015 14:17
C# instalation

Add following lines to your build commands:

sudo apt-add-repository -y ppa:ermshiperete/monodevelop
sudo apt-get install -y monodevelop
class Longtail
attr_accessor :model
attr_accessor :field
def initialize(options)
@model = options[:model]
@field = options[:field]
end
def fetch
Factory.define :application do |factory|
factory.attachment(:sample, "public/samples/sample.doc", "application/msword")
end
class Api::V2::MunicipalitiesController < Api::V2::BaseController
def index
municipalities = Municipality.find_all_for_api
@municipalities = municipalities.collect { |m| {:id => m.id, :name => m.name} }
render_json(@municipalities)
end
end
@darkofabijan
darkofabijan / user.rb
Created February 22, 2012 12:17 — forked from miloshadzic/user.rb
class User < ActiveRecord::Base
def find_form(id)
company.forms.find(id)
end
end
class User < ActiveRecord::Base
def forms
Form.where(:company => company)
end
def find_form(id)
forms.find(id)
end
end
sudo apt-get install mercurial
hg clone https://vim.googlecode.com/hg/ vim
cd vim
./configure --enable-rubyinterp --enable-gui=no
make
sudo make install