Skip to content

Instantly share code, notes, and snippets.

View ProNotion's full-sized avatar

ProNotion

  • Prolific Notion Ltd
  • Plymouth, UK
View GitHub Profile
@fnichol
fnichol / README.md
Created March 12, 2011 20:52
Download a cacert.pem for RailsInstaller

Why?

There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.

From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?

Installation

The Ruby Way! (Fun)

@beccasaurus
beccasaurus / README.markdown
Created May 5, 2011 19:37
Adds hooks to jQuery.validate's form/element validation methods (via trigger())

jQuery Validate Hooks

If you're using [ASP.NET MVC3][], it uses [jQuery Validate][] to do client-side validations. Instead of using [jQuery Validate][] directly, however, it wraps it with its own jQuery plugin called [jQuery.Validate.Unobtrusive][]. [jQuery.Validate.Unobtrusive][] sets up [jQuery Validate][] for you, behind the scenes, so you don't have an opportunity to customize your [jQuery Validate][] settings at all!

We've been running into trouble with this when we've been doing our own custom client-side validations. We need a way to integrate with the build-in [ASP.NET MVC3][] validation so we can:

@leekelleher
leekelleher / ForceEmptyRecycleBin.sql
Last active July 18, 2020 11:15
Umbraco: Force empty the Recycle Bin
-- Uncomment below to verify the number of nodes returned is the same as the number of nodes that is in the Recycle Bin
-- SELECT * FROM umbracoNode WHERE path LIKE '%-20%' AND id != -20
-- Delete all 'related' nodes and table contents...
DELETE FROM cmsPreviewXml WHERE nodeId IN (SELECT id FROM umbracoNode WHERE path LIKE '%-20%' AND id != -20)
DELETE FROM cmsContentVersion WHERE contentId IN (SELECT id FROM umbracoNode WHERE path LIKE '%-20%' AND id != -20)
DELETE FROM cmsDocument WHERE nodeId IN (SELECT id FROM umbracoNode WHERE path LIKE '%-20%' AND id != -20)
DELETE FROM cmsContentXML WHERE nodeId IN (SELECT id FROM umbracoNode WHERE path LIKE '%-20%' AND id != -20)
DELETE FROM cmsContent WHERE nodeId IN (SELECT id FROM umbracoNode WHERE path LIKE '%-20%' AND id != -20)
DELETE FROM cmsPropertyData WHERE contentNodeId IN (SELECT id FROM umbracoNode WHERE path LIKE '%-20%' AND id != -20)
@dieseltravis
dieseltravis / iisexpress.bat
Last active January 5, 2016 13:35
Add a shortcut to your Send To menu to launch a folder in IISExpress
@echo off
:: normalize folder
SET folder=%~1
IF %folder:~-1%==\ SET folder=%folder:~0,-1%
:: random number from 8000 to 9999
SET /a port=(%random%)*1999/32767+8000
:: start the web server for the random port starting at the passed-in directory
@greystate
greystate / xmldump.js
Last active September 29, 2015 07:38
XMLDump toggle Bookmarklet
// What it does:
(function() {
var loc = document.location;
var hasXMLDump = /xmldump(\.aspx)?(\/?\?([^=&?]+=[^=&?]+&?)*)?$/i;
var hasntXMLDump = /(\/|(\.aspx))?$/i;
if (hasXMLDump.test(loc.pathname)) {
document.location = loc.pathname.replace(hasXMLDump, '$1');
} else {
document.location = loc.pathname.replace(hasntXMLDump, '/xmldump$2');
}
@havvg
havvg / ajax-form.js
Created August 1, 2012 13:20
jQuery AJAX form submit with Twitter Bootstrap modal
jQuery(function($) {
$('form[data-async]').live('submit', function(event) {
var $form = $(this);
var $target = $($form.attr('data-target'));
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),
@ferventcoder
ferventcoder / setup.ps1
Last active December 12, 2019 16:59
Really rocking out the environment setup
$scriptDir = $(Split-Path -parent $MyInvocation.MyCommand.Definition)
function Install-NeededFor {
param(
[string] $packageName = ''
,[bool] $defaultAnswer = $true
)
if ($packageName -eq '') {return $false}
$yes = '6'
@jkarsrud
jkarsrud / BundleInstall.md
Last active May 27, 2020 08:51
How to use ASP.NET Bundling and Minifications in Umbraco

How to use ASP.NET Bundling and Minifications in Umbraco

Using the ASP.NET bundling and minifications is pretty straight forward, but here is a small guide that take care of a few gotchas when implementing bundles in your Umbraco project.

Installing ASP.NET Bundling and Minifications

ASP.NET Bundling and Minifications is part of the Microsoft ASP.NET Web Optimization Framework and is installed via NuGet;

PM> Install-Package Microsoft.AspNet.Web.Optimization

Once this is done, you need to create a BundleConfig.cs in your App_Start1 folder. This is where you register your different bundles. It can be extremely simple, or it can be more complex, but the gist of it is this;

@leekelleher
leekelleher / MyApplication.cs
Last active December 19, 2015 13:59
Example of Umbraco 6.1's IContentFinder
using Umbraco.Core;
using Umbraco.Core.Services;
using Umbraco.Web.Mvc;
using Umbraco.Web.Routing;
namespace Our.Umbraco
{
public class MyApplication : ApplicationEventHandler
{
protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
@nul800sebastiaan
nul800sebastiaan / gist:6086903
Created July 26, 2013 07:15
HtmlAgilityPack Assembly Redirect
<dependentAssembly>
<assemblyIdentity name="HtmlAgilityPack" publicKeyToken="bd319b19eaf3b43a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.4.6.0" newVersion="1.4.6.0" />
</dependentAssembly>