Skip to content

Instantly share code, notes, and snippets.

Brendan McKenzie brendanmckenzie

Block or report user

Report or block brendanmckenzie

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:1710666
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTEzMTcyMTE1MDcPZBYCZg9kFgICAQ9kFg4CBQ9kFgICCQ9kFgJmDxQrAAIPFgQeC18hRGF0YUJvdW5kZx4LXyFJdGVtQ291bnQCBWRkFgJmD2QWCgIBD2QWBAIBDw8WAh4LTmF2aWdhdGVVcmwFQS9saW1hL2RyLWpla3lsbC0tLW1yLWh5ZGUtYmFyLWF0LXRoZS1taXJhZmxvcmVzLWhvdGVsLWluLWxpbWEuaHRtZBYCZg8PFgQeDUFsdGVybmF0ZVRleHQFF0RyIEpla3lsbCAmIE1yIEh5ZGUgQmFyHghJbWFnZVVybAUwL3VwbG9hZGVkSW1hZ2VzL0NvbnRlbnQvQmFycy90aHVtYl9kciBqZWt5bGwuanBnZGQCAg8VAxdEciBKZWt5bGwgJiBNciBIeWRlIEJhcgRMaW1hiwVJZiB5b3UncmUgd2VhcmluZyBhIGhhdCwgcHJlcGFyZSB0byBkb2ZmIGl0LCBmb3IgdGhlIE1pcmFmbG9yZXMgSG90ZWwgcmVkZWZpbmVzIHRoZSB3b3JkICJsdXguIiBBbmQgaXQgZG9lcyBzbyBieSBtZWFucyBvZiBpdHMgb3V0c3RhbmRpbmcgbG9jYXRpb24gYXRvcCBhIGNsaWZmIG92ZXJsb29raW5nIHRoZSBQYWNpZmljIGl0cyBjaGFybWluZyBnYXJkZW5zIHBvc2l0aXZlbHkgb3ZlcmZsb3dpbmcgd2l0aCBleG90aWMgYmxvb21zIG92ZXIgd2hpY2ggdGhlIGh1bW1pbmcgYmlyZCBob3ZlcnMgaXRzIGltcGVjY2FibGUgc2VydmljZSBhbmQgYWJvdmUgYWxsIGl0cyBiYXIuIEFzIHF1aWV0IGFzIGl0IGlzIGludGltYXRlIHdpdGggd29vZGVuIHBhbmVsbGluZyAgd2VsbC11cGhvbHN0
View gist:2570631
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text.RegularExpressions;
using System.Web.Mvc;
namespace MyNamespace
{
public class MyViewEngine : RazorViewEngine
{
View gist:2640920
C:\Users\Brendan> ssh-agent
SSH_AUTH_SOCK=/tmp/ssh-wmhXdx5812/agent.5812; export SSH_AUTH_SOCK;
SSH_AGENT_PID=6076; export SSH_AGENT_PID;
echo Agent pid 6076;
View gist:2640926
Brendan@BRENDAN-PC ~
$ eval $(ssh-agent)
Agent pid 3768
Brendan@BRENDAN-PC ~
$ ssh-add
Could not open a connection to your authentication agent.
View gist:2640959
21:20 < rkeene> It needs to be a socket.
21:20 < Macca-> this is windows
21:20 < Macca-> ?
21:21 < rkeene> Upgrade
21:21 < Macca-> upgrade what?
21:21 < rkeene> To something that's not Windows
21:21 < Macca-> unfortunately .NET development isn't quite the same outside of Visual Studio.
21:21 < rkeene> Then don't use OpenSSH :-)
View gist:2647639
Controller.prototype.init = function () {
var that = this;
$('.campaign-container').on('click', '.campaign', function (e) { e.preventDefault(); that.load_campaign($(this).attr('data-id')); });
$('.create-new').click(function (e) { e.preventDefault(); that.create_campaign(); });
$('.content').on('click', '.delete', function (e) { e.preventDefault(); that.delete_campaign(that.current_id); });
$('.content').on('click', '.delete-media', function (e) { e.preventDefault(); that.delete_media($(this).attr('data-name')); });
$('.content').on('click', '.send-test', function (e) { e.preventDefault(); $('.send-test-dialog-container').fadeIn('slow', function () { $('.send-test-dialog-container input').focus(); }); });
$('.content').on('click', '.send-test-dialog-container .cancel', function (e) { e.preventDefault(); $('.send-test-dialog-container').fadeOut('slow'); });
View gist:2655753
/wEPDwUKMTEzNzkwMjY3NA9kFgICAQ9kFgICAQ9kFhICAQ9kFgJmDxYCHgRUZXh0BRM8IS0tIE1BUVNPT0QtUEMgLS0+ZAIDDw8WAh4HVmlzaWJsZWhkFjYCAw9kFgJmDxUBC3N1Yk1lbnVJdGVtZAIJD2QWAmYPFQELc3ViTWVudUl0ZW1kAgsPZBYCZg8VAQtzdWJNZW51SXRlbWQCDQ9kFgJmDxUBC3N1Yk1lbnVJdGVtZAITD2QWAmYPFQETc3ViTWVudUl0ZW1TZWxlY3RlZGQCFQ9kFgJmDxUBC3N1Yk1lbnVJdGVtZAIXD2QWAmYPFQELc3ViTWVudUl0ZW1kAhkPZBYCZg8VAQtzdWJNZW51SXRlbWQCGw9kFgJmDxUBC3N1Yk1lbnVJdGVtZAIfDxYCHwFoZAIhDxYCHwFoFgJmDxUBC3N1Yk1lbnVJdGVtZAIjDxYCHwFoFgJmDxUBC3N1Yk1lbnVJdGVtZAIlDxYCHwFoFgJmDxUBC3N1Yk1lbnVJdGVtZAInDxYCHwFoFgJmDxUBC3N1Yk1lbnVJdGVtZAIpDxYCHwFoFgJmDxUBC3N1Yk1lbnVJdGVtZAIrDxYCHwFoFgJmDxUBC3N1Yk1lbnVJdGVtZAItDxYCHwFoZAIvDxYCHwFnZAIxDxYCHwFnFgJmDxUBC3N1Yk1lbnVJdGVtZAIzDxYCHwFnFgJmDxUBC3N1Yk1lbnVJdGVtZAI1DxYCHwFoFgJmDxUBC3N1Yk1lbnVJdGVtZAI3DxYCHwFoFgJmDxUBC3N1Yk1lbnVJdGVtZAI5DxYCHwFoFgJmDxUBC3N1Yk1lbnVJdGVtZAI7DxYCHwFnZAI9DxYCHwFoZAI/DxYCHwFoFgJmDxUBC3N1Yk1lbnVJdGVtZAJBDxYCHwFoZAIHDw8WCh4QY3VycmVudEh5cGVyTGluawspgwFSYWlzaW5XZWJBZG1pbi5Db250cm9scy5HYWxhRXZlbnRIeXBlckxpbmtzK0h5cGVyTGlua3MsIFJh
View gist:2660803
var parameters = (string)(DataBinder.Eval(e.Row.DataItem, "ActionParameters"));
var lbl2 = (Label)e.Row.FindControl("lblActionParameters");
if (!string.IsNullOrEmpty(parameters))
{
var ser1 = new XMLSerializer<ActionParameters>();
var c = ser1.Deserialize(parameters);
if (c != null && c.Parameters.Count > 0)
{
foreach (var p in c.Parameters)
View gist:2719145
15:41 < Macca> it's funny how in the UK full time salaries are sooo much lower than contracting, whereas here they're a
lot closer
15:42 -!- matt1982 [~matt1982@cpc4-brad19-2-0-cust173.barn.cable.virginmedia.com] has joined #php
15:43 -!- escefn [~esc_ape@178.115.249.156.wireless.dyn.drei.com] has joined #php
15:45 < ymerej7> macca, dont worry that gap will soon be closed
View gist:2816223
function tile_image($source, $wide, $tall) {
$im_src = imagecreatefromjpeg($source);
$im_size = getimagesize($source);
$slice_width = $im_size[0] / $wide;
$slice_height = $im_size[1] / $tall;
$im_dest = imagecreatetruecolor($slice_width, $slice_height);
for ($x = 0; $x < $wide; $x++) {
You can’t perform that action at this time.