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
h1 { | |
background: linear-gradient(30deg, #c850c0, #ffcc70); | |
-webkit-background-clip: text; | |
-webkit-text-fill-color: transparent; | |
} |
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 addToTaskQueue(fn) { | |
// 模拟浏览器微任务 | |
setTimeout(fn, 0) | |
} | |
function isThenable(value) { | |
return typeof value?.then === 'function'; | |
} | |
class MyPromise { |
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
import bpy | |
bpy.ops.object.vertex_group_copy() | |
bpy.ops.object.vertex_group_mirror(flip_group_names=False,use_topology=True) | |
# only select one object at a time | |
selected_obj = bpy.context.selected_objects[0] | |
active_vertex_group = selected_obj.vertex_groups.active |
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
public static double sqrt(double c) { | |
if (c < 0) return Double.NaN; | |
double err = 1e-15; | |
double t = c; | |
while (Math.abs(t-c/t) >= err * t) | |
{ | |
t = (t + c/t) / 2.0; | |
} | |
return t; | |
} |