Skip to content

Instantly share code, notes, and snippets.

View joeke80215's full-sized avatar
:octocat:

joeekee joeke80215

:octocat:
  • Taipei City, Taiwan
View GitHub Profile
@joeke80215
joeke80215 / btree.c
Created February 17, 2019 13:29
btree with C
#include <stdio.h>
#include <stdlib.h>
struct Node
{
int Val;
struct Node *left;
struct Node *right;
};
@joeke80215
joeke80215 / main.c
Created February 16, 2019 14:00
Mysql With C Demo
#include <stdio.h>
#include <my_global.h>
#include <mysql.h>
int main(void)
{
MYSQL *conn;
conn = mysql_init(NULL);
if (conn == NULL)
{
@joeke80215
joeke80215 / string_combine.c
Created February 16, 2019 06:58
Combine New String with C
#include <stdio.h>
#include <stdlib.h>
char* CombineNewString(char *w1,char *w2)
{
size_t count1,count2;
int index;
char *t,*t1,*t2;
count1 = 0;
@joeke80215
joeke80215 / client.go
Created February 15, 2019 14:39
Golang http request demo
package main
import (
"bytes"
"encoding/json"
"io/ioutil"
"log"
"net/http"
"net/url"
"strings"
@joeke80215
joeke80215 / single_link.c
Created February 14, 2019 14:55
single Link with C
@joeke80215
joeke80215 / launch.json
Last active February 16, 2019 07:04
C with vs code
{
// 使用 IntelliSense 以得知可用的屬性。
// 暫留以檢視現有屬性的描述。
// 如需詳細資訊,請瀏覽: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"preLaunchTask": "build", // 添加preLaunchTask,先執行build任務
"name": "(gdb) Launch",
"type": "cppdbg",
@joeke80215
joeke80215 / atomicdemo.go
Created February 9, 2019 02:16
golang atomic demo
package main
import (
"fmt"
"sync"
"sync/atomic"
)
var browseNum uint32
@joeke80215
joeke80215 / mysql_update_timestamp_trigger.sql
Created November 19, 2018 07:41
mysql add timestamp when update row
CREATE TRIGGER `testTrigger` BEFORE UPDATE ON `testTable`
FOR EACH ROW SET NEW.<timestamp col>=TIMESTAMPDIFF(SECOND,OLD.SENDTIME,NOW())
@joeke80215
joeke80215 / example.cpp
Created November 16, 2018 01:48
Cocos2dx Sprite drop and drag
#include "example.h"
USING_NS_CC;
// createScene create scene for main scene
Scene* ExampleScene ::createScene()
{
return ExampleScene ::create();
}
@joeke80215
joeke80215 / main.go
Created November 15, 2018 07:17
Golang cookie cache struct in redis
package main
import (
"encoding/json"
"log"
"github.com/go-redis/redis"
)
type Cookie struct {