View Grafana Dashboard.json
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
{ | |
"__inputs": [ | |
{ | |
"name": "DS_PROMETHEUS", | |
"label": "Prometheus", | |
"description": "", | |
"type": "datasource", | |
"pluginId": "prometheus", | |
"pluginName": "Prometheus" | |
} |
View maskingBit.swift
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
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 |
View bitwiseShift.swift
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
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 |
View bitwiseXor.swift
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
let bitOne = 0b100111 | |
let bitTwo = 0b101000 | |
print(String(bitOne^bitTwo, radix: 2)) // Print the binary XOR output 1111 which is actually 01111 |
View bitwiseNot.swift
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
let bitOne:UInt8 = 0b01101110 | |
print(String(~bitOne, radix:2)) // Output 10010001 |
View bitwiseOr.swift
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
let bitOne = 0b100111 | |
let bitTwo = 0b101000 | |
print(String(bitOne|bitTwo, radix: 2)) // Print the binary OR output 101111 |
View bitwiseAnd.swift
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
let bitOne = 0b100111 | |
let bitTwo = 0b101000 | |
print(String(bitOne&bitTwo, radix: 2)) // Print the binary AND output 100000 | |
View sample.html
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
<script src=”/socket.io/socket.io.js”></script> | |
<script> | |
$(document).ready(() => { | |
var socket = io(); | |
socket.on(‘generated notification’, notificationString => { | |
// show the notification | |
var notification | |
= new Notification(‘Notification,{ | |
title: ‘notificationString’, | |
}); |
View receivers.server.sockets.js
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
// /app/sockets/receivers.server.sockets.js | |
var socketIO; | |
exports.receivers = (io) => { | |
socketIO = io; | |
io.emit(‘generated notification’,’hello’); | |
} | |
// handle different type of notification. |
View socketio.js
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
var io=null; | |
exports.set = function(socketio) { | |
io=socketio; | |
}; | |
exports.get = function() { | |
return io; | |
}; |
NewerOlder