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 SPM Custom CSS Properties | |
// @namespace http://tampermonkey.net/ | |
// @version 0.35 | |
// @description SPM UI theme creation using CSS properties | |
// @author https://github.com/daithimorton | |
// @match https://*/* | |
// @match http://*/* | |
// @grant none | |
// @downloadUrl https://gist.github.com/daithimorton/467336d64f1a130ef622499634dd098c/raw/spmcssvar.user.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
module Component | |
def operation | |
raise "Component error" | |
end | |
end | |
module Decorator | |
include Component | |
def initialize(component) | |
@component = component |
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
module Component | |
def operation | |
raise "Component error" | |
end | |
end | |
module Decorator | |
include Component | |
def initialize(component) |
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
// Receiver | |
class Entity { | |
String name; | |
public Entity(String name){ | |
this.name = name; | |
} | |
public void jump(){ | |
System.out.println(name + " Jump"); | |
} | |
public void fire(){ |
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
// Command | |
const InsertCommand = (database, id) => { | |
return { | |
execute: () => database.insertRecord(id), | |
undo: () => database.deleteRecord(id) | |
}; | |
}; | |
// Receiver | |
const insertRecord = id => console.log('>>> Database insert', id); |
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 <iostream> | |
using namespace std; | |
class B { | |
}; | |
class A : public B { | |
}; | |
template<typename D, typename B> |
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 <iostream> | |
#include <sstream> | |
#include <map> | |
using namespace std; | |
std::map<unsigned int, short> parityCache; | |
short parityOf(unsigned long x){ | |
short result = 0; | |
while(x){ |
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
// Copyright 2016 David Morton. All rights reserved. | |
// Use of this source code is governed by a license that can be | |
// found in the LICENSE file. | |
#ifndef BASE_UTILS_H | |
#define BASE_UTILS_H | |
#include <iostream> | |
class Utils { |
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
// Copyright 2016 David Morton. All rights reserved. | |
// Use of this source code is governed by a license that can be | |
// found in the LICENSE file. | |
#include "gtest/gtest.h" | |
#include "Base/Utils.h" | |
TEST(UtilsTest, to_strCanConvertIntZeroToString) { | |
std::string result = Utils::to_str(0); | |
ASSERT_EQ("0", result); |
NewerOlder