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
package main
import (
_ "encoding/json"
"fmt"
"gopkg.in/mgo.v2"
"io"
"os"
)
package main
import (
"context"
"log"
"runtime"
"time"
)
var (

Deploy gitlab-ce by docker

create service

docker run --detach \
    --hostname gitlab.example.com \
    --publish 8443:443 \
    --name gitlab \
    --restart always \
    --volume /srv/gitlab/config:/etc/gitlab \
@joeke80215
joeke80215 / backtrack.kt
Last active October 7, 2018 03:53
kotlin backtrack
class CombineHandler {
var subsetArray: IntArray
val SIZE: Int = 5
init {
subsetArray = IntArray(SIZE)
}
fun backtrack (n: Int,size: Int) {
if (n == SIZE) {
for (i in 0..size - 1) {
@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 {
@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 / 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 / atomicdemo.go
Created February 9, 2019 02:16
golang atomic demo
package main
import (
"fmt"
"sync"
"sync/atomic"
)
var browseNum uint32
@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 / single_link.c
Created February 14, 2019 14:55
single Link with C