小编gor*_*rds的帖子

Git排除了分支的文件

我想忽略分支中的某些文件,而不必依赖在.gitignore与其他分支合并期间将被覆盖的跟踪文件.

我一直密切关注Stack Overflow的回答以及链接的博客帖子,但我的回购似乎并没有认识到excludesfile我的指定.git/config.Git文档(git-config,gitignore)似乎没有显示如何指定和寻址特定分支的排除文件.

.git/config看起来像这样:

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
        ignorecase = true
        precomposeunicode = true
        excludesfile = +/info/exclude

[branch "myspecialbranch"]
        excludesfile = +/info/exclude_specialbranch
Run Code Online (Sandbox Code Playgroud)

我的.git/info/exclude文件看起来像这样(默认情况下,我没有触摸它):

# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude …
Run Code Online (Sandbox Code Playgroud)

git gitignore git-config

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

如何在 Laravel 5+ 中设置 PhpRedis?

背景
尝试在 运行 Apache 2.4.18、Php 7.0.14 和自制软件的 Mac OSX 本地服务器上的 Laravel 5.3 中使用PhpRedis ...无需额外(非官方)作曲家库

Redis是通过安装homebrew install redis和工作
测试的,redis-cli ping它给出PONG

PhpRedis通过安装homebrew install php70-redis
经过测试,php -r "if (new Redis() == true){ echo \"\r\n OK \r\n\"; }"它给出OK


设置
随着文档,这SO Laravel 4溶液我做到以下几点:

  1. aliasapp/config/app.php 中的定义从更改(或评论和添加)
    'Redis' => 'Illuminate\Support\Facades\Redis'

    'LRedis' => 'Illuminate\Support\Facades\Redis'
  2. 将客户端定义添加到redisconfig/database.php 中的数据库定义
    'client' => 'phpredis',
  3. 运行composer dump-autoload …

redis laravel phpredis laravel-5 laravel-5.3

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

angularjs cordova base href

试图base href为angularjs html5网络应用程序设置正确的值在cordova中工作

最初$locationProvider.html5Mode(true)用于 <base href="/">:

  • 应用程序在普通浏览器中完美运行
  • cordova为css/js/templates等提供资源错误
    (我相信它在cordova根目录而不是平台根目录中查找资源?)

在SO和ui-router 常见问题解答中尝试了一些替代方案:

<base href=".">使用html5模式根据这个答案:

  • 找不到资产在cordova(没有资源错误)
  • ui-router进入带有无限循环的尾部旋转和以下错误消息
    Error: Failed to execute 'pushState' on 'History': A history state object with URL 'https://page/' cannot be created in a document with origin https://example.com

<base href="./"> 使用html5模式:

  • 在cordova找到的资产(没有资源错误)
  • 给我一个可怕的Error: 10 $digest() iterations reached. Aborting!消息尝试使用这里提到的frankwallis解决方案,但没有帮助(相同的错误)

没有base href$locationProvider.html5Mode({enabled: true, requireBase: false});

  • 在cordova找到的资产(没有资源错误)
  • 页面开始加载自己?...在某些州有两次角度引导?

我的app配置定义如下:

myApp.config(['$locationProvider', '$urlRouterProvider', '$stateProvider', …
Run Code Online (Sandbox Code Playgroud)

html5 angularjs cordova angular-ui-router angular-ui-router-extras

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

angularjs google maps - 带窗口的标记 - infowindow不显示

尝试使用得到应用的角度,谷歌,地图:与
通过多个标记- markers指令
通过一个单一的信息窗口- window指令

我已经通过API和git-hub网站上的多个已关闭的问题/问题,但是无法让它工作......: - /

的jsfiddle

为简单起见,我手动声明标记(并且它们正确显示):

$scope.markers = [
    {
        id: 0,
        coords: {
            latitude: 37.7749295,
            longitude: -122.4194155
        },
        data: 'restaurant'
    },
    {
        id: 1,
        coords: {
            latitude: 37.79,
            longitude: -122.42
        },
        data: 'house'
    },
    {
        id: 2,
        coords: {
            latitude: 37.77,
            longitude: -122.41
        },
        data: 'hotel'
    }
];
Run Code Online (Sandbox Code Playgroud)

html看起来像:

<body ng-app="app">
    <div class="angular-google-map-container" ng-controller="MainCtrl">
        <ui-gmap-google-map center="map.center" zoom="map.zoom" draggable="true" options="map.options" events="map.events" control="googlemap">
            <ui-gmap-window coords="markers.coords" show="windowOptions.show" closeClick="closeClick()">
                <div>Hello</div>
            </ui-gmap-window>
            <ui-gmap-markers models="markers" idkey="markers.id" coords="'coords'" …
Run Code Online (Sandbox Code Playgroud)

infowindow marker angularjs angular-google-maps

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

angular-google-maps在初始地图加载后运行函数ONCE

使用angular-google-maps将谷歌地图合并到一个应用程序中

我需要一个命令,它将在初始地图加载完成后运行一个函数ONCE
- 但仅限于初始加载,而不是在每个地图操作之后

我不能使用idletilesloaded因为这些都是在每次运动后被解雇的......

我想要运行的函数需要获取映射边界以在初始页面加载时从服务器中提取数据 - 我希望在初始加载时发生ONCE,然后是使用刷新的手动函数map-control
- 如果我使用idletilesloaded触发它将会每次用户移动地图时拉取服务器数据.

有没有人知道如何在初始地图加载后触发一次性命令来获取地图详细信息(边界等)?

我已经尝试过maps.getBounds()第二个承诺函数,但它不起作用.

请注意,我有一个小提琴在这里工作 - $scope.map在定义控件/选项等之后我无法链接任何更多的承诺,因为它们没有返回一个承诺:

在文档中的代码示例不显示如何串连承诺$scope.map定义.

HTML

<div class="angular-google-map-container" ng-controller="MainCtrl">
    <ui-gmap-google-map center="map.center" zoom="map.zoom" draggable="true" options="map.options" events="map.events" control="googlemap">
    </ui-gmap-google-map>
</div>
Run Code Online (Sandbox Code Playgroud)

调节器

myApp.controller('MainCtrl', function($scope, uiGmapGoogleMapApi) {
    uiGmapGoogleMapApi
    .then(function(maps){
        $scope.map = {
            center: {
                latitude: 37.7749295, 
                longitude: -122.4194155 
            },
            zoom: 12
            events: {
                tilesloaded: function (maps, eventName, args) {
                    myServiceFuntion(maps)    // …
Run Code Online (Sandbox Code Playgroud)

javascript google-maps angularjs angular-google-maps

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

Web应用程序和cordova app之间的代码共享

我们已经编写了一个angularjs网站/应用程序 - 针对移动设备进行了优化,
并使用cordova制作基于html5的移动应用程序.

代码(html,css,js)对于web应用程序和cordova应用程序都是相同的,
但会有一些不同的文件.

我们如何设置我们的git repo以共享(仅)web-app repos和cordova-app repos之间的公共文件?

显然,任何.gitignore文件都被跟踪,并且对所有回购都是通用的.我们可以在cordova repo中添加我们不想要的所有文件,.gitignore但这会降低3个web应用程序回购对于一个cordova回购的可用性.

我们尝试过:

  1. 有一个本地回购的cordova应用程序的项目与.git/info/excludes该回购而不是.gitignore文件 - 但这只解决了从该回购推送的问题,而不是从原点拉出(这将导致未跟踪文件的错误)

  2. 设置一个不同的分支 - 并使用git流样式方法进行合并的中间分支 - 但是(显然)不可能有一个.git/info/excludes特定的分支 - 所以一切都会被覆盖在每个合并

git github angularjs cordova hybrid-mobile-app

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

Laravel 5 通过 AWS EC2 上的 cron 进行调度 - 命令未运行

问题:
我有一个 Laravel 5.4 artisan 任务,我需要通过 cron 运行它 - 尽管命令和调度程序(显然)设置正确,但它并没有完成。

这是 Laravel、php、apache、linux 或 crontab 的问题吗?最好的诊断方法是什么?


背景
在默认(亚马逊 AMI)EC2 实例上,artisan 命令被正确定义,并/var/www/html/myproject/在通过以下方式调用时从项目目录(即)完美运行:

php artisan mycommand:option1
Run Code Online (Sandbox Code Playgroud)

我已将此添加到如下所示的时间表中app/Console/Kernel.php

protected function schedule(Schedule $schedule)
{
    Log::info('schedule:run');
    $schedule   ->command('mycommand:option1')
                        ->dailyAt('07:00')
                        ->emailOutputTo('email@email.com');

    $schedule   ->command('mycommand:option2')
                        ->dailyAt('07:15')
                        ->emailOutputTo('email@email.com');
}
Run Code Online (Sandbox Code Playgroud)

apachevia添加了以下 cron 命令sudo crontab -u apache -e

* * * * * php /var/www/html/myproject/artisan schedule:run >> /dev/null 2>&1
Run Code Online (Sandbox Code Playgroud)

为了确保这不是权限问题,我还为以下用户添加了相同的命令:

  • ec2-user 通过 crontab -e
  • root 通过 sudo crontab -e

系统输出

来自sudo tail -f …

php cron laravel laravel-5 laravel-scheduler

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

angularjs deferred承诺不推迟

努力让promise在promjs服务提供商中正常工作我已经阅读了文档以及大量的例子(这里,这里这里),我想我的语法很好(虽然显然有些不对劲)

app模块和控制器看起来像

var myApp = angular.module('myApp', []);

myApp.controller('Controller_1', ['$scope', 'Service_1', function($scope, Service_1) {

    var myName = "Ben";

    Service_1.slowService(myName)
        .then(Service_1.fastService(name));

    $scope.myName = myName;
}]);
Run Code Online (Sandbox Code Playgroud)

服务(具有慢速功能)看起来像这样:

myApp.service('Service_1', function($q) {
    this.slowService = function (name) {
        var deferred = $q.defer();
        console.log('Start of slowService:', name, Date.now());

        setTimeout(function() {
            console.log('setTimeout name:', name, Date.now());

            if(name){
                name = 'Hello, ' + name + " is learning Angularjs";
                alert(name); 
                    console.log('name:', name);
                deferred.resolve(name);
            } else {
                deferred.reject('No name supplied !'); …
Run Code Online (Sandbox Code Playgroud)

javascript promise deferred angularjs angular-promise

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