Skip to content

Instantly share code, notes, and snippets.

View hangj's full-sized avatar
🥏
happy coding

hangj hangj

🥏
happy coding
View GitHub Profile
@hangj
hangj / deploy.lua
Last active September 20, 2019 15:12 — forked from samael500/handler.lua
Validating payloads from GitHub webhooks with Nginx + Lua
-- $ sudo opm get jkeys089/lua-resty-hmac
local shell = require "resty.shell"
local cjson = require "cjson.safe"
local hmac = require "resty.hmac"
local secret = '<MY SUPER SECRET>'
local event = 'push'
local branch = 'refs/heads/master'
@hangj
hangj / runOrReloadOpenresty.sh
Last active September 16, 2019 07:13
run/reload openresty
#!/usr/bin/bash
cd ~/work/ || exit
sudo openresty -p `pwd` -c conf/nginx.conf -t || exit
ps -ef | grep openresty | grep -v grep
if [ $? -eq 0 ]
then