Skip to content

Instantly share code, notes, and snippets.

@luoyuping
luoyuping / batch_rm_macos_screen_picture.sh
Last active Sep 6, 2017
批量删除特定格式的文件
View batch_rm_macos_screen_picture.sh
ls -ltr |grep 'Screen Shot' | awk '{print "\047" $8" "$9" "$10" "$11" "$12 "\047" }' |xargs rm
ls -ltr |grep 'Screen Shot' | awk '{print "\047" $8" "$9" "$10" "$11" "$12 " "$13 "\047" }' |xargs rm
@luoyuping
luoyuping / gist:5647015ca96dd3d739bb91ef81379b19
Created Mar 25, 2018
sum all number in a file using awk
View gist:5647015ca96dd3d739bb91ef81379b19
awk '{ sum += $1 } END { print sum }'
@luoyuping
luoyuping / java
Last active May 24, 2018
Blog/UT/difference_for_mock_and_spy
View java
package com.sankuai.zcm.trade.core.reverse;
import javafx.beans.binding.When;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.mockito.Spy;
View 分区统计sql
SELECT
(
CASE
WHEN minute >= 0
AND minute < 60 THEN
"0~59s"
WHEN minute >= 60
AND minute < 90 THEN
"60~90s"
WHEN minute >= 90