backdrop-filter on Safari2021. 3. 18.
make sure your opacity
value is 1.
warning: could not read '.git/rebase-merge/head-name': No such file or directory2021. 3. 17.
git rebase --quit
git rebase --quit
`mix ecto.create` -> `(Postgrex.Error) FATAL 28000 (invalid_authorization_specification) role "postgres" does not exist`2021. 3. 12.
createuser -s postgres
createuser -s postgres
Patch broken node_module with yarn22021. 3. 9.
yarn patch <module>
- fix the code inside the generated folder and save it.
yarn patch-commit <generated_folder> > <patch_file_name>.diff
- fix
package.json
with"module": "patch:<module>@<version>#<path_to_patch_file>/<patch_file_name>.diff"
yarn install
as const2021. 1. 21.
type predicate2021. 1. 11.
interface Article {
title: string;
body: string;
}
function isArticle(body: unknown): body is Article {
let b = body as Article;
return !!b && typeof b.body === 'string' && typeof b.title === 'string';
}
interface Article {
title: string;
body: string;
}
function isArticle(body: unknown): body is Article {
let b = body as Article;
return !!b && typeof b.body === 'string' && typeof b.title === 'string';
}
When m1 f***s sharp2020. 12. 29.
brew reinstall vips
brew reinstall vips
xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist2020. 12. 11.
GHCi, version 8.4.3: http://www.haskell.org/ghc/ :? for help
xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist
Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.
See `man xcode-select` for more details.
`clang' failed in phase `gcc'. (Exit code: 1)
GHCi, version 8.4.3: http://www.haskell.org/ghc/ :? for help
xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist
Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.
See `man xcode-select` for more details.
`clang' failed in phase `gcc'. (Exit code: 1)
⏬
sudo xcode-select -switch /Library/Developer/CommandLineTools
sudo xcode-select -switch /Library/Developer/CommandLineTools
Migrate .re to .res2020. 11. 20.
https://rescript-lang.org/docs/manual/latest/migrate-from-bucklescript-reason#upgrade-your-codebase
node_modules/.bin/bsc -format MyFile.re > MyFile.res
node_modules/.bin/bsc -format MyFile.re > MyFile.res
Beware! Array methods will do shallow copies2020. 11. 19.
const obj1 = { id: 1, name: "obj1" };
const obj2 = { id: 2, name: "obj2" };
const obj3 = { id: 3, name: "obj3" };
const arr = [obj1, obj2, obj3];
const mappedArr = arr.map((obj) => obj);
const filteredArr = arr.filter((obj) => obj.id !== 3);
const reducedArr = arr.reduce((acc, item) => {
if (item.id === 3) {
return acc;
}
return [...acc, item];
}, []);
const mappedAndSpreadedArr = arr.map((obj) => ({ ...obj }));
const reducedAndSpreadedArr = arr.reduce((acc, item) => {
if (item.id === 3) {
return acc;
}
return [...acc, { ...item }];
}, []);
console.log(obj1 === mappedArr[0]); // true
console.log(obj1 === mappedAndSpreadedArr[0]); // false
console.log(obj1 === filteredArr[0]); // true
console.log(obj1 === reducedArr[0]); // true
console.log(obj1 === reducedAndSpreadedArr[0]); // false
const findedObj1 = mappedArr.find((obj) => obj.id === 1);
findedObj1.name = "lol";
console.log(obj1.name); // 'lol'
const findedObj2 = mappedAndSpreadedArr.find((obj) => obj.id === 2);
findedObj2.name = "lol";
console.log(obj2.name); // 'obj2'
const obj1 = { id: 1, name: "obj1" };
const obj2 = { id: 2, name: "obj2" };
const obj3 = { id: 3, name: "obj3" };
const arr = [obj1, obj2, obj3];
const mappedArr = arr.map((obj) => obj);
const filteredArr = arr.filter((obj) => obj.id !== 3);
const reducedArr = arr.reduce((acc, item) => {
if (item.id === 3) {
return acc;
}
return [...acc, item];
}, []);
const mappedAndSpreadedArr = arr.map((obj) => ({ ...obj }));
const reducedAndSpreadedArr = arr.reduce((acc, item) => {
if (item.id === 3) {
return acc;
}
return [...acc, { ...item }];
}, []);
console.log(obj1 === mappedArr[0]); // true
console.log(obj1 === mappedAndSpreadedArr[0]); // false
console.log(obj1 === filteredArr[0]); // true
console.log(obj1 === reducedArr[0]); // true
console.log(obj1 === reducedAndSpreadedArr[0]); // false
const findedObj1 = mappedArr.find((obj) => obj.id === 1);
findedObj1.name = "lol";
console.log(obj1.name); // 'lol'
const findedObj2 = mappedAndSpreadedArr.find((obj) => obj.id === 2);
findedObj2.name = "lol";
console.log(obj2.name); // 'obj2'