Skip to content

Instantly share code, notes, and snippets.

View kinbei's full-sized avatar
💭
I may be slow to respond.

kinbei kinbei

💭
I may be slow to respond.
  • GuangZhou China
View GitHub Profile
@kinbei
kinbei / dual_stack_server.c
Created August 13, 2022 07:58
porting-applications-to-ipv6
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h> // for close
#include <arpa/inet.h> // for inet_ntop
#include <errno.h> // for errno
@kinbei
kinbei / SQL Cheat Sheet.md
Created November 22, 2020 15:21 — forked from janikvonrotz/SQL Cheat Sheet.md
SQL Cheat Sheet#SQL#Markdown

SQL languages

DDL is short name of Data Definition Language, which deals with database schemas and descriptions, of how the data should reside in the database.

DML is short name of Data Manipulation Language which deals with data manipulation, and includes most common SQL statements such SELECT, INSERT, UPDATE, DELETE etc, and it is used to store, modify, retrieve, delete and update data in database.

DCL is short name of Data Control Language which includes commands such as GRANT, and mostly concerned with rights, permissions and other controls of the database system.

Datatypes

Text types

@kinbei
kinbei / cacheserver.lua
Created November 19, 2020 01:09 — forked from cloudwu/cacheserver.lua
Unity cache server
local skynet = require "skynet"
local socket = require "skynet.socket"
local db_path = assert(skynet.getenv "cache_db") .. "/"
local mode = (...) or "main"
local function tohex(c)
return string.format("%02x", c:byte())
end
@kinbei
kinbei / ecs.lua
Created December 6, 2017 05:20 — forked from cloudwu/ecs.lua
Lua ECS
local core = require "ecs.core"
local ecs = {}
local entities = {} -- all Entities, eid -> entity
local entity_id = 0
ecs.entities = entities
-- cset: component set
local cset = { __mode = "kv" }
base_type=class()
function base_type:ctor(x)
print("base_type ctor")
self.x=x
end
function base_type:print_x()
print(self.x)
end
local _class={}
function class(super)
local class_type={}
class_type.ctor=false
class_type.super=super
class_type.new=function(...)
local obj={}
do
local create
@kinbei
kinbei / PerformBuild.cs
Last active August 27, 2015 11:06 — forked from jmcguirk/PerformBuild.cs
Unity3D Ant Build Configuration
// C# example
using UnityEditor;
using System.IO;
using System.Collections;
using UnityEngine;
using System.Collections.Generic;
class PerformBuild
{
static string[] GetBuildScenes()