Skip to content

Instantly share code, notes, and snippets.

View sorie's full-sized avatar
💭
I may be slow to respond.

lala sorie

💭
I may be slow to respond.
  • Seoul or Jeju island
View GitHub Profile
@sorie
sorie / newdevices.js
Last active October 13, 2021 01:44
es6 map example
const devices = [
{"deviceId":"default","kind":"audioinput","label":"기본값 - 마이크(Realtek Audio)","groupId":"2fc5a70356cd629dff0f57c8c5b420757f34b7f60a40184617607bdf125025f8"},
{"deviceId":"communications","kind":"audioinput","label":"커뮤니케이션 - 마이크(Realtek Audio)","groupId":"2fc5a70356cd629dff0f57c8c5b420757f34b7f60a40184617607bdf125025f8"},{"deviceId":"80f28f21743218d1430300452892a9272426095e48d4ddd344bef16a57e2d7cb","kind":"audioinput","label":"마이크(Realtek Audio)","groupId":"2fc5a70356cd629dff0f57c8c5b420757f34b7f60a40184617607bdf125025f8"},{"deviceId":"7fb6410182a2ef6910e68e942dfa9bd4f29350f391599099ed1563ab6e7ac185","kind":"videoinput","label":"Integrated Webcam (0bda:5689)","groupId":"80117ee788b9447605cce20ce90cefec3f387bb62f2df256e2a1559dac667d41"},{"deviceId":"7fb6410182a2ef6910e68e942dfa9bd4f29350f391599099ed1563ab6e7ac185","kind":"videoinput","label":"test Webcam (0bda:5689)","groupId":"80117ee788b9447605cce20ce90cefec3f387bb62f2df256e2a1559dac667d41"},
@sorie
sorie / quiz.js
Created August 12, 2021 05:02
remove duplicates!
const array = ['dog','cat','fox','dog','hols','cat'];
console.log(array);
console.log([...new Set(array)]);
@sorie
sorie / loops.js
Created August 12, 2021 01:57
javascript tip : loops
//Looping
const items = [1,2,3,4,5,6];
function getAllEvents(items) {
//good code
return items.fillter(num => num % 2 === 0);
//bad code
//const result = [];
//for (let i = 0; i < items.length; i++) {
@sorie
sorie / template-literals.js
Created August 12, 2021 01:44
javascript tip : template-literals.
//Template Literals (Template String)
const person = {
name: 'Julia',
score: 4,
};
//bad code
console.log(
'Hello ' + person.name + ', Your current score is: ' + person.score
);
@sorie
sorie / optional-chaining.js
Created August 12, 2021 01:39
javascript tip : optional chaining
const bob = {
name: 'Julia',
age: 20,
};
const anna = {
name: 'Julia',
age: 20,
job: {
title: 'Software Engineer'
}
@sorie
sorie / spread-syntax.js
Created August 12, 2021 01:10
javascript tip : Spread Syntax - Object,array
//Spread Syntax - Object
const item = { type: 'shirts', size : 'M' };
const detail = { price: 20, made: 'Kores', gender: 'M' };
//bad code
item['price'] = detail.price;
//bad code
const newObject = new Object;
newObject['type'] = itme.type;
@sorie
sorie / object-destructuring.js
Created August 12, 2021 00:57
javascript tip : object destructuring
//Object Destructuring
const person = {
name = 'Julia',
age = 20,
phone: '0102222222'
};
//bad code
function displayPerson(person){
displayAvatar(person.name);
@sorie
sorie / ternary-operator.js
Created August 12, 2021 00:41
javascript tip : ternary operator
//bad code
function getResult(score) {
let result;
if(score > 5) {
result = 'up';
} else if (score <= 5) {
result = 'down';
}
return result;
}
@sorie
sorie / nullish-coalescing.js
Last active August 12, 2021 00:51
javascript : nullish-coalescing
//nullidh coalescing operator ?? is only case null, undefined check.'
//do not confusing to Logical OR operator || is only case false(0, undefined, null, "",'',``) or true check.
//bad code
function printMessage(test){
let message = text;
if(text == null || text == undefined) {
message = 'Nothing to display';
}
console.log(message);
@sorie
sorie / gist:7f48c8b83184bec68f47da7e458ab031
Created July 10, 2021 09:26
vs code powershell 에서 PSSecurityException에러를 만났을 때
에러이유 : 관리자가 아닌 ms 계정으로 로그인한 윈도우10에서 Visual Studio Code 에서 Vue 개발환경을 설정하던 중 보안 오류가 발생함.
해결방법 :
d:\sori> Get-ExecutionPolicy -Scope CurrentUser
d:\sori> Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
d:\sori> Get-ExecutionPolicy -List
관련문서
https://docs.microsoft.com/ko-kr/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7