Skip to content

Instantly share code, notes, and snippets.

@paulduran
paulduran / ReversingValueProvider.cs
Created May 24, 2012 05:18
Creating Reversing Value Provider
// in global.asax
protected void Application_Start()
{
// other stuff
ValueProviderFactories.Factories.Add(new ReverseValueProviderFactory());
}
public class ReverseValueProviderFactory : ValueProviderFactory
{
@paulduran
paulduran / gist:3031281
Created July 2, 2012 05:34
blocking pop swallowing messages
public static void DumpJobs()
{
var client = new RedisConnection(Host, password: Password);
client.Open();
using (client)
{
while (true)
{
try
{
@paulduran
paulduran / select2-editor.js
Created November 18, 2014 06:13
Update of select2 editor for handsontable (compatible with 0.11.4). Original source at https://github.com/trebuchetty/Handsontable-select2-editor
/// select2 plugin
(function (Handsontable) {
"use strict";
var Select2Editor = Handsontable.editors.TextEditor.prototype.extend();
Select2Editor.prototype.prepare = function (td, row, col, prop, value, cellProperties) {
Handsontable.editors.TextEditor.prototype.prepare.apply(this, arguments);
@paulduran
paulduran / gist:91dd14c0eecc6b1ff22f
Created November 27, 2014 00:57
Premailer with Postal
public class MailSender
{
static MailSender()
{
var viewRenderer = new EmailViewRenderer(ViewEngines.Engines) {EmailViewDirectoryName = "UserMailer"};
var emailParser = new EmailParser(viewRenderer);
Email.CreateEmailService = ()=>new EmailService(viewRenderer, new PremailerEmailParser(emailParser), ()=>new SmtpClient());
}
public void SendEmail()
ERROR Failed to compile with 1 errors 8:04:35 AM
error in ./main.js
Module build failed: Error: The 'decorators' plugin requires a 'decoratorsBeforeExport' option, whose value must be a boolean. If you are migrating from Babylon/Babel 6 or want to use the old decorators proposal, you should use the 'decorators-legacy' plugin instead of 'decorators'.
at validatePlugins (C:\projects\ui-components\node_modules\@babel\parser\lib\index.js:6109:13)
at getParser (C:\projects\ui-components\node_modules\@babel\parser\lib\index.js:11426:5)
at parse (C:\projects\ui-components\node_modules\@babel\parser\lib\index.js:11409:12)
at parser (C:\projects\ui-components\node_modules\@babel\core\lib\transformation\normalize-file.js:168:34)
at normalizeFile (C:\projects\ui-components\node_modules\@babel\core\lib\transformation\normalize-file.js:102:11)