Skip to content

Instantly share code, notes, and snippets.

@Nowalon
Nowalon / photos.svg
Created September 2, 2013 08:55
SVG board with image manipulation - resize / rotate / move / remove etc.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{"noOfCities":13,"cities":[{"city":{"baseUrl":"http://www.cobone.com/deals/abudhabi","urlName":"abudhabi","latitude":24.455,"longitude":54.382,"facebookId":"135761843111435","twitterId":"coboneabudhabi","googlePlusId":"103770203060970696536","pinterestId":"cobone","name":"Abu Dhabi","description":"Abu Dhabi"}},{"city":{"baseUrl":"http://www.cobone.com/deals/alexandria","urlName":"alexandria","latitude":31.1981,"longitude":29.9192,"facebookId":"136543156389143 ","twitterId":"CoboneAlex ","googlePlusId":"103770203060970696536","pinterestId":"cobone","name":"Alexandria","description":"Alexandria"}},{"city":{"baseUrl":"http://www.cobone.com/deals/amman","urlName":"amman","latitude":31.95,"longitude":35.9333,"facebookId":"152768171402471","twitterId":"CoboneAmman ","googlePlusId":"103770203060970696536","pinterestId":"cobone","name":"Amman","description":"Amman"}},{"city":{"baseUrl":"http://www.cobone.com/deals/beirut","urlName":"beirut","latitude":33.8719,"longitude":35.5097,"facebookId":"145730898783705 ","twitt
{"verticalsResult":{"currentCity":{"baseUrl":"http://www.cobone.com/deals/dubai","urlName":"dubai","latitude":25.581,"longitude":55.697,"facebookId":"133323990035820 ","twitterId":"cobonedubai","googlePlusId":"103770203060970696536","pinterestId":"cobone","name":"Dubai","description":"Dubai","parent":{},"promos":[],"siblings":[],"children":[{"child":{"baseUrl":"http://www.cobone.com/deals/food-dining-dubai","urlName":"food-dining-dubai","latitude":0,"longitude":0,"facebookId":"133323990035820 ","twitterId":"cobonedubai","googlePlusId":"103770203060970696536","pinterestId":"cobone","name":"Food & Dining","description":"Food & Dining","grandChildren":[],"promos":[]}},{"child":{"baseUrl":"http://www.cobone.com/deals/beauty-spa-dubai","urlName":"beauty-spa-dubai","latitude":0,"longitude":0,"facebookId":"133323990035820 ","twitterId":"cobonedubai","googlePlusId":"103770203060970696536","pinterestId":"cobone","name":"Beauty & Spa","description":"Beauty & Spa","grandChildren":[],"promos":[]}},{"child":{"baseUrl":"ht
@Nowalon
Nowalon / transition.css
Created September 5, 2013 06:44
-webkit-transition: top 0.5s ease 0.7s; transition: top 0.5s ease 0.7s;
-webkit-transition: top 0.5s ease 0.7s;
transition: top 0.5s ease 0.7s;
//there's a couple of ways. My preferred way is to attach a function to the ajaxStart/Stop events on the element itself.
$('#loadingDiv')
.hide() // hide it initially
.ajaxStart(function() {
$(this).show();
})
.ajaxStop(function() {
$(this).hide();
});
//The ajaxStart/Stop functions will fire whenever you do any ajax calls.
@Nowalon
Nowalon / doResizeEnd.js
Created September 16, 2013 08:04
doResizeEnd - отработать по окончании ресайза окна
var resizeTimer = 0;
jQuery(function() {
//...
//...
jQuery(window).resize(function() {
/**
*
* Base64 encode / decode
* http://www.webtoolkit.info/
*
**/
var Base64 = {
// private property
/**
* jQuery.ajax mid - CROSS DOMAIN AJAX
* ---
* @author James Padolsey (http://james.padolsey.com)
* @version 0.11
* @updated 12-JAN-10
* ---
* Note: Read the README!
* ---
* @info http://james.padolsey.com/javascript/cross-domain-requests-with-jquery/
// Create the XHR object.
function createCORSRequest(method, url) {
var xhr = new XMLHttpRequest();
if ("withCredentials" in xhr) {
// XHR for Chrome/Firefox/Opera/Safari.
xhr.open(method, url, true);
} else if (typeof XDomainRequest != "undefined") {
// XDomainRequest for IE.
xhr = new XDomainRequest();
xhr.open(method, url);
@Nowalon
Nowalon / add-script-into-head.js
Created November 6, 2013 12:27
From https://developers.facebook.com/docs/reference/javascript/ add a <script type="text/javascript" src="script.js"></script>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
// init the FB JS SDK
FB.init({
appId : 'YOUR_APP_ID', // App ID from the app dashboard
channelUrl : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel file for x-domain comms
status : true, // Check Facebook Login status
xfbml : true // Look for social plugins on the page
});