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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
</head> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html;charset=utf-8"> | |
<style> | |
textarea{ | |
padding: 5px; | |
font-size: 14px; | |
height: 14px; | |
line-height: 1; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
<script src='test_1.js'></script> | |
</head> | |
<body> | |
<div id="mvvm-app"> | |
<input type="text" v-model="word"> |
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 str = 'abc'; | |
var nStr = str.replace(/\w/g,function(m,offset,s){ | |
return (offset ? '-' : '') + m.repeat(offset+1).replace(/(\w)/,(m)=>m.toUpperCase()); | |
}) | |
console.log(nStr); | |
// A-Bb-Ccc |
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
function isArray(obj){ | |
if(Array.prototype.isArray){ | |
return Array.prototype.isArray(obj) | |
} | |
return Object.prototype.toString.call(obj) === '[object Array]' | |
} |
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 flatten = (function(){ | |
var result = []; | |
var _innerFlatten = function(arr){ | |
if(arr.length === 0){ | |
return []; | |
} | |
arr.forEach(item => { | |
console.log(item) | |
console.log('>>>') | |
if(isArray(item)){ |
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
'use strict'; | |
function deepMerge(){ | |
let args = [].slice.call(arguments); | |
let target = args.shift(); | |
let sources = args; | |
if(sources.length == 0){ | |
return target; | |
} | |
else { |
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
# encoding: UTF-8 | |
#!/usr/bin/env ruby | |
Dir.chdir('_posts') do | |
Dir.glob('*.markdown') do |filename| | |
File.open(filename, mode: 'r+:UTF-8') do |file| | |
content = file.read(file.size) | |
# date = content.match(/date: (\d+-\d+-\d+)/) | |
# if date.nil? | |
# puts 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>particle</title> | |
<style> | |
body { | |
margin: 0; | |
padding: 0; | |
} |
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
#!usr/bin/env ruby | |
class BST | |
def initialize | |
end | |
def get key | |
node = _get(root, key) | |
node ? node.val : node | |
end |