Updated: 2025-12-22 11:55:22 CST
| # | Title | Score |
|---|---|---|
| 1 | Backing up Spotify | ▲1729 |
| 2 | Show HN: Jmail – Google Suite for Epstein files | ▲1394 |
| 3 | Go ahead, self-host Postgres | ▲652 |
| 4 | Flock and Cyble Inc. weaponize “cybercrime” takedowns to silence critics | ▲570 |
Updated: 2025-12-22 11:55:22 CST
| # | Title | Score |
|---|---|---|
| 1 | Backing up Spotify | ▲1729 |
| 2 | Show HN: Jmail – Google Suite for Epstein files | ▲1394 |
| 3 | Go ahead, self-host Postgres | ▲652 |
| 4 | Flock and Cyble Inc. weaponize “cybercrime” takedowns to silence critics | ▲570 |
| <?php | |
| // 驼峰命名法转蛇形命名法 | |
| function camel2snake ($camel) { | |
| if (false !== strpos($camel, '_')) { | |
| return $camel; | |
| } | |
| $capitalLetters = range('A', 'Z'); | |
| for ($i=1; $i < strlen($camel) - 1; $i++) { | |
| if (in_array($camel[$i], $capitalLetters)) { |
| <?php | |
| // 获取图片信息 | |
| $img_info = file_get_contents('https://cn.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&pid=hp&FORM=BEHPTB&video=1'); | |
| // 请求失败时,使用「Server 酱」将错误信息推送至绑定的微信 | |
| if (false === $img_info) { | |
| file_get_contents('https://sc.ftqq.com/xxx.send?text=' . urlencode('Get bing wallpaper error!')); | |
| } | |
| $img_obj = json_decode($img_info)->images[0]; |
| #!/bin/bash | |
| # Author: Palemoky | |
| # Fetch image | |
| img=$(curl -s 'https://bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&pid=hp&FORM=BEHPTB&video=1') | |
| img_path=$(jq .images[0].url <<< $img) | |
| img_name=$(jq .images[0].urlbase <<< $img) | |
| img_name=${img_name#*=} |
| #!/bin/bash | |
| # Author: Palemoky | |
| # Change directory to work path | |
| cd /path/to/work | |
| pages=$(curl -sG --data-urlencode "country=美国" 'https://ip.jiangxianli.com/api/proxy_ips' | jq .data.last_page) | |
| for page in $(eval echo {1..${pages}}); do |
| #!/bin/bash | |
| # Author: Palemoky | |
| email= | |
| domain= | |
| api_token= | |
| dns_identifier= | |
| zone_identifier= |
| <?php | |
| function uploadFile($fileInfo,$uploadPath = 'uploads',$maxSize = (2<<20),$allowExt = array('jpg','png','jpeg','gif','bmp'),$checkImg=true){ | |
| $filename = $fileInfo['name']; | |
| $type = $fileInfo['type']; | |
| $tmp_name = $fileInfo['tmp_name']; | |
| $size = $fileInfo['size']; | |
| $error = $fileInfo['error']; | |
| // $maxSize = (2<<20);//限制上传文件的大小为2M,以字节为单位 | |
| // $allowExt = array('jpg','png','jpeg','gif','bmp'); |
| <?php | |
| /** | |
| * Created by PhpStorm | |
| * User: Xinyu | |
| * Date: 16/8/25 | |
| * Time: 下午10:09 | |
| */ | |
| function unitConvert($scale){ | |
| if($scale >= (1<<30)){ | |
| $scale /= (1<<30); |