global computerIsInUse, resetTime | |
on run | |
set computerIsInUse to true | |
set resetTime to (do shell script "date +%s") as integer | |
end run | |
on idle | |
set idleTime to (do shell script "ioreg -c IOHIDSystem | awk '/HIDIdleTime/ {print $NF; exit}'") as integer | |
if idleTime is greater than 7.4E+10 then |
Although below are methods to extract the contents of a macOS package without actually installing it, the best way might be to create a blank disk image and install the package to this disk image in order to inspect the package contents. To do so:
- Open the Disk Utility app.
- Choose "File > New Image > Blank Image". Alternatively, simply press CMD-N.
- Set the parameters and click on "Save" to create the blank disk image.
- After creation, it should be already mounted. If not, you can mount it by navigating to the directory that it is placed at and double clicking on the disk image file.
- Run the package installer by double clicking on the package file.
- Select this newly created blank disk image as the destination and install it.
- If the script is preventing you from installing by saying, for example, "macOS isn't installed", you can:
本文譯自 Julio Merino 2018 年七月撰寫的 Rust vs. Go 一文。Julio Merino 是 G 社僱員,在 G 社工作超過 8 年,無論工作內外,都接觸開發不少 Go 語言,並撰寫 [Rust 點評][rust-review]系列文,來聽聽他對 Rust 與 Go 的想法吧。
Thanks Julio Merino for this awesome article!
What is strict aliasing? First we will describe what is aliasing and then we can learn what being strict about it means.
In C and C++ aliasing has to do with what expression types we are allowed to access stored values through. In both C and C++ the standard specifies which expression types are allowed to alias which types. The compiler and optimizer are allowed to assume we follow the aliasing rules strictly, hence the term strict aliasing rule. If we attempt to access a value using a type not allowed it is classified as undefined behavior(UB). Once we have undefined behavior all bets are off, the results of our program are no longer reliable.
Unfortunately with strict aliasing violations, we will often obtain the results we expect, leaving the possibility the a future version of a compiler with a new optimization will break code we th
{ | |
"emojis": [ | |
{"emoji": "👩👩👧👧", "name": "family: woman, woman, girl, girl", "shortname": ":woman_woman_girl_girl:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F467", "html": "👩‍👩‍👧‍👧", "category": "People & Body (family)", "order": ""}, | |
{"emoji": "👩👩👧👦", "name": "family: woman, woman, girl, boy", "shortname": ":woman_woman_girl_boy:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F466", "html": "👩‍👩‍👧‍👦", "category": "People & Body (family)", "order": ""}, | |
{"emoji": "👩👩👦👦", "name": "family: woman, woman, boy, boy", "shortname": ":woman_woman_boy_boy:", "unicode": "1F469 200D 1F469 200D 1F466 200D 1F466", "html": "👩‍👩‍👦‍👦", "category": "People & Body (family)", "order": ""}, | |
{"emoji": "👨👩👧👧", "name": "family: man, woman, girl, girl", "shortname": ":man_woman_girl_girl:", "unicode": "1F468 200D 1F469 200D 1F467 200D 1F467", "html": "👨‍👩&z |
# User | |
git config --global user.name YOUR_NAME | |
git config --global user.email YOUR_EMAIL@gmail.com | |
git config --global core.editor vim | |
# Common | |
git config --global alias.st status | |
git config --global alias.ci commit | |
git config --global alias.co checkout | |
git config --global alias.br branch |
#!/bin/bash | |
# | |
# git-mv-with-history -- move/rename file or folder, with history. | |
# | |
# Moving a file in git doesn't track history, so the purpose of this | |
# utility is best explained from the kernel wiki: | |
# | |
# Git has a rename command git mv, but that is just for convenience. | |
# The effect is indistinguishable from removing the file and adding another | |
# with different name and the same content. |