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 expect from 'expect'; | |
class ExpectAsync { | |
constructor(promise) { | |
this.promise = promise; | |
} | |
async toBeRejectedWith(error) { | |
try { | |
await Promise.resolve(this.promise); |
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 'babel-polyfill'; | |
import ModelA from '../../../src/models/ModelA'; | |
import expectModel from '../expect/expectModelFactory'; | |
import testAsync from '../helper/testAsync'; | |
import dbHelper from '../helper/db'; | |
import contentDummy from '../dummy/contentDummy'; | |
describe('Unit Test: models/ModelA', () => { | |
beforeEach(testAsync(async () => { |
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 toLower = require('lodash.tolower'); | |
const toSelector = (elem) => { | |
let selector = ''; | |
const tagName = toLower(elem.tagName); | |
const attributes = elem.attributes; | |
selector += tagName; |
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 keyMaker(namespace, obj) { | |
const composed = {}; | |
const keys = Object.keys(obj); | |
keys.forEach((key) => { | |
composed[key] = `${namespace}:${key}`; | |
}); | |
return composed; | |
} |
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 promisify(fn) { | |
return (...args) => new Promise((resolve, reject) => { | |
const callback = (err, ...results) => { | |
if (err) reject(err); | |
else if (results.length === 1) resolve(results[0]); | |
else resolve(results); | |
}; | |
fn(...args.concat(callback)); | |
}); |
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 btn1() { | |
var boxes = document.getElementsByClassName('box'); | |
for (var i = 0; i < 8; i += 2) { | |
boxes[i].style.visibility = "hidden"; | |
} | |
} | |
function btn2() { | |
var boxes = document.getElementsByClassName('box'); |
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
// 4주차 답안 예시 | |
var danCheck = /^[1-9]{1}$/; | |
/* | |
>>How to check the input<< | |
danCheck.test(input) | |
[input: number] |
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 charset="UTF-8"> | |
<title>keycode</title> | |
<style> | |
body{ | |
background-size:cover; | |
} | |
#wrapper{ |
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 charset="UTF-8"> | |
<title>mouse position</title> | |
<style> | |
#canvas{ | |
border:1px solid black; | |
height: 1000px; | |
} |
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 charset="UTF-8"> | |
<title>Slide</title> | |
<style> | |
body{ | |
margin: 0px; | |
font-size:16pt; | |
font-weight: bold; |
OlderNewer