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
| $ zig test src/main.zig | |
| ./src/main.zig:11:28: error: cannot store runtime value in compile time variable | |
| const d: u32 = c; | |
| ^ |
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
| --- | |
| - name: My playbook | |
| hosts: localhost | |
| vars: | |
| zabbix_agentd_d_dir: >- | |
| {% if ansible_facts['os_family'] == 'RedHat' -%} | |
| /etc/zabbix/zabbix_agentd.d | |
| {%- else -%} | |
| /etc/zabbix/zabbix_agentd.conf.d | |
| {%- endif %} |
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
| atob(`DES9N7bxsOmHupY4JsjDg6fZ7vaFIZaWDBASiCj6vN+S | |
| VYuCa9Bo5LdJHmeo+kpmK2PTvlShVkxpOwt59hGX6sdlT | |
| apaRgEGCB8FZt3iSkE9EdmShv5vmSv3oMrCoSFlqnLeGY | |
| 9Wh6hNCNx4nUfxtzjoExo494fUr+hZebjFTo5ow//oy22 | |
| fW8fuwieImoEm7y28eFSmN5ITVpjzDabYQBjYPgRpLStG | |
| jRMcsilxGH6Ud3nweSyqjimsCs6f2OL4JuoIfPTSVAP9/ | |
| hiab9VKmyBM3WbOVwAi+wLjoS6k1FcAcyjQo8HUM3v | |
| GALSnPn7w+wnD5YNKRdXPVpQ8tq+stidQzFdESSzajS7 | |
| rPC81pzrIjW3tXOkrDmusp/mEzfTEHOsFRq9eq3kOJr+ | |
| CXXSOhjXuSSPVNH1rt8JIDUts529LqAb5pPfYta1L4bD |
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
| use std::io; | |
| use std::io::prelude::*; | |
| fn main() -> io::Result<()> { | |
| let mut buffer = [0; 1]; | |
| loop { | |
| let n = io::stdin().read(&mut buffer)?; | |
| if n == 0 { | |
| break; | |
| } |
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
| #!/bin/bash | |
| if [ $# -ne 1 ]; then | |
| >&2 echo "Usage: $0 /path/to/cert_file" | |
| exit 1 | |
| fi | |
| cert_file="$1" | |
| certs=$(cat $cert_file) | |
| count=$(echo "$certs" | grep -c '^-----BEGIN CERTIFICATE-----') | |
| i=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
| const std = @import("std"); | |
| const assert = std.debug.assert; | |
| const maxInt = std.math.maxInt; | |
| const minInt = std.math.minInt; | |
| pub fn cast(comptime T: type, x: anytype) (error{Overflow}!T) { | |
| comptime assert(@typeInfo(T) == .Int); // must pass an integer | |
| comptime assert(@typeInfo(@TypeOf(x)) == .Int or | |
| @typeInfo(@TypeOf(x)) == .ComptimeInt); // must pass an integer or comptimeint | |
| if (x > maxInt(T)) { |
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
| pub const Transport = struct { | |
| pub fn send( | |
| self: *Transport, | |
| comptime Context: type, | |
| context: Context, | |
| comptime callback: fn ( | |
| context: Context, | |
| reuslt: usize, | |
| ) void, | |
| ) void { |
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
| package bm | |
| import ( | |
| "testing" | |
| ) | |
| var mb = map[string]bool{ | |
| "alpha": true, | |
| "beta": true, | |
| "gamma": true, |
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
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "math/rand" | |
| "sort" | |
| "time" | |
| ) |
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
| #!/bin/bash | |
| # apt-key-add - Alternative script for "apt-key add" which is deprecated in Ubuntu 20.10 | |
| # | |
| # example: | |
| # curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key-add - nodesource | |
| # instead of | |
| # curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add - | |
| # | |
| set -e | |
| if [ $# -ne 2 -o $UID -ne 0 ]; then |