Skip to content

Instantly share code, notes, and snippets.

View VictorTpo's full-sized avatar

Victor Thépaut VictorTpo

View GitHub Profile
@VictorTpo
VictorTpo / Git cmd.md
Last active December 28, 2015 21:29
Resume of git command

BRANCH

Recover branch ``` git checkout master git pull git checkout new_branch ```

Download remote branch

@VictorTpo
VictorTpo / Notre Code.md
Last active December 30, 2015 22:29
Une prière afin que la mise en prod' se passe bien.

Notre Code

Qui est en prod

Que Tes Classes soient compilées

Que Tes Tests viennent

Que Tes TDD soient fait sur la prod' comme en dev'

Errors process

Follow those instructions to fix some errors which happen on the server

Fail to save database

ssh remote_server

crontab -e # to see the syntax of all tasks
rvm use # server need to reload the rvm environment

##Merge many has_many

def get_fb_users
	FacebookUser.from("
		(
			(
				#{self.facebook_recipients_users.to_sql}
			) union (
				#{self.facebook_users.to_sql}
			)

#CAPISTRANO CMD

####Deploy current branch

> cap <ENV> deploy

####Maintenance

> cap <ENV> maintenance:on REASON='foo bar' ALLOWED_IPS='xxx.xxx.xx.xxx'
> top
# see all process
> ps -fp p_id
> df -k
# free space of disks

Faye & Rails 4

This gist describes how to implement faye with a rails 4 application.

What I want ?

A user receives a live notification when another user login.

Requirements

A rails 4 application with devise for user management

2 gems:

  • Apache conf
  • Enable URL with OVH

Apache conf

cd /etc/apache2/sites-available

touch my-url.domaine.com.conf

Create mails with a new domain name

go to http://www.google.fr/intl/fr/enterprise/apps/business/products/gmail/

###Account Start it, fill fields...

###Check the domain Go to configuration, and valid the 2 first steps #####Step "google-site-verification" : On OVH, go to your domain, DNS area, add new entry. Choose TXT and set the value with google-site-verification=a_really_fat_string.

{
"always_show_minimap_viewport": true,
"color_scheme": "Packages/User/enlightened.tmTheme",
"default_line_ending": "unix",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"font_face": "Source Code Pro for Powerline",
"font_size": 14,
"highlight_modified_tabs": true,
"rulers": [80],