Code | Name | HTTP Mapping |
---|---|---|
0 | OK | 200 OK |
1 | CANCELLED | 499 Client Closed Request |
2 | UNKNOWN | 500 Internal Server Error |
3 | INVALID_ARGUMENT | 400 Bad Request |
4 | DEADLINE_EXCEEDED | 504 Gateway Timeout |
5 | NOT_FOUND | 404 Not Found |
6 | ALREADY_EXISTS | 409 Conflict |
7 | PERMISSION_DENIED | 403 Forbidden |
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
// This is based on https://github.com/nghttp2/nghttp2/blob/master/integration-tests/server_tester.go | |
package main | |
import ( | |
"bytes" | |
"crypto/tls" | |
"errors" | |
"fmt" | |
"log" | |
"net" |
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
// Thank you to the folks at the C++ slack channel, | |
// along with @lewissbaker for the excellent literature | |
// (even though it took me a few days to be convinced | |
// it really was so). | |
#include <uv.h> | |
#include <iostream> | |
#include <experimental/coroutine> |
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
inline std::vector<uint8_t> read_vector_from_disk(std::string file_path) | |
{ | |
std::ifstream instream(file_path, std::ios::in | std::ios::binary); | |
std::vector<uint8_t> data((std::istreambuf_iterator<char>(instream)), std::istreambuf_iterator<char>()); | |
return data; | |
} |
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
#include <sstream> | |
#include <iostream> | |
#include <iomanip> | |
std::string uint8_to_hex_string(const uint8_t *v, const size_t s) { | |
std::stringstream ss; | |
ss << std::hex << std::setfill('0'); | |
for (int i = 0; i < s; i++) { |
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
import QtQuick 2.9 | |
import QtQuick.Controls 2.2 | |
Column { | |
width: parent.width | |
height: parent.height | |
property alias model: columnRepeater.model | |
ListView { |
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
#include <QDateTime> | |
#include <QMap> | |
#include <QVector> | |
#include <QList> | |
#include <QDebug> | |
#define SIZE 10000000 | |
int array[SIZE]; | |
int main(){ |
Most of the hard work is done by @nateevans https://gist.github.com/nateevans/9958390
Thank you!
Requires Twig ^1.2 | ^2.0
{% extends 'knp_menu.html.twig' %}
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
get_latest_release() { | |
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api | |
grep '"tag_name":' | # Get tag line | |
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value | |
} | |
# Usage | |
# $ get_latest_release "creationix/nvm" | |
# v0.31.4 |
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
import QtQuick 2.4 | |
Column { | |
width: parent.width | |
height: parent.height | |
property alias model: columnRepeater.model | |
Repeater { | |
id: columnRepeater |
NewerOlder