之前博客一直都没有搜索系统,趁着周末,给博客添加一个搜索系统,我这里选择的是使用algolia搜索。在这个过程中遇到了几个需要注意的地方,这里特意说明下: (adsbygoogle = window.adsbygoogle || []).push({}); algolia注册先去algolia官网,进行注册。 安装教程你需要安装hexo-algoliasearche。按照这上面的步骤进行操作就行了~api Key的位置如下,一一对应的填写好就行 注意事项1、配置文件需要放在根目录下的_config.yml中,而不是主题的_config.yml, 这个时候博客的搜索是搜索不到任何内容的,我们需要通过 Hexo Aloglia 获取站点数据 Hexo Aloglia获取站点数据1、配置本地环境我们需要配置一个名称为 HEXO_ALGOLIA_INDEXING_KEY,内容为 Alogolia 网页中 Admin API KEY的环境变量,以mac端为例:打开终端vim ~/.bash_profile添加下面语句:12export HEXO_ALGOLIA_INDEXIN ...
(adsbygoogle = window.adsbygoogle || []).push({}); 先来看下效果将脚本和放excel表格的文件夹置于同一级目录 在该目录下执行js脚本表格内容如下:转为json后: 脚本代码:1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677var path = require("path");var fs = require("fs");var xlsx = require('node-xlsx');var dirs = [];//读取文件夹里所有的文件fs.readdir(__dirname+'/excel/', function(err, files){ (function iterato ...
cocos Creator
未读(adsbygoogle = window.adsbygoogle || []).push({}); 代码主要介绍了PageView在使用时动态创建、删除page页以及PageView的监听事件 逻辑代码12345678910111213141516171819202122232425262728293031323334353637383940import { _decorator, Node,UITransform,size} from 'cc'import { UIPnlMultiTableView } from './UIPnlMultiTableView'import { UIBaseLogic } from '../../UIBaseLogic'const { ccclass } = _decoratorexport class UIPnlMultiTableLogic extends UIBaseLogic ...
已经上线的小程序1、小程序搜索:it前端农民工2、扫描下方二维码 hexo部署方法安装hexo-generator-wxapi1npm install hexo-generator-wxapi --save使用方法看这里 接口配置1、 在hexo根目录的_config.yml文件中加入一下配置,必须配123456789101112131415161718192021222324252627282930restful_api: # site 可配置为数组选择性生成某些属性 # site: ['title', 'subtitle', 'description', 'author', 'since', email', 'favicon', 'avatar'] site: true # hexo.config mix theme.config posts_size: 8 # 文章列表分页,0 表示不分页 posts_ ...
cocos creator
未读(adsbygoogle = window.adsbygoogle || []).push({}); 网上教程很多,但是大多数都是使用了2个精灵去实现的,个人觉得比较麻烦,这里写下我的方法,记录下123tween(this._view._ImgC_poker.node).to(0.5,{eulerAngles:new Vec3(0,90,0)}).call(()=>{ this._view._ImgC_poker.getComponent(Sprite).spriteFrame = this.pokerImg.getSpriteFrame("card_2");}).to(0.5,{eulerAngles:new Vec3(0,0,0)}).start();这里只需要用到一个精灵节点即可:
cocos Creator
未读(adsbygoogle = window.adsbygoogle || []).push({}); 同事之前安装好了CocosCreator,今天打开工程的时候出现了下面错误: 解决方案:直接将所用到的cocosCreator版本卸载后重装即可。
Hexo
未读说明:这里其实是分为两个部分,第一个部分是将hexo生成的静态文件上传到服务器,第二个部分就是部署网站了(个人理解) (adsbygoogle = window.adsbygoogle || []).push({}); 文件上传到服务器创建git用户1adduser git 修改git用户密码1sudo passwd git 根据提示操作即可 设置权限使用vim编辑/etc/sudoers(vim的使用方法很简单,不会可以百度)1vim /etc/sudoers找到User privilege specification部分,添加如下内容:1git ALL=(ALL:ALL) ALL如下图: 切换至git用户1su git 这里需要输入git的用户密码 添加密钥12345mkdir -p ~/.sshtouch ~/.ssh/authorized_keyschmod 600 ~/.ssh/authorzied_keyschmod 700 ~/.sshvim ~/.ssh/authorized_keys #将ssh密钥粘贴进去 登录测试在本地打开终端 ...
(adsbygoogle = window.adsbygoogle || []).push({}); 在开发的时候,我们需要一个既能翻页又能上下滑动的界面,这时候就会遇到翻页容器和滚动容器触摸冲突的情况。以下是博主这里的解决方法。 ScrollView和PageView层级关系如下:在不做任何处理前,在ScrollView区域(上图白色区域)滑动,ScrollView可以正常上下滑动,PageView不能左右滑动,但是PageView可以在上图中红不红、粉不粉的区域左右滑动。查了一下,是因为两者的触摸冲突了。下面是我的解决方法: 1234567891011121314151617181920212223242526272829303132333435363738394041424344public intiView() { this._view._ScrollC_game.node.on(Node.EventType.TOUCH_START, this.touchStart, this); this._view._ScrollC ...
编程语言
未读(adsbygoogle = window.adsbygoogle || []).push({}); 12345678910111213141516171819202122232425262728293031323334function removeTrailingZeros(numberString: string): string { const trimmedString = numberString.trim(); // 去除首尾空格 const decimalIndex = trimmedString.indexOf('.'); if (decimalIndex !== -1) { let endIndex = trimmedString.length - 1; while (trimmedString[endIndex] === '0') { endIndex--; } if (trimmedString[endIn ...
(adsbygoogle = window.adsbygoogle || []).push({}); 如果你clone下来一个别人的仓库,在此基础上完成你的代码,推送到自己的仓库可能遇到如下问题:error: remote origin already exists.表示远程仓库已存在。因此你要进行以下操作:1、先输入git remote rm origin删除关联的origin的远程库2、关联自己的仓库 git remote add origin <https://gitee.com/xxxxxx.git>3、最后git push origin master,这样就推送到自己的仓库了。
(adsbygoogle = window.adsbygoogle || []).push({}); 首先,您需要使用Cocos Creator的WebSocket模块来创建一个WebSocket连接。您可以使用以下代码在您的A类中创建WebSocket: 12345678910let socket = new WebSocket("ws://your-socket-url");// 将WebSocket对象设置为全局变量window["socket"] = socket;socket.onopen = function() { console.log("WebSocket连接已建立");};socket.onmessage = function(event) { console.log("接收到WebSocket数据", event.data); // 在这里处理接收到的数据}; 在您的B类中获取全局的WebSocket对象。您可以使用以下 ...
TypeScript
未读(adsbygoogle = window.adsbygoogle || []).push({}); 代码:12345678910function formatString(str: string, ...args: any[]): string { return str.replace(/\{(\d+)\}/g, (match, index) => { return typeof args[index] !== "undefined" ? args[index] : match; });}const name: string = "Alice";const age: number = 25;const message: string = formatString("My name is {0} and I am {1} years old.", name, age);console.log( ...