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
| step 'the following category records' do |table| | |
| table.hashes.each do |hash| | |
| a = AttributeSet.find_or_create_by(slug: 'myattritubetest', label: 'myattributetest', description: 'myattributeset') | |
| if hash['parents'].present? | |
| path = hash['parents'].split(', ') | |
| ancestor = Category.find_or_create_by(title: path.shift, attribute_set_id: a.id) | |
| path.each_with_index do |ancestor_title, index| | |
| category = Category.find_or_create_by(title: ancestor_title, parent_id: ancestor.id, attribute_set_id: a.id) | |
| ancestor = category | |
| 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
| window.History.Adapter.bind window, 'statechange', -> | |
| State = window.History.getState() | |
| window.History.log State.data, State.title, State.url | |
| if State.data.content? | |
| $('.product-page').html(State.data.content) | |
| dimensions = ":input[name='size_id'], :input[name='color_id'], :input[name='config_id']" | |
| window.History.replaceState { content: $('.product-page').html() }, null, window.location |
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
| --- /Users/andrew/Work/Rejuvenation/web/vendor/assets/javascripts/cloud-zoom.js Mon Jan 9 14:09:04 2012 | |
| +++ /Users/andrew/Work/Rejuvenation/web/vendor/assets/javascripts/cloud-zoom.js Tue Jan 17 20:01:30 2012 | |
| @@ -20,20 +20,19 @@ | |
| function CloudZoom(jWin, opts) { | |
| var sImg = $('img', jWin); | |
| - var img1; | |
| - var img2; | |
| + var img1; | |
| + var img2; |
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/init/project-web-reload.conf | |
| pre-start script | |
| initctl restart project-web | |
| sleep 15 | |
| end script | |
| exec /usr/local/rvm/bin/default_bluepill restart |
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
| import sublime, sublime_plugin | |
| import os | |
| class DetectFileTypeCommand(sublime_plugin.EventListener): | |
| """ Detects current file type if the file's extension isn't conclusive """ | |
| """ Modified for Ruby on Rails and Sublime Text 2 """ | |
| """ Original pastie here: http://pastie.org/private/kz8gtts0cjcvkec0d4quqa """ | |
| def on_load(self, view): | |
| filename = view.file_name() |
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 'stalker' | |
| stalker_config_file = File.join(Rails.root, 'config', 'stalker.yml') | |
| if File.file?(stalker_config_file) | |
| environment = defined?(Rails) && Rails.respond_to?(:env) ? Rails.env : ENV["RACK_ENV"] | |
| settings = YAML.load(ERB.new(File.new(stalker_config_file).read).result)[environment] | |
| if settings.present? | |
| begin | |
| Stalker.connect(settings['beanstalk_url']) |
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
| # ruby -rmongoid destructive_class_methods.rb | |
| class DestructiveClassMethods | |
| include Mongoid::Document | |
| end | |
| File.open('destructive_class_methods.txt', 'wb') do |f| | |
| DestructiveClassMethods.methods.sort.each do |method| | |
| f.puts method | |
| 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
| import sublime, sublime_plugin | |
| import os | |
| class DetectFileTypeCommand(sublime_plugin.EventListener): | |
| """ Detects current file type if the file's extension isn't conclusive """ | |
| """ Modified for Ruby on Rails and Sublime Text 2 """ | |
| """ Original pastie here: http://pastie.org/private/kz8gtts0cjcvkec0d4quqa """ | |
| def on_load(self, view): | |
| filename = view.file_name() |
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 'formula' | |
| class Beanstalk < Formula | |
| homepage 'http://kr.github.com/beanstalkd/' | |
| url 'https://github.com/downloads/kr/beanstalkd/beanstalkd-1.8.tar.gz' | |
| sha1 'b8c274d7233e02c6793d8d119608ad7c878b0954' | |
| def install | |
| system "make", "install", "PREFIX=#{prefix}" | |
| 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
| import sublime, sublime_plugin | |
| import os | |
| class DetectFileTypeCommand(sublime_plugin.EventListener): | |
| """ Detects current file type if the file's extension isn't conclusive """ | |
| """ Modified for Ruby on Rails and Sublime Text 2 """ | |
| """ Original pastie here: http://pastie.org/private/kz8gtts0cjcvkec0d4quqa """ | |
| def on_load(self, view): | |
| filename = view.file_name() |