Skip to content

Instantly share code, notes, and snippets.

@XciA
XciA / gist:c6d36621753c5922e269
Last active August 29, 2015 14:18
UI developer question list
For candidates between 0.6-2 years
1) Anagram in Javascript
function compare(w1,w2){
var word1 = w1.split("").sort().join("");
var word2 = w1.split("").sort().join("");
if(word1 === word2){
console.log('anagrams');
}
@XciA
XciA / gist:b7c9b46891155f55d437
Last active August 29, 2015 14:07
Interview Questions preliminary round
1)Print squares of first n natural numbers without using *, / and -
Input: n = 6
Output: 0 1 4 9 16 25
O(n) time
solution In Javascript
var square =0,prev=0;
function printSquares(n){
for(var x=0;x<n;x++){
square = (square+x+prev);
//console.log('x'+x);console.log('prev'+prev);console.log('square+x+prev'+square);
@XciA
XciA / gist:aa801ea69db1f60cdc56
Created May 5, 2014 08:55
Implementing double tap feature in IE 10 windows phone
IE10 introduces the MSPointer events, which normalize mouse/touch/pen inputs in IE10.
Another new aspect of IE10 is the ms-touch-action CSS property.
This CSS property tells IE10 whether to permit default touch behavior or not.
When using touch property we need to set ms-touch-action CSS property of the element;
-ms-touch-action: auto | none | [ [ [ pan-x || pan-y || pinch-zoom ? ] | manipulation ] || double-tap-zoom ? ]
Libraries
HammerJS - http://eightmedia.github.com/hammer.js/
@XciA
XciA / consecutive_numbers
Created April 13, 2014 06:52
group consecutive numbers in array , in Javascript.
/*
var data=[4,5,6,9,10,14,15,20,21,22,23,24,25,30,31,34]
output
4-6,9-10,14-15,20-25,30-31,34
*/
var data=[4,5,6,9,10,14,15,20,21,22,23,24,25,30,31,34,36,37,94,95];
var start=data[0];
var temp=1;
var a=0;