小编Moh*_*awy的帖子

Iterm2向上滚动更多(增加滚动缓冲区)

愚蠢的问题,所以如果答案显而易见,我会道歉但是如何在iterm2上向上滚动以获得完整输出?有时候,例如,如果我正在进行单元测试,那么错误是如此之大,以至于我不能再向上滚动,我不能再向上滚动,但输出继续超出滚动的顶部.我该如何访问?我尝试了更多的页面,但没有让我到那里.

谢谢!

iterm iterm2

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

Postgres JSON数据类型Rails查询

我正在使用Postgres的json数据类型,但想要使用嵌套在json中的数据进行查询/排序.

我想在json数据类型上使用.where进行排序或查询.例如,我想查询跟随者数> 500的用户,或者我想通过关注者或跟随计数来订购.

谢谢!

例:

model User

data: {
     "photos"=>[
       {"type"=>"facebook", "type_id"=>"facebook", "type_name"=>"Facebook", "url"=>"facebook.com"}
      ], 
     "social_profiles"=>[
         {"type"=>"vimeo", "type_id"=>"vimeo", "type_name"=>"Vimeo", "url"=>"http://vimeo.com/", "username"=>"v", "id"=>"1"},
         {"bio"=>"I am not a person, but a series of plants", "followers"=>1500, "following"=>240, "type"=>"twitter", "type_id"=>"twitter", "type_name"=>"Twitter", "url"=>"http://www.twitter.com/", "username"=>"123", "id"=>"123"}
     ]
}
Run Code Online (Sandbox Code Playgroud)

postgresql json rails-postgresql psql ruby-on-rails-4

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

是否存在类似于web的bootstrap的react-native样式框架?

离子很棒,但如果你想留在React原生世界,我还没有找到可比的东西.有什么建议?

reactjs react-native

41
推荐指数
3
解决办法
4万
查看次数

与Postgresql JSON数据列不同

试图在带有rails的模式上做区别.

2.1.1 :450 > u.profiles.select("profiles.*").distinct


Profile Load (0.9ms)  SELECT DISTINCT profiles.* FROM "profiles" INNER JOIN "integration_profiles" ON "profiles"."id" = "integration_profiles"."profile_id" INNER JOIN "integrations" ON "integration_profiles"."integration_id" = "integrations"."id" WHERE "integrations"."user_id" = $1  [["user_id", 2]]
PG::UndefinedFunction: ERROR:  could not identify an equality operator for type json
LINE 1: SELECT DISTINCT profiles.* FROM "profiles" INNER JOIN "integ...
                        ^
: SELECT DISTINCT profiles.* FROM "profiles" INNER JOIN "integration_profiles" ON "profiles"."id" = "integration_profiles"."profile_id" INNER JOIN "integrations" ON "integration_profiles"."integration_id" = "integrations"."id" WHERE "integrations"."user_id" = $1
ActiveRecord::StatementInvalid: …
Run Code Online (Sandbox Code Playgroud)

postgresql ruby-on-rails ruby-on-rails-3 postgresql-json

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

如何在夜视仪中运行单个测试

我如何仅从Test 3以下测试中运行?

module.exports = {
  'Test 1':function(){},
  'Test 2':function(){}
  'Test 3':function(){}
}
Run Code Online (Sandbox Code Playgroud)

functional-testing nightwatch.js

37
推荐指数
3
解决办法
3万
查看次数

nil的未定义方法`environment':将Bootstrap导入rails时的NilClass

得到错误:

undefined method `environment' for nil:NilClass
Extracted source (around line #5):

<head>
  <title>Dossiyadata</title>
  <%= stylesheet_link_tag    "application", media: "all", "data-turbolinks-track" => true %>
  <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
  <%= csrf_meta_tags %>
</head>
Run Code Online (Sandbox Code Playgroud)

导入bootstrap时.不知道为什么?使用ruby 2.1.1

宝石文件:

source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.4'


# Use SCSS for stylesheets
gem 'sass-rails'
gem 'bootstrap-sass'
Run Code Online (Sandbox Code Playgroud)

跟踪:

sass-rails (4.0.1) lib/sass/rails/importer.rb:84:in `evaluate'
sass-rails (4.0.1) lib/sass/rails/importer.rb:70:in `engine_from_path'
sass-rails (4.0.1) lib/sass/rails/importer.rb:35:in `find'
sass (3.3.3) lib/sass/tree/import_node.rb:54:in `block in import'
sass (3.3.3) …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails sass ruby-on-rails-4 twitter-bootstrap-3

30
推荐指数
2
解决办法
9770
查看次数

导入并使用es6调用函数

先前:

var debug = require('debug')('http')
  , http = require('http')
  , name = 'My App';
Run Code Online (Sandbox Code Playgroud)

使用es6,如何像第一行一样立即导入和调用?

import debug from 'debug'();
Run Code Online (Sandbox Code Playgroud)

是不是不?

javascript ecmascript-6 babeljs

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

Webpack用小项目创建大文件

我让我的webpack生成一个大的main.js文件(1.7mb),其中包含一个小于20-30个文件的项目,每个文件少于100行.所需的依赖项数量很少(React,Fluxible),我正在使用我能理解的每个优化插件:

module.exports = {
  output: {
    path: './build',
    publicPath: '/public/',
    filename: '[name].js'
  },
  debug: false,
  devtool: 'eval',
  target: 'web',
  entry: [
  'bootstrap-sass!./bootstrap-sass.config.js',
  './client.js',
  ],
  stats: {
    colors: true,
    reasons: false
  },
  resolve: {
    extensions: ['', '.js'],
    alias: {
      'styles': __dirname + '/src/styles',
      'components': __dirname + '/src/scripts/components',
      'actions': __dirname + '/src/scripts/actions',
      'stores': __dirname + '/src/scripts/stores',
      'constants': __dirname + '/src/scripts/constants',
      'mixins': __dirname + '/src/scripts/mixins',
      'configs': __dirname + '/src/scripts/configs',
      'utils': __dirname + '/src/scripts/utils'
    }
  },
  module: {
    loaders: [
      { test: /\.css$/, loader: …
Run Code Online (Sandbox Code Playgroud)

webpack webpack-dev-server

20
推荐指数
3
解决办法
1万
查看次数

webpack-dev-server react-router push state

我试图让react-router与webpack-dev-server一起工作,但继续得不到Get/SOMEURL.这是因为webpack-dev-server正在查找该特定文件但无法找到它.我希望webpack使用react-router vs搜索文件本身.

我怎么设置它?

我的咕噜声:

'webpack-dev-server': {
      options: {
        hot: true,
        port: 8000,
        webpack: webpackDevConfig,
        publicPath: '/assets/',
        contentBase: './<%= pkg.src %>/'
      },

      start: {
        keepAlive: true,
      }
    },
Run Code Online (Sandbox Code Playgroud)

reactjs webpack react-router

12
推荐指数
1
解决办法
3653
查看次数

npm脚本忽略错误

我目前有一个用于运行linter的npm脚本.显然会输出一些错误,但是npm脚本失败而不是只显示错误并继续前进.

这是非常糟糕的,特别是当我有其他东西调用脚本,因为它奇迹般地打破了一切.我总是可以跑来npm run lint --force避免错误,但我并不总是那么--force奢侈(例如,使用git-hook).

如何设置我的脚本输出错误而不会造成混乱?

git node.js npm

12
推荐指数
2
解决办法
9053
查看次数