View FigureExtParsedown.class.php
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
<?php | |
class FigureExtParsedown extends Parsedown { | |
// Matches Markdown image definition | |
private $MarkdownImageRegex = "~^!\[.*?\]\(.*?\)$~"; | |
public function __construct () { | |
// Add blockFigure to non-exclusive handlers for text starting with ! | |
$this->BlockTypes['!'][] = 'Figure'; |
View main.cpp
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 <gtest/gtest.h> | |
int main(int argc, char **argv) { | |
::testing::InitGoogleTest(&argc, argv); | |
return RUN_ALL_TESTS(); | |
} |
View test-example.cpp
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 <string> | |
#include <gtest/gtest.h> | |
TEST(ExampleTest, First) { | |
EXPECT_EQ(std::string("Example"), std::string("Example")); | |
} |
View test-exampleclass.cpp
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 <algorithm> | |
#include <vector> | |
#include <gtest/gtest.h> | |
class ExampleClass : public testing::Test { | |
protected: | |
virtual void SetUp() { | |
numbers.push_back(1); | |
numbers.push_back(2); |
View main.cpp
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 <string> | |
#include <iostream> | |
#include "optional.hpp" | |
int main() { | |
std::optional<std::string> empty; | |
std::cout << empty.value_or("no value") << std::endl; | |
} |
View optional.hpp
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
#ifndef OPTIONAL | |
#define OPTIONAL | |
#if __has_include(<optional>) | |
# include <optional> | |
#else | |
# include <experimental/optional> | |
namespace std { | |
template<typename T> | |
using optional = std::experimental::optional<T>; |
View wp-widget-connector-example.php
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
<?php | |
namespace kantoniak { | |
class AboutMe { | |
// ... | |
public function __construct() { |
View wp-widget-example.php
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
<?php | |
class MyNewWidget extends WP_Widget { | |
function __construct() { | |
// Instantiate the parent object | |
parent::__construct('mynewwidgetbaseid, 'My New Widget Title'); | |
} | |
function widget($args, $instance) { |
View chrono-unixtimestamp.cpp
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 <chrono> | |
#include <ctime> | |
#include <iostream> | |
int main() { | |
// std::chrono only | |
auto now = std::chrono::system_clock::now(); | |
std::cout << "std::chrono only: " << std::chrono::duration_cast<std::chrono::seconds>(now.time_since_epoch()).count() << std::endl; |
View chrono-gameloop.cpp
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 <chrono> | |
#include <iostream> | |
using namespace std::literals::chrono_literals; | |
void input() { | |
} | |
void update() { | |
// Do something to kill the time |
NewerOlder