This file contains 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 ApplicationController < ActionController::Base | |
layout :app_layout | |
def app_layout | |
if something == "some_other_thing" | |
"some_layout" | |
else | |
"application" | |
end | |
end |
This file contains 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
layout Proc.new{ ['edit', 'create'].include?(action_name) ? 'application' : 'cms' } |
This file contains 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
set :application, "myapp-name" | |
set :repository, "." | |
set :deploy_via, :copy | |
set :scm, :git | |
set :branch, "master" | |
set :user, "ubuntu" | |
set :use_sudo, false |
This file contains 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
# This example show how to integrate "South" into your exiting Django projects | |
# South - intelligent schema and data migrations for Django projects. | |
# Install South from pip | |
$ sudo pip install South | |
# Run the sysncdb | |
$ python manage.py syncdb | |
# Do an initial migration |
This file contains 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
SELECT name, modify_date | |
FROM sys.objects | |
WHERE type = 'P' order by modify_date desc | |
SELECT name, modify_date | |
FROM sys.tables | |
order by modify_date desc |
This file contains 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
<meta name="viewport" content=""> | |
<!-- | |
Within the content="" you can enter a load of comma delimited values, but we’re going to to focus on the fundamental ones for now. | |
--> | |
<!-- | |
For example, if your mobile design is purposely laid out at 320px you can specify the viewport width: | |
--> |
This file contains 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
Select DISTINCT t1.* from table1 t1 INNER JOIN( | |
SELECT table2_col_1 ,table2_col_2, table2_col_3 from table2 t2 | |
) temp_table | |
ON t1.Id = temp_table.table2_col_1 OR t1.id = temp_table.table2_col_2 OR t1.id = temp_table.table2_col_3 | |
Select DISTINCT t.* from topics t INNER JOIN( | |
SELECT topic_one ,topic_two, topic_three from entries e WHERE e.politician_id = 3 | |
) temp_table | |
ON t.Id = temp_table.topic_one OR t.id = temp_table.topic_two OR t.id = temp_table.topic_three |
This file contains 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
<%= f.grouped_collection_select :parent_id, Characteristic.roots, :children, :name, :id, :name, {:include_blank => true}%> |
This file contains 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
@import "bootstrap"; | |
body { padding-top: 60px;} | |
@import "bootstrap-responsive"; | |
@media (max-width: 767px) { | |
.sidebar-nav-fixed { | |
width:auto; | |
} | |
} |
This file contains 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
<header class="navbar navbar-fixed-top"> | |
<nav class="navbar-inner"> | |
<div class="container"> | |
<a data-toggle="collapse" data-target=".nav-collapse" class="btn btn-navbar"> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
</a> | |
<a class="brand" href="/?locale=en">manthri.lk</a> | |
<ul class="nav nav-collapse in collapse" style="height: 80px;"> |