Skip to content

Instantly share code, notes, and snippets.

@TheEskhaton
TheEskhaton / ChakraSample.jsx
Created October 12, 2020 17:59
Chakra Sample
// Sample component from airbnb.com
<Box>
<Image rounded="md" src="https://bit.ly/2k1H1t6"/>
<Flex align="baseline" mt={2}>
<Badge variantColor="pink">Plus</Badge>
<Text
ml={2}
textTransform="uppercase"
fontSize="sm"
import React from 'react'
import Figure from './Figure'
import Gist from 'super-react-gist';
const serializers = {
types: {
authorReference: ({node}) => <span>{node.author.name}</span>,
mainImage: Figure,
gist: ({node}) => {
import React from 'react';
import Gist from 'super-react-gist';
const Preview = ({value : {url}}) => {
if(!url) return null;
return <div style={{height: "100px", overflowY: 'scroll'}}><Gist url={url} /></div>
}
export default {
name: 'gist',
export default {
name: 'bodyPortableText',
type: 'array',
title: 'Post body',
of: [
{
type: 'block',
title: 'Block',
// Styles let you set what your user can mark up blocks with. These
// corrensponds with HTML tags, but you can set any title or value
// First, we must import the schema creator
import createSchema from 'part:@sanity/base/schema-creator'
// Then import schema types from any plugins that might expose them
import schemaTypes from 'all:part:@sanity/base/schema-type'
// document schemas
import author from './documents/author'
import category from './documents/category'
import post from './documents/post'
import React from 'react';
export default {
name: 'gist',
type: 'object',
title: 'Gist Embed',
fields: [
{
name: 'url',
type: 'url',
Hello From Github!
public static class EventLogApplicationInsightsConfig
{
private static readonly TelemetryClient telemetryClient = new TelemetryClient(new TelemetryConfiguration("INSTRUMENTATION KEY"));
public static void ConfigureListener()
{
EventLogEvents.LogEvent.After += LogToApplicationInsights;
}
private static void LogToApplicationInsights(object sender, LogEventArgs e)
{
System.Diagnostics.Trace.TraceInformation("Information");
System.Diagnostics.Trace.TraceWarning("Warning");
System.Diagnostics.Trace.TraceError("Error");
@TheEskhaton
TheEskhaton / AzureMediaModule.cs
Created April 1, 2019 13:07
kentico media module
// Registers the custom module into the system
[assembly: RegisterModule(typeof(AzureMediaModule))]
public class AzureMediaModule : Module
{
// Module class constructor, the system registers the module under the name "AzureMediaModule"
public AzureMediaModule()
: base("AzureMediaModule")
{
}