jQuery Pseudo Random Number Generator Plugin

Yesterday I released a jQuery plugin to generate true random numbers based on the brilliant work done by Steve Gibson to create an Ultra-High Entropy Pseudo-Random Number Generator.

This takes the work Steve has done, and automates some of the steps used on the demo page such as generating the entropy and setting the range & count for the loops – though you can change those.

Example code

var options = { range: 10001, count: 10001 };
var x = $(this).uheprngGen(options);

You can download the plugin here from Github.

This plugin was featured on the amazing DailyJS site.

Hash Generation – Self Hosted

Recently I built http://hashfor.me, a hash generation service. Though I do get a reasonable amount of visits I couldn’t see a future of it being a serious project due to people’s valid security concerns of entering text you want to hash on a website you don’t own yourself, so I released the code.

You can find the code on Github here, it makes use of the CrytoJS and ZeroClipboard libraries to make it a pleasant user experience.#

The readme being:

Browser based hash generation, making use of CryptoJS to allow you to self host a quick and easy hash generator.

Originally built for hashfor.me, this project is a quick hack together of resources to allow you to generate hashes with ease.

You can generate:

SHA3, BMW, Halfskein, MD5, SHABAL, Cube Hash, AES, SHA1, SHA255, SHA512, BLAKE, Rabbit & RIPEMD-160

View a live version at https://hashfor.me

Licensed under BSD-3, Enjoy!

Clear Client Browser Cache with IIS

So you’ve updated your site and now you realise that some clients can’t see the changes of images/css because they all retain the same names as the old version?

Well in IIS you can change the Content Expiry Header to force the client to get the latest versions of the files.

For IIS 7 follow the step from Microsoft.

  1. In Features View in IIS, double-click HTTP Response Headers.
  2. On the HTTP Response Headers page, in the Actions pane, click Set Common Headers.
  3. In the Set Common HTTP Response Headers dialog box, select the Expire Web content check box and select one of the following options:
    • Select Immediately if you want content to expire immediately after it is sent in a response.
    • Select After if you want the content to expire periodically. Then, in the corresponding boxes, type an integer and select a time interval at which content expires. For example, type 1 and select Days if you want the content to expire daily.
    • Select On (in Coordinated Universal Time (UTC)) if you want the content to expire on a specific day and at a specific time. Then, in the corresponding boxes, select a date and time at which the content expires.

For IIS 6:

  1.  In IIS Manager, double-click the local computer; right-click the Web Sites folder, an individual Web site folder, a virtual directory, or a file; and then click Properties.
  2. Click the HTTP Headers tab.
  3. Select the Enable content expiration check box.
  4. Click Expire immediately, Expire after, or Expire on, and type the appropriate expiration information in the corresponding boxes.

Clearing the cache with Query String

If you have access to the source code mall modern browsers will treat resources such as a CSS, Javascript as new versions if you append a query string to them which is unique.



The actual content of the query string doesn’t matter as long as it’s unique, however most developers will tend to use v for version and then just set it to be the build number.

Plexus Law Website – Redesign

Last month we relaunched PlexusLaw.co.uk, one of the main brochure websites we have at Parabis. I took it from a static layout of two columns on every page, no matter the page requirements, to something much more fluid and dynamic.

The base of the website was built with Bootstrap, the fantastic framework from the guys at twitter. However unlike most bootstrap websites which you can tell are based on bootstrap at a glace, this website would have a lot of customisation.

Plexus Law

As you can see from the above screenshot it’s hard to recognise that bootstrap. was even used. However it does retain the beautiful responsive nature of bootstrap, allowing the site to work perfectly on all devices.

hullstrap release

So yesterday I released hullstrap 0.2, hullstrap being an instance of hull.io themed with bootstrap and some extra custom stylings.

It provides widgets for:

  • Identity (Full page & compact button)
  • Friends (Full page & compact friends list)
  • Comments and Commenting (On activities)
  • Activity (Full page & compact list)
  • Lists (Full page)
  • Share & Like Buttons

Hopefully making customising hull a little easier for new people.

Though of course you are wondering what hull is? Hull is a pretty cool service allowing you to create social apps in a weekend.

hull is a full stack social platform as a service. It makes it easy for developers to build social apps with open and reusable components.

Basically taking the effort out of connecting to github, twitter or facebook and taking advantage of those services as well as making your site social in an instant.

Download hullstrap from Github, or have a look at the demo.

Awesome Stuff Found #1

SlabText – JS responsive headline creator: http://www.frequency-decoder.com/demo/slabText/

Metro UI CSS – Make your web apps look like the Metro Windows 8 Look UI: http://metroui.org.ua/

Chirp JS – Lightweight plugin to embed tweets on your site: http://lab.rog.ie/chirp/

Placeholder Filler – JS Plugin to offer graceful degrading for the placeholder attribute: http://www.scriptiny.com/2012/08/html5-placeholder-fallback-using-jquery/

Using Smart DNS to access US Netflix

Whilst looking for a router I could set up as VPN gateway to the US to access the larger library of content they have available on Netflix, I landed upon OverPlay.net I signed up for a full VPN account, with access to Smart DNS.

Smart DNS allows you resolve the American Netflix, by only changing your DNS records. This is useful as most devices that allow you to use Netflix, which may not necessarily have full VPN support will allow you to change your DNS records. Allowing you to keep your full speed from your ISP, and not having to tunnel through a VPN for a service that doesn’t require encryption.

To Quote OverPlay:

By enabling the SmartDNS service on your OverPlay account (visit the My Account area of our website, and choose the Server Details tab) and then performing the incredibly simple configuration change, you’ll instantly enable access to websites currently blocked at your office, school, or location. With no software to install, it even works on connected devices – iPads, AppleTVs, roku or BoxeeBox… the list is endless! Furthermore, if you make the simple configuration change on your local router, you’ll even benefit from the SmartDNS service on your entire network.

Please note that this service differs from our standard offering in a few ways. Firstly, this isn’t a VPN! It doesn’t encrypt traffic, everything still goes via your ISP. Don’t use this service if you need the extra safety provided by the VPN! Second, unlike the VPN service, the supported websites are whitelisted – obscure sites may not yet be supported, and others simply may not be compatible. Don’t worry though, if SmartDNS doesn’t unblock, you can fall back to our standard VPN service!

Visit OverPlay to have a look at the Smart DNS service.

Running jQuery & JS from VB.net easily

If you need to run some JS or jQuery on an ASP.NET page then the following code will be useful:

Private Sub runjQueryCode(ByVal jsCodetoRun As String)
Dim requestSM As ScriptManager = ScriptManager.GetCurrent(Me)
If requestSM IsNot Nothing AndAlso requestSM.IsInAsyncPostBack Then
ScriptManager.RegisterClientScriptBlock(Me, GetType(Page), Guid.NewGuid().ToString(), getjQueryCode(jsCodetoRun), True)
ClientScript.RegisterClientScriptBlock(GetType(Page), Guid.NewGuid().ToString(), getjQueryCode(jsCodetoRun), True)
End If
End Sub

Private Function getjQueryCode(ByVal jsCodetoRun As String) As String
Dim sb As New StringBuilder()
sb.AppendLine(“$(document).ready(function() {“)
sb.AppendLine(” });”)

            Return sb.ToString()
End Function

You can then call the function using: runjQueryCode(jscodetorun)