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
// ==UserScript== | |
// @name Show Failures by Test | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://evergreen.mongodb.com/version/* | |
// @grant none | |
// ==/UserScript== |
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
// ==UserScript== | |
// @name Compact Waterfall Summary | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Make it Smaller | |
// @author Mathias Stearn | |
// @match https://evergreen.mongodb.com/waterfall/* | |
// @grant none | |
// ==/UserScript== | |
// vim: sts=2 sw=2: |
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 <type_traits> | |
/** | |
* Test that 'Code' fails to compile. | |
* 'Type' is aliased to 'Alias' and it must be used in 'Code' | |
*/ | |
#define COMPILE_FAIL_TEST(Name, Type, Alias, Code) \ | |
struct Name { \ | |
template <typename Alias> \ | |
static auto compiles(Alias && ) -> decltype((void)(Code), std::true_type()); \ |
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
class OpDebug : public Decorable<OpDebug> { | |
public: | |
// | |
// Removed existing members for brevity. | |
// | |
class Extension { | |
virtual void appendToString(StringBuilder*) = 0; | |
virtual void appendToBson(BSONObjBuilder*) = 0; |
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 <utility> | |
template <typename T> using some_iterator_type = T*; | |
template <typename T> struct ptr {}; // from mongo ptr.h | |
// Defining concepts using struct syntax. These are like interfaces, but not in | |
// the virtual-dispatch sense. Actual Cursor implementations must have an API | |
// that is usable as-if it had these signatures, even if the types don't match. | |
#define concept struct | |
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 <boost/static_assert.hpp> | |
#include <type_traits> | |
#include <vector> | |
int main() { | |
////////////////// PROXY OBJECTS ///////////////// | |
{ | |
auto bools = std::vector<bool>{true, false}; |
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
// pseudo-c++ | |
// | |
// High Level Examples | |
// | |
void insert(BSONObj obj, bool shouldLogOp) { | |
do { | |
WriteUnitOfWork wunit; | |
if (!collection) |
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
// Example Query | |
db.runCommand({aggregate:'zips', | |
explain:true, | |
pipeline: [ | |
{$group: {_id:'$state', totalPop: {$sum:'$pop'}}}, | |
{$sort: {totalPop:1}}, | |
{$limit:10}]}) | |
// Unsharded: | |
{ |
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
/** A generic non-owning pointer type for function arguments. | |
* It will convert from any pointer type except auto_ptr. | |
* Semantics are the same as passing the pointer returned from get() | |
* const ptr<T> => T * const | |
* ptr<const T> => T const * or const T* | |
*/ | |
template <typename T> | |
struct ptr { | |
ptr() : _p(NULL) {} |
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
$ convert - /tmp/o.png << EOF | |
P1 | |
# This is an example bitmap of the letter "J" | |
6 10 | |
0 0 0 0 1 0 | |
0 0 0 0 1 0 | |
0 0 0 0 1 0 | |
0 0 0 0 1 0 | |
0 0 0 0 1 0 | |
0 0 0 0 1 0 |