Skip to content

Instantly share code, notes, and snippets.

@martinadamsdev
martinadamsdev / migratingRules.md
Created September 24, 2021 02:13 — forked from Jaid/migratingRules.md
ESLint rules for migrating projects from CommonJS to ESM

ESLint rules

The ESM standard is considered stable in NodeJS and well supported by a lot of modern JavaScript tools.

ESLint does a good job validating and fixing ESM code (as long as you don't use top-level await, coming in ESLint v8). Make sure to enable the latest ECMA features in the ESLint config.

  • .eslint.json
{
@martinadamsdev
martinadamsdev / index.html
Created June 3, 2021 04:33 — forked from AWeiJie/index.html
HTML5 Canvas圆盘抽奖应用(适用于Vue项目)
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<title>HTML5 Canvas圆盘抽奖应用DEMO演示</title>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<style>
* {
padding: 0px;

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@martinadamsdev
martinadamsdev / relativeOrientation.ts
Created March 18, 2021 11:51 — forked from thw0rted/relativeOrientation.ts
Cesium function to transform relative heading-pitch-roll to absolute rotation Quaternion
import {
Cartesian3,
HeadingPitchRoll,
Matrix3,
Matrix4,
Quaternion,
Transforms,
} from "cesium";
/**
@martinadamsdev
martinadamsdev / angular-require-shim.js
Created October 10, 2020 02:37 — forked from beginor/angular-require-shim.js
RequireJS Shim for AngularJS 1.3.0
requirejs.config({
baseUrl: 'scripts',
paths: {
'angular': 'lib/angular/angular',
'angular-animate': 'lib/angular/angular-animate',
'angular-aria': 'lib/angular/angular-aria',
'angular-cookies': 'lib/angular/angular-cookies',
'angular-messages': 'lib/angular/angular-messages',
'angular-mocks': 'lib/angular/angular-mocks',
'angular-resource': 'lib/angular/angular-resource',
@martinadamsdev
martinadamsdev / TextEllipsis.vue
Created September 30, 2020 12:58 — forked from xhsdnn/TextEllipsis.vue
单/多行文本截断的vue组件
<template>
<div class="text-ellipsis" :style="{height: textHeight,lineHeight: lineHeight}">
<div class="ellipsis-before" :style="{height: textHeight}"></div>
<div class="ellipsis-content">
<template v-if="$slots.default">
<slot></slot>
</template>
<template v-else>{{text}}</template>
</div>
<div class="ellipsis-after" :style="{top: '-'+lineHeight, height: lineHeight}">...</div>
@martinadamsdev
martinadamsdev / WebGL-WebGPU-frameworks-libraries.md
Created August 21, 2020 15:24 — forked from dmnsgn/WebGL-WebGPU-frameworks-libraries.md
A collection of WebGL and WebGPU frameworks and libraries

A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.

Engines and libraries

  • three.js: JavaScript 3D library
  • stack.gl: an open software ecosystem for WebGL, built on top of browserify and npm.
  • PixiJS: Super fast HTML 5 2D rendering engine that uses webGL with canvas fallback
  • Pex: Pex is a javascript 3d library / engine allowing for seamless development between Plask and WebGL in the browser.
  • Babylon.js: a complete JavaScript framework for building 3D games with HTML 5 and WebGL
  • Filament: Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS and WASM/WebGL
  • ClayGL: A WebGL graphic library
@martinadamsdev
martinadamsdev / fork-and-push.md
Created August 1, 2020 07:47 — forked from zxhfighter/fork-and-push.md
如何给开源项目贡献代码

如何给开源项目贡献代码

分两种情况:

  • 代码仓库管理者给你添加该仓库的写入权限,这样的话可以直接push
  • 如果不能直接push(大多数情况),采用经典的fork & pull request来提交代码,下面讲述这种情况

fork & pull request

例如有个仓库https://github.com/ecomfe/esui.git,其采用了经典的分支开发模型,稳定后的代码提交到master分支,其余特性则在dev分支上进行开发,待成熟后合并回master分支。

@martinadamsdev
martinadamsdev / README.md
Created June 2, 2020 14:17 — forked from jxson/README.md
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation