Skip to content

Instantly share code, notes, and snippets.

View momocow's full-sized avatar
🍭
Feed me plz

牛牛 momocow

🍭
Feed me plz
View GitHub Profile
@dube116
dube116 / api.js
Last active March 12, 2019 13:46
og api
buildingData = {'metalMine':{'id':1, 'type':'supply'},
'crystalMine':{'id':2, 'type':'supply'},
'deuteriumSynthesizer':{'id':3, 'type':'supply'},
'solarPlant':{'id':4, 'type':'supply'},
'fusionReactor':{'id':12, 'type':'supply'},
'solarSatellite':{'id':212, 'type':'supply'},
'metalStorage':{'id':22, 'type':'supply'},
'crystalStorage':{'id':23, 'type':'supply'},
'deuteriumTank':{'id':24, 'type':'supply'},
'roboticsFactory':{'id':14, 'type':'station'},
@weihanglo
weihanglo / rust-vs-go.md
Last active January 28, 2024 06:56
【譯】Rust vs. Go

【譯】Rust vs. Go

本文譯自 Julio Merino 2018 年七月撰寫的 Rust vs. Go 一文。Julio Merino 是 G 社僱員,在 G 社工作超過 8 年,無論工作內外,都接觸開發不少 Go 語言,並撰寫 [Rust 點評][rust-review]系列文,來聽聽他對 Rust 與 Go 的想法吧。

Thanks Julio Merino for this awesome article!


歌詞

二人で歩いた道
出会いの が また来るね

らした 月の影
やかに 優しくて
この空も この海も ずっと続くって
めての時 私そう思ってた
だけど全ては 消えてゆくのね

@psmolak
psmolak / api-spec.md
Last active February 13, 2024 16:22
OGame API documentation

Statistics API

API url: s{server}-{country}.ogame.gameforge.com/api/{endpoint}

Endpoints

players.xml (1 day)
Contain list of all players on the server along with their names and status.

@JohnEarnest
JohnEarnest / CorsServer.js
Created December 27, 2016 17:47
A CORS-aware read/write HTTP server in Node.js
////////////////////////////////////////////////////////////////////////////
//
// Node.js HTTP file server example.
//
// Serves documents via GET requests with CORS headers and (if enabled)
// additionally permits writes via POST requests.
//
// Before using, PLEASE be aware of the security risks associated with
// running a server like this on publicly accessible machines!
//
@languanghao
languanghao / left-bar.vue
Created December 22, 2016 06:56
element ui menu with vue-router
<template>
<el-menu :router="true" :default-active="activeLink">
<template v-for="rule in $router.options.routes">
<el-submenu v-if="rule.children && rule.children.length > 0"
:index="rule.path"
>
<template slot="title"><i :class="rule.icon"></i>{{ rule.title }}</template>
<el-menu-item v-for="child in rule.children" :index="rule.path + '/' + child.path">{{ child.title }}</el-menu-item>
</el-submenu>
<el-menu-item v-else
@citrusui
citrusui / dropdown.md
Last active April 16, 2024 20:25
"Dropdowns" in Markdown
How do I dropdown?
This is how you dropdown.

<details>
<summary>How do I dropdown?</summary>
<br>
This is how you dropdown.
@joepie91
joepie91 / random.md
Last active April 10, 2024 18:45
Secure random values (in Node.js)

Not all random values are created equal - for security-related code, you need a specific kind of random value.

A summary of this article, if you don't want to read the entire thing:

  • Don't use Math.random(). There are extremely few cases where Math.random() is the right answer. Don't use it, unless you've read this entire article, and determined that it's necessary for your case.
  • Don't use crypto.getRandomBytes directly. While it's a CSPRNG, it's easy to bias the result when 'transforming' it, such that the output becomes more predictable.
  • If you want to generate random tokens or API keys: Use uuid, specifically the uuid.v4() method. Avoid node-uuid - it's not the same package, and doesn't produce reliably secure random values.
  • If you want to generate random numbers in a range: Use random-number-csprng.

You should seriously consider reading the entire article, though - it's

title description date categories slug
QQ协议分析
QQ协议分析
2014-04-16
protocol
qq-protocol

一. 文字聊天协议族(TCPF, Text Chatting Protocol Family)

@ferventcoder
ferventcoder / FixGitSymlinkStatusIssues.ps1
Last active March 24, 2024 01:42
Git Symlinks POSIX vs Windows - Fixes Permission Denied issues when you share a repository as part of your Shared Folders with one or more Windows VMs.
# This fixes Permission denied errors you might get when
# there are git symlinks being used on repositories that
# you share in both POSIX (usually the host) and Windows (VM).
#
# This is not an issue if you are checking out the same
# repository separately in each platform. This is only an issue
# when it's the same working set (aka make a change w/out
# committing on OSX, go to Windows VM and git status would show
# you that change).
#