小编Mau*_*hak的帖子

什么是Procfile?和Web和工人

是否有必要在Procfile中提供"工人"信息?如果是,那么实际上是什么 - 找不到关于此的好文章.我希望你们有想法.我已经在Procfile中添加了web:node server/server.js的详细信息.任何帮助,将不胜感激!

heroku mongodb node.js procfile

46
推荐指数
2
解决办法
6万
查看次数

JavaScript - 正则表达式信用卡到期日期自动格式

我正在尝试编写一个函数,该函数将从输入元素获取内容,并尝试将输入框中输入的数字格式化为 MM/YY。以下是我的解决方案,我想减少它的行数。有人可以帮我写一个更好的函数来做到这一点吗?

如果你看到这个,它会自动插入斜杠。工作演示:https://codepen.io/ermauliks/pen/EXBryQ?editors =1010

function formatString(string) {
        return string.replace(
            /^([1-9]\/|[2-9])$/g, '0$1/' // To handle 3/ > 03/
        ).replace(
            /^(0[1-9]{1}|1[0-2]{1})$/g, '$1/' // 11 > 11/
        ).replace(
            /^([0-1]{1})([3-9]{1})$/g, '0$1/$2' // 13 > 01/3
        ).replace(
            /^(\d)\/(\d\d)$/g, '0$1/$2' // To handle 1/11 > 01/11
        ).replace(
            /^(0?[1-9]{1}|1[0-2]{1})([0-9]{2})$/g, '$1/$2' // 141 > 01/41
        ).replace(
            /^([0]{1,})\/|[0]{1,}$/g, '0' // To handle 0/ > 0 and 00 > 0
        ).replace(
            /[^\d\/]|^[\/]{0,}$/g, '' // To allow only numbers and /
        ).replace(
            /\/\//g, '/' // Prevent entering more than 1 …
Run Code Online (Sandbox Code Playgroud)

javascript regex

3
推荐指数
2
解决办法
1万
查看次数

Jekyll安装失败

我正在尝试在我的Mac上安装Jekyll,它根本没有发生,所以我试图重新安装我的rvm 1.9.3.但我现在正在跟踪错误.如果有人可以帮我解决这个问题,那就太好了.

...
e.rb, skipping
Installing ri documentation for parslet-1.5.0
unable to convert U+00E5 from UTF-8 to US-ASCII for test/test_child.rb, skipping
Installing ri documentation for posix-spawn-0.3.8
unable to convert U+2014 from UTF-8 to US-ASCII for lib/pygments/popen.rb, skipping
unable to convert U+00F8 from UTF-8 to US-ASCII for test/test_pygments.rb, skipping
unable to convert "\xC5" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to US-ASCII for         vendor/pygments-main/AUTHORS, skipping
unable to convert "\xC3" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to US-ASCII for …
Run Code Online (Sandbox Code Playgroud)

ruby macos ruby-on-rails jekyll rvm

2
推荐指数
1
解决办法
670
查看次数

标签 统计

heroku ×1

javascript ×1

jekyll ×1

macos ×1

mongodb ×1

node.js ×1

procfile ×1

regex ×1

ruby ×1

ruby-on-rails ×1

rvm ×1