Skip to content

Instantly share code, notes, and snippets.

@mattiasnorell
mattiasnorell / EditorButtonEditorDescriptor.cs
Last active August 16, 2017 15:26
Remove all buttons from a EPiServer CMS 7 XHTML / TinyMCE editor and add only the buttons you want to use.
using EPiServer.Core;
using EPiServer.Editor.TinyMCE;
using EPiServer.Shell.ObjectEditing;
using EPiServer.Shell.ObjectEditing.EditorDescriptors;
using Site.EPiServerAdmin.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Site.EPiServerAdmin.EditorDescriptors
@mattiasnorell
mattiasnorell / PropertyAppSettingsDropDownList.cs
Created August 22, 2014 12:53
Populate a EPiServer CMS 7 drop down list in dynamic content from AppSettings
using EPiServer.Core;
using EPiServer.PlugIn;
using EPiServer.SpecializedProperties;
using EPiServer.Web.PropertyControls;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Web.UI.WebControls;
namespace Namespace.Path.In.Project
@mattiasnorell
mattiasnorell / UpdateLoopiaDns.pl
Created August 22, 2014 12:55
Update LoopiaDNS using Perl
#!/usr/bin/perl
use RPC::XML;
use RPC::XML::Client;
use Data::Dumper;
use Encode;
my $apiurl = 'https://api.loopia.se/RPCSERV';
my $apiusr = ' API USERNAME ';
my $apipwd = 'API PASSWORD ';
@mattiasnorell
mattiasnorell / jquery.googlemapsgeocode.js
Created August 22, 2014 12:59
Display a GoogleMap, geocoded
/**
*
* PLUGIN: jquery.geocode
* BY: Mattias Norell
* VERSION: 0.9.3 (based on jQuery 1.4.4)
* BROWSERS: Safari 4, Chrome 7, IE9, Firefox 4
* ABOUT: Display a GoogleMap, geocoded
* HOW-TO: $(div).geocode({adress:"street,city",zoom:16});
*
#!/bin/sh
from=$SMS_1_NUMBER
echo "Hello world!" | sudo gammu sendsms TEXT "$from"
#!/bin/sh
from=$SMS_1_NUMBER
message=$SMS_1_TEXT
reply=""
if test "$message" = "Ping"; then
reply="Pong!"
else
reply="Y U NO PLAY PING PONG?"
fi
#!/bin/sh
sendto="0123456789"
message=$SMS_1_TEXT
from=$SMS_1_NUMBER
echo "$from\n$message" | sudo gammu sendsms TEXT "$sendto"
#!/bin/sh
message=$SMS_1_TEXT
if test "$message" = "shutdown"; then
/sbin/shutdown -h now
fi
@mattiasnorell
mattiasnorell / ExportPageFilesController.cs
Last active August 29, 2015 14:15
EPiServer CMS 7.5 gadget to export a zip-file containing all files for a specific page
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using EPiServer;
using EPiServer.Core;
using EPiServer.Shell.Gadgets;
using Ionic.Zip;
namespace Website.Web.Gadgets.Controllers
@mattiasnorell
mattiasnorell / ExportAsExcel.cshtml
Created February 20, 2015 14:13
List all page types from a EPiServer CMS 7.5
@model IEnumerable<EPiServer.DataAbstraction.ContentType>
@{
Layout = null;
}
@Html.Partial("PageTypeTablePartial", Model)