30-seconds-of-code-texteditorsnippets

授权协议 CC0-1.0 License
开发语言 JavaScript
所属分类 应用工具、 操作系统工具
软件类型 开源软件
地区 不详
投 递 者 齐文栋
操作系统 OS X
开源组织
适用人群 未知
 软件概览

30-seconds-of-code-texteditorsnippets

Included in this repository are the files you need to import all the snippets from the amazing resource 30-seconds-of-code into you text editor of choice (VSCode, Atom + Sublime).

Make sure you ⭐️ the original repo here!

The files in this repo contain the 30-seconds-of-code Snippets as of February 1st, 2018's release. The project is still under active development and not all the snippets contained herein are production ready. You've been warned.

How to import the snippets

VSCode: Go to 'Preferences' > 'User snippets' and select the language 'Javascript', then paste in all the code from the javascript.json file. For more information checkout the VSCode snippets docs.

Atom: Copy the code in the snippets.cson file into your own snippets.cson file located in ~./atom directory. For more information checkout the Atom snippets docs.

Sublime: Move all the *.sublime-snippet's into your Packages/User folder (technically you can store *.sublime-snippet's in any package's folder but for simplicities sake Packages/User will be easiest to find). If your stuck make sure you check out the Sublime snippets docs.

Alfred: If you're an Alfred powerpack user your in luck, there is an easy way to import the snippets using the file in this repo.

NPM: You can of course access all of these snippets and more with the 30-seconds-of-code npm package by running npm install 30-seconds-of-code or the tsoc npm package by running npm install tsoc.

After the package is installed you may access a snippet(s) with the following notation for node.js: import { snippetName, otherSnippet } from '_30s' and/or javascript: const { snippetName, otherSnippet } = require('_30s')

Special thanks

Mad props go out to the core team and all the contributors at 30-seconds-of-code who have worked hard putting these snippets together. ��

License

Creative Commons License

CC0 1.0 Universal

  • 30-seconds-of-code: 一个有用的 JavaScript 片段集合,让你可以在 30秒或更少的时间内理解 【GitHub】 原文链接:http://caibaojian.com/30-seconds-of-code.html 数组 arrayMax 返回数组中的最大值。 将Math.max()与扩展运算符 (...) 结合使用以获取数组中的最大值。 const arrayMax =

  • 函数 功能 原文:https://github.com/Chalarangelo/30-seconds-of-code 作者:Chalarangelo 翻译:http://caibaojian.com/30-seconds-of-code.html 译者:蔡宝坚 收集有用的 Javascript 片段, 你可以在30秒或更少的时间里理解。 chainAsync:链异步函数 循环遍历包含异步事件的函

  • const chunk = (arr, size) => Array.from({ length: Math.ceil(arr.length / size) }, (v, i) => arr.slice(i * size, i * size + size) ); const countBy = (arr, fn) => arr.map(typeof fn === 'functi

  • http://www.css88.com/30-seconds-of-code/#rgbtohex

  • A - C 系列 1、+ 号的隐式类型转换使用 +[3] //3 +[1,2,3].slice(-1) //将 [3] 转换为了3 2、日期的转换 const addDaysToDate = (date, n) => { const d = new Date(date); d.setDate(d.getDate() + n); return d.toISOString().spl

  • all const all = (arr, fn = Boolean) => arr.every(fn) 函数封装了every函数,判断条件默认为元素默认转为boolean值,如果都为true,则返回true。否则,返回false。 allEuqual const allEqual = arr => arr.every(val => val === arr[0]) 如all函数函数,判断条件变

  • 今天我在采用 "基于ThinkPHP5 使用QueryList爬取 并存入mysql数据库" 时   做了一个休眠处理 是当几秒后才执行 出现了  Maximum execution time of 30 seconds exceeded 这个提示: Maximum execution time of 30 seconds exceeded 错误,这个提示的意思就是告诉我们: 网页执行时间超过了3

  • Sublime Text Sublime Text作为非常美观大方的编辑器深受大家喜爱,我们也可以将其配置为各种语言的编译器,自定义一些快捷键,安装插件,提高日常使用的舒适度和开发效率。 通过Package Control安装插件:Ctrl+Shift+P调出命令板,输入list可以查看已安装的插件,输入install再回车可以安装想要的插件。 Sublime Text 2和3的区别暂时没有发现,

  • 30-seconds-of-code今天在github,发现了超好的资源库,30秒写出质量的代码。 下面是我从库里抄来的一个方法,大家先睹为快~ title: allEqual tags: array,beginner 检查数组中的所有元素是否相等。 使用 Array.prototype.every() 检查数组的所有元素是否与第一个元素相同。 数组中的元素使用严格比较运算符进行比较,它不考虑’

 相关资料
  • https://github.com/30-seconds/30-seconds-of-code 原生JS提供的原型方法,在我们实际工作需要在常常感觉不够用,有些常用的场景不得不自己再去封装一些方法,30-seconds-of-code这个项目提供了大量优秀的JavaScript代码片段,提供原型方法之外的一些常用方法,思路清奇优秀。 【Adapter】适配器 参数截取:只保留前n位参数,忽略其他

  • As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feat

  • 30 Days of Python For the next 30 days, learn the Python Programming language. Watch the official tutorial series on CFE or YouTube. 30 Days of Python using Python 3.6 has been moved to here. Happy Coding!

  • 这是一本新媒体(New Media)领域的研究人员从艺术和物理的角度探讨如何通过Processing框架,将一些常见的自然现象转换实现。     例如:向量,力,振荡,粒子系统,神经网络等等。     作者对于本书的介绍和定位如下:     “How can we capture the unpredictable evolutionary and emergent properties of n

  • 30-Days-of-ML-Kaggle �� About the Hands On Program �� Machine learning beginner → Kaggle competitor in 30 days. Non-coders welcome The program starts Monday, August 2, and lasts four weeks. It's desig

  • Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experien