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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
// 2. Given the following wheels and categories. Write a function named “wheelsWithCategories” | |
// that produces the result below. | |
const wheels = { | |
wheels: [ | |
{ | |
wheelID: 1, | |
wheelCategory: 'OffRoad' | |
wheelName: 'OffRoad One' | |
}, |
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
// 1. Given an array of five integers in ascending order, | |
// write a function called “transform” that takes the array, | |
// multiplies each integer by 10, and produces a new array | |
// of strings in descending order. | |
let items = [1, 2, 3, 4, 5]; | |
// Output | |
console.log(transform(items)); |
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 '[clojure.walk :as walk]) | |
(defn update-values | |
"Replaces all values in a map with the results of a function" | |
[m f & args] | |
(let [f (fn [[k v]] (if (map? v) [k v] [k (apply f v args)]))] | |
(walk/prewalk (fn [x] (if (map? x) (into {} (map f x)) x)) m))) | |
(update-values {:a 1 :b 1} + 10) |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Ansi 0 Color</key> | |
<dict> | |
<key>Blue Component</key> | |
<real>0.073354568467785999</real> | |
<key>Green Component</key> | |
<real>0.081447963800905021</real> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Ansi 0 Color</key> | |
<dict> | |
<key>Blue Component</key> | |
<real>0.098313517868518829</real> | |
<key>Green Component</key> | |
<real>0.11400297284126282</real> |
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
# Deployment uses SFTP by default when you use deploy_via :copy, and there | |
# doesn't seem to be any way to configure it. Unfortunately, we don't run | |
# SFTP on our servers, so it fails. This forces it to use SCP instead. | |
# http://www.capify.org/index.php/OverridingTaskCommands | |
# | |
module UseScpForDeployment | |
def self.included(base) | |
base.send(:alias_method, :old_upload, :upload) | |
base.send(:alias_method, :upload, :new_upload) | |
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
namespace :deploy do | |
namespace :torquebox do | |
task :deployment_descriptor do | |
puts "creating deployment descriptor" | |
dd_str = YAML.dump_stream( create_deployment_descriptor(latest_release) ) | |
dd_file = "#{jboss_home}/standalone/deployments/#{application}-knob.yml" | |
deploy_knob = "" | |
dd_str.each_line do |line| | |
deploy_knob << line | |
end |