Skip to content

Instantly share code, notes, and snippets.

View reza-rahman-rx's full-sized avatar
🎯
Focusing

Reza reza-rahman-rx

🎯
Focusing
View GitHub Profile
let bitOne = 0b100111
let bitTwo = 0b101000
print(String(bitOne|bitTwo, radix: 2)) // Print the binary OR output 101111
let bitOne:UInt8 = 0b01101110
print(String(~bitOne, radix:2)) // Output 10010001
let bitOne = 0b100111
let bitTwo = 0b101000
print(String(bitOne^bitTwo, radix: 2)) // Print the binary XOR output 1111 which is actually 01111
let bitOne = 0b100111
let bitTwo = 0b101000
print(String(bitOne<<2, radix: 2)) // Print the output 10011100
print(String(bitOne>>2, radix: 2)) // Print the output 1001
var bitOne = 0b00000001
var maskingBit = 0b00000000
// Retrieve the state of the bit of the first digit from right side of bitOne
print(String(bitOne|maskingBit, radix: 2)) // Print 1, which indicates the first digit from the right of bitOne is 1
// Turn on the first digit of bitOne no matter what the previous bit was
bitOne = bitOne|maskingBit
// Turn off the first digit of bitOne
@reza-rahman-rx
reza-rahman-rx / Grafana Dashboard.json
Created December 8, 2023 08:10
Grafana Dashboard
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}