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
| namespace :update do | |
| task :services do | |
| REPOS.each do |repo_path| | |
| uncommitted_files = `cd #{repo_path} && git status --porcelain | wc -l`.strip.chomp.to_i | |
| if uncommitted_files == 0 | |
| puts "Updating #{repo_path} ..." | |
| puts `cd #{repo_path} && BUNDLE_GEMFILE=#{repo_path}/Gemfile bundle update config-gem` |
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
| namespace :update do | |
| task :services do | |
| REPOS.each do |repo_path| | |
| uncommitted_files = `cd #{repo_path} && git status --porcelain | wc -l`.strip.chomp.to_i | |
| if uncommitted_files == 0 | |
| puts "Updating #{repo_path} ..." | |
| puts `cd #{repo_path} && bundle update config-gem` |
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
| .box { | |
| padding: 10px; | |
| ... | |
| &.is-active { | |
| } | |
| &.is-inactive { | |
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
| <div class='box box-light'> | |
| <div class='box-title'>...</div> | |
| <div class='box-inner'>...</div> | |
| </div> |
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 Header = (function(w,d,undefined)){ | |
| var _elem = null; | |
| var bindButtons = function(){ | |
| $(document).on('click', _elem.find(".js-toggle-sidebar"), function(){ | |
| Sidebar.toggle(); // | |
| }); | |
| } | |
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.confirm = function() { | |
| console.log.apply(console, arguments); return true; | |
| }; | |
| $(".host_status[data-traffic_light_level=3], .host_status[data-traffic_light_level=4]").each(function(i,el){ | |
| var p = $(this).parent(); | |
| var del = $(p).find(".delete_link.to_spinner"); | |
| var no_data = $(p).find(".no_data").length > 0; | |
| if(no_data && del.length > 0){ | |
| setTimeout(function() { | |
| console.log($(p).find(".app_name").text()); |
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
| # name: rick | |
| # description: The best bolt | |
| # keyword: rick | |
| result(title:"rick", description:"No strangers to love", action: actions.open("http://www.youtube.com/watch?gl=GB&hl=en-GB&v=oHg5SJYRHA0")) |
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
| <?php | |
| class WP_Customize_Category_Control extends WP_Customize_Control { | |
| public $type = 'dropdown-category'; | |
| public function render_content() { | |
| $dropdown = wp_dropdown_categories(array( | |
| "selected" => $this->value(), | |
| "name" => $this->settings["default"]->id, | |
| "echo" => 0 | |
| )); |
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
| # array of arrays | |
| a = [[10, 1000], [9, 923], [8, 1230], [7, 10]] # [data,frequency] | |
| mean = a.reduce(0) { |m,r| m += r[0] * r[1] } / a.reduce(0) { |m,r| m += r[1] }.to_f |