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
def create_popup(discipline) | |
if discipline.short_description.present? | |
options = {:content => discipline.short_description, "original-title" => t("discipline.short_description_title"), | |
:trigger => "hover" } | |
end | |
content_tag(:div, :data => options ) do | |
discipline.name | |
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
$(".pagination").each -> | |
parent_width = $(this).parent().width() | |
pwidth = $(this).width() | |
align = (parent_width - pwidth) / 2 | |
$(this).css "margin-left", align |
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
# Method for grouping users by the day (for postgresql): | |
User.order("DATE(created_at)").group("DATE(created_at)").count |
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
head | |
title = content_for?(:title) ? yield(:title) : 'Nathaniel Paul' | |
meta charset="utf-8" | |
meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" | |
meta name="viewport" content="width=device-width, maximum-scale=1, initial-scale=1, user-scalable=0" | |
meta name="description" content="#{content_for?(:description) ? yield(:description) : 'Nathaniel Paul description text'}" | |
meta name="keywords" content="#{content_for?(:keywords) ? yield(:keywords) : 'Nathaniel Paul, designer, emerged'}" |
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
cd ~ | |
sudo apt-get update | |
sudo apt-get install openjdk-7-jre-headless -y | |
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below | |
# NEW WAY / EASY WAY | |
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.1.0.deb | |
sudo dpkg -i elasticsearch-1.1.0.deb |
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
// Create /app/assets/javascripts/ckeditor/config.js file: | |
CKEDITOR.editorConfig = function( config ) | |
{ | |
config.toolbar = 'MyToolbar'; | |
config.toolbar_MyToolbar = | |
[ | |
{ name: 'document', items : [ 'NewPage','Preview' ] }, | |
{ name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] }, |
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
function AutoCompleteEditor(args) { | |
var $input; | |
var defaultValue; | |
var scope = this; | |
var calendarOpen = false; | |
this.init = function () { | |
$input = $("<INPUT type=text class='editor-text' />"); | |
$input.appendTo(args.container); |
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
# First connect to DB with needed sql data | |
class T < ActiveRecord::Base | |
establish_connection({adapter:'mysql2', database:'db_for_test', encoding:'utf8',user:'', password: ''}) | |
set_table_name 'utility_company' | |
end | |
CSV.open("data.csv", "wb") do |csv| | |
csv << T.first.attribute_names # adds the attributes name on the first line | |
T.all.each do |hash| |
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
# Not breaking the page but continue on the next column | |
# Example of 2 columns table with some styling | |
def render_left_products_list | |
column_box([-5, cursor], columns: 2, height: cursor, position: :left, width: bounds.width, spacer: 40) do | |
@categories.each do |category| | |
move_down 6 | |
table line_item_rows(category), position: :left, cell_style: { size: 7, text_color: "000000", borders: [:bottom], border_lines: [:dotted], padding: [2, 0, 4, 0] } do | |
column(1).style align: :right | |
style(row(0), text_color: 'FF0000') |
OlderNewer