Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am whtsky on github.
  • I am whtsky (https://keybase.io/whtsky) on keybase.
  • I have a public key whose fingerprint is 849B C953 6873 EFB9 E491 0C11 7E46 916F 1A78 0568

To claim this, I am signing this object:

import os
import shutil
import glob
WORKING_PATH = '/Volumes/Kindle/documents'
os.chdir(WORKING_PATH)
for n in glob.glob('*.sdr'):
name = n[:-4]
@whtsky
whtsky / random_string.py
Created July 19, 2014 15:44
Generate random string in Python
import random
s = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789^!\\$%&/()=?{[]}+~#-_.:,;<>|\\'
def create():
return ''.join([random.choice(s) for _ in range(16)])
@whtsky
whtsky / gitlab-retry.js
Created May 10, 2018 01:58
gitlab auto retry
function xxxci() {
$('.commit').map(function () {
if ($(this).find('.ci-failed')) {
try {
$(this).find('.js-pipelines-retry-button')[0].click()
$('.js-primary-button.btn-danger')[0].click()
} catch (e) {
}
}
})

作业提交1.2答案:

1.	
彻底的唯物主义一元论的根本要求是( )
	(A)	一切从实际出发
 
2.	
Process: mu [74693]
Path: /Applications/mu.app/Contents/MacOS/mu
Identifier: org.kreogist.mu
Version: 1.0b5 (1.0.0 Beta 5)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: mu [74693]
User ID: 501
Date/Time: 2018-07-13 13:07:33.421 +0800
Process: mu [16367]
Path: /Users/USER/Documents/*/mu.app/Contents/MacOS/mu
Identifier: org.kreogist.mu
Version: 1.0b5 (1.0.0 Beta 5)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: mu [16367]
User ID: 501
Date/Time: 2018-07-16 15:34:32.554 +0800
Get-ChildItem -Path 'D:\PATH' -Filter *pptx -Recurse |
ForEach-Object -Begin {
$null = Add-Type -AssemblyName Microsoft.Office.Interop.powerpoint
$SaveOption = [Microsoft.Office.Interop.PowerPoint.PpSaveAsFileType]::ppSaveAsPDF
$PowerPoint = New-Object -ComObject "PowerPoint.Application"
} -Process {
$Presentation = $PowerPoint.Presentations.Open($_.FullName)
$PdfNewName = $_.FullName -replace '\.pptx$','.pdf'
$presentation.SaveAs($PdfNewName,$SaveOption)
$presentation.close()
yarn config set puppeteer_download_host https://npm.taobao.org/mirrors
#!/bin/bash
clean_sdr_in_current_folder () {
find . -maxdepth 1 ! -path . -type d -print0 | while read -d $'\0' FOLDER
do
FOLDER=$(basename "$FOLDER")
if [[ $FOLDER == *".sdr" ]]; then
if [ -d "$FOLDER" -a ! -n "$(find . -maxdepth 1 -type f -name "${FOLDER%.sdr}*" -print -quit)" ]
then
echo "Remove $FOLDER"