Command Line
pry -r ./config/app_init_file.rb
- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb
- load your rails into a pry session
Debugger
" http://www.github.com/rwilhelm/dotfiles/vimrc | |
" Tue Jun 17 01:33:55 CEST 2014 | |
" 2007-2014 (c) [email protected] | |
set nocompatible | |
filetype off | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() |
########## CASE IN UPDATE STATEMENT ############ | |
from sqlalchemy import case | |
# single value modification (the 'else' is not mandatory) | |
session.query(User).update({User.status : case([(User.status == "pending", "approved")], else_=User.status)}, False) | |
# multiple values modification | |
session.query(User).update({User.status : case([(User.status == "pending", "approved"), | |
(User.status == "waiting", "deprecated_status")])}, False) |
Command Line
pry -r ./config/app_init_file.rb
- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb
- load your rails into a pry sessionDebugger
# Add the following 'help' target to your Makefile | |
# And add help text after each target name starting with '\#\#' | |
help: ## Show this help. | |
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' | |
# Everything below is an example | |
target00: ## This message will show up when typing 'make help' | |
@echo does nothing |
import sqlalchemy as sa | |
import sqlalchemy.orm as orm | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.ext.declarative import declared_attr | |
from sqlalchemy.orm import scoped_session, sessionmaker | |
DBSession = scoped_session(sessionmaker()) | |
class BaseMixin(object): | |
query = DBSession.query_property() | |
id = sa.Column(sa.Integer, primary_key=True) |
!!! Strict | |
%html{:xmlns => "http://www.w3.org/1999/xhtml"} | |
%head | |
%meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type"}/ | |
%meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"}/ | |
%title Your Message Subject or Title | |
:css | |
/* Based on The MailChimp Reset INLINE: Yes. */ | |
/* Client-specific Styles */ | |
#outlook a {padding:0;} /* Force Outlook to provide a "view in browser" menu link. */ |