# env.rb or spec_helper.rb
Capybara.register_driver :poltergeist do |app|
opts = {
extensions: ["#{Rails.root}/features/support/phantomjs/disable_animations.js"] # or wherever
}
Capybara::Poltergeist::Driver.new(app, opts)
end
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
group = Group.find(GROUP_ID_HERE) | |
user_ids = User.where(admin: false).pluck(:id) | |
admin_ids = User.where(admin: true).pluck(:id) | |
group.add_users(user_ids, GroupMember::DEVELOPER) | |
group.add_users(admin_ids, GroupMember::OWNER) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateUserService | |
attr_reader :current_user | |
def initialize(current_user) | |
@current_user = current_user | |
end | |
def execute(user_params) | |
raise "must be admin" unless current_user.is_admin? | |
opts = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Doctors - 08/20/2016 | |
Is there any way I record voice using voice_packet from discord::voice::AudioReceiver?(edited) | |
SpaceManịac - 08/20/2016 | |
@Doctors It's possible, yes - data is just audio in PCM form like you'd find in a .wav file | |
Doctors - 08/20/2016 | |
So I should be able to send data to a file (like a .wav)? Any suggestions as to how I would do so? | |
SpaceManịac - 08/20/2016 | |
The hound crate can be used for writing .wav files | |
Nick - 08/20/2016 | |
Yeah, wav will be the easiest, for any other format you'll have to use something like ffmpeg to convert the the input (and dear god, don't try to write c bindings for it, it's a terrible API) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~ \.php$ { | |
try_files $uri =404; | |
include fastcgi_params; | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Xunit.Abstractions; | |
using Xunit.Sdk; | |
namespace DotNetMVCTest | |
{ | |
public class DefinitionOrderer : ITestCaseOrderer | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Xunit.Abstractions; | |
using Xunit.Sdk; | |
namespace DotNetMVCTest | |
{ | |
public class DefinitionOrderer : ITestCaseOrderer | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* If a prefix is provided, the value will be prepended to the routes defined. | |
* | |
* It is optional to override the controller name if prefix is being used, so | |
* with the example given it would create routes like this: | |
* | |
* /users/:user_id/pets | |
* /users/:user_id/pets/:pet_id | |
**/ | |
exports.prefix = '/users/:user_id'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#58595B,#464547,#FF681D,#F8F8F8,#62B1BD,#FFFFFF,#A3D55F,#FF681D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
import inspect | |
import nose | |
import sys | |
import traceback | |
class MyTest(unittest.TestCase): | |
def test_failing(self): | |
self.assertTrue(False) | |