Skip to content

Instantly share code, notes, and snippets.

View nekomeowww's full-sized avatar
🥰
Gaining sunshine

Neko nekomeowww

🥰
Gaining sunshine
View GitHub Profile
.
├── matree
├── swift
│   ├── 00503_0_254.242_2013mar02
│   ├── 00546_0_ensbdasa-09aug2013
│   ├── 00553_0_ensbdpix3-09aug2013
│   ├── 00554_0_ensbdpix4-09aug2013
│   ├── 00555_0_ensbdrtr1-2013aug09
│   ├── 00557_0_ENSBDVPN1-02AUG2013
│   ├── 00558_0_ENSBDVPN2-02AUG2013
@nekomeowww
nekomeowww / SimpleHTTPServer.cs
Created October 2, 2017 21:00 — forked from aksakalli/SimpleHTTPServer.cs
SimpleHTTPServer in C#
// MIT License - Copyright (c) 2016 Can Güney Aksakalli
// https://aksakalli.github.io/2014/02/24/simple-http-server-with-csparp.html
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Net;
using System.IO;
@nekomeowww
nekomeowww / keybase.md
Created March 3, 2018 03:33
keybase.md

Keybase proof

I hereby claim:

  • I am nekomeowww on github.
  • I am ayakaneko (https://keybase.io/ayakaneko) on keybase.
  • I have a public key ASDgV2GVjKaEVf9KZPbl79unvUhuERWfYPr6qc0QetSYywo

To claim this, I am signing this object:

/**
* @param {string} word1
* @param {string} word2
* @return {number}
*/
let minDistance = function(word1, word2) {
let wordArr1 = word1.split("")
let wordArr2 = word2.split("")
let count = 0
@nekomeowww
nekomeowww / arclightTxsGraphql.js
Created February 9, 2021 14:23
ArcLight Txs GraphQL
const { gql, request } = require("graphql-request")
const query = gql`
{
transactions(
tags: [
{ name: "App-Name", values: "arclight-app" }
{ name: "Type", values: "Purchase" }
],
first: 100
@nekomeowww
nekomeowww / arweaveTransactionOwnerToAddress.js
Last active April 2, 2021 09:55
Arweave Owner to Address
import Arweave from 'arweave'
const arweave = Arweave.init({
host: 'arweave.net',
port: 443,
protocol: 'https',
timeout: 20000,
logging: false
})
package util
import "reflect"
// UniqAny 去重
func UniqAny(arrs interface{}) interface{} {
value := reflect.ValueOf(arrs)
// input value must be a slice
if value.Kind() != reflect.Slice {
@nekomeowww
nekomeowww / mongodb_facet_and_unwind.md
Last active November 6, 2023 10:29
Count multiple fields in MongoDB aggregation

Summary

Let's say we have the following documents:

[
  {"_id": "6094de60f74b0354af32dd17", "id": 1, "title": "Title1", "status": 1, "nested_field": {"expire_time": 4130633413} }
  {"_id": "6094de60f74b0354af32dd18", "id": 1, "title": "Title1", "status": 1}
  {"_id": "6094de60f74b0354af32dd19", "id": 2, "title": "Title2", "status": 0}
  {"_id": "6094de60f74b0354af32dd20", "id": 2, "title": "Title2", "status": 2}
@nekomeowww
nekomeowww / mongodb_query.js
Created November 26, 2021 02:23
MongoDB millisecond UNIX timestamp
((new Date().getTime()/1000)-(new Date().getTime()/1000%1))
@nekomeowww
nekomeowww / 1_synced_timer.js
Last active January 4, 2022 08:28
支持管理和同步系统时间的计时器实现
window.globalScope = {
syncedTimer: {
/**
* 计时器对象,保存了所有计时器的 id 和运行、重设状态
*
* @example { main : { "1": { running: true, reset: false }, "2": { running: false, reset: true } } }
*/
mTimers: {
main: {}
},