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
#!/usr/bin/env ruby | |
require 'octokit' | |
project = ARGV[0] | |
if project.nil? | |
puts 'project is empty' | |
abort | |
end | |
client = Octokit::Client.new(:access_token => "") | |
# Create repo |
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 is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
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
def filename | |
if original_filename | |
if model && model.read_attribute(mounted_as).present? | |
model.read_attribute(mounted_as) | |
else | |
"#{SecureRandom.hex}.#{File.extname(file.filename)}" | |
end | |
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
// outside the scope of the jQuery plugin to | |
// keep track of all dropdowns | |
var $allDropdowns = $(); | |
// if instantlyCloseOthers is true, then it will instantly | |
// shut other nav items when a new one is hovered over | |
$.fn.dropdownHover = function(options) { | |
// the element we really care about | |
// is the dropdown-toggle's parent |
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
RSpec.configure do |config| | |
config.after(:each) do | |
if example.exception && example.metadata[:js] | |
meta = example.metadata | |
filename = File.basename(meta[:file_path]) | |
line_number = meta[:line_number] | |
screenshot_name = "screenshot-#{filename}-#{line_number}.png" | |
screenshot_path = "#{Rails.root.join("tmp")}/#{screenshot_name}" | |
page.save_screenshot(screenshot_path) |
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
ru: | |
activerecord: | |
theme/posts: | |
text: Содержание # theme[posts][text] |
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
For Apache, use the Location directive into your virtual host(be sure you have included expires and headers modules) | |
<LocationMatch "^/assets/.*$"> | |
Header unset ETag | |
FileETag None | |
ExpiresActive On | |
ExpiresDefault "access plus 30 days" | |
</LocationMatch> | |
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 up heroku app | |
heroku git:remote -a app_name | |
# Create db backup | |
heroku pgbackups:capture | |
# Download last db backup | |
curl -o latest.dump `heroku pgbackups:url` | |
# Restore local base from Heroku |
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
load 'deploy' | |
# Uncomment if you are using Rails' asset pipeline | |
load 'deploy/assets' | |
load 'config/deploy' # remove this line to skip loading any of the default tasks |
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
wget repos.1c-bitrix.ru/yum/bitrix-env.sh | |
chmod +x bitrix-env.sh | |
./bitrix-env.sh | |
Email settings: | |
http://dev.1c-bitrix.ru/learning/course/?COURSE_ID=48&LESSON_ID=2946&LESSON_PATH=3918.4635.4739.4796.2946 |