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
# https://talk.automators.fm/t/unminimize-windows-of-the-current-application/12360/5 | |
tell application id ("com.apple.systemevents") ¬ | |
to tell (process 1 where it is frontmost) ¬ | |
to tell (windows whose attribute named "AXMinimized"'s value is true) ¬ | |
to if (it exists) then set the value of its attribute named "AXMinimized" of item 1 to false |
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
# https://apple.stackexchange.com/questions/408019/dismiss-macos-big-sur-notifications-with-keyboard | |
my closeNotif() | |
on closeNotif() | |
tell application "System Events" | |
tell process "Notification Center" | |
set theWindow to group 1 of UI element 1 of scroll area 1 of window "Notification Center" | |
# click theWindow if you want to open the app | |
set theActions to actions of theWindow | |
repeat with theAction in theActions |
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
# https://apple.stackexchange.com/questions/408019/dismiss-macos-big-sur-notifications-with-keyboard | |
my closeNotif() | |
on closeNotif() | |
tell application "System Events" | |
tell process "Notification Center" | |
set theWindow to group 1 of UI element 1 of scroll area 1 of window "Notification Center" | |
# click theWindow if you want to open the app | |
set theActions to actions of theWindow | |
repeat with theAction in theActions |
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
#!/usr/bin/env bash | |
# | |
# Threadhold 값 (30%) 이상 CPU 점유하고 있는 프로세스 중 가장 높은 CPU 점유하고 있는 프로세스 반환합니다. | |
# Better Touch Tool과 연동하여 TaskBar에 노출시키기 위해 사용하거나 | |
# TextBar http://richsomerfield.com/apps/textbar/ 와 함께 사용할 수 있습니다. | |
# 5초에 한번 정도 실행하도록 설정하면 적당합니다. | |
# | |
# https://stackoverflow.com/questions/24129903/notifying-when-using-high-cpu-via-applescript-or-automator | |
SAMPLE_SIZE=2 |
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
$ SAMPLE_SIZE=3 | |
DELAY_SECS=1 | |
TOP_APP_NUM=5 # number of apps to sum up | |
$ /usr/bin/top -s $DELAY_SECS -l $SAMPLE_SIZE -n $TOP_APP_NUM -F -o cpu -stats cpu,pid,command | \ | |
grep -A$TOP_APP_NUM "%CPU" | |
%CPU PID COMMAND | |
0.0 99989 fish | |
0.0 99752 mdworker_shared | |
0.0 99640 CategoriesServic |
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
public class IfAndSwitch { | |
public static void ifFunc(int v) { | |
if (v == 1) { | |
System.out.println(1); | |
} else if (v == 2) { | |
System.out.println(2); | |
} | |
} | |
public static void switchFunc(int v) { |
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
public class Person { | |
int age = 10; | |
public int getAge() { | |
return age; | |
} | |
public void setAge(int age) { | |
this.age = age; | |
} |
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
javascript:(function(){if(location.host!='twitter.com')return;var hide=function(){$('.stream-item').has('.twitter-atreply').hide()};hide();$(document).ajaxSuccess(function(){setTimeout(hide,100)})})() |
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
(function() { | |
if (location.host != 'twitter.com') | |
return; | |
var hide = function() { | |
$('.stream-item').has('.twitter-atreply').hide(); | |
}; | |
hide(); | |
$(document).ajaxSuccess(function() { |