This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Canvas 助手方法 | |
*/ | |
export class CanvasUtil { | |
constructor (ctx, canvasWidth, canvasHeight) { | |
this.ctx = ctx | |
this.canvasWidth = canvasWidth | |
this.canvasHeight = canvasHeight | |
return this |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.onwheel = function (e) { | |
e.preventDefault(); | |
if (e.ctrlKey) { | |
// Your zoom/scale factor | |
scale -= e.deltaY * 0.01; | |
} else { | |
// Your trackpad X and Y positions | |
posX -= e.deltaX * 2; | |
posY -= e.deltaY * 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
; #Warn ; Enable warnings to assist with detecting common errors. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
Tab::Send {Tab} | |
Tab & J::Send {Down} | |
Tab & U::Send {Shift Down} | |
Tab & K::Send {Up} | |
Tab & I::Send {Shift Up} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
composes | |
@import | |
@extend | |
@mixin | |
@at-root | |
position | |
top | |
right | |
bottom | |
left |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"title": "HHKB modifiers for mutoe (Tab key)", | |
"rules": [ | |
{ | |
"description": "Change left_shift to caps_lock if pressed alone.", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "left_shift", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
signingkey = | |
name = mutoe | |
email = [email protected] | |
[core] | |
editor = vim | |
[diff] | |
tool = vimdiff | |
[difftool] | |
prompt = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http') | |
function getClientIp (req) { | |
const forwardedIpsStr = req.headers['x-forwarded-for'] | |
if (forwardedIpsStr) { | |
console.log('forwardedIpsStr: ' + forwardedIpsStr) | |
return forwardedIpsStr.split(',')[0] | |
} | |
console.log('remoteAddress: ' + req.connection.remoteAddress) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http') | |
const crypto = require('crypto') | |
const execFile = require('child_process').execFile | |
const port = 10010 | |
const secret = 'your_secret' | |
const bashFile = './onpush.sh' | |
const sign = data => `sha1=${crypto.createHmac('sha1', secret).update(data).digest('hex')}` |