Da'sBlog


  • 首页

  • 分类

  • 归档

  • compass中文手册

  • 搜索
close
Da'sBlog

linux点命令执行linux.命令

发表于 2017-04-01 | 分类于 linux

.: . filename [arguments]
. 文件名 [参数]

Execute commands from a file in the current shell.
在当前的shell脚本中加载一个文件执行里面的命令.

Read and execute commands from FILENAME in the current shell.  The
在当前的shell脚本中加载一个文件读取和执行里面的命令.

entries in $PATH are used to find the directory containing FILENAME.
$PATH环境变量用于查找文件目录

If any ARGUMENTS are supplied, they become the positional parameters
when FILENAME is executed.
如果有形参,文件在被执行的时候实参就会传过去。
ps:(parameter=形参(formal parameter), argument=实参(actual parameter)。)

Exit Status:
退出状态:

Returns the status of the last command executed in FILENAME; fails if
FILENAME cannot be read.
返回文件最后执行的命令的状态;如果无法读取文件返回失败。
阅读全文 »
Da'sBlog

vmware-nonet

发表于 2017-03-17 | 分类于 vmware
很多小伙伴,在配置完虚拟机后,发现无法正常上网,这是为什么呢?
导致这个原因大部分是因为,我们的电脑有多个网卡,而我们设置的桥接方式是自动配置的,无法正确识别,主网卡。
这个时候我们可以通过 虚拟网络编辑器 编辑网桥 指定网卡就可以。
阅读全文 »
Da'sBlog

git fork和clone区别,fetch与pull区别

发表于 2017-03-10 | 分类于 git

fork:github中,克隆别人仓库的项目到自己的仓库
clone:克隆github或者其他远程 git服务器仓库的项目到自己的 本地

阅读全文 »
Da'sBlog

apache配置

发表于 2017-03-09 | 分类于 apache

优雅重启

1
/usr/local/apache2/bin/apachectl graceful

vhost配置路径
/usr/local/apache2/etc/extra

httpd配置路径
/usr/local/apache2/etc

阅读全文 »
Da'sBlog

php函数参数类和接口

发表于 2017-03-07 | 分类于 php

参数为类的实例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
class C {}
class D extends C {}
// This doesn't extend C.
class E {}
function f(C $c) {
echo get_class($c)."\n";
}
f(new C);
f(new D);
f(new E);
?>

输出为

1
2
3
4
5
6
7
8
9
10
11
<?php
C
D
Fatal error: Uncaught TypeError: Argument 1 passed to f() must be an instance of C, instance of E given, called in - on line 14 and defined in -:8
Stack trace:
#0 -(14): f(Object(E))
#1 {main}
thrown in - on line 8
?>
阅读全文 »
Da'sBlog

webpack热拔插教程hmr

发表于 2017-03-07 | 分类于 webpack

http://andrewhfarmer.com/webpack-hmr-tutorial/
Struggling to set up HMR with Webpack?

Are you finding the Webpack documentation to be lacking - particularly in the HMR section? Does it seem like they’ve left out some important parts?

If so, read on! We’ll fill in the gaps together.

By the way, HMR stands for ‘Hot Module Replacement’, sometimes called ‘hot module swapping’. It’s a Webpack feature that updates your JavaScript in-place without a browser refresh - whenever you make code changes. I love it because it enables a very fast developer workflow.
HMR Myths
First let’s get a couple myths about HMR out of the way.

阅读全文 »
Da'sBlog

laravel学习零散知识点

发表于 2017-03-06 | 分类于 laravel

<?php
$firstname = “Bill”;
$lastname = “Gates”;
$age = “60”;

$result = compact(“firstname”, “lastname”, “age”);

print_r($result);
?>
compact 紧凑的

动人的; 雄辩的,有口才的; 有说明力的; 富于表情的,逼真的;
eloquent
英文发音:[‘lærəvel]

作者 Taylor Otwell

In Narnia, Cair Paravel is the name of the castle where the kings and queens of Narnia live. Laravel rhymes with Paravel. I thought the name had a classy and sophisticated ring to it.— Taylor Otwell —

Laravel这个名字来自于纳尼亚传奇中的Cair Paravel城堡。Laravel 和Paravel 的发音相似,Taylor认为Laravel这个名字韵味深长而又优雅,所以命名为Laravel。
Cair Paravel 中的Paravel发音为[‘pærəvel] 推断Laravel发音取[‘lærəvel]

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{!! !!} 相当于 <?php echo $value; ?>
{{ }} 相当于 <?php echo htmlspecialchars($value); ?>
csrf_field()
csrf_field 函数生成一个包含 CSRF 令牌值的 HTML 隐藏域,例如,使用Blade语法示例如下:
{!! csrf_field() !!}
{{{}}} 完全转换html
@if()
@else
ss
@endif
@foreach()
@endforeach
@for
@endfor
@while
@endwhile
csrf_token()
csrf_token 函数获取当前 CSRF 令牌的值:
$token = csrf_token();

php artisan make:controller myController
php artisan route:list

laravel collect

laravel 请求 query get has exists
has 和exists 的区别 has 判断 是否存在此参数 其此参数不为空
检索 only
去除 Request::except(‘name’,’age’) 去除
url Request::url() 全部 fullUrl()

请求历史 flash flashExcept flashOnly old
请求文件 Request::file(‘’profile)->getSize()
getClientOriginalName
getClientOriginalExtension
session 教程http://blog.csdn.net/ghost_hell/article/details/53177072
Hash::make()

laravel
yield 用于定义个内容的片段 里面没有内容 只是内容的片段
section 用于定义给定片段的内容 定义了内容 可以多次继承覆盖

服务容器 都是依靠构造函数或者某些情况下通过 setter 方法将类依赖注入到类

阅读全文 »
Da'sBlog

git文件状态

发表于 2017-03-06 | 分类于 git

mark
灰色箭头不参与git快照。

  1. 默认git有4种状态
  2. untracked 未跟踪
  3. unmodified 未修改
  4. modified 修改
  5. staged 暂存区

其中我们工作区中只有 未修改 和修改。

初始化,和commit后 所有为跟踪的文件都是 未修改的。

运行了 git add 之后又作了修订的文件,需要重新运行 git add 把最新版本重新暂存起来:

阅读全文 »
Da'sBlog

window命令 端口占用、查杀进制

发表于 2017-03-05 | 分类于 window

cmd关闭php的一个示例

首先用php -S 开启一个服务

mark

另开一个窗口,查询占用了8081端口的进程:netstat -ano|findstr 8081,找到pid为12552

mark

tasklist|findstr 12552 。发现就是我们的php服务

mark

taskkill /f /t /im php.exe

/f 强制
/t 关闭子进程
/im 文件名
taskkill /f /PID 12552
/PID 删除指定pid

阅读全文 »
Da'sBlog

window命令mklink 创建符号链接 硬链接 目录联结

发表于 2017-03-05 | 分类于 window

最近研究mklink 发现国内很多文档认识有错误 或者不充分,在此补充下。

  1. 符号链接 用的比较多 也就是我们的快捷方式
  2. 硬链接 用的很少 可以防止误删,省空间等、
  3. 目录联结 一般用于共享目录

    链接的本质是创建一个指向原文件的路径

mark
我们的文件其实是存在磁盘空间中, 文件名指向磁盘空间,最后访问文件名 访问到它所指向的空间。

mark

  1. 符号链接
    mklink /d

    和快捷方式几乎。但与其不同的是快捷方式是.link后缀的文件。

    删除原文件,这种链接就无效了

    阅读全文 »
1…567
Sun Hao

Sun Hao

Whoever wants to be first must be slave of all.

68 日志
26 分类
100 标签
RSS
Creative Commons
© 2018 Sun Hao
Powered by Hexo
Theme - NexT.Mist
本站访客数人次 本站总访问量次