Skip to content

Instantly share code, notes, and snippets.

# wip
# fixes
# wip
# returned old widget
# wip
# --------------
# Please enter the commit message for your changes. Everything below
# this paragraph is ignored, and an empty message aborts the commit.
@bekzod
bekzod / tl_HWizard_SelectOffer
Created April 29, 2014 18:48
tl_HWizard_SelectOffer
{
"id": 916656,
"stars": 4,
"name": "Club Hotel Corona",
"address": "Ovrazhnaya Street 35",
"zip": "420012",
"city": "Kazan",
"country": "Russia",
"price": 552.14,
"currency": "USD",
@bekzod
bekzod / tl_HWizard_ClickHotel
Created April 29, 2014 18:55
tl_HWizard_ClickHotel
{
"id": 916656,
"stars": 4,
"name": "Club Hotel Corona",
"address": "Ovrazhnaya Street 35",
"zip": "420012",
"city": "Kazan",
"country": "Russia",
"price": 552.14,
"currency": "USD",
{
"email": "[email protected]",
"hsf_checkin": "2014-04-29T20:00:00.000Z",
"hsf_checkout": "2014-05-06T20:00:00.000Z",
"hsf_city": "Лондон, Англия, Великобритания",
"hsf_city_id": "2643743",
"lang": "ru",
"date_departure": "20140220",
"date_ticket_issued": "2014-02-20T12:05:00.000Z",
"service_class": "E",
var oPrices = {
"base": Math.ceil(convertCurrency(prcInf[ageToLower + "B"], prcInf.cur, showCurrency)),
"markupAndTaxes": Math.ceil(markup + convertCurrency(prcInf[ageToLower + "T"] || 0, prcInf.cur, showCurrency)),
"markupAndTaxesAndDiscount": Math.ceil(markup + convertCurrency(prcInf[ageToLower + "T"] || 0, prcInf.cur, showCurrency) + discount),
"discount": Math.ceil(Math.abs(discount)),
"amount": Math.ceil(amount)
};
@bekzod
bekzod / global.js
Created June 3, 2014 07:57
formatmoney
function formatMoney(money){
var arr = String(money).split('.');
var integerPart = arr[0];
var fractionPart;
var devPointer = '.';
if(tw.language == "es") {
devPointer = ',';
}
fractionPart = arr.length > 1 ? devPointer + arr[1] : '';
//devider = '\u200B'; //zerowidthspace
@bekzod
bekzod / javascript_resources.md
Created August 31, 2014 11:09 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@bekzod
bekzod / css_resources.md
Created August 31, 2014 11:09 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

var async = require('async');
function someFunc(i, callback){
function cbWrapper(){
callback(null, i);
}
i % 2 == 0 ? cbWrapper() : setTimeout(cbWrapper, 100);
}
var jobs = [];
var Step = require('step');
function someFunc(i, callback){
function cbWrapper(){ callback(undefined, i); }
i % 2 == 0 ? cbWrapper() : setTimeout(cbWrapper, 10);
}
Step(
function process(){
var group = this.group();
for(var i = 0; i < 10; i++){