require

Composer global require “laravel/installer” failed

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I shifted from windows to xubuntu. I am using Laravel in windows and installed it via composer from the docs. Everything works fine there. But when I shifted to xubuntu installed lamp php and mysql now everything works fine including the phpmyadmin. I also installed composer and now trying to install laravel and this error shows up below. Your requirements could not be resolved to an installable set of packages. Problem 1 - laravel/installer v1.4.1 requires ext-zip * -> the requested PHP extension zip is missing from your system. - laravel

How to let asynchronous readFile method follow order in node.js

匿名 (未验证) 提交于 2019-12-03 10:10:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a code like this var fs = require ( 'fs' ); console . log ( "1" ); fs . readFile ( "./index.js" , function ( err , data ) { if ( err ) { console . log ( "err" ); } console . log ( "2" ); }); console . log ( "3" ); and the result will be 1 3 2 But I want 1 2 3 I have look through filesystem's document and it says With the asynchronous methods there is no guaranteed ordering. so the document says if I want my code result 1 2 3 it should be var fs = require ( 'fs' ); console . log ( "1" ); fs . readFile ( "./index.js" ,

Node.js require() vs RequireJS?

时光总嘲笑我的痴心妄想 提交于 2019-12-03 09:59:15
问题 Hello with RequireJS I can set a base path like this: base : './app/' so when I am in ./app/foo/bar/ for example and I have a script where I use require('foo'); RequireJS then would search for ./app/foo.js and not in node_module folder or in ./app/foo/bar/foo.js this comes handy when you have a kind of structure where it would be much cleaner for you as a developer to see the dependencies instead of having ../../foo.js . I could have ./app/foo.js and ./app/foo/foo.js and ./app/foo/bar/foo.js

RAILS_ROOT require?

筅森魡賤 提交于 2019-12-03 09:55:36
I'm trying to access the RAILS_ROOT constant in a file residing in the /lib directory, but I'm not able to (uninitialized constant error). Is there something that I need to require to be able to do this? Yes, you should require the environment.rb: require File.dirname(__FILE__) + '/../config/environment.rb' puts RAILS_ROOT And Rails.root instead. 来源: https://stackoverflow.com/questions/2933225/rails-root-require

gulp-uglify won't preserve files order

匿名 (未验证) 提交于 2019-12-03 09:52:54
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: When I use gulp-uglify to minify the Javascript files the order gets messed up. Lets say I have this task working as expected: var gulp = require('gulp'); var rename = require('gulp-rename'); var gp_concat = require('gulp-concat'); gulp.task('js', function() { gulp.src([ './public/bower_components/jquery/dist/jquery.min.js', './public/js/functions.js', ]) .pipe(gp_concat('combined.js')) .pipe(gulp.dest(path.js + '/dist')) }); Adding the uglify line to it changes the order of the jquery and functions files and places functions.js above jquery

vue-cli3 项目从搭建优化到docker部署

易管家 提交于 2019-12-03 09:52:48
项目地址 vue-cli3-project 欢迎 star 原文地址 https://www.ccode.live/lentoo/list/9?from=art 1. 创建一个vue项目 相信大部分人都已经知道怎么创建项目的,可以跳过这一节,看下一节。 1.1 安装@vue/cli # 全局安装 vue-cli脚手架 npm install -g @vue/cli 等待安装完成后开始下一步 1.2 初始化项目 vue create vue-cli3-project 选择一个预设 可以选择默认预设,默认预设包含了 babel , eslint 我们选择更多功能 Manually select features 回车后来到选择插件 插件选择 这边选择了(Babel、Router、Vuex、Css预处理器、Linter / Formatter 格式检查、Unit测试框架) 路由模式选择 是否使用 history 模式的路由 (Yes) 选择一个css预处理器 (Sass/SCSS) 选择一个eslint配置 这边选择 ESLint + Standard config ,个人比较喜欢这个代码规范 选择什么时候进行 eslint 校验 选择(Lint on save)保存是检查 如果你正在使用的vscode编辑器的话,可以配置eslint插件进行代码自动格式化 选择测试框架 (Mocha +

Issue using Google Analytics with Require.js

家住魔仙堡 提交于 2019-12-03 09:47:23
问题 I'm using require.js (http://requirejs.org/) for a number of functions on my site and so far it seems to be working well. I've run into an issue when trying to include Google Analytics code though. The code seems to refuse to add a utm.gif and is not sending off a beacon to Google. I'm wondering if it's a scope thing. define(function() { var Analytics = {}; Analytics.Apply = function() { var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXX-X']); _gaq.push(['_trackPageview']); var ga =

Php Error - Unexpected require_once expecting function

匿名 (未验证) 提交于 2019-12-03 09:18:39
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm currently trying to fetch the medoo framework so that I can begin easily retrieving data from my MySQL database... and for some reason it doesn't work! here's the code of my signin.php file <?php function loginUserAccount($loginname, $password){ // Include Medoo (configured) require_once 'medoo.min.php'; // Initialize $database = new medoo(); $email = $database->get('MM_Users', 'Email', [ 'ID' => 1 ]); return $email; } ?> And the error: Parse error: syntax error, unexpected 'require_once' (T_REQUIRE_ONCE), expecting function (T_FUNCTION)

How to downgrade application from Ruby 2.0.0 to 1.9.3

匿名 (未验证) 提交于 2019-12-03 09:06:55
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My application is using Ruby 2.0.0-p247 but I need to downgrade to 1.9.3 (a custom module that's critical to my application doesn't work in 2.0.0 but does in 1.9.3). To do this I updated my gemfile with ruby '1.9.3' in the command line i typed: rvm use 1.9.3 I also edited the .ruby-version file and replaced it's contents with: 1.9.3 I ran bundle install and then tried to start the application by typing: rails s It tries to start up but then gives a segmentation fault (long time since i saw one of those). The error outputted is pasted below.

Angular 2, @ngtools/webpack, AOT

匿名 (未验证) 提交于 2019-12-03 09:05:37
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to use AOT in Angular 2 using webpack and @ngtools/webpack. I don't have any error with the compilation, but when I open the site on the browser I get a console error: No NgModule metadata found for 'AppModule' My AotPlugin on webpack configuration is this: new AotPlugin({ tsConfigPath: 'tsconfig.json', entryModule: helpers.root('src/app/app.module.ts#AppModule') }) My app.module.ts is: @NgModule({ bootstrap: [ App ], imports: [ // import Angular's modules BrowserModule, RouterModule.forRoot(ROUTES), SharedModule ], declarations: