This file contains hidden or 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
{ | |
"description": "Volume keys to Volume keys with Ctrl + Option", | |
"manipulators": [ | |
{ | |
"from": { "key_code": "f11" }, | |
"to": [ | |
{ | |
"key_code": "volume_decrement", | |
"modifiers": ["left_shift", "left_option"] | |
} |
This file contains hidden or 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
[ | |
{ | |
"districts": [ | |
{ | |
"zip": "100", | |
"name": "中正區" | |
}, | |
{ | |
"zip": "103", | |
"name": "大同區" |
This file contains hidden or 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
function buildNext(pattern = '') { | |
const next = (new Array(pattern.length + 1)).fill(0) | |
let i = 0; | |
let j = 1 | |
while (j < pattern.length) { | |
if(pattern[i] === pattern[j]) { | |
i++ | |
j++ | |
next[j] = i |
This file contains hidden or 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
// ==UserScript== | |
// @name Auto-Login Eyny | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Auto login for eyny site | |
// @author You | |
// @match *://*.eyny.com/* | |
// @require https://code.jquery.com/jquery-3.6.0.min.js | |
// ==/UserScript== |
This file contains hidden or 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
<?php | |
// 修改顯示標籤的個數 | |
$tags_number = 25; | |
// 這邊可以修改標籤的順序,數字越大的排在越前面 | |
$tag_order = [ | |
'2019電商新趨勢' => 101, | |
'OMO' => 100, | |
'新零售' => 99, |
This file contains hidden or 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
-- Thank @sbengo to figure out foreign_keys constraints is defaults to false in sqlite | |
-- Enable to delete logs by cascading delete | |
PRAGMA foreign_keys = ON; | |
WITH n_build_ids_per_repo as ( | |
SELECT build_id | |
FROM ( | |
SELECT | |
build_id, | |
build_repo_id, |
This file contains hidden or 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
#!/bin/bash | |
set -e | |
echo "Increase pid_max limit" | |
echo "kernel.pid_max=4194304" >> /etc/sysctl.conf | |
sysctl -p | |
echo "Create 4G SWAP" | |
fallocate -l 4G /swapfile |
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'open3' | |
class String | |
def truncate(max, omission: '') | |
length > max ? "#{self[0...max - omission.length]}#{omission}" : self | |
end | |
end | |
COLUMN_WIDTH = 30 |
This file contains hidden or 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
// | |
// 建立 pattern 的最大共同前後綴表 | |
// | |
// 假設 pattern 為 ABCABA | |
// 建立的順序如下 | |
// A 0 | |
// AB 0 | |
// ABC 0 | |
// ABCA 1 | |
// ABCAB 2 |