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 pync import Notifier | |
from Foundation import NSUserNotificationCenter, NSObject, NSRunLoop, NSDate | |
class NotificationDelegate(NSObject): | |
def userNotificationCenter_didDeliverNotification_(self, center, notification): | |
title = notification.title() | |
subtitle = notification.subtitle() | |
message = notification.informativeText() | |
print(f"Received notification:\nTitle: {title}\nSubtitle: {subtitle}\nMessage: {message}\n") |
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 pync import Notifier | |
import time | |
def show_notification(title, subtitle, message): | |
Notifier.notify( | |
message, | |
title=title, | |
subtitle=subtitle, | |
sound='default', | |
timeout=10 |
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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"log" | |
"net/http" | |
"net/mail" | |
"os" | |
) |
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
Buffer::OwnedImpl buffer; | |
auto result = bio_io_handle(b)->read(buffer, outl); | |
/* TODO: avoid copying */ | |
buffer.copyOut(0, buffer.length(), out); |
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
auto fragment = new Buffer::BufferFragmentImpl(out, outl, | |
[](const void*, size_t, const Buffer::BufferFragmentImpl* this_fragment) { | |
delete this_fragment; | |
}); | |
Buffer::OwnedImpl buffer; | |
buffer.addBufferFragment(*fragment); |
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
// en source/extensions/transport_sockets/tls/io_handle_bio.cc | |
// NOLINTNEXTLINE(readability-identifier-naming) | |
int io_handle_read(BIO* b, char* out, int outl) { | |
if (out == nullptr) { | |
return 0; | |
} | |
Buffer::BufferFragmentImpl fragment(out, outl, | |
[](const void*, size_t, |
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
#!/usr/bin/env python3.7 | |
import argparse | |
import json | |
import random | |
import string | |
def get_params(): | |
parser = argparse.ArgumentParser() |
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
{ | |
"admin": { | |
"access_log_path": "/tmp/admin_access.log", | |
"address": { | |
"socket_address": { | |
"protocol": "TCP", | |
"address": "127.0.0.1", | |
"port_value": 9904 | |
} | |
} |
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
... | |
{ | |
"name": "prod", | |
"capacity": 0.995 | |
}, | |
{ | |
"name": "canary", | |
"capacity": 0.005 | |
} |
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
... | |
{ | |
"name": "prod", | |
"capacity": 0.995 | |
}, | |
{ | |
"name": "canary", | |
"capacity": 0.005 | |
} |
NewerOlder