-
安装 https://github.com/swiftbar/SwiftBar
brew install swiftbar
-
实现一个网页服务器,用来存当前歌词,并提供一个接口查询当前歌词。 见下方
main.go
.
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
// see: | |
// https://github.com/hunshcn/gh-proxy | |
// 首页静态文件 | |
const ASSET_URL = 'https://hunshcn.github.io/gh-proxy/' | |
// 前缀, 如果自定义路由为 example.com/gh/*, 将 PREFIX 改为 '/gh/', 注意, 少一个杠都会错! | |
const PREFIX = '/' | |
// 分支文件使用 jsDelivr 镜像的开关, 0 为关闭, 默认关闭 | |
const Config = { | |
jsdelivr: 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
--[[-- | |
show lyrics on visualization 在可视化界面显示歌词 | |
url 项目地址: https://gist.github.com/youthlin/a3b3fc033586bede6046086f3d889322 | |
author 作者: youthlin | |
author url 作者博客: https://youthlin.com | |
How to install: | |
1. put this file on lua/intf/ | |
2. enable extra interface: luaintf (Settings[Show all] -> Interface -> Main Interfaces -> extract modules='luaintf'[make the 'Lua interpreter' checked]) | |
(important: extraintf=luaintf not lua) |
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
package xxx; | |
import com.alibaba.dubbo.common.URL; | |
import com.alibaba.dubbo.common.extension.ExtensionLoader; | |
import com.alibaba.dubbo.rpc.Invocation; | |
import com.alibaba.dubbo.rpc.Invoker; | |
import com.alibaba.dubbo.rpc.cluster.LoadBalance; | |
import com.alibaba.dubbo.rpc.cluster.loadbalance.AbstractLoadBalance; | |
import com.alibaba.dubbo.rpc.cluster.loadbalance.ConsistentHashLoadBalance; | |
import com.alibaba.dubbo.rpc.cluster.loadbalance.RandomLoadBalance; |
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/bash | |
#by youthlin.chen https://youthlin.com | |
dir=`pwd` | |
file=`curl -I "https://cn.bing.com/ImageResolution.aspx?w=1920&h=1080" 2>/dev/null | grep Location | awk '{print $2}'` | |
file=${file%_*} | |
file="${file}_1920x1080.jpg" | |
url="https://cn.bing.com$file" | |
file=${file##*/} | |
today=`date +%Y%m%d` | |
file="${today}_${file}" |
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 java.io.*; | |
import java.net.HttpURLConnection; | |
import java.net.URL; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.Scanner; | |
public class Downloader { | |
private static final String urlListFile = "out.txt"; |
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
<?php | |
echo "<h1>Hello, World</h1>" . PHP_EOL; | |
echo "<p>Welcome</p>" . PHP_EOL; | |
$img = "{$_SERVER["REQUEST_SCHEME"]}://{$_SERVER["HTTP_HOST"]}/uploads/qtalk.jpg"; | |
$prefix = $_SERVER["REQUEST_SCHEME"] . "://" . $_SERVER["HTTP_HOST"] . "/"; | |
echo "$prefix<br>" . PHP_EOL; | |
if(0 === strpos($img, $prefix)){ | |
$img = substr($img, strlen($prefix)); | |
$path = realpath($img); |
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 java.util.Scanner; | |
/* UTF8 转 Unicode */ | |
public class A { | |
public static void main(String[] args) { | |
Scanner in = new Scanner(System.in); | |
String line; | |
while (in.hasNextLine()) { | |
line = in.nextLine(); |
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
System.out.println("What's this"); |