       else
         null
 
-  getDummyName:->
-    u  = KD.utils
-    gr = u.getRandomNumber
-    gp = u.generatePassword
-    gp(gr(10), yes)
-
-  generateDummyUserData:->
-
-    u  = KD.utils
-
-    uniqueness = (Date.now()+"").slice(6)
-    return formData   =
-      agree           : "on"
-      email           : "sinanyasar+#{uniqueness}@gmail.com"
-      firstName       : u.getDummyName()
-      lastName        : u.getDummyName()
-      # inviteCode      : "twitterfriends"
-      password        : "123123123"
-      passwordConfirm : "123123123"
-      username        : uniqueness
-
-  registerDummyUser:->
-
-    return if location.hostname is "koding.com"
-
-    u  = KD.utils
-
-    KD.remote.api.JUser.register u.generateDummyUserData(), => location.reload yes
-
   startRollbar: ->
     @replaceFromTempStorage "_rollbar"
 

        to   = to
        niceify to - from

  # Chrome apps open links in a new browser window. OAuth authentication
  # relies on `window.opener` to be present to communicate back to the
  # parent window, which isn't available in a chrome app. Therefore, we
  # disable/change oauth behavior based on this flag: SA.
  oauthEnabled: -> window.name isnt "chromeapp"

  hasPermission: (name) ->

    (KD.config.permissions.indexOf name) >= 0

              "url=#{encodeURIComponent url}"

    return fullurl


  applyMarkdown: (text, options = {})->

    return null unless text

    options.gfm       ?= true
    options.pedantic  ?= false
    options.sanitize  ?= true
    options.highlight ?= (text, lang) ->
      if hljs.getLanguage lang
      then hljs.highlight(lang,text).value
      else text

    marked Encoder.htmlDecode(text), options


  # This function checks current user's preferred domain and
  # set's it to preferredDomainCookie
