Skip to content

Instantly share code, notes, and snippets.

View anastasiya29's full-sized avatar
:octocat:

Anastasiya Nicole Mitchell anastasiya29

:octocat:
View GitHub Profile
@anastasiya29
anastasiya29 / container-commands.md
Created January 29, 2021 16:21
Helpful Docker container commands

Helpful Docker container commands

Remoting into the container

For linux containers

docker exec -i -t [container name] sh

For windows containers

@anastasiya29
anastasiya29 / chrome-debug.launch.json
Last active April 16, 2021 16:52
VSCode debugging configurations
// Debug a process running in the browser
{
"name": "Chrome",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
},
@anastasiya29
anastasiya29 / foo.js
Created August 21, 2020 01:36
Example of logging to a file in Node
import logger from ‘./logger’;
function foo {
try {
// do something
logger.log('Victory in foo!');
} catch (error) {
logger.error(`Foo failed. Error: $(error)`);
}
}
@anastasiya29
anastasiya29 / settings.json
Last active January 29, 2021 18:13
VS Code settings
// File location on windows: %APPDATA%\Code\User\settings.json
// File location on Mac: $HOME/Library/Application Support/Code/User/settings.json
{
"editor.minimap.enabled": false,
"editor.renderWhitespace": "all",
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"editor.tabSize": 2,
"breadcrumbs.enabled": true,
"git.ignoreMissingGitWarning": true,
/// <summary>
/// Builds a tree-like structure of datasource item's descendants
/// </summary>
/// <seealso cref="Sitecore.LayoutService.ItemRendering.ContentsResolvers.RenderingContentsResolver" />
public class DescendantsRenderingContentsResolver : Sitecore.LayoutService.ItemRendering.ContentsResolvers.RenderingContentsResolver
{
protected override JObject ProcessItem(Item item, IRenderingConfiguration renderingConfig)
{
var jObject = base.ProcessItem(item, renderingConfig);
@anastasiya29
anastasiya29 / react-helper.js
Last active December 1, 2017 03:23 — forked from tungd/react-helper.js
React Helper to initialize components from HTML. Facilitates React integration with Sitecore renderings.
/**
* react-helper.js
* Source: https://gist.github.com/anastasiya29/8574b153b956ddb7abc928c8eaf7839a
*
* Helper for Facebook's React UI Library. Adds support for declaring
* component from HTML. Adds support for dependency injection.
*
* Usage:
* 1. Register a component with optional dependencies:
* ReactHelper.register('MyComponent', MyComponent, { depName: depFunc })