Skip to content

Instantly share code, notes, and snippets.

View wonderstory's full-sized avatar

wonderstory

View GitHub Profile
@wonderstory
wonderstory / _Flask_.md
Created June 1, 2017 06:09
Flask-uWSGI-nginx on CentOS 7

Small sample of Flask app with uWSGI and nginx on CentOS 7

(Replace example.com, /PATH/TO/CONTENT, APPNAME and USERNAME with yours.)

operations

nginx

$ sudo tee /etc/yum.repos.d/nginx.repo << 'EOF' > /dev/null

[nginx]

@wonderstory
wonderstory / webhook-receiver.py
Last active June 11, 2017 16:03
Validating payloads with secret token from GitHub on Flask app
import os
from flask import Flask, request, abort
import hashlib
import hmac
import subprocess
app = Flask(__name__)
SECRET = os.environ['GITHUB_SECRET_TOKEN'] # Never hardcode
@wonderstory
wonderstory / shortcut.cs
Created September 25, 2017 17:58
handle windows shortcut file (.lnk)
// refer to COM -- Windows Script Host Object Model
var lnkPath = @"C:\hoge\hoge.lnk";
var shell = new IWshRuntimeLibrary.WshShell();
var shortcut = (IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut(lnkPath);
// operations
//shortcut.FullName
//shortcut.TargetPath
//shortcut.Arguments
@wonderstory
wonderstory / gpd-pocket2.reg
Created December 30, 2018 12:46
GPD Pocket2 keyboard layout example with Keyboard Firmware (Japan)
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,04,00,00,00,29,00,7d,00,46,00,29,00,\
5d,e0,3a,00,00,00,00,00
@wonderstory
wonderstory / salt_sample.md
Last active July 12, 2023 13:51
PlantUML Salt (GUI Wireframe) cheat sheet

PlantUML Salt (GUI Wireframe) cheat sheet

generated image

image