这是一个油猴脚本,代码引用自zythum/mama2,我(Oaker)只是搬运。
功能:访问国内主流视频网站时,自动调用HTML播放器。暂时只做了初步的网址匹配。
cloud_view <- function(obj) { | |
withr::with_options( | |
list(viewer = function(url, ...) { | |
get_url_dir <- function(url) gsub("file://|/index.html", "", url) | |
server <- servr::httd( | |
dir = get_url_dir(url), | |
verbose = TRUE, | |
browser = FALSE | |
) | |
.vsc.browser(server$url, ...) |
#pragma once | |
#include <stdint.h> | |
//fnv1a 32 and 64 bit hash functions | |
// key is the data to hash, len is the size of the data (or how much of it to hash against) | |
// code license: public domain or equivalent | |
// post: https://notes.underscorediscovery.com/constexpr-fnv1a/ | |
inline const uint32_t hash_32_fnv1a(const void* key, const uint32_t len) { |
# Instrument binaries, pgo data to /data/pgo, serial make is important to not confuse the pgo generator | |
env CXXFLAGS='-march=native -fprofile-dir=/data/pgo -fprofile-generate=/data/pgo' cmake .. -DCMAKE_BUILD_TYPE=Release | |
make -j 1 | |
# Run instrumented program, generate and write pgo data | |
./runIt | |
# Use profile data and feed into gcc, correct for threading counter noise, serial make is important to not confuse the pgo generator | |
env CXXFLAGS='-march=native -fprofile-dir=/data/pgo -fprofile-use=/data/pgo -fprofile-correction' cmake .. -DCMAKE_BUILD_TYPE=Release | |
make -j 1 |
这是一个油猴脚本,代码引用自zythum/mama2,我(Oaker)只是搬运。
功能:访问国内主流视频网站时,自动调用HTML播放器。暂时只做了初步的网址匹配。
Inspired by recent @johnmyleswhite tweets on indexing (though they focus more on NA stuff)
My standard advice to R novices is "don't worry about numeric vs integer too much, for now", but I just created an indexing example that scares me.
I did not realize it was sooo easy to create this gotcha when indexing with numeric (which I know is not a great idea).
#!/path/2/Rscript | |
# License: CC0 (just be nice and point others to where you got this) | |
# Author: Robert M Flight <[email protected]>, github.com/rmflight | |
# | |
# This is a post-commit hook that after a successful commit subsequently increments the package version in DESCRIPTION | |
# and commits that. Analogous to the pre-commit at https://gist.github.com/rmflight/8863882, but useful if you only have | |
# good reasons for not doing it on the pre-commit. | |
# | |
# To install it, simply copy this into the ".git/hooks/post-commit" file of your git repo, change /path/2/Rscript, and make |