View front-matter.yml
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
--- | |
layout: post | |
title: xxx | |
slug: xxx | |
date: 2020-08-07 9:08 | |
status: publish | |
author: roccoshi | |
categories: | |
- xxxx | |
tags: |
View ffmpeg
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
ffmpeg -i video.mp4 -i audio.wav -c:v copy -c:a aac -strict experimental -map 0:v:0 -map 1:a:0 output.mp4 |
View protect.js
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
<script type="text/javascript"> | |
document.onkeydown = function(){ | |
if(window.event && window.event.keyCode == 123) { | |
alert("F12 is blocked"); | |
event.keyCode=0; | |
event.returnValue=false; | |
} | |
if(window.event && window.event.keyCode == 13) { | |
window.event.keyCode = 505; |
View telegram-bot.gs
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
function doGet(e){ | |
return HtmlService.createHtmlOutput("你好,我是一个新的机器人服务请求!"); | |
} | |
function doPost(e){ | |
var dataFromTelegram = { | |
"method": "post", | |
"payload": e.postData.contents | |
} |
View googlevoice-bot.gs
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
function autoReplier() { | |
var labelObj = GmailApp.getUserLabelByName('autoreply'); | |
var gmailThreads; | |
var messages; | |
var sender; | |
for (var gg = 0; gg < labelObj.getUnreadCount(); gg++) { | |
gmailThreads = labelObj.getThreads()[gg]; | |
messages = gmailThreads.getMessages(); | |
for (var ii = 0; ii < messages.length; ii++) { |
View whiteSquare.py
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
from PIL import Image | |
import os | |
# JPG文件 | |
def jpg_square(im, min_size=256, fill_color=(255, 255, 255)): | |
x, y = im.size | |
size = max(min_size, x, y) | |
new_im = Image.new('RGB', (size, size), fill_color) | |
new_im.paste(im, (int((size - x) / 2), int((size - y) / 2))) | |
return new_im |
View concat.py
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
import os | |
import PIL.Image as Image | |
def resize_by_width(infile, image_size): | |
"""按照宽度进行所需比例缩放""" | |
im = Image.open(infile) | |
(x, y) = im.size | |
lv = round(x / image_size, 2) + 0.01 |
View Dijkstra.cpp
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
/** | |
* author: roccoshi | |
* created: 2021-03-08 21:34:14 | |
* description: | |
dijkstra + priority_queue | |
test_cases: | |
node1 node2 distance | |
[[1,2,3],[1,3,3],[2,3,1],[1,4,2],[5,2,2],[3,5,1],[5,4,10]] | |
*/ | |
#pragma GCC diagnostic ignored "-Wsign-conversion" |
View gh-check
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
#!/usr/bin/python3 | |
import asyncio | |
import time | |
import socket | |
import argparse | |
import aiohttp | |
class MyConnector(aiohttp.TCPConnector): |
View crc32crack.cpp
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
#include <bits/stdc++.h> | |
using namespace std; | |
#define CRCPOLYNOMIAL 0xEDB88320 | |
vector<unsigned long> crc_table(255, 0); | |
string buffer; | |
void get_crc_table() { | |
unsigned long crc; | |
int i, j; |
OlderNewer