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 sys | |
from os.path import getsize, join | |
from pathlib import Path | |
from subprocess import DEVNULL, PIPE, Popen | |
rootpath = sys.argv[1] | |
audio_suffices = [".mp3", ".flac", ".m4a", ".aac"] | |
for root, dirs, files in os.walk(rootpath): | |
if len(files) == 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
import youtube_dl | |
writethumbnail = True | |
postprocessors = [] | |
postprocessors.append({"key": "FFmpegMetadata"}) | |
postprocessors.append( | |
{"key": "EmbedThumbnail", "already_have_thumbnail": writethumbnail} | |
) | |
ydl_opts = { |
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
" General Settings | |
set incsearch true | |
set smoothscroll true | |
set theme default | |
set editorcmd gvim | |
set searchurls.gh https://github.com/search?utf8=✓&q= | |
set searchurls.douban https://www.douban.com/search?q= |
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/env python3 | |
import sys | |
import os | |
jpg = sys.argv[1] | |
with open(jpg, "rb") as f: | |
b = f.read() | |
start_of_archive = b.find(b"\xff\xd9") + 2 | |
out_fname = os.path.splitext(jpg)[0] + ".zip" | |
with open(out_fname, "wb") as f: |
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
<!-- https://codepen.io/jessenwells/pen/pJrJjp --> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<script src= | |
"https://static.codepen.io/assets/editor/live/console_runner-1df7d3399bdc1f40995a35209755dcfd8c7547da127f6469fd81e5fba982f6af.js"></script> | |
<script src= | |
"https://static.codepen.io/assets/editor/live/css_reload-5619dc0905a68b2e6298901de54f73cefe4e079f65a75406858d92924b4938bf.js"></script> | |
<meta name="robots" content="noindex"> |
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
/* | |
* Copyright (c) 2016-present, Yann Collet, Facebook, Inc. | |
* All rights reserved. | |
* | |
* This source code is licensed under both the BSD-style license (found in the | |
* LICENSE file in the root directory of this source tree) and the GPLv2 (found | |
* in the COPYING file in the root directory of this source tree). | |
* You may select, at your option, one of the above-listed licenses. | |
*/ |
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
--- | |
Language: Cpp | |
# BasedOnStyle: LLVM | |
AccessModifierOffset: -4 | |
ConstructorInitializerIndentWidth: 4 | |
AlignEscapedNewlinesLeft: false | |
AlignTrailingComments: true | |
AllowAllParametersOfDeclarationOnNextLine: true | |
AllowShortBlocksOnASingleLine: false | |
AllowShortIfStatementsOnASingleLine: false |
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/env python3 | |
import json | |
import urllib.request | |
import sys | |
template = '''\ | |
# Maintainer: BennyYip <yebenmy@protonmail.com> | |
pkgname={pkgname} | |
_pkgname={name} |
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/env python | |
import os | |
fasd = os.path.expandvars('$HOME/.fasd') | |
z = os.path.expandvars('$HOME/.z') | |
with open(fasd) as in_f, open(z, 'w') as out_f: | |
for line in in_f: | |
x = line.split('|') | |
if not os.path.isdir(x[0]): | |
continue | |
x[1] = str(int(float(x[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
#!/bin/sh | |
rm -f src/auto/config.cache | |
make clean || true | |
make distclean || true | |
CFLAGS='-g -O2' STRIP=true ./configure --prefix=$HOME/.local --localstatedir=$HOME/.local/var/lib/vim --mandir=$HOME/.local/share/man --enable-acl --disable-gui --without-x --disable-fontset --disable-xsmp --enable-pythoninterp --enable-perlinterp=dynamic --enable-cscope --enable-multibyte --with-features=huge --enable-terminal --enable-fail-if-missing | |
echo 'Building...' |
NewerOlder