Skip to content

Instantly share code, notes, and snippets.

View xuanye's full-sized avatar
🍉
Summer is Comming

Xuanye Wang xuanye

🍉
Summer is Comming
View GitHub Profile
@xuanye
xuanye / .block
Created October 19, 2022 01:24 — forked from pjsier/.block
Real-Time Line Chart
license: mit
@xuanye
xuanye / serilog.json
Created December 15, 2021 01:50
Serilog ,console,file,ES
{
"using": [
"Serilog.Sinks.Async",
"Serilog.Sinks.Console",
"Serilog.Sinks.File",
"Serilog.Sinks.Elasticsearch",
"Serilog.Formatting.Elasticsearch",
"Serilog.Expressions"
],
"MinimumLevel": {
@xuanye
xuanye / threejs-physically-based-scene.js
Created January 18, 2021 09:33 — forked from chicio/threejs-physically-based-scene.js
Physically based scene using three.js
/**
* Create main scene light.
*
* @returns a point light scene.
*/
function createLight() {
var lightGeometry = new THREE.SphereGeometry(0);
var lightMaterial = new THREE.MeshStandardMaterial({
emissive: 0xffffee,
@xuanye
xuanye / AudioGoup.js
Created March 19, 2020 02:01 — forked from junlas/AudioGoup.js
彻底解决在微信环境下自动播放声音
export default class AudioGroup {
_imgUrl = null;
_mp3Url = null;
_autoPlay = false;
/**@type {Function} */
_onPlayCompleteCallback = null;
/**@type {boolean} */
_isUseDomAudio;
spriteFrame;
@xuanye
xuanye / InteractionManager.js
Created March 18, 2020 07:48
重写点击事件
// Override
PIXI.InteractionManager.prototype.onTouchStart = function(event)
{
var rect = this.interactionDOMElement.getBoundingClientRect();
if(PIXI.AUTO_PREVENT_DEFAULT)event.preventDefault();
var changedTouches = event.changedTouches;
for (var i=0; i < changedTouches.length; i++)
{
// 判断横竖屏
var utils = {
debounce: function(func,delay){
var timer = null;
return function(){
var context = this,
args = arguments;
clearTimeout(timer);
timer = setTimeout(function(){
func.apply(context,args);
@xuanye
xuanye / file comment.txt
Created May 1, 2018 04:44
文件注释
// <copyright file="文件名.cs" company="HP">
// Copyright (c) HP. All rights reserved.
// </copyright>
// <author>×××</author>
// <date> yyyy-mm-dd </date>
// <summary>文件功能描述</summary>
// <modify>
// 修改人:×××
// 修改时间:yyyy-mm-dd
// 修改描述:×××
@xuanye
xuanye / SemaphoreSlim.cs
Created March 25, 2018 00:35
异步情况下线程同步
SemaphoreSlim mutex = new SemaphoreSlim(1);
int value;
Task<int> GetNextValueAsync(int current);
async Task UpdateValueAsync()
{
@xuanye
xuanye / msys2-here-uninstall.reg
Created February 23, 2018 06:18 — forked from elieux/msys2-here-uninstall.reg
MSYS2 here context menu items
Windows Registry Editor Version 5.00
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\MSYS here]
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\MINGW64 here]
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\MINGW32 here]
@xuanye
xuanye / HostedService
Created January 15, 2018 08:27
实现IHostedService 用于实现后台服务,类似while(true)的基类
public abstract class HostedService : IHostedService
{
private Task _executingTask;
private CancellationTokenSource _cts;
public Task StartAsync(CancellationToken cancellationToken)
{
// Create a linked token so we can trigger cancellation outside of this token's cancellation