Skip to content

Instantly share code, notes, and snippets.

@TheEskhaton
TheEskhaton / jget.rb
Last active December 17, 2015 13:48
A simple Ruby script for downloading a certain jquery version from google CND. i.e. "ruby jget.rb 2.0.0" would download 2.0.0 to jquery.min.js
require('open-uri')
class JGet
def self.GetVersion(ver)
script = '';
open('http://ajax.googleapis.com/ajax/libs/jquery/'+ver +'/jquery.min.js') do |f|
f.each_line{|line| script << line}
end
return script
end
@TheEskhaton
TheEskhaton / web.config.xml
Last active April 1, 2019 12:55
Azure keys
<add key="CMSAzureAccountName" value="ENTER_ACCOUNT_NAME_HERE" />
<add key="CMSAzureSharedKey" value="ENTER_PRIMARY_ACCESS_KEY_HERE" />
@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")
{
}
System.Diagnostics.Trace.TraceInformation("Information");
System.Diagnostics.Trace.TraceWarning("Warning");
System.Diagnostics.Trace.TraceError("Error");
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)
{
Hello From Github!
import React from 'react';
export default {
name: 'gist',
type: 'object',
title: 'Gist Embed',
fields: [
{
name: 'url',
type: 'url',
// 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'
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
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',