Skip to content

Instantly share code, notes, and snippets.

@dmnsgn
dmnsgn / WebGL-WebGPU-frameworks-libraries.md
Last active May 31, 2024 13:54
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 ⚙️

Name Stars Last Commit Description
three.js ![GitHub
@forthxu
forthxu / CheckForbiddenWords.py
Created March 21, 2017 04:45
Python全站内容抓取、URL扫描 实例:用于扫描自己的网站的违禁词连接和对应的违禁词
#!/usr/bin/python
# -*- coding:utf-8 -*-
# Orignal Author: FrankHacker
# Modified by Linson @691000737
# Require requests module, python3.x+
# 处理常见违禁词,全站扫描,违禁词可以从自己的网站导出成json格式,替换13行内容
# 程序会在当前目录生成badword.txt文件
import requests
import re,json
@wojteklu
wojteklu / clean_code.md
Last active June 1, 2024 12:45
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@paulirish
paulirish / what-forces-layout.md
Last active May 31, 2024 22:37
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@aln787
aln787 / findFilesWithExtension.go
Last active January 20, 2023 22:05
Go Lang find files with extension from the current working directory.
/* Go Lang find files with extension from the current working directory.
Copyright (c) 2010-2014 Alex Niderberg */
package main
import (
"fmt"
"os"
"path/filepath"
"regexp"
@beginor
beginor / angular-require-shim.js
Created November 11, 2014 06:42
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',
@zxhfighter
zxhfighter / fork-and-push.md
Last active May 31, 2024 03:17
如何给开源项目贡献代码

如何给开源项目贡献代码

分两种情况:

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

fork & pull request

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

@tuxite
tuxite / d3.windArrow.js
Created September 17, 2014 13:28
D3 JS script to draw a wind arrow
/* Creates a wind arrow for display in station model */
/* The default size of the arrow is: width = 8, height = 2.
The size is then given by the @arrowWidth parameter.
The canvas is a square of 2*arroWidth.
The arrow is drawn in the center of the square and rotated to the corresponding angle (@direction).
*/
var WindArrow = function (speed, direction, container, arrowWidth) {
'use strict';
var index = 0,