Skip to content

Instantly share code, notes, and snippets.

View mojocn's full-sized avatar
🎯
Eating and coding

mojocn mojocn

🎯
Eating and coding
View GitHub Profile
@mojocn
mojocn / index.html
Created February 9, 2023 09:11
Vue2Editor Test
<div id="app">
<vue-editor v-model="content" :editorToolbar="customToolbar">
</vue-editor>
</div>
@mojocn
mojocn / hacknews.go
Created March 24, 2021 10:43
fetch hacknews
import (
"crypto/tls"
"errors"
"fmt"
"github.com/PuerkitoBio/goquery"
"github.com/sirupsen/logrus"
"gorm.io/gorm"
"net/http"
"strings"
@mojocn
mojocn / google_translate.go
Created March 24, 2021 10:42
free open google translate of golang
import (
"context"
"crypto/tls"
"errors"
"fmt"
"github.com/abadojack/whatlanggo"
"io/ioutil"
"net/http"
"net/url"
@mojocn
mojocn / conn_hub.go
Last active March 24, 2021 03:36
a simple chat engine of golang
package chatengine
import (
"fmt"
"net"
)
type ConnHub struct {
cap int
pool map[net.Addr]net.Conn
@mojocn
mojocn / logurs_hook.go
Created June 2, 2020 08:40
logrus email hook
package common
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net"
"net/mail"
"net/smtp"

Keybase proof

I hereby claim:

  • I am mojocn on github.
  • I am mojocn (https://keybase.io/mojocn) on keybase.
  • I have a public key whose fingerprint is 9D18 E5B3 8691 8E32 3D80 DBAC 1E66 4A4B 2B35 AEB1

To claim this, I am signing this object:

@mojocn
mojocn / stop.sh
Created March 5, 2018 12:47
how to add process by name in bash
#!/bin/bash
ps -efww|grep -w './start.sh'|grep -v grep|cut -c 9-15|xargs kill -9
ps -efww|grep -w 'manage.py Mqtt_msg_process'|grep -v grep|cut -c 9-15|xargs kill -9
ps -efww|grep -w 'manage.py Rds_msg_process'|grep -v grep|cut -c 9-15|xargs kill -9
ps -efww|grep -w 'manage.py Event_notice_process'|grep -v grep|cut -c 9-15|xargs kill -9
ps -efww|grep -w 'manage.py Offline'|grep -v grep|cut -c 9-15|xargs kill -9
ps -efww|grep -w 'manage.py dahua'|grep -v grep|cut -c 9-15|xargs kill -9
@mojocn
mojocn / main.go
Last active February 10, 2018 04:13
钉钉机器人订阅百度新闻v2
package main
import (
"bytes"
"fmt"
"github.com/PuerkitoBio/goquery"
"github.com/astaxie/beego/toolbox"
"github.com/go-redis/redis"
"log"
"net/http"
@mojocn
mojocn / main.go
Created February 9, 2018 09:17
ding-group-bot-webhook main.go
package main
import (
"fmt"
"log"
"github.com/PuerkitoBio/goquery"
"github.com/go-redis/redis"
"net/http"
"bytes"
"github.com/astaxie/beego/toolbox"