Skip to content

Instantly share code, notes, and snippets.

View fusionstrings's full-sized avatar

Dilip Kr. Shukla fusionstrings

View GitHub Profile
@fusionstrings
fusionstrings / number-to-words
Created February 20, 2014 14:21
Number to words in Javascript
var th = ['','thousand'];
var dg = ['zero','one','two','three','four', 'five','six','seven','eight','nine'];
var tn = ['ten','eleven','twelve','thirteen', 'fourteen','fifteen','sixteen', 'seventeen','eighteen','nineteen'];
var tw = ['twenty','thirty','forty','fifty', 'sixty','seventy','eighty','ninety'];
function toWords(s)
{
if (s > 1000) return 'too big';
s = s.toString();
s = s.replace(/[\, ]/g,'');
@fusionstrings
fusionstrings / checkPalindrome
Created February 20, 2014 14:23
Check Palindrome
var checkPalindrome = function(str){
var strArr = str.split('');
var strArrReverse = strArr.slice(0).reverse();
console.log(strArr, strArrReverse, strArr.length);
var compareArr = function(){
for (var i = 0; i < strArr.length; i++){
return strArr[i] !== strArrReverse[i] ? false : true
}
}
return compareArr();
@fusionstrings
fusionstrings / gist:7381dc8b5f36a7586d0d
Created May 29, 2014 08:25
run following command to run node locally as production
set NODE_ENV=production
node server.js
@fusionstrings
fusionstrings / git-zip
Created June 10, 2014 10:21
export zip from git
git archive HEAD --format=zip > archive.zip
@fusionstrings
fusionstrings / gist:0d28067572ce4f8f43de
Last active August 29, 2015 14:02
Loopback Storage API datasource setup
{
"memory": {
"defaultForType": "memory",
"connector": "memory"
},
"push": {
"defaultForType": "push",
"connector": "loopback-push-notification",
"installation": "installation",
"notification": "notification",
@fusionstrings
fusionstrings / loopback-storage-datasource.json
Last active August 29, 2015 14:02
model for loopback storage datasource
"container": {
"properties": {},
"public": true,
"dataSource": "storage",
"plural": "containers"
}
@fusionstrings
fusionstrings / gist:9a024aba4a830df35fb2
Created June 23, 2014 04:25
install loopback-storage-service
npm install -g loopback-storage-service --save
@fusionstrings
fusionstrings / useful-commands
Created June 24, 2014 06:24
Useful commands
// set permission
sudo chmod -R ug+rw
// delete recursive files and folders without prompt
rm -rf example
<link rel="import" href="../chart-js/chart-js.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/iconsets/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<link rel="import" href="../yt-video/yt-search-video.html">
<link rel="import" href="../google-map/google-map-search.html">
<link rel="import" href="../google-map/google-map-directions.html">
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../paper-icon-button/paper-icon-button.html">
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;