Skip to content

Instantly share code, notes, and snippets.

View friddle's full-sized avatar

copper friddle friddle

View GitHub Profile
@friddle
friddle / gist:bd57392e11d199be2901432c0405ef0f
Created July 11, 2022 01:25
AlsoIf(Java函数式的判断后执行操作)
/**
* AlsoIf.alsoIf(xxx,xxx,xx).alsoIf().get()
* 进行长条件判断.如果条件成立,则执行相应的操作.主要用于LambadaQuery上
* java lambda for predicate and do things
*/
@Slf4j
public class BizAlsoIf<R> {
R obj;
@friddle
friddle / BizLambdaUtil.java
Created July 11, 2022 01:36
BizLambdaUtil 常用的一些lambda工具函数类
@Slf4j
public class BizLambdaUtil {
public static<R> R alsoIf(R obj,boolean isIf,Consumer<R> consumer){
try {
if(isIf){
consumer.accept(obj);
}
return obj;
@friddle
friddle / gist:f8c93865e71bf1e02f702647edb5cce6
Created May 15, 2023 14:21
Create Steam Deck Desktop sh
#!/bin/bash
# Set the path to the Google Chrome binary
set +x
export url=$1
export desktop_folder="${HOME}/.local/share/application/"
origin_title=$(echo "$1"|awk -F "." '{print $2}')
title=$(curl -s $url| grep -o '<title>.*</title>' | sed -e 's/<title>//g' -e 's/<\/title>//g')
if [[ $title == "" ]];then
title=${origin_title}
@friddle
friddle / gist:3e433335728370e4e571cac465013eac
Created May 15, 2023 14:21
Create Steam Deck Desktop sh
#!/bin/bash
# Set the path to the Google Chrome binary
set +x
export url=$1
export desktop_folder="${HOME}/.local/share/application/"
origin_title=$(echo "$1"|awk -F "." '{print $2}')
title=$(curl -s $url| grep -o '<title>.*</title>' | sed -e 's/<title>//g' -e 's/<\/title>//g')
if [[ $title == "" ]];then
title=${origin_title}