laravel new project-name
Discover gists
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
export const assign = (...objs) => Object.assign({}, ...objs) | |
export const assign2 = (...objs) => { | |
objs.unshift({}); | |
let len = objs.length; | |
while (--len > 0) | |
for (let i in objs[len]) | |
objs[0][i] = objs[len][i] | |
return objs[0] | |
} | |
// no spread operator overhead, raw arguments access, obj[0] *is* mutated! |
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
I'm working on a way to connect data to a user interface | |
in a way that is flexible, | |
yet still easy for end-users to work with. | |
This has been one of the biggest challenges for me. | |
## References: | |
* https://hackernoon.com/how-to-decouple-state-and-ui-a-k-a-you-dont-need-componentwillmount-cc90b787aa37 | |
* https://webpack.js.org/guides/code-splitting/ |
前端发展很快,现代浏览器原生 API 已经足够好用。我们并不需要为了操作 DOM、Event 等再学习一下 jQuery 的 API。同时由于 React、Angular、Vue 等框架的流行,直接操作 DOM 不再是好的模式,jQuery 使用场景大大减少。本项目总结了大部分 jQuery API 替代的方法,暂时只支持 IE10+ 以上浏览器。
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
{ | |
"name": "ra-front-simple", | |
"version": "1.0.0", | |
"private": true, | |
"scripts": { | |
"build": "nuxt build --analyze", | |
"lint": "eslint --ext .js,.vue --ignore-path .gitignore src tests", | |
"dev": "nuxt", | |
"start": "nuxt start", | |
"generate": "nuxt generate", |
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 displayBio({ name, age, favouriteColour }) { | |
console.log(name, age, favouriteColour); | |
} | |
const frank = { | |
id: 124, | |
name: 'Frank', | |
age: '28', | |
address: '14 High St', | |
favouriteColour: 'red', |
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
/* | |
'Prototype' pattern | |
------------------- | |
Traditional pattern to emulate classical inheritance in JavaScript | |
Pros: | |
- already used by majority of OO JS developers | |
- performs well |
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
/** | |
* | |
*/ | |
export const deepFreeze = (obj) => { | |
// Retrieve the property names defined on obj | |
const propNames = Object.getOwnPropertyNames(obj); | |
// Freeze properties before freezing self | |
propNames.forEach((name) => { | |
let prop = obj[name]; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
awesome-productivity - A curated list of delightful productivity resources.
NewerOlder