Skip to content

Instantly share code, notes, and snippets.

View jackrex's full-sized avatar
🎯
Focusing

Jackrex jackrex

🎯
Focusing
View GitHub Profile
@marksnoopy
marksnoopy / google-shell-style-zh.md
Last active August 28, 2023 05:22
Google Shell 编码规范

Analytics

1、背景

(1)用哪种 Shell

Bash 是唯一一种允许被执行的 Shell 脚本语言.

#!/bin/bash 开头用来保持文件的可执行. 使用 set 设定 Shell 参数来调用你的 Shell 脚本,从而保证你的脚本不被中断

@StuPig
StuPig / clean_branch.sh
Created November 7, 2014 08:35
git分支清理脚本 script to clean git remote branches
#!/bin/bash
echo '***********************************';
echo '*';
echo -e '*\t分支清理';
echo '*';
echo '***********************************';
echo '';
# 切到主干分支develop,更新远程分支
@aramonc
aramonc / distance.sql
Last active August 31, 2024 11:29
MySQL function to calculate the distance between two coordinates using the Haversine formula. Leaving it here for future reference.
DELIMITER $$
CREATE FUNCTION `haversine` (lat1 DECIMAL(8,6), lng1 DECIMAL(8,6), lat2 DECIMAL(8,6), lng2 DECIMAL(8,6)) RETURNS DECIMAL(8,6)
BEGIN
DECLARE R INT;
DECLARE dLat DECIMAL(30,15);
DECLARE dLng DECIMAL(30,15);
DECLARE a1 DECIMAL(30,15);
DECLARE a2 DECIMAL(30,15);
DECLARE a DECIMAL(30,15);
DECLARE c DECIMAL(30,15);