commit stringlengths 40 40 | old_file stringlengths 4 184 | new_file stringlengths 4 184 | old_contents stringlengths 1 3.6k | new_contents stringlengths 5 3.38k | subject stringlengths 15 778 | message stringlengths 16 6.74k | lang stringclasses 201 values | license stringclasses 13 values | repos stringlengths 6 116k | config stringclasses 201 values | content stringlengths 137 7.24k | diff stringlengths 26 5.55k | diff_length int64 1 123 | relative_diff_length float64 0.01 89 | n_lines_added int64 0 108 | n_lines_deleted int64 0 106 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6862ad368ceda4ea8baba44f7de4c3b9e8938302 | .config/fish/config.fish | .config/fish/config.fish | source ~/.asdf/asdf.fish
set -x ERL_AFLAGS "-kernel shell_history enabled"
| source ~/.asdf/asdf.fish
set -x ERL_AFLAGS "-kernel shell_history enabled"
set -g fish_user_paths "/usr/local/sbin" $fish_user_paths
| Add sbin to fish path | Add sbin to fish path
brew doctor says so
| fish | mit | rockwood/dotfiles,rockwood/dotfiles | fish | ## Code Before:
source ~/.asdf/asdf.fish
set -x ERL_AFLAGS "-kernel shell_history enabled"
## Instruction:
Add sbin to fish path
brew doctor says so
## Code After:
source ~/.asdf/asdf.fish
set -x ERL_AFLAGS "-kernel shell_history enabled"
set -g fish_user_paths "/usr/local/sbin" $fish_user_paths
| source ~/.asdf/asdf.fish
set -x ERL_AFLAGS "-kernel shell_history enabled"
+ set -g fish_user_paths "/usr/local/sbin" $fish_user_paths | 1 | 0.5 | 1 | 0 |
059e9278325c0c1dbd1c557c4719af7ed6db0e27 | README.md | README.md | craft-akka-server
=================
| Akka based Craft server
=======================
This is a reimplementation of the python server distributed with the [fogleman/Craft](https://github.com/fogleman/Craft) project. Specifically it is built to run with the modified client in the [nsg/Craft](https://github.com/nsg/Craft) project, which is implementing the new binary protocol optimized for server generated worlds.
## Building
Get [SBT](http://www.scala-sbt.org/download.html)!
```sbt test``` to run unit tests.
## Running
```sbt run``` starts the server and binds port 4080.
| Add a minimal amount of information to the readme | Add a minimal amount of information to the readme
| Markdown | mit | Henningstone/server,Henningstone/server,konstructs/server | markdown | ## Code Before:
craft-akka-server
=================
## Instruction:
Add a minimal amount of information to the readme
## Code After:
Akka based Craft server
=======================
This is a reimplementation of the python server distributed with the [fogleman/Craft](https://github.com/fogleman/Craft) project. Specifically it is built to run with the modified client in the [nsg/Craft](https://github.com/nsg/Craft) project, which is implementing the new binary protocol optimized for server generated worlds.
## Building
Get [SBT](http://www.scala-sbt.org/download.html)!
```sbt test``` to run unit tests.
## Running
```sbt run``` starts the server and binds port 4080.
| - craft-akka-server
+ Akka based Craft server
- =================
+ =======================
? ++++++
+
+ This is a reimplementation of the python server distributed with the [fogleman/Craft](https://github.com/fogleman/Craft) project. Specifically it is built to run with the modified client in the [nsg/Craft](https://github.com/nsg/Craft) project, which is implementing the new binary protocol optimized for server generated worlds.
+
+ ## Building
+ Get [SBT](http://www.scala-sbt.org/download.html)!
+
+ ```sbt test``` to run unit tests.
+
+ ## Running
+
+ ```sbt run``` starts the server and binds port 4080. | 15 | 7.5 | 13 | 2 |
b6a43578a383c4ab78068f5dc18a4b9f1d193939 | app/controllers/denuncias_controller.rb | app/controllers/denuncias_controller.rb | class DenunciasController < ApplicationController
def create
@denuncia = Denuncia.new(denuncia_params)
@denuncia.ip = request.remote_ip
if @denuncia.save
redirect_to denuncia_path(@denuncia)
else
redirect_to root_path, error: 'Hubo errores procesando su denuncia.'
end
end
def show
@denuncia = Denuncia.find(params[:id])
end
private
def denuncia_params
params.require(:denuncia).permit(
:pais_id,
:delito_id,
item_denuncias_attributes: [
:pregunta_id,
:opcion_id,
:fecha,
:observacion,
opciones_multiples: []
]
)
end
end
| class DenunciasController < ApplicationController
def create
@denuncia = Denuncia.new(denuncia_params)
@denuncia.ip = request.remote_ip
if @denuncia.save
DenunciaMailer.resultado(@denuncia.id).deliver_later
redirect_to denuncia_path(@denuncia)
else
redirect_to root_path, error: 'Hubo errores procesando su denuncia.'
end
end
def show
@denuncia = Denuncia.find(params[:id])
end
private
def denuncia_params
params.require(:denuncia).permit(
:pais_id,
:delito_id,
item_denuncias_attributes: [
:pregunta_id,
:opcion_id,
:fecha,
:observacion,
opciones_multiples: []
]
)
end
end
| Send email when creating denuncia. | Send email when creating denuncia.
| Ruby | mit | antico5/odila,antico5/odila,antico5/odila | ruby | ## Code Before:
class DenunciasController < ApplicationController
def create
@denuncia = Denuncia.new(denuncia_params)
@denuncia.ip = request.remote_ip
if @denuncia.save
redirect_to denuncia_path(@denuncia)
else
redirect_to root_path, error: 'Hubo errores procesando su denuncia.'
end
end
def show
@denuncia = Denuncia.find(params[:id])
end
private
def denuncia_params
params.require(:denuncia).permit(
:pais_id,
:delito_id,
item_denuncias_attributes: [
:pregunta_id,
:opcion_id,
:fecha,
:observacion,
opciones_multiples: []
]
)
end
end
## Instruction:
Send email when creating denuncia.
## Code After:
class DenunciasController < ApplicationController
def create
@denuncia = Denuncia.new(denuncia_params)
@denuncia.ip = request.remote_ip
if @denuncia.save
DenunciaMailer.resultado(@denuncia.id).deliver_later
redirect_to denuncia_path(@denuncia)
else
redirect_to root_path, error: 'Hubo errores procesando su denuncia.'
end
end
def show
@denuncia = Denuncia.find(params[:id])
end
private
def denuncia_params
params.require(:denuncia).permit(
:pais_id,
:delito_id,
item_denuncias_attributes: [
:pregunta_id,
:opcion_id,
:fecha,
:observacion,
opciones_multiples: []
]
)
end
end
| class DenunciasController < ApplicationController
def create
@denuncia = Denuncia.new(denuncia_params)
@denuncia.ip = request.remote_ip
if @denuncia.save
+ DenunciaMailer.resultado(@denuncia.id).deliver_later
redirect_to denuncia_path(@denuncia)
else
redirect_to root_path, error: 'Hubo errores procesando su denuncia.'
end
end
def show
@denuncia = Denuncia.find(params[:id])
end
private
def denuncia_params
params.require(:denuncia).permit(
:pais_id,
:delito_id,
item_denuncias_attributes: [
:pregunta_id,
:opcion_id,
:fecha,
:observacion,
opciones_multiples: []
]
)
end
end | 1 | 0.032258 | 1 | 0 |
68494aae959dfbbf781cdf03a988d2f5fc7e4802 | CMake/abslConfig.cmake.in | CMake/abslConfig.cmake.in |
include(FindThreads)
@PACKAGE_INIT@
include ("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") |
include(CMakeFindDependencyMacro)
find_dependency(Threads)
@PACKAGE_INIT@
include ("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") | Fix CMake Threads dependency issue | Fix CMake Threads dependency issue
Fixes #668 | unknown | apache-2.0 | firebase/abseil-cpp,abseil/abseil-cpp,firebase/abseil-cpp,abseil/abseil-cpp,abseil/abseil-cpp,firebase/abseil-cpp,firebase/abseil-cpp,abseil/abseil-cpp | unknown | ## Code Before:
include(FindThreads)
@PACKAGE_INIT@
include ("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
## Instruction:
Fix CMake Threads dependency issue
Fixes #668
## Code After:
include(CMakeFindDependencyMacro)
find_dependency(Threads)
@PACKAGE_INIT@
include ("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") |
- include(FindThreads)
+ include(CMakeFindDependencyMacro)
+ find_dependency(Threads)
@PACKAGE_INIT@
include ("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") | 3 | 0.5 | 2 | 1 |
dd79dac3c66254ca3ea81b283197975418e04944 | src/libs/notification/tests/CMakeLists.txt | src/libs/notification/tests/CMakeLists.txt | include (LibAddMacros)
if (BUILD_TESTING)
add_headers (HDR_FILES)
set (TESTS
testlib_notification.c
)
foreach (file ${TESTS})
get_filename_component (name ${file} NAME_WE)
set (TEST_SOURCES $<TARGET_OBJECTS:cframework>)
list (APPEND TEST_SOURCES ${name})
list (APPEND TEST_SOURCES ${HDR_FILES})
add_executable (${name} ${TEST_SOURCES})
add_dependencies (${name} kdberrors_generated)
target_include_directories (${name} PUBLIC "${CMAKE_SOURCE_DIR}/tests/cframework")
target_link_elektra (${name} elektra-kdb elektra-notification)
add_test (NAME ${name}
COMMAND "${CMAKE_BINARY_DIR}/bin/${name}" "${CMAKE_CURRENT_SOURCE_DIR}"
)
endforeach (file ${TESTS})
endif (BUILD_TESTING)
| include (LibAddMacros)
set (ASAN_LINUX (ENABLE_ASAN AND CMAKE_SYSTEM_NAME MATCHES "Linux"))
if (BUILD_TESTING AND NOT ${ASAN_LINUX})
add_headers (HDR_FILES)
set (TESTS
testlib_notification.c
)
foreach (file ${TESTS})
get_filename_component (name ${file} NAME_WE)
set (TEST_SOURCES $<TARGET_OBJECTS:cframework>)
list (APPEND TEST_SOURCES ${name})
list (APPEND TEST_SOURCES ${HDR_FILES})
add_executable (${name} ${TEST_SOURCES})
add_dependencies (${name} kdberrors_generated)
target_include_directories (${name} PUBLIC "${CMAKE_SOURCE_DIR}/tests/cframework")
target_link_elektra (${name} elektra-kdb elektra-notification)
add_test (NAME ${name}
COMMAND "${CMAKE_BINARY_DIR}/bin/${name}" "${CMAKE_CURRENT_SOURCE_DIR}"
)
endforeach (file ${TESTS})
endif (BUILD_TESTING AND NOT ${ASAN_LINUX})
| Disable test on ASAN enabled Linux | Notifications: Disable test on ASAN enabled Linux
Currently the ASAN enabled Linux build reports some memory leaks in the
test `testlib_notification`.
This commit addresses issue #1824.
| Text | bsd-3-clause | petermax2/libelektra,e1528532/libelektra,e1528532/libelektra,mpranj/libelektra,mpranj/libelektra,mpranj/libelektra,BernhardDenner/libelektra,petermax2/libelektra,e1528532/libelektra,mpranj/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,e1528532/libelektra,BernhardDenner/libelektra,mpranj/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,e1528532/libelektra,petermax2/libelektra,mpranj/libelektra,petermax2/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,BernhardDenner/libelektra,e1528532/libelektra,mpranj/libelektra,mpranj/libelektra,petermax2/libelektra,e1528532/libelektra,BernhardDenner/libelektra,mpranj/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,ElektraInitiative/libelektra,BernhardDenner/libelektra,BernhardDenner/libelektra,e1528532/libelektra,ElektraInitiative/libelektra,BernhardDenner/libelektra | text | ## Code Before:
include (LibAddMacros)
if (BUILD_TESTING)
add_headers (HDR_FILES)
set (TESTS
testlib_notification.c
)
foreach (file ${TESTS})
get_filename_component (name ${file} NAME_WE)
set (TEST_SOURCES $<TARGET_OBJECTS:cframework>)
list (APPEND TEST_SOURCES ${name})
list (APPEND TEST_SOURCES ${HDR_FILES})
add_executable (${name} ${TEST_SOURCES})
add_dependencies (${name} kdberrors_generated)
target_include_directories (${name} PUBLIC "${CMAKE_SOURCE_DIR}/tests/cframework")
target_link_elektra (${name} elektra-kdb elektra-notification)
add_test (NAME ${name}
COMMAND "${CMAKE_BINARY_DIR}/bin/${name}" "${CMAKE_CURRENT_SOURCE_DIR}"
)
endforeach (file ${TESTS})
endif (BUILD_TESTING)
## Instruction:
Notifications: Disable test on ASAN enabled Linux
Currently the ASAN enabled Linux build reports some memory leaks in the
test `testlib_notification`.
This commit addresses issue #1824.
## Code After:
include (LibAddMacros)
set (ASAN_LINUX (ENABLE_ASAN AND CMAKE_SYSTEM_NAME MATCHES "Linux"))
if (BUILD_TESTING AND NOT ${ASAN_LINUX})
add_headers (HDR_FILES)
set (TESTS
testlib_notification.c
)
foreach (file ${TESTS})
get_filename_component (name ${file} NAME_WE)
set (TEST_SOURCES $<TARGET_OBJECTS:cframework>)
list (APPEND TEST_SOURCES ${name})
list (APPEND TEST_SOURCES ${HDR_FILES})
add_executable (${name} ${TEST_SOURCES})
add_dependencies (${name} kdberrors_generated)
target_include_directories (${name} PUBLIC "${CMAKE_SOURCE_DIR}/tests/cframework")
target_link_elektra (${name} elektra-kdb elektra-notification)
add_test (NAME ${name}
COMMAND "${CMAKE_BINARY_DIR}/bin/${name}" "${CMAKE_CURRENT_SOURCE_DIR}"
)
endforeach (file ${TESTS})
endif (BUILD_TESTING AND NOT ${ASAN_LINUX})
| include (LibAddMacros)
- if (BUILD_TESTING)
+ set (ASAN_LINUX (ENABLE_ASAN AND CMAKE_SYSTEM_NAME MATCHES "Linux"))
+
+ if (BUILD_TESTING AND NOT ${ASAN_LINUX})
add_headers (HDR_FILES)
set (TESTS
testlib_notification.c
)
foreach (file ${TESTS})
get_filename_component (name ${file} NAME_WE)
set (TEST_SOURCES $<TARGET_OBJECTS:cframework>)
list (APPEND TEST_SOURCES ${name})
list (APPEND TEST_SOURCES ${HDR_FILES})
add_executable (${name} ${TEST_SOURCES})
add_dependencies (${name} kdberrors_generated)
target_include_directories (${name} PUBLIC "${CMAKE_SOURCE_DIR}/tests/cframework")
target_link_elektra (${name} elektra-kdb elektra-notification)
add_test (NAME ${name}
COMMAND "${CMAKE_BINARY_DIR}/bin/${name}" "${CMAKE_CURRENT_SOURCE_DIR}"
)
endforeach (file ${TESTS})
- endif (BUILD_TESTING)
+ endif (BUILD_TESTING AND NOT ${ASAN_LINUX}) | 6 | 0.193548 | 4 | 2 |
e553225be53545c7f33fcca58c12402ddb4489e3 | test/functional/quick_jump_targets_controller_test.rb | test/functional/quick_jump_targets_controller_test.rb | require 'test_helper'
class QuickJumpTargetsControllerTest < ActionController::TestCase
setup do
QuickJumpTarget.update_all Project, Page
end
test "should render json on index" do
with_login do |user|
get :index, :format => :json, :query => "first"
@data = assigns['data']
assert_not_nil @data
assert !@data.empty?
assert @data.any? { |item| item["type"] == "Project" }
assert @data.any? { |item| item["type"] == "Page" }
end
end
test "should render json on pages" do
with_login do |user|
get :pages, :format => :json, :query => "first"
@data = assigns['data']
assert_not_nil @data
assert !@data.empty?
assert @data.all? { |item| item["type"] == "Page" }
end
end
end
| require 'test_helper'
class QuickJumpTargetsControllerTest < ActionController::TestCase
setup do
QuickJumpTarget.update_all Project, Page
end
test "should render json on index" do
with_login do |user|
get :index, :format => :json, :query => "first"
@data = assigns['data']
assert_not_nil @data
assert !@data.empty?
puts @data.inspect
assert @data.any? { |item| item["type"] == "project" }
assert @data.any? { |item| item["type"] == "page" }
end
end
test "should render json on pages" do
with_login do |user|
get :pages, :format => :json, :query => "first"
@data = assigns['data']
assert_not_nil @data
assert !@data.empty?
puts @data.inspect
assert @data.all? { |item| item["type"] == "page" }
end
end
end
| Fix failing tests for quick_jump_targets_controller | Fix failing tests for quick_jump_targets_controller
| Ruby | mit | rrrene/outline,rrrene/outline | ruby | ## Code Before:
require 'test_helper'
class QuickJumpTargetsControllerTest < ActionController::TestCase
setup do
QuickJumpTarget.update_all Project, Page
end
test "should render json on index" do
with_login do |user|
get :index, :format => :json, :query => "first"
@data = assigns['data']
assert_not_nil @data
assert !@data.empty?
assert @data.any? { |item| item["type"] == "Project" }
assert @data.any? { |item| item["type"] == "Page" }
end
end
test "should render json on pages" do
with_login do |user|
get :pages, :format => :json, :query => "first"
@data = assigns['data']
assert_not_nil @data
assert !@data.empty?
assert @data.all? { |item| item["type"] == "Page" }
end
end
end
## Instruction:
Fix failing tests for quick_jump_targets_controller
## Code After:
require 'test_helper'
class QuickJumpTargetsControllerTest < ActionController::TestCase
setup do
QuickJumpTarget.update_all Project, Page
end
test "should render json on index" do
with_login do |user|
get :index, :format => :json, :query => "first"
@data = assigns['data']
assert_not_nil @data
assert !@data.empty?
puts @data.inspect
assert @data.any? { |item| item["type"] == "project" }
assert @data.any? { |item| item["type"] == "page" }
end
end
test "should render json on pages" do
with_login do |user|
get :pages, :format => :json, :query => "first"
@data = assigns['data']
assert_not_nil @data
assert !@data.empty?
puts @data.inspect
assert @data.all? { |item| item["type"] == "page" }
end
end
end
| require 'test_helper'
class QuickJumpTargetsControllerTest < ActionController::TestCase
setup do
QuickJumpTarget.update_all Project, Page
end
test "should render json on index" do
with_login do |user|
get :index, :format => :json, :query => "first"
@data = assigns['data']
assert_not_nil @data
assert !@data.empty?
+ puts @data.inspect
- assert @data.any? { |item| item["type"] == "Project" }
? ^
+ assert @data.any? { |item| item["type"] == "project" }
? ^
- assert @data.any? { |item| item["type"] == "Page" }
? ^
+ assert @data.any? { |item| item["type"] == "page" }
? ^
end
end
test "should render json on pages" do
with_login do |user|
get :pages, :format => :json, :query => "first"
@data = assigns['data']
assert_not_nil @data
assert !@data.empty?
+ puts @data.inspect
- assert @data.all? { |item| item["type"] == "Page" }
? ^
+ assert @data.all? { |item| item["type"] == "page" }
? ^
end
end
end | 8 | 0.285714 | 5 | 3 |
1df2d044b289990ebe5aae631bbf9cb7fb250f76 | .travis.yml | .travis.yml | sudo: false
rvm:
- 2.1.5
script:
- bundle exec rake db:migrate RAILS_ENV=test
- bundle exec rake settings:update_defaults RAILS_ENV=test
- bundle exec rspec
before_script:
- cp config/channel.constants.sample.yml config/channel.constants.yml
- cp config/advanced.constants.sample.yml config/advanced.constants.yml
notifications:
hipchat:
rooms:
secure: hzm5pp3qtwFIJu+Uh7WjUbIwi4vLOjCzvLoSSREKttlakWNHTV4BVfUKkwvFFTaLorG0xwPGL5iWZll9KjCDMSM+Y7cxx+GhnV+bLfMe5ywl5MBPgCBRag1iYhPl19UQvxorFj/KJOMGEpWuqFSRRgctuzcyjDVO6+NqZPkDuu4=
addons:
code_climate:
repo_token: 24d5e8746ee2bcfc0db4df0ac6e09886a13e2903b4b6e7f25f64da9e86017c8c
| sudo: false
rvm:
- 2.1.5
script:
- bundle exec rake db:migrate RAILS_ENV=test
- bundle exec rake settings:update_defaults RAILS_ENV=test
- bundle exec rspec
before_script:
- cp config/channel.constants.sample.yml config/channel.constants.yml
- cp config/advanced.constants.sample.yml config/advanced.constants.yml
notifications:
slack:
secure: a7Lv/6S5pttnC84gGI4RFw0f4X0rC8CXdVt6/IK5xqNNtSJqUaFtL2GhmvQ111HTkOaN81QR6zv3Ynj9EW3cFTHaGZgMab37V/5iVeHO1QM56KQZ2sf/Z+LsyfPfok7GTe6lDr5VzeatN7lptoQkpunoI8fh2Up+DVqccgVOMP0=
addons:
code_climate:
repo_token: 24d5e8746ee2bcfc0db4df0ac6e09886a13e2903b4b6e7f25f64da9e86017c8c
| Add slack notifier for Travis | Add slack notifier for Travis
| YAML | mit | joegattnet/joegattnet_v3,joegattnet/joegattnet_v3,nembrotorg/nembrot,nembrotorg/nembrot,joegattnet/joegattnet_v3,nembrotorg/nembrot | yaml | ## Code Before:
sudo: false
rvm:
- 2.1.5
script:
- bundle exec rake db:migrate RAILS_ENV=test
- bundle exec rake settings:update_defaults RAILS_ENV=test
- bundle exec rspec
before_script:
- cp config/channel.constants.sample.yml config/channel.constants.yml
- cp config/advanced.constants.sample.yml config/advanced.constants.yml
notifications:
hipchat:
rooms:
secure: hzm5pp3qtwFIJu+Uh7WjUbIwi4vLOjCzvLoSSREKttlakWNHTV4BVfUKkwvFFTaLorG0xwPGL5iWZll9KjCDMSM+Y7cxx+GhnV+bLfMe5ywl5MBPgCBRag1iYhPl19UQvxorFj/KJOMGEpWuqFSRRgctuzcyjDVO6+NqZPkDuu4=
addons:
code_climate:
repo_token: 24d5e8746ee2bcfc0db4df0ac6e09886a13e2903b4b6e7f25f64da9e86017c8c
## Instruction:
Add slack notifier for Travis
## Code After:
sudo: false
rvm:
- 2.1.5
script:
- bundle exec rake db:migrate RAILS_ENV=test
- bundle exec rake settings:update_defaults RAILS_ENV=test
- bundle exec rspec
before_script:
- cp config/channel.constants.sample.yml config/channel.constants.yml
- cp config/advanced.constants.sample.yml config/advanced.constants.yml
notifications:
slack:
secure: a7Lv/6S5pttnC84gGI4RFw0f4X0rC8CXdVt6/IK5xqNNtSJqUaFtL2GhmvQ111HTkOaN81QR6zv3Ynj9EW3cFTHaGZgMab37V/5iVeHO1QM56KQZ2sf/Z+LsyfPfok7GTe6lDr5VzeatN7lptoQkpunoI8fh2Up+DVqccgVOMP0=
addons:
code_climate:
repo_token: 24d5e8746ee2bcfc0db4df0ac6e09886a13e2903b4b6e7f25f64da9e86017c8c
| sudo: false
-
rvm:
- 2.1.5
-
script:
- bundle exec rake db:migrate RAILS_ENV=test
- bundle exec rake settings:update_defaults RAILS_ENV=test
- bundle exec rspec
-
before_script:
- cp config/channel.constants.sample.yml config/channel.constants.yml
- cp config/advanced.constants.sample.yml config/advanced.constants.yml
-
notifications:
+ slack:
+ secure: a7Lv/6S5pttnC84gGI4RFw0f4X0rC8CXdVt6/IK5xqNNtSJqUaFtL2GhmvQ111HTkOaN81QR6zv3Ynj9EW3cFTHaGZgMab37V/5iVeHO1QM56KQZ2sf/Z+LsyfPfok7GTe6lDr5VzeatN7lptoQkpunoI8fh2Up+DVqccgVOMP0=
- hipchat:
- rooms:
- secure: hzm5pp3qtwFIJu+Uh7WjUbIwi4vLOjCzvLoSSREKttlakWNHTV4BVfUKkwvFFTaLorG0xwPGL5iWZll9KjCDMSM+Y7cxx+GhnV+bLfMe5ywl5MBPgCBRag1iYhPl19UQvxorFj/KJOMGEpWuqFSRRgctuzcyjDVO6+NqZPkDuu4=
-
addons:
code_climate:
repo_token: 24d5e8746ee2bcfc0db4df0ac6e09886a13e2903b4b6e7f25f64da9e86017c8c | 10 | 0.454545 | 2 | 8 |
f06770e94d9d8ce5470d162719634600a6d214e1 | vimrcs/plugins/frontend.vim | vimrcs/plugins/frontend.vim | """"""""""""""""""""""
" => Front-End
""""""""""""""""""""""
Plug 'mattn/emmet-vim'
Plug 'jelera/vim-javascript-syntax'
Plug 'hail2u/vim-css3-syntax'
Plug 'gorodinskiy/vim-coloresque'
Plug 'tpope/vim-haml'
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => SCSS syntax
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
au BufRead,BufNewFile *.scss set filetype=scss.css
| """"""""""""""""""""""
" => Front-End
""""""""""""""""""""""
Plug 'mattn/emmet-vim'
Plug 'jelera/vim-javascript-syntax'
Plug 'hail2u/vim-css3-syntax'
Plug 'gorodinskiy/vim-coloresque'
Plug 'tpope/vim-haml'
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => SCSS syntax
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
au BufRead,BufNewFile *.scss set filetype=scss.css
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => HTML syntax
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" set 2 tabspaces (identation) for html files
autocmd Filetype html setlocal ts=2 sw=2 expandtab
| Set two tabspace for html files | Set two tabspace for html files
| VimL | mit | ThiagoLopes/vim-master | viml | ## Code Before:
""""""""""""""""""""""
" => Front-End
""""""""""""""""""""""
Plug 'mattn/emmet-vim'
Plug 'jelera/vim-javascript-syntax'
Plug 'hail2u/vim-css3-syntax'
Plug 'gorodinskiy/vim-coloresque'
Plug 'tpope/vim-haml'
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => SCSS syntax
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
au BufRead,BufNewFile *.scss set filetype=scss.css
## Instruction:
Set two tabspace for html files
## Code After:
""""""""""""""""""""""
" => Front-End
""""""""""""""""""""""
Plug 'mattn/emmet-vim'
Plug 'jelera/vim-javascript-syntax'
Plug 'hail2u/vim-css3-syntax'
Plug 'gorodinskiy/vim-coloresque'
Plug 'tpope/vim-haml'
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => SCSS syntax
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
au BufRead,BufNewFile *.scss set filetype=scss.css
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => HTML syntax
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" set 2 tabspaces (identation) for html files
autocmd Filetype html setlocal ts=2 sw=2 expandtab
| """"""""""""""""""""""
" => Front-End
""""""""""""""""""""""
Plug 'mattn/emmet-vim'
Plug 'jelera/vim-javascript-syntax'
Plug 'hail2u/vim-css3-syntax'
Plug 'gorodinskiy/vim-coloresque'
Plug 'tpope/vim-haml'
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => SCSS syntax
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
au BufRead,BufNewFile *.scss set filetype=scss.css
+
+
+ """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+ " => HTML syntax
+ """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+ " set 2 tabspaces (identation) for html files
+ autocmd Filetype html setlocal ts=2 sw=2 expandtab
+ | 8 | 0.615385 | 8 | 0 |
6935fb259a228bca7d11ac173e23c56235d235dc | app.js | app.js | /*
* Mailchimp AJAX form submit VanillaJS
* Vanilla JS
* Author: Michiel Vandewalle
* Github author: https://github.com/michiel-vandewalle
* Github project: https://github.com/michiel-vandewalle/Mailchimp-AJAX-form-submit-vanillaJS
*/
(function () {
document.getElementsByTagName('form')[0].addEventListener('submit', function (e) {
e.preventDefault();
// Check for spam
if(document.getElementById('js-validate-robot').value !== '') { return false }
// Get url for mailchimp
var url = this.action.replace('/post?', '/post-json?');
// Add form data to object
var data = '';
var inputs = this.querySelectorAll('#js-form-inputs input');
for (var i = 0; i < inputs.length; i++) {
data += '&' + inputs[i].name + '=' + encodeURIComponent(inputs[i].value);
}
// Create & add post script to the DOM
var script = document.createElement('script');
script.src = url + data;
document.body.appendChild(script);
// Callback function
var callback = 'callback';
window[callback] = function(data) {
// Remove post script from the DOM
delete window[callback];
document.body.removeChild(script);
// Display response message
document.getElementById('js-subscribe-response').innerHTML = data.msg
};
});
})(); | /*
* Mailchimp AJAX form submit VanillaJS
* Vanilla JS
* Author: Michiel Vandewalle
* Github author: https://github.com/michiel-vandewalle
* Github project: https://github.com/michiel-vandewalle/Mailchimp-AJAX-form-submit-vanillaJS
*/
(function () {
if (document.getElementsByTagName('form').length > 0) {
document.getElementsByTagName('form')[0].addEventListener('submit', function (e) {
e.preventDefault();
// Check for spam
if(document.getElementById('js-validate-robot').value !== '') { return false }
// Get url for mailchimp
var url = this.action.replace('/post?', '/post-json?');
// Add form data to object
var data = '';
var inputs = this.querySelectorAll('#js-form-inputs input');
for (var i = 0; i < inputs.length; i++) {
data += '&' + inputs[i].name + '=' + encodeURIComponent(inputs[i].value);
}
// Create & add post script to the DOM
var script = document.createElement('script');
script.src = url + data;
document.body.appendChild(script);
// Callback function
var callback = 'callback';
window[callback] = function(data) {
// Remove post script from the DOM
delete window[callback];
document.body.removeChild(script);
// Display response message
document.getElementById('js-subscribe-response').innerHTML = data.msg
};
});
}
})();
| Make sure the subscribe form is available before running the script | Make sure the subscribe form is available before running the script
| JavaScript | mit | michiel-vandewalle/Mailchimp-AJAX-form-submit-vanillaJS,michiel-vandewalle/Mailchimp-AJAX-form-submit-vanillaJS | javascript | ## Code Before:
/*
* Mailchimp AJAX form submit VanillaJS
* Vanilla JS
* Author: Michiel Vandewalle
* Github author: https://github.com/michiel-vandewalle
* Github project: https://github.com/michiel-vandewalle/Mailchimp-AJAX-form-submit-vanillaJS
*/
(function () {
document.getElementsByTagName('form')[0].addEventListener('submit', function (e) {
e.preventDefault();
// Check for spam
if(document.getElementById('js-validate-robot').value !== '') { return false }
// Get url for mailchimp
var url = this.action.replace('/post?', '/post-json?');
// Add form data to object
var data = '';
var inputs = this.querySelectorAll('#js-form-inputs input');
for (var i = 0; i < inputs.length; i++) {
data += '&' + inputs[i].name + '=' + encodeURIComponent(inputs[i].value);
}
// Create & add post script to the DOM
var script = document.createElement('script');
script.src = url + data;
document.body.appendChild(script);
// Callback function
var callback = 'callback';
window[callback] = function(data) {
// Remove post script from the DOM
delete window[callback];
document.body.removeChild(script);
// Display response message
document.getElementById('js-subscribe-response').innerHTML = data.msg
};
});
})();
## Instruction:
Make sure the subscribe form is available before running the script
## Code After:
/*
* Mailchimp AJAX form submit VanillaJS
* Vanilla JS
* Author: Michiel Vandewalle
* Github author: https://github.com/michiel-vandewalle
* Github project: https://github.com/michiel-vandewalle/Mailchimp-AJAX-form-submit-vanillaJS
*/
(function () {
if (document.getElementsByTagName('form').length > 0) {
document.getElementsByTagName('form')[0].addEventListener('submit', function (e) {
e.preventDefault();
// Check for spam
if(document.getElementById('js-validate-robot').value !== '') { return false }
// Get url for mailchimp
var url = this.action.replace('/post?', '/post-json?');
// Add form data to object
var data = '';
var inputs = this.querySelectorAll('#js-form-inputs input');
for (var i = 0; i < inputs.length; i++) {
data += '&' + inputs[i].name + '=' + encodeURIComponent(inputs[i].value);
}
// Create & add post script to the DOM
var script = document.createElement('script');
script.src = url + data;
document.body.appendChild(script);
// Callback function
var callback = 'callback';
window[callback] = function(data) {
// Remove post script from the DOM
delete window[callback];
document.body.removeChild(script);
// Display response message
document.getElementById('js-subscribe-response').innerHTML = data.msg
};
});
}
})();
| /*
* Mailchimp AJAX form submit VanillaJS
* Vanilla JS
* Author: Michiel Vandewalle
* Github author: https://github.com/michiel-vandewalle
* Github project: https://github.com/michiel-vandewalle/Mailchimp-AJAX-form-submit-vanillaJS
*/
(function () {
+ if (document.getElementsByTagName('form').length > 0) {
- document.getElementsByTagName('form')[0].addEventListener('submit', function (e) {
+ document.getElementsByTagName('form')[0].addEventListener('submit', function (e) {
? ++++
- e.preventDefault();
+ e.preventDefault();
? ++++
- // Check for spam
+ // Check for spam
? ++++
- if(document.getElementById('js-validate-robot').value !== '') { return false }
+ if(document.getElementById('js-validate-robot').value !== '') { return false }
? ++++
- // Get url for mailchimp
+ // Get url for mailchimp
? ++++
- var url = this.action.replace('/post?', '/post-json?');
+ var url = this.action.replace('/post?', '/post-json?');
? ++++
- // Add form data to object
+ // Add form data to object
? ++++
- var data = '';
+ var data = '';
? ++++
- var inputs = this.querySelectorAll('#js-form-inputs input');
+ var inputs = this.querySelectorAll('#js-form-inputs input');
? ++++
- for (var i = 0; i < inputs.length; i++) {
+ for (var i = 0; i < inputs.length; i++) {
? ++++
- data += '&' + inputs[i].name + '=' + encodeURIComponent(inputs[i].value);
+ data += '&' + inputs[i].name + '=' + encodeURIComponent(inputs[i].value);
? ++++
- }
+ }
? ++++
- // Create & add post script to the DOM
+ // Create & add post script to the DOM
? ++++
- var script = document.createElement('script');
+ var script = document.createElement('script');
? ++++
- script.src = url + data;
+ script.src = url + data;
? ++++
- document.body.appendChild(script);
+ document.body.appendChild(script);
? ++++
- // Callback function
+ // Callback function
? ++++
- var callback = 'callback';
+ var callback = 'callback';
? ++++
- window[callback] = function(data) {
+ window[callback] = function(data) {
? ++++
- // Remove post script from the DOM
+ // Remove post script from the DOM
? ++++
- delete window[callback];
+ delete window[callback];
? ++++
- document.body.removeChild(script);
+ document.body.removeChild(script);
? ++++
- // Display response message
+ // Display response message
? ++++
- document.getElementById('js-subscribe-response').innerHTML = data.msg
+ document.getElementById('js-subscribe-response').innerHTML = data.msg
? ++++
+ };
- };
+ });
? +
- });
? --
+ }
})(); | 54 | 1.255814 | 28 | 26 |
da8b40ea8593bd6c5cb0acbc0d6c6ace80e38fe7 | assets/css/images.less | assets/css/images.less | img[src*="new-tools-to-try-out.png"] {
margin-top: 20px;
}
.to-try-out-img {
.text-right;
}
.distributions-icon img {
height: 57px;
}
| img[src*="new-tools-to-try-out.png"] {
margin-top: 20px;
}
.to-try-out-img {
.text-right;
}
.distributions-icon img {
height: 57px;
}
.laptop-responsive {
width: 100%;
padding: 1em;
}
| Add case for laptop image in css | Add case for laptop image in css | Less | mit | openSUSE/landing-page,openSUSE/landing-page,openSUSE/landing-page | less | ## Code Before:
img[src*="new-tools-to-try-out.png"] {
margin-top: 20px;
}
.to-try-out-img {
.text-right;
}
.distributions-icon img {
height: 57px;
}
## Instruction:
Add case for laptop image in css
## Code After:
img[src*="new-tools-to-try-out.png"] {
margin-top: 20px;
}
.to-try-out-img {
.text-right;
}
.distributions-icon img {
height: 57px;
}
.laptop-responsive {
width: 100%;
padding: 1em;
}
| img[src*="new-tools-to-try-out.png"] {
margin-top: 20px;
}
.to-try-out-img {
.text-right;
}
.distributions-icon img {
height: 57px;
}
+ .laptop-responsive {
+ width: 100%;
+ padding: 1em;
+ } | 4 | 0.444444 | 4 | 0 |
ccf3c89d32adf64aeadb48da0b0dc0b941a634fc | README.md | README.md |
[](https://gitter.im/bitrise-io/bitrise-cli?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
**Technology Preview:** this repository is still under active development, breaking changes are expected and feedback is greatly appreciated!
Bitrise (offline) CLI
You can run your Bitrise workflow with this CLI tool,
on your own device.
Part of the Bitrise Continuous Integration, Delivery and Automations Stack.
## Install and Setup
To install `bitrise-cli`, run the following commands (in a bash shell):
```
curl -L https://github.com/bitrise-io/bitrise-cli/releases/download/0.9.3/bitrise-cli-$(uname -s)-$(uname -m) > /usr/local/bin/bitrise-cli
```
Then:
```
chmod +x /usr/local/bin/bitrise-cli
```
The first time it's mandatory to call the `setup` after the install,
and as a best practice you should run the setup every time you install a new version of `bitrise-cli`.
Doing the setup is as easy as:
```
bitrise-cli setup
```
Once the setup finishes you have everything in place to use `bitrise-cli`.
## Development Guideline
* Number one priority is UX for the end-user, to make it a pleasant experience to work with this tool!
* Code should be kept simple: easy to understand, easy to collaborate/contribute (as much as possible of course).
## Tests
* Work with multiple projects, in separate folders
|
[](https://gitter.im/bitrise-io/bitrise-cli?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
**Technology Preview:** this repository is still under active development, breaking changes are expected and feedback is greatly appreciated!
Bitrise (offline) CLI
You can run your Bitrise workflow with this CLI tool,
on your own device.
Part of the Bitrise Continuous Integration, Delivery and Automations Stack.
## Install and Setup
Check the latest release for instructions at: [https://github.com/bitrise-io/bitrise-cli/releases](https://github.com/bitrise-io/bitrise-cli/releases)
## Development Guideline
* Number one priority is UX for the end-user, to make it a pleasant experience to work with this tool!
* Code should be kept simple: easy to understand, easy to collaborate/contribute (as much as possible of course).
## Tests
* Work with multiple projects, in separate folders
| Install instructions now points to /releases | Install instructions now points to /releases | Markdown | mit | bloodrabbit/bitrise,viktorbenei/bitrise,bitrise-io/bitrise,bitrise-io/bitrise-cli,bitrise-io/bitrise-cli,viktorbenei/bitrise,BONDARENKO-q/bitrise,birmacher/bitrise,bitrise-io/bitrise,BONDARENKO-q/bitrise,bazscsa/bitrise-cli,kokomo88/bitrise-cli,bazscsa/bitrise-cli,bloodrabbit/bitrise,birmacher/bitrise,kokomo88/bitrise-cli,mistydemeo/bitrise,mistydemeo/bitrise | markdown | ## Code Before:
[](https://gitter.im/bitrise-io/bitrise-cli?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
**Technology Preview:** this repository is still under active development, breaking changes are expected and feedback is greatly appreciated!
Bitrise (offline) CLI
You can run your Bitrise workflow with this CLI tool,
on your own device.
Part of the Bitrise Continuous Integration, Delivery and Automations Stack.
## Install and Setup
To install `bitrise-cli`, run the following commands (in a bash shell):
```
curl -L https://github.com/bitrise-io/bitrise-cli/releases/download/0.9.3/bitrise-cli-$(uname -s)-$(uname -m) > /usr/local/bin/bitrise-cli
```
Then:
```
chmod +x /usr/local/bin/bitrise-cli
```
The first time it's mandatory to call the `setup` after the install,
and as a best practice you should run the setup every time you install a new version of `bitrise-cli`.
Doing the setup is as easy as:
```
bitrise-cli setup
```
Once the setup finishes you have everything in place to use `bitrise-cli`.
## Development Guideline
* Number one priority is UX for the end-user, to make it a pleasant experience to work with this tool!
* Code should be kept simple: easy to understand, easy to collaborate/contribute (as much as possible of course).
## Tests
* Work with multiple projects, in separate folders
## Instruction:
Install instructions now points to /releases
## Code After:
[](https://gitter.im/bitrise-io/bitrise-cli?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
**Technology Preview:** this repository is still under active development, breaking changes are expected and feedback is greatly appreciated!
Bitrise (offline) CLI
You can run your Bitrise workflow with this CLI tool,
on your own device.
Part of the Bitrise Continuous Integration, Delivery and Automations Stack.
## Install and Setup
Check the latest release for instructions at: [https://github.com/bitrise-io/bitrise-cli/releases](https://github.com/bitrise-io/bitrise-cli/releases)
## Development Guideline
* Number one priority is UX for the end-user, to make it a pleasant experience to work with this tool!
* Code should be kept simple: easy to understand, easy to collaborate/contribute (as much as possible of course).
## Tests
* Work with multiple projects, in separate folders
|
[](https://gitter.im/bitrise-io/bitrise-cli?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
**Technology Preview:** this repository is still under active development, breaking changes are expected and feedback is greatly appreciated!
Bitrise (offline) CLI
You can run your Bitrise workflow with this CLI tool,
on your own device.
Part of the Bitrise Continuous Integration, Delivery and Automations Stack.
## Install and Setup
+ Check the latest release for instructions at: [https://github.com/bitrise-io/bitrise-cli/releases](https://github.com/bitrise-io/bitrise-cli/releases)
- To install `bitrise-cli`, run the following commands (in a bash shell):
-
- ```
- curl -L https://github.com/bitrise-io/bitrise-cli/releases/download/0.9.3/bitrise-cli-$(uname -s)-$(uname -m) > /usr/local/bin/bitrise-cli
- ```
-
- Then:
-
- ```
- chmod +x /usr/local/bin/bitrise-cli
- ```
-
- The first time it's mandatory to call the `setup` after the install,
- and as a best practice you should run the setup every time you install a new version of `bitrise-cli`.
-
- Doing the setup is as easy as:
-
- ```
- bitrise-cli setup
- ```
-
- Once the setup finishes you have everything in place to use `bitrise-cli`.
## Development Guideline
* Number one priority is UX for the end-user, to make it a pleasant experience to work with this tool!
* Code should be kept simple: easy to understand, easy to collaborate/contribute (as much as possible of course).
## Tests
* Work with multiple projects, in separate folders | 23 | 0.479167 | 1 | 22 |
330cf84d6c8dd988717dab5fb97672a10a3f3185 | app/places/templates/busrti.handlebars | app/places/templates/busrti.handlebars | {{#if messages}}
<table>
{{#messages}}
<tr>{{ this }}</tr>
{{/messages}}
</table>
{{/if}}
{{#if services}}
<img src="images/preloader.gif" id="rti-load" class="preloader" width="15" height="15">
<table id="bus-rti">
<tbody>
{{#services}}
<tr>
<td rowspan="2"><span class="service-id">{{ service }}</span></td>
<td class="service-destination">{{ destination }}</td>
<td class="service-next-bus">{{ next }}</td>
</tr>
<tr class="notopborder">
<td colspan="2" class="service-next-buses-following"><small>
{{#if following }}
Next:
{{/if}}
{{#following}}
{{ this }},
{{/following}}
</small></td>
</tr>
{{/services}}
</tbody>
</table>
{{#if lastUpdatedFormatted}}
<div class="last-updated">updated: {{ lastUpdatedFormatted }}</div>
{{/if}}
{{else}}
<p class="free-text">No real-time information available at the moment</p>
{{/if}}
| {{#if messages}}
<table>
{{#messages}}
<tr>{{ this }}</tr>
{{/messages}}
</table>
{{/if}}
{{#if services}}
<img src="images/preloader.gif" id="rti-load" class="preloader" width="15" height="15">
<table id="bus-rti">
<tbody>
{{#services}}
<tr>
<td rowspan="2"><span class="service-id">{{ service }}</span></td>
<td class="service-destination">{{ destination }}</td>
<td class="service-next-bus">{{ next }}</td>
</tr>
<tr class="notopborder">
<td colspan="2" class="service-next-buses-following"><small>
{{#if following }}
Next:
{{/if}}
{{#following}}
{{ this }},
{{/following}}
</small></td>
</tr>
{{/services}}
</tbody>
</table>
{{else}}
<p class="free-text">No real-time information available at the moment</p>
{{/if}}
{{#if lastUpdatedFormatted}}
<div class="last-updated">updated: {{ lastUpdatedFormatted }}</div>
{{/if}}
| Include last updated time regardless of any services | Include last updated time regardless of any services
| Handlebars | apache-2.0 | ox-it/moxie-js-client,ox-it/moxie-js-client,ox-it/moxie-js-client,ox-it/moxie-js-client | handlebars | ## Code Before:
{{#if messages}}
<table>
{{#messages}}
<tr>{{ this }}</tr>
{{/messages}}
</table>
{{/if}}
{{#if services}}
<img src="images/preloader.gif" id="rti-load" class="preloader" width="15" height="15">
<table id="bus-rti">
<tbody>
{{#services}}
<tr>
<td rowspan="2"><span class="service-id">{{ service }}</span></td>
<td class="service-destination">{{ destination }}</td>
<td class="service-next-bus">{{ next }}</td>
</tr>
<tr class="notopborder">
<td colspan="2" class="service-next-buses-following"><small>
{{#if following }}
Next:
{{/if}}
{{#following}}
{{ this }},
{{/following}}
</small></td>
</tr>
{{/services}}
</tbody>
</table>
{{#if lastUpdatedFormatted}}
<div class="last-updated">updated: {{ lastUpdatedFormatted }}</div>
{{/if}}
{{else}}
<p class="free-text">No real-time information available at the moment</p>
{{/if}}
## Instruction:
Include last updated time regardless of any services
## Code After:
{{#if messages}}
<table>
{{#messages}}
<tr>{{ this }}</tr>
{{/messages}}
</table>
{{/if}}
{{#if services}}
<img src="images/preloader.gif" id="rti-load" class="preloader" width="15" height="15">
<table id="bus-rti">
<tbody>
{{#services}}
<tr>
<td rowspan="2"><span class="service-id">{{ service }}</span></td>
<td class="service-destination">{{ destination }}</td>
<td class="service-next-bus">{{ next }}</td>
</tr>
<tr class="notopborder">
<td colspan="2" class="service-next-buses-following"><small>
{{#if following }}
Next:
{{/if}}
{{#following}}
{{ this }},
{{/following}}
</small></td>
</tr>
{{/services}}
</tbody>
</table>
{{else}}
<p class="free-text">No real-time information available at the moment</p>
{{/if}}
{{#if lastUpdatedFormatted}}
<div class="last-updated">updated: {{ lastUpdatedFormatted }}</div>
{{/if}}
| {{#if messages}}
<table>
{{#messages}}
<tr>{{ this }}</tr>
{{/messages}}
</table>
{{/if}}
{{#if services}}
<img src="images/preloader.gif" id="rti-load" class="preloader" width="15" height="15">
<table id="bus-rti">
<tbody>
{{#services}}
<tr>
<td rowspan="2"><span class="service-id">{{ service }}</span></td>
<td class="service-destination">{{ destination }}</td>
<td class="service-next-bus">{{ next }}</td>
</tr>
<tr class="notopborder">
<td colspan="2" class="service-next-buses-following"><small>
{{#if following }}
Next:
{{/if}}
{{#following}}
{{ this }},
{{/following}}
</small></td>
</tr>
{{/services}}
</tbody>
</table>
+ {{else}}
+ <p class="free-text">No real-time information available at the moment</p>
+ {{/if}}
+
{{#if lastUpdatedFormatted}}
<div class="last-updated">updated: {{ lastUpdatedFormatted }}</div>
{{/if}}
- {{else}}
- <p class="free-text">No real-time information available at the moment</p>
- {{/if}} | 7 | 0.189189 | 4 | 3 |
bdcef01d37ad23add978a6892100c8f3a70eda42 | src/utils/formatting.ts | src/utils/formatting.ts | /**
* Trims leading and trailing whitespace and line terminators and replaces all
* characters after character 90 with an ellipsis.
* @param str
*/
export const truncate = (str: string): string => {
const trimmed = str.trim();
return trimmed.length > 90 ? trimmed.slice(0, 89).concat(' ...') : trimmed;
};
| /**
* Trims leading and trailing whitespace and line terminators and replaces all
* characters after character 90 with an ellipsis.
* @param str
*/
export const truncate = (str: string, max = 90): string => {
const trimmed = str.trim();
return trimmed.length > max ? trimmed.slice(0, 89).concat(' ...') : trimmed;
};
| Truncate now accepts an optional max string length parameter | Truncate now accepts an optional max string length parameter
| TypeScript | mit | Anveio/mturk-engine,Anveio/mturk-engine,Anveio/mturk-engine | typescript | ## Code Before:
/**
* Trims leading and trailing whitespace and line terminators and replaces all
* characters after character 90 with an ellipsis.
* @param str
*/
export const truncate = (str: string): string => {
const trimmed = str.trim();
return trimmed.length > 90 ? trimmed.slice(0, 89).concat(' ...') : trimmed;
};
## Instruction:
Truncate now accepts an optional max string length parameter
## Code After:
/**
* Trims leading and trailing whitespace and line terminators and replaces all
* characters after character 90 with an ellipsis.
* @param str
*/
export const truncate = (str: string, max = 90): string => {
const trimmed = str.trim();
return trimmed.length > max ? trimmed.slice(0, 89).concat(' ...') : trimmed;
};
| /**
* Trims leading and trailing whitespace and line terminators and replaces all
* characters after character 90 with an ellipsis.
* @param str
*/
- export const truncate = (str: string): string => {
+ export const truncate = (str: string, max = 90): string => {
? ++++++++++
const trimmed = str.trim();
- return trimmed.length > 90 ? trimmed.slice(0, 89).concat(' ...') : trimmed;
? ^^
+ return trimmed.length > max ? trimmed.slice(0, 89).concat(' ...') : trimmed;
? ^^^
}; | 4 | 0.444444 | 2 | 2 |
9a63bf67012c3246ddb293f6624dfb290085ba9e | plugin/settings/tabular.vim | plugin/settings/tabular.vim | if !exists(':Tabularize')
finish "quit here
endif
nnoremap <silent> <Leader>a= :call Preserve("Tabularize /=")<CR>
vnoremap <silent> <Leader>a= :call Preserve("Tabularize /=")<CR>
nnoremap <silent> <Leader>a: :call Preserve("Tabularize /:\zs")<CR>
vnoremap <silent> <Leader>a: :call Preserve("Tabularize /:\zs")<CR>
nnoremap <silent> <Leader>a> :call Preserve("Tabularize /=>")<CR>
vnoremap <silent> <Leader>a> :call Preserve("Tabularize /=>")<CR>
| if !exists(':Tabularize')
finish "quit here
endif
"align on first =
nnoremap <silent> <Leader>a= :Tabularize /^[^=]*\zs=<CR>
vnoremap <silent> <Leader>a= :Tabularize /^[^=]*\zs=<CR>
"align on first :
nnoremap <silent> <Leader>a: :Tabularize /^[^:]*:\zs/l0c1<CR>
vnoremap <silent> <Leader>a: :Tabularize /^[^:]*:\zs/l0c1<CR>
" align on Ruby hash rocket
nnoremap <silent> <Leader>a> :Tabularize /=><CR>
vnoremap <silent> <Leader>a> :Tabularize /=><CR>
" align on first comma
nnoremap <silent> <Leader>a, :Tabularize /,\zs<CR>
vnoremap <silent> <Leader>a, :Tabularize /,\zs<CR>
| Fix first comma and first colon alignment patterns | Fix first comma and first colon alignment patterns
| VimL | apache-2.0 | dougireton/mirror_pond | viml | ## Code Before:
if !exists(':Tabularize')
finish "quit here
endif
nnoremap <silent> <Leader>a= :call Preserve("Tabularize /=")<CR>
vnoremap <silent> <Leader>a= :call Preserve("Tabularize /=")<CR>
nnoremap <silent> <Leader>a: :call Preserve("Tabularize /:\zs")<CR>
vnoremap <silent> <Leader>a: :call Preserve("Tabularize /:\zs")<CR>
nnoremap <silent> <Leader>a> :call Preserve("Tabularize /=>")<CR>
vnoremap <silent> <Leader>a> :call Preserve("Tabularize /=>")<CR>
## Instruction:
Fix first comma and first colon alignment patterns
## Code After:
if !exists(':Tabularize')
finish "quit here
endif
"align on first =
nnoremap <silent> <Leader>a= :Tabularize /^[^=]*\zs=<CR>
vnoremap <silent> <Leader>a= :Tabularize /^[^=]*\zs=<CR>
"align on first :
nnoremap <silent> <Leader>a: :Tabularize /^[^:]*:\zs/l0c1<CR>
vnoremap <silent> <Leader>a: :Tabularize /^[^:]*:\zs/l0c1<CR>
" align on Ruby hash rocket
nnoremap <silent> <Leader>a> :Tabularize /=><CR>
vnoremap <silent> <Leader>a> :Tabularize /=><CR>
" align on first comma
nnoremap <silent> <Leader>a, :Tabularize /,\zs<CR>
vnoremap <silent> <Leader>a, :Tabularize /,\zs<CR>
| if !exists(':Tabularize')
finish "quit here
endif
+ "align on first =
- nnoremap <silent> <Leader>a= :call Preserve("Tabularize /=")<CR>
? --------------- ^^
+ nnoremap <silent> <Leader>a= :Tabularize /^[^=]*\zs=<CR>
? +++ ^^^^^^
- vnoremap <silent> <Leader>a= :call Preserve("Tabularize /=")<CR>
? --------------- ^^
+ vnoremap <silent> <Leader>a= :Tabularize /^[^=]*\zs=<CR>
? +++ ^^^^^^
+ "align on first :
- nnoremap <silent> <Leader>a: :call Preserve("Tabularize /:\zs")<CR>
? --------------- ^^
+ nnoremap <silent> <Leader>a: :Tabularize /^[^:]*:\zs/l0c1<CR>
? ++++++ ^^^^^
- vnoremap <silent> <Leader>a: :call Preserve("Tabularize /:\zs")<CR>
? --------------- ^^
+ vnoremap <silent> <Leader>a: :Tabularize /^[^:]*:\zs/l0c1<CR>
? ++++++ ^^^^^
+ " align on Ruby hash rocket
- nnoremap <silent> <Leader>a> :call Preserve("Tabularize /=>")<CR>
? --------------- --
+ nnoremap <silent> <Leader>a> :Tabularize /=><CR>
- vnoremap <silent> <Leader>a> :call Preserve("Tabularize /=>")<CR>
? --------------- --
+ vnoremap <silent> <Leader>a> :Tabularize /=><CR>
+ " align on first comma
+ nnoremap <silent> <Leader>a, :Tabularize /,\zs<CR>
+ vnoremap <silent> <Leader>a, :Tabularize /,\zs<CR> | 18 | 1.384615 | 12 | 6 |
5e2a4b3a2c46b49a64ec8628bda8343e493e5c81 | .travis.yml | .travis.yml | language: node_js
node_js:
- "7"
addons:
firefox: latest
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- "export CHROME_BIN=chromium-browser"
- sleep 3
| language: node_js
node_js:
- "7"
addons:
firefox: latest
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- "export CHROME_BIN=chromium-browser"
- "sudo chmod 4755 /opt/google/chrome/chrome-sandbox"
- sleep 3
| ADD chmod 4755 to chromium paht | ADD chmod 4755 to chromium paht
| YAML | apache-2.0 | pubkey/rxdb,natew/rxdb,pubkey/rxdb,pubkey/rxdb,pubkey/rxdb,natew/rxdb,pubkey/rxdb | yaml | ## Code Before:
language: node_js
node_js:
- "7"
addons:
firefox: latest
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- "export CHROME_BIN=chromium-browser"
- sleep 3
## Instruction:
ADD chmod 4755 to chromium paht
## Code After:
language: node_js
node_js:
- "7"
addons:
firefox: latest
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- "export CHROME_BIN=chromium-browser"
- "sudo chmod 4755 /opt/google/chrome/chrome-sandbox"
- sleep 3
| language: node_js
node_js:
- "7"
addons:
firefox: latest
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- "export CHROME_BIN=chromium-browser"
+ - "sudo chmod 4755 /opt/google/chrome/chrome-sandbox"
- sleep 3 | 1 | 0.1 | 1 | 0 |
8b6cd6beff0451654a01c13b3c91afe8f8be105d | index.html | index.html | Hello World!
| <h1>Hello World!</h1>
<h3>myForexApp is an Android App project of mine to help users get their latest Forex related data in one place</h3>
Coming soon.
Please view my profile on :
<br/>
<a href="https://www.linkedin.com/in/asad-khan-developer/">Linkedin</a>
| Add some page content to GitHub Page | Add some page content to GitHub Page | HTML | apache-2.0 | asadkhan777/myForexApp,asadkhan777/myForexApp | html | ## Code Before:
Hello World!
## Instruction:
Add some page content to GitHub Page
## Code After:
<h1>Hello World!</h1>
<h3>myForexApp is an Android App project of mine to help users get their latest Forex related data in one place</h3>
Coming soon.
Please view my profile on :
<br/>
<a href="https://www.linkedin.com/in/asad-khan-developer/">Linkedin</a>
| - Hello World!
+ <h1>Hello World!</h1>
+
+ <h3>myForexApp is an Android App project of mine to help users get their latest Forex related data in one place</h3>
+ Coming soon.
+ Please view my profile on :
+ <br/>
+ <a href="https://www.linkedin.com/in/asad-khan-developer/">Linkedin</a>
+ | 9 | 9 | 8 | 1 |
93bd450f7ef6bb2a7ca3fe76ca2e11212ce19274 | db/migrate/20100826150615_remove_ext_memberships.rb | db/migrate/20100826150615_remove_ext_memberships.rb | class RemoveExtMemberships < ActiveRecord::Migration
def self.up
Membership.find_all_by_role(10).each{|d|d.destroy}
end
def self.down
end
end
| class RemoveExtMemberships < ActiveRecord::Migration
def self.up
Membership.delete_all(:role => 10)
end
def self.down
end
end
| Refactor migration for destroying useless roles. | Refactor migration for destroying useless roles.
Same behaviour, better performance.
| Ruby | agpl-3.0 | vveliev/teambox,alx/teambox,crewmate/crewmate,rahouldatta/teambox,nfredrik/teambox,crewmate/crewmate,alx/teambox,nfredrik/teambox,vveliev/teambox,irfanah/teambox,wesbillman/projects,irfanah/teambox,nfredrik/teambox,irfanah/teambox,irfanah/teambox,wesbillman/projects,crewmate/crewmate,nfredrik/teambox,teambox/teambox,rahouldatta/teambox,teambox/teambox,codeforeurope/samenspel,ccarruitero/teambox,vveliev/teambox,vveliev/teambox,rahouldatta/teambox,teambox/teambox,ccarruitero/teambox,codeforeurope/samenspel | ruby | ## Code Before:
class RemoveExtMemberships < ActiveRecord::Migration
def self.up
Membership.find_all_by_role(10).each{|d|d.destroy}
end
def self.down
end
end
## Instruction:
Refactor migration for destroying useless roles.
Same behaviour, better performance.
## Code After:
class RemoveExtMemberships < ActiveRecord::Migration
def self.up
Membership.delete_all(:role => 10)
end
def self.down
end
end
| class RemoveExtMemberships < ActiveRecord::Migration
def self.up
- Membership.find_all_by_role(10).each{|d|d.destroy}
+ Membership.delete_all(:role => 10)
end
def self.down
end
end | 2 | 0.25 | 1 | 1 |
f86ef07f3bcea176c66a7f76d1a4dd86254c1423 | .buildkite/pipeline.yml | .buildkite/pipeline.yml | steps:
- label: run bats tests
plugins:
docker-compose#v3.0.2:
run: tests
- label: ":bash: Shellcheck"
plugins:
shellcheck#v1.1.2:
files:
- hooks/*
- label: ":sparkles: Linter"
plugins:
plugin-linter#v2.0.0:
id: golang
- label: test running a specific version
command: go version
plugins:
${BUILDKITE_REPO}#${BUILDKITE_COMMIT}:
version: 1.10.2
- label: test cross compiling
command: go build ./tests/helloworld
plugins:
${BUILDKITE_REPO}#${BUILDKITE_COMMIT}:
version: 1.10.2
environment:
- GOOS=android
- GOARCH=arm
- GOARM=7
| steps:
- label: run bats tests
plugins:
docker-compose#v3.0.2:
run: tests
- label: ":bash: Shellcheck"
plugins:
shellcheck#v1.1.2:
files:
- hooks/*
- label: ":sparkles: Linter"
plugins:
plugin-linter#v2.0.0:
id: golang
- label: test running a specific version
command: go version
plugins:
${BUILDKITE_REPO}#${BUILDKITE_COMMIT}:
version: 1.13.8
- label: test cross compiling
command: go build ./tests/helloworld
plugins:
${BUILDKITE_REPO}#${BUILDKITE_COMMIT}:
version: 1.13.8
environment:
- GOOS=linux
- GOARCH=arm
- GOARM=7
| Fix invalid android+arm test combo | Fix invalid android+arm test combo
| YAML | mit | buildkite-plugins/golang-buildkite-plugin,buildkite-plugins/golang-buildkite-plugin | yaml | ## Code Before:
steps:
- label: run bats tests
plugins:
docker-compose#v3.0.2:
run: tests
- label: ":bash: Shellcheck"
plugins:
shellcheck#v1.1.2:
files:
- hooks/*
- label: ":sparkles: Linter"
plugins:
plugin-linter#v2.0.0:
id: golang
- label: test running a specific version
command: go version
plugins:
${BUILDKITE_REPO}#${BUILDKITE_COMMIT}:
version: 1.10.2
- label: test cross compiling
command: go build ./tests/helloworld
plugins:
${BUILDKITE_REPO}#${BUILDKITE_COMMIT}:
version: 1.10.2
environment:
- GOOS=android
- GOARCH=arm
- GOARM=7
## Instruction:
Fix invalid android+arm test combo
## Code After:
steps:
- label: run bats tests
plugins:
docker-compose#v3.0.2:
run: tests
- label: ":bash: Shellcheck"
plugins:
shellcheck#v1.1.2:
files:
- hooks/*
- label: ":sparkles: Linter"
plugins:
plugin-linter#v2.0.0:
id: golang
- label: test running a specific version
command: go version
plugins:
${BUILDKITE_REPO}#${BUILDKITE_COMMIT}:
version: 1.13.8
- label: test cross compiling
command: go build ./tests/helloworld
plugins:
${BUILDKITE_REPO}#${BUILDKITE_COMMIT}:
version: 1.13.8
environment:
- GOOS=linux
- GOARCH=arm
- GOARM=7
| steps:
- label: run bats tests
plugins:
docker-compose#v3.0.2:
run: tests
- label: ":bash: Shellcheck"
plugins:
shellcheck#v1.1.2:
files:
- hooks/*
- label: ":sparkles: Linter"
plugins:
plugin-linter#v2.0.0:
id: golang
- label: test running a specific version
command: go version
plugins:
${BUILDKITE_REPO}#${BUILDKITE_COMMIT}:
- version: 1.10.2
? ^ ^
+ version: 1.13.8
? ^ ^
- label: test cross compiling
command: go build ./tests/helloworld
plugins:
${BUILDKITE_REPO}#${BUILDKITE_COMMIT}:
- version: 1.10.2
? ^ ^
+ version: 1.13.8
? ^ ^
environment:
- - GOOS=android
? ^ ^^^^^
+ - GOOS=linux
? ^^ ^^
- GOARCH=arm
- GOARM=7
-
-
-
- | 10 | 0.277778 | 3 | 7 |
9e785ac35e0fcb8562668a8d32b752b8ba7fee8c | src/main/java/info/u_team/u_team_core/item/UBucketItem.java | src/main/java/info/u_team/u_team_core/item/UBucketItem.java | package info.u_team.u_team_core.item;
import java.util.function.Supplier;
import info.u_team.u_team_core.api.registry.IURegistryType;
import net.minecraft.fluid.Fluid;
import net.minecraft.item.BucketItem;
public class UBucketItem extends BucketItem implements IURegistryType {
protected final String name;
public UBucketItem(String name, Properties builder, Supplier<? extends Fluid> supplier) {
super(supplier, builder);
this.name = name;
}
@Override
public String getEntryName() {
return name;
}
}
| package info.u_team.u_team_core.item;
import java.util.function.Supplier;
import info.u_team.u_team_core.api.registry.IURegistryType;
import net.minecraft.fluid.Fluid;
import net.minecraft.item.*;
public class UBucketItem extends BucketItem implements IURegistryType {
protected final String name;
public UBucketItem(String name, Properties properties, Supplier<? extends Fluid> fluid) {
this(name, null, properties, fluid);
}
public UBucketItem(String name, ItemGroup group, Properties properties, Supplier<? extends Fluid> fluid) {
super(fluid, group == null ? properties : properties.group(group));
this.name = name;
}
@Override
public String getEntryName() {
return name;
}
}
| Add a ctor with the itemgroup | Add a ctor with the itemgroup | Java | apache-2.0 | MC-U-Team/U-Team-Core,MC-U-Team/U-Team-Core | java | ## Code Before:
package info.u_team.u_team_core.item;
import java.util.function.Supplier;
import info.u_team.u_team_core.api.registry.IURegistryType;
import net.minecraft.fluid.Fluid;
import net.minecraft.item.BucketItem;
public class UBucketItem extends BucketItem implements IURegistryType {
protected final String name;
public UBucketItem(String name, Properties builder, Supplier<? extends Fluid> supplier) {
super(supplier, builder);
this.name = name;
}
@Override
public String getEntryName() {
return name;
}
}
## Instruction:
Add a ctor with the itemgroup
## Code After:
package info.u_team.u_team_core.item;
import java.util.function.Supplier;
import info.u_team.u_team_core.api.registry.IURegistryType;
import net.minecraft.fluid.Fluid;
import net.minecraft.item.*;
public class UBucketItem extends BucketItem implements IURegistryType {
protected final String name;
public UBucketItem(String name, Properties properties, Supplier<? extends Fluid> fluid) {
this(name, null, properties, fluid);
}
public UBucketItem(String name, ItemGroup group, Properties properties, Supplier<? extends Fluid> fluid) {
super(fluid, group == null ? properties : properties.group(group));
this.name = name;
}
@Override
public String getEntryName() {
return name;
}
}
| package info.u_team.u_team_core.item;
import java.util.function.Supplier;
import info.u_team.u_team_core.api.registry.IURegistryType;
import net.minecraft.fluid.Fluid;
- import net.minecraft.item.BucketItem;
? ^^^^^^^^^^
+ import net.minecraft.item.*;
? ^
public class UBucketItem extends BucketItem implements IURegistryType {
protected final String name;
- public UBucketItem(String name, Properties builder, Supplier<? extends Fluid> supplier) {
? ^^^^^ ^ --- ^^
+ public UBucketItem(String name, Properties properties, Supplier<? extends Fluid> fluid) {
? ^^^^ ++++ ^^ ^
- super(supplier, builder);
+ this(name, null, properties, fluid);
+ }
+
+ public UBucketItem(String name, ItemGroup group, Properties properties, Supplier<? extends Fluid> fluid) {
+ super(fluid, group == null ? properties : properties.group(group));
this.name = name;
}
@Override
public String getEntryName() {
return name;
}
} | 10 | 0.454545 | 7 | 3 |
858ab1121f7e98284a80a869859fdb7ed6465d7f | lib/tasks/run_mailman.rake | lib/tasks/run_mailman.rake | namespace :helpy do
desc "Run mailman"
task :mailman => :environment do
require 'mailman'
# Mailman.config.poll_interval
if AppSettings["email.mail_service"] == 'pop3'
puts 'pop3 config found'
Mailman.config.pop3 = {
server: AppSettings['email.pop3_server'],
#ssl: true,
# Use starttls instead of ssl (do not specify both)
#starttls: true,
username: AppSettings['email.pop3_username'],
password: AppSettings['email.pop3_password']
}
end
if AppSettings["email.mail_service"] == 'imap'
puts 'imap config found'
Mailman.config.imap = {
server: AppSettings['email.imap_server'],
port: 993, # you usually don't need to set this, but it's there if you need to
#ssl: true,
# Use starttls instead of ssl (do not specify both)
starttls: true,
username: AppSettings['email.imap_username'],
password: AppSettings['email.imap_password']
}
end
Mailman::Application.run do
#to 'xikolo-ticket@apptanic.de' do
begin
EmailProcessor.new(message).process
rescue Exception => e
p e
end
#end
end
end
end
| namespace :helpy do
desc "Run mailman"
task :mailman => :environment do
require 'mailman'
# Mailman.config.poll_interval
if AppSettings["email.mail_service"] == 'pop3'
puts 'pop3 config found'
Mailman.config.pop3 = {
server: AppSettings['email.pop3_server'],
ssl: AppSettings['email.pop3_security'] == 'ssl' ? true : false,
starttls: AppSettings['email.pop3_security'] == 'starttls' ? true : false,
username: AppSettings['email.pop3_username'],
password: AppSettings['email.pop3_password']
}
end
if AppSettings["email.mail_service"] == 'imap'
puts 'imap config found'
Mailman.config.imap = {
server: AppSettings['email.imap_server'],
port: 993, # you usually don't need to set this, but it's there if you need to
ssl: AppSettings['email.imap_security'] == 'ssl' ? true : false,
starttls: AppSettings['email.imap_security'] == 'starttls' ? true : false,
username: AppSettings['email.imap_username'],
password: AppSettings['email.imap_password']
}
end
Mailman::Application.run do
#to 'xikolo-ticket@apptanic.de' do
begin
EmailProcessor.new(message).process
rescue Exception => e
p e
end
#end
end
end
end
| Use settings in rake task | Use settings in rake task
| Ruby | mit | helpyio/helpy,CGA1123/helpy,helpyio/helpy,CGA1123/helpy,monami-ya/helpy,olliebennett/helpy,scott/helpy__helpdesk_knowledgebase,Rynaro/helpy,monami-ya/helpy,helpyio/helpy,felipewmartins/helpy,scott/helpy,felipewmartins/helpy,scott/helpy__helpdesk_knowledgebase,olliebennett/helpy,Rynaro/helpy,olliebennett/helpy,scott/helpy,scott/helpy,felipewmartins/helpy,CGA1123/helpy,helpyio/helpy,Rynaro/helpy,CGA1123/helpy,scott/helpy__helpdesk_knowledgebase,monami-ya/helpy | ruby | ## Code Before:
namespace :helpy do
desc "Run mailman"
task :mailman => :environment do
require 'mailman'
# Mailman.config.poll_interval
if AppSettings["email.mail_service"] == 'pop3'
puts 'pop3 config found'
Mailman.config.pop3 = {
server: AppSettings['email.pop3_server'],
#ssl: true,
# Use starttls instead of ssl (do not specify both)
#starttls: true,
username: AppSettings['email.pop3_username'],
password: AppSettings['email.pop3_password']
}
end
if AppSettings["email.mail_service"] == 'imap'
puts 'imap config found'
Mailman.config.imap = {
server: AppSettings['email.imap_server'],
port: 993, # you usually don't need to set this, but it's there if you need to
#ssl: true,
# Use starttls instead of ssl (do not specify both)
starttls: true,
username: AppSettings['email.imap_username'],
password: AppSettings['email.imap_password']
}
end
Mailman::Application.run do
#to 'xikolo-ticket@apptanic.de' do
begin
EmailProcessor.new(message).process
rescue Exception => e
p e
end
#end
end
end
end
## Instruction:
Use settings in rake task
## Code After:
namespace :helpy do
desc "Run mailman"
task :mailman => :environment do
require 'mailman'
# Mailman.config.poll_interval
if AppSettings["email.mail_service"] == 'pop3'
puts 'pop3 config found'
Mailman.config.pop3 = {
server: AppSettings['email.pop3_server'],
ssl: AppSettings['email.pop3_security'] == 'ssl' ? true : false,
starttls: AppSettings['email.pop3_security'] == 'starttls' ? true : false,
username: AppSettings['email.pop3_username'],
password: AppSettings['email.pop3_password']
}
end
if AppSettings["email.mail_service"] == 'imap'
puts 'imap config found'
Mailman.config.imap = {
server: AppSettings['email.imap_server'],
port: 993, # you usually don't need to set this, but it's there if you need to
ssl: AppSettings['email.imap_security'] == 'ssl' ? true : false,
starttls: AppSettings['email.imap_security'] == 'starttls' ? true : false,
username: AppSettings['email.imap_username'],
password: AppSettings['email.imap_password']
}
end
Mailman::Application.run do
#to 'xikolo-ticket@apptanic.de' do
begin
EmailProcessor.new(message).process
rescue Exception => e
p e
end
#end
end
end
end
| namespace :helpy do
desc "Run mailman"
task :mailman => :environment do
require 'mailman'
# Mailman.config.poll_interval
if AppSettings["email.mail_service"] == 'pop3'
puts 'pop3 config found'
Mailman.config.pop3 = {
server: AppSettings['email.pop3_server'],
+ ssl: AppSettings['email.pop3_security'] == 'ssl' ? true : false,
+ starttls: AppSettings['email.pop3_security'] == 'starttls' ? true : false,
- #ssl: true,
- # Use starttls instead of ssl (do not specify both)
- #starttls: true,
username: AppSettings['email.pop3_username'],
password: AppSettings['email.pop3_password']
}
end
if AppSettings["email.mail_service"] == 'imap'
puts 'imap config found'
Mailman.config.imap = {
server: AppSettings['email.imap_server'],
port: 993, # you usually don't need to set this, but it's there if you need to
+ ssl: AppSettings['email.imap_security'] == 'ssl' ? true : false,
+ starttls: AppSettings['email.imap_security'] == 'starttls' ? true : false,
- #ssl: true,
- # Use starttls instead of ssl (do not specify both)
- starttls: true,
username: AppSettings['email.imap_username'],
password: AppSettings['email.imap_password']
}
end
Mailman::Application.run do
#to 'xikolo-ticket@apptanic.de' do
begin
EmailProcessor.new(message).process
rescue Exception => e
p e
end
#end
end
end
end | 10 | 0.232558 | 4 | 6 |
7304f3863d4f78dedab727148ba9582cbec72dc5 | input/docs/editors/visualstudio.md | input/docs/editors/visualstudio.md | Order: 30
Title: Visual Studio
---
# Syntax Highlighting
Syntax highlighting and Code snippets for .cake files are provided by the **Cake for Visual Studio** extension available from the [Visual Studio Gallery](https://visualstudiogallery.msdn.microsoft.com/).
# Intellisense
There is currently no support for Intellisense in .cake script files within Visual Studio.
# Templates
Choose the "Cake" category from the File > New > Project menu to quickly create a new Cake addin, module or addin test project.

You can also use the commands from the Build > Cake Build menu to install the default bootstrapper scripts or Cake configuration files into an open solution.
# Using the Task Runner
If your `build.cake` file is included in your solution, you can open the Task Runner Explorer window by right-clicking on the file from your Solution Explorer and choosing *Task Runner Explorer*.
Individual tasks will be listed on the left, and each task can be executed by double-clicking the task.

Task bindings make it possible to associate individual tasks with Visual Studio events such as Project Open, Build or Clean. These bindings are saved in your `cake.config` file. | Order: 30
Title: Visual Studio
---
# Syntax Highlighting
Syntax highlighting and Code snippets for .cake files are provided by the **Cake for Visual Studio** extension available from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=vs-publisher-1392591.CakeforVisualStudio).
# Intellisense
There is currently no support for Intellisense in .cake script files within Visual Studio.
# Templates
Choose the "Cake" category from the File > New > Project menu to quickly create a new Cake addin, module or addin test project.

You can also use the commands from the Build > Cake Build menu to install the default bootstrapper scripts or Cake configuration files into an open solution.
# Using the Task Runner
If your `build.cake` file is included in your solution, you can open the Task Runner Explorer window by right-clicking on the file from your Solution Explorer and choosing *Task Runner Explorer*.
Individual tasks will be listed on the left, and each task can be executed by double-clicking the task.

Task bindings make it possible to associate individual tasks with Visual Studio events such as Project Open, Build or Clean. These bindings are saved in your `cake.config` file. | Fix Link for the Cake Visual Studio Extension | Fix Link for the Cake Visual Studio Extension
The current link to the Cake extension on the Visual Studio Gallery is
outdated. Instead the extension can now be found on the Visual Studio
Marketplace.
| Markdown | mit | cake-build-bot/website,cake-build/website,devlead/website,cake-build/website,devlead/website,cake-build-bot/website,devlead/website,cake-build/website | markdown | ## Code Before:
Order: 30
Title: Visual Studio
---
# Syntax Highlighting
Syntax highlighting and Code snippets for .cake files are provided by the **Cake for Visual Studio** extension available from the [Visual Studio Gallery](https://visualstudiogallery.msdn.microsoft.com/).
# Intellisense
There is currently no support for Intellisense in .cake script files within Visual Studio.
# Templates
Choose the "Cake" category from the File > New > Project menu to quickly create a new Cake addin, module or addin test project.

You can also use the commands from the Build > Cake Build menu to install the default bootstrapper scripts or Cake configuration files into an open solution.
# Using the Task Runner
If your `build.cake` file is included in your solution, you can open the Task Runner Explorer window by right-clicking on the file from your Solution Explorer and choosing *Task Runner Explorer*.
Individual tasks will be listed on the left, and each task can be executed by double-clicking the task.

Task bindings make it possible to associate individual tasks with Visual Studio events such as Project Open, Build or Clean. These bindings are saved in your `cake.config` file.
## Instruction:
Fix Link for the Cake Visual Studio Extension
The current link to the Cake extension on the Visual Studio Gallery is
outdated. Instead the extension can now be found on the Visual Studio
Marketplace.
## Code After:
Order: 30
Title: Visual Studio
---
# Syntax Highlighting
Syntax highlighting and Code snippets for .cake files are provided by the **Cake for Visual Studio** extension available from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=vs-publisher-1392591.CakeforVisualStudio).
# Intellisense
There is currently no support for Intellisense in .cake script files within Visual Studio.
# Templates
Choose the "Cake" category from the File > New > Project menu to quickly create a new Cake addin, module or addin test project.

You can also use the commands from the Build > Cake Build menu to install the default bootstrapper scripts or Cake configuration files into an open solution.
# Using the Task Runner
If your `build.cake` file is included in your solution, you can open the Task Runner Explorer window by right-clicking on the file from your Solution Explorer and choosing *Task Runner Explorer*.
Individual tasks will be listed on the left, and each task can be executed by double-clicking the task.

Task bindings make it possible to associate individual tasks with Visual Studio events such as Project Open, Build or Clean. These bindings are saved in your `cake.config` file. | Order: 30
Title: Visual Studio
---
# Syntax Highlighting
- Syntax highlighting and Code snippets for .cake files are provided by the **Cake for Visual Studio** extension available from the [Visual Studio Gallery](https://visualstudiogallery.msdn.microsoft.com/).
+ Syntax highlighting and Code snippets for .cake files are provided by the **Cake for Visual Studio** extension available from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=vs-publisher-1392591.CakeforVisualStudio).
# Intellisense
There is currently no support for Intellisense in .cake script files within Visual Studio.
# Templates
Choose the "Cake" category from the File > New > Project menu to quickly create a new Cake addin, module or addin test project.

You can also use the commands from the Build > Cake Build menu to install the default bootstrapper scripts or Cake configuration files into an open solution.
# Using the Task Runner
If your `build.cake` file is included in your solution, you can open the Task Runner Explorer window by right-clicking on the file from your Solution Explorer and choosing *Task Runner Explorer*.
Individual tasks will be listed on the left, and each task can be executed by double-clicking the task.

Task bindings make it possible to associate individual tasks with Visual Studio events such as Project Open, Build or Clean. These bindings are saved in your `cake.config` file. | 2 | 0.068966 | 1 | 1 |
c35fb0279c0d9bc79afdf24046ee1816c2985a75 | rails/init.rb | rails/init.rb | File.join(File.dirname(__FILE__), "../lib/agnostic_presenters")
AgnosticPresenters::Base.send :include, ActionView::Helpers if defined?(Rails)
class << ActionController::Base
def add_template_helper_with_presenters(helper_module, *args, &block)
# Hijacking any helper added to controllers so that our presenters can acces 'em.
AgnosticPresenters::Base.instance_eval { include helper_module }
add_template_helper_without_presenters(helper_module, *args, &block)
end
alias_method_chain :add_template_helper, :presenters
end | File.join(File.dirname(__FILE__), "../lib/agnostic_presenters")
if defined?(Rails)
AgnosticPresenters::Base.send :include, ActionView::Helpers
class << ActionController::Base
def add_template_helper_with_presenters(helper_module, *args, &block)
# Hijacking any helper added to controllers so that our presenters can acces 'em.
AgnosticPresenters::Base.instance_eval { include helper_module }
add_template_helper_without_presenters(helper_module, *args, &block)
end
alias_method_chain :add_template_helper, :presenters
end
end | Fix to be totally agnostic. | Fix to be totally agnostic.
| Ruby | mit | yeastymobs/agnostic_presenters | ruby | ## Code Before:
File.join(File.dirname(__FILE__), "../lib/agnostic_presenters")
AgnosticPresenters::Base.send :include, ActionView::Helpers if defined?(Rails)
class << ActionController::Base
def add_template_helper_with_presenters(helper_module, *args, &block)
# Hijacking any helper added to controllers so that our presenters can acces 'em.
AgnosticPresenters::Base.instance_eval { include helper_module }
add_template_helper_without_presenters(helper_module, *args, &block)
end
alias_method_chain :add_template_helper, :presenters
end
## Instruction:
Fix to be totally agnostic.
## Code After:
File.join(File.dirname(__FILE__), "../lib/agnostic_presenters")
if defined?(Rails)
AgnosticPresenters::Base.send :include, ActionView::Helpers
class << ActionController::Base
def add_template_helper_with_presenters(helper_module, *args, &block)
# Hijacking any helper added to controllers so that our presenters can acces 'em.
AgnosticPresenters::Base.instance_eval { include helper_module }
add_template_helper_without_presenters(helper_module, *args, &block)
end
alias_method_chain :add_template_helper, :presenters
end
end | File.join(File.dirname(__FILE__), "../lib/agnostic_presenters")
- AgnosticPresenters::Base.send :include, ActionView::Helpers if defined?(Rails)
+ if defined?(Rails)
+ AgnosticPresenters::Base.send :include, ActionView::Helpers
+
- class << ActionController::Base
+ class << ActionController::Base
? ++
- def add_template_helper_with_presenters(helper_module, *args, &block)
+ def add_template_helper_with_presenters(helper_module, *args, &block)
? ++
- # Hijacking any helper added to controllers so that our presenters can acces 'em.
+ # Hijacking any helper added to controllers so that our presenters can acces 'em.
? ++
- AgnosticPresenters::Base.instance_eval { include helper_module }
+ AgnosticPresenters::Base.instance_eval { include helper_module }
? ++
- add_template_helper_without_presenters(helper_module, *args, &block)
+ add_template_helper_without_presenters(helper_module, *args, &block)
? ++
+ end
+
+ alias_method_chain :add_template_helper, :presenters
end
-
- alias_method_chain :add_template_helper, :presenters
end | 19 | 1.583333 | 11 | 8 |
4b2b8e47908cb857880de91f58fa66fa033889fa | app/models/request.rb | app/models/request.rb | class Request < ActiveRecord::Base
before_save :defaultly_unfulfilled
belongs_to :requester, class_name: 'User'
belongs_to :responder, class_name: 'User'
validates :content, presence: true
validates :requester, presence: true
validates :is_fulfilled, presence: true
private
def defaultly_unfulfilled
self.is_fulfilled = false
true
end
end
| class Request < ActiveRecord::Base
before_create :defaultly_unfulfilled
belongs_to :requester, class_name: 'User'
belongs_to :responder, class_name: 'User'
validates :content, presence: true
validates :requester, presence: true
validates :is_fulfilled, inclusion: { in: [true, false] }
private
def defaultly_unfulfilled
self.is_fulfilled = false
true
end
end
| Change callback to return true | Change callback to return true
| Ruby | mit | kimchanyoung/nghborly,kimchanyoung/nghborly,nyc-mud-turtles-2015/nghborly,nyc-mud-turtles-2015/nghborly,nyc-mud-turtles-2015/nghborly,kimchanyoung/nghborly | ruby | ## Code Before:
class Request < ActiveRecord::Base
before_save :defaultly_unfulfilled
belongs_to :requester, class_name: 'User'
belongs_to :responder, class_name: 'User'
validates :content, presence: true
validates :requester, presence: true
validates :is_fulfilled, presence: true
private
def defaultly_unfulfilled
self.is_fulfilled = false
true
end
end
## Instruction:
Change callback to return true
## Code After:
class Request < ActiveRecord::Base
before_create :defaultly_unfulfilled
belongs_to :requester, class_name: 'User'
belongs_to :responder, class_name: 'User'
validates :content, presence: true
validates :requester, presence: true
validates :is_fulfilled, inclusion: { in: [true, false] }
private
def defaultly_unfulfilled
self.is_fulfilled = false
true
end
end
| class Request < ActiveRecord::Base
- before_save :defaultly_unfulfilled
? ^ ^
+ before_create :defaultly_unfulfilled
? ^^^ ^
belongs_to :requester, class_name: 'User'
belongs_to :responder, class_name: 'User'
validates :content, presence: true
validates :requester, presence: true
- validates :is_fulfilled, presence: true
+ validates :is_fulfilled, inclusion: { in: [true, false] }
private
def defaultly_unfulfilled
self.is_fulfilled = false
true
end
end | 4 | 0.25 | 2 | 2 |
c5d52b97ffdd3bb8d344e6f646bcd02f942b39a0 | README.md | README.md | RxBroadcast
===========
RxBroadcast is a small distributed event library for Java and the JVM.
JCenter: [](https://bintray.com/whymarrh/maven/RxBroadcast/_latestVersion)
Gradle dependency:
```groovy
compile "rxbroadcast:rxbroadcast:$version"
```
Build status
------------
| Branch | Build Status |
| ------------- | ----------------------- |
| `master` | [![Build Status][1]][3] |
| `development` | [![Build Status][2]][3] |
[1]:https://travis-ci.org/RxBroadcast/RxBroadcast.svg?branch=master
[2]:https://travis-ci.org/RxBroadcast/RxBroadcast.svg?branch=development
[3]:https://travis-ci.org/RxBroadcast/RxBroadcast
See [rxbroadcast.website](http://rxbroadcast.website) for more information.
Project status
--------------
This library is under development.
| RxBroadcast
===========
RxBroadcast is a small distributed event library for Java and the JVM.
| JCenter |
| ------- |
| [](https://bintray.com/whymarrh/maven/RxBroadcast/_latestVersion) |
Gradle dependency:
```groovy
compile "rxbroadcast:rxbroadcast:$version"
```
Build status
------------
| Branch | Build Status |
| ------------- | ----------------------- |
| `master` | [![Build Status][1]][3] |
| `development` | [![Build Status][2]][3] |
[1]:https://travis-ci.org/RxBroadcast/RxBroadcast.svg?branch=master
[2]:https://travis-ci.org/RxBroadcast/RxBroadcast.svg?branch=development
[3]:https://travis-ci.org/RxBroadcast/RxBroadcast
See [rxbroadcast.website](http://rxbroadcast.website) for more information.
Project status
--------------
This library is under development.
| Move JCenter badge into a table | Move JCenter badge into a table
| Markdown | isc | RxBroadcast/RxBroadcast,whymarrh/RxBroadcast,RxBroadcast/RxBroadcast,RxBroadcast/RxBroadcast,whymarrh/RxBroadcast,RxBroadcast/RxBroadcast | markdown | ## Code Before:
RxBroadcast
===========
RxBroadcast is a small distributed event library for Java and the JVM.
JCenter: [](https://bintray.com/whymarrh/maven/RxBroadcast/_latestVersion)
Gradle dependency:
```groovy
compile "rxbroadcast:rxbroadcast:$version"
```
Build status
------------
| Branch | Build Status |
| ------------- | ----------------------- |
| `master` | [![Build Status][1]][3] |
| `development` | [![Build Status][2]][3] |
[1]:https://travis-ci.org/RxBroadcast/RxBroadcast.svg?branch=master
[2]:https://travis-ci.org/RxBroadcast/RxBroadcast.svg?branch=development
[3]:https://travis-ci.org/RxBroadcast/RxBroadcast
See [rxbroadcast.website](http://rxbroadcast.website) for more information.
Project status
--------------
This library is under development.
## Instruction:
Move JCenter badge into a table
## Code After:
RxBroadcast
===========
RxBroadcast is a small distributed event library for Java and the JVM.
| JCenter |
| ------- |
| [](https://bintray.com/whymarrh/maven/RxBroadcast/_latestVersion) |
Gradle dependency:
```groovy
compile "rxbroadcast:rxbroadcast:$version"
```
Build status
------------
| Branch | Build Status |
| ------------- | ----------------------- |
| `master` | [![Build Status][1]][3] |
| `development` | [![Build Status][2]][3] |
[1]:https://travis-ci.org/RxBroadcast/RxBroadcast.svg?branch=master
[2]:https://travis-ci.org/RxBroadcast/RxBroadcast.svg?branch=development
[3]:https://travis-ci.org/RxBroadcast/RxBroadcast
See [rxbroadcast.website](http://rxbroadcast.website) for more information.
Project status
--------------
This library is under development.
| RxBroadcast
===========
RxBroadcast is a small distributed event library for Java and the JVM.
+ | JCenter |
+ | ------- |
- JCenter: [](https://bintray.com/whymarrh/maven/RxBroadcast/_latestVersion)
? ^^^^^^^^
+ | [](https://bintray.com/whymarrh/maven/RxBroadcast/_latestVersion) |
? ^ ++
Gradle dependency:
```groovy
compile "rxbroadcast:rxbroadcast:$version"
```
Build status
------------
| Branch | Build Status |
| ------------- | ----------------------- |
| `master` | [![Build Status][1]][3] |
| `development` | [![Build Status][2]][3] |
[1]:https://travis-ci.org/RxBroadcast/RxBroadcast.svg?branch=master
[2]:https://travis-ci.org/RxBroadcast/RxBroadcast.svg?branch=development
[3]:https://travis-ci.org/RxBroadcast/RxBroadcast
See [rxbroadcast.website](http://rxbroadcast.website) for more information.
Project status
--------------
This library is under development. | 4 | 0.129032 | 3 | 1 |
44441db07463583f47d7cc8887d22a0798d7b80d | requirements.txt | requirements.txt | pynacl == 0.3.0
twisted == 14.0
stem == 1.3.0
ipaddress == 1.0.6
hkdf == 0.0.1
pycrypto == 2.6.1
pyopenssl == 0.14
| pynacl == 0.3.0
twisted == 14.0
stem == 1.3.0
ipaddress == 1.0.6
hkdf == 0.0.1
pycrypto == 2.6.1
pyopenssl == 0.14
service-identity == 14.0
| Add 'service-identity' package as a requirement. | Add 'service-identity' package as a requirement.
Twisted has an ugly warning if used without the 'service-identity'
Python package. We don't actually require the functionality,
but it's better to silence the warning.
| Text | bsd-3-clause | nskinkel/oppy | text | ## Code Before:
pynacl == 0.3.0
twisted == 14.0
stem == 1.3.0
ipaddress == 1.0.6
hkdf == 0.0.1
pycrypto == 2.6.1
pyopenssl == 0.14
## Instruction:
Add 'service-identity' package as a requirement.
Twisted has an ugly warning if used without the 'service-identity'
Python package. We don't actually require the functionality,
but it's better to silence the warning.
## Code After:
pynacl == 0.3.0
twisted == 14.0
stem == 1.3.0
ipaddress == 1.0.6
hkdf == 0.0.1
pycrypto == 2.6.1
pyopenssl == 0.14
service-identity == 14.0
| pynacl == 0.3.0
twisted == 14.0
stem == 1.3.0
ipaddress == 1.0.6
hkdf == 0.0.1
pycrypto == 2.6.1
pyopenssl == 0.14
+ service-identity == 14.0 | 1 | 0.142857 | 1 | 0 |
b3c102cdf6504875a2e69ae673b632021f6fa0b8 | clj_record/test/model/config.clj | clj_record/test/model/config.clj | (ns clj-record.test.model.config)
(comment
(def db {:classname "org.apache.derby.jdbc.EmbeddedDriver"
:subprotocol "derby"
:subname "/tmp/clj-record.test.db"
:create true})
)
(def db {:classname "org.postgresql.Driver"
:subprotocol "postgresql"
:subname "//localhost:5433/coffeemug"
:user "enter-user-name-here"
:password ""}) | (ns clj-record.test.model.config)
(def db {:classname "org.apache.derby.jdbc.EmbeddedDriver"
:subprotocol "derby"
:subname "/tmp/clj-record.test.db"
:create true})
(comment
(def db {:classname "org.postgresql.Driver"
:subprotocol "postgresql"
:subname "//localhost:5433/coffeemug"
:user "enter-user-name-here"
:password ""})
)
| Switch back to using Derby in tests. | Switch back to using Derby in tests.
| Clojure | mit | duelinmarkers/clj-record | clojure | ## Code Before:
(ns clj-record.test.model.config)
(comment
(def db {:classname "org.apache.derby.jdbc.EmbeddedDriver"
:subprotocol "derby"
:subname "/tmp/clj-record.test.db"
:create true})
)
(def db {:classname "org.postgresql.Driver"
:subprotocol "postgresql"
:subname "//localhost:5433/coffeemug"
:user "enter-user-name-here"
:password ""})
## Instruction:
Switch back to using Derby in tests.
## Code After:
(ns clj-record.test.model.config)
(def db {:classname "org.apache.derby.jdbc.EmbeddedDriver"
:subprotocol "derby"
:subname "/tmp/clj-record.test.db"
:create true})
(comment
(def db {:classname "org.postgresql.Driver"
:subprotocol "postgresql"
:subname "//localhost:5433/coffeemug"
:user "enter-user-name-here"
:password ""})
)
| (ns clj-record.test.model.config)
- (comment
(def db {:classname "org.apache.derby.jdbc.EmbeddedDriver"
:subprotocol "derby"
:subname "/tmp/clj-record.test.db"
:create true})
- )
+ (comment
(def db {:classname "org.postgresql.Driver"
:subprotocol "postgresql"
:subname "//localhost:5433/coffeemug"
:user "enter-user-name-here"
:password ""})
+ ) | 4 | 0.285714 | 2 | 2 |
9ae5ea3876fae6ef0bc092d87c71d9ea86040cf7 | InvenTree/company/api.py | InvenTree/company/api.py | from __future__ import unicode_literals
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import filters
from rest_framework import generics, permissions
from django.conf.urls import url
from .models import Company
from .serializers import CompanySerializer
class CompanyList(generics.ListCreateAPIView):
serializer_class = CompanySerializer
queryset = Company.objects.all()
permission_classes = [
permissions.IsAuthenticatedOrReadOnly,
]
filter_backends = [
DjangoFilterBackend,
filters.SearchFilter,
filters.OrderingFilter,
]
filter_fields = [
'name',
'is_customer',
'is_supplier',
]
search_fields = [
'name',
'description',
]
ordering_fields = [
'name',
]
ordering = 'name'
company_api_urls = [
url(r'^.*$', CompanyList.as_view(), name='api-company-list'),
]
| from __future__ import unicode_literals
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import filters
from rest_framework import generics, permissions
from django.conf.urls import url
from .models import Company
from .serializers import CompanySerializer
class CompanyList(generics.ListCreateAPIView):
serializer_class = CompanySerializer
queryset = Company.objects.all()
permission_classes = [
permissions.IsAuthenticatedOrReadOnly,
]
filter_backends = [
DjangoFilterBackend,
filters.SearchFilter,
filters.OrderingFilter,
]
filter_fields = [
'name',
'is_customer',
'is_supplier',
]
search_fields = [
'name',
'description',
]
ordering_fields = [
'name',
]
ordering = 'name'
class CompanyDetail(generics.RetrieveUpdateDestroyAPIView):
queryset = Company.objects.all()
serializer_class = CompanySerializer
permission_classes = [
permissions.IsAuthenticatedOrReadOnly,
]
company_api_urls = [
url(r'^(?P<pk>\d+)/?', CompanyDetail.as_view(), name='api-company-detail'),
url(r'^.*$', CompanyList.as_view(), name='api-company-list'),
]
| Add RUD endpoint for Company | Add RUD endpoint for Company
| Python | mit | SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,inventree/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree | python | ## Code Before:
from __future__ import unicode_literals
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import filters
from rest_framework import generics, permissions
from django.conf.urls import url
from .models import Company
from .serializers import CompanySerializer
class CompanyList(generics.ListCreateAPIView):
serializer_class = CompanySerializer
queryset = Company.objects.all()
permission_classes = [
permissions.IsAuthenticatedOrReadOnly,
]
filter_backends = [
DjangoFilterBackend,
filters.SearchFilter,
filters.OrderingFilter,
]
filter_fields = [
'name',
'is_customer',
'is_supplier',
]
search_fields = [
'name',
'description',
]
ordering_fields = [
'name',
]
ordering = 'name'
company_api_urls = [
url(r'^.*$', CompanyList.as_view(), name='api-company-list'),
]
## Instruction:
Add RUD endpoint for Company
## Code After:
from __future__ import unicode_literals
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import filters
from rest_framework import generics, permissions
from django.conf.urls import url
from .models import Company
from .serializers import CompanySerializer
class CompanyList(generics.ListCreateAPIView):
serializer_class = CompanySerializer
queryset = Company.objects.all()
permission_classes = [
permissions.IsAuthenticatedOrReadOnly,
]
filter_backends = [
DjangoFilterBackend,
filters.SearchFilter,
filters.OrderingFilter,
]
filter_fields = [
'name',
'is_customer',
'is_supplier',
]
search_fields = [
'name',
'description',
]
ordering_fields = [
'name',
]
ordering = 'name'
class CompanyDetail(generics.RetrieveUpdateDestroyAPIView):
queryset = Company.objects.all()
serializer_class = CompanySerializer
permission_classes = [
permissions.IsAuthenticatedOrReadOnly,
]
company_api_urls = [
url(r'^(?P<pk>\d+)/?', CompanyDetail.as_view(), name='api-company-detail'),
url(r'^.*$', CompanyList.as_view(), name='api-company-list'),
]
| from __future__ import unicode_literals
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import filters
from rest_framework import generics, permissions
from django.conf.urls import url
from .models import Company
from .serializers import CompanySerializer
class CompanyList(generics.ListCreateAPIView):
serializer_class = CompanySerializer
queryset = Company.objects.all()
permission_classes = [
permissions.IsAuthenticatedOrReadOnly,
]
filter_backends = [
DjangoFilterBackend,
filters.SearchFilter,
filters.OrderingFilter,
]
filter_fields = [
'name',
'is_customer',
'is_supplier',
]
search_fields = [
'name',
'description',
]
ordering_fields = [
'name',
]
ordering = 'name'
+ class CompanyDetail(generics.RetrieveUpdateDestroyAPIView):
+
+ queryset = Company.objects.all()
+ serializer_class = CompanySerializer
+
+ permission_classes = [
+ permissions.IsAuthenticatedOrReadOnly,
+ ]
+
+
company_api_urls = [
+
+ url(r'^(?P<pk>\d+)/?', CompanyDetail.as_view(), name='api-company-detail'),
url(r'^.*$', CompanyList.as_view(), name='api-company-list'),
] | 12 | 0.25 | 12 | 0 |
2dcb362bd7d1927528887f9d71edf3158e523cc3 | app/views/datasets/_datasets.html.erb | app/views/datasets/_datasets.html.erb | <div class="row">
<% @datasets.each do |dataset| %>
<div class="col-xs-12 col-sm-6 col-md-4 ">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><%= link_to dataset.name, dataset %></h3>
</div>
<div class="panel-body">
<div style="text-align:center;background-color:white;padding-bottom:5px;height:145px;line-height:145px">
<% if dataset.logo.size > 0 %>
<%= link_to image_tag( logo_dataset_path(dataset), style: 'max-width:100%;' ), dataset %>
<% else %>
<%= link_to image_tag( 'project-default-logo.png', style: 'max-width:100%;' ), dataset %>
<% end %>
</div>
</div>
</div>
</div>
<% end %>
</div>
<div class="center"><%= paginate @datasets, theme: "contour" %></div>
| <div class="row">
<% @datasets.each do |dataset| %>
<div class="col-xs-12 col-sm-6 col-md-4 ">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><%= link_to dataset.name, dataset %></h3>
</div>
<div class="panel-body">
<div style="text-align:center;background-color:white;padding-bottom:5px;height:145px;line-height:145px">
<% if dataset.logo.size > 0 %>
<%= link_to image_tag( logo_dataset_path(dataset), style: 'max-width:100%;max-height:140px' ), dataset %>
<% else %>
<%= link_to image_tag( 'project-default-logo.png', style: 'max-width:100%;max-height:140px' ), dataset %>
<% end %>
</div>
</div>
</div>
</div>
<% end %>
</div>
<div class="center"><%= paginate @datasets, theme: "contour" %></div>
| Set max-width for dataset logos | Set max-width for dataset logos
| HTML+ERB | mit | nsrr/www.sleepdata.org,nsrr/www.sleepdata.org,nsrr/www.sleepdata.org | html+erb | ## Code Before:
<div class="row">
<% @datasets.each do |dataset| %>
<div class="col-xs-12 col-sm-6 col-md-4 ">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><%= link_to dataset.name, dataset %></h3>
</div>
<div class="panel-body">
<div style="text-align:center;background-color:white;padding-bottom:5px;height:145px;line-height:145px">
<% if dataset.logo.size > 0 %>
<%= link_to image_tag( logo_dataset_path(dataset), style: 'max-width:100%;' ), dataset %>
<% else %>
<%= link_to image_tag( 'project-default-logo.png', style: 'max-width:100%;' ), dataset %>
<% end %>
</div>
</div>
</div>
</div>
<% end %>
</div>
<div class="center"><%= paginate @datasets, theme: "contour" %></div>
## Instruction:
Set max-width for dataset logos
## Code After:
<div class="row">
<% @datasets.each do |dataset| %>
<div class="col-xs-12 col-sm-6 col-md-4 ">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><%= link_to dataset.name, dataset %></h3>
</div>
<div class="panel-body">
<div style="text-align:center;background-color:white;padding-bottom:5px;height:145px;line-height:145px">
<% if dataset.logo.size > 0 %>
<%= link_to image_tag( logo_dataset_path(dataset), style: 'max-width:100%;max-height:140px' ), dataset %>
<% else %>
<%= link_to image_tag( 'project-default-logo.png', style: 'max-width:100%;max-height:140px' ), dataset %>
<% end %>
</div>
</div>
</div>
</div>
<% end %>
</div>
<div class="center"><%= paginate @datasets, theme: "contour" %></div>
| <div class="row">
<% @datasets.each do |dataset| %>
<div class="col-xs-12 col-sm-6 col-md-4 ">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><%= link_to dataset.name, dataset %></h3>
</div>
<div class="panel-body">
<div style="text-align:center;background-color:white;padding-bottom:5px;height:145px;line-height:145px">
<% if dataset.logo.size > 0 %>
- <%= link_to image_tag( logo_dataset_path(dataset), style: 'max-width:100%;' ), dataset %>
+ <%= link_to image_tag( logo_dataset_path(dataset), style: 'max-width:100%;max-height:140px' ), dataset %>
? ++++++++++++++++
<% else %>
- <%= link_to image_tag( 'project-default-logo.png', style: 'max-width:100%;' ), dataset %>
+ <%= link_to image_tag( 'project-default-logo.png', style: 'max-width:100%;max-height:140px' ), dataset %>
? ++++++++++++++++
<% end %>
</div>
</div>
</div>
</div>
<% end %>
</div>
<div class="center"><%= paginate @datasets, theme: "contour" %></div> | 4 | 0.181818 | 2 | 2 |
fe51ae4423629bf348f19f34e3a3dd2d5f1c9d8f | test/fixtures/testScaled50PercentWithJs.html | test/fixtures/testScaled50PercentWithJs.html | <html>
<head>
<title>Test page with full resource includes, scaled and styling hidden behind hover/active selectors + JS</title>
<link rel="stylesheet" type="text/css" href="import_test.css"/>
<style type="text/css">
.test {
margin: 0;
padding: 0;
vertical-align: top;
}
div.test {
float: left;
width: 50px;
height: 50px;
}
.webfont {
font-size: 50px;
line-height: 50px;
}
</style>
</head>
<body class="test">
<div class="test">
<img class="test" src="green.png" width="50" height="50" alt="green image"/>
</div>
<script src="testWithJs.js"></script>
</body>
</html>
| <html>
<head>
<title>Test page with full resource includes, scaled and styling hidden behind hover/active selectors + JS</title>
<link rel="stylesheet" type="text/css" href="import_test.css"/>
<style type="text/css">
.test {
margin: 0;
padding: 0;
vertical-align: top;
}
div.test {
float: left;
width: 50px;
height: 50px;
}
.webfont {
font-size: 50px;
line-height: 50px;
}
html {
/* Force rendering on same line, esp. for Firefox on Linux */
width: 100px;
overflow: hidden;
}
</style>
</head>
<body class="test">
<div class="test">
<img class="test" src="green.png" width="50" height="50" alt="green image"/>
</div>
<script src="testWithJs.js"></script>
</body>
</html>
| Fix integration test under Linux | Fix integration test under Linux
| HTML | mit | cburgmer/rasterizeHTML.js,cburgmer/rasterizeHTML.js | html | ## Code Before:
<html>
<head>
<title>Test page with full resource includes, scaled and styling hidden behind hover/active selectors + JS</title>
<link rel="stylesheet" type="text/css" href="import_test.css"/>
<style type="text/css">
.test {
margin: 0;
padding: 0;
vertical-align: top;
}
div.test {
float: left;
width: 50px;
height: 50px;
}
.webfont {
font-size: 50px;
line-height: 50px;
}
</style>
</head>
<body class="test">
<div class="test">
<img class="test" src="green.png" width="50" height="50" alt="green image"/>
</div>
<script src="testWithJs.js"></script>
</body>
</html>
## Instruction:
Fix integration test under Linux
## Code After:
<html>
<head>
<title>Test page with full resource includes, scaled and styling hidden behind hover/active selectors + JS</title>
<link rel="stylesheet" type="text/css" href="import_test.css"/>
<style type="text/css">
.test {
margin: 0;
padding: 0;
vertical-align: top;
}
div.test {
float: left;
width: 50px;
height: 50px;
}
.webfont {
font-size: 50px;
line-height: 50px;
}
html {
/* Force rendering on same line, esp. for Firefox on Linux */
width: 100px;
overflow: hidden;
}
</style>
</head>
<body class="test">
<div class="test">
<img class="test" src="green.png" width="50" height="50" alt="green image"/>
</div>
<script src="testWithJs.js"></script>
</body>
</html>
| <html>
<head>
<title>Test page with full resource includes, scaled and styling hidden behind hover/active selectors + JS</title>
<link rel="stylesheet" type="text/css" href="import_test.css"/>
<style type="text/css">
.test {
margin: 0;
padding: 0;
vertical-align: top;
}
div.test {
float: left;
width: 50px;
height: 50px;
}
.webfont {
font-size: 50px;
line-height: 50px;
}
+ html {
+ /* Force rendering on same line, esp. for Firefox on Linux */
+ width: 100px;
+ overflow: hidden;
+ }
</style>
</head>
<body class="test">
<div class="test">
<img class="test" src="green.png" width="50" height="50" alt="green image"/>
</div>
<script src="testWithJs.js"></script>
</body>
</html> | 5 | 0.178571 | 5 | 0 |
5c020deef2ee09fe0abe00ad533fba9a2411dd4a | include/siri/grammar/gramp.h | include/siri/grammar/gramp.h | /*
* gramp.h - SiriDB Grammar Properties.
*
* Note: we need this file up-to-date with the grammar. The grammar has
* keywords starting with K_ so the will all be sorted.
* KW_OFFSET should be set to the first keyword and KW_COUNT needs the
* last keyword in the grammar.
*
*/
#ifndef SIRI_GRAMP_H_
#define SIRI_GRAMP_H_
#include <siri/grammar/grammar.h>
/* keywords */
#define KW_OFFSET CLERI_GID_K_ACCESS
#define KW_COUNT CLERI_GID_K_WRITE + 1 - KW_OFFSET
/* aggregation functions */
#define F_OFFSET CLERI_GID_F_COUNT
/* help statements */
#define HELP_OFFSET CLERI_GID_HELP_ACCESS
#define HELP_COUNT CLERI_GID_HELP_TIMEZONES + 1 - HELP_OFFSET
#if CLERI_VERSION_MINOR >= 12
#define CLERI_NODE_DATA(__node) ((intptr_t)(__node)->data)
#define CLERI_NODE_DATA_ADDR(__node) ((intptr_t *) &(__node)->data)
#else
#define CLERI_NODE_DATA(__node) ((intptr_t)(__node)->result)
#define CLERI_NODE_DATA_ADDR(__node) ((intptr_t *) &(__node)->result)
#endif
#endif /* SIRI_GRAMP_H_ */
| /*
* gramp.h - SiriDB Grammar Properties.
*
* Note: we need this file up-to-date with the grammar. The grammar has
* keywords starting with K_ so the will all be sorted.
* KW_OFFSET should be set to the first keyword and KW_COUNT needs the
* last keyword in the grammar.
*
*/
#ifndef SIRI_GRAMP_H_
#define SIRI_GRAMP_H_
#include <siri/grammar/grammar.h>
/* keywords */
#define KW_OFFSET CLERI_GID_K_ACCESS
#define KW_COUNT CLERI_GID_K_WRITE + 1 - KW_OFFSET
/* aggregation functions */
#define F_OFFSET CLERI_GID_F_COUNT
/* help statements */
#define HELP_OFFSET CLERI_GID_HELP_ACCESS
#define HELP_COUNT CLERI_GID_HELP_TIMEZONES + 1 - HELP_OFFSET
#if CLERI_VERSION_MINOR >= 12
#define CLERI_NODE_DATA(__node) ((intptr_t)(__node)->data)
#define CLERI_NODE_DATA_ADDR(__node) ((intptr_t *) &(__node)->data)
#else
#define CLERI_NODE_DATA(__node) (__node)->result
#define CLERI_NODE_DATA_ADDR(__node) &(__node)->result
#endif
#endif /* SIRI_GRAMP_H_ */
| Update compat with old libcleri | Update compat with old libcleri
| C | mit | transceptor-technology/siridb-server,transceptor-technology/siridb-server,transceptor-technology/siridb-server,transceptor-technology/siridb-server | c | ## Code Before:
/*
* gramp.h - SiriDB Grammar Properties.
*
* Note: we need this file up-to-date with the grammar. The grammar has
* keywords starting with K_ so the will all be sorted.
* KW_OFFSET should be set to the first keyword and KW_COUNT needs the
* last keyword in the grammar.
*
*/
#ifndef SIRI_GRAMP_H_
#define SIRI_GRAMP_H_
#include <siri/grammar/grammar.h>
/* keywords */
#define KW_OFFSET CLERI_GID_K_ACCESS
#define KW_COUNT CLERI_GID_K_WRITE + 1 - KW_OFFSET
/* aggregation functions */
#define F_OFFSET CLERI_GID_F_COUNT
/* help statements */
#define HELP_OFFSET CLERI_GID_HELP_ACCESS
#define HELP_COUNT CLERI_GID_HELP_TIMEZONES + 1 - HELP_OFFSET
#if CLERI_VERSION_MINOR >= 12
#define CLERI_NODE_DATA(__node) ((intptr_t)(__node)->data)
#define CLERI_NODE_DATA_ADDR(__node) ((intptr_t *) &(__node)->data)
#else
#define CLERI_NODE_DATA(__node) ((intptr_t)(__node)->result)
#define CLERI_NODE_DATA_ADDR(__node) ((intptr_t *) &(__node)->result)
#endif
#endif /* SIRI_GRAMP_H_ */
## Instruction:
Update compat with old libcleri
## Code After:
/*
* gramp.h - SiriDB Grammar Properties.
*
* Note: we need this file up-to-date with the grammar. The grammar has
* keywords starting with K_ so the will all be sorted.
* KW_OFFSET should be set to the first keyword and KW_COUNT needs the
* last keyword in the grammar.
*
*/
#ifndef SIRI_GRAMP_H_
#define SIRI_GRAMP_H_
#include <siri/grammar/grammar.h>
/* keywords */
#define KW_OFFSET CLERI_GID_K_ACCESS
#define KW_COUNT CLERI_GID_K_WRITE + 1 - KW_OFFSET
/* aggregation functions */
#define F_OFFSET CLERI_GID_F_COUNT
/* help statements */
#define HELP_OFFSET CLERI_GID_HELP_ACCESS
#define HELP_COUNT CLERI_GID_HELP_TIMEZONES + 1 - HELP_OFFSET
#if CLERI_VERSION_MINOR >= 12
#define CLERI_NODE_DATA(__node) ((intptr_t)(__node)->data)
#define CLERI_NODE_DATA_ADDR(__node) ((intptr_t *) &(__node)->data)
#else
#define CLERI_NODE_DATA(__node) (__node)->result
#define CLERI_NODE_DATA_ADDR(__node) &(__node)->result
#endif
#endif /* SIRI_GRAMP_H_ */
| /*
* gramp.h - SiriDB Grammar Properties.
*
* Note: we need this file up-to-date with the grammar. The grammar has
* keywords starting with K_ so the will all be sorted.
* KW_OFFSET should be set to the first keyword and KW_COUNT needs the
* last keyword in the grammar.
*
*/
#ifndef SIRI_GRAMP_H_
#define SIRI_GRAMP_H_
#include <siri/grammar/grammar.h>
/* keywords */
#define KW_OFFSET CLERI_GID_K_ACCESS
#define KW_COUNT CLERI_GID_K_WRITE + 1 - KW_OFFSET
/* aggregation functions */
#define F_OFFSET CLERI_GID_F_COUNT
/* help statements */
#define HELP_OFFSET CLERI_GID_HELP_ACCESS
#define HELP_COUNT CLERI_GID_HELP_TIMEZONES + 1 - HELP_OFFSET
#if CLERI_VERSION_MINOR >= 12
#define CLERI_NODE_DATA(__node) ((intptr_t)(__node)->data)
#define CLERI_NODE_DATA_ADDR(__node) ((intptr_t *) &(__node)->data)
#else
- #define CLERI_NODE_DATA(__node) ((intptr_t)(__node)->result)
? ----------- -
+ #define CLERI_NODE_DATA(__node) (__node)->result
- #define CLERI_NODE_DATA_ADDR(__node) ((intptr_t *) &(__node)->result)
? -------------- -
+ #define CLERI_NODE_DATA_ADDR(__node) &(__node)->result
#endif
#endif /* SIRI_GRAMP_H_ */ | 4 | 0.111111 | 2 | 2 |
6f9f68f8c376205d753ab92095bb89052620e67e | .travis.yml | .travis.yml | language: node_js
node_js:
- '9'
- '8'
- '7'
- '6'
- '5'
- '4'
- '0.12'
- '0.10'
notifications:
email:
- watson@elastic.co
slack:
rooms:
secure: PR+vjohDfGmidHhaIboj896iad3OIa4pked1Mib+XB5FF3tWfpDjBBNmEBizRbpwzxy4oHgOr22LBNvi+zkE674wXY3VUM+Wx9pJztlqotcON/hBjcJd993MfixRHN0RShxn4omaLfiqrZ+8iUFD5MQKdLKqBG/IG2toxdhuDkU=
on_success: change
on_failure: change
on_pull_requests: false
| language: node_js
node_js:
- '9'
- '8'
- '7'
- '6'
- '5'
- '4'
notifications:
email:
- watson@elastic.co
slack:
rooms:
secure: PR+vjohDfGmidHhaIboj896iad3OIa4pked1Mib+XB5FF3tWfpDjBBNmEBizRbpwzxy4oHgOr22LBNvi+zkE674wXY3VUM+Wx9pJztlqotcON/hBjcJd993MfixRHN0RShxn4omaLfiqrZ+8iUFD5MQKdLKqBG/IG2toxdhuDkU=
on_success: change
on_failure: change
on_pull_requests: false
| Drop support for Node.js <4 | Drop support for Node.js <4
For now it technically still works with earlier versions of Node.js, but
since we now stop testing on those versions, we shouldn't rely on it.
| YAML | mit | watson/opbeat-http-client | yaml | ## Code Before:
language: node_js
node_js:
- '9'
- '8'
- '7'
- '6'
- '5'
- '4'
- '0.12'
- '0.10'
notifications:
email:
- watson@elastic.co
slack:
rooms:
secure: PR+vjohDfGmidHhaIboj896iad3OIa4pked1Mib+XB5FF3tWfpDjBBNmEBizRbpwzxy4oHgOr22LBNvi+zkE674wXY3VUM+Wx9pJztlqotcON/hBjcJd993MfixRHN0RShxn4omaLfiqrZ+8iUFD5MQKdLKqBG/IG2toxdhuDkU=
on_success: change
on_failure: change
on_pull_requests: false
## Instruction:
Drop support for Node.js <4
For now it technically still works with earlier versions of Node.js, but
since we now stop testing on those versions, we shouldn't rely on it.
## Code After:
language: node_js
node_js:
- '9'
- '8'
- '7'
- '6'
- '5'
- '4'
notifications:
email:
- watson@elastic.co
slack:
rooms:
secure: PR+vjohDfGmidHhaIboj896iad3OIa4pked1Mib+XB5FF3tWfpDjBBNmEBizRbpwzxy4oHgOr22LBNvi+zkE674wXY3VUM+Wx9pJztlqotcON/hBjcJd993MfixRHN0RShxn4omaLfiqrZ+8iUFD5MQKdLKqBG/IG2toxdhuDkU=
on_success: change
on_failure: change
on_pull_requests: false
| language: node_js
node_js:
- '9'
- '8'
- '7'
- '6'
- '5'
- '4'
- - '0.12'
- - '0.10'
notifications:
email:
- watson@elastic.co
slack:
rooms:
secure: PR+vjohDfGmidHhaIboj896iad3OIa4pked1Mib+XB5FF3tWfpDjBBNmEBizRbpwzxy4oHgOr22LBNvi+zkE674wXY3VUM+Wx9pJztlqotcON/hBjcJd993MfixRHN0RShxn4omaLfiqrZ+8iUFD5MQKdLKqBG/IG2toxdhuDkU=
on_success: change
on_failure: change
on_pull_requests: false | 2 | 0.105263 | 0 | 2 |
40159197ece0fe66411da62abec34ea780cdab45 | app/views/pages/about.html.haml | app/views/pages/about.html.haml | %h1 About Us
%p
Larp Library was made by #{mail_to "natbudin@gmail.com", "Nat Budin"} and is a project of
#{link_to "New England Interactive Literature", "http://interactiveliterature.org"}.
%p
Larp Library is a Ruby on Rails application. The source code for the app is available
#{link_to "on Github", "https://github.com/neinteractiveliterature/larp_library"}. | %h1 About Us
%ul.list-unstyled
%li
%strong Lead Developer:
Nat Budin (natbudin AT gmail DOT com)
%li
%strong Curator:
Eva Schiffer (valleyviolet AT gmail DOT com)
%li
A project of
#{link_to "New England Interactive Literature", "http://interactiveliterature.org"}.
%p
Larp Library is a Ruby on Rails application. The source code for the app is available
#{link_to "on Github", "https://github.com/neinteractiveliterature/larp_library"}. | Add Eva to the About page | Add Eva to the About page
| Haml | mit | neinteractiveliterature/larp_library,nbudin/larp_library,neinteractiveliterature/larp_library,neinteractiveliterature/larp_library,neinteractiveliterature/larp_library,neinteractiveliterature/larp_library,nbudin/larp_library | haml | ## Code Before:
%h1 About Us
%p
Larp Library was made by #{mail_to "natbudin@gmail.com", "Nat Budin"} and is a project of
#{link_to "New England Interactive Literature", "http://interactiveliterature.org"}.
%p
Larp Library is a Ruby on Rails application. The source code for the app is available
#{link_to "on Github", "https://github.com/neinteractiveliterature/larp_library"}.
## Instruction:
Add Eva to the About page
## Code After:
%h1 About Us
%ul.list-unstyled
%li
%strong Lead Developer:
Nat Budin (natbudin AT gmail DOT com)
%li
%strong Curator:
Eva Schiffer (valleyviolet AT gmail DOT com)
%li
A project of
#{link_to "New England Interactive Literature", "http://interactiveliterature.org"}.
%p
Larp Library is a Ruby on Rails application. The source code for the app is available
#{link_to "on Github", "https://github.com/neinteractiveliterature/larp_library"}. | %h1 About Us
- %p
- Larp Library was made by #{mail_to "natbudin@gmail.com", "Nat Budin"} and is a project of
+ %ul.list-unstyled
+ %li
+ %strong Lead Developer:
+ Nat Budin (natbudin AT gmail DOT com)
+ %li
+ %strong Curator:
+ Eva Schiffer (valleyviolet AT gmail DOT com)
+ %li
+ A project of
- #{link_to "New England Interactive Literature", "http://interactiveliterature.org"}.
+ #{link_to "New England Interactive Literature", "http://interactiveliterature.org"}.
? ++
-
+
%p
Larp Library is a Ruby on Rails application. The source code for the app is available
#{link_to "on Github", "https://github.com/neinteractiveliterature/larp_library"}. | 15 | 1.666667 | 11 | 4 |
5b32fda4b8698deda5402b8c640d36bf5cd69222 | app/helpers/labels_helper.rb | app/helpers/labels_helper.rb | module LabelsHelper
def project_label_names
@project.labels.pluck(:title)
end
def render_colored_label(label)
label_color = label.color || Label::DEFAULT_COLOR
text_color = text_color_for_bg(label_color)
content_tag :span, class: 'label color-label', style: "background:#{label_color};color:#{text_color}" do
label.name
end
end
def suggested_colors
[
'#D9534F',
'#F0AD4E',
'#428BCA',
'#5CB85C',
'#34495E',
'#7F8C8D',
'#8E44AD',
'#FFECDB'
]
end
def text_color_for_bg(bg_color)
r, g, b = bg_color.slice(1,7).scan(/.{2}/).map(&:hex)
if (r + g + b) > 500
"#333"
else
"#FFF"
end
end
end
| module LabelsHelper
def project_label_names
@project.labels.pluck(:title)
end
def render_colored_label(label)
label_color = label.color || Label::DEFAULT_COLOR
text_color = text_color_for_bg(label_color)
content_tag :span, class: 'label color-label', style: "background:#{label_color};color:#{text_color}" do
label.name
end
end
def suggested_colors
[
'#CC0033',
'#FF0000',
'#D9534F',
'#D1D100',
'#F0AD4E',
'#AD8D43',
'#0033CC',
'#428BCA',
'#44AD8E',
'#A8D695',
'#5CB85C',
'#69D100',
'#004E00',
'#34495E',
'#7F8C8D',
'#A295D6',
'#5843AD',
'#8E44AD',
'#AD4363',
'#FFECDB',
'#D10069'
]
end
def text_color_for_bg(bg_color)
r, g, b = bg_color.slice(1,7).scan(/.{2}/).map(&:hex)
if (r + g + b) > 500
"#333"
else
"#FFF"
end
end
end
| Add more label color suggestions | Add more label color suggestions
| Ruby | mit | allysonbarros/gitlabhq,szechyjs/gitlabhq,hzy001/gitlabhq,pjknkda/gitlabhq,bozaro/gitlabhq,allistera/gitlabhq,ferdinandrosario/gitlabhq,delkyd/gitlabhq,jirutka/gitlabhq,manfer/gitlabhq,flashbuckets/gitlabhq,bozaro/gitlabhq,liyakun/gitlabhq,zBMNForks/gitlabhq,Telekom-PD/gitlabhq,gorgee/gitlabhq,nmav/gitlabhq,Soullivaneuh/gitlabhq,tim-hoff/gitlabhq,martijnvermaat/gitlabhq,hq804116393/gitlabhq,stanhu/gitlabhq,OlegGirko/gitlab-ce,hq804116393/gitlabhq,ttasanen/gitlabhq,Datacom/gitlabhq,icedwater/gitlabhq,Devin001/gitlabhq,michaKFromParis/gitlabhqold,eliasp/gitlabhq,tk23/gitlabhq,tim-hoff/gitlabhq,OtkurBiz/gitlabhq,larryli/gitlabhq,youprofit/gitlabhq,NKMR6194/gitlabhq,sekcheong/gitlabhq,cui-liqiang/gitlab-ce,sue445/gitlabhq,mmkassem/gitlabhq,fgbreel/gitlabhq,ayufan/gitlabhq,fpgentil/gitlabhq,lvfeng1130/gitlabhq,whluwit/gitlabhq,daiyu/gitlab-zh,fendoudeqingchunhh/gitlabhq,fgbreel/gitlabhq,julianengel/gitlabhq,ikappas/gitlabhq,Soullivaneuh/gitlabhq,martinma4/gitlabhq,jrjang/gitlab-ce,duduribeiro/gitlabhq,tim-hoff/gitlabhq,folpindo/gitlabhq,dplarson/gitlabhq,bigsurge/gitlabhq,dvrylc/gitlabhq,rebecamendez/gitlabhq,julianengel/gitlabhq,t-zuehlsdorff/gitlabhq,allysonbarros/gitlabhq,hacsoc/gitlabhq,ikappas/gitlabhq,sonalkr132/gitlabhq,dplarson/gitlabhq,liyakun/gitlabhq,bbodenmiller/gitlabhq,fearenales/gitlabhq,kemenaran/gitlabhq,sekcheong/gitlabhq,vjustov/gitlabhq,mente/gitlabhq,SVArago/gitlabhq,joalmeid/gitlabhq,childbamboo/gitlabhq,yonglehou/gitlabhq,sekcheong/gitlabhq,initiummedia/gitlabhq,jrjang/gitlab-ce,chadyred/gitlabhq,yonglehou/gitlabhq,mmkassem/gitlabhq,pulkit21/gitlabhq,bbodenmiller/gitlabhq,Telekom-PD/gitlabhq,martijnvermaat/gitlabhq,luzhongyang/gitlabhq,cinderblock/gitlabhq,fpgentil/gitlabhq,larryli/gitlabhq,adaiguoguo/gitlab_globalserarch,fscherwi/gitlabhq,folpindo/gitlabhq,zBMNForks/gitlabhq,yuyue2013/ss,DanielZhangQingLong/gitlabhq,icedwater/gitlabhq,iiet/iiet-git,duduribeiro/gitlabhq,ikappas/gitlabhq,martijnvermaat/gitlabhq,sakishum/gitlabhq,cncodog/gitlab,allistera/gitlabhq,fpgentil/gitlabhq,jvanbaarsen/gitlabhq,Burick/gitlabhq,kitech/gitlabhq,zrbsprite/gitlabhq,chadyred/gitlabhq,koreamic/gitlabhq,TheWatcher/gitlabhq,Razer6/gitlabhq,darkrasid/gitlabhq,fendoudeqingchunhh/gitlabhq,sonalkr132/gitlabhq,joalmeid/gitlabhq,jaepyoung/gitlabhq,mr-dxdy/gitlabhq,adaiguoguo/gitlab_globalserarch,yfaizal/gitlabhq,rebecamendez/gitlabhq,rebecamendez/gitlabhq,mathstuf/gitlabhq,copystudy/gitlabhq,michaKFromParis/sparkslab,H3Chief/gitlabhq,wangcan2014/gitlabhq,dreampet/gitlab,kitech/gitlabhq,jirutka/gitlabhq,lvfeng1130/gitlabhq,axilleas/gitlabhq,martinma4/gitlabhq,salipro4ever/gitlabhq,ksoichiro/gitlabhq,jrjang/gitlabhq,joalmeid/gitlabhq,luzhongyang/gitlabhq,cinderblock/gitlabhq,copystudy/gitlabhq,pjknkda/gitlabhq,daiyu/gitlab-zh,ksoichiro/gitlabhq,initiummedia/gitlabhq,dwrensha/gitlabhq,szechyjs/gitlabhq,szechyjs/gitlabhq,williamherry/gitlabhq,sue445/gitlabhq,pulkit21/gitlabhq,liyakun/gitlabhq,mmkassem/gitlabhq,revaret/gitlabhq,tk23/gitlabhq,Burick/gitlabhq,michaKFromParis/gitlabhqold,yatish27/gitlabhq,openwide-java/gitlabhq,NKMR6194/gitlabhq,jrjang/gitlab-ce,openwide-java/gitlabhq,Datacom/gitlabhq,delkyd/gitlabhq,wangcan2014/gitlabhq,williamherry/gitlabhq,gopeter/gitlabhq,darkrasid/gitlabhq,dplarson/gitlabhq,bozaro/gitlabhq,nmav/gitlabhq,manfer/gitlabhq,hacsoc/gitlabhq,nguyen-tien-mulodo/gitlabhq,chadyred/gitlabhq,bozaro/gitlabhq,OlegGirko/gitlab-ce,hq804116393/gitlabhq,dreampet/gitlab,bbodenmiller/gitlabhq,yuyue2013/ss,htve/GitlabForChinese,OtkurBiz/gitlabhq,per-garden/gitlabhq,mrb/gitlabhq,wangcan2014/gitlabhq,mrb/gitlabhq,adaiguoguo/gitlab_globalserarch,mrb/gitlabhq,louahola/gitlabhq,dukex/gitlabhq,LUMC/gitlabhq,stanhu/gitlabhq,luzhongyang/gitlabhq,it33/gitlabhq,louahola/gitlabhq,ferdinandrosario/gitlabhq,lvfeng1130/gitlabhq,zrbsprite/gitlabhq,since2014/gitlabhq,OtkurBiz/gitlabhq,dwrensha/gitlabhq,mavimo/gitlabhq,kemenaran/gitlabhq,yuyue2013/ss,youprofit/gitlabhq,LUMC/gitlabhq,Telekom-PD/gitlabhq,aaronsnyder/gitlabhq,mmkassem/gitlabhq,ordiychen/gitlabhq,szechyjs/gitlabhq,theonlydoo/gitlabhq,Devin001/gitlabhq,pulkit21/gitlabhq,revaret/gitlabhq,Tyrael/gitlabhq,allysonbarros/gitlabhq,k4zzk/gitlabhq,rebecamendez/gitlabhq,ngpestelos/gitlabhq,joalmeid/gitlabhq,NARKOZ/gitlabhq,icedwater/gitlabhq,Tyrael/gitlabhq,hacsoc/gitlabhq,tempbottle/gitlabhq,vjustov/gitlabhq,nguyen-tien-mulodo/gitlabhq,Devin001/gitlabhq,aaronsnyder/gitlabhq,youprofit/gitlabhq,jvanbaarsen/gitlabhq,Razer6/gitlabhq,openwide-java/gitlabhq,tim-hoff/gitlabhq,Exeia/gitlabhq,salipro4ever/gitlabhq,ayufan/gitlabhq,MauriceMohlek/gitlabhq,theonlydoo/gitlabhq,ferdinandrosario/gitlabhq,jrjang/gitlab-ce,gorgee/gitlabhq,jvanbaarsen/gitlabhq,johnmyqin/gitlabhq,yuyue2013/ss,SkyWei/gitlabhq,dvrylc/gitlabhq,eliasp/gitlabhq,sonalkr132/gitlabhq,DanielZhangQingLong/gitlabhq,ksoichiro/gitlabhq,liyakun/gitlabhq,shinexiao/gitlabhq,stoplightio/gitlabhq,ayufan/gitlabhq,nguyen-tien-mulodo/gitlabhq,tempbottle/gitlabhq,sakishum/gitlabhq,rumpelsepp/gitlabhq,yfaizal/gitlabhq,chenrui2014/gitlabhq,fendoudeqingchunhh/gitlabhq,fscherwi/gitlabhq,yonglehou/gitlabhq,koreamic/gitlabhq,WSDC-NITWarangal/gitlabhq,theonlydoo/gitlabhq,martinma4/gitlabhq,NARKOZ/gitlabhq,stanhu/gitlabhq,ferdinandrosario/gitlabhq,theonlydoo/gitlabhq,dwrensha/gitlabhq,jrjang/gitlabhq,MauriceMohlek/gitlabhq,SkyWei/gitlabhq,jvanbaarsen/gitlabhq,julianengel/gitlabhq,duduribeiro/gitlabhq,sakishum/gitlabhq,sue445/gitlabhq,johnmyqin/gitlabhq,kemenaran/gitlabhq,LUMC/gitlabhq,iiet/iiet-git,k4zzk/gitlabhq,iiet/iiet-git,mathstuf/gitlabhq,SVArago/gitlabhq,H3Chief/gitlabhq,hq804116393/gitlabhq,ttasanen/gitlabhq,ngpestelos/gitlabhq,LytayTOUCH/gitlabhq,theodi/gitlabhq,michaKFromParis/gitlabhq,LytayTOUCH/gitlabhq,aaronsnyder/gitlabhq,screenpages/gitlabhq,DanielZhangQingLong/gitlabhq,pulkit21/gitlabhq,flashbuckets/gitlabhq,hzy001/gitlabhq,aaronsnyder/gitlabhq,NARKOZ/gitlabhq,flashbuckets/gitlabhq,ttasanen/gitlabhq,tk23/gitlabhq,fscherwi/gitlabhq,ordiychen/gitlabhq,ordiychen/gitlabhq,OlegGirko/gitlab-ce,per-garden/gitlabhq,whluwit/gitlabhq,yatish27/gitlabhq,since2014/gitlabhq,LytayTOUCH/gitlabhq,williamherry/gitlabhq,theodi/gitlabhq,rhels/gitlabhq,copystudy/gitlabhq,stoplightio/gitlabhq,mente/gitlabhq,rumpelsepp/gitlabhq,fearenales/gitlabhq,DanielZhangQingLong/gitlabhq,axilleas/gitlabhq,k4zzk/gitlabhq,chenrui2014/gitlabhq,sekcheong/gitlabhq,it33/gitlabhq,fearenales/gitlabhq,dukex/gitlabhq,t-zuehlsdorff/gitlabhq,shinexiao/gitlabhq,whluwit/gitlabhq,rhels/gitlabhq,sonalkr132/gitlabhq,eliasp/gitlabhq,cinderblock/gitlabhq,fantasywind/gitlabhq,screenpages/gitlabhq,michaKFromParis/sparkslab,pjknkda/gitlabhq,larryli/gitlabhq,since2014/gitlabhq,johnmyqin/gitlabhq,cncodog/gitlab,michaKFromParis/gitlabhqold,stoplightio/gitlabhq,rumpelsepp/gitlabhq,initiummedia/gitlabhq,fantasywind/gitlabhq,yama07/gitlabhq,Soullivaneuh/gitlabhq,fantasywind/gitlabhq,axilleas/gitlabhq,louahola/gitlabhq,manfer/gitlabhq,gopeter/gitlabhq,ngpestelos/gitlabhq,vjustov/gitlabhq,Exeia/gitlabhq,michaKFromParis/gitlabhq,rhels/gitlabhq,adaiguoguo/gitlab_globalserarch,martinma4/gitlabhq,folpindo/gitlabhq,eliasp/gitlabhq,vjustov/gitlabhq,luzhongyang/gitlabhq,gorgee/gitlabhq,Exeia/gitlabhq,dukex/gitlabhq,it33/gitlabhq,jirutka/gitlabhq,mathstuf/gitlabhq,WSDC-NITWarangal/gitlabhq,yfaizal/gitlabhq,cui-liqiang/gitlab-ce,dwrensha/gitlabhq,screenpages/gitlabhq,gopeter/gitlabhq,yfaizal/gitlabhq,childbamboo/gitlabhq,theodi/gitlabhq,larryli/gitlabhq,allistera/gitlabhq,jaepyoung/gitlabhq,Razer6/gitlabhq,cui-liqiang/gitlab-ce,LUMC/gitlabhq,Razer6/gitlabhq,cncodog/gitlab,initiummedia/gitlabhq,jaepyoung/gitlabhq,zrbsprite/gitlabhq,fscherwi/gitlabhq,pjknkda/gitlabhq,copystudy/gitlabhq,ngpestelos/gitlabhq,martijnvermaat/gitlabhq,fgbreel/gitlabhq,ikappas/gitlabhq,kitech/gitlabhq,Burick/gitlabhq,NKMR6194/gitlabhq,stoplightio/gitlabhq,childbamboo/gitlabhq,youprofit/gitlabhq,dukex/gitlabhq,bigsurge/gitlabhq,williamherry/gitlabhq,louahola/gitlabhq,ksoichiro/gitlabhq,nguyen-tien-mulodo/gitlabhq,Devin001/gitlabhq,childbamboo/gitlabhq,yatish27/gitlabhq,stanhu/gitlabhq,chenrui2014/gitlabhq,SkyWei/gitlabhq,cui-liqiang/gitlab-ce,dplarson/gitlabhq,fpgentil/gitlabhq,yama07/gitlabhq,ttasanen/gitlabhq,jirutka/gitlabhq,mavimo/gitlabhq,htve/GitlabForChinese,shinexiao/gitlabhq,folpindo/gitlabhq,icedwater/gitlabhq,hacsoc/gitlabhq,per-garden/gitlabhq,michaKFromParis/gitlabhq,SkyWei/gitlabhq,shinexiao/gitlabhq,yonglehou/gitlabhq,SVArago/gitlabhq,chenrui2014/gitlabhq,Tyrael/gitlabhq,mavimo/gitlabhq,dreampet/gitlab,gopeter/gitlabhq,yama07/gitlabhq,NKMR6194/gitlabhq,ordiychen/gitlabhq,michaKFromParis/gitlabhq,mathstuf/gitlabhq,salipro4ever/gitlabhq,tk23/gitlabhq,kitech/gitlabhq,sakishum/gitlabhq,mente/gitlabhq,TheWatcher/gitlabhq,tempbottle/gitlabhq,allysonbarros/gitlabhq,t-zuehlsdorff/gitlabhq,nmav/gitlabhq,gorgee/gitlabhq,LytayTOUCH/gitlabhq,dreampet/gitlab,revaret/gitlabhq,TheWatcher/gitlabhq,ayufan/gitlabhq,hzy001/gitlabhq,mrb/gitlabhq,TheWatcher/gitlabhq,NARKOZ/gitlabhq,openwide-java/gitlabhq,SVArago/gitlabhq,Telekom-PD/gitlabhq,OlegGirko/gitlab-ce,kemenaran/gitlabhq,mente/gitlabhq,michaKFromParis/sparkslab,chadyred/gitlabhq,since2014/gitlabhq,manfer/gitlabhq,it33/gitlabhq,duduribeiro/gitlabhq,zrbsprite/gitlabhq,delkyd/gitlabhq,michaKFromParis/sparkslab,Burick/gitlabhq,daiyu/gitlab-zh,lvfeng1130/gitlabhq,darkrasid/gitlabhq,bigsurge/gitlabhq,sue445/gitlabhq,rhels/gitlabhq,koreamic/gitlabhq,fantasywind/gitlabhq,jaepyoung/gitlabhq,mavimo/gitlabhq,mr-dxdy/gitlabhq,whluwit/gitlabhq,dvrylc/gitlabhq,Soullivaneuh/gitlabhq,htve/GitlabForChinese,fgbreel/gitlabhq,koreamic/gitlabhq,dvrylc/gitlabhq,jrjang/gitlabhq,nmav/gitlabhq,michaKFromParis/gitlabhqold,yatish27/gitlabhq,yama07/gitlabhq,mr-dxdy/gitlabhq,Exeia/gitlabhq,iiet/iiet-git,per-garden/gitlabhq,Datacom/gitlabhq,Tyrael/gitlabhq,cncodog/gitlab,zBMNForks/gitlabhq,flashbuckets/gitlabhq,Datacom/gitlabhq,htve/GitlabForChinese,fendoudeqingchunhh/gitlabhq,tempbottle/gitlabhq,bigsurge/gitlabhq,zBMNForks/gitlabhq,WSDC-NITWarangal/gitlabhq,johnmyqin/gitlabhq,OtkurBiz/gitlabhq,k4zzk/gitlabhq,julianengel/gitlabhq,mr-dxdy/gitlabhq,revaret/gitlabhq,screenpages/gitlabhq,hzy001/gitlabhq,jrjang/gitlabhq,darkrasid/gitlabhq,delkyd/gitlabhq,theodi/gitlabhq,WSDC-NITWarangal/gitlabhq,allistera/gitlabhq,rumpelsepp/gitlabhq,bbodenmiller/gitlabhq,MauriceMohlek/gitlabhq,daiyu/gitlab-zh,salipro4ever/gitlabhq,wangcan2014/gitlabhq,H3Chief/gitlabhq,axilleas/gitlabhq,fearenales/gitlabhq,H3Chief/gitlabhq,MauriceMohlek/gitlabhq,cinderblock/gitlabhq,t-zuehlsdorff/gitlabhq | ruby | ## Code Before:
module LabelsHelper
def project_label_names
@project.labels.pluck(:title)
end
def render_colored_label(label)
label_color = label.color || Label::DEFAULT_COLOR
text_color = text_color_for_bg(label_color)
content_tag :span, class: 'label color-label', style: "background:#{label_color};color:#{text_color}" do
label.name
end
end
def suggested_colors
[
'#D9534F',
'#F0AD4E',
'#428BCA',
'#5CB85C',
'#34495E',
'#7F8C8D',
'#8E44AD',
'#FFECDB'
]
end
def text_color_for_bg(bg_color)
r, g, b = bg_color.slice(1,7).scan(/.{2}/).map(&:hex)
if (r + g + b) > 500
"#333"
else
"#FFF"
end
end
end
## Instruction:
Add more label color suggestions
## Code After:
module LabelsHelper
def project_label_names
@project.labels.pluck(:title)
end
def render_colored_label(label)
label_color = label.color || Label::DEFAULT_COLOR
text_color = text_color_for_bg(label_color)
content_tag :span, class: 'label color-label', style: "background:#{label_color};color:#{text_color}" do
label.name
end
end
def suggested_colors
[
'#CC0033',
'#FF0000',
'#D9534F',
'#D1D100',
'#F0AD4E',
'#AD8D43',
'#0033CC',
'#428BCA',
'#44AD8E',
'#A8D695',
'#5CB85C',
'#69D100',
'#004E00',
'#34495E',
'#7F8C8D',
'#A295D6',
'#5843AD',
'#8E44AD',
'#AD4363',
'#FFECDB',
'#D10069'
]
end
def text_color_for_bg(bg_color)
r, g, b = bg_color.slice(1,7).scan(/.{2}/).map(&:hex)
if (r + g + b) > 500
"#333"
else
"#FFF"
end
end
end
| module LabelsHelper
def project_label_names
@project.labels.pluck(:title)
end
def render_colored_label(label)
label_color = label.color || Label::DEFAULT_COLOR
text_color = text_color_for_bg(label_color)
content_tag :span, class: 'label color-label', style: "background:#{label_color};color:#{text_color}" do
label.name
end
end
def suggested_colors
[
+ '#CC0033',
+ '#FF0000',
'#D9534F',
+ '#D1D100',
'#F0AD4E',
+ '#AD8D43',
+ '#0033CC',
'#428BCA',
+ '#44AD8E',
+ '#A8D695',
'#5CB85C',
+ '#69D100',
+ '#004E00',
'#34495E',
'#7F8C8D',
+ '#A295D6',
+ '#5843AD',
'#8E44AD',
+ '#AD4363',
- '#FFECDB'
+ '#FFECDB',
? +
+ '#D10069'
]
end
def text_color_for_bg(bg_color)
r, g, b = bg_color.slice(1,7).scan(/.{2}/).map(&:hex)
if (r + g + b) > 500
"#333"
else
"#FFF"
end
end
end | 15 | 0.405405 | 14 | 1 |
c56eb8e8c3ea46bd777cf2cd7675c5eb675df161 | configuration.js | configuration.js | var nconf = require('nconf');
var scheConf = new nconf.Provider();
var mainConf = new nconf.Provider();
var optConf = new nconf.Provider();
var name2Conf = {"sche" : scheConf, "main": mainConf, "opt": optConf};
scheConf.file({file: './app/schedules.json'});
mainConf.file({file: './app/schools.json'});
optConf.file({file: './app/options.json'});
function saveSettings(settingKey, settingValue, file) {
var conf = name2Conf[file];
conf.set(settingKey, settingValue);
conf.save();
}
function readSettings(settingKey, file) {
var conf = name2Conf[file];
conf.load();
return conf.get(settingKey);
}
function getSettings(file) {
var conf = name2Conf[file];
conf.load();
return conf.get();
}
function clearSetting(key, file) {
var conf = name2Conf[file];
conf.load();
conf.clear(key);
conf.save();
}
module.exports = {
saveSettings: saveSettings,
readSettings: readSettings,
getSettings: getSettings,
clearSetting: clearSetting
};
| var nconf = require('nconf');
var scheConf = new nconf.Provider();
var mainConf = new nconf.Provider();
var optConf = new nconf.Provider();
var name2Conf = {"sche" : scheConf, "main": mainConf, "opt": optConf};
scheConf.file({file: __dirname + '/app/schedules.json'});
mainConf.file({file: __dirname + '/app/schools.json'});
optConf.file({file: __dirname + '/app/options.json'});
function saveSettings(settingKey, settingValue, file) {
var conf = name2Conf[file];
conf.set(settingKey, settingValue);
conf.save();
}
function readSettings(settingKey, file) {
var conf = name2Conf[file];
conf.load();
return conf.get(settingKey);
}
function getSettings(file) {
var conf = name2Conf[file];
conf.load();
return conf.get();
}
function clearSetting(key, file) {
var conf = name2Conf[file];
conf.load();
conf.clear(key);
conf.save();
}
module.exports = {
saveSettings: saveSettings,
readSettings: readSettings,
getSettings: getSettings,
clearSetting: clearSetting
};
| Make .json config paths relative | Make .json config paths relative
| JavaScript | mit | jdkato/scheduler,jdkato/scheduler | javascript | ## Code Before:
var nconf = require('nconf');
var scheConf = new nconf.Provider();
var mainConf = new nconf.Provider();
var optConf = new nconf.Provider();
var name2Conf = {"sche" : scheConf, "main": mainConf, "opt": optConf};
scheConf.file({file: './app/schedules.json'});
mainConf.file({file: './app/schools.json'});
optConf.file({file: './app/options.json'});
function saveSettings(settingKey, settingValue, file) {
var conf = name2Conf[file];
conf.set(settingKey, settingValue);
conf.save();
}
function readSettings(settingKey, file) {
var conf = name2Conf[file];
conf.load();
return conf.get(settingKey);
}
function getSettings(file) {
var conf = name2Conf[file];
conf.load();
return conf.get();
}
function clearSetting(key, file) {
var conf = name2Conf[file];
conf.load();
conf.clear(key);
conf.save();
}
module.exports = {
saveSettings: saveSettings,
readSettings: readSettings,
getSettings: getSettings,
clearSetting: clearSetting
};
## Instruction:
Make .json config paths relative
## Code After:
var nconf = require('nconf');
var scheConf = new nconf.Provider();
var mainConf = new nconf.Provider();
var optConf = new nconf.Provider();
var name2Conf = {"sche" : scheConf, "main": mainConf, "opt": optConf};
scheConf.file({file: __dirname + '/app/schedules.json'});
mainConf.file({file: __dirname + '/app/schools.json'});
optConf.file({file: __dirname + '/app/options.json'});
function saveSettings(settingKey, settingValue, file) {
var conf = name2Conf[file];
conf.set(settingKey, settingValue);
conf.save();
}
function readSettings(settingKey, file) {
var conf = name2Conf[file];
conf.load();
return conf.get(settingKey);
}
function getSettings(file) {
var conf = name2Conf[file];
conf.load();
return conf.get();
}
function clearSetting(key, file) {
var conf = name2Conf[file];
conf.load();
conf.clear(key);
conf.save();
}
module.exports = {
saveSettings: saveSettings,
readSettings: readSettings,
getSettings: getSettings,
clearSetting: clearSetting
};
| var nconf = require('nconf');
var scheConf = new nconf.Provider();
var mainConf = new nconf.Provider();
var optConf = new nconf.Provider();
var name2Conf = {"sche" : scheConf, "main": mainConf, "opt": optConf};
+
- scheConf.file({file: './app/schedules.json'});
? -
+ scheConf.file({file: __dirname + '/app/schedules.json'});
? ++++++++++++
- mainConf.file({file: './app/schools.json'});
? -
+ mainConf.file({file: __dirname + '/app/schools.json'});
? ++++++++++++
- optConf.file({file: './app/options.json'});
? -
+ optConf.file({file: __dirname + '/app/options.json'});
? ++++++++++++
function saveSettings(settingKey, settingValue, file) {
var conf = name2Conf[file];
conf.set(settingKey, settingValue);
conf.save();
}
function readSettings(settingKey, file) {
var conf = name2Conf[file];
conf.load();
return conf.get(settingKey);
}
function getSettings(file) {
var conf = name2Conf[file];
conf.load();
return conf.get();
}
function clearSetting(key, file) {
var conf = name2Conf[file];
conf.load();
conf.clear(key);
conf.save();
}
module.exports = {
saveSettings: saveSettings,
readSettings: readSettings,
getSettings: getSettings,
clearSetting: clearSetting
}; | 7 | 0.166667 | 4 | 3 |
1f319b223e46cf281e19c3546b17e13e49c1ff10 | src/api/resolve/mutation/auth/confirmEmail.js | src/api/resolve/mutation/auth/confirmEmail.js | import bind from "lib/helper/graphql/normalizeParams"
import BadRequest from "lib/error/http/BadRequest"
import waterfall from "lib/helper/array/runWaterfall"
import db from "lib/db/connection"
import {get, remove} from "lib/auth/tokens"
import User from "model/User"
import Session from "model/Session"
const confirmEmail = ({args, ctx}) => db.transaction(async transaction => {
const {client} = ctx.state
const {hash} = args
const id = await get(hash)
if (!id) {
throw new BadRequest("The user cannot be activated: Bad token signature.")
}
let user = await User.findByPk(id, {transaction})
if (!user) {
throw new BadRequest("There's no such user.")
}
user = await waterfall([
() => remove(hash),
() => Session.destroy({where: {userId: user.id}, transaction}),
() => user.update({status: User.statuses.active}, {transaction}),
() => user.reload({transaction})
])
const tokens = await Session.sign({
client, user: user.toJSON()
}, {transaction})
return user.update({lastVisited: new Date()}, {transaction})
.then(() => tokens)
})
export default confirmEmail |> bind
| import bind from "lib/helper/graphql/normalizeParams"
import BadRequest from "lib/error/http/BadRequest"
import waterfall from "lib/helper/array/runWaterfall"
import db from "lib/db/connection"
import {get, remove} from "lib/auth/tokens"
import User from "model/User"
import Session from "model/Session"
const confirmEmail = ({args, ctx}) => db.transaction(async transaction => {
const {client} = ctx.state
const {hash} = args
const id = await get(hash)
if (!id) {
throw new BadRequest("The user cannot be activated: Bad token signature.")
}
let user = await User.findByPk(id, {transaction})
if (!user) {
throw new BadRequest("There's no such user.")
}
user = await waterfall([
() => Session.destroy({where: {userId: user.id}, transaction}),
() => user.update({status: User.statuses.active}, {transaction}),
() => remove(hash),
() => user.reload({transaction})
])
const tokens = await Session.sign({
client, user: user.toJSON()
}, {transaction})
return user.update({lastVisited: new Date()}, {transaction})
.then(() => tokens)
})
export default confirmEmail |> bind
| Reorder operations in email confirmation resolver. | Reorder operations in email confirmation resolver.
| JavaScript | mit | octet-stream/ponyfiction-js,octet-stream/ponyfiction-js | javascript | ## Code Before:
import bind from "lib/helper/graphql/normalizeParams"
import BadRequest from "lib/error/http/BadRequest"
import waterfall from "lib/helper/array/runWaterfall"
import db from "lib/db/connection"
import {get, remove} from "lib/auth/tokens"
import User from "model/User"
import Session from "model/Session"
const confirmEmail = ({args, ctx}) => db.transaction(async transaction => {
const {client} = ctx.state
const {hash} = args
const id = await get(hash)
if (!id) {
throw new BadRequest("The user cannot be activated: Bad token signature.")
}
let user = await User.findByPk(id, {transaction})
if (!user) {
throw new BadRequest("There's no such user.")
}
user = await waterfall([
() => remove(hash),
() => Session.destroy({where: {userId: user.id}, transaction}),
() => user.update({status: User.statuses.active}, {transaction}),
() => user.reload({transaction})
])
const tokens = await Session.sign({
client, user: user.toJSON()
}, {transaction})
return user.update({lastVisited: new Date()}, {transaction})
.then(() => tokens)
})
export default confirmEmail |> bind
## Instruction:
Reorder operations in email confirmation resolver.
## Code After:
import bind from "lib/helper/graphql/normalizeParams"
import BadRequest from "lib/error/http/BadRequest"
import waterfall from "lib/helper/array/runWaterfall"
import db from "lib/db/connection"
import {get, remove} from "lib/auth/tokens"
import User from "model/User"
import Session from "model/Session"
const confirmEmail = ({args, ctx}) => db.transaction(async transaction => {
const {client} = ctx.state
const {hash} = args
const id = await get(hash)
if (!id) {
throw new BadRequest("The user cannot be activated: Bad token signature.")
}
let user = await User.findByPk(id, {transaction})
if (!user) {
throw new BadRequest("There's no such user.")
}
user = await waterfall([
() => Session.destroy({where: {userId: user.id}, transaction}),
() => user.update({status: User.statuses.active}, {transaction}),
() => remove(hash),
() => user.reload({transaction})
])
const tokens = await Session.sign({
client, user: user.toJSON()
}, {transaction})
return user.update({lastVisited: new Date()}, {transaction})
.then(() => tokens)
})
export default confirmEmail |> bind
| import bind from "lib/helper/graphql/normalizeParams"
import BadRequest from "lib/error/http/BadRequest"
import waterfall from "lib/helper/array/runWaterfall"
import db from "lib/db/connection"
import {get, remove} from "lib/auth/tokens"
import User from "model/User"
import Session from "model/Session"
const confirmEmail = ({args, ctx}) => db.transaction(async transaction => {
const {client} = ctx.state
const {hash} = args
const id = await get(hash)
if (!id) {
throw new BadRequest("The user cannot be activated: Bad token signature.")
}
let user = await User.findByPk(id, {transaction})
if (!user) {
throw new BadRequest("There's no such user.")
}
user = await waterfall([
- () => remove(hash),
-
() => Session.destroy({where: {userId: user.id}, transaction}),
() => user.update({status: User.statuses.active}, {transaction}),
+
+ () => remove(hash),
() => user.reload({transaction})
])
const tokens = await Session.sign({
client, user: user.toJSON()
}, {transaction})
return user.update({lastVisited: new Date()}, {transaction})
.then(() => tokens)
})
export default confirmEmail |> bind | 4 | 0.088889 | 2 | 2 |
7c67e27bcef9ac05eec6ee84d02056814dea2b85 | spec/factories/user_groups.rb | spec/factories/user_groups.rb | FactoryGirl.define do
factory :user_group do
name { Faker::Team.name }
mission { get_mission }
end
end
|
FactoryGirl.define do
factory :user_group do
sequence(:name) { |n| "UserGroup #{n}" }
mission { get_mission }
end
end
| Fix user group name uniqueness error | 9690: Fix user group name uniqueness error
| Ruby | apache-2.0 | thecartercenter/elmo,thecartercenter/elmo,thecartercenter/elmo | ruby | ## Code Before:
FactoryGirl.define do
factory :user_group do
name { Faker::Team.name }
mission { get_mission }
end
end
## Instruction:
9690: Fix user group name uniqueness error
## Code After:
FactoryGirl.define do
factory :user_group do
sequence(:name) { |n| "UserGroup #{n}" }
mission { get_mission }
end
end
| +
FactoryGirl.define do
factory :user_group do
- name { Faker::Team.name }
+ sequence(:name) { |n| "UserGroup #{n}" }
mission { get_mission }
end
end | 3 | 0.5 | 2 | 1 |
1aa4a4edbfc0d6d8ad3495261a8b588ae52e739a | logging.js | logging.js | const fs = require('fs');
const sysout = console.log;
function toFile(log) {
fs.appendFile("./latest.log", log);
}
const out = log => {
sysout(log);
toFile(log);
};
console.log = log => {
let d = new Date();
log = `[${d.toString()} LOG] ${log}`;
out(log);
};
console.info = console.log;
console.error = log => {
let d = new Date();
log = `[${d.toString()} ERROR] ${log}`;
out(log);
};
| const fs = require('fs');
const sysout = console.log;
function toFile(log) {
fs.appendFile("./latest.log", log, () => {});
}
const out = log => {
sysout(log);
toFile(log);
};
console.log = log => {
let d = new Date();
log = `[${d.toString()} LOG] ${log}`;
out(log);
};
console.info = console.log;
console.error = log => {
let d = new Date();
log = `[${d.toString()} ERROR] ${log}`;
out(log);
};
| Fix the async deprecation error in node7 | Fix the async deprecation error in node7
| JavaScript | mit | Lunar-Skies/Hamster | javascript | ## Code Before:
const fs = require('fs');
const sysout = console.log;
function toFile(log) {
fs.appendFile("./latest.log", log);
}
const out = log => {
sysout(log);
toFile(log);
};
console.log = log => {
let d = new Date();
log = `[${d.toString()} LOG] ${log}`;
out(log);
};
console.info = console.log;
console.error = log => {
let d = new Date();
log = `[${d.toString()} ERROR] ${log}`;
out(log);
};
## Instruction:
Fix the async deprecation error in node7
## Code After:
const fs = require('fs');
const sysout = console.log;
function toFile(log) {
fs.appendFile("./latest.log", log, () => {});
}
const out = log => {
sysout(log);
toFile(log);
};
console.log = log => {
let d = new Date();
log = `[${d.toString()} LOG] ${log}`;
out(log);
};
console.info = console.log;
console.error = log => {
let d = new Date();
log = `[${d.toString()} ERROR] ${log}`;
out(log);
};
| const fs = require('fs');
const sysout = console.log;
function toFile(log) {
- fs.appendFile("./latest.log", log);
+ fs.appendFile("./latest.log", log, () => {});
? ++++++++++
}
const out = log => {
sysout(log);
toFile(log);
};
console.log = log => {
let d = new Date();
log = `[${d.toString()} LOG] ${log}`;
out(log);
};
console.info = console.log;
console.error = log => {
let d = new Date();
log = `[${d.toString()} ERROR] ${log}`;
out(log);
}; | 2 | 0.1 | 1 | 1 |
a26035061a407292ddcebcf224423cfbcd0fbd10 | README.md | README.md | HelloMama Registration accepts registrations for the Hello Mama project.
## Apps & Models:
* registrations
* Source
* Registration
* SubscriptionRequest
* changes
* Change
## Metrics
##### registrations.created.sum
`sum` Total number of registrations created
##### registrations.unique_operators.sum
`sum` Total number of unique health workers who have completed registrations
##### registrations.msg_type.{{type}}.sum
`sum` Number of registrations per message type
##### registrations.msg_type.{{type}}.last
`last` Total number of registrations per message type
| HelloMama Registration accepts registrations for the Hello Mama project.
This app uses the Django cache framework for efficient calculation of metrics,
so if you are running multiple instances, make sure to setup a shared Django
cache backend for them.
## Apps & Models:
* registrations
* Source
* Registration
* SubscriptionRequest
* changes
* Change
## Metrics
##### registrations.created.sum
`sum` Total number of registrations created
##### registrations.unique_operators.sum
`sum` Total number of unique health workers who have completed registrations
##### registrations.msg_type.{{type}}.sum
`sum` Number of registrations per message type
##### registrations.msg_type.{{type}}.last
`last` Total number of registrations per message type
| Add note to readme to warn for proper cache backend for multiple instances | Add note to readme to warn for proper cache backend for multiple instances
| Markdown | bsd-3-clause | praekelt/hellomama-registration,praekelt/hellomama-registration | markdown | ## Code Before:
HelloMama Registration accepts registrations for the Hello Mama project.
## Apps & Models:
* registrations
* Source
* Registration
* SubscriptionRequest
* changes
* Change
## Metrics
##### registrations.created.sum
`sum` Total number of registrations created
##### registrations.unique_operators.sum
`sum` Total number of unique health workers who have completed registrations
##### registrations.msg_type.{{type}}.sum
`sum` Number of registrations per message type
##### registrations.msg_type.{{type}}.last
`last` Total number of registrations per message type
## Instruction:
Add note to readme to warn for proper cache backend for multiple instances
## Code After:
HelloMama Registration accepts registrations for the Hello Mama project.
This app uses the Django cache framework for efficient calculation of metrics,
so if you are running multiple instances, make sure to setup a shared Django
cache backend for them.
## Apps & Models:
* registrations
* Source
* Registration
* SubscriptionRequest
* changes
* Change
## Metrics
##### registrations.created.sum
`sum` Total number of registrations created
##### registrations.unique_operators.sum
`sum` Total number of unique health workers who have completed registrations
##### registrations.msg_type.{{type}}.sum
`sum` Number of registrations per message type
##### registrations.msg_type.{{type}}.last
`last` Total number of registrations per message type
| HelloMama Registration accepts registrations for the Hello Mama project.
+
+ This app uses the Django cache framework for efficient calculation of metrics,
+ so if you are running multiple instances, make sure to setup a shared Django
+ cache backend for them.
## Apps & Models:
* registrations
* Source
* Registration
* SubscriptionRequest
* changes
* Change
## Metrics
##### registrations.created.sum
`sum` Total number of registrations created
##### registrations.unique_operators.sum
`sum` Total number of unique health workers who have completed registrations
##### registrations.msg_type.{{type}}.sum
`sum` Number of registrations per message type
##### registrations.msg_type.{{type}}.last
`last` Total number of registrations per message type | 4 | 0.181818 | 4 | 0 |
dce04fa8f644e7d75ccbbc3aa9b2df907bf0ed5c | test/case6/case6.js | test/case6/case6.js | ;((rc) => {
'use strict';
var tagContent = 'router2-content';
var div = document.createElement('div');
div.innerHTML = `
<${tagContent} id="case6-1" hash="case(\\d+)">
Case 6 via RegExp
</${tagContent}>
`;
var async1 = async_test('Case 6: hash changed to content[hash="case(\d+)"]');
async1.next = async1.step_func(_ => {
var check_hash = async1.step_func((e) => {
window.removeEventListener('hashchange', check_hash);
var content1 = document.querySelector('#case6-1');
assert_false(content1.hidden);
assert_equals(content1.getAttribute('route-param1'), '6');
document.body.removeChild(div);
async1.done();
rc.next();
});
window.addEventListener('hashchange', check_hash);
window.location.hash = "case6";
});
rc.push(_ => {
async1.step(_ => {
document.body.appendChild(div);
async1.next();
});
})
})(window.routeCases);
| ;((rc) => {
'use strict';
var tagContent = 'router2-content';
var div = document.createElement('div');
div.innerHTML = `
<${tagContent} id="case6-2" hash="case62">
Case 6. It's suposed that this will come before (\\d+)
</${tagContent}>
<${tagContent} id="case6-1" hash="case(\\d+)">
Case 6 via RegExp
</${tagContent}>
`;
var async1 = async_test('Case 6: hash changed to content[hash="case(\d+)"]');
var async2 = async_test('Case 6; hash changed to content[hash="case62"]');
async1.next = async1.step_func(_ => {
var check_hash = async1.step_func((e) => {
window.removeEventListener('hashchange', check_hash);
var content1 = document.querySelector('#case6-1');
assert_false(content1.hidden);
assert_equals(content1.getAttribute('route-param1'), '6');
async1.done();
async2.next();
});
window.addEventListener('hashchange', check_hash);
window.location.hash = "case6";
});
async2.next = async2.step_func(_ => {
var check_hash = async2.step_func((e) => {
window.removeEventListener('hashchange', check_hash);
var content1 = document.querySelector('#case6-2');
assert_false(content1.hidden);
document.body.removeChild(div);
async2.done();
rc.next();
});
window.addEventListener('hashchange', check_hash);
window.location.hash = "case62";
});
rc.push(_ => {
async1.step(_ => {
document.body.appendChild(div);
async1.next();
});
})
})(window.routeCases);
| Test case 6 - the order of contents at the DOM-tree | Test case 6 - the order of contents at the DOM-tree
| JavaScript | isc | m3co/router3,m3co/router3 | javascript | ## Code Before:
;((rc) => {
'use strict';
var tagContent = 'router2-content';
var div = document.createElement('div');
div.innerHTML = `
<${tagContent} id="case6-1" hash="case(\\d+)">
Case 6 via RegExp
</${tagContent}>
`;
var async1 = async_test('Case 6: hash changed to content[hash="case(\d+)"]');
async1.next = async1.step_func(_ => {
var check_hash = async1.step_func((e) => {
window.removeEventListener('hashchange', check_hash);
var content1 = document.querySelector('#case6-1');
assert_false(content1.hidden);
assert_equals(content1.getAttribute('route-param1'), '6');
document.body.removeChild(div);
async1.done();
rc.next();
});
window.addEventListener('hashchange', check_hash);
window.location.hash = "case6";
});
rc.push(_ => {
async1.step(_ => {
document.body.appendChild(div);
async1.next();
});
})
})(window.routeCases);
## Instruction:
Test case 6 - the order of contents at the DOM-tree
## Code After:
;((rc) => {
'use strict';
var tagContent = 'router2-content';
var div = document.createElement('div');
div.innerHTML = `
<${tagContent} id="case6-2" hash="case62">
Case 6. It's suposed that this will come before (\\d+)
</${tagContent}>
<${tagContent} id="case6-1" hash="case(\\d+)">
Case 6 via RegExp
</${tagContent}>
`;
var async1 = async_test('Case 6: hash changed to content[hash="case(\d+)"]');
var async2 = async_test('Case 6; hash changed to content[hash="case62"]');
async1.next = async1.step_func(_ => {
var check_hash = async1.step_func((e) => {
window.removeEventListener('hashchange', check_hash);
var content1 = document.querySelector('#case6-1');
assert_false(content1.hidden);
assert_equals(content1.getAttribute('route-param1'), '6');
async1.done();
async2.next();
});
window.addEventListener('hashchange', check_hash);
window.location.hash = "case6";
});
async2.next = async2.step_func(_ => {
var check_hash = async2.step_func((e) => {
window.removeEventListener('hashchange', check_hash);
var content1 = document.querySelector('#case6-2');
assert_false(content1.hidden);
document.body.removeChild(div);
async2.done();
rc.next();
});
window.addEventListener('hashchange', check_hash);
window.location.hash = "case62";
});
rc.push(_ => {
async1.step(_ => {
document.body.appendChild(div);
async1.next();
});
})
})(window.routeCases);
| ;((rc) => {
'use strict';
var tagContent = 'router2-content';
var div = document.createElement('div');
div.innerHTML = `
+ <${tagContent} id="case6-2" hash="case62">
+ Case 6. It's suposed that this will come before (\\d+)
+ </${tagContent}>
<${tagContent} id="case6-1" hash="case(\\d+)">
Case 6 via RegExp
</${tagContent}>
`;
var async1 = async_test('Case 6: hash changed to content[hash="case(\d+)"]');
+ var async2 = async_test('Case 6; hash changed to content[hash="case62"]');
async1.next = async1.step_func(_ => {
var check_hash = async1.step_func((e) => {
window.removeEventListener('hashchange', check_hash);
var content1 = document.querySelector('#case6-1');
assert_false(content1.hidden);
assert_equals(content1.getAttribute('route-param1'), '6');
+ async1.done();
+ async2.next();
+ });
+ window.addEventListener('hashchange', check_hash);
+ window.location.hash = "case6";
+ });
+
+ async2.next = async2.step_func(_ => {
+ var check_hash = async2.step_func((e) => {
+ window.removeEventListener('hashchange', check_hash);
+ var content1 = document.querySelector('#case6-2');
+ assert_false(content1.hidden);
+
document.body.removeChild(div);
- async1.done();
? ^
+ async2.done();
? ^
rc.next();
});
window.addEventListener('hashchange', check_hash);
- window.location.hash = "case6";
+ window.location.hash = "case62";
? +
});
rc.push(_ => {
async1.step(_ => {
document.body.appendChild(div);
async1.next();
});
})
})(window.routeCases); | 21 | 0.567568 | 19 | 2 |
f708d695f2f0a33c3e856ebd4aa8299c46e91694 | setup.py | setup.py | from setuptools import setup
setup(
name="ldap_dingens",
version="0.1",
description="LDAP web frontend for the FSFW Dresden group",
url="https://github.com/fsfw-dresden/ldap-dingens",
author="Dominik Pataky",
author_email="mail@netdecorator.org",
license="AGPL",
classifiers=[
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3",
],
keywords="ldap web-frontend flask",
install_requires=[
"Flask>=0.10.1",
"Flask-Login>=0.2.11",
"Flask-WTF>=0.10",
"itsdangerous>=0.24",
"Jinja2>=2.7.3",
"MarkupSafe>=0.23",
"SQLAlchemy>=0.9.9",
"Werkzeug>=0.9.6",
"WTForms>=2.0",
"blinker>=1.3"
],
packages=["ldap_dingens"],
package_data={
"ldap_dingens": [
"static/css/*.css",
"templates/*.html",
"templates/invite/*.html",
]
},
)
| from setuptools import setup
setup(
name="ldap_dingens",
version="0.1",
description="LDAP web frontend for the FSFW Dresden group",
url="https://github.com/fsfw-dresden/ldap-dingens",
author="Dominik Pataky",
author_email="mail@netdecorator.org",
license="AGPL",
classifiers=[
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3",
],
keywords="ldap web-frontend flask",
install_requires=[
"Flask>=0.10.1",
"Flask-Login>=0.2.11",
"Flask-WTF>=0.10",
"itsdangerous>=0.24",
"Jinja2>=2.7.3",
"MarkupSafe>=0.23",
"SQLAlchemy>=0.9.9",
"Werkzeug>=0.9.6",
"WTForms>=2.0",
"blinker>=1.3",
"enum34>=1.0",
"ldap3>=0.9.7.1"
],
packages=["ldap_dingens"],
package_data={
"ldap_dingens": [
"static/css/*.css",
"templates/*.html",
"templates/invite/*.html",
]
},
)
| Add some more or less obvious dependencies | Add some more or less obvious dependencies
| Python | agpl-3.0 | fsfw-dresden/ldap-dingens,fsfw-dresden/ldap-dingens | python | ## Code Before:
from setuptools import setup
setup(
name="ldap_dingens",
version="0.1",
description="LDAP web frontend for the FSFW Dresden group",
url="https://github.com/fsfw-dresden/ldap-dingens",
author="Dominik Pataky",
author_email="mail@netdecorator.org",
license="AGPL",
classifiers=[
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3",
],
keywords="ldap web-frontend flask",
install_requires=[
"Flask>=0.10.1",
"Flask-Login>=0.2.11",
"Flask-WTF>=0.10",
"itsdangerous>=0.24",
"Jinja2>=2.7.3",
"MarkupSafe>=0.23",
"SQLAlchemy>=0.9.9",
"Werkzeug>=0.9.6",
"WTForms>=2.0",
"blinker>=1.3"
],
packages=["ldap_dingens"],
package_data={
"ldap_dingens": [
"static/css/*.css",
"templates/*.html",
"templates/invite/*.html",
]
},
)
## Instruction:
Add some more or less obvious dependencies
## Code After:
from setuptools import setup
setup(
name="ldap_dingens",
version="0.1",
description="LDAP web frontend for the FSFW Dresden group",
url="https://github.com/fsfw-dresden/ldap-dingens",
author="Dominik Pataky",
author_email="mail@netdecorator.org",
license="AGPL",
classifiers=[
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3",
],
keywords="ldap web-frontend flask",
install_requires=[
"Flask>=0.10.1",
"Flask-Login>=0.2.11",
"Flask-WTF>=0.10",
"itsdangerous>=0.24",
"Jinja2>=2.7.3",
"MarkupSafe>=0.23",
"SQLAlchemy>=0.9.9",
"Werkzeug>=0.9.6",
"WTForms>=2.0",
"blinker>=1.3",
"enum34>=1.0",
"ldap3>=0.9.7.1"
],
packages=["ldap_dingens"],
package_data={
"ldap_dingens": [
"static/css/*.css",
"templates/*.html",
"templates/invite/*.html",
]
},
)
| from setuptools import setup
setup(
name="ldap_dingens",
version="0.1",
description="LDAP web frontend for the FSFW Dresden group",
url="https://github.com/fsfw-dresden/ldap-dingens",
author="Dominik Pataky",
author_email="mail@netdecorator.org",
license="AGPL",
classifiers=[
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3",
],
keywords="ldap web-frontend flask",
install_requires=[
"Flask>=0.10.1",
"Flask-Login>=0.2.11",
"Flask-WTF>=0.10",
"itsdangerous>=0.24",
"Jinja2>=2.7.3",
"MarkupSafe>=0.23",
"SQLAlchemy>=0.9.9",
"Werkzeug>=0.9.6",
"WTForms>=2.0",
- "blinker>=1.3"
+ "blinker>=1.3",
? +
+ "enum34>=1.0",
+ "ldap3>=0.9.7.1"
],
packages=["ldap_dingens"],
package_data={
"ldap_dingens": [
"static/css/*.css",
"templates/*.html",
"templates/invite/*.html",
]
},
) | 4 | 0.111111 | 3 | 1 |
5cf42e61353f59037b5b2eb05dd2ee14b5c8160c | app/controllers/comments_controller.rb | app/controllers/comments_controller.rb | class CommentsController < ApplicationController
before_filter :authenticate_user!
# lol embedded documents
before_filter :find_book_and_chapter_and_note
def create
@comment = @note.comments.build(params[:comment].merge!(:user => current_user))
if @comment.save
change_note_state!
@comment.send_notifications!
flash[:notice] = "Comment has been created."
redirect_to [@book, @chapter, @note]
else
@comments = @note.comments
flash[:error] = "Comment could not be created."
render "notes/show"
end
end
private
def change_note_state!
if current_user.author?
case params[:commit]
when "Accept"
@comment.note.accept!
when "Reject"
@comment.note.reject!
when "Reopen"
@comment.note.reopen!
end
end
end
def find_book_and_chapter_and_note
@book = Book.where(permalink: params[:book_id]).first
@chapter = @book.chapters.where(:position => params[:chapter_id]).first
@note = @chapter.notes.where(:number => params[:note_id]).first
end
end | class CommentsController < ApplicationController
before_filter :authenticate_user!
# lol embedded documents
before_filter :find_book_and_chapter_and_note
def create
@comments = @note.comments
@comment = @note.comments.build(params[:comment].merge!(:user => current_user))
if params[:comment][:text].blank?
attempt_state_update
else
create_new_comment
end
end
private
def attempt_state_update
if current_user.author?
change_note_state!
flash[:notice] = "Note state updated."
render "notes/show"
else
@comment = @note.comments.build
flash[:error] = "Comment could not be created."
render "notes/show"
end
end
def create_new_comment
if @comment.save
@comment.send_notifications!
flash[:notice] = "Comment has been created."
redirect_to [@book, @chapter, @note]
else
flash[:error] = "Comment could not be created."
render "notes/show"
end
end
def change_note_state!
case params[:commit]
when "Accept"
@note.accept!
when "Reject"
@note.reject!
when "Reopen"
@note.reopen!
end
end
def find_book_and_chapter_and_note
@book = Book.where(permalink: params[:book_id]).first
@chapter = @book.chapters.where(:position => params[:chapter_id]).first
@note = @chapter.notes.where(:number => params[:note_id]).first
end
end
| Allow note state to be changed without being forced to leave a comment | Allow note state to be changed without being forced to leave a comment
| Ruby | mit | radar/twist,doug-c/mttwist,RealSilo/twist,radar/twist,yannvery/twist,doug-c/mttwist,yannvery/twist,RealSilo/twist,yannvery/twist,radar/twist,RealSilo/twist,doug-c/mttwist | ruby | ## Code Before:
class CommentsController < ApplicationController
before_filter :authenticate_user!
# lol embedded documents
before_filter :find_book_and_chapter_and_note
def create
@comment = @note.comments.build(params[:comment].merge!(:user => current_user))
if @comment.save
change_note_state!
@comment.send_notifications!
flash[:notice] = "Comment has been created."
redirect_to [@book, @chapter, @note]
else
@comments = @note.comments
flash[:error] = "Comment could not be created."
render "notes/show"
end
end
private
def change_note_state!
if current_user.author?
case params[:commit]
when "Accept"
@comment.note.accept!
when "Reject"
@comment.note.reject!
when "Reopen"
@comment.note.reopen!
end
end
end
def find_book_and_chapter_and_note
@book = Book.where(permalink: params[:book_id]).first
@chapter = @book.chapters.where(:position => params[:chapter_id]).first
@note = @chapter.notes.where(:number => params[:note_id]).first
end
end
## Instruction:
Allow note state to be changed without being forced to leave a comment
## Code After:
class CommentsController < ApplicationController
before_filter :authenticate_user!
# lol embedded documents
before_filter :find_book_and_chapter_and_note
def create
@comments = @note.comments
@comment = @note.comments.build(params[:comment].merge!(:user => current_user))
if params[:comment][:text].blank?
attempt_state_update
else
create_new_comment
end
end
private
def attempt_state_update
if current_user.author?
change_note_state!
flash[:notice] = "Note state updated."
render "notes/show"
else
@comment = @note.comments.build
flash[:error] = "Comment could not be created."
render "notes/show"
end
end
def create_new_comment
if @comment.save
@comment.send_notifications!
flash[:notice] = "Comment has been created."
redirect_to [@book, @chapter, @note]
else
flash[:error] = "Comment could not be created."
render "notes/show"
end
end
def change_note_state!
case params[:commit]
when "Accept"
@note.accept!
when "Reject"
@note.reject!
when "Reopen"
@note.reopen!
end
end
def find_book_and_chapter_and_note
@book = Book.where(permalink: params[:book_id]).first
@chapter = @book.chapters.where(:position => params[:chapter_id]).first
@note = @chapter.notes.where(:number => params[:note_id]).first
end
end
| class CommentsController < ApplicationController
before_filter :authenticate_user!
# lol embedded documents
before_filter :find_book_and_chapter_and_note
-
+
def create
+ @comments = @note.comments
@comment = @note.comments.build(params[:comment].merge!(:user => current_user))
+ if params[:comment][:text].blank?
+ attempt_state_update
+ else
+ create_new_comment
+ end
+ end
+
+ private
+
+ def attempt_state_update
+ if current_user.author?
+ change_note_state!
+ flash[:notice] = "Note state updated."
+ render "notes/show"
+ else
+ @comment = @note.comments.build
+ flash[:error] = "Comment could not be created."
+ render "notes/show"
+ end
+ end
+
+ def create_new_comment
if @comment.save
- change_note_state!
@comment.send_notifications!
flash[:notice] = "Comment has been created."
redirect_to [@book, @chapter, @note]
else
- @comments = @note.comments
flash[:error] = "Comment could not be created."
render "notes/show"
end
end
-
- private
def change_note_state!
- if current_user.author?
- case params[:commit]
? --
+ case params[:commit]
- when "Accept"
? --
+ when "Accept"
- @comment.note.accept!
? -- --------
+ @note.accept!
- when "Reject"
? --
+ when "Reject"
- @comment.note.reject!
? -- --------
+ @note.reject!
- when "Reopen"
? --
+ when "Reopen"
- @comment.note.reopen!
? -- --------
+ @note.reopen!
- end
end
end
def find_book_and_chapter_and_note
@book = Book.where(permalink: params[:book_id]).first
@chapter = @book.chapters.where(:position => params[:chapter_id]).first
@note = @chapter.notes.where(:number => params[:note_id]).first
end
end | 45 | 1.097561 | 31 | 14 |
f6e97c003ac2743dc69974629222eeab70766d67 | index.html | index.html | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>SICK IRC Client</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<div id="screen">
<noscript>
<p class="code"><<span class='person'>~SICK</span>> Hi There!</p>
<p class="code"><<span class='person'>~SICK</span>> It's a shame that you have Javascript Disabled,</p>
<p class="code"><<span class='person'>~SICK</span>> As we have a really awesome, interactive site.</p>
<p class="code"><<span class='person'>~SICK</span>> Either way, you can download SICK from <a href="https://github.com/weloxux/sick">GitHub</a> or <a href="http://sourceforge.net/projects/sick-client/files/latest/download">Sourceforge</a>.</p>
</noscript>
</div>
<script src="js/script.js" type="text/javascript"></script>
</body>
</html>
| <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>SICK IRC Client</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<div id="screen">
<noscript>
<p class="code"><<span class='person'>~SICK</span>> Hi There!</p>
<p class="code"><<span class='person'>~SICK</span>> It's a shame (but very understandable) that you have Javascript disabled,</p>
<p class="code"><<span class='person'>~SICK</span>> as we have a really awesome, interactive site.</p>
<p class="code"><<span class='person'>~SICK</span>> Either way, you can download SICK from <a href="https://github.com/weloxux/sick">GitHub</a> or <a href="http://sourceforge.net/projects/sick-client/files/latest/download">Sourceforge</a>.</p>
</noscript>
</div>
<script src="js/script.js" type="text/javascript"></script>
</body>
</html>
| Make some slight edits to message displayed to people without javascript | Make some slight edits to message displayed to people without javascript
| HTML | agpl-3.0 | sickdev/sicksite,sickdev/sicksite | html | ## Code Before:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>SICK IRC Client</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<div id="screen">
<noscript>
<p class="code"><<span class='person'>~SICK</span>> Hi There!</p>
<p class="code"><<span class='person'>~SICK</span>> It's a shame that you have Javascript Disabled,</p>
<p class="code"><<span class='person'>~SICK</span>> As we have a really awesome, interactive site.</p>
<p class="code"><<span class='person'>~SICK</span>> Either way, you can download SICK from <a href="https://github.com/weloxux/sick">GitHub</a> or <a href="http://sourceforge.net/projects/sick-client/files/latest/download">Sourceforge</a>.</p>
</noscript>
</div>
<script src="js/script.js" type="text/javascript"></script>
</body>
</html>
## Instruction:
Make some slight edits to message displayed to people without javascript
## Code After:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>SICK IRC Client</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<div id="screen">
<noscript>
<p class="code"><<span class='person'>~SICK</span>> Hi There!</p>
<p class="code"><<span class='person'>~SICK</span>> It's a shame (but very understandable) that you have Javascript disabled,</p>
<p class="code"><<span class='person'>~SICK</span>> as we have a really awesome, interactive site.</p>
<p class="code"><<span class='person'>~SICK</span>> Either way, you can download SICK from <a href="https://github.com/weloxux/sick">GitHub</a> or <a href="http://sourceforge.net/projects/sick-client/files/latest/download">Sourceforge</a>.</p>
</noscript>
</div>
<script src="js/script.js" type="text/javascript"></script>
</body>
</html>
| <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>SICK IRC Client</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<div id="screen">
<noscript>
<p class="code"><<span class='person'>~SICK</span>> Hi There!</p>
- <p class="code"><<span class='person'>~SICK</span>> It's a shame that you have Javascript Disabled,</p>
? ^
+ <p class="code"><<span class='person'>~SICK</span>> It's a shame (but very understandable) that you have Javascript disabled,</p>
? ++++++++++++++++++++++++++ ^
- <p class="code"><<span class='person'>~SICK</span>> As we have a really awesome, interactive site.</p>
? ^
+ <p class="code"><<span class='person'>~SICK</span>> as we have a really awesome, interactive site.</p>
? ^
<p class="code"><<span class='person'>~SICK</span>> Either way, you can download SICK from <a href="https://github.com/weloxux/sick">GitHub</a> or <a href="http://sourceforge.net/projects/sick-client/files/latest/download">Sourceforge</a>.</p>
</noscript>
</div>
<script src="js/script.js" type="text/javascript"></script>
</body>
</html> | 4 | 0.190476 | 2 | 2 |
b2a95b9fd0dd934423c1804274c0687b2a998892 | tools/buildexe.bat | tools/buildexe.bat | @ECHO OFF
CD winrun4j
COPY WinRun4J64.exe DNGearSim.exe
RCEDIT64.exe /N DNGearSim.exe DNGearSim.ini
RCEDIT64.exe /S DNGearSim.exe splash.bmp
RCEDIT64.exe /I DNGearSim.exe icon.ico
COPY "DNGearSim.exe" "../../runtime/DNGearSim.exe"
CD ../..
CD Bootstrap/target
COPY "bootstrap.jar" "../../runtime/bootstrap.jar"
PAUSE | @ECHO OFF
CD winrun4j
COPY WinRun4J64.exe DNGearSim.exe
RCEDIT64.exe /N DNGearSim.exe DNGearSim.ini
RCEDIT64.exe /S DNGearSim.exe splash.bmp
RCEDIT64.exe /I DNGearSim.exe icon.ico
COPY "DNGearSim.exe" "../../runtime/DNGearSim.exe"
CD ../..
CD Bootstrap/target
COPY "bootstrap.jar" "../../runtime/bootstrap.jar"
CD ../..
| Remove unnecessary pause, CD back to top | Remove unnecessary pause, CD back to top
| Batchfile | mit | vincentzhang96/DNGearSim | batchfile | ## Code Before:
@ECHO OFF
CD winrun4j
COPY WinRun4J64.exe DNGearSim.exe
RCEDIT64.exe /N DNGearSim.exe DNGearSim.ini
RCEDIT64.exe /S DNGearSim.exe splash.bmp
RCEDIT64.exe /I DNGearSim.exe icon.ico
COPY "DNGearSim.exe" "../../runtime/DNGearSim.exe"
CD ../..
CD Bootstrap/target
COPY "bootstrap.jar" "../../runtime/bootstrap.jar"
PAUSE
## Instruction:
Remove unnecessary pause, CD back to top
## Code After:
@ECHO OFF
CD winrun4j
COPY WinRun4J64.exe DNGearSim.exe
RCEDIT64.exe /N DNGearSim.exe DNGearSim.ini
RCEDIT64.exe /S DNGearSim.exe splash.bmp
RCEDIT64.exe /I DNGearSim.exe icon.ico
COPY "DNGearSim.exe" "../../runtime/DNGearSim.exe"
CD ../..
CD Bootstrap/target
COPY "bootstrap.jar" "../../runtime/bootstrap.jar"
CD ../..
| @ECHO OFF
CD winrun4j
COPY WinRun4J64.exe DNGearSim.exe
RCEDIT64.exe /N DNGearSim.exe DNGearSim.ini
RCEDIT64.exe /S DNGearSim.exe splash.bmp
RCEDIT64.exe /I DNGearSim.exe icon.ico
COPY "DNGearSim.exe" "../../runtime/DNGearSim.exe"
+ CD ../..
- CD ../..
CD Bootstrap/target
COPY "bootstrap.jar" "../../runtime/bootstrap.jar"
+ CD ../..
-
- PAUSE | 5 | 0.357143 | 2 | 3 |
e1edb506113a0fd8104931def710188f5d507f06 | crispy/gui/widgets/plotwidget.py | crispy/gui/widgets/plotwidget.py |
from silx.gui.plot import PlotWindow
class PlotWidget(PlotWindow):
def __init__(self, *args):
super(PlotWidget, self).__init__()
self.setActiveCurveHandling(False)
self.setGraphXLabel('Energy (eV)')
self.setGraphYLabel('Absorption cross section (a.u.)')
def plot(self, x, y, legend=None):
self.addCurve(x, y, legend=legend)
def clear(self):
super(PlotWidget, self).clear()
|
from silx.gui.plot import PlotWindow
class PlotWidget(PlotWindow):
def __init__(self, *args):
super(PlotWidget, self).__init__(logScale=False, grid=True,
aspectRatio=False, yInverted=False, roi=False, mask=False,
print_=False)
self.setActiveCurveHandling(False)
self.setGraphXLabel('Energy (eV)')
self.setGraphYLabel('Absorption cross section (a.u.)')
def plot(self, x, y, legend=None):
self.addCurve(x, y, legend=legend)
def clear(self):
super(PlotWidget, self).clear()
| Remove unused icons of the PlotWindow | Remove unused icons of the PlotWindow
| Python | mit | mretegan/crispy,mretegan/crispy | python | ## Code Before:
from silx.gui.plot import PlotWindow
class PlotWidget(PlotWindow):
def __init__(self, *args):
super(PlotWidget, self).__init__()
self.setActiveCurveHandling(False)
self.setGraphXLabel('Energy (eV)')
self.setGraphYLabel('Absorption cross section (a.u.)')
def plot(self, x, y, legend=None):
self.addCurve(x, y, legend=legend)
def clear(self):
super(PlotWidget, self).clear()
## Instruction:
Remove unused icons of the PlotWindow
## Code After:
from silx.gui.plot import PlotWindow
class PlotWidget(PlotWindow):
def __init__(self, *args):
super(PlotWidget, self).__init__(logScale=False, grid=True,
aspectRatio=False, yInverted=False, roi=False, mask=False,
print_=False)
self.setActiveCurveHandling(False)
self.setGraphXLabel('Energy (eV)')
self.setGraphYLabel('Absorption cross section (a.u.)')
def plot(self, x, y, legend=None):
self.addCurve(x, y, legend=legend)
def clear(self):
super(PlotWidget, self).clear()
|
from silx.gui.plot import PlotWindow
class PlotWidget(PlotWindow):
def __init__(self, *args):
- super(PlotWidget, self).__init__()
? ^
+ super(PlotWidget, self).__init__(logScale=False, grid=True,
? ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ aspectRatio=False, yInverted=False, roi=False, mask=False,
+ print_=False)
self.setActiveCurveHandling(False)
self.setGraphXLabel('Energy (eV)')
self.setGraphYLabel('Absorption cross section (a.u.)')
def plot(self, x, y, legend=None):
self.addCurve(x, y, legend=legend)
def clear(self):
super(PlotWidget, self).clear()
| 4 | 0.25 | 3 | 1 |
a6945494944b3864fb8224dc5edc6d7b51dc3582 | README.md | README.md |
The Essence project done...right?
## What's Coming
1. Clarity::expect() and expect() are now the only 2 entry points.
2. Class `Chain` is now responsible for handling all the magic.
- queries are cached in memory
- no need to have an array of "links" anymore, Chain just ignores unknown identifiers
- however, it'll let you know if no matcher was specified
3. Matchers are now that much better than before.
- no "configuration" matchers, but now they have `options`
- special syntax for matcher options: `...->withOptionName(optionValue, ...)`
- aliases are supported too (1+ for any matcher)!
- there are less matchers, but each one of them has more features than previously
4. Clarity::runLast() and Clarity::runAll() methods is all you need.
- stupid things like `implicit_validation` were removed, ugh
- integration with existing popular testing frameworks like *PhpUnit*
5. Later, Clarity will obtain its own test runner (and code coverage tools integration!).
6. Even more cool stuff coming.
## License
The MIT license (MIT).
|
The Essence project done...right?
## What's Coming
1. Clarity::expect() and expect() are now the only 2 entry points.
2. Class `Chain` is now responsible for handling all the magic.
- queries are cached in memory
- no need to have an array of "links" anymore, Chain just ignores unknown identifiers
- however, it'll let you know if no matcher was specified
3. Matchers are now that much better than before.
- no "configuration" matchers, but now they have `options`
- special syntax for matcher options: `...->withOptionName(optionValue, ...)`
- aliases are supported too (1+ for any matcher)!
- there are less matchers, but each one of them has more features than previously
4. Clarity::runLast() and Clarity::runAll() methods are all you need.
- stupid things like `implicit_validation` were removed, ugh
- integration with existing popular testing frameworks like *PhpUnit*
5. Later, Clarity will obtain its own test runner (and integration with code coverage tools!).
6. Even more cool stuff coming.
## License
The MIT license (MIT).
| Fix some mistakes in the readme file. | Fix some mistakes in the readme file.
| Markdown | mit | bound1ess/clarity | markdown | ## Code Before:
The Essence project done...right?
## What's Coming
1. Clarity::expect() and expect() are now the only 2 entry points.
2. Class `Chain` is now responsible for handling all the magic.
- queries are cached in memory
- no need to have an array of "links" anymore, Chain just ignores unknown identifiers
- however, it'll let you know if no matcher was specified
3. Matchers are now that much better than before.
- no "configuration" matchers, but now they have `options`
- special syntax for matcher options: `...->withOptionName(optionValue, ...)`
- aliases are supported too (1+ for any matcher)!
- there are less matchers, but each one of them has more features than previously
4. Clarity::runLast() and Clarity::runAll() methods is all you need.
- stupid things like `implicit_validation` were removed, ugh
- integration with existing popular testing frameworks like *PhpUnit*
5. Later, Clarity will obtain its own test runner (and code coverage tools integration!).
6. Even more cool stuff coming.
## License
The MIT license (MIT).
## Instruction:
Fix some mistakes in the readme file.
## Code After:
The Essence project done...right?
## What's Coming
1. Clarity::expect() and expect() are now the only 2 entry points.
2. Class `Chain` is now responsible for handling all the magic.
- queries are cached in memory
- no need to have an array of "links" anymore, Chain just ignores unknown identifiers
- however, it'll let you know if no matcher was specified
3. Matchers are now that much better than before.
- no "configuration" matchers, but now they have `options`
- special syntax for matcher options: `...->withOptionName(optionValue, ...)`
- aliases are supported too (1+ for any matcher)!
- there are less matchers, but each one of them has more features than previously
4. Clarity::runLast() and Clarity::runAll() methods are all you need.
- stupid things like `implicit_validation` were removed, ugh
- integration with existing popular testing frameworks like *PhpUnit*
5. Later, Clarity will obtain its own test runner (and integration with code coverage tools!).
6. Even more cool stuff coming.
## License
The MIT license (MIT).
|
The Essence project done...right?
## What's Coming
1. Clarity::expect() and expect() are now the only 2 entry points.
2. Class `Chain` is now responsible for handling all the magic.
- queries are cached in memory
- no need to have an array of "links" anymore, Chain just ignores unknown identifiers
- however, it'll let you know if no matcher was specified
3. Matchers are now that much better than before.
- no "configuration" matchers, but now they have `options`
- special syntax for matcher options: `...->withOptionName(optionValue, ...)`
- aliases are supported too (1+ for any matcher)!
- there are less matchers, but each one of them has more features than previously
- 4. Clarity::runLast() and Clarity::runAll() methods is all you need.
? ^^
+ 4. Clarity::runLast() and Clarity::runAll() methods are all you need.
? ^^^
- stupid things like `implicit_validation` were removed, ugh
- integration with existing popular testing frameworks like *PhpUnit*
- 5. Later, Clarity will obtain its own test runner (and code coverage tools integration!).
? ------------
+ 5. Later, Clarity will obtain its own test runner (and integration with code coverage tools!).
? +++++++++++++++++
6. Even more cool stuff coming.
## License
The MIT license (MIT). | 4 | 0.166667 | 2 | 2 |
c33fe7e96a0831322d2e2eb927417b4497206e56 | metadata/com.powerpoint45.lucidbrowserfree.txt | metadata/com.powerpoint45.lucidbrowserfree.txt | Categories:Internet
License:MIT
Web Site:https://github.com/powerpoint45/Lucid-Browser
Source Code:https://github.com/powerpoint45/Lucid-Browser
Issue Tracker:https://github.com/powerpoint45/Lucid-Browser/issues
Summary:small and simple web browser
Description:
Lucid Browser is a free and open source browser designed to be small, light, fast, and simple. The app itself is as small as 1 MB. The browser uses a custom homepage that loads locally for quick start-ups. It is easy to use and very handy.
.
Repo Type:git
Repo:https://github.com/powerpoint45/Lucid-Browser.git
Build:1.0,1
prebuild=rm libs/android-support-v4.jar
srclibs=1:appcompat@v7
commit=86a485337db5177e2657dca3b012addd72cc1275
Auto Update Mode:None
Update Check Mode:Tags
| Categories:Internet
License:MIT
Web Site:https://github.com/powerpoint45/Lucid-Browser
Source Code:https://github.com/powerpoint45/Lucid-Browser
Issue Tracker:https://github.com/powerpoint45/Lucid-Browser/issues
Auto Name:Lucid Browser
Summary:small and simple web browser
Description:
Lucid Browser is a free and open source browser designed to be small, light, fast, and simple. The app itself is as small as 1 MB. The browser uses a custom homepage that loads locally for quick start-ups. It is easy to use and very handy.
.
Repo Type:git
Repo:https://github.com/powerpoint45/Lucid-Browser.git
Build:1.0,1
commit=86a485337db5177e2657dca3b012addd72cc1275
srclibs=1:appcompat@v7
prebuild=rm libs/android-support-v4.jar
Auto Update Mode:None
Update Check Mode:Tags
| Set autoname of Lucid Browser | Set autoname of Lucid Browser
| Text | agpl-3.0 | f-droid/fdroid-data,f-droid/fdroiddata,f-droid/fdroiddata | text | ## Code Before:
Categories:Internet
License:MIT
Web Site:https://github.com/powerpoint45/Lucid-Browser
Source Code:https://github.com/powerpoint45/Lucid-Browser
Issue Tracker:https://github.com/powerpoint45/Lucid-Browser/issues
Summary:small and simple web browser
Description:
Lucid Browser is a free and open source browser designed to be small, light, fast, and simple. The app itself is as small as 1 MB. The browser uses a custom homepage that loads locally for quick start-ups. It is easy to use and very handy.
.
Repo Type:git
Repo:https://github.com/powerpoint45/Lucid-Browser.git
Build:1.0,1
prebuild=rm libs/android-support-v4.jar
srclibs=1:appcompat@v7
commit=86a485337db5177e2657dca3b012addd72cc1275
Auto Update Mode:None
Update Check Mode:Tags
## Instruction:
Set autoname of Lucid Browser
## Code After:
Categories:Internet
License:MIT
Web Site:https://github.com/powerpoint45/Lucid-Browser
Source Code:https://github.com/powerpoint45/Lucid-Browser
Issue Tracker:https://github.com/powerpoint45/Lucid-Browser/issues
Auto Name:Lucid Browser
Summary:small and simple web browser
Description:
Lucid Browser is a free and open source browser designed to be small, light, fast, and simple. The app itself is as small as 1 MB. The browser uses a custom homepage that loads locally for quick start-ups. It is easy to use and very handy.
.
Repo Type:git
Repo:https://github.com/powerpoint45/Lucid-Browser.git
Build:1.0,1
commit=86a485337db5177e2657dca3b012addd72cc1275
srclibs=1:appcompat@v7
prebuild=rm libs/android-support-v4.jar
Auto Update Mode:None
Update Check Mode:Tags
| Categories:Internet
License:MIT
Web Site:https://github.com/powerpoint45/Lucid-Browser
Source Code:https://github.com/powerpoint45/Lucid-Browser
Issue Tracker:https://github.com/powerpoint45/Lucid-Browser/issues
+ Auto Name:Lucid Browser
Summary:small and simple web browser
Description:
Lucid Browser is a free and open source browser designed to be small, light, fast, and simple. The app itself is as small as 1 MB. The browser uses a custom homepage that loads locally for quick start-ups. It is easy to use and very handy.
.
Repo Type:git
Repo:https://github.com/powerpoint45/Lucid-Browser.git
Build:1.0,1
+ commit=86a485337db5177e2657dca3b012addd72cc1275
+ srclibs=1:appcompat@v7
prebuild=rm libs/android-support-v4.jar
- srclibs=1:appcompat@v7
- commit=86a485337db5177e2657dca3b012addd72cc1275
Auto Update Mode:None
Update Check Mode:Tags
+ | 6 | 0.285714 | 4 | 2 |
ac10470ef9b9ceb1c80dbc06020ecfa781bbcab4 | lib/vitrage/router.rb | lib/vitrage/router.rb | module Vitrage
module Router
def routes(rails_router, options = {})
if options[:controller]
cs = options[:controller].to_s
rails_router.post '/vitrage/pieces' => "#{cs}#create", as: :vitrage_pieces
rails_router.get '/vitrage/pieces/new' => "#{cs}#new", as: :new_vitrage_piece
rails_router.get '/vitrage/pieces/restore_order' => "#{cs}#restore_order", as: :restore_order_vitrage_pieces
rails_router.get '/vitrage/pieces/:id/edit' => "#{cs}#edit", as: :edit_vitrage_piece
rails_router.get '/vitrage/pieces/:id' => "#{cs}#show", as: :vitrage_piece
rails_router.match '/vitrage/pieces/:id' => "#{cs}#update", via: [:patch, :put]
rails_router.delete '/vitrage/pieces/:id' => "#{cs}#destroy"
rails_router.post '/vitrage/pieces/:id/reorder' => "#{cs}#reorder", as: :vitrage_piece_reoder
else
rails_router.namespace :vitrage do
rails_router.resources :pieces, except: [:index]
end
end
end
end
end
| module Vitrage
module Router
def routes(rails_router, options = {})
cs = options[:controller] ? options[:controller].to_s : "pieces"
rails_router.post '/vitrage/pieces' => "#{cs}#create", as: :vitrage_pieces
rails_router.get '/vitrage/pieces/new' => "#{cs}#new", as: :new_vitrage_piece
rails_router.get '/vitrage/pieces/restore_order' => "#{cs}#restore_order", as: :restore_order_vitrage_pieces
rails_router.get '/vitrage/pieces/:id/edit' => "#{cs}#edit", as: :edit_vitrage_piece
rails_router.get '/vitrage/pieces/:id' => "#{cs}#show", as: :vitrage_piece
rails_router.match '/vitrage/pieces/:id' => "#{cs}#update", via: [:patch, :put]
rails_router.delete '/vitrage/pieces/:id' => "#{cs}#destroy"
rails_router.post '/vitrage/pieces/:id/reorder' => "#{cs}#reorder", as: :vitrage_piece_reoder
# rails_router.namespace :vitrage do
# rails_router.resources :pieces, except: [:index]
# end
end
end
end
| Fix routes without custom controller | Fix routes without custom controller
| Ruby | mit | dymio/vitrage,dymio/vitrage,dymio/vitrage | ruby | ## Code Before:
module Vitrage
module Router
def routes(rails_router, options = {})
if options[:controller]
cs = options[:controller].to_s
rails_router.post '/vitrage/pieces' => "#{cs}#create", as: :vitrage_pieces
rails_router.get '/vitrage/pieces/new' => "#{cs}#new", as: :new_vitrage_piece
rails_router.get '/vitrage/pieces/restore_order' => "#{cs}#restore_order", as: :restore_order_vitrage_pieces
rails_router.get '/vitrage/pieces/:id/edit' => "#{cs}#edit", as: :edit_vitrage_piece
rails_router.get '/vitrage/pieces/:id' => "#{cs}#show", as: :vitrage_piece
rails_router.match '/vitrage/pieces/:id' => "#{cs}#update", via: [:patch, :put]
rails_router.delete '/vitrage/pieces/:id' => "#{cs}#destroy"
rails_router.post '/vitrage/pieces/:id/reorder' => "#{cs}#reorder", as: :vitrage_piece_reoder
else
rails_router.namespace :vitrage do
rails_router.resources :pieces, except: [:index]
end
end
end
end
end
## Instruction:
Fix routes without custom controller
## Code After:
module Vitrage
module Router
def routes(rails_router, options = {})
cs = options[:controller] ? options[:controller].to_s : "pieces"
rails_router.post '/vitrage/pieces' => "#{cs}#create", as: :vitrage_pieces
rails_router.get '/vitrage/pieces/new' => "#{cs}#new", as: :new_vitrage_piece
rails_router.get '/vitrage/pieces/restore_order' => "#{cs}#restore_order", as: :restore_order_vitrage_pieces
rails_router.get '/vitrage/pieces/:id/edit' => "#{cs}#edit", as: :edit_vitrage_piece
rails_router.get '/vitrage/pieces/:id' => "#{cs}#show", as: :vitrage_piece
rails_router.match '/vitrage/pieces/:id' => "#{cs}#update", via: [:patch, :put]
rails_router.delete '/vitrage/pieces/:id' => "#{cs}#destroy"
rails_router.post '/vitrage/pieces/:id/reorder' => "#{cs}#reorder", as: :vitrage_piece_reoder
# rails_router.namespace :vitrage do
# rails_router.resources :pieces, except: [:index]
# end
end
end
end
| module Vitrage
module Router
def routes(rails_router, options = {})
- if options[:controller]
- cs = options[:controller].to_s
+ cs = options[:controller] ? options[:controller].to_s : "pieces"
+
- rails_router.post '/vitrage/pieces' => "#{cs}#create", as: :vitrage_pieces
? --
+ rails_router.post '/vitrage/pieces' => "#{cs}#create", as: :vitrage_pieces
- rails_router.get '/vitrage/pieces/new' => "#{cs}#new", as: :new_vitrage_piece
? --
+ rails_router.get '/vitrage/pieces/new' => "#{cs}#new", as: :new_vitrage_piece
- rails_router.get '/vitrage/pieces/restore_order' => "#{cs}#restore_order", as: :restore_order_vitrage_pieces
? --
+ rails_router.get '/vitrage/pieces/restore_order' => "#{cs}#restore_order", as: :restore_order_vitrage_pieces
- rails_router.get '/vitrage/pieces/:id/edit' => "#{cs}#edit", as: :edit_vitrage_piece
? --
+ rails_router.get '/vitrage/pieces/:id/edit' => "#{cs}#edit", as: :edit_vitrage_piece
- rails_router.get '/vitrage/pieces/:id' => "#{cs}#show", as: :vitrage_piece
? --
+ rails_router.get '/vitrage/pieces/:id' => "#{cs}#show", as: :vitrage_piece
- rails_router.match '/vitrage/pieces/:id' => "#{cs}#update", via: [:patch, :put]
? --
+ rails_router.match '/vitrage/pieces/:id' => "#{cs}#update", via: [:patch, :put]
- rails_router.delete '/vitrage/pieces/:id' => "#{cs}#destroy"
? --
+ rails_router.delete '/vitrage/pieces/:id' => "#{cs}#destroy"
- rails_router.post '/vitrage/pieces/:id/reorder' => "#{cs}#reorder", as: :vitrage_piece_reoder
? --
+ rails_router.post '/vitrage/pieces/:id/reorder' => "#{cs}#reorder", as: :vitrage_piece_reoder
- else
+
- rails_router.namespace :vitrage do
? ^
+ # rails_router.namespace :vitrage do
? ^
- rails_router.resources :pieces, except: [:index]
? ^
+ # rails_router.resources :pieces, except: [:index]
? ^
- end
? ^
+ # end
? ^
- end
end
end
end | 29 | 1.26087 | 14 | 15 |
2865c83fb0702fff27057588d414d755dbed00f5 | LunchOverflow/app/views/posts/show.html.erb | LunchOverflow/app/views/posts/show.html.erb | <h2><%= @post.title %> - <%= @post.address %></h2>
<p><%= @post.content %></p>
| <h2><%= @post.title %> - <%= @post.address %></h2>
<h4><%= @post.content %></h4>
<h3>Comments</h3>
<ul>
<% @post.comments.each do |comment| %>
<li><%= comment.content %></li>
<% end %>
</ul> | Add comments to post show view | Add comments to post show view
| HTML+ERB | mit | rock-doves-2014/LunchOverflow,rock-doves-2014/LunchOverflow | html+erb | ## Code Before:
<h2><%= @post.title %> - <%= @post.address %></h2>
<p><%= @post.content %></p>
## Instruction:
Add comments to post show view
## Code After:
<h2><%= @post.title %> - <%= @post.address %></h2>
<h4><%= @post.content %></h4>
<h3>Comments</h3>
<ul>
<% @post.comments.each do |comment| %>
<li><%= comment.content %></li>
<% end %>
</ul> | <h2><%= @post.title %> - <%= @post.address %></h2>
- <p><%= @post.content %></p>
? ^ ^
+ <h4><%= @post.content %></h4>
? ^^ ^^
+
+ <h3>Comments</h3>
+ <ul>
+ <% @post.comments.each do |comment| %>
+ <li><%= comment.content %></li>
+ <% end %>
+ </ul> | 9 | 4.5 | 8 | 1 |
829d693e3d1e519b837587adc51c940871666c13 | decoder/dict.h | decoder/dict.h |
class Dict {
typedef std::tr1::unordered_map<std::string, WordID, boost::hash<std::string> > Map;
public:
Dict() : b0_("<bad0>") { words_.reserve(1000); }
inline int max() const { return words_.size(); }
inline WordID Convert(const std::string& word, bool frozen = false) {
Map::iterator i = d_.find(word);
if (i == d_.end()) {
if (frozen)
return 0;
words_.push_back(word);
d_[word] = words_.size();
return words_.size();
} else {
return i->second;
}
}
inline const std::string& Convert(const WordID& id) const {
if (id == 0) return b0_;
assert(id <= words_.size());
return words_[id-1];
}
void clear() { words_.clear(); d_.clear(); }
private:
const std::string b0_;
std::vector<std::string> words_;
Map d_;
};
#endif
|
class Dict {
typedef std::tr1::unordered_map<std::string, WordID, boost::hash<std::string> > Map;
public:
Dict() : b0_("<bad0>") { words_.reserve(1000); }
inline int max() const { return words_.size(); }
inline WordID Convert(const std::string& word, bool frozen = false) {
Map::iterator i = d_.find(word);
if (i == d_.end()) {
if (frozen)
return 0;
words_.push_back(word);
d_[word] = words_.size();
return words_.size();
} else {
return i->second;
}
}
inline WordID Convert(const std::vector<std::string>& words, bool frozen = false) {
std::string word= "";
for (std::vector<std::string>::const_iterator it=words.begin();
it != words.end(); ++it) {
if (it != words.begin()) word += "__";
word += *it;
}
return Convert(word, frozen);
}
inline const std::string& Convert(const WordID& id) const {
if (id == 0) return b0_;
assert(id <= words_.size());
return words_[id-1];
}
void clear() { words_.clear(); d_.clear(); }
private:
const std::string b0_;
std::vector<std::string> words_;
Map d_;
};
#endif
| Update utility functions to work with pyp-topics. | Update utility functions to work with pyp-topics.
git-svn-id: 357248c53bdac2d7b36f7ee045286eb205fcf757@49 ec762483-ff6d-05da-a07a-a48fb63a330f
| C | apache-2.0 | carhaas/cdec-semparse,m5w/atools,redpony/cdec,veer66/cdec,veer66/cdec,veer66/cdec,redpony/cdec,carhaas/cdec-semparse,carhaas/cdec-semparse,veer66/cdec,redpony/cdec,m5w/atools,veer66/cdec,pks/cdec-dtrain,pks/cdec-dtrain,carhaas/cdec-semparse,pks/cdec-dtrain,redpony/cdec,redpony/cdec,redpony/cdec,veer66/cdec,pks/cdec-dtrain,pks/cdec-dtrain,carhaas/cdec-semparse,pks/cdec-dtrain,carhaas/cdec-semparse,m5w/atools | c | ## Code Before:
class Dict {
typedef std::tr1::unordered_map<std::string, WordID, boost::hash<std::string> > Map;
public:
Dict() : b0_("<bad0>") { words_.reserve(1000); }
inline int max() const { return words_.size(); }
inline WordID Convert(const std::string& word, bool frozen = false) {
Map::iterator i = d_.find(word);
if (i == d_.end()) {
if (frozen)
return 0;
words_.push_back(word);
d_[word] = words_.size();
return words_.size();
} else {
return i->second;
}
}
inline const std::string& Convert(const WordID& id) const {
if (id == 0) return b0_;
assert(id <= words_.size());
return words_[id-1];
}
void clear() { words_.clear(); d_.clear(); }
private:
const std::string b0_;
std::vector<std::string> words_;
Map d_;
};
#endif
## Instruction:
Update utility functions to work with pyp-topics.
git-svn-id: 357248c53bdac2d7b36f7ee045286eb205fcf757@49 ec762483-ff6d-05da-a07a-a48fb63a330f
## Code After:
class Dict {
typedef std::tr1::unordered_map<std::string, WordID, boost::hash<std::string> > Map;
public:
Dict() : b0_("<bad0>") { words_.reserve(1000); }
inline int max() const { return words_.size(); }
inline WordID Convert(const std::string& word, bool frozen = false) {
Map::iterator i = d_.find(word);
if (i == d_.end()) {
if (frozen)
return 0;
words_.push_back(word);
d_[word] = words_.size();
return words_.size();
} else {
return i->second;
}
}
inline WordID Convert(const std::vector<std::string>& words, bool frozen = false) {
std::string word= "";
for (std::vector<std::string>::const_iterator it=words.begin();
it != words.end(); ++it) {
if (it != words.begin()) word += "__";
word += *it;
}
return Convert(word, frozen);
}
inline const std::string& Convert(const WordID& id) const {
if (id == 0) return b0_;
assert(id <= words_.size());
return words_[id-1];
}
void clear() { words_.clear(); d_.clear(); }
private:
const std::string b0_;
std::vector<std::string> words_;
Map d_;
};
#endif
|
class Dict {
typedef std::tr1::unordered_map<std::string, WordID, boost::hash<std::string> > Map;
+
public:
Dict() : b0_("<bad0>") { words_.reserve(1000); }
+
inline int max() const { return words_.size(); }
+
inline WordID Convert(const std::string& word, bool frozen = false) {
Map::iterator i = d_.find(word);
if (i == d_.end()) {
if (frozen)
return 0;
words_.push_back(word);
d_[word] = words_.size();
return words_.size();
} else {
return i->second;
}
}
+
+ inline WordID Convert(const std::vector<std::string>& words, bool frozen = false) {
+ std::string word= "";
+ for (std::vector<std::string>::const_iterator it=words.begin();
+ it != words.end(); ++it) {
+ if (it != words.begin()) word += "__";
+ word += *it;
+ }
+
+ return Convert(word, frozen);
+ }
+
inline const std::string& Convert(const WordID& id) const {
if (id == 0) return b0_;
assert(id <= words_.size());
return words_[id-1];
}
+
void clear() { words_.clear(); d_.clear(); }
+
private:
const std::string b0_;
std::vector<std::string> words_;
Map d_;
};
#endif | 17 | 0.548387 | 17 | 0 |
c3d8c9ffa5a3975f0b1e39e93708e7a63fc64ca5 | _config.yml | _config.yml | title: jacob
email: jacob.walker94@gmail.com
description: Jacob Walker's smashing homepage and equally smashing blog
baseurl: "" # the subpath of your site, e.g. /blog/
url: "http://ja.co.bw" # the base hostname & protocol for your site
twitter_username: jacobwalkr
github_username: jacobwalkr
# Build settings
markdown: kramdown
sass:
style: :compressed
| title: jacob
email: jacob.walker94@gmail.com
description: Jacob Walker's smashing homepage and equally smashing blog
baseurl: "" # the subpath of your site, e.g. /blog/
url: "http://ja.co.bw" # the base hostname & protocol for your site
twitter_username: jacobwalkr
github_username: jacobwalkr
# Build settings
markdown: kramdown
sass:
style: :compressed
defaults:
-
scope:
path: ""
type: "posts"
values:
permalink: "/posts/:title"
is_post: true # flag for posts - used in layout
| Set is_post variable to true for all posts | Set is_post variable to true for all posts
| YAML | mit | jacobwalkr/ja.co.bw | yaml | ## Code Before:
title: jacob
email: jacob.walker94@gmail.com
description: Jacob Walker's smashing homepage and equally smashing blog
baseurl: "" # the subpath of your site, e.g. /blog/
url: "http://ja.co.bw" # the base hostname & protocol for your site
twitter_username: jacobwalkr
github_username: jacobwalkr
# Build settings
markdown: kramdown
sass:
style: :compressed
## Instruction:
Set is_post variable to true for all posts
## Code After:
title: jacob
email: jacob.walker94@gmail.com
description: Jacob Walker's smashing homepage and equally smashing blog
baseurl: "" # the subpath of your site, e.g. /blog/
url: "http://ja.co.bw" # the base hostname & protocol for your site
twitter_username: jacobwalkr
github_username: jacobwalkr
# Build settings
markdown: kramdown
sass:
style: :compressed
defaults:
-
scope:
path: ""
type: "posts"
values:
permalink: "/posts/:title"
is_post: true # flag for posts - used in layout
| title: jacob
email: jacob.walker94@gmail.com
description: Jacob Walker's smashing homepage and equally smashing blog
baseurl: "" # the subpath of your site, e.g. /blog/
url: "http://ja.co.bw" # the base hostname & protocol for your site
twitter_username: jacobwalkr
github_username: jacobwalkr
# Build settings
markdown: kramdown
sass:
style: :compressed
+
+ defaults:
+ -
+ scope:
+ path: ""
+ type: "posts"
+ values:
+ permalink: "/posts/:title"
+ is_post: true # flag for posts - used in layout | 9 | 0.692308 | 9 | 0 |
121927a61f307c49bbc50d7bf784238968da90dd | src/main/plugins/org.dita.html5/params.xml | src/main/plugins/org.dita.html5/params.xml | <?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of the DITA Open Toolkit project.
Copyright 2015 Jarno Elovirta
See the accompanying LICENSE file for applicable license.
-->
<params>
<param name="input.map.url" expression="${html5.map.url}" if="html5.map.url"/>
<param name="nav-toc" expression="${html5.nav-toc}" if="html5.nav-toc"/>
</params>
| <?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of the DITA Open Toolkit project.
Copyright 2015 Jarno Elovirta
See the accompanying LICENSE file for applicable license.
-->
<params xmlns:if="ant:if">
<param name="input.map.url" expression="${html5.map.url}" if:set="html5.map.url"/>
<param name="nav-toc" expression="${html5.nav-toc}" if:set="html5.nav-toc"/>
</params>
| Use replace obsolete Ant if attributes | Use replace obsolete Ant if attributes
Signed-off-by: Jarno Elovirta <0f1ab0ac7dffd9db21aa539af2fd4bb04abc3ad4@elovirta.com>
| XML | apache-2.0 | dita-ot/dita-ot,shaneataylor/dita-ot,dita-ot/dita-ot,shaneataylor/dita-ot,infotexture/dita-ot,drmacro/dita-ot,infotexture/dita-ot,infotexture/dita-ot,dita-ot/dita-ot,shaneataylor/dita-ot,dita-ot/dita-ot,dita-ot/dita-ot,drmacro/dita-ot,drmacro/dita-ot,shaneataylor/dita-ot,drmacro/dita-ot,shaneataylor/dita-ot,infotexture/dita-ot,infotexture/dita-ot,drmacro/dita-ot | xml | ## Code Before:
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of the DITA Open Toolkit project.
Copyright 2015 Jarno Elovirta
See the accompanying LICENSE file for applicable license.
-->
<params>
<param name="input.map.url" expression="${html5.map.url}" if="html5.map.url"/>
<param name="nav-toc" expression="${html5.nav-toc}" if="html5.nav-toc"/>
</params>
## Instruction:
Use replace obsolete Ant if attributes
Signed-off-by: Jarno Elovirta <0f1ab0ac7dffd9db21aa539af2fd4bb04abc3ad4@elovirta.com>
## Code After:
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of the DITA Open Toolkit project.
Copyright 2015 Jarno Elovirta
See the accompanying LICENSE file for applicable license.
-->
<params xmlns:if="ant:if">
<param name="input.map.url" expression="${html5.map.url}" if:set="html5.map.url"/>
<param name="nav-toc" expression="${html5.nav-toc}" if:set="html5.nav-toc"/>
</params>
| <?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of the DITA Open Toolkit project.
Copyright 2015 Jarno Elovirta
See the accompanying LICENSE file for applicable license.
-->
- <params>
+ <params xmlns:if="ant:if">
- <param name="input.map.url" expression="${html5.map.url}" if="html5.map.url"/>
? -
+ <param name="input.map.url" expression="${html5.map.url}" if:set="html5.map.url"/>
? ++++
- <param name="nav-toc" expression="${html5.nav-toc}" if="html5.nav-toc"/>
+ <param name="nav-toc" expression="${html5.nav-toc}" if:set="html5.nav-toc"/>
? ++++
</params> | 6 | 0.5 | 3 | 3 |
090ff88fe5a4fc8be9f40d9517af006143dc9de3 | src/test/e2e/welcome.po.ts | src/test/e2e/welcome.po.ts | /// <reference path="../../../dts/protractor.d.ts" />
declare var by: AureliaSeleniumPlugins;
class PageObject_Welcome {
constructor() {
}
getGreeting() {
return element(by.tagName('h2')).getText();
}
setFirstname(value) {
return element(by.valueBind('firstName')).clear()["sendKeys"](value);
}
setLastname(value) {
return element(by.valueBind('lastName')).clear()["sendKeys"](value);
}
getFullname() {
return element(by.css('.help-block')).getText();
}
pressSubmitButton() {
return element(by.css('button[type="submit"]')).click();
}
openAlertDialog() {
return browser.wait(() => {
this.pressSubmitButton();
return browser.switchTo().alert().then(
// use alert.accept instead of alert.dismiss which results in a browser crash
function(alert) { alert.accept(); return true; },
function() { return false; }
);
}, 100);
}
}
export = PageObject_Welcome;
| /// <reference path="../../../dts/protractor.d.ts" />
declare var by: AureliaSeleniumPlugins;
class PageObject_Welcome {
constructor() {
}
getGreeting() {
return element(by.tagName('h2')).getText();
}
setFirstname(value) {
var el = element(by.valueBind('firstName'));
el.clear();
return el.sendKeys(value);
}
setLastname(value) {
var el = element(by.valueBind('lastName'));
el.clear();
return el.sendKeys(value);
}
getFullname() {
return element(by.css('.help-block')).getText();
}
pressSubmitButton() {
return element(by.css('button[type="submit"]')).click();
}
openAlertDialog() {
return browser.wait(() => {
this.pressSubmitButton();
return browser.switchTo().alert().then(
// use alert.accept instead of alert.dismiss which results in a browser crash
function(alert) { alert.accept(); return true; },
function() { return false; }
);
}, 100);
}
}
export = PageObject_Welcome;
| Rewrite e2e test to avoid compilation warning | Rewrite e2e test to avoid compilation warning
| TypeScript | mit | bohnen/aurelia-skeleton-navigation-gulp-typescript,Enrapt/aurelia-skeleton-navigation-gulp-typescript,Enrapt/aurelia-skeleton-navigation-gulp-typescript,bohnen/aurelia-skeleton-navigation-gulp-typescript,bohnen/aurelia-skeleton-navigation-gulp-typescript,Enrapt/aurelia-skeleton-navigation-gulp-typescript | typescript | ## Code Before:
/// <reference path="../../../dts/protractor.d.ts" />
declare var by: AureliaSeleniumPlugins;
class PageObject_Welcome {
constructor() {
}
getGreeting() {
return element(by.tagName('h2')).getText();
}
setFirstname(value) {
return element(by.valueBind('firstName')).clear()["sendKeys"](value);
}
setLastname(value) {
return element(by.valueBind('lastName')).clear()["sendKeys"](value);
}
getFullname() {
return element(by.css('.help-block')).getText();
}
pressSubmitButton() {
return element(by.css('button[type="submit"]')).click();
}
openAlertDialog() {
return browser.wait(() => {
this.pressSubmitButton();
return browser.switchTo().alert().then(
// use alert.accept instead of alert.dismiss which results in a browser crash
function(alert) { alert.accept(); return true; },
function() { return false; }
);
}, 100);
}
}
export = PageObject_Welcome;
## Instruction:
Rewrite e2e test to avoid compilation warning
## Code After:
/// <reference path="../../../dts/protractor.d.ts" />
declare var by: AureliaSeleniumPlugins;
class PageObject_Welcome {
constructor() {
}
getGreeting() {
return element(by.tagName('h2')).getText();
}
setFirstname(value) {
var el = element(by.valueBind('firstName'));
el.clear();
return el.sendKeys(value);
}
setLastname(value) {
var el = element(by.valueBind('lastName'));
el.clear();
return el.sendKeys(value);
}
getFullname() {
return element(by.css('.help-block')).getText();
}
pressSubmitButton() {
return element(by.css('button[type="submit"]')).click();
}
openAlertDialog() {
return browser.wait(() => {
this.pressSubmitButton();
return browser.switchTo().alert().then(
// use alert.accept instead of alert.dismiss which results in a browser crash
function(alert) { alert.accept(); return true; },
function() { return false; }
);
}, 100);
}
}
export = PageObject_Welcome;
| /// <reference path="../../../dts/protractor.d.ts" />
declare var by: AureliaSeleniumPlugins;
class PageObject_Welcome {
constructor() {
}
getGreeting() {
return element(by.tagName('h2')).getText();
}
setFirstname(value) {
- return element(by.valueBind('firstName')).clear()["sendKeys"](value);
+ var el = element(by.valueBind('firstName'));
+ el.clear();
+ return el.sendKeys(value);
}
setLastname(value) {
- return element(by.valueBind('lastName')).clear()["sendKeys"](value);
+ var el = element(by.valueBind('lastName'));
+ el.clear();
+ return el.sendKeys(value);
}
getFullname() {
return element(by.css('.help-block')).getText();
}
pressSubmitButton() {
return element(by.css('button[type="submit"]')).click();
}
openAlertDialog() {
return browser.wait(() => {
this.pressSubmitButton();
return browser.switchTo().alert().then(
// use alert.accept instead of alert.dismiss which results in a browser crash
function(alert) { alert.accept(); return true; },
function() { return false; }
);
}, 100);
}
}
export = PageObject_Welcome; | 8 | 0.181818 | 6 | 2 |
53fb18edadea3f42a5628b778b120adf1c44c651 | index.html | index.html | <!DOCTYPE html>
<html lang="nl">
<head>
<title>Tijdelijk niet beschikbaar</title>
<meta charset="utf-8">
<meta name="description" content="Fietsenwinkel gelegen in Lier.">
<meta name="viewport" content="initial-scale=1.0, width=device-width">
<link rel="stylesheet" href="stylesheet.css" type="text/css" media="screen">
</head>
<body>
<p><h1>Deze website is tijdelijk niet beschikbaar door updates. Sorry voor het ongemak
<h1>-De Veloshop</p>
</body>
| <!DOCTYPE html>
<html lang="nl">
<head>
<title>Tijdelijk niet beschikbaar</title>
<meta charset="utf-8">
<meta name="description" content="Fietsenwinkel gelegen in Lier.">
<meta name="viewport" content="initial-scale=1.0, width=device-width">
<link rel="stylesheet" href="stylesheet.css" type="text/css" media="screen">
</head>
<body>
<p><h1>Deze website is tijdelijk niet beschikbaar door updates. We gaan proberen dit zo snel mogelijk te verhelpen. Sorry voor het ongemak
<h1>-De Veloshop</p>
</body>
| Update ik weet niet meer hoeveel. | Update ik weet niet meer hoeveel.
teskst verandert van updates
| HTML | mit | develoshop/Home | html | ## Code Before:
<!DOCTYPE html>
<html lang="nl">
<head>
<title>Tijdelijk niet beschikbaar</title>
<meta charset="utf-8">
<meta name="description" content="Fietsenwinkel gelegen in Lier.">
<meta name="viewport" content="initial-scale=1.0, width=device-width">
<link rel="stylesheet" href="stylesheet.css" type="text/css" media="screen">
</head>
<body>
<p><h1>Deze website is tijdelijk niet beschikbaar door updates. Sorry voor het ongemak
<h1>-De Veloshop</p>
</body>
## Instruction:
Update ik weet niet meer hoeveel.
teskst verandert van updates
## Code After:
<!DOCTYPE html>
<html lang="nl">
<head>
<title>Tijdelijk niet beschikbaar</title>
<meta charset="utf-8">
<meta name="description" content="Fietsenwinkel gelegen in Lier.">
<meta name="viewport" content="initial-scale=1.0, width=device-width">
<link rel="stylesheet" href="stylesheet.css" type="text/css" media="screen">
</head>
<body>
<p><h1>Deze website is tijdelijk niet beschikbaar door updates. We gaan proberen dit zo snel mogelijk te verhelpen. Sorry voor het ongemak
<h1>-De Veloshop</p>
</body>
| <!DOCTYPE html>
<html lang="nl">
<head>
<title>Tijdelijk niet beschikbaar</title>
<meta charset="utf-8">
<meta name="description" content="Fietsenwinkel gelegen in Lier.">
<meta name="viewport" content="initial-scale=1.0, width=device-width">
<link rel="stylesheet" href="stylesheet.css" type="text/css" media="screen">
</head>
<body>
- <p><h1>Deze website is tijdelijk niet beschikbaar door updates. Sorry voor het ongemak
+ <p><h1>Deze website is tijdelijk niet beschikbaar door updates. We gaan proberen dit zo snel mogelijk te verhelpen. Sorry voor het ongemak
? ++++++++++++++++++++++++++++++++++++++++++++++++++++
<h1>-De Veloshop</p>
</body> | 2 | 0.133333 | 1 | 1 |
99fe2da33621262796ca9fdf5cb080de43008a25 | baseUris-example.json | baseUris-example.json | {
"stop": "http://data.gtfs.org/example/stops/{stop_id}",
"route": "http://data.gtfs.org/example/routes/{routes.route_short_name}",
"trip": "http://data.gtfs.org/example/trips/{trip_id}/{routes.route_short_name}{trips.startTime}",
"connection": "http://example/linkedconnections.org/connections/{trips.startTime}/{connection.departureStop}/{trips.trip_id}",
"resolve": {
"route_short_id": "connection.trip.route.route_id.substring(0,5)",
"trip_id": "connection.trip.trip_id",
"trip_startTime": "format(connection.trip.startTime, 'YYYYMMDDTHHmm');",
"departureStop": "connection.departureStop"
}
}
| {
"stop": "http://data.gtfs.org/example/stops/{stop_id}",
"route": "http://data.gtfs.org/example/routes/{route_short_id}",
"trip": "http://data.gtfs.org/example/trips/{trip_id}/{trip_startTime}",
"connection": "http://example/linkedconnections.org/connections/{trip_startTime}/{departureStop}/{trip_id}",
"resolve": {
"route_short_id": "connection.trip.route.route_id.substring(0,5)",
"trip_id": "connection.trip.trip_id",
"trip_startTime": "format(connection.trip.startTime, 'YYYYMMDDTHHmm');",
"departureStop": "connection.departureStop"
}
}
| Fix for URI resolve bug | Fix for URI resolve bug
| JSON | mit | linkedconnections/gtfs2lc,linkedconnections/gtfs2lc | json | ## Code Before:
{
"stop": "http://data.gtfs.org/example/stops/{stop_id}",
"route": "http://data.gtfs.org/example/routes/{routes.route_short_name}",
"trip": "http://data.gtfs.org/example/trips/{trip_id}/{routes.route_short_name}{trips.startTime}",
"connection": "http://example/linkedconnections.org/connections/{trips.startTime}/{connection.departureStop}/{trips.trip_id}",
"resolve": {
"route_short_id": "connection.trip.route.route_id.substring(0,5)",
"trip_id": "connection.trip.trip_id",
"trip_startTime": "format(connection.trip.startTime, 'YYYYMMDDTHHmm');",
"departureStop": "connection.departureStop"
}
}
## Instruction:
Fix for URI resolve bug
## Code After:
{
"stop": "http://data.gtfs.org/example/stops/{stop_id}",
"route": "http://data.gtfs.org/example/routes/{route_short_id}",
"trip": "http://data.gtfs.org/example/trips/{trip_id}/{trip_startTime}",
"connection": "http://example/linkedconnections.org/connections/{trip_startTime}/{departureStop}/{trip_id}",
"resolve": {
"route_short_id": "connection.trip.route.route_id.substring(0,5)",
"trip_id": "connection.trip.trip_id",
"trip_startTime": "format(connection.trip.startTime, 'YYYYMMDDTHHmm');",
"departureStop": "connection.departureStop"
}
}
| {
"stop": "http://data.gtfs.org/example/stops/{stop_id}",
- "route": "http://data.gtfs.org/example/routes/{routes.route_short_name}",
? ------- ^^^^
+ "route": "http://data.gtfs.org/example/routes/{route_short_id}",
? ^^
- "trip": "http://data.gtfs.org/example/trips/{trip_id}/{routes.route_short_name}{trips.startTime}",
? ------------------------- ^^
+ "trip": "http://data.gtfs.org/example/trips/{trip_id}/{trip_startTime}",
? ^
- "connection": "http://example/linkedconnections.org/connections/{trips.startTime}/{connection.departureStop}/{trips.trip_id}",
? ^^ ----------- ------
+ "connection": "http://example/linkedconnections.org/connections/{trip_startTime}/{departureStop}/{trip_id}",
? ^
"resolve": {
"route_short_id": "connection.trip.route.route_id.substring(0,5)",
"trip_id": "connection.trip.trip_id",
"trip_startTime": "format(connection.trip.startTime, 'YYYYMMDDTHHmm');",
"departureStop": "connection.departureStop"
}
}
+ | 7 | 0.583333 | 4 | 3 |
8f37e04d78440f20eb1c09630c35ad74e85b19a4 | spec/spec_helper.rb | spec/spec_helper.rb | $LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'rubygems'
require 'bundler'
require 'bundler/setup'
Bundler.setup(:development)
require 'mailgun'
require_relative 'unit/connection/test_client'
# INSERT YOUR API KEYS HERE
APIKEY = "key"
PUB_APIKEY = "pubkey"
APIHOST = "api.mailgun.net"
APIVERSION = "v2"
SSL= true
| $LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'rubygems'
require 'bundler'
require 'bundler/setup'
Bundler.setup(:development)
require 'mailgun'
require_relative 'unit/connection/test_client'
# INSERT YOUR API KEYS HERE
APIKEY = ENV['MAILGUN_API_KEY']
PUB_APIKEY = ENV['MAILGUN_PUBLIC_KEY']
APIHOST = "api.mailgun.net"
APIVERSION = "v2"
SSL = true
| Use environment variables for API keys | Use environment variables for API keys
Since we have to use our own keys to run the tests on this gem, support
using environment variables so we don’t have to edit this file and
remember to revert it back before committing. This way we can run tests
like:
`MAILGUN_API_KEY=abcd MAILGUN_PUBLIC_KEY=1234 bundle exec rspec`
| Ruby | apache-2.0 | veracross/mailgun-ruby | ruby | ## Code Before:
$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'rubygems'
require 'bundler'
require 'bundler/setup'
Bundler.setup(:development)
require 'mailgun'
require_relative 'unit/connection/test_client'
# INSERT YOUR API KEYS HERE
APIKEY = "key"
PUB_APIKEY = "pubkey"
APIHOST = "api.mailgun.net"
APIVERSION = "v2"
SSL= true
## Instruction:
Use environment variables for API keys
Since we have to use our own keys to run the tests on this gem, support
using environment variables so we don’t have to edit this file and
remember to revert it back before committing. This way we can run tests
like:
`MAILGUN_API_KEY=abcd MAILGUN_PUBLIC_KEY=1234 bundle exec rspec`
## Code After:
$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'rubygems'
require 'bundler'
require 'bundler/setup'
Bundler.setup(:development)
require 'mailgun'
require_relative 'unit/connection/test_client'
# INSERT YOUR API KEYS HERE
APIKEY = ENV['MAILGUN_API_KEY']
PUB_APIKEY = ENV['MAILGUN_PUBLIC_KEY']
APIHOST = "api.mailgun.net"
APIVERSION = "v2"
SSL = true
| $LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'rubygems'
require 'bundler'
require 'bundler/setup'
Bundler.setup(:development)
require 'mailgun'
require_relative 'unit/connection/test_client'
# INSERT YOUR API KEYS HERE
- APIKEY = "key"
- PUB_APIKEY = "pubkey"
+ APIKEY = ENV['MAILGUN_API_KEY']
+ PUB_APIKEY = ENV['MAILGUN_PUBLIC_KEY']
APIHOST = "api.mailgun.net"
APIVERSION = "v2"
- SSL= true
+ SSL = true
? +
| 6 | 0.4 | 3 | 3 |
f7c5eb1e93f8cb5f75fa23825cee0389faaf51d0 | src/js/components/WindowList.js | src/js/components/WindowList.js | import React from 'react'
import { inject, observer } from 'mobx-react'
import Window from './Window'
import DragPreview from './DragPreview'
@inject('windowStore')
@observer
export default class App extends React.Component {
resize = () => {
const bottom = Math.max(
...Object.values(this.refs).map(
x => x.getBoundingClientRect().bottom
)
)
const height = `${bottom}px`
document.getElementsByTagName('html')[0].style.height = height
document.body.style.height = height
}
componentDidUpdate = this.resize
componentDidMount = this.resize
render () {
const { windowStore: { windows } } = this.props
const winList = windows.map((win) => (
<Window
key={win.id}
ref={win.id}
containment={() => this.containment}
dragPreview={() => this.dragPreview}
{...win}
/>
))
return (
<div ref={(el) => { this.containment = el || this.containment }}
style={{
overflow: 'auto',
flex: '1 1 auto'
}}>
<DragPreview
setDragPreview={(dragPreview) => { this.dragPreview = dragPreview }}
/>
{winList}
</div>
)
}
}
| import React from 'react'
import { inject, observer } from 'mobx-react'
import Window from './Window'
import DragPreview from './DragPreview'
@inject('windowStore')
@observer
export default class App extends React.Component {
resize = () => {
const bottom = Math.max(
...Object.values(this.refs).map(
x => x.getBoundingClientRect().bottom
)
)
const height = `${Math.max(bottom, 300)}px`
document.getElementsByTagName('html')[0].style.height = height
document.body.style.height = height
}
componentDidUpdate = this.resize
componentDidMount = this.resize
render () {
const { windowStore: { windows } } = this.props
const winList = windows.map((win) => (
<Window
key={win.id}
ref={win.id}
containment={() => this.containment}
dragPreview={() => this.dragPreview}
{...win}
/>
))
return (
<div ref={(el) => { this.containment = el || this.containment }}
style={{
overflow: 'auto',
flex: '1 1 auto'
}}>
<DragPreview
setDragPreview={(dragPreview) => { this.dragPreview = dragPreview }}
/>
{winList}
</div>
)
}
}
| Make min height = 300px | Make min height = 300px
| JavaScript | mit | xcv58/Tab-Manager-v2,xcv58/Tab-Manager-v2,xcv58/Tab-Manager-v2,xcv58/Tab-Manager-v2 | javascript | ## Code Before:
import React from 'react'
import { inject, observer } from 'mobx-react'
import Window from './Window'
import DragPreview from './DragPreview'
@inject('windowStore')
@observer
export default class App extends React.Component {
resize = () => {
const bottom = Math.max(
...Object.values(this.refs).map(
x => x.getBoundingClientRect().bottom
)
)
const height = `${bottom}px`
document.getElementsByTagName('html')[0].style.height = height
document.body.style.height = height
}
componentDidUpdate = this.resize
componentDidMount = this.resize
render () {
const { windowStore: { windows } } = this.props
const winList = windows.map((win) => (
<Window
key={win.id}
ref={win.id}
containment={() => this.containment}
dragPreview={() => this.dragPreview}
{...win}
/>
))
return (
<div ref={(el) => { this.containment = el || this.containment }}
style={{
overflow: 'auto',
flex: '1 1 auto'
}}>
<DragPreview
setDragPreview={(dragPreview) => { this.dragPreview = dragPreview }}
/>
{winList}
</div>
)
}
}
## Instruction:
Make min height = 300px
## Code After:
import React from 'react'
import { inject, observer } from 'mobx-react'
import Window from './Window'
import DragPreview from './DragPreview'
@inject('windowStore')
@observer
export default class App extends React.Component {
resize = () => {
const bottom = Math.max(
...Object.values(this.refs).map(
x => x.getBoundingClientRect().bottom
)
)
const height = `${Math.max(bottom, 300)}px`
document.getElementsByTagName('html')[0].style.height = height
document.body.style.height = height
}
componentDidUpdate = this.resize
componentDidMount = this.resize
render () {
const { windowStore: { windows } } = this.props
const winList = windows.map((win) => (
<Window
key={win.id}
ref={win.id}
containment={() => this.containment}
dragPreview={() => this.dragPreview}
{...win}
/>
))
return (
<div ref={(el) => { this.containment = el || this.containment }}
style={{
overflow: 'auto',
flex: '1 1 auto'
}}>
<DragPreview
setDragPreview={(dragPreview) => { this.dragPreview = dragPreview }}
/>
{winList}
</div>
)
}
}
| import React from 'react'
import { inject, observer } from 'mobx-react'
import Window from './Window'
import DragPreview from './DragPreview'
@inject('windowStore')
@observer
export default class App extends React.Component {
resize = () => {
const bottom = Math.max(
...Object.values(this.refs).map(
x => x.getBoundingClientRect().bottom
)
)
- const height = `${bottom}px`
+ const height = `${Math.max(bottom, 300)}px`
? +++++++++ ++++++
document.getElementsByTagName('html')[0].style.height = height
document.body.style.height = height
}
componentDidUpdate = this.resize
componentDidMount = this.resize
render () {
const { windowStore: { windows } } = this.props
const winList = windows.map((win) => (
<Window
key={win.id}
ref={win.id}
containment={() => this.containment}
dragPreview={() => this.dragPreview}
{...win}
/>
))
return (
<div ref={(el) => { this.containment = el || this.containment }}
style={{
overflow: 'auto',
flex: '1 1 auto'
}}>
<DragPreview
setDragPreview={(dragPreview) => { this.dragPreview = dragPreview }}
/>
{winList}
</div>
)
}
} | 2 | 0.042553 | 1 | 1 |
fb2876902f23c74e909f1721d00fd1009942f7dd | lib/polish-test-file.js | lib/polish-test-file.js | var _ = require('lodash');
module.exports = function(ast, filePath, plugins) {
var errors = [],
warnings = [];
_.each(plugins, function(plugin){
var results,
array;
if (plugin.severity === 2) {
array = errors;
} else if (plugin.severity === 1) {
array = warnings;
} else {
return;
}
results = plugin.test(ast, filePath, plugin.options);
if (!results || !results.length || !_.isArray(results)){
return;
}
// Remove failures that are on plugins with inline configs
_.each(results, function (result){
if (!result.node || !result.node.ruleConfig) {
return;
}
if (result.node.ruleConfig[plugin.name] === false) {
results = _.without(results, result);
}
});
_.each(results, function(result){
array.push({
plugin: _.pick(plugin, ['name', 'message', 'severity']),
error: result
});
});
});
return {
errors : errors,
warnings : warnings
};
}; | var _ = require('lodash');
module.exports = function(ast, filePath, plugins) {
var errors = [],
warnings = [];
_.each(plugins, function(plugin){
var results,
array;
if (plugin.severity === 2) {
array = errors;
} else if (plugin.severity === 1) {
array = warnings;
} else {
return;
}
results = plugin.test(ast, filePath, plugin.options);
if (!results || !results.length || !_.isArray(results)){
return;
}
// Remove failures that are on plugins with inline configs
_.each(results, function (result){
if (!result.node || !result.node._polishIgnore || !_.contains(result.node._polishIgnore, plugin.name)) {
return;
}
results = _.without(results, result);
});
_.each(results, function(result){
array.push({
plugin: _.pick(plugin, ['name', 'message', 'severity']),
error: result
});
});
});
return {
errors : errors,
warnings : warnings
};
}; | Exclude results with matching inline configs when testing files | bugfix: Exclude results with matching inline configs when testing files
| JavaScript | mit | brendanlacroix/polish-css | javascript | ## Code Before:
var _ = require('lodash');
module.exports = function(ast, filePath, plugins) {
var errors = [],
warnings = [];
_.each(plugins, function(plugin){
var results,
array;
if (plugin.severity === 2) {
array = errors;
} else if (plugin.severity === 1) {
array = warnings;
} else {
return;
}
results = plugin.test(ast, filePath, plugin.options);
if (!results || !results.length || !_.isArray(results)){
return;
}
// Remove failures that are on plugins with inline configs
_.each(results, function (result){
if (!result.node || !result.node.ruleConfig) {
return;
}
if (result.node.ruleConfig[plugin.name] === false) {
results = _.without(results, result);
}
});
_.each(results, function(result){
array.push({
plugin: _.pick(plugin, ['name', 'message', 'severity']),
error: result
});
});
});
return {
errors : errors,
warnings : warnings
};
};
## Instruction:
bugfix: Exclude results with matching inline configs when testing files
## Code After:
var _ = require('lodash');
module.exports = function(ast, filePath, plugins) {
var errors = [],
warnings = [];
_.each(plugins, function(plugin){
var results,
array;
if (plugin.severity === 2) {
array = errors;
} else if (plugin.severity === 1) {
array = warnings;
} else {
return;
}
results = plugin.test(ast, filePath, plugin.options);
if (!results || !results.length || !_.isArray(results)){
return;
}
// Remove failures that are on plugins with inline configs
_.each(results, function (result){
if (!result.node || !result.node._polishIgnore || !_.contains(result.node._polishIgnore, plugin.name)) {
return;
}
results = _.without(results, result);
});
_.each(results, function(result){
array.push({
plugin: _.pick(plugin, ['name', 'message', 'severity']),
error: result
});
});
});
return {
errors : errors,
warnings : warnings
};
}; | - var _ = require('lodash');
? ---
+ var _ = require('lodash');
module.exports = function(ast, filePath, plugins) {
var errors = [],
warnings = [];
_.each(plugins, function(plugin){
var results,
array;
if (plugin.severity === 2) {
array = errors;
} else if (plugin.severity === 1) {
array = warnings;
} else {
return;
}
results = plugin.test(ast, filePath, plugin.options);
if (!results || !results.length || !_.isArray(results)){
return;
}
// Remove failures that are on plugins with inline configs
_.each(results, function (result){
- if (!result.node || !result.node.ruleConfig) {
+ if (!result.node || !result.node._polishIgnore || !_.contains(result.node._polishIgnore, plugin.name)) {
return;
}
- if (result.node.ruleConfig[plugin.name] === false) {
- results = _.without(results, result);
? --
+ results = _.without(results, result);
- }
});
_.each(results, function(result){
array.push({
plugin: _.pick(plugin, ['name', 'message', 'severity']),
error: result
});
});
});
return {
errors : errors,
warnings : warnings
};
}; | 8 | 0.166667 | 3 | 5 |
d9ce37a6631725a72cbd24e3d9d8c68e367c02a7 | requirements.txt | requirements.txt |
pbr>=0.6,!=0.7,<1.0
argparse
Babel>=1.3
iso8601>=0.1.9
netaddr>=0.7.12
oslo.config>=1.9.3 # Apache-2.0
oslo.i18n>=1.5.0 # Apache-2.0
oslo.serialization>=1.4.0 # Apache-2.0
oslo.utils>=1.4.0 # Apache-2.0
PrettyTable>=0.7,<0.8
requests>=2.2.0,!=2.4.0
six>=1.9.0
stevedore>=1.3.0 # Apache-2.0
|
argparse
Babel>=1.3
iso8601>=0.1.9
netaddr>=0.7.12
oslo.config>=1.9.3 # Apache-2.0
oslo.i18n>=1.5.0 # Apache-2.0
oslo.serialization>=1.4.0 # Apache-2.0
oslo.utils>=1.4.0 # Apache-2.0
PrettyTable>=0.7,<0.8
requests>=2.2.0,!=2.4.0
six>=1.9.0
stevedore>=1.3.0 # Apache-2.0
| Remove pbr as runtime depend | Remove pbr as runtime depend
It's neither used nor desired.
Change-Id: Idba1b092054ea435f874374aa94919d103ac3be0
| Text | apache-2.0 | jamielennox/keystoneauth,citrix-openstack-build/keystoneauth,sileht/keystoneauth | text | ## Code Before:
pbr>=0.6,!=0.7,<1.0
argparse
Babel>=1.3
iso8601>=0.1.9
netaddr>=0.7.12
oslo.config>=1.9.3 # Apache-2.0
oslo.i18n>=1.5.0 # Apache-2.0
oslo.serialization>=1.4.0 # Apache-2.0
oslo.utils>=1.4.0 # Apache-2.0
PrettyTable>=0.7,<0.8
requests>=2.2.0,!=2.4.0
six>=1.9.0
stevedore>=1.3.0 # Apache-2.0
## Instruction:
Remove pbr as runtime depend
It's neither used nor desired.
Change-Id: Idba1b092054ea435f874374aa94919d103ac3be0
## Code After:
argparse
Babel>=1.3
iso8601>=0.1.9
netaddr>=0.7.12
oslo.config>=1.9.3 # Apache-2.0
oslo.i18n>=1.5.0 # Apache-2.0
oslo.serialization>=1.4.0 # Apache-2.0
oslo.utils>=1.4.0 # Apache-2.0
PrettyTable>=0.7,<0.8
requests>=2.2.0,!=2.4.0
six>=1.9.0
stevedore>=1.3.0 # Apache-2.0
| -
- pbr>=0.6,!=0.7,<1.0
argparse
Babel>=1.3
iso8601>=0.1.9
netaddr>=0.7.12
oslo.config>=1.9.3 # Apache-2.0
oslo.i18n>=1.5.0 # Apache-2.0
oslo.serialization>=1.4.0 # Apache-2.0
oslo.utils>=1.4.0 # Apache-2.0
PrettyTable>=0.7,<0.8
requests>=2.2.0,!=2.4.0
six>=1.9.0
stevedore>=1.3.0 # Apache-2.0 | 2 | 0.133333 | 0 | 2 |
77a5ecc7c406e4a6acf814a2f0381dc605e0d14c | leds/led_dance.py | leds/led_dance.py |
import pyb
def led_dance(delay):
dots = {}
control = pyb.Switch(1)
while True:
if not control.value():
dots[pyb.millis() % 25] = 16
for d in dots:
pyb.pixel(d, dots[d])
if dots[d] == 0:
del(dots[d])
else:
dots[d] = int(dots[d]/2)
pyb.delay(delay)
led_dance(101)
|
import microbit
def led_dance(delay):
dots = [ [0]*5, [0]*5, [0]*5, [0]*5, [0]*5 ]
microbit.display.set_display_mode(1)
while True:
dots[microbit.random(5)][microbit.random(5)] = 128
for i in range(5):
for j in range(5):
microbit.display.image.set_pixel_value(i, j, dots[i][j])
dots[i][j] = int(dots[i][j]/2)
microbit.sleep(delay)
led_dance(100)
| Update for new version of micropython for microbit | Update for new version of micropython for microbit
| Python | mit | jrmhaig/microbit_playground | python | ## Code Before:
import pyb
def led_dance(delay):
dots = {}
control = pyb.Switch(1)
while True:
if not control.value():
dots[pyb.millis() % 25] = 16
for d in dots:
pyb.pixel(d, dots[d])
if dots[d] == 0:
del(dots[d])
else:
dots[d] = int(dots[d]/2)
pyb.delay(delay)
led_dance(101)
## Instruction:
Update for new version of micropython for microbit
## Code After:
import microbit
def led_dance(delay):
dots = [ [0]*5, [0]*5, [0]*5, [0]*5, [0]*5 ]
microbit.display.set_display_mode(1)
while True:
dots[microbit.random(5)][microbit.random(5)] = 128
for i in range(5):
for j in range(5):
microbit.display.image.set_pixel_value(i, j, dots[i][j])
dots[i][j] = int(dots[i][j]/2)
microbit.sleep(delay)
led_dance(100)
|
- import pyb
+ import microbit
def led_dance(delay):
- dots = {}
- control = pyb.Switch(1)
+ dots = [ [0]*5, [0]*5, [0]*5, [0]*5, [0]*5 ]
+ microbit.display.set_display_mode(1)
while True:
+ dots[microbit.random(5)][microbit.random(5)] = 128
+ for i in range(5):
+ for j in range(5):
+ microbit.display.image.set_pixel_value(i, j, dots[i][j])
- if not control.value():
- dots[pyb.millis() % 25] = 16
- for d in dots:
- pyb.pixel(d, dots[d])
- if dots[d] == 0:
- del(dots[d])
- else:
- dots[d] = int(dots[d]/2)
? ^ ^
+ dots[i][j] = int(dots[i][j]/2)
? ^^^^ ^^^^
- pyb.delay(delay)
+ microbit.sleep(delay)
- led_dance(101)
? ^
+ led_dance(100)
? ^
| 23 | 1.277778 | 10 | 13 |
ce61d9b9836d3f963df93a4bb05db594d62548a4 | lib/Support/StringSaver.cpp | lib/Support/StringSaver.cpp | //===-- StringSaver.cpp ---------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "llvm/Support/StringSaver.h"
using namespace llvm;
StringRef StringSaver::save(StringRef S) {
char *P = Alloc.Allocate<char>(S.size() + 1);
memcpy(P, S.data(), S.size());
P[S.size()] = '\0';
return StringRef(P, S.size());
}
StringRef UniqueStringSaver::save(StringRef S) {
auto R = Unique.insert(S);
if (R.second) // cache miss, need to actually save the string
*R.first = Strings.save(S); // safe replacement with equal value
return *R.first;
}
| //===-- StringSaver.cpp ---------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "llvm/Support/StringSaver.h"
using namespace llvm;
StringRef StringSaver::save(StringRef S) {
char *P = Alloc.Allocate<char>(S.size() + 1);
if (!S.empty())
memcpy(P, S.data(), S.size());
P[S.size()] = '\0';
return StringRef(P, S.size());
}
StringRef UniqueStringSaver::save(StringRef S) {
auto R = Unique.insert(S);
if (R.second) // cache miss, need to actually save the string
*R.first = Strings.save(S); // safe replacement with equal value
return *R.first;
}
| Fix an undefined behavior when storing an empty StringRef. | Fix an undefined behavior when storing an empty StringRef.
Summary: Passing a nullptr to memcpy is UB.
Reviewers: ioeric
Subscribers: llvm-commits, cfe-commits
Differential Revision: https://reviews.llvm.org/D50966
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@340170 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm | c++ | ## Code Before:
//===-- StringSaver.cpp ---------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "llvm/Support/StringSaver.h"
using namespace llvm;
StringRef StringSaver::save(StringRef S) {
char *P = Alloc.Allocate<char>(S.size() + 1);
memcpy(P, S.data(), S.size());
P[S.size()] = '\0';
return StringRef(P, S.size());
}
StringRef UniqueStringSaver::save(StringRef S) {
auto R = Unique.insert(S);
if (R.second) // cache miss, need to actually save the string
*R.first = Strings.save(S); // safe replacement with equal value
return *R.first;
}
## Instruction:
Fix an undefined behavior when storing an empty StringRef.
Summary: Passing a nullptr to memcpy is UB.
Reviewers: ioeric
Subscribers: llvm-commits, cfe-commits
Differential Revision: https://reviews.llvm.org/D50966
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@340170 91177308-0d34-0410-b5e6-96231b3b80d8
## Code After:
//===-- StringSaver.cpp ---------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "llvm/Support/StringSaver.h"
using namespace llvm;
StringRef StringSaver::save(StringRef S) {
char *P = Alloc.Allocate<char>(S.size() + 1);
if (!S.empty())
memcpy(P, S.data(), S.size());
P[S.size()] = '\0';
return StringRef(P, S.size());
}
StringRef UniqueStringSaver::save(StringRef S) {
auto R = Unique.insert(S);
if (R.second) // cache miss, need to actually save the string
*R.first = Strings.save(S); // safe replacement with equal value
return *R.first;
}
| //===-- StringSaver.cpp ---------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "llvm/Support/StringSaver.h"
using namespace llvm;
StringRef StringSaver::save(StringRef S) {
char *P = Alloc.Allocate<char>(S.size() + 1);
+ if (!S.empty())
- memcpy(P, S.data(), S.size());
+ memcpy(P, S.data(), S.size());
? ++
P[S.size()] = '\0';
return StringRef(P, S.size());
}
StringRef UniqueStringSaver::save(StringRef S) {
auto R = Unique.insert(S);
if (R.second) // cache miss, need to actually save the string
*R.first = Strings.save(S); // safe replacement with equal value
return *R.first;
} | 3 | 0.115385 | 2 | 1 |
7a05f0a7a10f62944885da1ba1710d7f4d43c588 | app/models/spree/product_decorator.rb | app/models/spree/product_decorator.rb | Spree::Product.class_eval do
def option_values
@_option_values ||= Spree::OptionValue.for_product(self).order(:position).sort_by {|ov| ov.option_type.position }
end
def grouped_option_values
@_grouped_option_values ||= option_values.group_by(&:option_type)
end
def variants_for_option_value(value)
@_variant_option_values ||= variants.includes(:option_values).all
@_variant_option_values.select { |i| i.option_value_ids.include?(value.id) }
end
def variant_options_hash
return @_variant_options_hash if @_variant_options_hash
hash = {}
variants.includes(:option_values).each do |variant|
variant.option_values.each do |ov|
otid = ov.option_type_id.to_s
ovid = ov.id.to_s
hash[otid] ||= {}
hash[otid][ovid] ||= {}
hash[otid][ovid][variant.id.to_s] = variant.to_hash
end
end
@_variant_options_hash = hash
end
end
| Spree::Product.class_eval do
def option_values
@_option_values ||= Spree::OptionValue.find_by_sql(["SELECT ov.id FROM spree_option_values ov INNER JOIN spree_option_values_variants ovv ON ovv.option_value_id = ov.id INNER JOIN spree_variants v on ovv.variant_id = v.id WHERE v.product_id = ? ORDER BY v.position", self.id])
end
def grouped_option_values
@_grouped_option_values ||= option_values.group_by(&:option_type)
end
def variants_for_option_value(value)
@_variant_option_values ||= variants.includes(:option_values).all
@_variant_option_values.select { |i| i.option_value_ids.include?(value.id) }
end
def variant_options_hash
return @_variant_options_hash if @_variant_options_hash
hash = {}
variants.includes(:option_values).each do |variant|
variant.option_values.each do |ov|
otid = ov.option_type_id.to_s
ovid = ov.id.to_s
hash[otid] ||= {}
hash[otid][ovid] ||= {}
hash[otid][ovid][variant.id.to_s] = variant.to_hash
end
end
@_variant_options_hash = hash
end
end
| Order options by variant position | Order options by variant position
| Ruby | bsd-3-clause | Scoutmob/spree_variant_options,Scoutmob/spree_variant_options,Scoutmob/spree_variant_options | ruby | ## Code Before:
Spree::Product.class_eval do
def option_values
@_option_values ||= Spree::OptionValue.for_product(self).order(:position).sort_by {|ov| ov.option_type.position }
end
def grouped_option_values
@_grouped_option_values ||= option_values.group_by(&:option_type)
end
def variants_for_option_value(value)
@_variant_option_values ||= variants.includes(:option_values).all
@_variant_option_values.select { |i| i.option_value_ids.include?(value.id) }
end
def variant_options_hash
return @_variant_options_hash if @_variant_options_hash
hash = {}
variants.includes(:option_values).each do |variant|
variant.option_values.each do |ov|
otid = ov.option_type_id.to_s
ovid = ov.id.to_s
hash[otid] ||= {}
hash[otid][ovid] ||= {}
hash[otid][ovid][variant.id.to_s] = variant.to_hash
end
end
@_variant_options_hash = hash
end
end
## Instruction:
Order options by variant position
## Code After:
Spree::Product.class_eval do
def option_values
@_option_values ||= Spree::OptionValue.find_by_sql(["SELECT ov.id FROM spree_option_values ov INNER JOIN spree_option_values_variants ovv ON ovv.option_value_id = ov.id INNER JOIN spree_variants v on ovv.variant_id = v.id WHERE v.product_id = ? ORDER BY v.position", self.id])
end
def grouped_option_values
@_grouped_option_values ||= option_values.group_by(&:option_type)
end
def variants_for_option_value(value)
@_variant_option_values ||= variants.includes(:option_values).all
@_variant_option_values.select { |i| i.option_value_ids.include?(value.id) }
end
def variant_options_hash
return @_variant_options_hash if @_variant_options_hash
hash = {}
variants.includes(:option_values).each do |variant|
variant.option_values.each do |ov|
otid = ov.option_type_id.to_s
ovid = ov.id.to_s
hash[otid] ||= {}
hash[otid][ovid] ||= {}
hash[otid][ovid][variant.id.to_s] = variant.to_hash
end
end
@_variant_options_hash = hash
end
end
| Spree::Product.class_eval do
def option_values
- @_option_values ||= Spree::OptionValue.for_product(self).order(:position).sort_by {|ov| ov.option_type.position }
+ @_option_values ||= Spree::OptionValue.find_by_sql(["SELECT ov.id FROM spree_option_values ov INNER JOIN spree_option_values_variants ovv ON ovv.option_value_id = ov.id INNER JOIN spree_variants v on ovv.variant_id = v.id WHERE v.product_id = ? ORDER BY v.position", self.id])
end
def grouped_option_values
@_grouped_option_values ||= option_values.group_by(&:option_type)
end
def variants_for_option_value(value)
@_variant_option_values ||= variants.includes(:option_values).all
@_variant_option_values.select { |i| i.option_value_ids.include?(value.id) }
end
def variant_options_hash
return @_variant_options_hash if @_variant_options_hash
hash = {}
variants.includes(:option_values).each do |variant|
variant.option_values.each do |ov|
otid = ov.option_type_id.to_s
ovid = ov.id.to_s
hash[otid] ||= {}
hash[otid][ovid] ||= {}
hash[otid][ovid][variant.id.to_s] = variant.to_hash
end
end
@_variant_options_hash = hash
end
end | 2 | 0.064516 | 1 | 1 |
d5c89d054faca702b1c9a312c9f4dfa6d9fe5fa8 | db/migrate/20180711182519_change_allowed_email_domains_text.rb | db/migrate/20180711182519_change_allowed_email_domains_text.rb | class ChangeAllowedEmailDomainsText < ActiveRecord::Migration[5.2]
def change
if Organization.new.respond_to? :allowed_email_domains
change_column :organizations, :allowed_email_domains, :text, limit: 255
end
end
end
| class ChangeAllowedEmailDomainsText < ActiveRecord::Migration[5.2]
def change
if Organization.column_names.include? 'allowed_email_domains'
change_column :organizations, :allowed_email_domains, :text, limit: 255
end
end
end
| Fix migration so that it doesn't try to load SystemConfig. | Fix migration so that it doesn't try to load SystemConfig.
| Ruby | mit | camsys/transam_core,camsys/transam_core,camsys/transam_core,camsys/transam_core | ruby | ## Code Before:
class ChangeAllowedEmailDomainsText < ActiveRecord::Migration[5.2]
def change
if Organization.new.respond_to? :allowed_email_domains
change_column :organizations, :allowed_email_domains, :text, limit: 255
end
end
end
## Instruction:
Fix migration so that it doesn't try to load SystemConfig.
## Code After:
class ChangeAllowedEmailDomainsText < ActiveRecord::Migration[5.2]
def change
if Organization.column_names.include? 'allowed_email_domains'
change_column :organizations, :allowed_email_domains, :text, limit: 255
end
end
end
| class ChangeAllowedEmailDomainsText < ActiveRecord::Migration[5.2]
def change
- if Organization.new.respond_to? :allowed_email_domains
? ^^^^ ^^ ^^^ ^
+ if Organization.column_names.include? 'allowed_email_domains'
? +++++ ^^^^ ^^ +++ ^ ^ +
change_column :organizations, :allowed_email_domains, :text, limit: 255
end
end
end | 2 | 0.285714 | 1 | 1 |
471de1b432de0a05a8f5209f74c8d4579186a3b0 | resources/public/css/site.css | resources/public/css/site.css | body {
font-family: 'Helvetica Neue', Verdana, Helvetica, Arial, sans-serif;
max-width: 1000px;
margin: 0 auto;
padding-top: 72px;
-webkit-font-smoothing: antialiased;
font-size: 1.125em;
color: #333;
line-height: 1.5em;
}
h1, h2, h3 {
color: #000;
}
h1 {
font-size: 2.5em
}
h2 {
font-size: 2em
}
h3 {
font-size: 1.5em
}
a {
text-decoration: none;
color: #09f;
}
a:hover {
text-decoration: underline;
}
button {
display: block;
margin: 0px auto;
background: #FFF;
}
.graph {
}
.controls {
padding-top: 1cm;
padding-bottom: 1cm;
}
.error {
border-style: dashed;
border-width: 3px;
border-color: #F89;
}
.cheatsheet {
padding-top: 0.5cm;
}
.cheatsheet .code {
font-family: monospace;
}
.CodeMirror {
height: auto;
}
.CodeMirror-scroll {
max-height: 450px;
}
| body {
font-family: 'Helvetica Neue', Verdana, Helvetica, Arial, sans-serif;
max-width: 1000px;
margin: 0 auto;
padding-top: 72px;
-webkit-font-smoothing: antialiased;
font-size: 1.125em;
color: #333;
line-height: 1.5em;
}
h1, h2, h3 {
color: #000;
}
h1 {
font-size: 2.5em
}
h2 {
font-size: 2em
}
h3 {
font-size: 1.5em
}
a {
text-decoration: none;
color: #09f;
}
a:hover {
text-decoration: underline;
}
button {
display: block;
margin: 0px auto;
background: #FFF;
}
.graph {
}
.controls {
padding-top: 1cm;
padding-bottom: 1cm;
}
.error {
border-style: dashed;
border-width: 3px;
border-color: #F89;
}
.cheatsheet {
padding-top: 0.5cm;
}
.cheatsheet .code {
font-family: monospace;
}
.CodeMirror {
height: auto;
}
.CodeMirror-scroll {
max-height: 450px;
height: auto;
}
| Fix the height of CodeMirror so it properly fits the content. | Fix the height of CodeMirror so it properly fits the content.
| CSS | mit | ctford/cljs-bach,ctford/cljs-bach | css | ## Code Before:
body {
font-family: 'Helvetica Neue', Verdana, Helvetica, Arial, sans-serif;
max-width: 1000px;
margin: 0 auto;
padding-top: 72px;
-webkit-font-smoothing: antialiased;
font-size: 1.125em;
color: #333;
line-height: 1.5em;
}
h1, h2, h3 {
color: #000;
}
h1 {
font-size: 2.5em
}
h2 {
font-size: 2em
}
h3 {
font-size: 1.5em
}
a {
text-decoration: none;
color: #09f;
}
a:hover {
text-decoration: underline;
}
button {
display: block;
margin: 0px auto;
background: #FFF;
}
.graph {
}
.controls {
padding-top: 1cm;
padding-bottom: 1cm;
}
.error {
border-style: dashed;
border-width: 3px;
border-color: #F89;
}
.cheatsheet {
padding-top: 0.5cm;
}
.cheatsheet .code {
font-family: monospace;
}
.CodeMirror {
height: auto;
}
.CodeMirror-scroll {
max-height: 450px;
}
## Instruction:
Fix the height of CodeMirror so it properly fits the content.
## Code After:
body {
font-family: 'Helvetica Neue', Verdana, Helvetica, Arial, sans-serif;
max-width: 1000px;
margin: 0 auto;
padding-top: 72px;
-webkit-font-smoothing: antialiased;
font-size: 1.125em;
color: #333;
line-height: 1.5em;
}
h1, h2, h3 {
color: #000;
}
h1 {
font-size: 2.5em
}
h2 {
font-size: 2em
}
h3 {
font-size: 1.5em
}
a {
text-decoration: none;
color: #09f;
}
a:hover {
text-decoration: underline;
}
button {
display: block;
margin: 0px auto;
background: #FFF;
}
.graph {
}
.controls {
padding-top: 1cm;
padding-bottom: 1cm;
}
.error {
border-style: dashed;
border-width: 3px;
border-color: #F89;
}
.cheatsheet {
padding-top: 0.5cm;
}
.cheatsheet .code {
font-family: monospace;
}
.CodeMirror {
height: auto;
}
.CodeMirror-scroll {
max-height: 450px;
height: auto;
}
| body {
font-family: 'Helvetica Neue', Verdana, Helvetica, Arial, sans-serif;
max-width: 1000px;
margin: 0 auto;
padding-top: 72px;
-webkit-font-smoothing: antialiased;
font-size: 1.125em;
color: #333;
line-height: 1.5em;
}
h1, h2, h3 {
color: #000;
}
h1 {
font-size: 2.5em
}
h2 {
font-size: 2em
}
h3 {
font-size: 1.5em
}
a {
text-decoration: none;
color: #09f;
}
a:hover {
text-decoration: underline;
}
button {
display: block;
margin: 0px auto;
background: #FFF;
}
.graph {
}
.controls {
padding-top: 1cm;
padding-bottom: 1cm;
}
.error {
border-style: dashed;
border-width: 3px;
border-color: #F89;
}
.cheatsheet {
padding-top: 0.5cm;
}
.cheatsheet .code {
font-family: monospace;
}
.CodeMirror {
height: auto;
}
.CodeMirror-scroll {
max-height: 450px;
+ height: auto;
} | 1 | 0.014286 | 1 | 0 |
5fff561cd43d3d1a09de5adbb39a6a4b9fafbcf4 | functions/shorten_path.fish | functions/shorten_path.fish | function shorten_path
if test (count $argv) -lt 3
echo $argv[1] | sed -e "s#$HOME#~#g" | sed -e 's#\\(\\.\\?[^/]\\{1\\}\\)[^/]*/#\\1/#g'
else
echo $argv[1] | sed -e "s#$argv[2]#$argv[3]#g" | sed -e 's#\\(\\.\\?[^/]\\{1\\}\\)[^/]*/#\\1/#g'
end
end
| function shorten_path
if test (count $argv) -lt 3
echo $argv[1] | sed -e "s#$HOME\\(/\\|\$\\)#~\1#g" | sed -e 's#\\(\\.\\?[^/]\\{1\\}\\)[^/]*/#\\1/#g'
else
echo $argv[1] | sed -e "s#$argv[2]\\(/\\|\$\\)#$argv[3]\1#g" | sed -e 's#\\(\\.\\?[^/]\\{1\\}\\)[^/]*/#\\1/#g'
end
end
| Fix shorten path incorrectly shortening files in /home | Fix shorten path incorrectly shortening files in /home
| fish | mit | wilfriedvanasten/miscvar,wilfriedvanasten/miscvar,wilfriedvanasten/miscvar | fish | ## Code Before:
function shorten_path
if test (count $argv) -lt 3
echo $argv[1] | sed -e "s#$HOME#~#g" | sed -e 's#\\(\\.\\?[^/]\\{1\\}\\)[^/]*/#\\1/#g'
else
echo $argv[1] | sed -e "s#$argv[2]#$argv[3]#g" | sed -e 's#\\(\\.\\?[^/]\\{1\\}\\)[^/]*/#\\1/#g'
end
end
## Instruction:
Fix shorten path incorrectly shortening files in /home
## Code After:
function shorten_path
if test (count $argv) -lt 3
echo $argv[1] | sed -e "s#$HOME\\(/\\|\$\\)#~\1#g" | sed -e 's#\\(\\.\\?[^/]\\{1\\}\\)[^/]*/#\\1/#g'
else
echo $argv[1] | sed -e "s#$argv[2]\\(/\\|\$\\)#$argv[3]\1#g" | sed -e 's#\\(\\.\\?[^/]\\{1\\}\\)[^/]*/#\\1/#g'
end
end
| function shorten_path
if test (count $argv) -lt 3
- echo $argv[1] | sed -e "s#$HOME#~#g" | sed -e 's#\\(\\.\\?[^/]\\{1\\}\\)[^/]*/#\\1/#g'
+ echo $argv[1] | sed -e "s#$HOME\\(/\\|\$\\)#~\1#g" | sed -e 's#\\(\\.\\?[^/]\\{1\\}\\)[^/]*/#\\1/#g'
? ++++++++++++ ++
else
- echo $argv[1] | sed -e "s#$argv[2]#$argv[3]#g" | sed -e 's#\\(\\.\\?[^/]\\{1\\}\\)[^/]*/#\\1/#g'
+ echo $argv[1] | sed -e "s#$argv[2]\\(/\\|\$\\)#$argv[3]\1#g" | sed -e 's#\\(\\.\\?[^/]\\{1\\}\\)[^/]*/#\\1/#g'
? ++++++++++++ ++
end
end | 4 | 0.571429 | 2 | 2 |
1f2ab8e287807f8c684e8758f5b4ed618dca20be | README.md | README.md |
This is the result of 7 hours of work during zdrowieton.js in 2017.
We will clean it up and make available for everyone, once we find time.
If you want to run it:
1.`git clone` or download it
2.`npm install`
3.`gulp`
## Goals
Make the users aware of how much of kilocalories, fat, protein and carbohydrates each food contains.
## Made by
- Rafał Rudol - [@rrudol](https://github.com/rrudol)
- Tomasz Gil - [@tomaszgil](https://github.com/tomaszgil)
- Tomasz Jeznach - [@futer](https://github.com/futer)
- Marta Sitkowska - [@seohhe](https://github.com/seohhe)
- Marcin Ławniczak - [@marcinlawnik](https://github.com/marcinlawnik)
|
This is the result of 7 hours of work during zdrowieton.js in 2017.
We will clean it up and make available for everyone, once we find time.
If you want to run it:
1.`git clone` or download it
2.`npm install`
3.`gulp`
## Goals
Make the users aware of how much of kilocalories, fat, protein and carbohydrates each food contains.
## Made by
- Rafał Rudol - [@rrudol](https://github.com/rrudol)
- Mikołaj Rozwadowski [@hejmsdz](https://github.com/hejmsdz)
- Tomasz Gil - [@tomaszgil](https://github.com/tomaszgil)
- Tomasz Jeznach - [@futer](https://github.com/futer)
- Marta Sitkowska - [@seohhe](https://github.com/seohhe)
- Marcin Ławniczak - [@marcinlawnik](https://github.com/marcinlawnik)
| Add Mikołaj to the list | Add Mikołaj to the list | Markdown | mit | akai-org/zdrowieton2017,akai-org/zdrowieton2017 | markdown | ## Code Before:
This is the result of 7 hours of work during zdrowieton.js in 2017.
We will clean it up and make available for everyone, once we find time.
If you want to run it:
1.`git clone` or download it
2.`npm install`
3.`gulp`
## Goals
Make the users aware of how much of kilocalories, fat, protein and carbohydrates each food contains.
## Made by
- Rafał Rudol - [@rrudol](https://github.com/rrudol)
- Tomasz Gil - [@tomaszgil](https://github.com/tomaszgil)
- Tomasz Jeznach - [@futer](https://github.com/futer)
- Marta Sitkowska - [@seohhe](https://github.com/seohhe)
- Marcin Ławniczak - [@marcinlawnik](https://github.com/marcinlawnik)
## Instruction:
Add Mikołaj to the list
## Code After:
This is the result of 7 hours of work during zdrowieton.js in 2017.
We will clean it up and make available for everyone, once we find time.
If you want to run it:
1.`git clone` or download it
2.`npm install`
3.`gulp`
## Goals
Make the users aware of how much of kilocalories, fat, protein and carbohydrates each food contains.
## Made by
- Rafał Rudol - [@rrudol](https://github.com/rrudol)
- Mikołaj Rozwadowski [@hejmsdz](https://github.com/hejmsdz)
- Tomasz Gil - [@tomaszgil](https://github.com/tomaszgil)
- Tomasz Jeznach - [@futer](https://github.com/futer)
- Marta Sitkowska - [@seohhe](https://github.com/seohhe)
- Marcin Ławniczak - [@marcinlawnik](https://github.com/marcinlawnik)
|
This is the result of 7 hours of work during zdrowieton.js in 2017.
We will clean it up and make available for everyone, once we find time.
If you want to run it:
1.`git clone` or download it
2.`npm install`
3.`gulp`
## Goals
Make the users aware of how much of kilocalories, fat, protein and carbohydrates each food contains.
## Made by
- Rafał Rudol - [@rrudol](https://github.com/rrudol)
+ - Mikołaj Rozwadowski [@hejmsdz](https://github.com/hejmsdz)
- Tomasz Gil - [@tomaszgil](https://github.com/tomaszgil)
- Tomasz Jeznach - [@futer](https://github.com/futer)
- Marta Sitkowska - [@seohhe](https://github.com/seohhe)
- Marcin Ławniczak - [@marcinlawnik](https://github.com/marcinlawnik) | 1 | 0.043478 | 1 | 0 |
757b8b2dc35193988395b97d82532289289ccc9a | README.md | README.md |
[](https://travis-ci.org/twpayne/go-gpx)
[](https://godoc.org/github.com/twpayne/go-gpx)
Package go-gpx provides convenince methods for creating and writing GPX documents.
[License](LICENSE)
|
[](https://travis-ci.org/twpayne/go-gpx)
[](https://godoc.org/github.com/twpayne/go-gpx)
[](https://goreportcard.com/report/github.com/twpayne/go-gpx)
Package go-gpx provides convenince methods for creating and writing GPX documents.
[License](LICENSE)
| Add link to Report Card | Add link to Report Card
| Markdown | mit | twpayne/go-gpx | markdown | ## Code Before:
[](https://travis-ci.org/twpayne/go-gpx)
[](https://godoc.org/github.com/twpayne/go-gpx)
Package go-gpx provides convenince methods for creating and writing GPX documents.
[License](LICENSE)
## Instruction:
Add link to Report Card
## Code After:
[](https://travis-ci.org/twpayne/go-gpx)
[](https://godoc.org/github.com/twpayne/go-gpx)
[](https://goreportcard.com/report/github.com/twpayne/go-gpx)
Package go-gpx provides convenince methods for creating and writing GPX documents.
[License](LICENSE)
|
[](https://travis-ci.org/twpayne/go-gpx)
[](https://godoc.org/github.com/twpayne/go-gpx)
+ [](https://goreportcard.com/report/github.com/twpayne/go-gpx)
Package go-gpx provides convenince methods for creating and writing GPX documents.
[License](LICENSE) | 1 | 0.142857 | 1 | 0 |
d2fd463089be453dbe3e2758042672e962bd65ca | tweet_processor.rb | tweet_processor.rb | module BBC
# TweetProcessor contains all twitter text filtering and word tracking
class TweetProcessor
attr_accessor :total_word_count
attr_accessor :word_cont_hash
def initialize
@total_word_count = 0
@word_count_hash = {}
end
def add_word_count(tweet)
word_ar = tweet.split(" ")
@total_word_count += word_ar.length
end
def add_words_to_hash(tweet)
filtered_tweet_ar = filter_stop_words(tweet)
filtered_tweet_ar.each do |word|
if word_count_hash[:"#{word}"].nil?
word_count_hash[:"#{word}"] = 1
else
word_count_hash[:"#{word}"] += 1
end
end
end
def list_top_words(number)
# Simplify with Ruby 2.2.2 Enumerable .max(10) available
# @word_count_hash.max(10) { |a,b| a[1] <=> b[1] }
sorted_word_count_hash = word_count_hash.sort do |kv_pair1, kv_pair2|
kv_pair2[1] <=> kv_pair1[1]
end
top_kv_pairs = sorted_word_count_hash.first(number)
puts "Ten Most Frequent Words:"
top_kv_pairs.each do |key, value|
puts "#{key}: #{value}"
end
end
private
def filter_stop_words(tweet)
word_ar = tweet.split(" ")
word_ar.delete_if do |word|
STOP_WORDS.include?(word)
end
end
def word_count_hash
@word_count_hash
end
end
end
| module BBC
class TweetProcessor
attr_reader :total_word_count
def initialize
@total_word_count = 0
@word_count = {}
end
def add_word_count(tweet)
words = tweet.split(" ")
@total_word_count += words.length
end
def add_words_to_hash(tweet)
filter_stop_words(tweet).each do |word|
if word_count[word.to_sym].nil?
word_count[word.to_sym] = 1
else
word_count[word.to_sym] += 1
end
end
end
def list_top_words(number)
top_words = word_count.sort do |a, b|
b[1] <=> a[1]
end.first(number)
puts "Ten Most Frequent Words:"
top_words.each do |key, value|
puts "#{key}: #{value}"
end
end
private
def filter_stop_words(tweet)
tweet.split(" ").delete_if do |word|
STOP_WORDS.include?(word)
end
end
def word_count
@word_count
end
end
end
| Refactor for concise var naming | Refactor for concise var naming
| Ruby | mit | bry/twitter-stream-tracker | ruby | ## Code Before:
module BBC
# TweetProcessor contains all twitter text filtering and word tracking
class TweetProcessor
attr_accessor :total_word_count
attr_accessor :word_cont_hash
def initialize
@total_word_count = 0
@word_count_hash = {}
end
def add_word_count(tweet)
word_ar = tweet.split(" ")
@total_word_count += word_ar.length
end
def add_words_to_hash(tweet)
filtered_tweet_ar = filter_stop_words(tweet)
filtered_tweet_ar.each do |word|
if word_count_hash[:"#{word}"].nil?
word_count_hash[:"#{word}"] = 1
else
word_count_hash[:"#{word}"] += 1
end
end
end
def list_top_words(number)
# Simplify with Ruby 2.2.2 Enumerable .max(10) available
# @word_count_hash.max(10) { |a,b| a[1] <=> b[1] }
sorted_word_count_hash = word_count_hash.sort do |kv_pair1, kv_pair2|
kv_pair2[1] <=> kv_pair1[1]
end
top_kv_pairs = sorted_word_count_hash.first(number)
puts "Ten Most Frequent Words:"
top_kv_pairs.each do |key, value|
puts "#{key}: #{value}"
end
end
private
def filter_stop_words(tweet)
word_ar = tweet.split(" ")
word_ar.delete_if do |word|
STOP_WORDS.include?(word)
end
end
def word_count_hash
@word_count_hash
end
end
end
## Instruction:
Refactor for concise var naming
## Code After:
module BBC
class TweetProcessor
attr_reader :total_word_count
def initialize
@total_word_count = 0
@word_count = {}
end
def add_word_count(tweet)
words = tweet.split(" ")
@total_word_count += words.length
end
def add_words_to_hash(tweet)
filter_stop_words(tweet).each do |word|
if word_count[word.to_sym].nil?
word_count[word.to_sym] = 1
else
word_count[word.to_sym] += 1
end
end
end
def list_top_words(number)
top_words = word_count.sort do |a, b|
b[1] <=> a[1]
end.first(number)
puts "Ten Most Frequent Words:"
top_words.each do |key, value|
puts "#{key}: #{value}"
end
end
private
def filter_stop_words(tweet)
tweet.split(" ").delete_if do |word|
STOP_WORDS.include?(word)
end
end
def word_count
@word_count
end
end
end
| module BBC
- # TweetProcessor contains all twitter text filtering and word tracking
class TweetProcessor
- attr_accessor :total_word_count
? ^^ ---
+ attr_reader :total_word_count
? ++ ^
- attr_accessor :word_cont_hash
def initialize
@total_word_count = 0
- @word_count_hash = {}
? -----
+ @word_count = {}
end
def add_word_count(tweet)
- word_ar = tweet.split(" ")
? ^^^
+ words = tweet.split(" ")
? ^
- @total_word_count += word_ar.length
? ^^^
+ @total_word_count += words.length
? ^
end
def add_words_to_hash(tweet)
- filtered_tweet_ar = filter_stop_words(tweet)
-
- filtered_tweet_ar.each do |word|
? ^ ^ ^^^
+ filter_stop_words(tweet).each do |word|
? ^^^^^^^^^ ^^ ^
- if word_count_hash[:"#{word}"].nil?
? ----- ---- ^^
+ if word_count[word.to_sym].nil?
? ^^^^^^^
- word_count_hash[:"#{word}"] = 1
? ----- ---- ^^
+ word_count[word.to_sym] = 1
? ^^^^^^^
else
- word_count_hash[:"#{word}"] += 1
? ----- ---- ^^
+ word_count[word.to_sym] += 1
? ^^^^^^^
end
end
end
def list_top_words(number)
+ top_words = word_count.sort do |a, b|
+ b[1] <=> a[1]
+ end.first(number)
- # Simplify with Ruby 2.2.2 Enumerable .max(10) available
- # @word_count_hash.max(10) { |a,b| a[1] <=> b[1] }
- sorted_word_count_hash = word_count_hash.sort do |kv_pair1, kv_pair2|
- kv_pair2[1] <=> kv_pair1[1]
- end
-
- top_kv_pairs = sorted_word_count_hash.first(number)
puts "Ten Most Frequent Words:"
- top_kv_pairs.each do |key, value|
? ^^^^^^
+ top_words.each do |key, value|
? ^^ +
puts "#{key}: #{value}"
end
end
private
def filter_stop_words(tweet)
+ tweet.split(" ").delete_if do |word|
- word_ar = tweet.split(" ")
- word_ar.delete_if do |word|
STOP_WORDS.include?(word)
end
end
- def word_count_hash
? -----
+ def word_count
- @word_count_hash
? -----
+ @word_count
end
end
end | 39 | 0.672414 | 15 | 24 |
7db3a14636402a5c66179a9c60df33398190bd3e | app/modules/frest/api/__init__.py | app/modules/frest/api/__init__.py | from functools import wraps, partial
from flask import request
from flask_api import status
from flask.wrappers import Response
from app.config import API_ACCEPT_HEADER
def API(method=None):
if method is None:
return partial(API)
@wraps(method)
def decorated(*args, **kwargs):
_return = method(*args, **kwargs)
if isinstance(_return, Response):
return _return
if request.headers['Accept'] == API_ACCEPT_HEADER:
ret, code = _return
else:
ret, code = ("Please check request accept again.", status.HTTP_406_NOT_ACCEPTABLE)
return serialize(ret, code)
def serialize(ret, code):
_return = {'code': code}
if not status.is_success(code):
_return['status'] = 'fail'
if ret is not None:
if isinstance(ret, dict):
_return.update(ret)
else:
_return['message'] = ret
else:
_return['status'] = 'success'
if ret is not None:
if isinstance(ret, dict):
_return.update(ret)
else:
_return['data'] = ret
return _return, code
return decorated
| from functools import wraps, partial
from flask import request
from flask_api import status
from flask.wrappers import Response
from app.config import API_ACCEPT_HEADER, API_VERSION
def API(method=None):
if method is None:
return partial(API)
@wraps(method)
def decorated(*args, **kwargs):
_return = method(*args, **kwargs)
if isinstance(_return, Response):
return _return
if request.url.find('v' + str(API_VERSION)) > 0:
if request.headers['Accept'] == API_ACCEPT_HEADER:
ret, code = _return
else:
ret, code = ("Please check request accept again.", status.HTTP_406_NOT_ACCEPTABLE)
else:
ret, code = ("API has been updated. The latest version is v" + str(API_VERSION), status.HTTP_301_MOVED_PERMANENTLY)
return serialize(ret, code)
def serialize(ret, code):
_return = {'code': code}
if not status.is_success(code):
_return['status'] = 'fail'
if ret is not None:
if isinstance(ret, dict):
_return.update(ret)
else:
_return['message'] = ret
else:
_return['status'] = 'success'
if ret is not None:
if isinstance(ret, dict):
_return.update(ret)
else:
_return['data'] = ret
return _return, code
return decorated
| Return http status code 301 when api version is wrong | Return http status code 301 when api version is wrong
| Python | mit | h4wldev/Frest | python | ## Code Before:
from functools import wraps, partial
from flask import request
from flask_api import status
from flask.wrappers import Response
from app.config import API_ACCEPT_HEADER
def API(method=None):
if method is None:
return partial(API)
@wraps(method)
def decorated(*args, **kwargs):
_return = method(*args, **kwargs)
if isinstance(_return, Response):
return _return
if request.headers['Accept'] == API_ACCEPT_HEADER:
ret, code = _return
else:
ret, code = ("Please check request accept again.", status.HTTP_406_NOT_ACCEPTABLE)
return serialize(ret, code)
def serialize(ret, code):
_return = {'code': code}
if not status.is_success(code):
_return['status'] = 'fail'
if ret is not None:
if isinstance(ret, dict):
_return.update(ret)
else:
_return['message'] = ret
else:
_return['status'] = 'success'
if ret is not None:
if isinstance(ret, dict):
_return.update(ret)
else:
_return['data'] = ret
return _return, code
return decorated
## Instruction:
Return http status code 301 when api version is wrong
## Code After:
from functools import wraps, partial
from flask import request
from flask_api import status
from flask.wrappers import Response
from app.config import API_ACCEPT_HEADER, API_VERSION
def API(method=None):
if method is None:
return partial(API)
@wraps(method)
def decorated(*args, **kwargs):
_return = method(*args, **kwargs)
if isinstance(_return, Response):
return _return
if request.url.find('v' + str(API_VERSION)) > 0:
if request.headers['Accept'] == API_ACCEPT_HEADER:
ret, code = _return
else:
ret, code = ("Please check request accept again.", status.HTTP_406_NOT_ACCEPTABLE)
else:
ret, code = ("API has been updated. The latest version is v" + str(API_VERSION), status.HTTP_301_MOVED_PERMANENTLY)
return serialize(ret, code)
def serialize(ret, code):
_return = {'code': code}
if not status.is_success(code):
_return['status'] = 'fail'
if ret is not None:
if isinstance(ret, dict):
_return.update(ret)
else:
_return['message'] = ret
else:
_return['status'] = 'success'
if ret is not None:
if isinstance(ret, dict):
_return.update(ret)
else:
_return['data'] = ret
return _return, code
return decorated
| from functools import wraps, partial
from flask import request
from flask_api import status
from flask.wrappers import Response
- from app.config import API_ACCEPT_HEADER
+ from app.config import API_ACCEPT_HEADER, API_VERSION
? +++++++++++++
def API(method=None):
if method is None:
return partial(API)
@wraps(method)
def decorated(*args, **kwargs):
_return = method(*args, **kwargs)
if isinstance(_return, Response):
return _return
+ if request.url.find('v' + str(API_VERSION)) > 0:
- if request.headers['Accept'] == API_ACCEPT_HEADER:
+ if request.headers['Accept'] == API_ACCEPT_HEADER:
? ++++
- ret, code = _return
+ ret, code = _return
? ++++
+ else:
+ ret, code = ("Please check request accept again.", status.HTTP_406_NOT_ACCEPTABLE)
else:
- ret, code = ("Please check request accept again.", status.HTTP_406_NOT_ACCEPTABLE)
+ ret, code = ("API has been updated. The latest version is v" + str(API_VERSION), status.HTTP_301_MOVED_PERMANENTLY)
return serialize(ret, code)
def serialize(ret, code):
_return = {'code': code}
if not status.is_success(code):
_return['status'] = 'fail'
if ret is not None:
if isinstance(ret, dict):
_return.update(ret)
else:
_return['message'] = ret
else:
_return['status'] = 'success'
if ret is not None:
if isinstance(ret, dict):
_return.update(ret)
else:
_return['data'] = ret
return _return, code
return decorated | 11 | 0.22 | 7 | 4 |
43a24cbc79dfd7c63fa261f390f9016989c06e6a | scripts/travis/deploy.sh | scripts/travis/deploy.sh | set -e
if [ ${BUILD_TYPE} == 'deploy' ]; then
eval "$(ssh-agent -s)"
ssh-add deploy_rsa
# Temporarily copy files to second server
DEPLOY_FOLDER2=${TRAVIS_BRANCH}
DEPLOY_SERVER2=travis@cognosis.mit.edu
echo "Copying binaries to ${DEPLOY_SERVER2}:${DEPLOY_FOLDER2} ..."
rsync -r --delete-after --quiet binaries ${DEPLOY_SERVER2}:${DEPLOY_FOLDER2}
DEPLOY_FOLDER=xcolab/${TRAVIS_BRANCH}
DEPLOY_SERVER=binaries@cognosis2.mit.edu
echo "Copying binaries to ${DEPLOY_SERVER}:${DEPLOY_FOLDER} ..."
rsync -r --delete-after --quiet binaries ${DEPLOY_SERVER}:${DEPLOY_FOLDER}
# Workaround for hanging builds
# taken from https://github.com/travis-ci/travis-ci/issues/8082#issuecomment-315147561
ssh-agent -k
else
echo "Skipping deploy step on branch ${TRAVIS_BRANCH}"
fi
| set -e
if [ ${BUILD_TYPE} == 'deploy' ]; then
eval "$(ssh-agent -s)"
ssh-add deploy_rsa
WORKER_IP="$(dig +short myip.opendns.com @resolver1.opendns.com)"
# Temporarily copy files to second server
DEPLOY_FOLDER2=${TRAVIS_BRANCH}
DEPLOY_SERVER2=travis@cognosis.mit.edu
echo "Copying binaries from ${WORKER_IP} to ${DEPLOY_SERVER2}:${DEPLOY_FOLDER2} ..."
rsync -r --delete-after --quiet binaries ${DEPLOY_SERVER2}:${DEPLOY_FOLDER2}
DEPLOY_FOLDER=xcolab/${TRAVIS_BRANCH}
DEPLOY_SERVER=binaries@cognosis2.mit.edu
echo "Copying binaries from ${WORKER_IP} to ${DEPLOY_SERVER}:${DEPLOY_FOLDER} ..."
rsync -r --delete-after --quiet binaries ${DEPLOY_SERVER}:${DEPLOY_FOLDER}
# Workaround for hanging builds
# taken from https://github.com/travis-ci/travis-ci/issues/8082#issuecomment-315147561
ssh-agent -k
else
echo "Skipping deploy step on branch ${TRAVIS_BRANCH}"
fi
| Add worker IP to travis build log | Add worker IP to travis build log
| Shell | mit | CCI-MIT/XCoLab,CCI-MIT/XCoLab,CCI-MIT/XCoLab,CCI-MIT/XCoLab | shell | ## Code Before:
set -e
if [ ${BUILD_TYPE} == 'deploy' ]; then
eval "$(ssh-agent -s)"
ssh-add deploy_rsa
# Temporarily copy files to second server
DEPLOY_FOLDER2=${TRAVIS_BRANCH}
DEPLOY_SERVER2=travis@cognosis.mit.edu
echo "Copying binaries to ${DEPLOY_SERVER2}:${DEPLOY_FOLDER2} ..."
rsync -r --delete-after --quiet binaries ${DEPLOY_SERVER2}:${DEPLOY_FOLDER2}
DEPLOY_FOLDER=xcolab/${TRAVIS_BRANCH}
DEPLOY_SERVER=binaries@cognosis2.mit.edu
echo "Copying binaries to ${DEPLOY_SERVER}:${DEPLOY_FOLDER} ..."
rsync -r --delete-after --quiet binaries ${DEPLOY_SERVER}:${DEPLOY_FOLDER}
# Workaround for hanging builds
# taken from https://github.com/travis-ci/travis-ci/issues/8082#issuecomment-315147561
ssh-agent -k
else
echo "Skipping deploy step on branch ${TRAVIS_BRANCH}"
fi
## Instruction:
Add worker IP to travis build log
## Code After:
set -e
if [ ${BUILD_TYPE} == 'deploy' ]; then
eval "$(ssh-agent -s)"
ssh-add deploy_rsa
WORKER_IP="$(dig +short myip.opendns.com @resolver1.opendns.com)"
# Temporarily copy files to second server
DEPLOY_FOLDER2=${TRAVIS_BRANCH}
DEPLOY_SERVER2=travis@cognosis.mit.edu
echo "Copying binaries from ${WORKER_IP} to ${DEPLOY_SERVER2}:${DEPLOY_FOLDER2} ..."
rsync -r --delete-after --quiet binaries ${DEPLOY_SERVER2}:${DEPLOY_FOLDER2}
DEPLOY_FOLDER=xcolab/${TRAVIS_BRANCH}
DEPLOY_SERVER=binaries@cognosis2.mit.edu
echo "Copying binaries from ${WORKER_IP} to ${DEPLOY_SERVER}:${DEPLOY_FOLDER} ..."
rsync -r --delete-after --quiet binaries ${DEPLOY_SERVER}:${DEPLOY_FOLDER}
# Workaround for hanging builds
# taken from https://github.com/travis-ci/travis-ci/issues/8082#issuecomment-315147561
ssh-agent -k
else
echo "Skipping deploy step on branch ${TRAVIS_BRANCH}"
fi
| set -e
if [ ${BUILD_TYPE} == 'deploy' ]; then
eval "$(ssh-agent -s)"
ssh-add deploy_rsa
+ WORKER_IP="$(dig +short myip.opendns.com @resolver1.opendns.com)"
+
# Temporarily copy files to second server
DEPLOY_FOLDER2=${TRAVIS_BRANCH}
DEPLOY_SERVER2=travis@cognosis.mit.edu
- echo "Copying binaries to ${DEPLOY_SERVER2}:${DEPLOY_FOLDER2} ..."
+ echo "Copying binaries from ${WORKER_IP} to ${DEPLOY_SERVER2}:${DEPLOY_FOLDER2} ..."
? ++++++++++++++++++
rsync -r --delete-after --quiet binaries ${DEPLOY_SERVER2}:${DEPLOY_FOLDER2}
DEPLOY_FOLDER=xcolab/${TRAVIS_BRANCH}
DEPLOY_SERVER=binaries@cognosis2.mit.edu
- echo "Copying binaries to ${DEPLOY_SERVER}:${DEPLOY_FOLDER} ..."
+ echo "Copying binaries from ${WORKER_IP} to ${DEPLOY_SERVER}:${DEPLOY_FOLDER} ..."
? ++++++++++++++++++
rsync -r --delete-after --quiet binaries ${DEPLOY_SERVER}:${DEPLOY_FOLDER}
# Workaround for hanging builds
# taken from https://github.com/travis-ci/travis-ci/issues/8082#issuecomment-315147561
ssh-agent -k
else
echo "Skipping deploy step on branch ${TRAVIS_BRANCH}"
fi | 6 | 0.25 | 4 | 2 |
4fcee02539bddc4c2b0079fa6f4e5707a6f887c6 | gulpfile.js | gulpfile.js | var gulp = require("gulp");
var sass = require("gulp-sass");
gulp.task('sass', function () {
gulp.src('src/hipster-grid-system.scss')
.pipe(sass())
.pipe(gulp.dest('dist'));
});
| var gulp = require("gulp");
var sass = require("gulp-sass");
var rename = require("gulp-rename");
var autoprefixer = require("gulp-autoprefixer");
gulp.task('sass', function () {
gulp.src('src/hipster-grid-system.scss')
.pipe(sass())
.pipe(autoprefixer())
.pipe(gulp.dest('dist'));
gulp.src('src/hipster-grid-system.scss')
.pipe(sass({outputStyle: 'compressed'}))
.pipe(autoprefixer())
.pipe(rename({
suffix: ".min"
}))
.pipe(gulp.dest('dist'));
});
| Add support autoprefixer for cross-browser. Add support minify dist file. | Add support autoprefixer for cross-browser.
Add support minify dist file.
| JavaScript | mit | erdoganbulut/hipster-grid-system | javascript | ## Code Before:
var gulp = require("gulp");
var sass = require("gulp-sass");
gulp.task('sass', function () {
gulp.src('src/hipster-grid-system.scss')
.pipe(sass())
.pipe(gulp.dest('dist'));
});
## Instruction:
Add support autoprefixer for cross-browser.
Add support minify dist file.
## Code After:
var gulp = require("gulp");
var sass = require("gulp-sass");
var rename = require("gulp-rename");
var autoprefixer = require("gulp-autoprefixer");
gulp.task('sass', function () {
gulp.src('src/hipster-grid-system.scss')
.pipe(sass())
.pipe(autoprefixer())
.pipe(gulp.dest('dist'));
gulp.src('src/hipster-grid-system.scss')
.pipe(sass({outputStyle: 'compressed'}))
.pipe(autoprefixer())
.pipe(rename({
suffix: ".min"
}))
.pipe(gulp.dest('dist'));
});
| var gulp = require("gulp");
var sass = require("gulp-sass");
+ var rename = require("gulp-rename");
+ var autoprefixer = require("gulp-autoprefixer");
gulp.task('sass', function () {
gulp.src('src/hipster-grid-system.scss')
.pipe(sass())
+ .pipe(autoprefixer())
+ .pipe(gulp.dest('dist'));
+ gulp.src('src/hipster-grid-system.scss')
+ .pipe(sass({outputStyle: 'compressed'}))
+ .pipe(autoprefixer())
+ .pipe(rename({
+ suffix: ".min"
+ }))
.pipe(gulp.dest('dist'));
}); | 10 | 1.25 | 10 | 0 |
a9596a8398fffd8e95d5ee8d5773f9a32ca5b933 | README.md | README.md | This repo contains the bare minimum code to have an auto-updating Electron app using [`electron-updater`](https://github.com/electron-userland/electron-builder/tree/master/packages/electron-updater) with releases stored on GitHub.
1. First, install necessary dependencies with:
```
npm install
```
2. Generate a GitHub access token by going to <https://github.com/settings/tokens/new>. The access token should have the `repo` scope/permission. Once you have the token, assign it to an environment variable (on macOS/linux):
```
export GH_TOKEN="<YOUR_TOKEN_HERE>"
```
3. Publish with the `publish.sh` script:
```
./publish.sh
```
4. Download and install the app from <https://github.com/iffy/electron-updater-example/releases>.
5. Update the version in `package.json`
6. Publish again.
7. Open the installed version of the app and see that it updates itself. | This repo contains the bare minimum code to have an auto-updating Electron app using [`electron-updater`](https://github.com/electron-userland/electron-builder/tree/master/packages/electron-updater) with releases stored on GitHub.
1. First, install necessary dependencies with:
npm install
2. Generate a GitHub access token by going to <https://github.com/settings/tokens/new>. The access token should have the `repo` scope/permission. Once you have the token, assign it to an environment variable (on macOS/linux):
export GH_TOKEN="<YOUR_TOKEN_HERE>"
3. Publish with the `publish.sh` script:
./publish.sh
4. Download and install the app from <https://github.com/iffy/electron-updater-example/releases>.
5. Update the version in `package.json`
6. Publish again.
7. Open the installed version of the app and see that it updates itself. | Fix code block syntax again :) | Fix code block syntax again :)
| Markdown | unlicense | iffy/electron-updater-example,iffy/electron-updater-example | markdown | ## Code Before:
This repo contains the bare minimum code to have an auto-updating Electron app using [`electron-updater`](https://github.com/electron-userland/electron-builder/tree/master/packages/electron-updater) with releases stored on GitHub.
1. First, install necessary dependencies with:
```
npm install
```
2. Generate a GitHub access token by going to <https://github.com/settings/tokens/new>. The access token should have the `repo` scope/permission. Once you have the token, assign it to an environment variable (on macOS/linux):
```
export GH_TOKEN="<YOUR_TOKEN_HERE>"
```
3. Publish with the `publish.sh` script:
```
./publish.sh
```
4. Download and install the app from <https://github.com/iffy/electron-updater-example/releases>.
5. Update the version in `package.json`
6. Publish again.
7. Open the installed version of the app and see that it updates itself.
## Instruction:
Fix code block syntax again :)
## Code After:
This repo contains the bare minimum code to have an auto-updating Electron app using [`electron-updater`](https://github.com/electron-userland/electron-builder/tree/master/packages/electron-updater) with releases stored on GitHub.
1. First, install necessary dependencies with:
npm install
2. Generate a GitHub access token by going to <https://github.com/settings/tokens/new>. The access token should have the `repo` scope/permission. Once you have the token, assign it to an environment variable (on macOS/linux):
export GH_TOKEN="<YOUR_TOKEN_HERE>"
3. Publish with the `publish.sh` script:
./publish.sh
4. Download and install the app from <https://github.com/iffy/electron-updater-example/releases>.
5. Update the version in `package.json`
6. Publish again.
7. Open the installed version of the app and see that it updates itself. | This repo contains the bare minimum code to have an auto-updating Electron app using [`electron-updater`](https://github.com/electron-userland/electron-builder/tree/master/packages/electron-updater) with releases stored on GitHub.
1. First, install necessary dependencies with:
+ npm install
- ```
- npm install
- ```
2. Generate a GitHub access token by going to <https://github.com/settings/tokens/new>. The access token should have the `repo` scope/permission. Once you have the token, assign it to an environment variable (on macOS/linux):
- ```
- export GH_TOKEN="<YOUR_TOKEN_HERE>"
+ export GH_TOKEN="<YOUR_TOKEN_HERE>"
? ++++++++
- ```
3. Publish with the `publish.sh` script:
- ```
- ./publish.sh
+ ./publish.sh
? ++++++++
- ```
4. Download and install the app from <https://github.com/iffy/electron-updater-example/releases>.
5. Update the version in `package.json`
6. Publish again.
7. Open the installed version of the app and see that it updates itself. | 12 | 0.444444 | 3 | 9 |
79429836295981dcc65ef1c8421db12d37f76e0b | app/views/rate_categories/_form.html.haml | app/views/rate_categories/_form.html.haml | .box-content
= simple_form_for @rate_category, html: { class: "basic home" } do |f|
= f.error_notification class: "warning"
%h2.group-title Schablon
= f.input :name
= show_attribute('rate_category.description', @rate_category.description)
= f.input :from_age
= f.input :to_age
= f.association :legal_code, include_blank: false, selected: 1
%h2.group-title Ekonomi
.terms
= f.simple_fields_for :rates do |s|
= render "fields_for_rate", s: s
.form-group
%span.control-label
.controls
= add_rates_button "Lägg till belopp", f
= render 'application/submit', form: f, cancel_path: rate_categories_path
| .box-content
= simple_form_for @rate_category, html: { class: "basic home" } do |f|
= f.error_notification class: "warning"
%h2.group-title Schablon
= show_attribute('rate_category.name', @rate_category.name)
= show_attribute('rate_category.description', @rate_category.description)
= show_attribute('rate_category.from_age', @rate_category.from_age)
= show_attribute('rate_category.to_age', @rate_category.to_age)
= show_attribute('rate_category.legal_code', @rate_category.legal_code.name)
%h2.group-title Ekonomi
.terms
= f.simple_fields_for :rates do |s|
= render "fields_for_rate", s: s
.form-group
%span.control-label
.controls
= add_rates_button "Lägg till belopp", f
= render 'application/submit', form: f, cancel_path: rate_categories_path
| Disable edit of rate categories | Disable edit of rate categories
| Haml | agpl-3.0 | malmostad/meks,malmostad/meks,malmostad/meks,malmostad/meks | haml | ## Code Before:
.box-content
= simple_form_for @rate_category, html: { class: "basic home" } do |f|
= f.error_notification class: "warning"
%h2.group-title Schablon
= f.input :name
= show_attribute('rate_category.description', @rate_category.description)
= f.input :from_age
= f.input :to_age
= f.association :legal_code, include_blank: false, selected: 1
%h2.group-title Ekonomi
.terms
= f.simple_fields_for :rates do |s|
= render "fields_for_rate", s: s
.form-group
%span.control-label
.controls
= add_rates_button "Lägg till belopp", f
= render 'application/submit', form: f, cancel_path: rate_categories_path
## Instruction:
Disable edit of rate categories
## Code After:
.box-content
= simple_form_for @rate_category, html: { class: "basic home" } do |f|
= f.error_notification class: "warning"
%h2.group-title Schablon
= show_attribute('rate_category.name', @rate_category.name)
= show_attribute('rate_category.description', @rate_category.description)
= show_attribute('rate_category.from_age', @rate_category.from_age)
= show_attribute('rate_category.to_age', @rate_category.to_age)
= show_attribute('rate_category.legal_code', @rate_category.legal_code.name)
%h2.group-title Ekonomi
.terms
= f.simple_fields_for :rates do |s|
= render "fields_for_rate", s: s
.form-group
%span.control-label
.controls
= add_rates_button "Lägg till belopp", f
= render 'application/submit', form: f, cancel_path: rate_categories_path
| .box-content
= simple_form_for @rate_category, html: { class: "basic home" } do |f|
= f.error_notification class: "warning"
%h2.group-title Schablon
- = f.input :name
+ = show_attribute('rate_category.name', @rate_category.name)
= show_attribute('rate_category.description', @rate_category.description)
- = f.input :from_age
- = f.input :to_age
- = f.association :legal_code, include_blank: false, selected: 1
+ = show_attribute('rate_category.from_age', @rate_category.from_age)
+ = show_attribute('rate_category.to_age', @rate_category.to_age)
+ = show_attribute('rate_category.legal_code', @rate_category.legal_code.name)
%h2.group-title Ekonomi
.terms
= f.simple_fields_for :rates do |s|
= render "fields_for_rate", s: s
.form-group
%span.control-label
.controls
= add_rates_button "Lägg till belopp", f
= render 'application/submit', form: f, cancel_path: rate_categories_path | 8 | 0.380952 | 4 | 4 |
26634c37e9cdd234b83167f786571c6050c85930 | README.md | README.md |
A tiny thing to make the browser reload css and javascript when files are changed on disk.
Provides a command line tool and a middleware for express.
## Command line
```
Usage: quickreload [options] [watchdir]
Will default to current working directory if watchdir is omitted.
Options:
--css <extensions...> Comma separated list of extensions to treat as css files. The client will reload
all tags matching link[rel=stylesheet] when files with any of these extensions
are changed.
Default: css,sass,scss,less,styl
--js <extensions...> Comma separated list of extensions to treat as js files. The client will do a
full page reload when files with any of these extensions are changed.
Default: js,jsx,coffee,json
--html <extensions...> Comma separated list of extensions to treat as js files. The client will do a
full page reload when files with any of these extensions are changed.
Default: html
--ignore, -i <dirname|globstr> A directory name or glob string that, if a directory matches it will, it will not be
watched for changes.
Default: node_modules
--port, -p <port> Port to listen to. Will assign a random available port by default.
```
## Express middleware
```js
var quickreload = require("quickreload");
// ...
app.use(quickreload());
```
Then include the following script tag on pages that should respond to file changes:
```html
<script src="/quickreload.js" async></script>
``` |
A tiny thing to make the browser reload css and javascript when files are changed on disk.
Provides a command line tool and a middleware for express.
## Command line
```
Usage: quickreload [options] [watchdir]
Will default to current working directory if watchdir is omitted.
Options:
--css <extensions...> Comma separated list of extensions to treat as css
files. The client will reload all tags matching
link[rel=stylesheet] when files with any of these
extensions are changed.
Default: css,sass,scss,less,styl
--js <extensions...> Comma separated list of extensions to treat as js
files. The client will do a full page reload when
files with any of these extensions are changed.
Default: js,jsx,coffee,json
--html <extensions...> Comma separated list of extensions to treat as html
files. The client will do a full page reload when
files with any of these extensions are changed.
Default: html
--ignore, -i <dir|globstr> A directory name or glob string that, if a directory
matches it will, it will not be watched for
changes.
Default: node_modules
--port, -p <port> Port to listen to. Will assign a random available
port by default.
```
## Express middleware
```js
var quickreload = require("quickreload");
// ...
app.use(quickreload());
```
Then include the following script tag on pages that should respond to file changes:
```html
<script src="/quickreload.js" async></script>
``` | Break usage.txt at column 80 (in readme too) | Break usage.txt at column 80 (in readme too)
| Markdown | mit | bjoerge/quickreload,bjoerge/quickreload | markdown | ## Code Before:
A tiny thing to make the browser reload css and javascript when files are changed on disk.
Provides a command line tool and a middleware for express.
## Command line
```
Usage: quickreload [options] [watchdir]
Will default to current working directory if watchdir is omitted.
Options:
--css <extensions...> Comma separated list of extensions to treat as css files. The client will reload
all tags matching link[rel=stylesheet] when files with any of these extensions
are changed.
Default: css,sass,scss,less,styl
--js <extensions...> Comma separated list of extensions to treat as js files. The client will do a
full page reload when files with any of these extensions are changed.
Default: js,jsx,coffee,json
--html <extensions...> Comma separated list of extensions to treat as js files. The client will do a
full page reload when files with any of these extensions are changed.
Default: html
--ignore, -i <dirname|globstr> A directory name or glob string that, if a directory matches it will, it will not be
watched for changes.
Default: node_modules
--port, -p <port> Port to listen to. Will assign a random available port by default.
```
## Express middleware
```js
var quickreload = require("quickreload");
// ...
app.use(quickreload());
```
Then include the following script tag on pages that should respond to file changes:
```html
<script src="/quickreload.js" async></script>
```
## Instruction:
Break usage.txt at column 80 (in readme too)
## Code After:
A tiny thing to make the browser reload css and javascript when files are changed on disk.
Provides a command line tool and a middleware for express.
## Command line
```
Usage: quickreload [options] [watchdir]
Will default to current working directory if watchdir is omitted.
Options:
--css <extensions...> Comma separated list of extensions to treat as css
files. The client will reload all tags matching
link[rel=stylesheet] when files with any of these
extensions are changed.
Default: css,sass,scss,less,styl
--js <extensions...> Comma separated list of extensions to treat as js
files. The client will do a full page reload when
files with any of these extensions are changed.
Default: js,jsx,coffee,json
--html <extensions...> Comma separated list of extensions to treat as html
files. The client will do a full page reload when
files with any of these extensions are changed.
Default: html
--ignore, -i <dir|globstr> A directory name or glob string that, if a directory
matches it will, it will not be watched for
changes.
Default: node_modules
--port, -p <port> Port to listen to. Will assign a random available
port by default.
```
## Express middleware
```js
var quickreload = require("quickreload");
// ...
app.use(quickreload());
```
Then include the following script tag on pages that should respond to file changes:
```html
<script src="/quickreload.js" async></script>
``` |
A tiny thing to make the browser reload css and javascript when files are changed on disk.
Provides a command line tool and a middleware for express.
## Command line
```
Usage: quickreload [options] [watchdir]
Will default to current working directory if watchdir is omitted.
Options:
- --css <extensions...> Comma separated list of extensions to treat as css files. The client will reload
? ------ ------------------------------
+ --css <extensions...> Comma separated list of extensions to treat as css
+ files. The client will reload all tags matching
- all tags matching link[rel=stylesheet] when files with any of these extensions
? ------------------------ ------------
+ link[rel=stylesheet] when files with any of these
- are changed.
? ^^^^^
+ extensions are changed.
? ^^^^^^^^^^
- Default: css,sass,scss,less,styl
? ------
+ Default: css,sass,scss,less,styl
- --js <extensions...> Comma separated list of extensions to treat as js files. The client will do a
? ------ -----------------------------
+ --js <extensions...> Comma separated list of extensions to treat as js
+ files. The client will do a full page reload when
- full page reload when files with any of these extensions are changed.
? -----------------------------
+ files with any of these extensions are changed.
- Default: js,jsx,coffee,json
? ------
+ Default: js,jsx,coffee,json
- --html <extensions...> Comma separated list of extensions to treat as js files. The client will do a
? ------ ----------- ------- ^^^^ -----
+ --html <extensions...> Comma separated list of extensions to treat as html
? ^
+ files. The client will do a full page reload when
- full page reload when files with any of these extensions are changed.
? ----------------------------
+ files with any of these extensions are changed.
- Default: html
? ------
+ Default: html
- --ignore, -i <dirname|globstr> A directory name or glob string that, if a directory matches it will, it will not be
? -- ---- --------------------------------
+ --ignore, -i <dir|globstr> A directory name or glob string that, if a directory
+ matches it will, it will not be watched for
- watched for changes.
? ------------------
+ changes.
- Default: node_modules
? ------
+ Default: node_modules
- --port, -p <port> Port to listen to. Will assign a random available port by default.
? ------ -----------------
+ --port, -p <port> Port to listen to. Will assign a random available
+ port by default.
```
## Express middleware
```js
var quickreload = require("quickreload");
// ...
app.use(quickreload());
```
Then include the following script tag on pages that should respond to file changes:
```html
<script src="/quickreload.js" async></script>
``` | 33 | 0.66 | 19 | 14 |
f75c0119bd1dc9684a36080f75b719af0ea72e39 | src/Oro/Bundle/EmailBundle/EventListener/SearchListener.php | src/Oro/Bundle/EmailBundle/EventListener/SearchListener.php | <?php
namespace Oro\Bundle\EmailBundle\EventListener;
use Symfony\Component\Security\Core\User\UserInterface;
use Oro\Bundle\SearchBundle\Event\PrepareEntityMapEvent;
use Oro\Bundle\EmailBundle\Entity\Email;
use Oro\Bundle\EmailBundle\Entity\EmailRecipient;
use Oro\Bundle\OrganizationBundle\Entity\OrganizationAwareInterface;
class SearchListener
{
const EMAIL_CLASS_NAME = 'Oro\Bundle\EmailBundle\Entity\Email';
/**
* @param PrepareEntityMapEvent $event
*/
public function prepareEntityMapEvent(PrepareEntityMapEvent $event)
{
$data = $event->getData();
$className = $event->getClassName();
if ($className === self::EMAIL_CLASS_NAME) {
/** @var $entity Email */
$entity = $event->getEntity();
$organizationsId = [];
$recipients = $entity->getRecipients();
/** @var $recipient EmailRecipient */
foreach ($recipients as $recipient) {
$owner = $recipient->getEmailAddress()->getOwner();
if ($owner instanceof UserInterface && $owner instanceof OrganizationAwareInterface) {
$organizationsId[] = $owner->getOrganization()->getId();
}
}
if (!empty($organizationsId)) {
$data['integer']['organization'] = array_unique($organizationsId);
} else {
$data['integer']['organization'] = 0;
}
}
$event->setData($data);
}
}
| <?php
namespace Oro\Bundle\EmailBundle\EventListener;
use Symfony\Component\Security\Core\User\UserInterface;
use Oro\Bundle\SearchBundle\Event\PrepareEntityMapEvent;
use Oro\Bundle\EmailBundle\Entity\Email;
use Oro\Bundle\EmailBundle\Entity\EmailRecipient;
use Oro\Bundle\OrganizationBundle\Entity\OrganizationAwareInterface;
class SearchListener
{
const EMAIL_CLASS_NAME = 'Oro\Bundle\EmailBundle\Entity\Email';
const EMPTY_ORGANIZATION_ID = 0;
/**
* @param PrepareEntityMapEvent $event
*/
public function prepareEntityMapEvent(PrepareEntityMapEvent $event)
{
$data = $event->getData();
$className = $event->getClassName();
if ($className === self::EMAIL_CLASS_NAME) {
/** @var $entity Email */
$entity = $event->getEntity();
$organizationsId = [];
$recipients = $entity->getRecipients();
/** @var $recipient EmailRecipient */
foreach ($recipients as $recipient) {
$owner = $recipient->getEmailAddress()->getOwner();
if ($owner instanceof UserInterface && $owner instanceof OrganizationAwareInterface) {
$organizationsId[] = $owner->getOrganization()->getId();
}
}
if (!isset ($data['integer'])) {
$data['integer'] = [];
}
if (!empty($organizationsId)) {
$data['integer']['organization'] = array_unique($organizationsId);
} else {
$data['integer']['organization'] = self::EMPTY_ORGANIZATION_ID;
}
}
$event->setData($data);
}
}
| Add email owners to search index - Fix cs | BAP-3724: Add email owners to search index
- Fix cs
| PHP | mit | 2ndkauboy/platform,hugeval/platform,orocrm/platform,Djamy/platform,Djamy/platform,geoffroycochard/platform,morontt/platform,trustify/oroplatform,hugeval/platform,orocrm/platform,Djamy/platform,2ndkauboy/platform,trustify/oroplatform,trustify/oroplatform,ramunasd/platform,ramunasd/platform,morontt/platform,ramunasd/platform,northdakota/platform,hugeval/platform,geoffroycochard/platform,northdakota/platform,morontt/platform,2ndkauboy/platform,orocrm/platform,northdakota/platform,geoffroycochard/platform | php | ## Code Before:
<?php
namespace Oro\Bundle\EmailBundle\EventListener;
use Symfony\Component\Security\Core\User\UserInterface;
use Oro\Bundle\SearchBundle\Event\PrepareEntityMapEvent;
use Oro\Bundle\EmailBundle\Entity\Email;
use Oro\Bundle\EmailBundle\Entity\EmailRecipient;
use Oro\Bundle\OrganizationBundle\Entity\OrganizationAwareInterface;
class SearchListener
{
const EMAIL_CLASS_NAME = 'Oro\Bundle\EmailBundle\Entity\Email';
/**
* @param PrepareEntityMapEvent $event
*/
public function prepareEntityMapEvent(PrepareEntityMapEvent $event)
{
$data = $event->getData();
$className = $event->getClassName();
if ($className === self::EMAIL_CLASS_NAME) {
/** @var $entity Email */
$entity = $event->getEntity();
$organizationsId = [];
$recipients = $entity->getRecipients();
/** @var $recipient EmailRecipient */
foreach ($recipients as $recipient) {
$owner = $recipient->getEmailAddress()->getOwner();
if ($owner instanceof UserInterface && $owner instanceof OrganizationAwareInterface) {
$organizationsId[] = $owner->getOrganization()->getId();
}
}
if (!empty($organizationsId)) {
$data['integer']['organization'] = array_unique($organizationsId);
} else {
$data['integer']['organization'] = 0;
}
}
$event->setData($data);
}
}
## Instruction:
BAP-3724: Add email owners to search index
- Fix cs
## Code After:
<?php
namespace Oro\Bundle\EmailBundle\EventListener;
use Symfony\Component\Security\Core\User\UserInterface;
use Oro\Bundle\SearchBundle\Event\PrepareEntityMapEvent;
use Oro\Bundle\EmailBundle\Entity\Email;
use Oro\Bundle\EmailBundle\Entity\EmailRecipient;
use Oro\Bundle\OrganizationBundle\Entity\OrganizationAwareInterface;
class SearchListener
{
const EMAIL_CLASS_NAME = 'Oro\Bundle\EmailBundle\Entity\Email';
const EMPTY_ORGANIZATION_ID = 0;
/**
* @param PrepareEntityMapEvent $event
*/
public function prepareEntityMapEvent(PrepareEntityMapEvent $event)
{
$data = $event->getData();
$className = $event->getClassName();
if ($className === self::EMAIL_CLASS_NAME) {
/** @var $entity Email */
$entity = $event->getEntity();
$organizationsId = [];
$recipients = $entity->getRecipients();
/** @var $recipient EmailRecipient */
foreach ($recipients as $recipient) {
$owner = $recipient->getEmailAddress()->getOwner();
if ($owner instanceof UserInterface && $owner instanceof OrganizationAwareInterface) {
$organizationsId[] = $owner->getOrganization()->getId();
}
}
if (!isset ($data['integer'])) {
$data['integer'] = [];
}
if (!empty($organizationsId)) {
$data['integer']['organization'] = array_unique($organizationsId);
} else {
$data['integer']['organization'] = self::EMPTY_ORGANIZATION_ID;
}
}
$event->setData($data);
}
}
| <?php
namespace Oro\Bundle\EmailBundle\EventListener;
use Symfony\Component\Security\Core\User\UserInterface;
use Oro\Bundle\SearchBundle\Event\PrepareEntityMapEvent;
use Oro\Bundle\EmailBundle\Entity\Email;
use Oro\Bundle\EmailBundle\Entity\EmailRecipient;
use Oro\Bundle\OrganizationBundle\Entity\OrganizationAwareInterface;
class SearchListener
{
const EMAIL_CLASS_NAME = 'Oro\Bundle\EmailBundle\Entity\Email';
+ const EMPTY_ORGANIZATION_ID = 0;
/**
* @param PrepareEntityMapEvent $event
*/
public function prepareEntityMapEvent(PrepareEntityMapEvent $event)
{
- $data = $event->getData();
+ $data = $event->getData();
? +++++
$className = $event->getClassName();
if ($className === self::EMAIL_CLASS_NAME) {
/** @var $entity Email */
- $entity = $event->getEntity();
+ $entity = $event->getEntity();
? +++++++++
$organizationsId = [];
- $recipients = $entity->getRecipients();
+ $recipients = $entity->getRecipients();
? +++++
/** @var $recipient EmailRecipient */
foreach ($recipients as $recipient) {
$owner = $recipient->getEmailAddress()->getOwner();
if ($owner instanceof UserInterface && $owner instanceof OrganizationAwareInterface) {
$organizationsId[] = $owner->getOrganization()->getId();
}
}
+ if (!isset ($data['integer'])) {
+ $data['integer'] = [];
+ }
if (!empty($organizationsId)) {
$data['integer']['organization'] = array_unique($organizationsId);
} else {
- $data['integer']['organization'] = 0;
? ^
+ $data['integer']['organization'] = self::EMPTY_ORGANIZATION_ID;
? ^^^^^^^^^^^^^^^^^^^^^^^^^^^
}
}
$event->setData($data);
}
} | 12 | 0.272727 | 8 | 4 |
5d93d1fb887d76d6fbe0a2f699e973ed9f6e7556 | tests/test_navigation.py | tests/test_navigation.py | def get_menu_titles(page) -> list:
page.wait_for_load_state()
menu_list = page.query_selector_all("//*[@class='toctree-wrapper compound']/ul/li/a")
return [title.as_element().inner_text() for title in menu_list]
flag = True
def test_check_titles(page):
global flag
if(flag):
page.goto("index.html")
page.set_viewport_size({"width": 1050, "height": 600})
menu_list = get_menu_titles(page)
page.wait_for_load_state()
for menu_item in menu_list:
right_arrow = page.query_selector("//*[@id='relations-next']/a")
if(right_arrow):
page.click("//*[@id='relations-next']/a")
page.wait_for_load_state()
page_title = page.title().split(" — ")[0]
assert page_title == menu_item
if("toctree" in page.url):
# check titles for all sub-toctree content
# list_url = page.split("/")[3::]
# new_url = "/".join(list_url)
# test_check_titles(new_url)
flag = False
test_check_titles(page)
else:
break
| def get_menu_titles(page) -> list:
page.wait_for_load_state()
menu_list = page.query_selector_all("//*[@class='toctree-wrapper compound']/ul/li/a")
return [title.as_element().inner_text() for title in menu_list]
flag = True
def test_check_titles(page):
global flag
if(flag):
page.goto("index.html")
menu_list = get_menu_titles(page)
page.wait_for_load_state()
for menu_item in menu_list:
right_arrow = page.query_selector("//*[@id='relations-next']/a")
if(right_arrow):
page.click("//*[@id='relations-next']/a")
page.wait_for_load_state()
page_title = page.title().split(" — ")[0]
assert page_title == menu_item
if("toctree" in page.url):
flag = False
test_check_titles(page)
else:
break
| Delete debug comments and tool | Delete debug comments and tool
| Python | agpl-3.0 | PyAr/PyZombis,PyAr/PyZombis,PyAr/PyZombis | python | ## Code Before:
def get_menu_titles(page) -> list:
page.wait_for_load_state()
menu_list = page.query_selector_all("//*[@class='toctree-wrapper compound']/ul/li/a")
return [title.as_element().inner_text() for title in menu_list]
flag = True
def test_check_titles(page):
global flag
if(flag):
page.goto("index.html")
page.set_viewport_size({"width": 1050, "height": 600})
menu_list = get_menu_titles(page)
page.wait_for_load_state()
for menu_item in menu_list:
right_arrow = page.query_selector("//*[@id='relations-next']/a")
if(right_arrow):
page.click("//*[@id='relations-next']/a")
page.wait_for_load_state()
page_title = page.title().split(" — ")[0]
assert page_title == menu_item
if("toctree" in page.url):
# check titles for all sub-toctree content
# list_url = page.split("/")[3::]
# new_url = "/".join(list_url)
# test_check_titles(new_url)
flag = False
test_check_titles(page)
else:
break
## Instruction:
Delete debug comments and tool
## Code After:
def get_menu_titles(page) -> list:
page.wait_for_load_state()
menu_list = page.query_selector_all("//*[@class='toctree-wrapper compound']/ul/li/a")
return [title.as_element().inner_text() for title in menu_list]
flag = True
def test_check_titles(page):
global flag
if(flag):
page.goto("index.html")
menu_list = get_menu_titles(page)
page.wait_for_load_state()
for menu_item in menu_list:
right_arrow = page.query_selector("//*[@id='relations-next']/a")
if(right_arrow):
page.click("//*[@id='relations-next']/a")
page.wait_for_load_state()
page_title = page.title().split(" — ")[0]
assert page_title == menu_item
if("toctree" in page.url):
flag = False
test_check_titles(page)
else:
break
| def get_menu_titles(page) -> list:
page.wait_for_load_state()
menu_list = page.query_selector_all("//*[@class='toctree-wrapper compound']/ul/li/a")
return [title.as_element().inner_text() for title in menu_list]
flag = True
def test_check_titles(page):
global flag
if(flag):
page.goto("index.html")
- page.set_viewport_size({"width": 1050, "height": 600})
menu_list = get_menu_titles(page)
page.wait_for_load_state()
for menu_item in menu_list:
right_arrow = page.query_selector("//*[@id='relations-next']/a")
if(right_arrow):
page.click("//*[@id='relations-next']/a")
page.wait_for_load_state()
page_title = page.title().split(" — ")[0]
assert page_title == menu_item
if("toctree" in page.url):
- # check titles for all sub-toctree content
- # list_url = page.split("/")[3::]
- # new_url = "/".join(list_url)
- # test_check_titles(new_url)
flag = False
test_check_titles(page)
else:
break | 5 | 0.151515 | 0 | 5 |
02d30d653afc6f6fa4c93c4b868a0771a090beb0 | requirements-dev.txt | requirements-dev.txt | coverage==4.0.3
coveralls==0.5
flake8==2.5.2
flake8-docstrings==0.2.4
flake8-quotes==0.2.4
httmock==1.2.4
lxml==3.4.4
mccabe==0.4.0
mock==1.3.0
pep257==0.7.0
pep8-naming==0.2.2
Sphinx==1.3.5
sphinx-rtd-theme==0.1.9
| coverage==4.1.0
coveralls==0.5
flake8==2.5.4
flake8-docstrings==0.2.6
flake8-quotes==0.2.4
httmock==1.2.5
lxml==3.4.4
mock==2.0.0
mccabe==0.4.0
pep257==0.7.0
pep8-naming==0.2.2
Sphinx==1.4.2
sphinx-rtd-theme==0.1.9
| Upgrade package development requirements to match upstream Girder | Upgrade package development requirements to match upstream Girder
Coverage changes at:
http://coverage.readthedocs.io/en/coverage-4.1/changes.html#version-4-1b-2016-05-21
Flake8 changes at:
https://flake8.readthedocs.io/en/latest/changes.html
Flake8-Docstrings changes at:
https://gitlab.com/pycqa/flake8-docstrings/blob/master/HISTORY.rst
HTTMock changes at (raw form):
https://github.com/patrys/httmock/compare/1.2.4...1.2.5
Mock changes at:
https://mock.readthedocs.io/en/latest/changelog.html
Sphinx changes at:
http://www.sphinx-doc.org/en/stable/changes.html
| Text | apache-2.0 | girder/girder_worker,girder/girder_worker,girder/girder_worker | text | ## Code Before:
coverage==4.0.3
coveralls==0.5
flake8==2.5.2
flake8-docstrings==0.2.4
flake8-quotes==0.2.4
httmock==1.2.4
lxml==3.4.4
mccabe==0.4.0
mock==1.3.0
pep257==0.7.0
pep8-naming==0.2.2
Sphinx==1.3.5
sphinx-rtd-theme==0.1.9
## Instruction:
Upgrade package development requirements to match upstream Girder
Coverage changes at:
http://coverage.readthedocs.io/en/coverage-4.1/changes.html#version-4-1b-2016-05-21
Flake8 changes at:
https://flake8.readthedocs.io/en/latest/changes.html
Flake8-Docstrings changes at:
https://gitlab.com/pycqa/flake8-docstrings/blob/master/HISTORY.rst
HTTMock changes at (raw form):
https://github.com/patrys/httmock/compare/1.2.4...1.2.5
Mock changes at:
https://mock.readthedocs.io/en/latest/changelog.html
Sphinx changes at:
http://www.sphinx-doc.org/en/stable/changes.html
## Code After:
coverage==4.1.0
coveralls==0.5
flake8==2.5.4
flake8-docstrings==0.2.6
flake8-quotes==0.2.4
httmock==1.2.5
lxml==3.4.4
mock==2.0.0
mccabe==0.4.0
pep257==0.7.0
pep8-naming==0.2.2
Sphinx==1.4.2
sphinx-rtd-theme==0.1.9
| - coverage==4.0.3
? --
+ coverage==4.1.0
? ++
coveralls==0.5
- flake8==2.5.2
? ^
+ flake8==2.5.4
? ^
- flake8-docstrings==0.2.4
? ^
+ flake8-docstrings==0.2.6
? ^
flake8-quotes==0.2.4
- httmock==1.2.4
? ^
+ httmock==1.2.5
? ^
lxml==3.4.4
+ mock==2.0.0
mccabe==0.4.0
- mock==1.3.0
pep257==0.7.0
pep8-naming==0.2.2
- Sphinx==1.3.5
? ^ ^
+ Sphinx==1.4.2
? ^ ^
sphinx-rtd-theme==0.1.9 | 12 | 0.923077 | 6 | 6 |
52b1d4afe955fcc057232d66b1a9b1f8aabbc42f | src/test/dutch.spec.ts | src/test/dutch.spec.ts | import {expect} from 'chai';
import * as cspell from '../index';
import * as path from 'path';
import * as fsp from 'fs-extra';
import * as dutchDict from 'cspell-dict-nl-nl';
import * as util from '../util/util';
const sampleFilename = path.join(__dirname, '..', '..', 'samples', 'Dutch.txt');
const sampleFile = fsp.readFile(sampleFilename, 'UTF-8').then(buffer => buffer.toString());
const dutchConfig = dutchDict.getConfigLocation();
describe('Validate that Dutch text is correctly checked.', () => {
it('Tests the default configuration', () => {
return sampleFile.then(text => {
expect(text).to.not.be.empty;
const ext = path.extname(sampleFilename);
const languageIds = cspell.getLanguagesForExt(ext);
const dutchSettings = cspell.readSettings(dutchConfig);
const settings = cspell.mergeSettings(cspell.getDefaultSettings(), dutchSettings, { language: 'en,nl' });
const fileSettings = cspell.combineTextAndLanguageSettings(settings, text, languageIds);
return cspell.validateText(text, fileSettings)
.then(results => {
/* cspell:ignore ANBI RABO RABONL unported */
expect(results.map(a => a.text).filter(util.uniqueFn()).sort()).deep.equals(['ANBI', 'RABO', 'RABONL', 'unported']);
});
});
});
});
| import {expect} from 'chai';
import * as cspell from '../index';
import * as path from 'path';
import * as fsp from 'fs-extra';
import * as dutchDict from 'cspell-dict-nl-nl';
import * as util from '../util/util';
const sampleFilename = path.join(__dirname, '..', '..', 'samples', 'Dutch.txt');
const sampleFile = fsp.readFile(sampleFilename, 'UTF-8').then(buffer => buffer.toString());
const dutchConfig = dutchDict.getConfigLocation();
describe('Validate that Dutch text is correctly checked.', function() {
this.timeout(5000);
it('Tests the default configuration', () => {
return sampleFile.then(text => {
expect(text).to.not.be.empty;
const ext = path.extname(sampleFilename);
const languageIds = cspell.getLanguagesForExt(ext);
const dutchSettings = cspell.readSettings(dutchConfig);
const settings = cspell.mergeSettings(cspell.getDefaultSettings(), dutchSettings, { language: 'en,nl' });
const fileSettings = cspell.combineTextAndLanguageSettings(settings, text, languageIds);
return cspell.validateText(text, fileSettings)
.then(results => {
/* cspell:ignore ANBI RABO RABONL unported */
expect(results.map(a => a.text).filter(util.uniqueFn()).sort()).deep.equals(['ANBI', 'RABO', 'RABONL', 'unported']);
});
});
});
});
| Update the timeout for the dutch test. | Update the timeout for the dutch test.
| TypeScript | mit | Jason3S/cspell,Jason3S/cspell,Jason3S/cspell,Jason3S/cspell,Jason3S/cspell | typescript | ## Code Before:
import {expect} from 'chai';
import * as cspell from '../index';
import * as path from 'path';
import * as fsp from 'fs-extra';
import * as dutchDict from 'cspell-dict-nl-nl';
import * as util from '../util/util';
const sampleFilename = path.join(__dirname, '..', '..', 'samples', 'Dutch.txt');
const sampleFile = fsp.readFile(sampleFilename, 'UTF-8').then(buffer => buffer.toString());
const dutchConfig = dutchDict.getConfigLocation();
describe('Validate that Dutch text is correctly checked.', () => {
it('Tests the default configuration', () => {
return sampleFile.then(text => {
expect(text).to.not.be.empty;
const ext = path.extname(sampleFilename);
const languageIds = cspell.getLanguagesForExt(ext);
const dutchSettings = cspell.readSettings(dutchConfig);
const settings = cspell.mergeSettings(cspell.getDefaultSettings(), dutchSettings, { language: 'en,nl' });
const fileSettings = cspell.combineTextAndLanguageSettings(settings, text, languageIds);
return cspell.validateText(text, fileSettings)
.then(results => {
/* cspell:ignore ANBI RABO RABONL unported */
expect(results.map(a => a.text).filter(util.uniqueFn()).sort()).deep.equals(['ANBI', 'RABO', 'RABONL', 'unported']);
});
});
});
});
## Instruction:
Update the timeout for the dutch test.
## Code After:
import {expect} from 'chai';
import * as cspell from '../index';
import * as path from 'path';
import * as fsp from 'fs-extra';
import * as dutchDict from 'cspell-dict-nl-nl';
import * as util from '../util/util';
const sampleFilename = path.join(__dirname, '..', '..', 'samples', 'Dutch.txt');
const sampleFile = fsp.readFile(sampleFilename, 'UTF-8').then(buffer => buffer.toString());
const dutchConfig = dutchDict.getConfigLocation();
describe('Validate that Dutch text is correctly checked.', function() {
this.timeout(5000);
it('Tests the default configuration', () => {
return sampleFile.then(text => {
expect(text).to.not.be.empty;
const ext = path.extname(sampleFilename);
const languageIds = cspell.getLanguagesForExt(ext);
const dutchSettings = cspell.readSettings(dutchConfig);
const settings = cspell.mergeSettings(cspell.getDefaultSettings(), dutchSettings, { language: 'en,nl' });
const fileSettings = cspell.combineTextAndLanguageSettings(settings, text, languageIds);
return cspell.validateText(text, fileSettings)
.then(results => {
/* cspell:ignore ANBI RABO RABONL unported */
expect(results.map(a => a.text).filter(util.uniqueFn()).sort()).deep.equals(['ANBI', 'RABO', 'RABONL', 'unported']);
});
});
});
});
| import {expect} from 'chai';
import * as cspell from '../index';
import * as path from 'path';
import * as fsp from 'fs-extra';
import * as dutchDict from 'cspell-dict-nl-nl';
import * as util from '../util/util';
const sampleFilename = path.join(__dirname, '..', '..', 'samples', 'Dutch.txt');
const sampleFile = fsp.readFile(sampleFilename, 'UTF-8').then(buffer => buffer.toString());
const dutchConfig = dutchDict.getConfigLocation();
- describe('Validate that Dutch text is correctly checked.', () => {
? ---
+ describe('Validate that Dutch text is correctly checked.', function() {
? ++++++++
+ this.timeout(5000);
+
it('Tests the default configuration', () => {
return sampleFile.then(text => {
expect(text).to.not.be.empty;
const ext = path.extname(sampleFilename);
const languageIds = cspell.getLanguagesForExt(ext);
const dutchSettings = cspell.readSettings(dutchConfig);
const settings = cspell.mergeSettings(cspell.getDefaultSettings(), dutchSettings, { language: 'en,nl' });
const fileSettings = cspell.combineTextAndLanguageSettings(settings, text, languageIds);
return cspell.validateText(text, fileSettings)
.then(results => {
/* cspell:ignore ANBI RABO RABONL unported */
expect(results.map(a => a.text).filter(util.uniqueFn()).sort()).deep.equals(['ANBI', 'RABO', 'RABONL', 'unported']);
});
});
});
}); | 4 | 0.142857 | 3 | 1 |
182519caadf2bfbd05bf90858b1e3926e4e34fbd | package.json | package.json | {
"name": "placard-wrapper",
"description": "A wrapper of Placard, a Portuguese online gambling system. The idea of this application is to provide a better user-experience.",
"private": true,
"scripts": {
"start": "meteor run"
},
"dependencies": {
"babel-runtime": "^6.20.0",
"history": "^4.6.3",
"meteor-node-stubs": "~0.2.4",
"react": "^15.6.1",
"react-addons-pure-render-mixin": "^15.6.0",
"react-dom": "^15.6.1",
"react-router": "^4.1.2"
},
"devDependencies": {
"standard": "^10.0.2"
}
}
| {
"name": "placard-wrapper",
"description": "A wrapper of Placard, a Portuguese online gambling system. The idea of this application is to provide a better user-experience.",
"version": "1.0.0",
"private": true,
"scripts": {
"start": "meteor run"
},
"dependencies": {
"babel-runtime": "^6.20.0",
"history": "^4.6.3",
"meteor-node-stubs": "~0.2.4",
"react": "^15.6.1",
"react-addons-pure-render-mixin": "^15.6.0",
"react-dom": "^15.6.1",
"react-router": "^4.1.2"
},
"devDependencies": {
"standard": "^10.0.2"
}
}
| Bump major version: changes in the data stored. | Bump major version: changes in the data stored.
| JSON | mit | LuisLoureiro/placard-wrapper | json | ## Code Before:
{
"name": "placard-wrapper",
"description": "A wrapper of Placard, a Portuguese online gambling system. The idea of this application is to provide a better user-experience.",
"private": true,
"scripts": {
"start": "meteor run"
},
"dependencies": {
"babel-runtime": "^6.20.0",
"history": "^4.6.3",
"meteor-node-stubs": "~0.2.4",
"react": "^15.6.1",
"react-addons-pure-render-mixin": "^15.6.0",
"react-dom": "^15.6.1",
"react-router": "^4.1.2"
},
"devDependencies": {
"standard": "^10.0.2"
}
}
## Instruction:
Bump major version: changes in the data stored.
## Code After:
{
"name": "placard-wrapper",
"description": "A wrapper of Placard, a Portuguese online gambling system. The idea of this application is to provide a better user-experience.",
"version": "1.0.0",
"private": true,
"scripts": {
"start": "meteor run"
},
"dependencies": {
"babel-runtime": "^6.20.0",
"history": "^4.6.3",
"meteor-node-stubs": "~0.2.4",
"react": "^15.6.1",
"react-addons-pure-render-mixin": "^15.6.0",
"react-dom": "^15.6.1",
"react-router": "^4.1.2"
},
"devDependencies": {
"standard": "^10.0.2"
}
}
| {
"name": "placard-wrapper",
"description": "A wrapper of Placard, a Portuguese online gambling system. The idea of this application is to provide a better user-experience.",
+ "version": "1.0.0",
"private": true,
"scripts": {
"start": "meteor run"
},
"dependencies": {
"babel-runtime": "^6.20.0",
"history": "^4.6.3",
"meteor-node-stubs": "~0.2.4",
"react": "^15.6.1",
"react-addons-pure-render-mixin": "^15.6.0",
"react-dom": "^15.6.1",
"react-router": "^4.1.2"
},
"devDependencies": {
"standard": "^10.0.2"
}
} | 1 | 0.05 | 1 | 0 |
9b89d9fb530ff5604319766493edacf43a6f55b3 | GTProgressBar/Classes/GTProgressBar.swift | GTProgressBar/Classes/GTProgressBar.swift | //
// GTProgressBar.swift
// Pods
//
// Created by Grzegorz Tatarzyn on 19/09/2016.
//
//
import UIKit
public class GTProgressBar: UIView {
private let backgroundView = UIView()
private let fillView = UIView()
private let backgroundViewBorder: CGFloat = 2
private let backgroundViewBorderColor: UIColor = UIColor.black
private let backgroundViewBackgroundColor: UIColor = UIColor.white
private let fillViewInset: CGFloat = 2
private let fillViewBackgroundColor = UIColor.black
public override init(frame: CGRect) {
super.init(frame: frame)
prepareSubviews()
}
required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
prepareSubviews()
}
private func prepareSubviews() {
addSubview(backgroundView)
addSubview(fillView)
}
public override func layoutSubviews() {
backgroundView.frame = CGRect(origin: CGPoint.zero, size: frame.size)
backgroundView.backgroundColor = backgroundViewBackgroundColor
backgroundView.layer.borderWidth = backgroundViewBorder
backgroundView.layer.borderColor = backgroundViewBorderColor.cgColor
let offset = backgroundViewBorder + fillViewInset
fillView.frame = backgroundView.frame.insetBy(dx: offset, dy: offset)
fillView.backgroundColor = fillViewBackgroundColor
}
}
| //
// GTProgressBar.swift
// Pods
//
// Created by Grzegorz Tatarzyn on 19/09/2016.
//
//
import UIKit
public class GTProgressBar: UIView {
private let backgroundView = UIView()
private let fillView = UIView()
private let backgroundViewBorder: CGFloat = 2
private let backgroundViewBorderColor: UIColor = UIColor.black
private let backgroundViewBackgroundColor: UIColor = UIColor.white
private let fillViewInset: CGFloat = 2
private let fillViewBackgroundColor = UIColor.black
public override init(frame: CGRect) {
super.init(frame: frame)
prepareSubviews()
}
required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
prepareSubviews()
}
private func prepareSubviews() {
addSubview(backgroundView)
addSubview(fillView)
}
public override func layoutSubviews() {
setupBackgroundView()
setupFillView()
}
private func setupBackgroundView() {
backgroundView.frame = CGRect(origin: CGPoint.zero, size: frame.size)
backgroundView.backgroundColor = backgroundViewBackgroundColor
backgroundView.layer.borderWidth = backgroundViewBorder
backgroundView.layer.borderColor = backgroundViewBorderColor.cgColor
}
private func setupFillView() {
let offset = backgroundViewBorder + fillViewInset
fillView.frame = backgroundView.frame.insetBy(dx: offset, dy: offset)
fillView.backgroundColor = fillViewBackgroundColor
}
}
| Move setup of each of the child views to separate methods. | Move setup of each of the child views to separate methods.
| Swift | mit | gregttn/GTProgressBar,gregttn/GTProgressBar | swift | ## Code Before:
//
// GTProgressBar.swift
// Pods
//
// Created by Grzegorz Tatarzyn on 19/09/2016.
//
//
import UIKit
public class GTProgressBar: UIView {
private let backgroundView = UIView()
private let fillView = UIView()
private let backgroundViewBorder: CGFloat = 2
private let backgroundViewBorderColor: UIColor = UIColor.black
private let backgroundViewBackgroundColor: UIColor = UIColor.white
private let fillViewInset: CGFloat = 2
private let fillViewBackgroundColor = UIColor.black
public override init(frame: CGRect) {
super.init(frame: frame)
prepareSubviews()
}
required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
prepareSubviews()
}
private func prepareSubviews() {
addSubview(backgroundView)
addSubview(fillView)
}
public override func layoutSubviews() {
backgroundView.frame = CGRect(origin: CGPoint.zero, size: frame.size)
backgroundView.backgroundColor = backgroundViewBackgroundColor
backgroundView.layer.borderWidth = backgroundViewBorder
backgroundView.layer.borderColor = backgroundViewBorderColor.cgColor
let offset = backgroundViewBorder + fillViewInset
fillView.frame = backgroundView.frame.insetBy(dx: offset, dy: offset)
fillView.backgroundColor = fillViewBackgroundColor
}
}
## Instruction:
Move setup of each of the child views to separate methods.
## Code After:
//
// GTProgressBar.swift
// Pods
//
// Created by Grzegorz Tatarzyn on 19/09/2016.
//
//
import UIKit
public class GTProgressBar: UIView {
private let backgroundView = UIView()
private let fillView = UIView()
private let backgroundViewBorder: CGFloat = 2
private let backgroundViewBorderColor: UIColor = UIColor.black
private let backgroundViewBackgroundColor: UIColor = UIColor.white
private let fillViewInset: CGFloat = 2
private let fillViewBackgroundColor = UIColor.black
public override init(frame: CGRect) {
super.init(frame: frame)
prepareSubviews()
}
required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
prepareSubviews()
}
private func prepareSubviews() {
addSubview(backgroundView)
addSubview(fillView)
}
public override func layoutSubviews() {
setupBackgroundView()
setupFillView()
}
private func setupBackgroundView() {
backgroundView.frame = CGRect(origin: CGPoint.zero, size: frame.size)
backgroundView.backgroundColor = backgroundViewBackgroundColor
backgroundView.layer.borderWidth = backgroundViewBorder
backgroundView.layer.borderColor = backgroundViewBorderColor.cgColor
}
private func setupFillView() {
let offset = backgroundViewBorder + fillViewInset
fillView.frame = backgroundView.frame.insetBy(dx: offset, dy: offset)
fillView.backgroundColor = fillViewBackgroundColor
}
}
| //
// GTProgressBar.swift
// Pods
//
// Created by Grzegorz Tatarzyn on 19/09/2016.
//
//
import UIKit
public class GTProgressBar: UIView {
private let backgroundView = UIView()
private let fillView = UIView()
private let backgroundViewBorder: CGFloat = 2
private let backgroundViewBorderColor: UIColor = UIColor.black
private let backgroundViewBackgroundColor: UIColor = UIColor.white
private let fillViewInset: CGFloat = 2
private let fillViewBackgroundColor = UIColor.black
public override init(frame: CGRect) {
super.init(frame: frame)
prepareSubviews()
}
required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
prepareSubviews()
}
private func prepareSubviews() {
addSubview(backgroundView)
addSubview(fillView)
}
public override func layoutSubviews() {
+ setupBackgroundView()
+ setupFillView()
+ }
+
+ private func setupBackgroundView() {
backgroundView.frame = CGRect(origin: CGPoint.zero, size: frame.size)
backgroundView.backgroundColor = backgroundViewBackgroundColor
backgroundView.layer.borderWidth = backgroundViewBorder
backgroundView.layer.borderColor = backgroundViewBorderColor.cgColor
-
+ }
+
+ private func setupFillView() {
let offset = backgroundViewBorder + fillViewInset
fillView.frame = backgroundView.frame.insetBy(dx: offset, dy: offset)
fillView.backgroundColor = fillViewBackgroundColor
}
} | 9 | 0.2 | 8 | 1 |
9944bd62cb33aa24b6a69d4288283ec16db6cc84 | check_bts_seeds.sh | check_bts_seeds.sh |
BRANCH=master
if [ -n "$1" ]; then
BRANCH=$1
fi
if [ "${BRANCH}" == "testnet" ]; then
seeds_file=https://raw.githubusercontent.com/bitshares/bitshares-core/${BRANCH}/libraries/egenesis/seed-nodes-testnet.txt
else
seeds_file=https://raw.githubusercontent.com/bitshares/bitshares-core/${BRANCH}/libraries/egenesis/seed-nodes.txt
fi
seeds=`curl $seeds_file 2>/dev/null | tail -n "+2" | cut -f2 -d'"'`
for seed in ${seeds}; do
seed_host=`echo $seed|cut -f1 -d':'`;
seed_port=`echo $seed|cut -f2 -d':'`;
seed_ips=`dig "$seed_host"|grep -v '^;'|grep -E "IN\s*A"|awk '{print $5}'|sort`
if [ -z "$seed_ips" ]; then
echo "$seed\t\t\t\tDNS lookup failed"
else
count=`echo "$seed_ips"|wc -l`
if [ "$count" = "1" ]; then
printf "%-32s" $seed
else
printf "%s (%d IP addresses)\n" $seed $count
fi
for seed_ip in $seed_ips; do
printf "%-24s" "${seed_ip}:${seed_port}"
[ -n "`nc ${seed_ip} $seed_port -w 10 -W 1`" ] && echo Ok || echo Failed
done
fi
done
|
BRANCH=master
if [ -n "$1" ]; then
BRANCH=$1
fi
if [ "${BRANCH}" == "testnet" ]; then
seeds_file=https://raw.githubusercontent.com/bitshares/bitshares-core/${BRANCH}/libraries/egenesis/seed-nodes-testnet.txt
else
seeds_file=https://raw.githubusercontent.com/bitshares/bitshares-core/${BRANCH}/libraries/egenesis/seed-nodes.txt
fi
seeds=`curl $seeds_file 2>/dev/null | grep -v '^//' | cut -f2 -d'"'`
for seed in ${seeds}; do
seed_host=`echo $seed|cut -f1 -d':'`;
seed_port=`echo $seed|cut -f2 -d':'`;
seed_ips=`dig "$seed_host"|grep -v '^;'|grep -E "IN\s*A"|awk '{print $5}'|sort`
if [ -z "$seed_ips" ]; then
printf "%-62s" $seed
echo "DNS lookup failed"
else
count=`echo "$seed_ips"|wc -l`
if [ "$count" = "1" ]; then
printf "%-38s" $seed
else
printf "%s (%d IP addresses)\n" $seed $count
fi
for seed_ip in $seed_ips; do
printf "%-24s" "${seed_ip}:${seed_port}"
[[ $( nc ${seed_ip} $seed_port -w 10 -W 1 | wc -c ) -ne 0 ]] && echo Ok || echo Failed
done
fi
done
| Fix seed file process and NUL byte issue, reformat | Fix seed file process and NUL byte issue, reformat | Shell | unlicense | abitmore/btstools,abitmore/btstools | shell | ## Code Before:
BRANCH=master
if [ -n "$1" ]; then
BRANCH=$1
fi
if [ "${BRANCH}" == "testnet" ]; then
seeds_file=https://raw.githubusercontent.com/bitshares/bitshares-core/${BRANCH}/libraries/egenesis/seed-nodes-testnet.txt
else
seeds_file=https://raw.githubusercontent.com/bitshares/bitshares-core/${BRANCH}/libraries/egenesis/seed-nodes.txt
fi
seeds=`curl $seeds_file 2>/dev/null | tail -n "+2" | cut -f2 -d'"'`
for seed in ${seeds}; do
seed_host=`echo $seed|cut -f1 -d':'`;
seed_port=`echo $seed|cut -f2 -d':'`;
seed_ips=`dig "$seed_host"|grep -v '^;'|grep -E "IN\s*A"|awk '{print $5}'|sort`
if [ -z "$seed_ips" ]; then
echo "$seed\t\t\t\tDNS lookup failed"
else
count=`echo "$seed_ips"|wc -l`
if [ "$count" = "1" ]; then
printf "%-32s" $seed
else
printf "%s (%d IP addresses)\n" $seed $count
fi
for seed_ip in $seed_ips; do
printf "%-24s" "${seed_ip}:${seed_port}"
[ -n "`nc ${seed_ip} $seed_port -w 10 -W 1`" ] && echo Ok || echo Failed
done
fi
done
## Instruction:
Fix seed file process and NUL byte issue, reformat
## Code After:
BRANCH=master
if [ -n "$1" ]; then
BRANCH=$1
fi
if [ "${BRANCH}" == "testnet" ]; then
seeds_file=https://raw.githubusercontent.com/bitshares/bitshares-core/${BRANCH}/libraries/egenesis/seed-nodes-testnet.txt
else
seeds_file=https://raw.githubusercontent.com/bitshares/bitshares-core/${BRANCH}/libraries/egenesis/seed-nodes.txt
fi
seeds=`curl $seeds_file 2>/dev/null | grep -v '^//' | cut -f2 -d'"'`
for seed in ${seeds}; do
seed_host=`echo $seed|cut -f1 -d':'`;
seed_port=`echo $seed|cut -f2 -d':'`;
seed_ips=`dig "$seed_host"|grep -v '^;'|grep -E "IN\s*A"|awk '{print $5}'|sort`
if [ -z "$seed_ips" ]; then
printf "%-62s" $seed
echo "DNS lookup failed"
else
count=`echo "$seed_ips"|wc -l`
if [ "$count" = "1" ]; then
printf "%-38s" $seed
else
printf "%s (%d IP addresses)\n" $seed $count
fi
for seed_ip in $seed_ips; do
printf "%-24s" "${seed_ip}:${seed_port}"
[[ $( nc ${seed_ip} $seed_port -w 10 -W 1 | wc -c ) -ne 0 ]] && echo Ok || echo Failed
done
fi
done
|
BRANCH=master
if [ -n "$1" ]; then
BRANCH=$1
fi
if [ "${BRANCH}" == "testnet" ]; then
seeds_file=https://raw.githubusercontent.com/bitshares/bitshares-core/${BRANCH}/libraries/egenesis/seed-nodes-testnet.txt
else
seeds_file=https://raw.githubusercontent.com/bitshares/bitshares-core/${BRANCH}/libraries/egenesis/seed-nodes.txt
fi
- seeds=`curl $seeds_file 2>/dev/null | tail -n "+2" | cut -f2 -d'"'`
? ^^^^ ^ ^^^^
+ seeds=`curl $seeds_file 2>/dev/null | grep -v '^//' | cut -f2 -d'"'`
? ^^^^ ^ ^^^^^
for seed in ${seeds}; do
seed_host=`echo $seed|cut -f1 -d':'`;
seed_port=`echo $seed|cut -f2 -d':'`;
seed_ips=`dig "$seed_host"|grep -v '^;'|grep -E "IN\s*A"|awk '{print $5}'|sort`
if [ -z "$seed_ips" ]; then
+ printf "%-62s" $seed
- echo "$seed\t\t\t\tDNS lookup failed"
? -------------
+ echo "DNS lookup failed"
else
count=`echo "$seed_ips"|wc -l`
if [ "$count" = "1" ]; then
- printf "%-32s" $seed
? ^
+ printf "%-38s" $seed
? ^
else
printf "%s (%d IP addresses)\n" $seed $count
fi
for seed_ip in $seed_ips; do
printf "%-24s" "${seed_ip}:${seed_port}"
- [ -n "`nc ${seed_ip} $seed_port -w 10 -W 1`" ] && echo Ok || echo Failed
? ^^ -- --
+ [[ $( nc ${seed_ip} $seed_port -w 10 -W 1 | wc -c ) -ne 0 ]] && echo Ok || echo Failed
? + ^^ +++++++++++++++++
done
fi
done | 9 | 0.257143 | 5 | 4 |
f9a7d5815780435e12c4721059ca8939372c716a | app/views/my_modules/_card_due_date_label.html.erb | app/views/my_modules/_card_due_date_label.html.erb | <% if my_module.completed? %>
<%= t("my_modules.states.completed") %>
<span class="due-date-label">
<%= l(my_module.completed_on.utc, format: :full_date) %>
<span class="fas fa-check"></span>
</span>
<% elsif my_module.is_one_day_prior? %>
<%= t("my_modules.states.due_soon") %>
<span class="due-date-label">
<%=l my_module.due_date.utc, format: :full_date %>
<span class="fas fa-exclamation-triangle"></span>
</span>
<% elsif my_module.is_overdue? %>
<%= t("my_modules.states.overdue") %>
<span class="due-date-label">
<%=l my_module.due_date.utc, format: :full_date %>
<span class="fas fa-exclamation-triangle"></span>
</span>
<% elsif my_module.due_date %>
<%= t("experiments.canvas.full_zoom.due_date") %>
<span class="due-date-label">
<%=l my_module.due_date.utc, format: :full_date %>
</span>
<% else %>
<%= t("experiments.canvas.full_zoom.due_date") %>
<span class="due-date-label">
<em><%=t "experiments.canvas.full_zoom.no_due_date" %></em>
</span>
<% end %>
| <% if my_module.completed? %>
<%= t('my_modules.states.completed') %>
<span class="due-date-label">
<%= l(my_module.completed_on, format: :full_date) %>
<span class="fas fa-check"></span>
</span>
<% elsif my_module.is_one_day_prior? %>
<%= t('my_modules.states.due_soon') %>
<span class="due-date-label">
<%= l(my_module.due_date, format: :full_date) %>
<span class="fas fa-exclamation-triangle"></span>
</span>
<% elsif my_module.is_overdue? %>
<%= t('my_modules.states.overdue') %>
<span class="due-date-label">
<%= l(my_module.due_date, format: :full_date) %>
<span class="fas fa-exclamation-triangle"></span>
</span>
<% elsif my_module.due_date %>
<%= t('experiments.canvas.full_zoom.due_date') %>
<span class="due-date-label">
<%= l(my_module.due_date, format: :full_date) %>
</span>
<% else %>
<%= t('experiments.canvas.full_zoom.due_date') %>
<span class="due-date-label">
<em><%= t('experiments.canvas.full_zoom.no_due_date') %></em>
</span>
<% end %>
| Fix due dates on task cards in the canvas | Fix due dates on task cards in the canvas [SCI-4487]
| HTML+ERB | mpl-2.0 | mlorb/scinote-web,mlorb/scinote-web,mlorb/scinote-web | html+erb | ## Code Before:
<% if my_module.completed? %>
<%= t("my_modules.states.completed") %>
<span class="due-date-label">
<%= l(my_module.completed_on.utc, format: :full_date) %>
<span class="fas fa-check"></span>
</span>
<% elsif my_module.is_one_day_prior? %>
<%= t("my_modules.states.due_soon") %>
<span class="due-date-label">
<%=l my_module.due_date.utc, format: :full_date %>
<span class="fas fa-exclamation-triangle"></span>
</span>
<% elsif my_module.is_overdue? %>
<%= t("my_modules.states.overdue") %>
<span class="due-date-label">
<%=l my_module.due_date.utc, format: :full_date %>
<span class="fas fa-exclamation-triangle"></span>
</span>
<% elsif my_module.due_date %>
<%= t("experiments.canvas.full_zoom.due_date") %>
<span class="due-date-label">
<%=l my_module.due_date.utc, format: :full_date %>
</span>
<% else %>
<%= t("experiments.canvas.full_zoom.due_date") %>
<span class="due-date-label">
<em><%=t "experiments.canvas.full_zoom.no_due_date" %></em>
</span>
<% end %>
## Instruction:
Fix due dates on task cards in the canvas [SCI-4487]
## Code After:
<% if my_module.completed? %>
<%= t('my_modules.states.completed') %>
<span class="due-date-label">
<%= l(my_module.completed_on, format: :full_date) %>
<span class="fas fa-check"></span>
</span>
<% elsif my_module.is_one_day_prior? %>
<%= t('my_modules.states.due_soon') %>
<span class="due-date-label">
<%= l(my_module.due_date, format: :full_date) %>
<span class="fas fa-exclamation-triangle"></span>
</span>
<% elsif my_module.is_overdue? %>
<%= t('my_modules.states.overdue') %>
<span class="due-date-label">
<%= l(my_module.due_date, format: :full_date) %>
<span class="fas fa-exclamation-triangle"></span>
</span>
<% elsif my_module.due_date %>
<%= t('experiments.canvas.full_zoom.due_date') %>
<span class="due-date-label">
<%= l(my_module.due_date, format: :full_date) %>
</span>
<% else %>
<%= t('experiments.canvas.full_zoom.due_date') %>
<span class="due-date-label">
<em><%= t('experiments.canvas.full_zoom.no_due_date') %></em>
</span>
<% end %>
| <% if my_module.completed? %>
- <%= t("my_modules.states.completed") %>
? ^ ^
+ <%= t('my_modules.states.completed') %>
? ^ ^
<span class="due-date-label">
- <%= l(my_module.completed_on.utc, format: :full_date) %>
? ----
+ <%= l(my_module.completed_on, format: :full_date) %>
<span class="fas fa-check"></span>
</span>
<% elsif my_module.is_one_day_prior? %>
- <%= t("my_modules.states.due_soon") %>
? ^ ^
+ <%= t('my_modules.states.due_soon') %>
? ^ ^
<span class="due-date-label">
- <%=l my_module.due_date.utc, format: :full_date %>
? ^ ----
+ <%= l(my_module.due_date, format: :full_date) %>
? + ^ +
<span class="fas fa-exclamation-triangle"></span>
</span>
<% elsif my_module.is_overdue? %>
- <%= t("my_modules.states.overdue") %>
? ^ ^
+ <%= t('my_modules.states.overdue') %>
? ^ ^
<span class="due-date-label">
- <%=l my_module.due_date.utc, format: :full_date %>
? ^ ----
+ <%= l(my_module.due_date, format: :full_date) %>
? + ^ +
<span class="fas fa-exclamation-triangle"></span>
</span>
<% elsif my_module.due_date %>
- <%= t("experiments.canvas.full_zoom.due_date") %>
? ^ ^
+ <%= t('experiments.canvas.full_zoom.due_date') %>
? ^ ^
<span class="due-date-label">
- <%=l my_module.due_date.utc, format: :full_date %>
? ^ ----
+ <%= l(my_module.due_date, format: :full_date) %>
? + ^ +
</span>
<% else %>
- <%= t("experiments.canvas.full_zoom.due_date") %>
? ^ ^
+ <%= t('experiments.canvas.full_zoom.due_date') %>
? ^ ^
<span class="due-date-label">
- <em><%=t "experiments.canvas.full_zoom.no_due_date" %></em>
? ^^ ^
+ <em><%= t('experiments.canvas.full_zoom.no_due_date') %></em>
? + ^^ ^^
</span>
<% end %> | 20 | 0.689655 | 10 | 10 |
2aea738a2edf89ef972287c38d527784603e2690 | Cargo.toml | Cargo.toml | [package]
name = "rotting13-bot"
version = "1.0.0"
authors = ["Bocom"]
[dependencies.websocket]
version = "0.17"
[dependencies.discord]
default_features = false
git = "https://github.com/SpaceManiac/discord-rs" | [package]
name = "rotting13-bot"
version = "1.0.0"
authors = ["Bocom"]
[dependencies.websocket]
version = "0.17"
[dependencies.discord]
default_features = false
git = "https://github.com/Bocom/discord-rs" | Switch to my fork of discord-rs. Temporary measure until my pull-request is merged. | Switch to my fork of discord-rs.
Temporary measure until my pull-request is merged.
| TOML | mit | Bocom/the-rotting-13 | toml | ## Code Before:
[package]
name = "rotting13-bot"
version = "1.0.0"
authors = ["Bocom"]
[dependencies.websocket]
version = "0.17"
[dependencies.discord]
default_features = false
git = "https://github.com/SpaceManiac/discord-rs"
## Instruction:
Switch to my fork of discord-rs.
Temporary measure until my pull-request is merged.
## Code After:
[package]
name = "rotting13-bot"
version = "1.0.0"
authors = ["Bocom"]
[dependencies.websocket]
version = "0.17"
[dependencies.discord]
default_features = false
git = "https://github.com/Bocom/discord-rs" | [package]
name = "rotting13-bot"
version = "1.0.0"
authors = ["Bocom"]
[dependencies.websocket]
version = "0.17"
[dependencies.discord]
default_features = false
- git = "https://github.com/SpaceManiac/discord-rs"
? ^^^ ^^^^^^^
+ git = "https://github.com/Bocom/discord-rs"
? ^^ ^^
| 2 | 0.181818 | 1 | 1 |
5e55b947004b261551828ca649aca9c223bc90ff | src/views/Tutorial.test.js | src/views/Tutorial.test.js | /* eslint-env jest */
import { visit } from './testUtils'
describe('Tutorial page', () => {
it('loads in /tutorial', async () => {
const page = visit('/tutorial')
const text = await page.evaluate(() => document.body.textContent).end()
expect(text).not.toContain('Page not found')
})
it('has a youtube video', async () => {
const page = visit('/tutorial')
const videoSelector = 'iframe[src*="youtube.com"]'
const hasVideo = await page.exists(videoSelector).end()
expect(hasVideo).toEqual(true)
})
it('mentions contacting Jesse', async () => {
const page = visit('/tutorial')
const text = await page.evaluate(() => document.body.textContent).end()
expect(text).toContain('please contact Jesse Weigel')
})
})
| /* eslint-env jest */
import { visit } from './testUtils'
describe('Tutorial page', () => {
it('loads in /tutorial', async () => {
const page = visit('/tutorial')
const text = await page.evaluate(() => document.body.textContent).end()
expect(text).not.toContain('Page not found')
})
it('has a youtube video', async () => {
const page = visit('/tutorial')
const videoSelector = 'iframe[src*="youtube.com"]'
const hasVideo = await page.exists(videoSelector).end()
expect(hasVideo).toEqual(true)
})
it('mentions contacting Jesse', async () => {
const page = visit('/tutorial')
const text = await page.evaluate(() => document.body.textContent).end()
expect(text).toContain('please contact Jesse Weigel')
})
const testCentered = async viewport => {
const page = visit('/tutorial')
const { leftSpace, rightSpace } = await page
.viewport(viewport.width, viewport.height)
.evaluate(() => {
const iframeRect = document
.querySelector('iframe')
.getBoundingClientRect()
const viewportWidth = window.innerWidth // Not incluiding scrollbar
const leftSpace = iframeRect.left
const rightSpace = viewportWidth - iframeRect.right
return { leftSpace, rightSpace }
})
.end()
const difference = Math.abs(leftSpace - rightSpace)
return expect(difference).toBeLessThanOrEqual(1) // Allow up to 1px of difference
}
it('has an iframe centered in a big viewport', () =>
testCentered({ width: 1920, height: 1080 }))
it('has an iframe centered in a small viewport', () =>
testCentered({ width: 320, height: 570 }))
})
| Test that the video is centered | Test that the video is centered
By actually comparing the positioning aganist the size of the viewport,
so not checking some specific css or styling.
| JavaScript | mit | fus-marcom/resource-center,planigan/resource-center,fus-marcom/resource-center,planigan/resource-center | javascript | ## Code Before:
/* eslint-env jest */
import { visit } from './testUtils'
describe('Tutorial page', () => {
it('loads in /tutorial', async () => {
const page = visit('/tutorial')
const text = await page.evaluate(() => document.body.textContent).end()
expect(text).not.toContain('Page not found')
})
it('has a youtube video', async () => {
const page = visit('/tutorial')
const videoSelector = 'iframe[src*="youtube.com"]'
const hasVideo = await page.exists(videoSelector).end()
expect(hasVideo).toEqual(true)
})
it('mentions contacting Jesse', async () => {
const page = visit('/tutorial')
const text = await page.evaluate(() => document.body.textContent).end()
expect(text).toContain('please contact Jesse Weigel')
})
})
## Instruction:
Test that the video is centered
By actually comparing the positioning aganist the size of the viewport,
so not checking some specific css or styling.
## Code After:
/* eslint-env jest */
import { visit } from './testUtils'
describe('Tutorial page', () => {
it('loads in /tutorial', async () => {
const page = visit('/tutorial')
const text = await page.evaluate(() => document.body.textContent).end()
expect(text).not.toContain('Page not found')
})
it('has a youtube video', async () => {
const page = visit('/tutorial')
const videoSelector = 'iframe[src*="youtube.com"]'
const hasVideo = await page.exists(videoSelector).end()
expect(hasVideo).toEqual(true)
})
it('mentions contacting Jesse', async () => {
const page = visit('/tutorial')
const text = await page.evaluate(() => document.body.textContent).end()
expect(text).toContain('please contact Jesse Weigel')
})
const testCentered = async viewport => {
const page = visit('/tutorial')
const { leftSpace, rightSpace } = await page
.viewport(viewport.width, viewport.height)
.evaluate(() => {
const iframeRect = document
.querySelector('iframe')
.getBoundingClientRect()
const viewportWidth = window.innerWidth // Not incluiding scrollbar
const leftSpace = iframeRect.left
const rightSpace = viewportWidth - iframeRect.right
return { leftSpace, rightSpace }
})
.end()
const difference = Math.abs(leftSpace - rightSpace)
return expect(difference).toBeLessThanOrEqual(1) // Allow up to 1px of difference
}
it('has an iframe centered in a big viewport', () =>
testCentered({ width: 1920, height: 1080 }))
it('has an iframe centered in a small viewport', () =>
testCentered({ width: 320, height: 570 }))
})
| /* eslint-env jest */
import { visit } from './testUtils'
describe('Tutorial page', () => {
it('loads in /tutorial', async () => {
const page = visit('/tutorial')
const text = await page.evaluate(() => document.body.textContent).end()
expect(text).not.toContain('Page not found')
})
it('has a youtube video', async () => {
const page = visit('/tutorial')
const videoSelector = 'iframe[src*="youtube.com"]'
const hasVideo = await page.exists(videoSelector).end()
expect(hasVideo).toEqual(true)
})
it('mentions contacting Jesse', async () => {
const page = visit('/tutorial')
const text = await page.evaluate(() => document.body.textContent).end()
expect(text).toContain('please contact Jesse Weigel')
})
+
+ const testCentered = async viewport => {
+ const page = visit('/tutorial')
+ const { leftSpace, rightSpace } = await page
+ .viewport(viewport.width, viewport.height)
+ .evaluate(() => {
+ const iframeRect = document
+ .querySelector('iframe')
+ .getBoundingClientRect()
+ const viewportWidth = window.innerWidth // Not incluiding scrollbar
+ const leftSpace = iframeRect.left
+ const rightSpace = viewportWidth - iframeRect.right
+ return { leftSpace, rightSpace }
+ })
+ .end()
+
+ const difference = Math.abs(leftSpace - rightSpace)
+ return expect(difference).toBeLessThanOrEqual(1) // Allow up to 1px of difference
+ }
+
+ it('has an iframe centered in a big viewport', () =>
+ testCentered({ width: 1920, height: 1080 }))
+
+ it('has an iframe centered in a small viewport', () =>
+ testCentered({ width: 320, height: 570 }))
}) | 25 | 0.925926 | 25 | 0 |
7fa91bfd3ca4ff3ed83bedcdde5d06980d60c33e | app.json | app.json | {
"name":"poradnia",
"scripts":{
"postdeploy":"python poradnia/manage.py migrate"
},
"env":{
"DJANGO_CONFIGURATION":{
"required":true
},
"DJANGO_EMAIL_HOST_PASSWORD":{
"required":true
},
"DJANGO_EMAIL_HOST_USER":{
"required":true
},
"DJANGO_SECRET_KEY":{
"required":true
},
"DJANGO_SERVER_EMAIL":{
"required":true
},
"DJANGO_SETTINGS_MODULE":{
"required":true
},
"EMAIL_HOST_PASSWORD":{
"required":true
},
"EMAIL_HOST_USER":{
"required":true
},
"NEW_RELIC_APP_NAME":{
"required":true
},
"WHITENOISE_USE":{
"required":true
}
},
"addons":[
"sendgrid",
"newrelic",
"cleardb",
"memcachier"
],
"buildpacks": [
{
"url": "https://github.com/heroku/heroku-buildpack-python"
}
]
}
| {
"name":"poradnia",
"scripts":{
"postdeploy":"python poradnia/manage.py migrate; echo \"from users.models import User; u, _=User.objects.get_or_create(username='admin', defaults={'email':'admin@example.com', 'is_superuser':True, 'is_staff':True}); u.set_password('admin'); print (u, u.pk); u.save(); print (u, u.pk);\" | python poradnia/manage.py shell --plain;"
},
"env":{
"DJANGO_CONFIGURATION":{
"required":true
},
"DJANGO_EMAIL_HOST_PASSWORD":{
"required":true
},
"DJANGO_EMAIL_HOST_USER":{
"required":true
},
"DJANGO_SECRET_KEY":{
"required":true
},
"DJANGO_SERVER_EMAIL":{
"required":true
},
"DJANGO_SETTINGS_MODULE":{
"required":true
},
"EMAIL_HOST_PASSWORD":{
"required":true
},
"EMAIL_HOST_USER":{
"required":true
},
"NEW_RELIC_APP_NAME":{
"required":true
},
"WHITENOISE_USE":{
"required":true
}
},
"addons":[
"sendgrid",
"newrelic",
"cleardb",
"memcachier"
],
"buildpacks": [
{
"url": "https://github.com/heroku/heroku-buildpack-python"
}
]
}
| Add default admin for heroku autodeploy | Add default admin for heroku autodeploy
| JSON | mit | watchdogpolska/poradnia.siecobywatelska.pl,rwakulszowa/poradnia,watchdogpolska/poradnia,rwakulszowa/poradnia,watchdogpolska/poradnia,watchdogpolska/poradnia,watchdogpolska/poradnia.siecobywatelska.pl,rwakulszowa/poradnia,watchdogpolska/poradnia.siecobywatelska.pl,watchdogpolska/poradnia,rwakulszowa/poradnia | json | ## Code Before:
{
"name":"poradnia",
"scripts":{
"postdeploy":"python poradnia/manage.py migrate"
},
"env":{
"DJANGO_CONFIGURATION":{
"required":true
},
"DJANGO_EMAIL_HOST_PASSWORD":{
"required":true
},
"DJANGO_EMAIL_HOST_USER":{
"required":true
},
"DJANGO_SECRET_KEY":{
"required":true
},
"DJANGO_SERVER_EMAIL":{
"required":true
},
"DJANGO_SETTINGS_MODULE":{
"required":true
},
"EMAIL_HOST_PASSWORD":{
"required":true
},
"EMAIL_HOST_USER":{
"required":true
},
"NEW_RELIC_APP_NAME":{
"required":true
},
"WHITENOISE_USE":{
"required":true
}
},
"addons":[
"sendgrid",
"newrelic",
"cleardb",
"memcachier"
],
"buildpacks": [
{
"url": "https://github.com/heroku/heroku-buildpack-python"
}
]
}
## Instruction:
Add default admin for heroku autodeploy
## Code After:
{
"name":"poradnia",
"scripts":{
"postdeploy":"python poradnia/manage.py migrate; echo \"from users.models import User; u, _=User.objects.get_or_create(username='admin', defaults={'email':'admin@example.com', 'is_superuser':True, 'is_staff':True}); u.set_password('admin'); print (u, u.pk); u.save(); print (u, u.pk);\" | python poradnia/manage.py shell --plain;"
},
"env":{
"DJANGO_CONFIGURATION":{
"required":true
},
"DJANGO_EMAIL_HOST_PASSWORD":{
"required":true
},
"DJANGO_EMAIL_HOST_USER":{
"required":true
},
"DJANGO_SECRET_KEY":{
"required":true
},
"DJANGO_SERVER_EMAIL":{
"required":true
},
"DJANGO_SETTINGS_MODULE":{
"required":true
},
"EMAIL_HOST_PASSWORD":{
"required":true
},
"EMAIL_HOST_USER":{
"required":true
},
"NEW_RELIC_APP_NAME":{
"required":true
},
"WHITENOISE_USE":{
"required":true
}
},
"addons":[
"sendgrid",
"newrelic",
"cleardb",
"memcachier"
],
"buildpacks": [
{
"url": "https://github.com/heroku/heroku-buildpack-python"
}
]
}
| {
"name":"poradnia",
"scripts":{
- "postdeploy":"python poradnia/manage.py migrate"
+ "postdeploy":"python poradnia/manage.py migrate; echo \"from users.models import User; u, _=User.objects.get_or_create(username='admin', defaults={'email':'admin@example.com', 'is_superuser':True, 'is_staff':True}); u.set_password('admin'); print (u, u.pk); u.save(); print (u, u.pk);\" | python poradnia/manage.py shell --plain;"
},
"env":{
"DJANGO_CONFIGURATION":{
"required":true
},
"DJANGO_EMAIL_HOST_PASSWORD":{
"required":true
},
"DJANGO_EMAIL_HOST_USER":{
"required":true
},
"DJANGO_SECRET_KEY":{
"required":true
},
"DJANGO_SERVER_EMAIL":{
"required":true
},
"DJANGO_SETTINGS_MODULE":{
"required":true
},
"EMAIL_HOST_PASSWORD":{
"required":true
},
"EMAIL_HOST_USER":{
"required":true
},
"NEW_RELIC_APP_NAME":{
"required":true
},
"WHITENOISE_USE":{
"required":true
}
},
"addons":[
"sendgrid",
"newrelic",
"cleardb",
"memcachier"
],
"buildpacks": [
{
"url": "https://github.com/heroku/heroku-buildpack-python"
}
]
} | 2 | 0.040816 | 1 | 1 |
6511e418d8fc07603183dd8473150cca2a482a61 | README.rst | README.rst | ============
GeoAlchemy 2
============
.. image:: https://travis-ci.org/geoalchemy/geoalchemy2.png?branch=master
:target: http://travis-ci.org/#!/geoalchemy/geoalchemy2
.. image:: https://coveralls.io/repos/geoalchemy/geoalchemy2/badge.png?branch=master
:target: https://coveralls.io/r/geoalchemy/geoalchemy2
.. image:: https://readthedocs.org/projects/geoalchemy-2/badge/?version=latest
:target: http://geoalchemy-2.readthedocs.org/en/latest/?badge=latest
:alt: Documentation Status
GeoAlchemy 2 is a Python toolkit for working with spatial databases. It is
based on the gorgeous `SQLAlchemy <http://www.sqlalchemy.org/>`_.
Documentation is on Read the Docs: http://geoalchemy-2.rtfd.org.
| ============
GeoAlchemy 2
============
.. image:: https://travis-ci.org/geoalchemy/geoalchemy2.png?branch=master
:target: http://travis-ci.org/#!/geoalchemy/geoalchemy2
.. image:: https://coveralls.io/repos/geoalchemy/geoalchemy2/badge.png?branch=master
:target: https://coveralls.io/r/geoalchemy/geoalchemy2
.. image:: https://readthedocs.org/projects/geoalchemy-2/badge/?version=latest
:target: https://geoalchemy-2.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
GeoAlchemy 2 is a Python toolkit for working with spatial databases. It is
based on the gorgeous `SQLAlchemy <http://www.sqlalchemy.org/>`_.
Documentation is on Read the Docs: https://geoalchemy-2.readthedocs.io.
| Convert readthedocs links for their .org -> .io migration for hosted projects | Convert readthedocs links for their .org -> .io migration for hosted projects
As per [their blog post of the 27th April](https://blog.readthedocs.com/securing-subdomains/) ‘Securing subdomains’:
> Starting today, Read the Docs will start hosting projects from subdomains on the domain readthedocs.io, instead of on readthedocs.org. This change addresses some security concerns around site cookies while hosting user generated data on the same domain as our dashboard.
Test Plan: Manually visited all the links I’ve modified.
| reStructuredText | mit | geoalchemy/geoalchemy2 | restructuredtext | ## Code Before:
============
GeoAlchemy 2
============
.. image:: https://travis-ci.org/geoalchemy/geoalchemy2.png?branch=master
:target: http://travis-ci.org/#!/geoalchemy/geoalchemy2
.. image:: https://coveralls.io/repos/geoalchemy/geoalchemy2/badge.png?branch=master
:target: https://coveralls.io/r/geoalchemy/geoalchemy2
.. image:: https://readthedocs.org/projects/geoalchemy-2/badge/?version=latest
:target: http://geoalchemy-2.readthedocs.org/en/latest/?badge=latest
:alt: Documentation Status
GeoAlchemy 2 is a Python toolkit for working with spatial databases. It is
based on the gorgeous `SQLAlchemy <http://www.sqlalchemy.org/>`_.
Documentation is on Read the Docs: http://geoalchemy-2.rtfd.org.
## Instruction:
Convert readthedocs links for their .org -> .io migration for hosted projects
As per [their blog post of the 27th April](https://blog.readthedocs.com/securing-subdomains/) ‘Securing subdomains’:
> Starting today, Read the Docs will start hosting projects from subdomains on the domain readthedocs.io, instead of on readthedocs.org. This change addresses some security concerns around site cookies while hosting user generated data on the same domain as our dashboard.
Test Plan: Manually visited all the links I’ve modified.
## Code After:
============
GeoAlchemy 2
============
.. image:: https://travis-ci.org/geoalchemy/geoalchemy2.png?branch=master
:target: http://travis-ci.org/#!/geoalchemy/geoalchemy2
.. image:: https://coveralls.io/repos/geoalchemy/geoalchemy2/badge.png?branch=master
:target: https://coveralls.io/r/geoalchemy/geoalchemy2
.. image:: https://readthedocs.org/projects/geoalchemy-2/badge/?version=latest
:target: https://geoalchemy-2.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
GeoAlchemy 2 is a Python toolkit for working with spatial databases. It is
based on the gorgeous `SQLAlchemy <http://www.sqlalchemy.org/>`_.
Documentation is on Read the Docs: https://geoalchemy-2.readthedocs.io.
| ============
GeoAlchemy 2
============
.. image:: https://travis-ci.org/geoalchemy/geoalchemy2.png?branch=master
:target: http://travis-ci.org/#!/geoalchemy/geoalchemy2
.. image:: https://coveralls.io/repos/geoalchemy/geoalchemy2/badge.png?branch=master
:target: https://coveralls.io/r/geoalchemy/geoalchemy2
.. image:: https://readthedocs.org/projects/geoalchemy-2/badge/?version=latest
- :target: http://geoalchemy-2.readthedocs.org/en/latest/?badge=latest
? --
+ :target: https://geoalchemy-2.readthedocs.io/en/latest/?badge=latest
? + +
:alt: Documentation Status
GeoAlchemy 2 is a Python toolkit for working with spatial databases. It is
based on the gorgeous `SQLAlchemy <http://www.sqlalchemy.org/>`_.
- Documentation is on Read the Docs: http://geoalchemy-2.rtfd.org.
? ^ --
+ Documentation is on Read the Docs: https://geoalchemy-2.readthedocs.io.
? + +++ ^^ +++ +
| 4 | 0.222222 | 2 | 2 |
63721f91fbbc7bd3c87880107ac9e9a7b0d4116b | backend/app/views/spree/admin/shared/_locale_selection.html.erb | backend/app/views/spree/admin/shared/_locale_selection.html.erb | <div class="admin-locale-selection">
<% available_locales = Spree.i18n_available_locales %>
<% if available_locales.size > 1 %>
<select class="js-locale-selection custom-select fullwidth">
<%=
options_for_select(
available_locales.map do |locale|
[I18n.t('spree.i18n.this_file_language', locale: locale, default: locale.to_s, fallback: false), locale]
end.sort,
selected: I18n.locale,
)
%>
</select>
<% end %>
</div>
| <% available_locales = Spree.i18n_available_locales %>
<% if available_locales.size > 1 %>
<div class="admin-locale-selection">
<select class="js-locale-selection custom-select fullwidth">
<%=
options_for_select(
available_locales.map do |locale|
[I18n.t('spree.i18n.this_file_language', locale: locale, default: locale.to_s, fallback: false), locale]
end.sort,
selected: I18n.locale,
)
%>
</select>
</div>
<% end %>
| Move locale selection div inside if statement | Move locale selection div inside if statement
| HTML+ERB | bsd-3-clause | pervino/solidus,pervino/solidus,pervino/solidus,pervino/solidus | html+erb | ## Code Before:
<div class="admin-locale-selection">
<% available_locales = Spree.i18n_available_locales %>
<% if available_locales.size > 1 %>
<select class="js-locale-selection custom-select fullwidth">
<%=
options_for_select(
available_locales.map do |locale|
[I18n.t('spree.i18n.this_file_language', locale: locale, default: locale.to_s, fallback: false), locale]
end.sort,
selected: I18n.locale,
)
%>
</select>
<% end %>
</div>
## Instruction:
Move locale selection div inside if statement
## Code After:
<% available_locales = Spree.i18n_available_locales %>
<% if available_locales.size > 1 %>
<div class="admin-locale-selection">
<select class="js-locale-selection custom-select fullwidth">
<%=
options_for_select(
available_locales.map do |locale|
[I18n.t('spree.i18n.this_file_language', locale: locale, default: locale.to_s, fallback: false), locale]
end.sort,
selected: I18n.locale,
)
%>
</select>
</div>
<% end %>
| - <div class="admin-locale-selection">
- <% available_locales = Spree.i18n_available_locales %>
? --
+ <% available_locales = Spree.i18n_available_locales %>
- <% if available_locales.size > 1 %>
? --
+ <% if available_locales.size > 1 %>
+ <div class="admin-locale-selection">
<select class="js-locale-selection custom-select fullwidth">
<%=
options_for_select(
available_locales.map do |locale|
[I18n.t('spree.i18n.this_file_language', locale: locale, default: locale.to_s, fallback: false), locale]
end.sort,
selected: I18n.locale,
)
%>
</select>
+ </div>
- <% end %>
? --
+ <% end %>
- </div> | 10 | 0.666667 | 5 | 5 |
01b261dc54580851181efdf7f08fadfd73d58fc5 | db/migrate/20170814214010_add_description_to_issues.rb | db/migrate/20170814214010_add_description_to_issues.rb |
class AddDescriptionToIssues < ActiveRecord::Migration[5.1]
def change
add_column :issues, :description_translations, :jsonb
Issue.update_all(description_translations: { "en": "Description", "es": "Descripción" })
end
end
|
class AddDescriptionToIssues < ActiveRecord::Migration[5.1]
def change
add_column :issues, :description_translations, :jsonb
end
end
| Remove old model from migration | Remove old model from migration
| Ruby | agpl-3.0 | PopulateTools/gobierto-dev,PopulateTools/gobierto,PopulateTools/gobierto-dev,PopulateTools/gobierto-dev,PopulateTools/gobierto,PopulateTools/gobierto-dev,PopulateTools/gobierto,PopulateTools/gobierto | ruby | ## Code Before:
class AddDescriptionToIssues < ActiveRecord::Migration[5.1]
def change
add_column :issues, :description_translations, :jsonb
Issue.update_all(description_translations: { "en": "Description", "es": "Descripción" })
end
end
## Instruction:
Remove old model from migration
## Code After:
class AddDescriptionToIssues < ActiveRecord::Migration[5.1]
def change
add_column :issues, :description_translations, :jsonb
end
end
|
class AddDescriptionToIssues < ActiveRecord::Migration[5.1]
def change
add_column :issues, :description_translations, :jsonb
- Issue.update_all(description_translations: { "en": "Description", "es": "Descripción" })
end
end | 1 | 0.142857 | 0 | 1 |
c9003940c583a19861c1dff20498aa4c6aae1efb | scikits/crab/tests/test_base.py | scikits/crab/tests/test_base.py |
# Authors: Marcel Caraciolo <marcel@muricoca.com>
# Bruno Melo <bruno@muricoca.com>
# License: BSD Style.
import unittest
import sys
sys.path.append('/Users/marcelcaraciolo/Desktop/Orygens/crab/crab/scikits/craba')
from base import BaseRecommender
#test classes
class MyRecommender(BaseRecommender):
def __init__(self,model):
BaseRecommender.__init__(self,model)
################################################################################
# The tests
class testBaseRecommender(unittest.TestCase):
pass
if __name__ == '__main__':
unittest.main()
|
# Authors: Marcel Caraciolo <marcel@muricoca.com>
# Bruno Melo <bruno@muricoca.com>
# License: BSD Style.
import unittest
from base import BaseRecommender
#test classes
class MyRecommender(BaseRecommender):
def __init__(self,model):
BaseRecommender.__init__(self,model)
################################################################################
# The tests
class testBaseRecommender(unittest.TestCase):
pass
if __name__ == '__main__':
unittest.main()
| Fix the test removing paths. | Fix the test removing paths.
| Python | bsd-3-clause | Lawrence-Liu/crab,muricoca/crab,hi2srihari/crab,echogreens/crab,muricoca/crab,augustoppimenta/crab,imouren/crab,rcarmo/crab,Flowerowl/Crab,wnyc/crab,wnyc/crab | python | ## Code Before:
# Authors: Marcel Caraciolo <marcel@muricoca.com>
# Bruno Melo <bruno@muricoca.com>
# License: BSD Style.
import unittest
import sys
sys.path.append('/Users/marcelcaraciolo/Desktop/Orygens/crab/crab/scikits/craba')
from base import BaseRecommender
#test classes
class MyRecommender(BaseRecommender):
def __init__(self,model):
BaseRecommender.__init__(self,model)
################################################################################
# The tests
class testBaseRecommender(unittest.TestCase):
pass
if __name__ == '__main__':
unittest.main()
## Instruction:
Fix the test removing paths.
## Code After:
# Authors: Marcel Caraciolo <marcel@muricoca.com>
# Bruno Melo <bruno@muricoca.com>
# License: BSD Style.
import unittest
from base import BaseRecommender
#test classes
class MyRecommender(BaseRecommender):
def __init__(self,model):
BaseRecommender.__init__(self,model)
################################################################################
# The tests
class testBaseRecommender(unittest.TestCase):
pass
if __name__ == '__main__':
unittest.main()
|
# Authors: Marcel Caraciolo <marcel@muricoca.com>
# Bruno Melo <bruno@muricoca.com>
# License: BSD Style.
import unittest
- import sys
-
- sys.path.append('/Users/marcelcaraciolo/Desktop/Orygens/crab/crab/scikits/craba')
from base import BaseRecommender
#test classes
class MyRecommender(BaseRecommender):
def __init__(self,model):
BaseRecommender.__init__(self,model)
################################################################################
# The tests
class testBaseRecommender(unittest.TestCase):
pass
if __name__ == '__main__':
unittest.main()
| 3 | 0.103448 | 0 | 3 |
01c9a6508cc552ec4f5d6c5bcab94d2ec6c85a13 | lib/negative-settings.js | lib/negative-settings.js | 'use strict';
const { app } = require('electron');
const fs = require('fs');
const path = require('path');
module.exports = {
init(callback) {
this.settingsFilePath = path.join(app.getPath('userData'), 'settings.json');
fs.readFile(this.settingsFilePath, (err, result) => {
if (err) {
this.settings = {};
} else {
try {
this.settings = JSON.parse(result);
} catch (e) {
process.stderr.write(e);
this.settings = {};
}
}
callback();
});
},
get(key) {
return this.settings[key];
},
set(key, value) {
this.settings[key] = value;
},
save(callback) {
fs.writeFile(this.settingsFilePath, JSON.stringify(this.settings), callback);
}
};
| 'use strict';
const { app } = require('electron');
const fs = require('fs');
const path = require('path');
const { NEGATIVE_SETTINGS_PATH } = process.env;
module.exports = {
init(callback) {
const testSettingsFilePath = NEGATIVE_SETTINGS_PATH && path.resolve(__dirname, NEGATIVE_SETTINGS_PATH);
this.settingsFilePath = path.join(app.getPath('userData'), 'settings.json');
fs.readFile(testSettingsFilePath || this.settingsFilePath, (err, result) => {
if (err) {
this.settings = {};
} else {
try {
this.settings = JSON.parse(result);
} catch (e) {
process.stderr.write(e);
this.settings = {};
}
}
callback();
});
},
get(key) {
return this.settings[key];
},
set(key, value) {
this.settings[key] = value;
},
save(callback) {
fs.writeFile(this.settingsFilePath, JSON.stringify(this.settings), callback);
}
};
| Allow modifying settings path through env var. | Allow modifying settings path through env var.
| JavaScript | mit | atdrago/negative,atdrago/negative,atdrago/negative | javascript | ## Code Before:
'use strict';
const { app } = require('electron');
const fs = require('fs');
const path = require('path');
module.exports = {
init(callback) {
this.settingsFilePath = path.join(app.getPath('userData'), 'settings.json');
fs.readFile(this.settingsFilePath, (err, result) => {
if (err) {
this.settings = {};
} else {
try {
this.settings = JSON.parse(result);
} catch (e) {
process.stderr.write(e);
this.settings = {};
}
}
callback();
});
},
get(key) {
return this.settings[key];
},
set(key, value) {
this.settings[key] = value;
},
save(callback) {
fs.writeFile(this.settingsFilePath, JSON.stringify(this.settings), callback);
}
};
## Instruction:
Allow modifying settings path through env var.
## Code After:
'use strict';
const { app } = require('electron');
const fs = require('fs');
const path = require('path');
const { NEGATIVE_SETTINGS_PATH } = process.env;
module.exports = {
init(callback) {
const testSettingsFilePath = NEGATIVE_SETTINGS_PATH && path.resolve(__dirname, NEGATIVE_SETTINGS_PATH);
this.settingsFilePath = path.join(app.getPath('userData'), 'settings.json');
fs.readFile(testSettingsFilePath || this.settingsFilePath, (err, result) => {
if (err) {
this.settings = {};
} else {
try {
this.settings = JSON.parse(result);
} catch (e) {
process.stderr.write(e);
this.settings = {};
}
}
callback();
});
},
get(key) {
return this.settings[key];
},
set(key, value) {
this.settings[key] = value;
},
save(callback) {
fs.writeFile(this.settingsFilePath, JSON.stringify(this.settings), callback);
}
};
| 'use strict';
const { app } = require('electron');
const fs = require('fs');
const path = require('path');
+ const { NEGATIVE_SETTINGS_PATH } = process.env;
+
module.exports = {
init(callback) {
+ const testSettingsFilePath = NEGATIVE_SETTINGS_PATH && path.resolve(__dirname, NEGATIVE_SETTINGS_PATH);
+
this.settingsFilePath = path.join(app.getPath('userData'), 'settings.json');
- fs.readFile(this.settingsFilePath, (err, result) => {
+ fs.readFile(testSettingsFilePath || this.settingsFilePath, (err, result) => {
? ++++++++++++++++++++++++
if (err) {
this.settings = {};
} else {
try {
this.settings = JSON.parse(result);
} catch (e) {
process.stderr.write(e);
this.settings = {};
}
}
callback();
});
},
get(key) {
return this.settings[key];
},
set(key, value) {
this.settings[key] = value;
},
save(callback) {
fs.writeFile(this.settingsFilePath, JSON.stringify(this.settings), callback);
}
}; | 6 | 0.157895 | 5 | 1 |
6a0ff187c6791cadedcef119b5170c7b0787408e | Cargo.toml | Cargo.toml | [package]
name = "seax"
version = "0.0.2"
authors = ["Hawk Weisman <hi@hawkweisman.me>"]
description = "SECD virtual machine for interpreting programs in FP languages and a Scheme compiler targeting that machine."
license = "MIT"
homepage = "http://hawkweisman.me/seax"
repository = "https://github.com/hawkw/seax"
readme = "README.md"
keywords = ["vm","lisp","languages"]
[dependencies]
docopt = "*"
regex = "*"
rustc-serialize = "*"
log = "0.3.1"
[dependencies.seax_svm]
path = "seax_svm"
version = "^0.2.2"
[dependencies.seax_scheme]
path = "seax_scheme"
version = "^0.2.0" | [package]
name = "seax"
version = "0.0.2"
authors = ["Hawk Weisman <hi@hawkweisman.me>"]
description = "SECD virtual machine for interpreting programs in FP languages and a Scheme compiler targeting that machine."
license = "MIT"
homepage = "http://hawkweisman.me/seax"
repository = "https://github.com/hawkw/seax"
readme = "README.md"
keywords = ["vm","lisp","languages"]
[dependencies]
docopt = "*"
regex = "*"
rustc-serialize = "*"
log = "0.3.1"
[dev-dependencies]
quickcheck = "*"
[dependencies.seax_svm]
path = "seax_svm"
version = "^0.2.2"
[dependencies.seax_scheme]
path = "seax_scheme"
version = "^0.2.0"
| Put QuickCheck in root crate's dev deps | Put QuickCheck in root crate's dev deps
| TOML | mit | hawkw/seax,hawkw/seax | toml | ## Code Before:
[package]
name = "seax"
version = "0.0.2"
authors = ["Hawk Weisman <hi@hawkweisman.me>"]
description = "SECD virtual machine for interpreting programs in FP languages and a Scheme compiler targeting that machine."
license = "MIT"
homepage = "http://hawkweisman.me/seax"
repository = "https://github.com/hawkw/seax"
readme = "README.md"
keywords = ["vm","lisp","languages"]
[dependencies]
docopt = "*"
regex = "*"
rustc-serialize = "*"
log = "0.3.1"
[dependencies.seax_svm]
path = "seax_svm"
version = "^0.2.2"
[dependencies.seax_scheme]
path = "seax_scheme"
version = "^0.2.0"
## Instruction:
Put QuickCheck in root crate's dev deps
## Code After:
[package]
name = "seax"
version = "0.0.2"
authors = ["Hawk Weisman <hi@hawkweisman.me>"]
description = "SECD virtual machine for interpreting programs in FP languages and a Scheme compiler targeting that machine."
license = "MIT"
homepage = "http://hawkweisman.me/seax"
repository = "https://github.com/hawkw/seax"
readme = "README.md"
keywords = ["vm","lisp","languages"]
[dependencies]
docopt = "*"
regex = "*"
rustc-serialize = "*"
log = "0.3.1"
[dev-dependencies]
quickcheck = "*"
[dependencies.seax_svm]
path = "seax_svm"
version = "^0.2.2"
[dependencies.seax_scheme]
path = "seax_scheme"
version = "^0.2.0"
| [package]
name = "seax"
version = "0.0.2"
authors = ["Hawk Weisman <hi@hawkweisman.me>"]
description = "SECD virtual machine for interpreting programs in FP languages and a Scheme compiler targeting that machine."
license = "MIT"
homepage = "http://hawkweisman.me/seax"
repository = "https://github.com/hawkw/seax"
readme = "README.md"
keywords = ["vm","lisp","languages"]
[dependencies]
docopt = "*"
regex = "*"
rustc-serialize = "*"
log = "0.3.1"
+ [dev-dependencies]
+ quickcheck = "*"
+
[dependencies.seax_svm]
path = "seax_svm"
version = "^0.2.2"
[dependencies.seax_scheme]
path = "seax_scheme"
version = "^0.2.0" | 3 | 0.12 | 3 | 0 |
68ee85bfbe68d3f159c640c55b3bf92a8fa6ec8a | metadater.rb | metadater.rb | require 'rubygems' # When running under 1.8. Who knows?
require 'mediainfo' # Capture technical metadata from video. Requires MediaInfo
require 'mini_exiftool' # Capture software metadata from video. Requires ExifTool
# require 'spreadsheet' Spreadsheet output not implemented yet
require 'xmlsimple' # Read data from Sony's XML Exif
require 'find' # Ruby's Find.find method
# Internal functions and classes
require File.dirname(__FILE__) + '/lib/mediainfo.rb'
require File.dirname(__FILE__) + '/lib/exif.rb'
require File.dirname(__FILE__) + '/lib/client.rb'
# These are the filetypes we consider to be videos
# All others are not videos and we care nothing for them
# Note that we will also scan files with no extensions.
@@filetypes = [ '.mov', '.avi', '.mp4', '.mts' ]
@@files = [] # Let's leave this empty for later
$metadata = [] # This too
case ARGV[0]
when nil
puts "usage: metadater <directory>"
puts "metadater will scan the specified directory and produce YAML output at the end"
puts "of the process."
when String
# Get base directory to scan
# This directory and all its subdirectories will be scanned
scandir = Path.new(ARGV[0])
end
scandir.scan
| require 'rubygems' # When running under 1.8. Who knows?
require 'mediainfo' # Capture technical metadata from video. Requires MediaInfo
require 'mini_exiftool' # Capture software metadata from video. Requires ExifTool
# require 'spreadsheet' Spreadsheet output not implemented yet
require 'xmlsimple' # Read data from Sony's XML Exif
require 'find' # Ruby's Find.find method
# Internal functions and classes
require File.dirname(__FILE__) + '/lib/mediainfo.rb'
require File.dirname(__FILE__) + '/lib/client.rb'
# These are the filetypes we consider to be videos
# All others are not videos and we care nothing for them
# Note that we will also scan files with no extensions.
@@filetypes = [ '.mov', '.avi', '.mp4', '.mts' ]
@@files = [] # Let's leave this empty for later
$metadata = [] # This too
case ARGV[0]
when nil
puts "usage: metadater <directory>"
puts "metadater will scan the specified directory and produce YAML output at the end"
puts "of the process."
when String
# Get base directory to scan
# This directory and all its subdirectories will be scanned
scandir = Path.new(ARGV[0])
end
scandir.scan
| Remove reference to deleted lib | Remove reference to deleted lib
| Ruby | bsd-2-clause | mistydemeo/metadater | ruby | ## Code Before:
require 'rubygems' # When running under 1.8. Who knows?
require 'mediainfo' # Capture technical metadata from video. Requires MediaInfo
require 'mini_exiftool' # Capture software metadata from video. Requires ExifTool
# require 'spreadsheet' Spreadsheet output not implemented yet
require 'xmlsimple' # Read data from Sony's XML Exif
require 'find' # Ruby's Find.find method
# Internal functions and classes
require File.dirname(__FILE__) + '/lib/mediainfo.rb'
require File.dirname(__FILE__) + '/lib/exif.rb'
require File.dirname(__FILE__) + '/lib/client.rb'
# These are the filetypes we consider to be videos
# All others are not videos and we care nothing for them
# Note that we will also scan files with no extensions.
@@filetypes = [ '.mov', '.avi', '.mp4', '.mts' ]
@@files = [] # Let's leave this empty for later
$metadata = [] # This too
case ARGV[0]
when nil
puts "usage: metadater <directory>"
puts "metadater will scan the specified directory and produce YAML output at the end"
puts "of the process."
when String
# Get base directory to scan
# This directory and all its subdirectories will be scanned
scandir = Path.new(ARGV[0])
end
scandir.scan
## Instruction:
Remove reference to deleted lib
## Code After:
require 'rubygems' # When running under 1.8. Who knows?
require 'mediainfo' # Capture technical metadata from video. Requires MediaInfo
require 'mini_exiftool' # Capture software metadata from video. Requires ExifTool
# require 'spreadsheet' Spreadsheet output not implemented yet
require 'xmlsimple' # Read data from Sony's XML Exif
require 'find' # Ruby's Find.find method
# Internal functions and classes
require File.dirname(__FILE__) + '/lib/mediainfo.rb'
require File.dirname(__FILE__) + '/lib/client.rb'
# These are the filetypes we consider to be videos
# All others are not videos and we care nothing for them
# Note that we will also scan files with no extensions.
@@filetypes = [ '.mov', '.avi', '.mp4', '.mts' ]
@@files = [] # Let's leave this empty for later
$metadata = [] # This too
case ARGV[0]
when nil
puts "usage: metadater <directory>"
puts "metadater will scan the specified directory and produce YAML output at the end"
puts "of the process."
when String
# Get base directory to scan
# This directory and all its subdirectories will be scanned
scandir = Path.new(ARGV[0])
end
scandir.scan
| require 'rubygems' # When running under 1.8. Who knows?
require 'mediainfo' # Capture technical metadata from video. Requires MediaInfo
require 'mini_exiftool' # Capture software metadata from video. Requires ExifTool
# require 'spreadsheet' Spreadsheet output not implemented yet
require 'xmlsimple' # Read data from Sony's XML Exif
require 'find' # Ruby's Find.find method
# Internal functions and classes
require File.dirname(__FILE__) + '/lib/mediainfo.rb'
- require File.dirname(__FILE__) + '/lib/exif.rb'
require File.dirname(__FILE__) + '/lib/client.rb'
# These are the filetypes we consider to be videos
# All others are not videos and we care nothing for them
# Note that we will also scan files with no extensions.
@@filetypes = [ '.mov', '.avi', '.mp4', '.mts' ]
@@files = [] # Let's leave this empty for later
$metadata = [] # This too
case ARGV[0]
when nil
puts "usage: metadater <directory>"
puts "metadater will scan the specified directory and produce YAML output at the end"
puts "of the process."
when String
# Get base directory to scan
# This directory and all its subdirectories will be scanned
scandir = Path.new(ARGV[0])
end
scandir.scan | 1 | 0.029412 | 0 | 1 |
bbe793af5bce16775dd0259eaa70a0d8aef7acb3 | .github/workflows/sourcehutmanifests/freebsd.yml | .github/workflows/sourcehutmanifests/freebsd.yml | image: freebsd/latest
packages:
- alsa-lib
- glfw
- libxcursor
- libxi
- libxinerama
- libxrandr
- mesa-libs
- go
- pkgconf
sources:
- https://github.com/hajimehoshi/ebiten#{{.Commit}}
tasks:
- build: |
cd ebiten
go build -tags=example ./...
| image: freebsd/latest
packages:
- alsa-lib
- glfw
- libxcursor
- libxi
- libxinerama
- libxrandr
- mesa-libs
- pkgconf
- go
sources:
- https://github.com/hajimehoshi/ebiten#{{.Commit}}
tasks:
- build: |
cd ebiten
go build -tags=example ./...
| Fix the library order for consistency | .github/workflows/sourcehutmanifests: Fix the library order for consistency
| YAML | apache-2.0 | hajimehoshi/ebiten,hajimehoshi/ebiten | yaml | ## Code Before:
image: freebsd/latest
packages:
- alsa-lib
- glfw
- libxcursor
- libxi
- libxinerama
- libxrandr
- mesa-libs
- go
- pkgconf
sources:
- https://github.com/hajimehoshi/ebiten#{{.Commit}}
tasks:
- build: |
cd ebiten
go build -tags=example ./...
## Instruction:
.github/workflows/sourcehutmanifests: Fix the library order for consistency
## Code After:
image: freebsd/latest
packages:
- alsa-lib
- glfw
- libxcursor
- libxi
- libxinerama
- libxrandr
- mesa-libs
- pkgconf
- go
sources:
- https://github.com/hajimehoshi/ebiten#{{.Commit}}
tasks:
- build: |
cd ebiten
go build -tags=example ./...
| image: freebsd/latest
packages:
- alsa-lib
- glfw
- libxcursor
- libxi
- libxinerama
- libxrandr
- mesa-libs
+ - pkgconf
- go
- - pkgconf
sources:
- https://github.com/hajimehoshi/ebiten#{{.Commit}}
tasks:
- build: |
cd ebiten
go build -tags=example ./... | 2 | 0.117647 | 1 | 1 |
ffaa2b98305c7a1368587cdb30724a7cabbe3237 | glitch/apikeys_sample.py | glitch/apikeys_sample.py |
db_connect_string = ""
cookie_monster = "llsfZyohQDa4kRdCCqnoV3gpD8jaHUY0kfkKI3pZlZ4="
# in Python you can generate like this:
# import base64
# import uuid
# print(base64.b64encode(uuid.uuid4().bytes + uuid.uuid4().bytes))
# Thanks to https://gist.github.com/didip/823887
# Alternative way to generate a similar-length nonce:
# import base64, os; print(base64.b64encode(os.urandom(33)))
# These settings are used only for the sending of emails. The server will
# start with them at the defaults, but all email sending will fail.
system_email = 'server@example.com'
admin_email = 'username@example.com'
# Will use default settings if SMTP_SERVER_PORT == 'localhost'
SMTP_SERVER_PORT = "smtp.gmail.com:587"
SMTP_USERNAME = "email@gmail.com"
SMTP_PASSWORD = "yourpassword"
|
db_connect_string = ""
cookie_monster = "uqHHRiRIUyCIcB0RJJcv+T/Qc3wJS0p/jsyE1x36qBIa"
# Generated like this:
# import base64, os; print(base64.b64encode(os.urandom(33)))
# These settings are used only for the sending of emails. The server will
# start with them at the defaults, but all email sending will fail.
system_email = 'server@example.com'
admin_email = 'username@example.com'
# Will use default settings if SMTP_SERVER_PORT == 'localhost'
SMTP_SERVER_PORT = "smtp.gmail.com:587"
SMTP_USERNAME = "email@gmail.com"
SMTP_PASSWORD = "yourpassword"
| Drop the UUID; just use urandom | Drop the UUID; just use urandom
| Python | artistic-2.0 | Rosuav/appension,Rosuav/appension,MikeiLL/appension,Rosuav/appension,Rosuav/appension,MikeiLL/appension,MikeiLL/appension,MikeiLL/appension | python | ## Code Before:
db_connect_string = ""
cookie_monster = "llsfZyohQDa4kRdCCqnoV3gpD8jaHUY0kfkKI3pZlZ4="
# in Python you can generate like this:
# import base64
# import uuid
# print(base64.b64encode(uuid.uuid4().bytes + uuid.uuid4().bytes))
# Thanks to https://gist.github.com/didip/823887
# Alternative way to generate a similar-length nonce:
# import base64, os; print(base64.b64encode(os.urandom(33)))
# These settings are used only for the sending of emails. The server will
# start with them at the defaults, but all email sending will fail.
system_email = 'server@example.com'
admin_email = 'username@example.com'
# Will use default settings if SMTP_SERVER_PORT == 'localhost'
SMTP_SERVER_PORT = "smtp.gmail.com:587"
SMTP_USERNAME = "email@gmail.com"
SMTP_PASSWORD = "yourpassword"
## Instruction:
Drop the UUID; just use urandom
## Code After:
db_connect_string = ""
cookie_monster = "uqHHRiRIUyCIcB0RJJcv+T/Qc3wJS0p/jsyE1x36qBIa"
# Generated like this:
# import base64, os; print(base64.b64encode(os.urandom(33)))
# These settings are used only for the sending of emails. The server will
# start with them at the defaults, but all email sending will fail.
system_email = 'server@example.com'
admin_email = 'username@example.com'
# Will use default settings if SMTP_SERVER_PORT == 'localhost'
SMTP_SERVER_PORT = "smtp.gmail.com:587"
SMTP_USERNAME = "email@gmail.com"
SMTP_PASSWORD = "yourpassword"
|
db_connect_string = ""
+ cookie_monster = "uqHHRiRIUyCIcB0RJJcv+T/Qc3wJS0p/jsyE1x36qBIa"
+ # Generated like this:
- cookie_monster = "llsfZyohQDa4kRdCCqnoV3gpD8jaHUY0kfkKI3pZlZ4="
- # in Python you can generate like this:
- # import base64
- # import uuid
- # print(base64.b64encode(uuid.uuid4().bytes + uuid.uuid4().bytes))
- # Thanks to https://gist.github.com/didip/823887
- # Alternative way to generate a similar-length nonce:
# import base64, os; print(base64.b64encode(os.urandom(33)))
# These settings are used only for the sending of emails. The server will
# start with them at the defaults, but all email sending will fail.
system_email = 'server@example.com'
admin_email = 'username@example.com'
# Will use default settings if SMTP_SERVER_PORT == 'localhost'
SMTP_SERVER_PORT = "smtp.gmail.com:587"
SMTP_USERNAME = "email@gmail.com"
SMTP_PASSWORD = "yourpassword" | 9 | 0.473684 | 2 | 7 |
ad707af19fbf5084a8e34957698e28d0e4892f64 | .travis.yml | .travis.yml | language: php
sudo: false
php:
- "5.5"
- "5.6"
- "7"
- "hhvm"
matrix:
include:
- php: "5.5"
env: CHECKSTYLE="YES" COVERAGE="YES"
allow_failures:
- php: "7"
- php: "hhvm"
install: composer install
script: phpunit
| language: php
sudo: false
php:
- "5.5"
- "5.6"
- "7"
- "hhvm"
matrix:
allow_failures:
- php: "7"
- php: "hhvm"
install: composer install
script: phpunit
| Remove ENV from build configuration | [TASK] Remove ENV from build configuration
| YAML | mit | NamelessCoder/numerolog | yaml | ## Code Before:
language: php
sudo: false
php:
- "5.5"
- "5.6"
- "7"
- "hhvm"
matrix:
include:
- php: "5.5"
env: CHECKSTYLE="YES" COVERAGE="YES"
allow_failures:
- php: "7"
- php: "hhvm"
install: composer install
script: phpunit
## Instruction:
[TASK] Remove ENV from build configuration
## Code After:
language: php
sudo: false
php:
- "5.5"
- "5.6"
- "7"
- "hhvm"
matrix:
allow_failures:
- php: "7"
- php: "hhvm"
install: composer install
script: phpunit
| language: php
sudo: false
php:
- "5.5"
- "5.6"
- "7"
- "hhvm"
matrix:
- include:
- - php: "5.5"
- env: CHECKSTYLE="YES" COVERAGE="YES"
allow_failures:
- php: "7"
- php: "hhvm"
install: composer install
script: phpunit | 3 | 0.142857 | 0 | 3 |
e6c2271bc9b4de99c56b6023033ba54d3ec0ded8 | src/Essence/Essence.php | src/Essence/Essence.php | <?php namespace Essence;
use Closure;
class Essence
{
/**
* @var array
*/
protected $configuration = [
"exception" => "Essence\Exceptions\AssertionException",
];
/**
* @var array
*/
protected $defaultConfiguration;
/**
* @return Essence
*/
public function __construct()
{
$this->defaultConfiguration = $this->configuration;
}
/**
* Throws an exception (specified in the configuration) with the given error message.
*
* @param string|null $message
* @throws Exceptions\AssertionException|object
* @return void
*/
public function throwOnFailure($message = null)
{
$class = $this->configuration["exception"];
throw new $class($message);
}
/**
* Returns the configuration array.
*
* @return array
*/
public function getConfiguration()
{
return $this->configuration;
}
/**
* Allows you to configure Essence via a Closure.
*
* @param Closure $callback
* @return void
*/
public function configure(Closure $callback)
{
if ( ! is_array($configuration = $callback($this->configuration))) {
throw new Exceptions\InvalidConfigurationException($configuration);
}
$this->configuration = array_merge($this->defaultConfiguration, $configuration);
}
}
| <?php namespace Essence;
use Closure;
class Essence
{
/**
* @var array
*/
protected $configuration = [
"exception" => "Essence\Exceptions\AssertionException",
];
/**
* @var array
*/
protected $defaultConfiguration;
/**
* @var AssertionBuilder
*/
protected $builder;
/**
* @param mixed $value
* @return Essence
*/
public function __construct($value = null)
{
$this->defaultConfiguration = $this->configuration;
$this->builder = new AssertionBuilder($value);
}
/**
* Throws an exception (specified in the configuration) with the given error message.
*
* @param string|null $message
* @throws Exceptions\AssertionException|object
* @return void
*/
public function throwOnFailure($message = null)
{
$class = $this->configuration["exception"];
throw new $class($message);
}
/**
* Returns the configuration array.
*
* @return array
*/
public function getConfiguration()
{
return $this->configuration;
}
/**
* Allows you to configure Essence via a Closure.
*
* @param Closure $callback
* @return void
*/
public function configure(Closure $callback)
{
if ( ! is_array($configuration = $callback($this->configuration))) {
throw new Exceptions\InvalidConfigurationException($configuration);
}
$this->configuration = array_merge($this->defaultConfiguration, $configuration);
}
/**
* This trick allows us to implicitly perform the validation.
*
* @return void
*/
public function __destruct()
{
if ( ! $this->builder->validate()) {
$this->throwOnFailure($this->builder->getMessage());
}
}
}
| Use __destruct to validate implicitly. | Use __destruct to validate implicitly.
| PHP | mit | bound1ess/essence | php | ## Code Before:
<?php namespace Essence;
use Closure;
class Essence
{
/**
* @var array
*/
protected $configuration = [
"exception" => "Essence\Exceptions\AssertionException",
];
/**
* @var array
*/
protected $defaultConfiguration;
/**
* @return Essence
*/
public function __construct()
{
$this->defaultConfiguration = $this->configuration;
}
/**
* Throws an exception (specified in the configuration) with the given error message.
*
* @param string|null $message
* @throws Exceptions\AssertionException|object
* @return void
*/
public function throwOnFailure($message = null)
{
$class = $this->configuration["exception"];
throw new $class($message);
}
/**
* Returns the configuration array.
*
* @return array
*/
public function getConfiguration()
{
return $this->configuration;
}
/**
* Allows you to configure Essence via a Closure.
*
* @param Closure $callback
* @return void
*/
public function configure(Closure $callback)
{
if ( ! is_array($configuration = $callback($this->configuration))) {
throw new Exceptions\InvalidConfigurationException($configuration);
}
$this->configuration = array_merge($this->defaultConfiguration, $configuration);
}
}
## Instruction:
Use __destruct to validate implicitly.
## Code After:
<?php namespace Essence;
use Closure;
class Essence
{
/**
* @var array
*/
protected $configuration = [
"exception" => "Essence\Exceptions\AssertionException",
];
/**
* @var array
*/
protected $defaultConfiguration;
/**
* @var AssertionBuilder
*/
protected $builder;
/**
* @param mixed $value
* @return Essence
*/
public function __construct($value = null)
{
$this->defaultConfiguration = $this->configuration;
$this->builder = new AssertionBuilder($value);
}
/**
* Throws an exception (specified in the configuration) with the given error message.
*
* @param string|null $message
* @throws Exceptions\AssertionException|object
* @return void
*/
public function throwOnFailure($message = null)
{
$class = $this->configuration["exception"];
throw new $class($message);
}
/**
* Returns the configuration array.
*
* @return array
*/
public function getConfiguration()
{
return $this->configuration;
}
/**
* Allows you to configure Essence via a Closure.
*
* @param Closure $callback
* @return void
*/
public function configure(Closure $callback)
{
if ( ! is_array($configuration = $callback($this->configuration))) {
throw new Exceptions\InvalidConfigurationException($configuration);
}
$this->configuration = array_merge($this->defaultConfiguration, $configuration);
}
/**
* This trick allows us to implicitly perform the validation.
*
* @return void
*/
public function __destruct()
{
if ( ! $this->builder->validate()) {
$this->throwOnFailure($this->builder->getMessage());
}
}
}
| <?php namespace Essence;
use Closure;
class Essence
{
/**
* @var array
*/
protected $configuration = [
"exception" => "Essence\Exceptions\AssertionException",
];
/**
* @var array
*/
protected $defaultConfiguration;
/**
+ * @var AssertionBuilder
+ */
+ protected $builder;
+
+ /**
+ * @param mixed $value
* @return Essence
*/
- public function __construct()
+ public function __construct($value = null)
? +++++++++++++
{
$this->defaultConfiguration = $this->configuration;
+ $this->builder = new AssertionBuilder($value);
}
/**
* Throws an exception (specified in the configuration) with the given error message.
*
* @param string|null $message
* @throws Exceptions\AssertionException|object
* @return void
*/
public function throwOnFailure($message = null)
{
$class = $this->configuration["exception"];
throw new $class($message);
}
/**
* Returns the configuration array.
*
* @return array
*/
public function getConfiguration()
{
return $this->configuration;
}
/**
* Allows you to configure Essence via a Closure.
*
* @param Closure $callback
* @return void
*/
public function configure(Closure $callback)
{
if ( ! is_array($configuration = $callback($this->configuration))) {
throw new Exceptions\InvalidConfigurationException($configuration);
}
$this->configuration = array_merge($this->defaultConfiguration, $configuration);
}
+
+ /**
+ * This trick allows us to implicitly perform the validation.
+ *
+ * @return void
+ */
+ public function __destruct()
+ {
+ if ( ! $this->builder->validate()) {
+ $this->throwOnFailure($this->builder->getMessage());
+ }
+ }
} | 21 | 0.318182 | 20 | 1 |
1cf354d834fbb81260c88718c57533a546fc9dfa | src/robots/actions/attitudes.py | src/robots/actions/attitudes.py | import logging; logger = logging.getLogger("robot." + __name__)
from robots.exception import RobotError
from robots.actions.look_at import sweep
from robots.action import *
###############################################################################
@action
def sorry(robot, speed = 0.5):
return sweep(robot, 45, speed)
| import logging; logger = logging.getLogger("robot." + __name__)
import random
from robots.exception import RobotError
from robots.lowlevel import *
from robots.actions.look_at import sweep
from robots.action import *
###############################################################################
@action
@workswith(ALL)
def satisfied(robot):
actions = kb_satisfied()
return actions
@action
@same_requirements_as(sweep)
def sorry(robot, speed = 0.5):
actions = kb_sorry()
actions += sweep(robot, 45, speed)
return actions
def _generate_id():
sequence = "abcdefghijklmopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
sample = random.sample(sequence, 5)
return "".join(sample)
def _send_state(state):
state_id = _generate_id()
statements = [state_id + " rdf:type " + state,
"myself experiences " + state_id]
logger.info("Setting my mood to " + state)
return add_knowledge(statements, lifespan=10)
def kb_confused():
return _send_state("ConfusedState")
def kb_satisfied():
return _send_state("SatisfiedState")
def kb_sorry():
return _send_state("SorryState")
def kb_happy():
return _send_state("HappyState")
def kb_angry():
return _send_state("AngryState")
def kb_sad():
return _send_state("SadState")
| Update the knowledge base according to the emotion | [actions/attitude] Update the knowledge base according to the emotion
| Python | isc | chili-epfl/pyrobots,chili-epfl/pyrobots-nao | python | ## Code Before:
import logging; logger = logging.getLogger("robot." + __name__)
from robots.exception import RobotError
from robots.actions.look_at import sweep
from robots.action import *
###############################################################################
@action
def sorry(robot, speed = 0.5):
return sweep(robot, 45, speed)
## Instruction:
[actions/attitude] Update the knowledge base according to the emotion
## Code After:
import logging; logger = logging.getLogger("robot." + __name__)
import random
from robots.exception import RobotError
from robots.lowlevel import *
from robots.actions.look_at import sweep
from robots.action import *
###############################################################################
@action
@workswith(ALL)
def satisfied(robot):
actions = kb_satisfied()
return actions
@action
@same_requirements_as(sweep)
def sorry(robot, speed = 0.5):
actions = kb_sorry()
actions += sweep(robot, 45, speed)
return actions
def _generate_id():
sequence = "abcdefghijklmopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
sample = random.sample(sequence, 5)
return "".join(sample)
def _send_state(state):
state_id = _generate_id()
statements = [state_id + " rdf:type " + state,
"myself experiences " + state_id]
logger.info("Setting my mood to " + state)
return add_knowledge(statements, lifespan=10)
def kb_confused():
return _send_state("ConfusedState")
def kb_satisfied():
return _send_state("SatisfiedState")
def kb_sorry():
return _send_state("SorryState")
def kb_happy():
return _send_state("HappyState")
def kb_angry():
return _send_state("AngryState")
def kb_sad():
return _send_state("SadState")
| import logging; logger = logging.getLogger("robot." + __name__)
+
+ import random
from robots.exception import RobotError
+ from robots.lowlevel import *
from robots.actions.look_at import sweep
from robots.action import *
###############################################################################
@action
+ @workswith(ALL)
+ def satisfied(robot):
+ actions = kb_satisfied()
+ return actions
+
+
+ @action
+ @same_requirements_as(sweep)
def sorry(robot, speed = 0.5):
+ actions = kb_sorry()
- return sweep(robot, 45, speed)
? ^^ ^^
+ actions += sweep(robot, 45, speed)
? ^^ ^^ ++++
-
+ return actions
+
+ def _generate_id():
+ sequence = "abcdefghijklmopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ sample = random.sample(sequence, 5)
+ return "".join(sample)
+
+
+ def _send_state(state):
+
+
+ state_id = _generate_id()
+ statements = [state_id + " rdf:type " + state,
+ "myself experiences " + state_id]
+
+ logger.info("Setting my mood to " + state)
+ return add_knowledge(statements, lifespan=10)
+
+
+ def kb_confused():
+ return _send_state("ConfusedState")
+
+ def kb_satisfied():
+ return _send_state("SatisfiedState")
+
+ def kb_sorry():
+ return _send_state("SorryState")
+
+ def kb_happy():
+ return _send_state("HappyState")
+
+ def kb_angry():
+ return _send_state("AngryState")
+
+ def kb_sad():
+ return _send_state("SadState")
+
+ | 53 | 3.785714 | 51 | 2 |
6aaddc1833ae2ff9731638f3a6658a6538d9a652 | ESNotification/NotificationObjC.swift | ESNotification/NotificationObjC.swift | //
// NotificationObjC.swift
// ESNotification
//
// Created by Tomohiro Kumagai on H27/10/15.
// Copyright © 平成27年 EasyStyle G.K. All rights reserved.
//
import Foundation
extension NSNotificationCenter {
public func addObserver(observer: AnyObject, selector aSelector: Selector, ESNotification notification: NotificationProtocol.Type, object: AnyObject?) {
self.addObserver(observer, selector: aSelector, name: notification.notificationIdentifier, object: object)
}
public func postESNotification(notification:Postable) {
notification.post()
}
}
| //
// NotificationObjC.swift
// ESNotification
//
// Created by Tomohiro Kumagai on H27/10/15.
// Copyright © 平成27年 EasyStyle G.K. All rights reserved.
//
import Foundation
extension NSNotificationCenter {
public static func ESNotificationNameOf(notification: NotificationProtocol.Type) -> String {
return notification.notificationIdentifier
}
public func addObserver(observer: AnyObject, selector aSelector: Selector, ESNotification notification: NotificationProtocol.Type, object: AnyObject?) {
let name = NSNotificationCenter.ESNotificationNameOf(notification)
self.addObserver(observer, selector: aSelector, name: name, object: object)
}
public func removeObserver(observer: AnyObject, ESNotification notification: NotificationProtocol.Type, object: AnyObject?) {
let name = NSNotificationCenter.ESNotificationNameOf(notification)
self.removeObserver(observer, name: name, object: object)
}
public func postESNotification(notification:Postable) {
notification.post()
}
}
| Add `removeObserver` method and `ESNotificationNameOf` method to `NSNotificationCenter`. | Add `removeObserver` method and `ESNotificationNameOf` method to `NSNotificationCenter`.
| Swift | mit | EZ-NET/ESNotification,EZ-NET/ESNotification | swift | ## Code Before:
//
// NotificationObjC.swift
// ESNotification
//
// Created by Tomohiro Kumagai on H27/10/15.
// Copyright © 平成27年 EasyStyle G.K. All rights reserved.
//
import Foundation
extension NSNotificationCenter {
public func addObserver(observer: AnyObject, selector aSelector: Selector, ESNotification notification: NotificationProtocol.Type, object: AnyObject?) {
self.addObserver(observer, selector: aSelector, name: notification.notificationIdentifier, object: object)
}
public func postESNotification(notification:Postable) {
notification.post()
}
}
## Instruction:
Add `removeObserver` method and `ESNotificationNameOf` method to `NSNotificationCenter`.
## Code After:
//
// NotificationObjC.swift
// ESNotification
//
// Created by Tomohiro Kumagai on H27/10/15.
// Copyright © 平成27年 EasyStyle G.K. All rights reserved.
//
import Foundation
extension NSNotificationCenter {
public static func ESNotificationNameOf(notification: NotificationProtocol.Type) -> String {
return notification.notificationIdentifier
}
public func addObserver(observer: AnyObject, selector aSelector: Selector, ESNotification notification: NotificationProtocol.Type, object: AnyObject?) {
let name = NSNotificationCenter.ESNotificationNameOf(notification)
self.addObserver(observer, selector: aSelector, name: name, object: object)
}
public func removeObserver(observer: AnyObject, ESNotification notification: NotificationProtocol.Type, object: AnyObject?) {
let name = NSNotificationCenter.ESNotificationNameOf(notification)
self.removeObserver(observer, name: name, object: object)
}
public func postESNotification(notification:Postable) {
notification.post()
}
}
| //
// NotificationObjC.swift
// ESNotification
//
// Created by Tomohiro Kumagai on H27/10/15.
// Copyright © 平成27年 EasyStyle G.K. All rights reserved.
//
import Foundation
extension NSNotificationCenter {
+ public static func ESNotificationNameOf(notification: NotificationProtocol.Type) -> String {
+
+ return notification.notificationIdentifier
+ }
+
public func addObserver(observer: AnyObject, selector aSelector: Selector, ESNotification notification: NotificationProtocol.Type, object: AnyObject?) {
+ let name = NSNotificationCenter.ESNotificationNameOf(notification)
+
- self.addObserver(observer, selector: aSelector, name: notification.notificationIdentifier, object: object)
? ------ ^^^^^^^^^^^^^^^^^^^ -------
+ self.addObserver(observer, selector: aSelector, name: name, object: object)
? ^
+ }
+
+ public func removeObserver(observer: AnyObject, ESNotification notification: NotificationProtocol.Type, object: AnyObject?) {
+
+ let name = NSNotificationCenter.ESNotificationNameOf(notification)
+
+ self.removeObserver(observer, name: name, object: object)
}
public func postESNotification(notification:Postable) {
notification.post()
}
} | 16 | 0.727273 | 15 | 1 |
556c00626630cf089f5bffc1d51473b11c8d8cb9 | _licenses/wtfpl.txt | _licenses/wtfpl.txt | ---
title: "Do What The F*ck You Want To Public License"
spdx-id: WTFPL
source: http://www.wtfpl.net/
description: The easiest license out there. It gives the user permissions to do whatever they want with your code.
how: Create a text file (typically named LICENSE or LICENSE.txt) in the root of your source code and copy the text of the license into the file.
permissions:
- commercial-use
- modifications
- distribution
- private-use
conditions: []
limitations: []
---
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) [year] [fullname] <[email]>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
| ---
title: "Do What The F*ck You Want To Public License"
spdx-id: WTFPL
source: http://www.wtfpl.net/
description: The easiest license out there. It gives the user permissions to do whatever they want with your code.
how: Create a text file (typically named LICENSE or LICENSE.txt) in the root of your source code and copy the text of the license into the file.
permissions:
- commercial-use
- modifications
- distribution
- private-use
conditions: []
limitations: []
---
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
| Fix copyright line, which pertains to the license itself | Fix copyright line, which pertains to the license itself
See http://www.wtfpl.net/faq/ | Text | mit | github/choosealicense.com,github/choosealicense.com,eogas/choosealicense.com,eogas/choosealicense.com,github/choosealicense.com,eogas/choosealicense.com | text | ## Code Before:
---
title: "Do What The F*ck You Want To Public License"
spdx-id: WTFPL
source: http://www.wtfpl.net/
description: The easiest license out there. It gives the user permissions to do whatever they want with your code.
how: Create a text file (typically named LICENSE or LICENSE.txt) in the root of your source code and copy the text of the license into the file.
permissions:
- commercial-use
- modifications
- distribution
- private-use
conditions: []
limitations: []
---
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) [year] [fullname] <[email]>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
## Instruction:
Fix copyright line, which pertains to the license itself
See http://www.wtfpl.net/faq/
## Code After:
---
title: "Do What The F*ck You Want To Public License"
spdx-id: WTFPL
source: http://www.wtfpl.net/
description: The easiest license out there. It gives the user permissions to do whatever they want with your code.
how: Create a text file (typically named LICENSE or LICENSE.txt) in the root of your source code and copy the text of the license into the file.
permissions:
- commercial-use
- modifications
- distribution
- private-use
conditions: []
limitations: []
---
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
| ---
title: "Do What The F*ck You Want To Public License"
spdx-id: WTFPL
source: http://www.wtfpl.net/
description: The easiest license out there. It gives the user permissions to do whatever they want with your code.
how: Create a text file (typically named LICENSE or LICENSE.txt) in the root of your source code and copy the text of the license into the file.
permissions:
- commercial-use
- modifications
- distribution
- private-use
conditions: []
limitations: []
---
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
- Copyright (C) [year] [fullname] <[email]>
+ Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO. | 2 | 0.058824 | 1 | 1 |
aba23cf821489971d9ec13c8fc4cc1dfbaba686d | setup.py | setup.py | from os.path import abspath, dirname, join, normpath
from setuptools import setup
setup(
# Basic package information:
name='django-heroku-memcacheify',
version='1.0.0',
py_modules=('memcacheify',),
# Packaging options:
zip_safe=False,
include_package_data=True,
# Package dependencies:
install_requires=['django-pylibmc>=0.6.1'],
# Metadata for PyPI:
author='Randall Degges',
author_email='r@rdegges.com',
license='UNLICENSE',
url='https://github.com/rdegges/django-heroku-memcacheify',
keywords='django heroku cloud cache memcache memcached awesome epic',
classifiers=[
'Framework :: Django',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
],
description='Automatic Django memcached configuration on Heroku.',
long_description=open(normpath(join(dirname(abspath(__file__)),
'README.md'))).read()
)
| from os.path import abspath, dirname, join, normpath
from setuptools import setup
setup(
# Basic package information:
name='django-heroku-memcacheify',
version='1.0.0',
py_modules=('memcacheify',),
# Packaging options:
zip_safe=False,
include_package_data=True,
# Package dependencies:
install_requires=['django-pylibmc>=0.6.1'],
# Metadata for PyPI:
author='Randall Degges',
author_email='r@rdegges.com',
license='UNLICENSE',
url='https://github.com/rdegges/django-heroku-memcacheify',
keywords='django heroku cloud cache memcache memcached awesome epic',
classifiers=[
'Framework :: Django',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
],
description='Automatic Django memcached configuration on Heroku.',
long_description=open(normpath(join(dirname(abspath(__file__)),
'README.md'))).read(),
long_description_content_type='text/markdown'
)
| Fix PyPI README.MD showing problem. | Fix PyPI README.MD showing problem.
There is a problem in the project's pypi page. To fix this I added the following line in the setup.py file:
```python
long_description_content_type='text/markdown'
``` | Python | unlicense | rdegges/django-heroku-memcacheify | python | ## Code Before:
from os.path import abspath, dirname, join, normpath
from setuptools import setup
setup(
# Basic package information:
name='django-heroku-memcacheify',
version='1.0.0',
py_modules=('memcacheify',),
# Packaging options:
zip_safe=False,
include_package_data=True,
# Package dependencies:
install_requires=['django-pylibmc>=0.6.1'],
# Metadata for PyPI:
author='Randall Degges',
author_email='r@rdegges.com',
license='UNLICENSE',
url='https://github.com/rdegges/django-heroku-memcacheify',
keywords='django heroku cloud cache memcache memcached awesome epic',
classifiers=[
'Framework :: Django',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
],
description='Automatic Django memcached configuration on Heroku.',
long_description=open(normpath(join(dirname(abspath(__file__)),
'README.md'))).read()
)
## Instruction:
Fix PyPI README.MD showing problem.
There is a problem in the project's pypi page. To fix this I added the following line in the setup.py file:
```python
long_description_content_type='text/markdown'
```
## Code After:
from os.path import abspath, dirname, join, normpath
from setuptools import setup
setup(
# Basic package information:
name='django-heroku-memcacheify',
version='1.0.0',
py_modules=('memcacheify',),
# Packaging options:
zip_safe=False,
include_package_data=True,
# Package dependencies:
install_requires=['django-pylibmc>=0.6.1'],
# Metadata for PyPI:
author='Randall Degges',
author_email='r@rdegges.com',
license='UNLICENSE',
url='https://github.com/rdegges/django-heroku-memcacheify',
keywords='django heroku cloud cache memcache memcached awesome epic',
classifiers=[
'Framework :: Django',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
],
description='Automatic Django memcached configuration on Heroku.',
long_description=open(normpath(join(dirname(abspath(__file__)),
'README.md'))).read(),
long_description_content_type='text/markdown'
)
| from os.path import abspath, dirname, join, normpath
from setuptools import setup
setup(
# Basic package information:
name='django-heroku-memcacheify',
version='1.0.0',
py_modules=('memcacheify',),
# Packaging options:
zip_safe=False,
include_package_data=True,
# Package dependencies:
install_requires=['django-pylibmc>=0.6.1'],
# Metadata for PyPI:
author='Randall Degges',
author_email='r@rdegges.com',
license='UNLICENSE',
url='https://github.com/rdegges/django-heroku-memcacheify',
keywords='django heroku cloud cache memcache memcached awesome epic',
classifiers=[
'Framework :: Django',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
],
description='Automatic Django memcached configuration on Heroku.',
long_description=open(normpath(join(dirname(abspath(__file__)),
- 'README.md'))).read()
+ 'README.md'))).read(),
? +
+ long_description_content_type='text/markdown'
) | 3 | 0.081081 | 2 | 1 |
df06110a88709a5d821791bd49f28803fcadeebb | gulpfile.js | gulpfile.js | /* jshint bitwise: true,
curly: true,
eqeqeq: true,
esversion: 6,
forin: true,
freeze: true,
latedef: nofunc,
noarg: true,
nocomma: true,
node: true,
nonbsp: true,
nonew: true,
plusplus: true,
singleGroups: true,
strict: true,
undef: true,
unused: true
*/
'use strict';
const gulp = require('gulp');
const BUILD_OUTPUT_DIR = 'build';
const NODE_MODULES_BIN_DIR = 'node_modules/.bin';
function exec(command, callback) {
require('child_process').exec(command, (err) => {
if (err) {
return callback(err);
}
callback();
});
}
function execJsDoc(configPath, callback) {
exec(`${NODE_MODULES_BIN_DIR}/jsdoc -c ${configPath}`, callback);
}
gulp.task('clean', () => {
const del = require('del');
return del([BUILD_OUTPUT_DIR]);
});
gulp.task('docs:client', (callback) => {
execJsDoc('.jsdoc-client-conf.json', callback);
});
gulp.task('docs:server', (callback) => {
execJsDoc('.jsdoc-server-conf.json', callback);
});
gulp.task('docs', ['docs:client', 'docs:server']);
| /* jshint bitwise: true,
curly: true,
eqeqeq: true,
esversion: 6,
forin: true,
freeze: true,
latedef: nofunc,
noarg: true,
nocomma: true,
node: true,
nonbsp: true,
nonew: true,
plusplus: true,
singleGroups: true,
strict: true,
undef: true,
unused: true
*/
'use strict';
const gulp = require('gulp');
const BUILD_OUTPUT_DIR = 'build';
const NODE_MODULES_BIN_DIR = 'node_modules/.bin';
function exec(command, callback) {
require('child_process').exec(command, (err) => {
if (err) {
return callback(err);
}
callback();
});
}
function execJsDoc(configPath, callback) {
exec(`${NODE_MODULES_BIN_DIR}/jsdoc -c ${configPath}`, callback);
}
gulp.task('clean', () => {
const del = require('del');
return del([BUILD_OUTPUT_DIR]);
});
gulp.task('docs:client', (done) => {
execJsDoc('.jsdoc-client-conf.json', done);
});
gulp.task('docs:server', (done) => {
execJsDoc('.jsdoc-server-conf.json', done);
});
gulp.task('docs', ['docs:client', 'docs:server']);
| Rename task callbacks to match Gulp standards | Rename task callbacks to match Gulp standards
| JavaScript | mit | ssoloff/dice-server-js,ssoloff/dice-server-js,ssoloff/dice-server-js,ssoloff/dice-server-js | javascript | ## Code Before:
/* jshint bitwise: true,
curly: true,
eqeqeq: true,
esversion: 6,
forin: true,
freeze: true,
latedef: nofunc,
noarg: true,
nocomma: true,
node: true,
nonbsp: true,
nonew: true,
plusplus: true,
singleGroups: true,
strict: true,
undef: true,
unused: true
*/
'use strict';
const gulp = require('gulp');
const BUILD_OUTPUT_DIR = 'build';
const NODE_MODULES_BIN_DIR = 'node_modules/.bin';
function exec(command, callback) {
require('child_process').exec(command, (err) => {
if (err) {
return callback(err);
}
callback();
});
}
function execJsDoc(configPath, callback) {
exec(`${NODE_MODULES_BIN_DIR}/jsdoc -c ${configPath}`, callback);
}
gulp.task('clean', () => {
const del = require('del');
return del([BUILD_OUTPUT_DIR]);
});
gulp.task('docs:client', (callback) => {
execJsDoc('.jsdoc-client-conf.json', callback);
});
gulp.task('docs:server', (callback) => {
execJsDoc('.jsdoc-server-conf.json', callback);
});
gulp.task('docs', ['docs:client', 'docs:server']);
## Instruction:
Rename task callbacks to match Gulp standards
## Code After:
/* jshint bitwise: true,
curly: true,
eqeqeq: true,
esversion: 6,
forin: true,
freeze: true,
latedef: nofunc,
noarg: true,
nocomma: true,
node: true,
nonbsp: true,
nonew: true,
plusplus: true,
singleGroups: true,
strict: true,
undef: true,
unused: true
*/
'use strict';
const gulp = require('gulp');
const BUILD_OUTPUT_DIR = 'build';
const NODE_MODULES_BIN_DIR = 'node_modules/.bin';
function exec(command, callback) {
require('child_process').exec(command, (err) => {
if (err) {
return callback(err);
}
callback();
});
}
function execJsDoc(configPath, callback) {
exec(`${NODE_MODULES_BIN_DIR}/jsdoc -c ${configPath}`, callback);
}
gulp.task('clean', () => {
const del = require('del');
return del([BUILD_OUTPUT_DIR]);
});
gulp.task('docs:client', (done) => {
execJsDoc('.jsdoc-client-conf.json', done);
});
gulp.task('docs:server', (done) => {
execJsDoc('.jsdoc-server-conf.json', done);
});
gulp.task('docs', ['docs:client', 'docs:server']);
| /* jshint bitwise: true,
curly: true,
eqeqeq: true,
esversion: 6,
forin: true,
freeze: true,
latedef: nofunc,
noarg: true,
nocomma: true,
node: true,
nonbsp: true,
nonew: true,
plusplus: true,
singleGroups: true,
strict: true,
undef: true,
unused: true
*/
'use strict';
const gulp = require('gulp');
const BUILD_OUTPUT_DIR = 'build';
const NODE_MODULES_BIN_DIR = 'node_modules/.bin';
function exec(command, callback) {
require('child_process').exec(command, (err) => {
if (err) {
return callback(err);
}
callback();
});
}
function execJsDoc(configPath, callback) {
exec(`${NODE_MODULES_BIN_DIR}/jsdoc -c ${configPath}`, callback);
}
gulp.task('clean', () => {
const del = require('del');
return del([BUILD_OUTPUT_DIR]);
});
- gulp.task('docs:client', (callback) => {
? ^^^^^^^^
+ gulp.task('docs:client', (done) => {
? ^^^^
- execJsDoc('.jsdoc-client-conf.json', callback);
? ^^^^^^^^
+ execJsDoc('.jsdoc-client-conf.json', done);
? ^^^^
});
- gulp.task('docs:server', (callback) => {
? ^^^^^^^^
+ gulp.task('docs:server', (done) => {
? ^^^^
- execJsDoc('.jsdoc-server-conf.json', callback);
? ^^^^^^^^
+ execJsDoc('.jsdoc-server-conf.json', done);
? ^^^^
});
gulp.task('docs', ['docs:client', 'docs:server']); | 8 | 0.150943 | 4 | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.