Skip to content

Instantly share code, notes, and snippets.

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

Xiaoyu dingdayu

💭
I may be slow to respond
View GitHub Profile
@shoyuf
shoyuf / alfred-terminal.applescript
Last active September 2, 2020 03:43
open iTerm 2 and exec script on Alfred
on alfred_script(q)
tell application "System Events" to set isRunning to exists (processes where name is "iTerm2")
if isRunning then
tell application "iTerm2" to set hasWindow to exists (windows)
if hasWindow then
tell application "iTerm2"
tell current window to create tab with default profile
tell current session of current window to write text q
end tell
else
@sunny352
sunny352 / install_docker.sh
Last active April 1, 2024 06:51
CentOS 7 安装 docker-ce 和 docker-compose 并设置腾讯云容器镜像源的脚本
#!/usr/bin/env bash
# 安装docker(使用阿里云源)
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum -y install docker-ce
systemctl start docker
# 迁移docker目录(可选)
systemctl stop docker docker.socket
#!/usr/bin/env python2
# lrdcq
# usage python2 unwxapkg.py filename
import sys, os
import struct
class WxapkgFile(object):
nameLen = 0

Install dlib and face_recognition on a Raspberry Pi

Instructions tested with a Raspberry Pi 2 with an 8GB memory card. Probably also works fine on a Raspberry Pi 3.

Steps

Download the latest Raspbian Jessie Light image. Earlier versions of Raspbian won't work.

Write it to a memory card using Etcher, put the memory card in the RPi and boot it up.

@walm
walm / main.go
Last active September 21, 2025 16:52
Simple Golang DNS Server
package main
import (
"fmt"
"log"
"strconv"
"github.com/miekg/dns"
)
@tonyc726
tonyc726 / exchange.js
Created December 24, 2015 11:45
JS数字金额大写转换
var digitUppercase = function(n) {
var fraction = ['角', '分'];
var digit = [
'零', '壹', '贰', '叁', '肆',
'伍', '陆', '柒', '捌', '玖'
];
var unit = [
['元', '万', '亿'],
['', '拾', '佰', '仟']
];

註:Formula 就是套件名稱,你在官方文件或 help 上會經常看到 FORMULA... 這個英文字彙,在 Homebrew 中,它即是套件名稱。

  • 查看有哪些指令可以使用
% brew help
  • 查詢有無 MongoDB 的套件
% brew search mongodb
@lyoshenka
lyoshenka / ngrok-selfhosting-setup.md
Last active September 28, 2025 09:54
How to setup Ngrok with a self-signed SSL cert

Intro

The plan is to create a pair of executables (ngrok and ngrokd) that are connected with a self-signed SSL cert. Since the client and server executables are paired, you won't be able to use any other ngrok to connect to this ngrokd, and vice versa.

DNS

Add two DNS records: one for the base domain and one for the wildcard domain. For example, if your base domain is domain.com, you'll need a record for that and for *.domain.com.

Different Operating Systems

title description date categories slug
QQ协议分析
QQ协议分析
2014-04-16
protocol
qq-protocol

一. 文字聊天协议族(TCPF, Text Chatting Protocol Family)

@ardan-bkennedy
ardan-bkennedy / GoMgoSample-1.go
Last active January 31, 2025 09:00
Sample Go and MGO example
type (
// BuoyCondition contains information for an individual station.
BuoyCondition struct {
WindSpeed float64 `bson:"wind_speed_milehour"`
WindDirection int `bson:"wind_direction_degnorth"`
WindGust float64 `bson:"gust_wind_speed_milehour"`
}
// BuoyLocation contains the buoy's location.
BuoyLocation struct {