小编NoD*_*chi的帖子

通过 cPanel 添加私有 git repo

我正在尝试在 cPanel 上添加一个私有的 git repo,但遇到了权限问题并且不确定我哪里出错了

我已经在 cPanel 的“SSH 访问”部分生成了 SSH 密钥。然后,我将密钥添加到 git 中“部署密钥”部分的私有存储库中。

但是当我尝试在 cPanel 上克隆 repo 时,出现错误:

错误:“/usr/local/cpanel/3rdparty/bin/git”结束时报告错误代码“128”:Permission denied (publickey)。致命:无法从远程存储库读取。请确保您拥有正确的访问权限并且存储库存在。

我正在尝试使用 SSH 进行克隆 git@github.com:myusername/myrepo.git

我做错了什么或错过了一步吗?

git github cpanel

17
推荐指数
5
解决办法
1万
查看次数

防止弹性项目从一侧到另一侧呈现

我正在使用flexbox将一些项目放在一个块中,但我希望每个项目都在它自己的行中.例如,我希望橙色方块位于文本上方,但是在使用flex之后它将它移动到文本的一侧 - 有没有人知道这方面的方法呢?

.container {
  height: 200px;
  width: 200px;
  background: cornflowerblue;
  position: relative;
}

.inner {
  height: 100%;
  position: absolute;
  left: 0;
  width: 100%;
  top: 0;
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  align-items: center;
  justify-content: center;
}

.square {
  width: 30px;
  height: 30px;
  background: tomato;
  display: block;
}
Run Code Online (Sandbox Code Playgroud)
<div class="container">
  <div class="inner">
    <div class="square"></div>

    <p>some text</p>
  </div>
</div>
Run Code Online (Sandbox Code Playgroud)

html css css3 flexbox

7
推荐指数
2
解决办法
2346
查看次数

JS - 画布元素中的中心图像

我正在缩小图像以使其适合画布内部,我正在努力做的事情就是将其置于canavas元素内部,有人知道如何做到这一点吗?任何帮助,将不胜感激

https://jsfiddle.net/n7xL5c37/

var canvas = document.getElementById('canvas');
var image = new Image();
    image.src = 'http://placehold.it/300x550';
    image.onload = function () {
        var canvasContext = canvas.getContext('2d');
        var wrh = image.width / image.height;
        var newWidth = canvas.width;
        var newHeight = newWidth / wrh;
        if (newHeight > canvas.height) {
                    newHeight = canvas.height;
            newWidth = newHeight * wrh;
        }

        canvasContext.drawImage(image,0,0, newWidth , newHeight);
      };
Run Code Online (Sandbox Code Playgroud)

javascript html5 canvas

5
推荐指数
3
解决办法
3679
查看次数

jQuery - 从json对象中获取选定的值

我想要做的是,当选择一个选项时(例如#4),我从json对象获取日期,以便它呈现出:"12月26日星期一".我很难展示这个 - 有谁知道我怎么能这样做呢?

https://jsfiddle.net/9L53epre/3/

$(function() {
  $('select').change(function() {
    var val = $(this).val();
    console.log(val);
  });

  var data = $('#delivery-date').data('delivery-date');

  console.log(data);
  // console.log(data.item[val]);
});
Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<span id="delivery-date" data-delivery-date='{"1":"","2":"","3":"","4":"Monday 26th December","5":"","6":"","7":"Friday 23rd December","8":"","9":""}
'></span>

<select>
  <option value="1">option 1</option>
  <option value="2">option 2</option>
  <option value="3">option 4</option>
  <option value="4">option 4</option>
</select>
Run Code Online (Sandbox Code Playgroud)

html javascript arrays jquery json

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

jQuery - 带变量的Calc高度

有没有办法在jQuery中使用calc?我正在尝试类似下面的东西,但似乎没有效果.有谁知道这样做的正确方法吗?

var h = $('.mydiv').height();

$('.shopping-cart-table-container').css({ height: 'calc(100% - ' h')'});
Run Code Online (Sandbox Code Playgroud)

jquery css3

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

标签 统计

css3 ×2

html ×2

javascript ×2

jquery ×2

arrays ×1

canvas ×1

cpanel ×1

css ×1

flexbox ×1

git ×1

github ×1

html5 ×1

json ×1