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 XMLBuilder | |
def initialize | |
@d = {} | |
end | |
def to_xml | |
@d | |
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
// https://vuejs.org/v2/guide/instance.html | |
// | |
// | |
//function Vue(opts){ | |
//for(var key in opts.data){ | |
//this[key] = opts.data[key] | |
//} | |
//} | |
function Vue(opts){ | |
this._data = opts.data; |
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
const Watcher = require('./watcher'); | |
const noop = function () {}; | |
const sharedPropDef = { | |
enumerable: true, | |
configurable: true, | |
get: noop, | |
set: noop | |
}; |
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 Watcher { | |
constructor(vm, valueFn) { | |
this.vm = vm; | |
this.getter = valueFn; | |
this.value = this.get(); | |
} | |
get() { | |
let value; |
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
let myLib = (function(){ | |
this.libName = 'in lib'; | |
let obj = { | |
libName: 'in obj', | |
toCaps() { | |
return this.libName.toUpperCase(); | |
} | |
}; |
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
def solution(a) | |
total = a.size | |
lindex = a.size-1 | |
sorted = a.sort | |
min = total | |
combos = [] | |
return 0 if a == sorted | |
(2..total).each do |pair_size| |
OlderNewer