This file contains hidden or 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/awk -f | |
BEGIN { FS = ":" } | |
{ | |
if (NF == 2) { | |
print $1*60 + $2 | |
} else if (NF == 3) { | |
split($1, a, "-"); | |
if (a[2] != "" ) { | |
print ((a[1]*24+a[2])*60 + $2) * 60 + $3; | |
} else { |
This file contains hidden or 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 | |
set -e | |
# Java process ID | |
PID="$(pgrep java)" | |
# convert `ps -o etime` output format to second | |
function psetime_converter() { | |
echo "$(cat -)" | awk ' |
This file contains hidden or 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
final private static CharSequenceTranslator quotes = buildAggregateTranslator(Mode.ENT_QUOTES); | |
final private static CharSequenceTranslator noquotes = buildAggregateTranslator(Mode.ENT_NOQUOTES); | |
private static AggregateTranslator buildAggregateTranslator(Mode mode) { | |
Map<CharSequence, CharSequence> map = new HashMap<>(); | |
if (mode == Mode.ENT_QUOTES) { | |
map.put("\"", """); // " - double-quote | |
map.put("'", "'"); // ' - apostrophe | |
} |
This file contains hidden or 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
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
int main() { | |
int fd; | |
char buf[2]; | |
fd = open("filename.txt", 2); |
This file contains hidden or 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
#include <stdio.h> | |
int main(int argc, char **argv) | |
{ | |
unsigned long a[1]; | |
a[3] = 0x7ffff7b36cebUL; | |
return 0; | |
} |
This file contains hidden or 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
trap ' | |
pids="$(jobs -p)" | |
if [[ "${pids}" != "" ]]; then | |
echo "terminated procs are below:" | |
ps auxww ${pids} | |
kill ${pids} > /dev/null | |
fi' EXIT |
This file contains hidden or 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
MM/dd(EEEEE) HH:mm:ss.S |
This file contains hidden or 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 enable_darkmode() { | |
set_darkmode "$1" "no" | |
} | |
function disable_darkmode() { | |
set_darkmode "$1" "yes" | |
} | |
function set_darkmode() { | |
app="$1" |
This file contains hidden or 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
tell application "Google Chrome" | |
set myURL to get URL of active tab of first window | |
set myTitle to get title of active tab of first window | |
end tell | |
tell application "Safari" to add reading list item myURL with title myTitle |
This file contains hidden or 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
:root { | |
--multirow-n-rows: 3; | |
} | |
#tabbrowser-tabs { | |
min-height: unset !important; | |
padding-inline-start: 0px !important; | |
} | |
#tabbrowser-tabs > .tabbrowser-arrowscrollbox > .arrowscrollbox-scrollbox { | |
display: flex; | |
flex-wrap: wrap; |