# install parallel if you don't have one
brew install parallel
chmod +x convert.sh
./convert.sh
# delete opus files
find . -type f -name '*.opus' -delete
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
func appendStringsIfMissing(slice []string, elements ...string) (out []string) { | |
out = slice | |
outer: | |
for _, element := range elements { | |
for _, e := range slice { | |
if e == element { | |
continue outer | |
} | |
} | |
out = append(out, element) |
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
require 'http' | |
require 'openssl' | |
require 'digest/md5' | |
module WxPay | |
class << self | |
attr_accessor :appid, :mch_id, :key, :appsecret | |
attr_reader :apiclient_cert, :apiclient_key | |
def apiclient_cert=(cert) |
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
module github.com/caiguanhao/fake-req | |
go 1.14 | |
require github.com/google/uuid v1.1.1 |
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
host = 'host' | |
user = 'user' | |
options = { | |
keys_only: true, | |
keys: [], | |
key_data: [ server_ssh_private_key ], | |
user_known_hosts_file: [], | |
known_hosts: Class.new do | |
def self.search_for(host, options={}) | |
fingerprint = server_ssh_fingerprint.split(/\s+/).last |
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 { RawSource } = require('webpack-sources') | |
class WebpackAssetsManifest { | |
apply (compiler) { | |
compiler.hooks.emit.tapAsync('WebpackAssetsManifest', (compilation, callback) => { | |
let entrypoints = compilation.entrypoints | |
for (const [name, entrypoint] of entrypoints) { | |
const js = [] | |
const css = [] | |
entrypoint.getFiles().forEach(file => { |
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
# gem 'http' | |
def send_tencent!(country_code, cellphone, code) | |
number = "+#{country_code}#{cellphone}" | |
json = { | |
PhoneNumberSet: [ number ], | |
TemplateID: '<YOUR TEMPLATE ID>', | |
TemplateParamSet: [ code.to_s ], | |
SmsSdkAppid: Rails.application.credentials.tencent_cloud_sms_app_id, | |
}.to_json |
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
let style = document.createElement('style') | |
document.head.appendChild(style) | |
document.addEventListener('scroll', () => { | |
let table = document.querySelector('.table') | |
if (!table) return | |
let navbar = document.querySelector('.navbar') | |
if (!navbar) return | |
let offset = table.getBoundingClientRect().top + window.scrollY - navbar.offsetHeight | |
let second = document.querySelector('.table > thead > tr:nth-child(2) > th') | |
let secondOffset = 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
class Cable { | |
constructor(options) { | |
this.options = options || {} | |
this.polled = 0 | |
wx.onSocketOpen(() => { | |
if (this.options.connected) { | |
this.options.connected() | |
} | |
this.resubscribe() | |
this.stopPolling() |
$ gem install htmlentities
$ echo -n '测试文本' | ruby -r htmlentities -e "puts HTMLEntities.new.encode(STDIN.read, :decimal)"
测试文本
NewerOlder