This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| lib/oleku/presentation.rb | |
| ----------------------------------------------- | |
| module Oleku | |
| module Presentation | |
| module Video | |
| def self.included base | |
| base.send :include, InstanceMethods | |
| end | |
| module InstanceMethods | |
| def method_missing( meth, *args, &block) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ sudo aptitude install apache2 dnsmasq | |
| $ sudo vim /etc/dnsmasq.conf | |
| # ... | |
| address=/dev/127.0.0.1 | |
| listen-address=127.0.0.1 | |
| $ sudo vim /etc/dhcp3/dhclient.conf | |
| # uncomment line 20: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %w(buy rent).each do |a| | |
| define_method "user_#{a}_movies" do | |
| instance_variable_get(:"@#{a}_movies").blank? ? instance_variable_set( :"@#{a}_movies", PublicActivity::Activity.where(owner_id: User.current.id, owner_type: "User", key: "video.#{a}")) : instance_variable_get(:"@#{a}_movies") | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| VICTOR_VI_COMMAND=("vthis" "vmo" "vco" "view" "vconf" "vasset") | |
| VICTOR_VI_PATH=("." "app/models/" "app/controllers/" "app/views/" "config/" "app/assets/") | |
| tLen=${#VICTOR_VI_COMMAND[@]} | |
| tfunc="$HOME/.tmp/t1" | |
| function vi_init(){ | |
| for ((i=0; i < ${tLen}; i++)); | |
| do | |
| ( | |
| echo "function \$VICTOR_VI_COMMAND[\$i]" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #get_host=`pwd` | |
| PROMPT='$fg[cyan] %m $fg[blue] © git: $(git_prompt_status) $fg[yellow] rvm: $(rvm current) $fg[red] $USER $fg[green]. | |
| → $reset_color' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mk_setup_backup(){ | |
| if [ "$#" -ne 1 ] | |
| then | |
| echo "Error!!!" | |
| exit | |
| else | |
| mkdir -p $HOME/local_backups/$1 | |
| d_path=`pwd` | |
| cd $HOME/local_backups/$1 | |
| git init --bare |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class VideosController < ApplicationController | |
| before_filter :video, only: [:show, :edit, :update, :watch, :buy, :rent] | |
| def update | |
| authorize! :update, @video | |
| if @video.update_attributes params[:video] | |
| redirect_to @video | |
| else | |
| render :edit | |
| end | |
| end |
NewerOlder