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
Rails.application.config.assets.paths |
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
$('.typeahead').focus().typeahead('val', '').focus().typeahead('val', 'what ever value you want to test'); |
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
require 'csv' | |
csv_text = File.read('...') | |
csv = CSV.parse(csv_text, :headers => true) | |
csv.each do |row| | |
Model.create!(row.to_hash) | |
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
var distance_of_time_in_words, time_ago_in_words; | |
time_ago_in_words = function(from_time, include_seconds) { | |
if (include_seconds != null) { | |
include_seconds; | |
} else { | |
include_seconds = false; | |
}; | |
return App.distance_of_time_in_words(from_time, Date.now(), include_seconds); | |
}; | |
distance_of_time_in_words = function(from_time, to_time, include_seconds) { |
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
module PageFunctions | |
include Capybara::DSL | |
def in_browser(name) | |
old_session = Capybara.session_name | |
Capybara.session_name = name | |
yield | |
Capybara.session_name = old_session |
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
# /etc/logrotate.d/<logrotate_file> | |
/home/ubuntu/<folder>/shared/log/*.log { | |
daily | |
missingok | |
rotate 1 | |
compress | |
notifempty | |
copytruncate | |
su ubuntu ubuntu | |
} |
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
# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file | |
# | |
# To ban all spiders from the entire site uncomment the next two lines: | |
User-agent: libwww-perl | |
User-agent: Rogerbot | |
User-agent: Exabot | |
User-agent: MJ12bot | |
User-agent: Dotbot | |
User-agent: Gigabot | |
User-agent: AhrefsBot |
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
JS_PATH = 'app/assets/javascripts/**/*.js' | |
Dir[JS_PATH].each do |file| | |
begin | |
Uglifier.compile(File.read(file)) | |
rescue => e | |
puts e.message | |
puts file | |
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
server { | |
listen 443 ssl; | |
server_name domain.com; | |
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; | |
ssl_certificate /etc/ssl/certs/domain.crt; | |
ssl_certificate_key /etc/ssl/certs/domain.key; | |
ssl on; |
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
Typical setup process of a React project on Node |