Skip to content

Instantly share code, notes, and snippets.

View carlwoodhouse's full-sized avatar

Carl Woodhouse carlwoodhouse

View GitHub Profile
@carlwoodhouse
carlwoodhouse / sql-dupes-to-delete
Created January 15, 2015 16:18
sql duplicates to delete
DELETE FROM dbo.Orchard_MediaProcessing_FileNameRecord
WHERE id in (
SELECT id
FROM (
SELECT
path, id,
ROW_NUMBER() OVER (PARTITION BY path ORDER BY id) AS intRow
FROM dbo.Orchard_MediaProcessing_FileNameRecord
) AS d
WHERE intRow != 1
@carlwoodhouse
carlwoodhouse / gist:8581198
Created January 23, 2014 16:04
scp cheat sheet
# copy from local machine to remote machine
scp localfile user@host:/path/to/whereyouwant/thefile
# copy from remote machine to local machine
scp user@host:/path/to/remotefile localfile
// in theme functions.php
<?php
add_action('gform_after_submission', 'createPaymentForm', 10, 2);
function createPaymentForm($entry, $form) {
$valuesFound = false;
$fieldId = -1;
$fieldTotalId = -1;
$fieldCounter = 0;
<httpErrors existingResponse="Replace" errorMode="Custom">
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/404.aspx" responseMode="ExecuteURL" />
</httpErrors>
@carlwoodhouse
carlwoodhouse / gist:4754051
Created February 11, 2013 11:51
radio, do something when selected value changes
$("#marksradio").change(function () {
var selectedValue = $("#marksradio option:selected").val(); // or .text();
// do some shit with selectedValue
})