嘿!
/static
我的Apache 2.x服务器webroot中有一个文件夹.如果请求匹配
/static/<somename like [\S-_]+>.(png|jpg|css|js)/\d{8,15}
Run Code Online (Sandbox Code Playgroud)
例如
/static/bg.jpg/1335455634
Run Code Online (Sandbox Code Playgroud)
我想要两件事:
/static/bg.jpg
(摆脱时间戳)如果请求不匹配,请求及其标题应该正常,不重写.理想情况下,/ static/*之外的任何请求都不应受到影响(尽管«巧合的尾随时间段»应该很少......)
我对FilesMatch/RewriteCond只有麻烦,所以我宁愿不发布我的不良尝试...(在我的机器上启用了genereal中的重写,我确实拥有发送缓存相关头文件的权限)
Dankeschön!
我想标记格式化字符串(非常类似于printf),我想我只是遗漏了一点点:
²update:现在使用#而不是%.(使用Windows命令行参数减少麻烦)
如果你专注于通过管道连接的三个部分(作为 - 或者),这并不可怕,所以基本上它只是三个匹配.由于我想从头到尾进行匹配,因此我将事物包裹起来/^...%/
并被一个(?:...
可能重复一次或多次的不匹配组包围:
$exp = '/^(?:(%\\d*[ctYymd]+)|([^$%]+)|(\\$\\d))+$/';
Run Code Online (Sandbox Code Playgroud)
我的来源仍未提供:
$exp = '/^(?:(%\\d*[ctYymd]+)|([^$%]+)|(\\$\\d))+$/';
echo "expression: $exp \n";
$tests = [
'###%04d_Ball0n%02d$1',
'%03d_Ball0n%02x$1%03d_Ball0n%02d$1',
'%3d_Ball0n%02d',
];
foreach ( $tests as $test )
{
echo "teststring: $test\n";
if( preg_match( $exp, $test, $tokens) )
{
array_shift($tokens);
foreach ( $tokens as $token )
echo "\t\t'$token'\n";
}
else
echo "not valid.";
} // foreach
Run Code Online (Sandbox Code Playgroud)
我得到的结果却是:比赛失灵了.第一个%[数字] [字母]从不匹配,因此其他匹配双:
expression: /^((%\d*[ctYymd]+)|([^$%]+)|(\$\d))+$/
teststring: ###%04d_Ball0n%02d$1 …
Run Code Online (Sandbox Code Playgroud) 对于一个新项目,我必须保持webpack-only,因此需要找到一种方法来有效地编译我们的样式表.基本上是以一种非常有道理的方式:
src/**/*.less
(CSS顺序可以是任意的)../node_modules/vendor/**/*.css
或3rdparty/master.less
bogus.js
入口点,那很好......)cssnano
做它的优化工作,与像例如特定的CSS纳米选项orderedValues: false, normalizeWhitespace: true
...styles.css
为最终输出而且当然:
styles.css.map
我做的事情并不需要的是css modules
(CSS imported
成"作用域"使用,出来哈希范围的选择节点模块...)
这个问题是我的第一次尝试,在合并之后我被困在中间的配置中...
我知道,对于webpack,包括css甚至字体和图像在内的任何资源都是一个"模块"......而不是将我的css"模块"与实际的js合并(后来再次将它们再次精心地分开),它可能是更聪明,有一个cssstub.js
并行的入口点- 也称为多编译器模式.
但那真的是,我的智慧结束了......在webpack中对一组文件执行一系列$ thing似乎真的很难(除非它是一个连接的javascript模块图).我确实在globbing上找到了一些东西,但这还不够(合并css,cssnano,......)而且大多数时候我根本无法将这些碎片粘在一起......
我有一些像这样的 Sass:
.zbounce1, .zbounce2, .zbounce3, .zbounce4
animation-name: bounceIn
animation-duration: .5s
animation-timing-function: ease-in-out
span.zbounce1, span.zbounce2, span.zbounce3, span.zbounce4
display: inline-block
Run Code Online (Sandbox Code Playgroud)
我想将第二部分简化为第一部分的嵌套部分,因此我不必再次提及每个类:
span.&
display: inline-block
Run Code Online (Sandbox Code Playgroud)
可悲的是,这是不合法的。(相反,用嵌套专门化一堆样式&.anotherClass
很容易......
有什么解决方法可以实现这一目标吗?(也许使用@extendOnly-Placeholder?)或一些时髦的 sass 连接...?
NodeJS给了我一个警告
(node:32600)[DEP0013] DeprecationWarning:不建议在不回调的情况下调用异步函数.
当我运行这个'测试'时:
describe('whatever', () => {
it('test simple', async () => {
const dir = './build/fileTests';
if (fs.existsSync(dir)) {
console.log(`deleting ${dir}`);
await fs.rmdir(dir);
}
});
});
Run Code Online (Sandbox Code Playgroud)
好吧,我几乎同意,使用没有回调的异步函数是不好的(因为只有在cb内你才能确定,它发生了,继续等等......
...如果不是因为我故意使用ES7 async
/await
,因为它们使它同步,所以我可以使用我得到的任何东西......(在这种特殊情况下,我可以逃避到rmdirSync,但那不是我的点...)
所以我的问题:如何摆脱这些警告?
- 以有意义的方式,当使用async/await时... - 处理返回值,因为const r = ...
它不被识别为'回调处理'...
menu
和 maincontent
是特定于模块的,因此我使用的是插槽。换句话说:五分之一的不同可能的父组件使用这个组件并提供main
内容和一个(单独不同的)menu
,使用角度内容投影。 <ng-template #menu><ng-content select="[slot='menu']"></ng-content></ng-template>
<ng-template #content><ng-content select="[slot='content']"></ng-content></ng-template>
<section *ngIf="landscape">
<div class="global-ui-top">
<ng-container *ngTemplateOutlet="menu"></ng-container> // 1st
</div>
<some-main-content>
<ng-container *ngTemplateOutlet="content"></ng-container>
</some-main-content>
<div class="global-ui-bottom">
<ng-container *ngTemplateOutlet="menu"></ng-container> // 2nd
</div>
</section>
// portrait mode
<section *ngIf="!landscape">
... pretty similar to above, also 2× menu, 1× content...
Run Code Online (Sandbox Code Playgroud)
A <ng-container *ngTemplateOutlet="menu"></ng-container> A
B <ng-container *ngTemplateOutlet="menu"></ng-container> B
Run Code Online (Sandbox Code Playgroud)
...然而,插槽 get 只在最后一次“选择一次”(两个 A 之间的标签保持为空)。换句话说,我的第一个.global-ui-top
仍然是空的。
注意:ng-detour
第 …
我做了以下事情:
npm install TuningGuide/react-sortable-hoc --save
npm info it worked if it ends with ok
npm info using npm@3.10.5
npm info using node@v6.2.2
npm info git [ 'clone',
npm info git '--template=/Users/velten/.npm/_git-remotes/_templates',
npm info git '--mirror',
npm info git 'git://github.com/tuningguide/react-sortable-hoc.git',
npm info git '/Users/velten/.npm/_git-remotes/git-github-com-tuningguide-react-sortable-hoc-git-78a804e9' ]
npm info git [ 'rev-list', '-n1', 'master' ]
npm info git [ 'clone',
npm info git '/Users/velten/.npm/_git-remotes/git-github-com-tuningguide-react-sortable-hoc-git-78a804e9',
npm info git '/var/folders/95/ylk5ht9s24n6xk4rcr6sch4r0000gn/T/npm-22395-24e6f9cc/git-cache-220f34bb/09fb1e0c7d657657b9aa091c018b45aee0ed0662' ]
npm info git [ 'checkout', '09fb1e0c7d657657b9aa091c018b45aee0ed0662' ]
npm info git [ 'submodule', '-q', 'update', …
Run Code Online (Sandbox Code Playgroud) 我有一个Bootstrap使我的选项菜单可视化的方式的问题.看看截图:
我不知道是什么原因造成的.我没有在这个特殊情况下使用标签,但他们也没有帮助.
这是代码:
<nav class="sidebar col-sm-4 col-md-3 d-inline align-self-auto">
<div class="form-group">
<select class="custom-select mt-2">
<option selected>?????</option>
<option value="1">???</option>
<option value="2">????</option>
<option value="3">????</option>
</select>
Run Code Online (Sandbox Code Playgroud)
请帮我这个,因为我想要一个漂亮的网站.我正在使用Bootstrap 4.0.0.b我还应该提到我正在使用gulp来编译我的CSS.
提前致谢.
我是一个相当大的ReactJS项目的新手。在顶层,它并没有具备平常webpack.config.js
,但只有一个`webpack.config.babel.js'。我可以验证一下,这个确实可以使用了
> webpack
Run Code Online (Sandbox Code Playgroud)
被调用(通过npm run
NODE_ENV = development和WEBPACK_CONFIG =server_dev²,但这无关紧要)。
a)如果我删除了babel-config,我将收到以下正当的投诉:
在当前目录中,配置文件可以命名为“ webpack.config.js”。
b)相反,如果我添加我自己要做的几乎没有的事情webpack.config.js
,那确实是“规则”(webpack.config.babel.js
不再使用)。
因此,很明显,webpack.config.js
如果缺少此文件,则会启动一个“不可访问的”默认值。再说一遍,显然吗?此默认配置以某种方式迎合了webpack配置吗?通过什么方式?通过安装那些节点模块?
还是.babelrc
将各种标记文件添加到webpack?
有趣的是,这个项目,preact-www
项目具有相同的东西。(也不是原始的webpack配置,而是webpack的风格)。所以他们知道一些,我不知道...
css ×3
node.js ×3
gulp ×2
webpack ×2
webpack-3 ×2
.htaccess ×1
angular ×1
apache ×1
async-await ×1
asynchronous ×1
config ×1
ecmascript-6 ×1
fs ×1
github ×1
html ×1
javascript ×1
less ×1
mod-expires ×1
npm ×1
php ×1
regex ×1
sass ×1
tokenize ×1