Skip to content

Instantly share code, notes, and snippets.

Avatar
📞
OnCall

steve flitcroft redsquare

📞
OnCall
View GitHub Profile
View Keybase.md

Keybase proof

I hereby claim:

  • I am redsquare on github.
  • I am redsquare (https://keybase.io/redsquare) on keybase.
  • I have a public key ASBXSLaKvqYBgD34X1I2FSTC5hTdJqkr6lKhzu4__ZYE8Qo

To claim this, I am signing this object:

@redsquare
redsquare / program.cs
Created Mar 1, 2019
SSL stack redis issue
View program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using StackExchange.Redis;
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>t1</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
View angualar-question
$scope.updateview = function (iteration, $event) {
var _this = $("#" + $event.target.id);
$http.get('../issues?size=25&iteration=' + iteration).success(function (data) {
$scope.issueList = data;
_this.addClass("tab-selected");
});
};
@redsquare
redsquare / mongoadd
Created Jan 9, 2014
mongo bulk add
View mongoadd
//r = require('rethinkdb')
var MongoClient = require('mongodb').MongoClient,
format = require('util').format;
var querystring = require('querystring');
var https = require('https');
var Inserter = function (collection) {
this.collection = collection;
View Wait.cs
public static class Wait
{
public static bool ForExpectedValue<T>(T expectation, Func<T> source, int millisecondPolling = 500, int timeoutInMilliseconds = 5000)
{
var matched = Wait.Until(() => expectation.Equals(source()), millisecondPolling, timeoutInMilliseconds).WasSatisfied;
StoryTellerAssert.Fail(!matched, () => "Expected {0}, but was {1}".ToFormat(expectation, source()));
return true;
}
@redsquare
redsquare / header.js
Created Jan 24, 2012 — forked from tvpmb/header.js
Moving Events from Module to separate file
View header.js
(function() {
var Events = {
dropMenu: function(evt) {
alert("Handle the click");
},
events: {
"click .drop-menu": "dropMenu",
},
}
return Events;
@redsquare
redsquare / jquery.ba-tinypubsub.js
Created Dec 26, 2011 — forked from cowboy/HEY-YOU.md
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
View jquery.ba-tinypubsub.js
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);
@redsquare
redsquare / gist:1053873
Created Jun 29, 2011
js encapsulation template - better minification
View gist:1053873
//
// Module pattern:
// http://yuiblog.com/blog/2007/06/12/module-pattern
//
var APP = (function($, window, document, undefined) {
// For use only inside APP.
var PRIVATE_CONSTANT_1 = 'foo';
var PRIVATE_CONSTANT_2 = 'bar';
// Expose contents of APP.