Skip to content

Instantly share code, notes, and snippets.

  1. Sites can very quickly put up what you might call Queue-Walls in front of their sites. Ocado appears to be using Traffic Defender. "Virtual Waiting Room"

  2. It really helps the user if a Queue-Wall gives you an idea of where you are in the queue. Contrast ASDA "you are now in a queue" with Ocado "You are position 28220 of 31978. Your wait time will be more than four hours." Ocado has bad news, but its better than ASDA where you just don't know.

@EdGuiness
EdGuiness / opinions.md
Last active December 20, 2019 11:27
There are many opinions, here are mine.

Here are my opinions.

Ethics and conduct

  1. Developers should adopt a code of ethics. The ACM has a nice example, if you need one.
  2. Be kind, always.
  3. Bigotry and intolerance of others is not ever OK.
  4. In code, people, everything, seek to understand before judging.
  5. It's OK to judge, provided you're also kind.
  6. It's hard to create good software. Be respectful.
  7. It's easy to criticise and tear down. Don't be an arse.
@EdGuiness
EdGuiness / gist:c815f99d2bcb42714165
Created January 8, 2015 10:07
Dump IP addresses with count from IIS log file
use strict;use warnings;
my %ipaddrs;
while (<DATA>) {
while (/\b(\d+\.\d+\.\d+\.\d+)\b/g) {
$ipaddrs{$&}++;
}
}
using System;
using System.IO;
using System.Security.Cryptography;
class test {
static void Main(string[] args) {
string file = "";
if (args.Length > 0) {
@EdGuiness
EdGuiness / gist:9788644
Last active August 29, 2015 13:57
Compare two date ranges to see if they overlap. This is the source code for a Youtube video to be published at http://www.youtube.com/user/CodingForTheWin
using System;
namespace Power
{
class Program
{
static void Main(string[] args)
{
var a = new DateRange { Start = new DateTime(2014, 01, 10), End = new DateTime(2014, 01, 20) };
@EdGuiness
EdGuiness / hr.pl
Created February 11, 2014 07:50
HR emulator
grep {/sql|asp\.net/i} <> and print ‘CV is perfect!’;
@EdGuiness
EdGuiness / gist:8925250
Last active August 29, 2015 13:56
<hr/> for windows command prompt
perl -e "$_=`mode`;/ns:\s+(\d+)/;print '='x$1"
@EdGuiness
EdGuiness / hnleaders.js
Last active January 3, 2016 01:09
Source code for HN Leaders chrome extension
/*
A script to highlight leaders on HN
Uses zeptojs
*/
Zepto(function($) {
$('.subtext,.comhead').each(function() {
var link = $(this).children('a').first();
@EdGuiness
EdGuiness / gist:8315115
Last active January 2, 2016 14:09
Use this code when you want to be sure it happens
/// <summary>
/// Use this to make sure A is set
/// </summary>
public int A
{
set
{
try
{
lock (lockObj)
@EdGuiness
EdGuiness / gist:5296102
Last active December 15, 2015 17:20
playing with sort
sub findRemainder {
map {return $_[0] % ($_[1] || 1) } @_ = sort { $b <=> $a } @_;
}
print findRemainder(142,1000),"\n";
print findRemainder(1000,142),"\n";
print findRemainder(1000,0),"\n"