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
var pipelines = $H({}); | |
var stats = { | |
pipelineCount: 0, | |
stageCount: 0, | |
stageHasOneJobCount: 0, | |
stageHasMultipleJobCount: 0 | |
} | |
$j.ajax({url: "/go/cctray.xml", dataType: "xml"}).done(function(data) { | |
$j(data).find("Project").each(function(i, e) { | |
var job = $j(e).attr("name").split(" :: "); |
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
PS1='\u@\h \W$(__git_ps1 "(%s)[$(git config --get user.name)]")\$ ' | |
PS1='\h \W$(__git_ps1 "($(git config --get user.name)@%s)")\$ ' |
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
require 'fileutils' | |
require 'yaml' | |
require 'erb' | |
module PlatformConfig | |
def load(config_yml) | |
unless File.exists?(config_yml) | |
FileUtils.cp("#{config_yml}.example", config_yml) | |
end | |
if platform_config = YAML.load(ERB.new(File.read(config_yml)).result)[RUBY_PLATFORM] |
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 this file before load anything. | |
# JRuby-Rack will load rack before load rails, so should load this file when JRuby runtime initialized. | |
# Call AutoloadThreadsafe.eager_load_all! at the end of rails environment rb | |
module AutoloadThreadsafe | |
module Recorder | |
def self.included(base) | |
base.class_eval do | |
alias :unsafe_autoload :autoload | |
def autoload(m, filename) |
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
import static org.jruby.javasupport.JavaEmbedUtils.invokeMethod; | |
import org.jruby.Ruby; | |
import org.jruby.runtime.builtin.IRubyObject; | |
public class JRubyObject { | |
public static JRubyObject load(Ruby runtime, String dump) { | |
return new JRubyObject(((IRubyObject) marshalClass(runtime).send("load", dump))); | |
} |
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
//find out caller's class name (found from log5j) | |
public static void xxx() { | |
String name = new Exception().getStackTrace()[1].getClassName(); | |
.... | |
} | |
// or | |
String name = Thread.currentThread().getStackTrace()[3].getClassName() |
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
# How to find out where a method comes from. | |
# Learned this from Dave Thomas while teaching Advanced Ruby Studio | |
# Makes the case for separating method definitions into | |
# modules, especially when enhancing built-in classes. | |
module Perpetrator | |
def crime | |
end | |
end | |
class Fixnum |
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
class YourModule::Parser | |
options no_result_var | |
... |
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
common: | |
phoenix_mode: true #default to false | |
environments: | |
dev: | |
phoenix_mode: false # turn off for dev env for faster deployment | |
strategy: inplace-update # default strategy: blue-green | |
option_settings: | |
- namespace: aws:elb:loadbalancer | |
option_name: SSLCertificateId |
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
components: | |
- name: bg | |
strategy: inplace-update | |
option_settings: | |
- namespace: aws:autoscaling:asg | |
option_name: MinSize | |
value: "1" | |
- namespace: aws:autoscaling:asg | |
option_name: MaxSize | |
value: "1" |
NewerOlder