我的历史看起来像这样:
* 3830e61 Add data escaping. (Bad)
* 0f5e148 Improve function for getting page template.
* aaf8dc5 Merge branch 'navigation'
|\
| * 3e667f8 Add icons.
| * 43a07b1 Add menu styles. (Breaks)
| * 107ca95 Add Responsive Nav. (Good)
* | ea3d736 Add ‘Admin’ notice.
* | 17ca0bb Update placeholder text.
|/
* f52cc34 Add featured image.
* 2abd954 Style placeholders.
Run Code Online (Sandbox Code Playgroud)
我正在努力学习更多git bisect,但我对这段历史遇到了麻烦.我知道这107ca95很好而且3830e61很糟糕.当我运行时git bisect,提交107ca95..3e667f8被忽略.我碰巧知道这43a07b1是引入回归的提交,但它永远不会被评估.
这大致是我所做的:
git checkout …Run Code Online (Sandbox Code Playgroud) 我正在开发我的第一个项目,我正在利用PHPUnit进行单元测试.事情一直在顺利进行; 但是,我已经开始使用最近的测试得到以下输出:
................................................................. 65 / 76 ( 85%)
...........
Time: 1 second, Memory: 30.50Mb
OK (76 tests, 404 assertions)
Run Code Online (Sandbox Code Playgroud)
我找不到任何关于"65/76(85%)"的含义的信息.
有谁知道如何解释这个?
谢谢!
由于" 不允许错误的URI或跨站点访问 "问题,通过Cloudfront提供的字体在Firefox中被破坏.为了解决这个问题,我了解到我需要将"Access-Control-Allow-Origin"标头设置为通配符或源域.
我遇到的问题是,Cloudfront似乎不接受来自原点的标头.
例如,以下是我在服务器上ping字体时获得的标头列表:
curl -I -s "https://mysite.com/wp-content/themes/my-theme/includes/fonts/ProximaNova-Reg-webfont.ttf"
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 29 Jan 2014 16:03:03 GMT
Content-Type: application/x-font-ttf
Content-Length: 44992
Last-Modified: Tue, 28 Jan 2014 22:21:41 GMT
Connection: keep-alive
ETag: "52e82d75-afc0"
Expires: Thu, 29 Jan 2015 16:03:03 GMT
Cache-Control: max-age=31536000
Access-Control-Allow-Origin: https://mysite.com
Access-Control-Allow-Methods: GET
Access-Control-Max-Age: 3600
Accept-Ranges: bytes
Run Code Online (Sandbox Code Playgroud)
这种反应一切都很好看; 但是,当我为同一资源ping Cloudfront时,我得到:
curl -I -s "https://ds6dj5kp03o39.cloudfront.net/wp-content/themes/my-theme/includes/fonts/ProximaNova-Reg-webfont.ttf"
HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: 44992
Connection: keep-alive
Date: Wed, 29 Jan 2014 16:22:30 GMT
Server: Apache/2.2.16 …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用MAMP在OS X Lion中设置开发环境.我历史上使用它的默认设置MAMP设置,但现在我需要使用虚拟主机进行环境设置.为此,我做了以下事情:
1)添加到hosts文件:
127.0.0.1 test.com
127.0.0.1 my.test.com
Run Code Online (Sandbox Code Playgroud)
2)编辑了httpd.conf和httpd-vhosts.conf(都位于MAMP文件夹中).对于httpd.conf,我只是取消注释该Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf行.对于httpd-vhosts.conf,我添加了:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "/Users/username/Sites/test.com"
ServerName test.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Users/username/Sites/my.test.com"
ServerName my.test.com
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
3)我将MAMP中的端口更改为80(Apache)和3306(MySQL).
4)我关闭了系统首选项中的个人Web共享.
现在,有了这个集合,当我导航到"test.com"到test.com:8888时,我会遇到重定向.我不知道它来自哪里.然后,当我去"http:// localhost时",我得到了"It Works!"的问候,表明OS X Lion Apache服务器正在运行.
我错过了这种配置的东西吗?有什么想法吗?
非常感谢你的帮助!
我有一个我想要操作的简单字符串:
您的订单将很快得到处理:
我用以下方法抓住字符串:
var html = jQuery('.checkout td h4').html();
Run Code Online (Sandbox Code Playgroud)
然后我尝试使用以下命令替换':':
html.replace(":", ".");
Run Code Online (Sandbox Code Playgroud)
当我将其打印到控制台时,该字符串与原始字符串相同.我还尝试html通过执行以下操作确保变量的类型为"string":
html = html + "";
Run Code Online (Sandbox Code Playgroud)
这没有任何作用.在搜索时,似乎该replace函数执行RegEx搜索并且":"字符可能具有特殊含义.我不知道如何解决这个问题.有人可以帮助我摆脱这个臭的冒号吗?
我有一个简单的数组,我正在尝试JSON编码并设置为cookie.我使用json2.js脚本编码为JSON.我使用以下代码来设置cookie:
jQuery(document).ready(function(){
var ids = ['1', '2'];
JSON.stringify(ids);
setCookie(cookieName, ids, 1);
});
function setCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
Run Code Online (Sandbox Code Playgroud)
将数组转换为JSON并将其记录在控制台中后,我得到:
["1", "2"]
Run Code Online (Sandbox Code Playgroud)
这是我所期待的.然后我用以下函数读出cookie
function getCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return …Run Code Online (Sandbox Code Playgroud) 我需要帮助来改变类似的事情:
<img class="coup-pic" src="http://example.com/img/pic.jg" alt="" />
Run Code Online (Sandbox Code Playgroud)
进入:
<a href="http://example.com/img/pic.jg"><img class="coup-pic" src="http://example.com/img/pic.jg" alt="" /></a>
Run Code Online (Sandbox Code Playgroud)
我需要能够使用 PHP 动态搜索类似上面的字符串,并将其包装在 a 标记中,并使用 src 属性作为 a 标记。我想我需要使用 preg_replace,但我不知道要使用正确的正则表达式。
谢谢您的帮助!
我在查找文档方面遇到困难,因为我认为您可以使用PHP向SalesForce检索产品列表.我看到很多关于获取联系人的信息,但不是产品.有可能获得产品吗?如果是这样,你能指出我可以从中了解到这一点.
I am trying to set up a regex that will match the following:
*test*
*t*
*te*
Run Code Online (Sandbox Code Playgroud)
But, I do not want it to match:
*test**
Run Code Online (Sandbox Code Playgroud)
The general rules are:
^) or a whitespace character (\s)**$) or a whitespace character (\s) …javascript ×2
php ×2
regex ×2
apache ×1
cdn ×1
cookies ×1
cors ×1
git ×1
git-bisect ×1
json ×1
mamp ×1
osx-lion ×1
phpunit ×1
salesforce ×1
string ×1