Skip to content

Instantly share code, notes, and snippets.


Custom POIs and hotels list for Stay22

You can add a set of POIs (points of interests) and/or a set of your own hotels in case you have a group deal, sponsorship deal, or whatnot.

Implementation for POIs and Hotels

Insert the JSON into the poi or hotels parameter. You have to make sure the JSON is valid, then minify the JSON, and finally URL encode it before pasting it into the query param. Take note of the max characters in a URL bug, since encoded JSON tends be long..

Custom POIs example

View backbone_pushstate_router.js
// Only need this for pushState enabled browsers
if (Backbone.history && Backbone.history._hasPushState) {
var $document = $(window.document);
var openLinkInTab = false;
$document.keydown(function(e) {
if (e.ctrlKey || e.keyCode === 91) {
openLinkInTab = true;
View encryptSID
function encryptSID(sid) {
sid = String(sid);
var sidLength = sid.length;
var encryptedSID = [];
for (var index = 0; index < sidLength; index++) {
var e = sid.charAt(index);
switch (index) {