小编Cra*_*dks的帖子

安装gitLab缺少现代化器?

我尝试使用这个turotial在debian上安装gitlab:https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/installation.md

我在步骤"安装宝石"并尝试运行:

sudo -u git -H bundle install --deployment --without development test postgres aws
Run Code Online (Sandbox Code Playgroud)

我得到这个回声:

Fetching source index from https://rubygems.org/
Could not find modernizr-2.6.2 in any of the sources
Run Code Online (Sandbox Code Playgroud)

我没有找到这个错误的解决方案我也以root身份运行它.

感谢帮助.

linux shell debian gitlab

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

decodeAudioData HTML5音频API

我想从ArrayBuffer播放音频数据...所以我生成我的数组并用微缩输入填充它.如果我在画布上绘制这些数据,它看起来像 - > 在此输入图像描述

这样可行!

但是,如果我想听这个数据

context.decodeAudioData(tmp, function(bufferN) { //tmp is a arrayBuffer
    var out = context.createBufferSource();
    out.buffer = bufferN;
    out.connect(context.destination);
    out.noteOn(0);
}, errorFunction);
Run Code Online (Sandbox Code Playgroud)

我听不到任何声音......因为调用了errorFunction.但错误是空的!

我也试着像这样得到缓冲区:

var soundBuffer = context.createBuffer(myArrayBuffer, true/*make mono*/);
Run Code Online (Sandbox Code Playgroud)

但我得到错误:Uncaught SyntaxError:指定了无效或非法字符串.

谁能给我一个暗示?

编辑1(更多代码以及我如何获得麦克风输入):

 navigator.webkitGetUserMedia({audio: true}, function(stream) {

                liveSource = context.createMediaStreamSource(stream);

                // create a ScriptProcessorNode
                if(!context.createScriptProcessor){
                   node = context.createJavaScriptNode(2048, 1, 1);
                } else {
                   node = context.createScriptProcessor(2048, 1, 1);
                }


                node.onaudioprocess = function(e){

               var tmp = new Uint8Array(e.inputBuffer.byteLength);
               tmp.set(new      Uint8Array(e.inputBuffer.byteLength), 0);

   //Here comes the code from above.
Run Code Online (Sandbox Code Playgroud)

谢谢你的帮助!

javascript html5 buffer decode html5-audio

23
推荐指数
1
解决办法
7964
查看次数

使用rtc的Firefox createMediaStreamDestination错误?

我通过rtc传输音频,并希望将音频静音和取消静音.

这有效...但没有增益控制:

function(stream) { /* getUserMedia stream */
      console.log("Access granted to audio/video");
      peer_connection.addStream(stream);
}
Run Code Online (Sandbox Code Playgroud)

这适用于Chrome但不适用于Firefox(带增益控制)

function(stream) { /* getUserMedia stream */
  console.log("Access granted to audio/video");
  var microphone = context.createMediaStreamSource(stream);
  gainNode = context.createGain();
  var dest = context.createMediaStreamDestination();
  microphone.connect(gainNode);
  gainNode.connect(dest);

  local_media_stream = dest.stream;
  peer_connection.addStream(local_media_stream);
}
Run Code Online (Sandbox Code Playgroud)

我没有得到任何错误,我听不到任何声音.当我将gainNode发送到context.destination时,我可以听到自己.

我认为"context.createMediaStreamSource(stream)"以任何方式被破坏.谁能告诉我为什么?以及如何解决这个问题.


编辑:所以我检查了流和:

stream //type: LocalMediaStream    
dest.steam //type: MediaStream
Run Code Online (Sandbox Code Playgroud)

在Firefox中!在chrome中,两者都是MediaStreams

javascript audio firefox html5-audio

6
推荐指数
1
解决办法
285
查看次数

Gitlab背后是ngnix和https - >不安全或不良网关

我在我的ngnix后面运行gitlab.

服务器1(反向代理):启用了https的Ngnix,以及/ git的配置:

location ^~ /git/ {
    proxy_pass                          http://134.103.176.101:80;
    proxy_redirect off;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Ssl on;
}
Run Code Online (Sandbox Code Playgroud)

如果我不改变我的gitlab设置上的任何内容,这将有效但由于外部http请求不安全,如:

'http://www.gravatar.com/avatar/c1ca2b6e2cd20fda9d215fe429335e0e?s=120&d=identicon'. This content should also be served over HTTPS.
Run Code Online (Sandbox Code Playgroud)

所以,如果我更改隐藏服务器2(http gitlab)上的gitlab配置:

external_url 'https://myurl'
nginx['listen_https'] = false
Run Code Online (Sandbox Code Playgroud)

正如文件中所述.我将得到一个错误的网关错误502.没有加载页面.

我能做什么 ?


编辑:通过设置黑客攻击:

gitlab_rails['gravatar_plain_url'] = 'https://www.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon'
Run Code Online (Sandbox Code Playgroud)

https ...这工作但不是一个干净的解决方案.(克隆网址仍然是http://)

ssl https reverse-proxy nginx gitlab

4
推荐指数
1
解决办法
1642
查看次数

IndexedDb上的WebSQL语法

我有一个使用WebSQL的应用程序。我也想支持IndexedDB(对于不支持WebSql的浏览器)。是否有任何使用sql语法但可在后台与indexedDB / LocalStorage一起使用的库?

我不想更改所有查询和功能。

我发现的所有库都使用IndexedDb语法并支持WebSql。(不是我所需要的)。

谢谢 :)

javascript syntax html5 web-sql indexeddb

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

需要xml解析attr ?! 支柱?

使用jQuery在JavaScript控制台(Chrome或其他东西)上试试这个.

var jo = $("<xml required=\"true\" name=\"lol\"></xml>"); //test xml
jo.attr("required"); //returns "required" instead of true
jo.attr("name"); //returns correct "lol"
jo.prop("required"); //returns undefined
jo.prop("name"); //returns undefined
Run Code Online (Sandbox Code Playgroud)

那里的任何人都有一个工作解决方案来获得true/false这个xml 的正确所需值()?

.prop()只适用于html之类的<input>.

xml jquery prop attr

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