Skip to content

Instantly share code, notes, and snippets.

@miguelmota
miguelmota / crypto.go
Last active June 5, 2024 14:28
Golang SHA256 hash example
package crypto
import (
"crypto/sha256"
)
// NewSHA256 ...
func NewSHA256(data []byte) []byte {
hash := sha256.Sum256(data)
return hash[:]
@whour
whour / Sublime Text Licence Key Build 3156
Created December 12, 2017 02:49 — forked from dr3772/Sublime Text Licence Key Build 3156
Sublime Text Dev Build 3156 Serial Key
----- BEGIN LICENSE -----
eldon
Single User License
EA7E-1122628
C0360740 20724B8A 30420C09 6D7E046F
3F5D5FBB 17EF95DA 2BA7BB27 CCB14947
27A316BE 8BCF4BC0 252FB8FF FD97DF71
B11A1DA9 F7119CA0 31984BB9 7D71700C
2C728BF8 B952E5F5 B941FF64 6D7979DA
B8EB32F8 8D415F8E F16FE657 A35381CC
@antlis
antlis / ga.pug
Last active November 26, 2019 18:44
Google analytics pug mixin
mixin ga(id)
//- Pass your ga id, as an attribute, eg. +ga('yourid12345')
script.
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
e.src='https://www.google-analytics.com/analytics.js';
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
ga('create', !{id});ga('send','pageview');
@dopey
dopey / main.go
Last active April 22, 2025 12:17 — forked from denisbrodbeck/main.go
How to generate secure random strings in golang with crypto/rand.
package main
import (
"crypto/rand"
"encoding/base64"
"fmt"
"io"
"math/big"
)
@asm-jaime
asm-jaime / go-gin-mgo.go
Last active February 20, 2021 21:13
go gin mgo, gin+mongo+test example
package main
import (
"encoding/base64"
"fmt"
rand "math/rand"
"time"
"github.com/gin-gonic/gin"
@youfou
youfou / wxpy_tips_1_search.md
Last active May 25, 2017 10:16
wxpy 小技巧 (1) -- 搜索

wxpy 小技巧 (1) -- 搜索

wxpy 除了用于自动回复外,在搜索方面也很拿手。

是指在自己的好友或已加入的群聊中进行搜索

这里举个针对群的例子~


@youfou
youfou / tuling_reply.py
Last active March 13, 2017 09:29
利用wxpy内置的图灵机器人自动回复指定好友
from wxpy import *
bot = Bot()
tuling = Tuling('你的 API KEY (http://www.tuling123.com/)')
my_friend = ensure_one(bot.friends().search('好友的名称'))
@bot.register(my_friend, TEXT)
def tuling_reply(msg):
@youfou
youfou / ad_urls.json
Last active September 9, 2023 14:50
响应好友请求 / 自动聊天 / 限制频率 / 邀请入群 / 远程群管理 / 新人欢迎消息 / 关键词问答 / 发心跳 / 远程命令 / 远程执行代码
{
"xiaohongshu.com": "小红书",
"vip.com": "唯品会",
"douguo.com": "豆果美食",
"youshu.cc": "有书",
"missfresh.cn": "每日优鲜",
"qnr.io": "去哪儿",
"kaola.com": "网易考拉",
"waimai.meituan.com": "美团外卖",
"qcs.meituan.com": "美团打车",
@logaretm
logaretm / axiosPlugin.js
Last active October 23, 2018 09:55
Axios plugin to replace vue-resource
import axios from 'axios';
export default (Vue) => {
Object.defineProperties(Vue.prototype, {
$http: {
get() {
return axios;
}
}
});
@erans
erans / main.go
Last active June 5, 2024 14:36
Go Example: Google CloudSQL with CloudSQL Proxy and GORM
package main
import (
"github.com/jinzhu/gorm"
_ "database/sql"
_ "github.com/GoogleCloudPlatform/cloudsql-proxy/proxy/dialers/mysql"
)
// You can read more in this post: http://forecastcloudy.net/2016/06/28/using-google-cloud-sql-from-go-with-gorm-in-google-container-engine-and-google-compute-engine/
func main() {