Skip to content

Instantly share code, notes, and snippets.

View c0mrade's full-sized avatar

Emir Ibrahimbegovic c0mrade

  • VH
  • Remote
View GitHub Profile
@c0mrade
c0mrade / docker-destroy-all.sh
Created December 16, 2016 02:10 — forked from JeffBelback/docker-destroy-all.sh
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
docker stop $(docker ps -a -q)
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
@c0mrade
c0mrade / ruby_setup.md
Created June 7, 2016 20:15 — forked from julionc/ruby_setup.md
Deploy Ruby On Rails on Ubuntu 14.04

Deploy Ruby On Rails on Ubuntu 14.04

Server: Nginx with Phusion Passenger

Ruby Version: 2.1.3

User System: deploy

User System

require 'optparse'
ENV['RAILS_ENV'] = ENV['RAILS_ENV'] || 'development'
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
opts = {}
ARGV.options {|opt|
opt.on('-s', '--save', 'save') {|v| opts[:save] = v }
opt.parse!
@c0mrade
c0mrade / ability.rb
Last active August 29, 2015 14:14 — forked from hrdwdmrbl/ability.rb
class Ability
include CanCan::Ability
def marshal_dump
#blocks cannot be cached
@rules.reject{|rule| rule.instance_variable_get :@block }.map{|rule| Marshal.dump(rule) }
end
def marshal_load array
#blocks cannot be cached, so blocks must be re-defined
can :read, Comment do |comment|