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
RUNTIME=/home/snowmantw/debugmulet/firefox/firefox TEST_FILES=/home/snowmantw/debugmulet/gaia/apps/system/test/marionette/lockscreen_media_playback_test.js make test-integration-test | |
TEST_MANIFEST=/home/snowmantw/debugmulet/gaia/shared/test/integration/local-manifest.json npm run marionette -- --buildapp="desktop" --reporter="spec" | |
> gaia@0.0.3 marionette /home/snowmantw/debugmulet/gaia | |
> gaia-marionette "--buildapp=desktop" "--reporter=spec" | |
+ export MOZ_DISABLE_NONLOCAL_CONNECTIONS=1 | |
+ MOZ_DISABLE_NONLOCAL_CONNECTIONS=1 | |
+ SOURCE=/home/snowmantw/debugmulet/gaia/node_modules/.bin/gaia-marionette | |
+++ dirname /home/snowmantw/debugmulet/gaia/node_modules/.bin/gaia-marionette |
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
// "pure" version | |
[1, 2, 3, 4].reduce(function(acc, elem) { | |
var result = []; | |
// Generate multiple "elements". | |
for (var i = 0; i < elem; i++) { | |
result.push(i); | |
} | |
// And generate the new "array" as the new accumulator. | |
return acc.concat(result); | |
}, []) |
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
# truly curried function ! | |
add = (x)->(y)-> x()+y() | |
add4 = add(()->4) | |
console.log(add(()->4)(()->6)) | |
console.log(add4(()->6)) |
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
/* description: Parses end executes mathematical expressions. */ | |
/* lexical grammar */ | |
%lex | |
%% | |
\s+ { return 'SP'; } | |
"->" { return 'AR'; } | |
"(" { return 'LP'; } | |
")" { return 'RP'; } |
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
應該是在 toggle 設定時,雖然做了 names_node 去存父子的 name ,偵測反應時卻依然只是用 dom_name 這個單層者,沒有使用 names_node |
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::Matchers.define(:be_same_file_as) do |exected_file_path| | |
match do |actual_file_path| | |
md5_hash(actual_file_path).should == md5_hash(exected_file_path) | |
end | |
def md5_hash(file_path) | |
Digest::MD5.hexdigest(File.read(file_path)) | |
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
var t = ["3+3;console.log('abc');"] | |
var tb = new Blob(t, {"type": "text\/javascript"}); | |
w = new Worker(window.webkitURL.createObjectURL(tb)) |
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
location /newapi/no-op { | |
add_header Content-Type "application/json; charset=utf-8"; | |
return 200; | |
} |
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
Compute | |
.init( {:Xa => xa, :domain => domain, :uid => uid} ) | |
.wait("resource.scalar_product.Ra_ra",:Ra, :ra) #1. | |
.compute(:Xa_, lambda{ |m| add(m[:Xa], m[:Ra], m[:domain]) } ) #2. | |
.send("resource.scalar_product.Xa_", :Xa_) #3. | |
.wait("resource.scalar_product.Xb_", :Xb_) #4. | |
.wait("resource.scalar_product.t", :t) #5. | |
.compute( :yA, lambda{ |m| t1 = trans(m[:Xb_], m[:domain]) | |
t2 = mul(m[:Ra],t1, m[:domain]) | |
t3 = sub(m[:t] ,t2, m[:domain]) }) #6. |
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
t = fluorine.Environment({a: 1}) | |
.local(function(e){ return {'b': this.a+1}; }) | |
.async() | |
.local(function(data){ console.log('data');console.log(this.data);return this}) | |
.done().run() | |
// 重點:async 實作中設定了接續 run 的部份 | |
/* | |
// THIS FUNCTION IS ONLY FOR TEST ASYNC CALLS. |