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
# | |
# Powershell script for adding/removing/showing entries to the hosts file. | |
# | |
# Known limitations: | |
# - does not handle entries with comments afterwards ("<ip> <host> # comment") | |
# | |
$file = "C:\Windows\System32\drivers\etc\hosts" | |
function add-host([string]$filename, [string]$ip, [string]$hostname) { |
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
# 更新所有子目录的git仓库 | |
for dir in $(find . -maxdepth 2 -mindepth 2 -type d | xargs); do (echo "$dir" && cd "$dir" && git pull); done | |
# 按月统计所有仓库的提交次数 | |
for dir in $(find . -maxdepth 2 -mindepth 2 -type d | xargs); do (echo "$dir" && cd "$dir" && git-quick-stats -m | sed '1,3d' | awk '{print $1, $2}' >> /mnt/e/report/commit.txt); done |
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 ssl | |
from typing import List | |
from urllib.parse import urlparse | |
from xml.etree import ElementTree as ET | |
import feedparser | |
import requests | |
from bs4 import BeautifulSoup, ResultSet | |
ssl._create_default_https_context = ssl._create_unverified_context |
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
If you use the findAll(Specification, Pageable) method, a count query is first executed and then the | |
data query is executed if the count returns a value greater than the offset. | |
For what I was doing I did not need pageable, but simply wanted to limit my results. This is easy | |
to do with static named queries and methodNameMagicGoodness queries, but from my research (googling | |
for a few hours) I couldn't find a way to do it with dynamic criteria queries using Specifications. | |
During my search I found two things that helped me to figure out how to just do it myself. | |
1.) A stackoverflow question. |
OlderNewer