This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Restify Server CheatSheet. | |
// More about the API: http://mcavage.me/node-restify/#server-api | |
// Install restify with npm install restify | |
// 1.1. Creating a Server. | |
// http://mcavage.me/node-restify/#Creating-a-Server | |
var restify = require('restify'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CategorySchema.statics.getLineage = function (categoryId, flag, done) { | |
var self = this; | |
var count1 = 0; | |
var count2 = 0; | |
var recurse = function (id, results) { | |
var deferred = Promise.defer(); | |
self.findById(id, function(error, category) { | |
if (error) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns metabase | |
(:require | |
[clojure.walk :as cwalk] | |
[clojure.string :as cstr])) | |
(defmulti gen-limit-str | |
{:arglist '([env limit])} | |
(fn [env limit] | |
(if (number? limit) | |
(:dialect env) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns number-to-words | |
(:require [clojure.string :as cstr])) | |
(def ^:private log10 #(java.lang.Math/log10 %)) | |
(def ^:private char->int #(Character/getNumericValue %)) | |
(def ^:private number-map | |
{0 "" | |
1 "one" |
I hereby claim:
- I am heypragyan on github.
- I am pragyan (https://keybase.io/pragyan) on keybase.
- I have a public key ASC1CGIMKcozgd4LL1G7CmxbSM6X7L40AofJCJ-hgxx00wo
To claim this, I am signing this object:
OlderNewer