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
fn add(u: usize, i: i32) -> Option<usize> { | |
if i.is_negative() { | |
u.checked_sub(i.wrapping_abs() as u32 as usize) | |
} else { | |
u.checked_add(i as usize) | |
} | |
} | |
fn main() { | |
let u = 7; |
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
# --with-ssl is ignored and depends_on "libressl" doesn't work. | |
ENV.prepend_path "PKG_CONFIG_PATH", "#{Formula["libressl"].opt_lib}/pkgconfig" |
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
/* | |
From https://github.com/rust-lang/rust/issues/23596 | |
128-bit support | |
More usize & isize conversions | |
Lossless conversion between usize & isize <-> integers | |
Inlined functions | |
Removed self-casts and primitives with From<T> implementations | |
Note: usize & isize conversions valid on 32-bit & 64-bit word sizes. |
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
[ -e /etc/cloudflared ] || { | |
curl --fail https://raw.githubusercontent.com/yon2004/ubnt_cloudflared/master/cloudflared --output /usr/local/bin/cloudflared || die | |
chmod +x /usr/local/bin/cloudflared || die | |
ln -s /config/cloudflared /etc/cloudflared || die | |
[ -e /etc/cloudflared/config.yml ] || { | |
curl --fail https://raw.githubusercontent.com/yon2004/ubnt_cloudflared/master/config.yml --output /etc/cloudflared/config.yml || die | |
} |
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
# Runs an instance of pacproxy in the background which terminates with the current shell. | |
# Requires pacproxy (https://github.com/williambailey/pacproxy/releases). | |
# Must be sourced in the current shell with the command ". ./pacproxy.sh". | |
pacproxy -c http://proxy/proxy.pac -l 127.0.0.1:3128 -v & trap 'pkill -P $$' SIGINT SIGTERM EXIT && export HTTP_PROXY=http://127.0.0.1:3128 && export HTTPS_PROXY=$HTTP_PROXY |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>local.applescript</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>sh</string> | |
<string>-c</string> |
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
if [[ ! -o login && -x /usr/libexec/path_helper ]]; then | |
eval `/usr/libexec/path_helper -s` | |
fi |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>local.environment</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>launchctl</string> | |
<string>setenv</string> |