Skip to content

Instantly share code, notes, and snippets.

@quitschibo
quitschibo / testMocks.js
Last active July 21, 2023 17:25
How to mock jQuery calls with Jasmine. Just some examples ;)
describe('Mock jQuery calls with Jasmine', function() {
it('how to mock $("test").show()', function() {
// mock the call
spyOn($.fn, 'show').andCallFake(function() {
return true;
});
// now we can call the mock
result = $("test").show();
@robert-b-clarke
robert-b-clarke / men.md
Last active December 11, 2015 09:39
Why the new MEN website risks upsetting users

My thoughts on the the forthcoming relaunch of the Manchester Evening News website

In the internet business you get used to seeing the work you’ve done slowly disappearing from public view. After well over ten years building websites and associated systems it’s something that rarely bothers me. However, this week’s announcement by the Manchester Evening News that they are relaunching their website did raise my hackles somewhat, but not because they’re discontinuing the last remnants of systems I helped to design and build.

I worked at the MEN from 2005 through to 2010. In late 2006 it was decided that we would relaunch the Manchester Evening News website. Usability consultants were hired, and managed to persuade everyone that the site should carry less adverts, some fancy new search technology was purchased, and everyone got together and focused on making the site better. On the dev team we got ch

@trek
trek / unit.js
Created July 22, 2012 02:40
Run your mocha unit tests suite via casper.js
// get a Casper object.
// See http://casperjs.org/
var casper = require('casper').create();
// this will be evaluated inside the context of the window.
// See http://casperjs.org/api.html#casper.evaluate for notes on
// the difference between casper's running environment and the
// DOM environment of the loaded page.
function testReporter(){
// casper is webkit, so we have good DOM methods. You're
@dvessel
dvessel / README.mdown
Last active December 10, 2024 11:34
Sass+Compass, Guard, LiveReload

This will enable Sass+Compass with LiveReload through Guard. (Guard screen cast)

You will also need a browser component to communicate with LiveReload. (browser extension, livereload.js)

If you prefer going through a GUI, that option is available. The following instructions is specific to Mac OS X and it works through the command line.

Note that this is not specific to Rails projects. This can work for any standalone front-end project.

Instructions

@LeverOne
LeverOne / LICENSE.txt
Created October 24, 2011 04:17 — forked from jed/LICENSE.txt
generate random v4 UUIDs (107 bytes)
DO WTF YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Alexey Silin <[email protected]>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WTF YOU WANT TO PUBLIC LICENSE
@fnichol
fnichol / README.md
Created March 12, 2011 20:52
Download a cacert.pem for RailsInstaller

Why?

There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.

From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?

Installation

The Ruby Way! (Fun)