Skip to content

Instantly share code, notes, and snippets.

View gravypower's full-sized avatar
🇦🇺

Aaron Job gravypower

🇦🇺
View GitHub Profile
public class House
{
public LivingRoom livingRoom;
public void LivingRoom ()
{
ILcd lcd = new Video();
livingRoom = new LivingRoom(lcd);
livingRoom.EnterRoom();
}
public class MockNode
{
private readonly IDictionary<string, object> properties;
public MockNode()
{
this.properties = new Dictionary<string, object>();
}
public MockNode AddProperty(string alias, string value)
using Gravyframe.Service.Messages;
namespace Gravyframe.Service.Example
{
public class ExampleRequest : Request
{
}
}
using NUnit.Framework;
using Gravyframe.Kernel.Umbraco.Tests.Examine;
using NSubstitute;
namespace Gravyframe.Data.Umbraco.Tests
{
[TestFixture]
public class ExampleExamineTests
{
private MockedIndex mockedIndex;
var fields = typeof(BaseUmbracoIndexer).GetFields(BindingFlags.NonPublic | BindingFlags.Static);
var disableInitializationCheckField = fields.SingleOrDefault(x => x.Name == "DisableInitializationCheck");
if (disableInitializationCheckField == null)
{
Assert.Fail("Could Not Set DisableInitializationCheck");
}
disableInitializationCheckField.SetValue(null, true);
protected override void OnDocumentWriting(DocumentWritingEventArgs docArgs)
{
var currentNode = _nodeFactoryFacade.GetNode(docArgs.NodeId);
var categories = currentNode.GetProperty("categories").Value;
if (!string.IsNullOrEmpty(categories))
{
var categoryNodeIdsXml = XElement.Parse(categories);
var categoryNodeIds = categoryNodeIdsXml.Descendants("nodeId");
foreach (var categoryNodeId in categoryNodeIds)
namespace Patterns.AbstractFactory.People
{
using Patterns.AbstractFactory.Drinks;
/// <summary>
/// The aaron.
/// </summary>
public class Aaron : ICocktailFactory
{
/// <summary>
@gravypower
gravypower / name
Created January 28, 2016 23:58
nginx server configuration example
server {
server_name <name>;
root /var/www/<name>r; ## <-- Your only path reference.
# Enable compression, this will help if you have for instance advagg module
# by serving Gzip versions of the files.
gzip_static on;
location = /favicon.ico {
The website encountered an unexpected error. Please try again later.
Drupal\Core\Entity\EntityStorageException: Cannot set a list with a non-array value. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 757 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Drupal\Core\TypedData\TypedDataManager->create(Object, 'some@email.com')
Drupal\Core\Plugin\Context\Context->setContextValue('some@email.com')
Drupal\Core\Plugin\Context\Context->__construct(Object, 'some@email.com')
Drupal\Core\Plugin\Context\Context::createFromContext(Object, 'some@email.com')
Drupal\rules\Plugin\RulesExpression\RulesAction->mapContext(Object, Object)
Drupal\rules\Plugin\RulesExpression\RulesAction->executeWithState(Object)
Drupal\rules\Plugin\RulesExpression\ActionSet->executeWithState(Object)