小编Lov*_*ock的帖子

xcrun:错误:无法找到实用程序"PackageApplication",无法找到开发人员工具或PATH中 - 自更新xCode

今天早上更新了Xcode,现在离子项目不会部署到设备上.

ionic run ios --device
Run Code Online (Sandbox Code Playgroud)

返回:

** BUILD SUCCEEDED **


xcrun: error: unable to find utility "PackageApplication", not a developer tool or in PATH

Error: Error code 72 for command: xcrun with args: -sdk,iphoneos,PackageApplication,-v
Run Code Online (Sandbox Code Playgroud)

不知道该怎么做才能修复,谷歌搜索返回了很多选项,但没有一个正确.

xcode ios ionic-framework

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

碳 - 获得一个月的第一天

我正在使用碳,但试图获得本月的第一天,所以我可以从月初到当天运行报告.

    $date = [
        'start' => new \Carbon\Carbon('last month'),
        'end' => new \Carbon\Carbon('today')
    ];
Run Code Online (Sandbox Code Playgroud)

上面的代码将显示今天的日期,回到上个月的同一天.但是我想从第一次到现在.

有一种简单的方法可以像我一样做到这一点吗?无法在文档中找到任何内容.

php datetime laravel-4 php-carbon

29
推荐指数
2
解决办法
5万
查看次数

使用Vue.js设置复选框

我一直在谷歌搜索和玩我知道的每一个组合,但我不能让我的复选框初始化为已检查.

例:

<ul class="object administrator-checkbox-list">
    <li v-for="module in modules">
        <label v-bind:for="module.id">
            <input type="checkbox" v-model="form.modules" v-bind:value="module.id" v-bind:id="module.id">
            <span>@{{ module.name }}</span>
        </label>
    </li>
</ul>
Run Code Online (Sandbox Code Playgroud)

模块数据的示例:

[
    {
        "id": 1,
        "name": "Business",
        "checked": true
    },
    {
        "id": 2,
        "name": "Business 2",
        "checked": false
    },
]
Run Code Online (Sandbox Code Playgroud)

如何初始设置复选框的选中状态?

javascript vue.js

23
推荐指数
4
解决办法
7万
查看次数

限制使用Laravel分页显示的链接数量

有什么简单的方法来限制Laravels分页显示的链接数量?

目前它最多显示13个链接(上一个,1 2 3 4 5 7 8 .. 78 79下一个)

然而,这对于移动设备来说太多了,并且变成了双线导航...有没有办法将链接设置为例如只显示10?

我和分页主持人搞砸了,但实际上似乎没什么用.

谢谢

php pagination laravel

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

使用BulletProof上传类时,在上传之前调整图像大小

发现这很好,很快实现.它工作得很好,但在上传图像之前我想要它,它们被调整到最大宽度但保持比率.

假设我正在上传宽度为5000像素的图像,我希望将其调整为1000px宽度,但保持高度比,然后保存最终图像.

用法示例:

/* shrink() - will shrink/resize the image according to the given dimensions (in pixels) 
 * NOTE, a folder called 'shrinked_images' will be created first to store the uploaded image
 */ 
$bulletProof
->fileTypes(array("jpg", "gif", "png", "jpeg"))
->uploadDir("shrinked_images")
->shrink(array("height"=>100, "width"=>200))
->upload($_FILES["pictures"]);
Run Code Online (Sandbox Code Playgroud)

GitHub:

https://github.com/samayo/bulletproof

我已阅读了文档,但无法找到有关调整大小的内容.我能在代码中找到的只是缩小函数,但是无法看到如何添加保持率选项?

谢谢.克雷格.

php image class image-uploading bulletproof

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

找不到HTML文档的字符编码声明

随机获取此问题出现在我的Firefox的Web控制台(是js选项卡)

它刚刚出现,不能将它与我所做的任何改变联系起来.

完整的错误是:

The page was reloaded, because the character encoding declaration of the HTML document was not found when prescanning the first 1024 bytes of the file. The encoding declaration needs to be moved to be within the first 1024 bytes of the file.
Run Code Online (Sandbox Code Playgroud)

或者这一个:

The character encoding declaration of the HTML document was not found when prescanning the first 1024 bytes of the file. When viewed in a differently-configured browser, this page will reload automatically. The encoding declaration …
Run Code Online (Sandbox Code Playgroud)

html javascript meta utf-8 character-encoding

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

检测CKEditor的焦点

试图解决问题在IOS设备上键盘破坏固定元素.

单击CKEditor文本区域时,我的目标是将该固定元素的样式设置为固定.

但是不确定如何检测CKEditor的焦点.

我没有尝试过任何工作,这里是基本的:

http://jsfiddle.net/B4yGJ/180/

CKEDITOR.replace('editor1');

$('#editor1').focus(function() {
  alert('Focused');
});
Run Code Online (Sandbox Code Playgroud)

html javascript jquery ckeditor

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

Laravel 4 - 此PHP安装不提供ImageMagick模块

试图让ImageMagick在我的本地机器上工作但收到错误:

ImageMagick module not available with this PHP installation.
Run Code Online (Sandbox Code Playgroud)

我从来没有见过那个错误所以不知道从哪里开始.我正在运行PHP 5.6.2(根据MAMP),自从我第一次看到错误安装ImageMagick与自制软件,然后也尝试了mac安装程序,但我仍然得到相同的问题.

有帮助吗?

php imagemagick

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

锚标签上的边框底部,适用于多行并具有内联块/块显示

我在我的网站上有一些锚标记,我需要根据设计有一个"自定义"下划线.

问题是当链接文本分成多行时,底部边框仅适用于锚的底线/底部.我可以通过给锚链接显示内联来解决这个问题,但是后来我失去了为它们提供边距的能力.

有没有什么方法可以给链接一个2px的下划线并且可以跨多行工作,同时还能给他们一个保证金顶部?

示例小提琴:

https://jsfiddle.net/mjxfzrwk/

代码只是包含:

.custom-underline {
  border-bottom: 2px solid red;
  display: inline-block;
  margin-top: 20px;
}
.standard-underline {
  text-decoration: underline;
  display: inline-block;
  margin-top: 20px;
}
.inline {
  display: inline;
}
.container {
  width: 100px;
}
a {
  text-decoration: none;
  line-height: 29px;
  font-size: 20px;
}
Run Code Online (Sandbox Code Playgroud)
<div class="container">
  <a class="custom-underline" href="">This has a good underline</a> 
  <br/>
  <a class="standard-underline" href="">This has a standard underline</a> 
  <br />
  <a class="custom-underline inline" href="">This has a good underline but display inline removed top margin</a>
</div>
Run Code Online (Sandbox Code Playgroud)

css anchor

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

Laravel 5 - 在将资源的所有投票作为关系返回时,检查用户是否已经"投票"

我正在为我正在开发的链接共享网站制作一个投票系统.

当用户对链接进行投票时,新行将添加到具有链接ID和用户ID的数据库中.

在我的控制器中显示这些链接时,我称之为关系(投票):

$links = Link::orderBy('created_at', 'desc')->with('votes')->paginate(20);
Run Code Online (Sandbox Code Playgroud)

和模型中的关系

public function votes()
{
    return $this->hasMany('\App\LinkVote');
}
Run Code Online (Sandbox Code Playgroud)

在我看来,我在$ links上运行foreach以显示每个.我的目的是,如果用户已经投票支持该链接,则显示不同的按钮.

当dd'ing $ link->投票时,我得到:

在此输入图像描述

如何检查(在我的视图和foreach中)当前登录的用户是否在该投票数组中?

php laravel laravel-5.3

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