Skip to content

Instantly share code, notes, and snippets.

@starstuck
starstuck / esi-server.js
Last active December 17, 2015 16:19
Simple server expanding esi:include tags from local html files. Very usefull to test your static pages before uploading to Akamai. Written in node.js.
/**
* Simple server expanding esi:include tags from local html files.
* Very usefull to test your static pages before uploading to Akamai.
*
* $ npm install express
*
* Now you are ready to run preview server:
*
* $ node esi-server.js
*
@starstuck
starstuck / test-rest.js
Last active June 8, 2023 09:09
Exaple of using node.js + mocha + expect.js for testing/validating REST'full services
/*jslint node:true*/
/*global describe, it, before*/
/**
* Example of channel REST service specification
*
* To get it running call in folder where you have put test_channel.js
* npm install -g mocha # if you have not installed mocha in your environment already
* npm install expect.js
* mocha test_channel.js
@starstuck
starstuck / compass-retina-sprites.scss
Created August 3, 2012 15:33 — forked from thulstrup/compass-retina-sprites.scss
Using Compass to generate normal and retina sprite maps
/**
* Setup images sprite having high resolution variant for retina displays.
*
* It will create class names for all available icons.
*
* This uses custom function to prefix selectors from array. To get it working you will need to include following snippet in your config.rb
*
* module Sass::Script::Functions
* def prefix_each(array, prefix)
* return Sass::Script::String.new array.to_a.map{|item| prefix.value + item.value}.join(", ")