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
f4fedcde0ee99fef99512b26c63eeb34bdce0fc9
db/migrate/20100524151953_move_notes_to_comments_in_students.rb
db/migrate/20100524151953_move_notes_to_comments_in_students.rb
class MoveNotesToCommentsInStudents < ActiveRecord::Migration class Comment < ActiveRecord::Base end class Student < ActiveRecord::Base end def self.up user = User.first if user Student.all.each do |student| next if student.notes.blank? Comment.create!(:commentable_id => student.id, :commentable_type => "Student", :comment => student.notes, :user_id => user.id) end end remove_column :students, :notes end def self.down add_column :students, :notes, :text Student.all.each do |student| comments = Comment.find(:all, :conditions => {:commentable_type => "Student", :commentable_id => student.id}, :order => "created_at asc") student.update_attributes :notes => comments.map(&:comment).join("\n\n") comments.each(&:destroy) end end end
class MoveNotesToCommentsInStudents < ActiveRecord::Migration class Comment < ActiveRecord::Base end class Person < ActiveRecord::Base end def self.up user = User.first if user Person.all.each do |student| next if student.notes.blank? Comment.create!(:commentable_id => student.id, :commentable_type => "Student", :comment => student.notes, :user_id => user.id) end end remove_column :students, :notes end def self.down add_column :students, :notes, :text Person.all.each do |student| comments = Comment.find(:all, :conditions => {:commentable_type => "Student", :commentable_id => student.id}, :order => "created_at asc") student.update_attributes :notes => comments.map(&:comment).join("\n\n") comments.each(&:destroy) end end end
Adjust migration to use person instead of student
Adjust migration to use person instead of student
Ruby
mit
edendevelopment/cfi,edendevelopment/cfi,edendevelopment/cfi,edendevelopment/cfi
ruby
## Code Before: class MoveNotesToCommentsInStudents < ActiveRecord::Migration class Comment < ActiveRecord::Base end class Student < ActiveRecord::Base end def self.up user = User.first if user Student.all.each do |student| next if student.notes.blank? Comment.create!(:commentable_id => student.id, :commentable_type => "Student", :comment => student.notes, :user_id => user.id) end end remove_column :students, :notes end def self.down add_column :students, :notes, :text Student.all.each do |student| comments = Comment.find(:all, :conditions => {:commentable_type => "Student", :commentable_id => student.id}, :order => "created_at asc") student.update_attributes :notes => comments.map(&:comment).join("\n\n") comments.each(&:destroy) end end end ## Instruction: Adjust migration to use person instead of student ## Code After: class MoveNotesToCommentsInStudents < ActiveRecord::Migration class Comment < ActiveRecord::Base end class Person < ActiveRecord::Base end def self.up user = User.first if user Person.all.each do |student| next if student.notes.blank? Comment.create!(:commentable_id => student.id, :commentable_type => "Student", :comment => student.notes, :user_id => user.id) end end remove_column :students, :notes end def self.down add_column :students, :notes, :text Person.all.each do |student| comments = Comment.find(:all, :conditions => {:commentable_type => "Student", :commentable_id => student.id}, :order => "created_at asc") student.update_attributes :notes => comments.map(&:comment).join("\n\n") comments.each(&:destroy) end end end
class MoveNotesToCommentsInStudents < ActiveRecord::Migration class Comment < ActiveRecord::Base end - class Student < ActiveRecord::Base ? ^^^^ - + class Person < ActiveRecord::Base ? ^ +++ end def self.up user = User.first if user - Student.all.each do |student| ? ^^^^ - + Person.all.each do |student| ? ^ +++ next if student.notes.blank? Comment.create!(:commentable_id => student.id, :commentable_type => "Student", :comment => student.notes, :user_id => user.id) end end remove_column :students, :notes end def self.down add_column :students, :notes, :text - Student.all.each do |student| ? ^^^^ - + Person.all.each do |student| ? ^ +++ comments = Comment.find(:all, :conditions => {:commentable_type => "Student", :commentable_id => student.id}, :order => "created_at asc") student.update_attributes :notes => comments.map(&:comment).join("\n\n") comments.each(&:destroy) end end end
6
0.222222
3
3
e1856fc6fdf300699f0b46af8f74b672742964e1
.travis.yml
.travis.yml
branches: only: [master] env: global: {secure: Fbrfq+v7R/n1CpgeP9iefnLEb3OD7Wz8ILsdhHSo5JP336jvgK/sVKOsfYaAZhBzaGFymTdisulUgL1og0er7c6o+52Nbzurp7dcDsKvXbN6FroJJ70rzxCvnwFp4AJkerswyHHjtKZ+kV3qCr5nqbK27Fz9IRBCTmRi3n3lIHI=} before_install: - sudo apt-get install -qq python-lxml install: - pip install nikola language: python python: ['2.7'] script: bash ./travis_build_n_deploy.sh virtualenv: system_site_packages: true
branches: only: [master] env: global: {secure: Fbrfq+v7R/n1CpgeP9iefnLEb3OD7Wz8ILsdhHSo5JP336jvgK/sVKOsfYaAZhBzaGFymTdisulUgL1og0er7c6o+52Nbzurp7dcDsKvXbN6FroJJ70rzxCvnwFp4AJkerswyHHjtKZ+kV3qCr5nqbK27Fz9IRBCTmRi3n3lIHI=} before_install: - sudo apt-get install -qq python-lxml python-imaging install: - pip install nikola language: python python: ['2.7'] script: bash ./travis_build_n_deploy.sh virtualenv: system_site_packages: true
Install python-imaging to see if it makes things faster.
Install python-imaging to see if it makes things faster.
YAML
bsd-3-clause
punchagan/mumbaiultimate.in,punchagan/mumbaiultimate.in
yaml
## Code Before: branches: only: [master] env: global: {secure: Fbrfq+v7R/n1CpgeP9iefnLEb3OD7Wz8ILsdhHSo5JP336jvgK/sVKOsfYaAZhBzaGFymTdisulUgL1og0er7c6o+52Nbzurp7dcDsKvXbN6FroJJ70rzxCvnwFp4AJkerswyHHjtKZ+kV3qCr5nqbK27Fz9IRBCTmRi3n3lIHI=} before_install: - sudo apt-get install -qq python-lxml install: - pip install nikola language: python python: ['2.7'] script: bash ./travis_build_n_deploy.sh virtualenv: system_site_packages: true ## Instruction: Install python-imaging to see if it makes things faster. ## Code After: branches: only: [master] env: global: {secure: Fbrfq+v7R/n1CpgeP9iefnLEb3OD7Wz8ILsdhHSo5JP336jvgK/sVKOsfYaAZhBzaGFymTdisulUgL1og0er7c6o+52Nbzurp7dcDsKvXbN6FroJJ70rzxCvnwFp4AJkerswyHHjtKZ+kV3qCr5nqbK27Fz9IRBCTmRi3n3lIHI=} before_install: - sudo apt-get install -qq python-lxml python-imaging install: - pip install nikola language: python python: ['2.7'] script: bash ./travis_build_n_deploy.sh virtualenv: system_site_packages: true
branches: only: [master] env: global: {secure: Fbrfq+v7R/n1CpgeP9iefnLEb3OD7Wz8ILsdhHSo5JP336jvgK/sVKOsfYaAZhBzaGFymTdisulUgL1og0er7c6o+52Nbzurp7dcDsKvXbN6FroJJ70rzxCvnwFp4AJkerswyHHjtKZ+kV3qCr5nqbK27Fz9IRBCTmRi3n3lIHI=} before_install: - - sudo apt-get install -qq python-lxml + - sudo apt-get install -qq python-lxml python-imaging ? +++++++++++++++ install: - pip install nikola language: python python: ['2.7'] script: bash ./travis_build_n_deploy.sh virtualenv: system_site_packages: true
2
0.153846
1
1
c59fda0e1be36c8007ac706ad9b35d054d5111eb
README.md
README.md
ASP.NET Core Identity === AppVeyor: [![AppVeyor](https://ci.appveyor.com/api/projects/status/vf79kttspnblh2hx/branch/dev?svg=true)](https://ci.appveyor.com/project/aspnetci/Identity/branch/dev) Travis: [![Travis](https://travis-ci.org/aspnet/Identity.svg?branch=dev)](https://travis-ci.org/aspnet/Identity) ASP.NET Core Identity is the membership system for building ASP.NET Core web applications, including membership, login, and user data. ASP.NET Core Identity allows you to add login features to your application and makes it easy to customize data about the logged in user. This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the [Home](https://github.com/aspnet/home) repo. ## Community Maintained Store Providers - [ASP.NET Identity MongoDB Provider](https://github.com/tugberkugurlu/AspNetCore.Identity.MongoDB) - [ASP.NET Identity LinqToDB Provider](https://github.com/ili/LinqToDB.Identity) - [ASP.NET Identity DynamoDB Provider](https://github.com/miltador/AspNetCore.Identity.DynamoDB) - [ASP.NET Identity RavenDB Provider](https://github.com/JudahGabriel/RavenDB.Identity)
ASP.NET Core Identity === AppVeyor: [![AppVeyor](https://ci.appveyor.com/api/projects/status/vf79kttspnblh2hx/branch/dev?svg=true)](https://ci.appveyor.com/project/aspnetci/Identity/branch/dev) Travis: [![Travis](https://travis-ci.org/aspnet/Identity.svg?branch=dev)](https://travis-ci.org/aspnet/Identity) ASP.NET Core Identity is the membership system for building ASP.NET Core web applications, including membership, login, and user data. ASP.NET Core Identity allows you to add login features to your application and makes it easy to customize data about the logged in user. This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the [Home](https://github.com/aspnet/home) repo. ## Community Maintained Store Providers - [ASP.NET Identity MongoDB Provider](https://github.com/tugberkugurlu/AspNetCore.Identity.MongoDB) - [ASP.NET Identity LinqToDB Provider](https://github.com/ili/LinqToDB.Identity) - [ASP.NET Identity DynamoDB Provider](https://github.com/miltador/AspNetCore.Identity.DynamoDB) - ASP.NET Identity RavenDB Provider: - [By Judah Gabriel Himango](https://github.com/JudahGabriel/RavenDB.Identity) - [By Iskandar Rafiev](https://github.com/maqduni/AspNetCore.Identity.RavenDB)
Add alternative RavenDB provider by maqduni.
Add alternative RavenDB provider by maqduni.
Markdown
apache-2.0
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
markdown
## Code Before: ASP.NET Core Identity === AppVeyor: [![AppVeyor](https://ci.appveyor.com/api/projects/status/vf79kttspnblh2hx/branch/dev?svg=true)](https://ci.appveyor.com/project/aspnetci/Identity/branch/dev) Travis: [![Travis](https://travis-ci.org/aspnet/Identity.svg?branch=dev)](https://travis-ci.org/aspnet/Identity) ASP.NET Core Identity is the membership system for building ASP.NET Core web applications, including membership, login, and user data. ASP.NET Core Identity allows you to add login features to your application and makes it easy to customize data about the logged in user. This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the [Home](https://github.com/aspnet/home) repo. ## Community Maintained Store Providers - [ASP.NET Identity MongoDB Provider](https://github.com/tugberkugurlu/AspNetCore.Identity.MongoDB) - [ASP.NET Identity LinqToDB Provider](https://github.com/ili/LinqToDB.Identity) - [ASP.NET Identity DynamoDB Provider](https://github.com/miltador/AspNetCore.Identity.DynamoDB) - [ASP.NET Identity RavenDB Provider](https://github.com/JudahGabriel/RavenDB.Identity) ## Instruction: Add alternative RavenDB provider by maqduni. ## Code After: ASP.NET Core Identity === AppVeyor: [![AppVeyor](https://ci.appveyor.com/api/projects/status/vf79kttspnblh2hx/branch/dev?svg=true)](https://ci.appveyor.com/project/aspnetci/Identity/branch/dev) Travis: [![Travis](https://travis-ci.org/aspnet/Identity.svg?branch=dev)](https://travis-ci.org/aspnet/Identity) ASP.NET Core Identity is the membership system for building ASP.NET Core web applications, including membership, login, and user data. ASP.NET Core Identity allows you to add login features to your application and makes it easy to customize data about the logged in user. This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the [Home](https://github.com/aspnet/home) repo. ## Community Maintained Store Providers - [ASP.NET Identity MongoDB Provider](https://github.com/tugberkugurlu/AspNetCore.Identity.MongoDB) - [ASP.NET Identity LinqToDB Provider](https://github.com/ili/LinqToDB.Identity) - [ASP.NET Identity DynamoDB Provider](https://github.com/miltador/AspNetCore.Identity.DynamoDB) - ASP.NET Identity RavenDB Provider: - [By Judah Gabriel Himango](https://github.com/JudahGabriel/RavenDB.Identity) - [By Iskandar Rafiev](https://github.com/maqduni/AspNetCore.Identity.RavenDB)
ASP.NET Core Identity === AppVeyor: [![AppVeyor](https://ci.appveyor.com/api/projects/status/vf79kttspnblh2hx/branch/dev?svg=true)](https://ci.appveyor.com/project/aspnetci/Identity/branch/dev) Travis: [![Travis](https://travis-ci.org/aspnet/Identity.svg?branch=dev)](https://travis-ci.org/aspnet/Identity) ASP.NET Core Identity is the membership system for building ASP.NET Core web applications, including membership, login, and user data. ASP.NET Core Identity allows you to add login features to your application and makes it easy to customize data about the logged in user. This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the [Home](https://github.com/aspnet/home) repo. ## Community Maintained Store Providers - [ASP.NET Identity MongoDB Provider](https://github.com/tugberkugurlu/AspNetCore.Identity.MongoDB) - [ASP.NET Identity LinqToDB Provider](https://github.com/ili/LinqToDB.Identity) - [ASP.NET Identity DynamoDB Provider](https://github.com/miltador/AspNetCore.Identity.DynamoDB) - - [ASP.NET Identity RavenDB Provider](https://github.com/JudahGabriel/RavenDB.Identity) + - ASP.NET Identity RavenDB Provider: + - [By Judah Gabriel Himango](https://github.com/JudahGabriel/RavenDB.Identity) + - [By Iskandar Rafiev](https://github.com/maqduni/AspNetCore.Identity.RavenDB)
4
0.235294
3
1
c47b2d88fce9f890e7356288faf097cf4a97f0b8
simplesqlite/_logger/_logger.py
simplesqlite/_logger/_logger.py
from __future__ import absolute_import, unicode_literals import sqliteschema import tabledata from ._null_logger import NullLogger MODULE_NAME = "simplesqlite" try: from loguru import logger logger.disable(MODULE_NAME) except ImportError: logger = NullLogger() def set_logger(is_enable): if is_enable: logger.enable(MODULE_NAME) else: logger.disable(MODULE_NAME) tabledata.set_logger(is_enable) sqliteschema.set_logger(is_enable) try: import pytablereader pytablereader.set_logger(is_enable) except ImportError: pass def set_log_level(log_level): # deprecated return
from __future__ import absolute_import, unicode_literals import sqliteschema import tabledata from ._null_logger import NullLogger MODULE_NAME = "simplesqlite" _is_enable = False try: from loguru import logger logger.disable(MODULE_NAME) except ImportError: logger = NullLogger() def set_logger(is_enable): global _is_enable if is_enable == _is_enable: return if is_enable: logger.enable(MODULE_NAME) else: logger.disable(MODULE_NAME) tabledata.set_logger(is_enable) sqliteschema.set_logger(is_enable) try: import pytablereader pytablereader.set_logger(is_enable) except ImportError: pass def set_log_level(log_level): # deprecated return
Add check for logging state
Add check for logging state
Python
mit
thombashi/SimpleSQLite,thombashi/SimpleSQLite
python
## Code Before: from __future__ import absolute_import, unicode_literals import sqliteschema import tabledata from ._null_logger import NullLogger MODULE_NAME = "simplesqlite" try: from loguru import logger logger.disable(MODULE_NAME) except ImportError: logger = NullLogger() def set_logger(is_enable): if is_enable: logger.enable(MODULE_NAME) else: logger.disable(MODULE_NAME) tabledata.set_logger(is_enable) sqliteschema.set_logger(is_enable) try: import pytablereader pytablereader.set_logger(is_enable) except ImportError: pass def set_log_level(log_level): # deprecated return ## Instruction: Add check for logging state ## Code After: from __future__ import absolute_import, unicode_literals import sqliteschema import tabledata from ._null_logger import NullLogger MODULE_NAME = "simplesqlite" _is_enable = False try: from loguru import logger logger.disable(MODULE_NAME) except ImportError: logger = NullLogger() def set_logger(is_enable): global _is_enable if is_enable == _is_enable: return if is_enable: logger.enable(MODULE_NAME) else: logger.disable(MODULE_NAME) tabledata.set_logger(is_enable) sqliteschema.set_logger(is_enable) try: import pytablereader pytablereader.set_logger(is_enable) except ImportError: pass def set_log_level(log_level): # deprecated return
from __future__ import absolute_import, unicode_literals import sqliteschema import tabledata from ._null_logger import NullLogger MODULE_NAME = "simplesqlite" + _is_enable = False try: from loguru import logger logger.disable(MODULE_NAME) except ImportError: logger = NullLogger() def set_logger(is_enable): + global _is_enable + + if is_enable == _is_enable: + return + if is_enable: logger.enable(MODULE_NAME) else: logger.disable(MODULE_NAME) tabledata.set_logger(is_enable) sqliteschema.set_logger(is_enable) try: import pytablereader pytablereader.set_logger(is_enable) except ImportError: pass def set_log_level(log_level): # deprecated return
6
0.15
6
0
87cbd33f114f61bee5f76d6944280c7cb40311e8
owncloud/indico_owncloud/client/index.js
owncloud/indico_owncloud/client/index.js
// This file is part of the Indico plugins. // Copyright (C) 2002 - 2022 CERN // // The Indico plugins are free software; you can redistribute // them and/or modify them under the terms of the MIT License; // see the LICENSE file for more details. // eslint-disable-next-line import/unambiguous window.setupOwncloudFilePickerWidget = ({filepickerUrl, fieldId}) => { window.addEventListener('message', message => { const iframe = document.querySelector('#owncloud_filepicker-file-picker'); if ( message.origin === filepickerUrl && message.source === iframe.contentWindow && message.data && message.data.files ) { document.getElementById(`${fieldId}-files`).value = message.data.files.join('\n'); } }); };
// This file is part of the Indico plugins. // Copyright (C) 2002 - 2022 CERN // // The Indico plugins are free software; you can redistribute // them and/or modify them under the terms of the MIT License; // see the LICENSE file for more details. // eslint-disable-next-line import/unambiguous window.setupOwncloudFilePickerWidget = ({filepickerUrl, fieldId}) => { window.addEventListener('message', message => { const iframe = document.querySelector('#owncloud_filepicker-file-picker'); if ( iframe && message.origin === filepickerUrl && message.source === iframe.contentWindow && message.data && message.data.files ) { document.getElementById(`${fieldId}-files`).value = message.data.files.join('\n'); } }); };
Fix JS error after closing dialog
OwnCloud: Fix JS error after closing dialog
JavaScript
mit
indico/indico-plugins,indico/indico-plugins,indico/indico-plugins,indico/indico-plugins
javascript
## Code Before: // This file is part of the Indico plugins. // Copyright (C) 2002 - 2022 CERN // // The Indico plugins are free software; you can redistribute // them and/or modify them under the terms of the MIT License; // see the LICENSE file for more details. // eslint-disable-next-line import/unambiguous window.setupOwncloudFilePickerWidget = ({filepickerUrl, fieldId}) => { window.addEventListener('message', message => { const iframe = document.querySelector('#owncloud_filepicker-file-picker'); if ( message.origin === filepickerUrl && message.source === iframe.contentWindow && message.data && message.data.files ) { document.getElementById(`${fieldId}-files`).value = message.data.files.join('\n'); } }); }; ## Instruction: OwnCloud: Fix JS error after closing dialog ## Code After: // This file is part of the Indico plugins. // Copyright (C) 2002 - 2022 CERN // // The Indico plugins are free software; you can redistribute // them and/or modify them under the terms of the MIT License; // see the LICENSE file for more details. // eslint-disable-next-line import/unambiguous window.setupOwncloudFilePickerWidget = ({filepickerUrl, fieldId}) => { window.addEventListener('message', message => { const iframe = document.querySelector('#owncloud_filepicker-file-picker'); if ( iframe && message.origin === filepickerUrl && message.source === iframe.contentWindow && message.data && message.data.files ) { document.getElementById(`${fieldId}-files`).value = message.data.files.join('\n'); } }); };
// This file is part of the Indico plugins. // Copyright (C) 2002 - 2022 CERN // // The Indico plugins are free software; you can redistribute // them and/or modify them under the terms of the MIT License; // see the LICENSE file for more details. // eslint-disable-next-line import/unambiguous window.setupOwncloudFilePickerWidget = ({filepickerUrl, fieldId}) => { window.addEventListener('message', message => { const iframe = document.querySelector('#owncloud_filepicker-file-picker'); if ( + iframe && message.origin === filepickerUrl && message.source === iframe.contentWindow && message.data && message.data.files ) { document.getElementById(`${fieldId}-files`).value = message.data.files.join('\n'); } }); };
1
0.047619
1
0
b11386486790226f751ac07e5893802df41a39e4
Manifold/Term+DefinitionalEquality.swift
Manifold/Term+DefinitionalEquality.swift
// Copyright © 2015 Rob Rix. All rights reserved. extension Term { public static func equate(left: Term, _ right: Term, _ environment: [Name:Term]) -> Term? { let normalize: Term -> Term = { term in term.weakHeadNormalForm(environment, shouldRecur: false) } let left = normalize(left) let right = normalize(right) if left == right { return right } switch (left.out, right.out) { case (.Implicit, _): return right case (_, .Implicit): return left case (.Type, .Type): return right case let (.Application(a1, a2), .Application(b1, b2)): guard let first = equate(a1, b1, environment), second = equate(a2, b2, environment) else { return nil } return .Application(first, second) case let (.Lambda(_, a1, a2), .Lambda(i, b1, b2)): guard let type = equate(a1, b1, environment), body = equate(a2, b2, environment) else { return nil } return .Lambda(i, type, body) default: return nil } } }
// Copyright © 2015 Rob Rix. All rights reserved. extension Term { public static func equate(left: Term, _ right: Term, _ environment: [Name:Term]) -> Term? { let normalize: Term -> Term = { term in term.weakHeadNormalForm(environment, shouldRecur: false) } let leftʹ = normalize(left) let rightʹ = normalize(right) if leftʹ == rightʹ { return rightʹ } switch (leftʹ.out, rightʹ.out) { case (.Implicit, _): return rightʹ case (_, .Implicit): return leftʹ case (.Type, .Type): return rightʹ case let (.Application(a1, a2), .Application(b1, b2)): guard let first = equate(a1, b1, environment), second = equate(a2, b2, environment) else { return nil } return .Application(first, second) case let (.Lambda(_, a1, a2), .Lambda(i, b1, b2)): guard let type = equate(a1, b1, environment), body = equate(a2, b2, environment) else { return nil } return .Lambda(i, type, body) default: return nil } } }
Rename the normalized variables in definitional equality.
Rename the normalized variables in definitional equality.
Swift
mit
antitypical/Manifold,antitypical/Manifold
swift
## Code Before: // Copyright © 2015 Rob Rix. All rights reserved. extension Term { public static func equate(left: Term, _ right: Term, _ environment: [Name:Term]) -> Term? { let normalize: Term -> Term = { term in term.weakHeadNormalForm(environment, shouldRecur: false) } let left = normalize(left) let right = normalize(right) if left == right { return right } switch (left.out, right.out) { case (.Implicit, _): return right case (_, .Implicit): return left case (.Type, .Type): return right case let (.Application(a1, a2), .Application(b1, b2)): guard let first = equate(a1, b1, environment), second = equate(a2, b2, environment) else { return nil } return .Application(first, second) case let (.Lambda(_, a1, a2), .Lambda(i, b1, b2)): guard let type = equate(a1, b1, environment), body = equate(a2, b2, environment) else { return nil } return .Lambda(i, type, body) default: return nil } } } ## Instruction: Rename the normalized variables in definitional equality. ## Code After: // Copyright © 2015 Rob Rix. All rights reserved. extension Term { public static func equate(left: Term, _ right: Term, _ environment: [Name:Term]) -> Term? { let normalize: Term -> Term = { term in term.weakHeadNormalForm(environment, shouldRecur: false) } let leftʹ = normalize(left) let rightʹ = normalize(right) if leftʹ == rightʹ { return rightʹ } switch (leftʹ.out, rightʹ.out) { case (.Implicit, _): return rightʹ case (_, .Implicit): return leftʹ case (.Type, .Type): return rightʹ case let (.Application(a1, a2), .Application(b1, b2)): guard let first = equate(a1, b1, environment), second = equate(a2, b2, environment) else { return nil } return .Application(first, second) case let (.Lambda(_, a1, a2), .Lambda(i, b1, b2)): guard let type = equate(a1, b1, environment), body = equate(a2, b2, environment) else { return nil } return .Lambda(i, type, body) default: return nil } } }
// Copyright © 2015 Rob Rix. All rights reserved. extension Term { public static func equate(left: Term, _ right: Term, _ environment: [Name:Term]) -> Term? { let normalize: Term -> Term = { term in term.weakHeadNormalForm(environment, shouldRecur: false) } - let left = normalize(left) + let leftʹ = normalize(left) ? + - let right = normalize(right) + let rightʹ = normalize(right) ? + - if left == right { return right } + if leftʹ == rightʹ { return rightʹ } ? + + + - switch (left.out, right.out) { + switch (leftʹ.out, rightʹ.out) { ? + + case (.Implicit, _): - return right + return rightʹ ? + case (_, .Implicit): - return left + return leftʹ ? + case (.Type, .Type): - return right + return rightʹ ? + case let (.Application(a1, a2), .Application(b1, b2)): guard let first = equate(a1, b1, environment), second = equate(a2, b2, environment) else { return nil } return .Application(first, second) case let (.Lambda(_, a1, a2), .Lambda(i, b1, b2)): guard let type = equate(a1, b1, environment), body = equate(a2, b2, environment) else { return nil } return .Lambda(i, type, body) default: return nil } } }
14
0.388889
7
7
922acafc793b3d32f625fe18cd52b2bfd59a5f96
ansible/wsgi.py
ansible/wsgi.py
from pecan.deploy import deploy app = deploy('/opt/web/draughtcraft/src/production.py') from paste.exceptions.errormiddleware import ErrorMiddleware app = ErrorMiddleware( app, error_email=app.conf.error_email, from_address=app.conf.error_email, smtp_server=app.conf.error_smtp_server, smtp_username=app.conf.error_email, smtp_password=app.conf.error_password, smtp_use_tls=True )
from pecan import conf from pecan.deploy import deploy app = deploy('/opt/web/draughtcraft/src/production.py') from paste.exceptions.errormiddleware import ErrorMiddleware app = ErrorMiddleware( app, error_email=conf.error_email, from_address=conf.error_email, smtp_server=conf.error_smtp_server, smtp_username=conf.error_email, smtp_password=conf.error_password, smtp_use_tls=True )
Fix a bug in the WSGI entrypoint.
Fix a bug in the WSGI entrypoint.
Python
bsd-3-clause
ryanpetrello/draughtcraft,ryanpetrello/draughtcraft,ryanpetrello/draughtcraft,ryanpetrello/draughtcraft
python
## Code Before: from pecan.deploy import deploy app = deploy('/opt/web/draughtcraft/src/production.py') from paste.exceptions.errormiddleware import ErrorMiddleware app = ErrorMiddleware( app, error_email=app.conf.error_email, from_address=app.conf.error_email, smtp_server=app.conf.error_smtp_server, smtp_username=app.conf.error_email, smtp_password=app.conf.error_password, smtp_use_tls=True ) ## Instruction: Fix a bug in the WSGI entrypoint. ## Code After: from pecan import conf from pecan.deploy import deploy app = deploy('/opt/web/draughtcraft/src/production.py') from paste.exceptions.errormiddleware import ErrorMiddleware app = ErrorMiddleware( app, error_email=conf.error_email, from_address=conf.error_email, smtp_server=conf.error_smtp_server, smtp_username=conf.error_email, smtp_password=conf.error_password, smtp_use_tls=True )
+ from pecan import conf from pecan.deploy import deploy app = deploy('/opt/web/draughtcraft/src/production.py') from paste.exceptions.errormiddleware import ErrorMiddleware app = ErrorMiddleware( app, - error_email=app.conf.error_email, ? ---- + error_email=conf.error_email, - from_address=app.conf.error_email, ? ---- + from_address=conf.error_email, - smtp_server=app.conf.error_smtp_server, ? ---- + smtp_server=conf.error_smtp_server, - smtp_username=app.conf.error_email, ? ---- + smtp_username=conf.error_email, - smtp_password=app.conf.error_password, ? ---- + smtp_password=conf.error_password, smtp_use_tls=True )
11
0.846154
6
5
a99693050075581d8a44ffbef73add20ce3c9551
lib/tasks/update_printers.rake
lib/tasks/update_printers.rake
require 'net/http' namespace :cthit do desc "Update glorious printers" task update_printers: :environment do uri = URI('http://print.chalmers.se/public/pls.cgi') res = Net::HTTP.post_form(uri, 'textver' => 'CSV export') lines = res.body.split("\n") lines.drop(12).each do |printer| values = printer.split("\t") next unless values.length == 6 p = Printer.create(name: values[0].strip, location: values[2].strip, media: values[4].strip) puts p end end end
require 'csv' require 'net/http' def get_all_csv uri = URI 'http://print.chalmers.se/public/pls.cgi' res = Net::HTTP.post_form(uri, 'textver' => 'CSV export') xml = Nokogiri::XML(res.body) text = xml.css('pre').children.text.strip CSV.parse(text, { col_sep: "\t", header_converters: :symbol, headers: true, return_headers: true }).drop(1) end namespace :cthit do desc "Update glorious printers" task update_printers: :environment do csv = get_all_csv Printer.where('name NOT IN (?)', csv.map{ |c| c[:printer].strip }).delete_all csv.each do |printer| pp = Printer.find_or_initialize_by(name: printer[:printer].strip) pp.update_attributes({ location: printer[:printer].strip, media: printer[:size].strip }) puts pp end end end
Make printer adding script repeatable
Make printer adding script repeatable
Ruby
mit
cthit/chalmersit-rails,cthit/chalmersit-rails,cthit/chalmersit-rails,cthit/chalmersit-rails
ruby
## Code Before: require 'net/http' namespace :cthit do desc "Update glorious printers" task update_printers: :environment do uri = URI('http://print.chalmers.se/public/pls.cgi') res = Net::HTTP.post_form(uri, 'textver' => 'CSV export') lines = res.body.split("\n") lines.drop(12).each do |printer| values = printer.split("\t") next unless values.length == 6 p = Printer.create(name: values[0].strip, location: values[2].strip, media: values[4].strip) puts p end end end ## Instruction: Make printer adding script repeatable ## Code After: require 'csv' require 'net/http' def get_all_csv uri = URI 'http://print.chalmers.se/public/pls.cgi' res = Net::HTTP.post_form(uri, 'textver' => 'CSV export') xml = Nokogiri::XML(res.body) text = xml.css('pre').children.text.strip CSV.parse(text, { col_sep: "\t", header_converters: :symbol, headers: true, return_headers: true }).drop(1) end namespace :cthit do desc "Update glorious printers" task update_printers: :environment do csv = get_all_csv Printer.where('name NOT IN (?)', csv.map{ |c| c[:printer].strip }).delete_all csv.each do |printer| pp = Printer.find_or_initialize_by(name: printer[:printer].strip) pp.update_attributes({ location: printer[:printer].strip, media: printer[:size].strip }) puts pp end end end
+ require 'csv' require 'net/http' + + def get_all_csv + uri = URI 'http://print.chalmers.se/public/pls.cgi' + res = Net::HTTP.post_form(uri, 'textver' => 'CSV export') + xml = Nokogiri::XML(res.body) + text = xml.css('pre').children.text.strip + CSV.parse(text, { + col_sep: "\t", + header_converters: :symbol, + headers: true, + return_headers: true + }).drop(1) + end + namespace :cthit do desc "Update glorious printers" task update_printers: :environment do + csv = get_all_csv + Printer.where('name NOT IN (?)', csv.map{ |c| c[:printer].strip }).delete_all - uri = URI('http://print.chalmers.se/public/pls.cgi') - res = Net::HTTP.post_form(uri, 'textver' => 'CSV export') - lines = res.body.split("\n") - lines.drop(12).each do |printer| - values = printer.split("\t") - - next unless values.length == 6 - p = Printer.create(name: values[0].strip, location: values[2].strip, media: values[4].strip) + csv.each do |printer| + pp = Printer.find_or_initialize_by(name: printer[:printer].strip) + pp.update_attributes({ + location: printer[:printer].strip, + media: printer[:size].strip + }) - puts p + puts pp ? + end - end - end
35
1.842105
24
11
8a91a4132040663ad06f0fe610865bbb9394a82d
requirements.txt
requirements.txt
Flask==0.10.1 Flask-Bcrypt==0.6.0 Flask-Login==0.2.11 Flask-OAuthlib==0.5.0 -e git://github.com/imgtl/flask-restful.git#egg=Flask_RESTful-master Flask-SQLAlchemy==1.0 Jinja2==2.7.3 MarkupSafe==0.23 SQLAlchemy==0.9.7 Wand==0.3.7 Werkzeug==0.9.6 aniso8601==0.82 argparse==1.2.1 itsdangerous==0.24 oauthlib==0.6.3 py-bcrypt==0.4 pytz==2014.4 requests==2.3.0 shortuuid==0.4.2 simplejson==3.6.0 six==1.7.3 wsgiref==0.1.2
Flask==0.10.1 Flask-Bcrypt==0.6.0 Flask-Login==0.2.11 Flask-OAuthlib==0.5.0 Flask-RESTful==0.2.12 Flask-SQLAlchemy==1.0 Jinja2==2.7.3 MarkupSafe==0.23 SQLAlchemy==0.9.7 Wand==0.3.7 Werkzeug==0.9.6 aniso8601==0.82 argparse==1.2.1 itsdangerous==0.24 oauthlib==0.6.3 py-bcrypt==0.4 pytz==2014.4 requests==2.3.0 shortuuid==0.4.2 simplejson==3.6.0 six==1.7.3 wsgiref==0.1.2
Change Flask-RESTful to PyPI version
Change Flask-RESTful to PyPI version
Text
mit
revi/imgtl,imgtl/imgtl,imgtl/imgtl,revi/imgtl,revi/imgtl
text
## Code Before: Flask==0.10.1 Flask-Bcrypt==0.6.0 Flask-Login==0.2.11 Flask-OAuthlib==0.5.0 -e git://github.com/imgtl/flask-restful.git#egg=Flask_RESTful-master Flask-SQLAlchemy==1.0 Jinja2==2.7.3 MarkupSafe==0.23 SQLAlchemy==0.9.7 Wand==0.3.7 Werkzeug==0.9.6 aniso8601==0.82 argparse==1.2.1 itsdangerous==0.24 oauthlib==0.6.3 py-bcrypt==0.4 pytz==2014.4 requests==2.3.0 shortuuid==0.4.2 simplejson==3.6.0 six==1.7.3 wsgiref==0.1.2 ## Instruction: Change Flask-RESTful to PyPI version ## Code After: Flask==0.10.1 Flask-Bcrypt==0.6.0 Flask-Login==0.2.11 Flask-OAuthlib==0.5.0 Flask-RESTful==0.2.12 Flask-SQLAlchemy==1.0 Jinja2==2.7.3 MarkupSafe==0.23 SQLAlchemy==0.9.7 Wand==0.3.7 Werkzeug==0.9.6 aniso8601==0.82 argparse==1.2.1 itsdangerous==0.24 oauthlib==0.6.3 py-bcrypt==0.4 pytz==2014.4 requests==2.3.0 shortuuid==0.4.2 simplejson==3.6.0 six==1.7.3 wsgiref==0.1.2
Flask==0.10.1 Flask-Bcrypt==0.6.0 Flask-Login==0.2.11 Flask-OAuthlib==0.5.0 - -e git://github.com/imgtl/flask-restful.git#egg=Flask_RESTful-master + Flask-RESTful==0.2.12 Flask-SQLAlchemy==1.0 Jinja2==2.7.3 MarkupSafe==0.23 SQLAlchemy==0.9.7 Wand==0.3.7 Werkzeug==0.9.6 aniso8601==0.82 argparse==1.2.1 itsdangerous==0.24 oauthlib==0.6.3 py-bcrypt==0.4 pytz==2014.4 requests==2.3.0 shortuuid==0.4.2 simplejson==3.6.0 six==1.7.3 wsgiref==0.1.2
2
0.090909
1
1
b209a5a547272f70d8263dec1b3816cf91c272e0
DEPLOY.md
DEPLOY.md
The following describes how to run the server in production using Docker Compose. ## Requirements - Git 1.8+ - Docker 17.09+ (since we use `--chown` flag in the COPY directive) - Docker Compose ## Gather Container Environment Variables There are four configurations that must be set when running the container. * `SECRET_KEY` is used to provide cryptographic signing, refer to src/pycontw2016/settings/local.sample.env on how to generate secret key * `MEDIA_ROOT` specifies where media files (user-uploaded assets) are stored in the host. This will be mounted into the container. * `DATABASE_URL` specifies how to connect to the database (in the URL form e.g. `postgres://username:password@host_or_ip:5432/database_name`) * `EMAIL_URL` specifies how to connect to the mail server (e.g. `smtp+tls://username:password@host_or_ip:25`) * `DSN_URL` specify how to connect to Sentry error reporting service (e.g. `https://key@sentry.io/project`), please refer to [Sentry's documentation on how to obtain Data Source Name](https://docs.sentry.io/error-reporting/quickstart/?platform=python) * (optional) `SLACK_WEBHOOK_URL` Write them in a `.env` file at the same directory that contains `docker-compose.yml`. # Run the Production Server Run the production server container: docker-compose start
The following describes how to run the server in production using Docker Compose. ## Requirements - Git 1.8+ - Docker 17.09+ (since we use `--chown` flag in the COPY directive) - Docker Compose ## Gather Container Environment Variables There are four configurations that must be set when running the container. * `SECRET_KEY` is used to provide cryptographic signing, refer to src/pycontw2016/settings/local.sample.env on how to generate secret key * `MEDIA_ROOT` specifies where media files (user-uploaded assets) are stored in the host. This will be mounted into the container. * `DATABASE_URL` specifies how to connect to the database (in the URL form e.g. `postgres://username:password@host_or_ip:5432/database_name`) * `EMAIL_URL` specifies how to connect to the mail server (e.g. `smtp+tls://username:password@host_or_ip:25`) * `DSN_URL` specify how to connect to Sentry error reporting service (e.g. `https://key@sentry.io/project`), please refer to [Sentry's documentation on how to obtain Data Source Name](https://docs.sentry.io/error-reporting/quickstart/?platform=python) * (optional) `SLACK_WEBHOOK_URL` Write them in a [`.env` file](https://docs.docker.com/compose/env-file/) at the same directory that contains `docker-compose.yml`. # Run the Production Server Run the production server container: docker-compose start
Add link to Docker's env file docs (because it is weird)
Add link to Docker's env file docs (because it is weird)
Markdown
mit
pycontw/pycontw2016,pycontw/pycontw2016,pycontw/pycontw2016,pycontw/pycontw2016
markdown
## Code Before: The following describes how to run the server in production using Docker Compose. ## Requirements - Git 1.8+ - Docker 17.09+ (since we use `--chown` flag in the COPY directive) - Docker Compose ## Gather Container Environment Variables There are four configurations that must be set when running the container. * `SECRET_KEY` is used to provide cryptographic signing, refer to src/pycontw2016/settings/local.sample.env on how to generate secret key * `MEDIA_ROOT` specifies where media files (user-uploaded assets) are stored in the host. This will be mounted into the container. * `DATABASE_URL` specifies how to connect to the database (in the URL form e.g. `postgres://username:password@host_or_ip:5432/database_name`) * `EMAIL_URL` specifies how to connect to the mail server (e.g. `smtp+tls://username:password@host_or_ip:25`) * `DSN_URL` specify how to connect to Sentry error reporting service (e.g. `https://key@sentry.io/project`), please refer to [Sentry's documentation on how to obtain Data Source Name](https://docs.sentry.io/error-reporting/quickstart/?platform=python) * (optional) `SLACK_WEBHOOK_URL` Write them in a `.env` file at the same directory that contains `docker-compose.yml`. # Run the Production Server Run the production server container: docker-compose start ## Instruction: Add link to Docker's env file docs (because it is weird) ## Code After: The following describes how to run the server in production using Docker Compose. ## Requirements - Git 1.8+ - Docker 17.09+ (since we use `--chown` flag in the COPY directive) - Docker Compose ## Gather Container Environment Variables There are four configurations that must be set when running the container. * `SECRET_KEY` is used to provide cryptographic signing, refer to src/pycontw2016/settings/local.sample.env on how to generate secret key * `MEDIA_ROOT` specifies where media files (user-uploaded assets) are stored in the host. This will be mounted into the container. * `DATABASE_URL` specifies how to connect to the database (in the URL form e.g. `postgres://username:password@host_or_ip:5432/database_name`) * `EMAIL_URL` specifies how to connect to the mail server (e.g. `smtp+tls://username:password@host_or_ip:25`) * `DSN_URL` specify how to connect to Sentry error reporting service (e.g. `https://key@sentry.io/project`), please refer to [Sentry's documentation on how to obtain Data Source Name](https://docs.sentry.io/error-reporting/quickstart/?platform=python) * (optional) `SLACK_WEBHOOK_URL` Write them in a [`.env` file](https://docs.docker.com/compose/env-file/) at the same directory that contains `docker-compose.yml`. # Run the Production Server Run the production server container: docker-compose start
The following describes how to run the server in production using Docker Compose. ## Requirements - Git 1.8+ - Docker 17.09+ (since we use `--chown` flag in the COPY directive) - Docker Compose ## Gather Container Environment Variables There are four configurations that must be set when running the container. * `SECRET_KEY` is used to provide cryptographic signing, refer to src/pycontw2016/settings/local.sample.env on how to generate secret key * `MEDIA_ROOT` specifies where media files (user-uploaded assets) are stored in the host. This will be mounted into the container. * `DATABASE_URL` specifies how to connect to the database (in the URL form e.g. `postgres://username:password@host_or_ip:5432/database_name`) * `EMAIL_URL` specifies how to connect to the mail server (e.g. `smtp+tls://username:password@host_or_ip:25`) * `DSN_URL` specify how to connect to Sentry error reporting service (e.g. `https://key@sentry.io/project`), please refer to [Sentry's documentation on how to obtain Data Source Name](https://docs.sentry.io/error-reporting/quickstart/?platform=python) * (optional) `SLACK_WEBHOOK_URL` - Write them in a `.env` file at the same directory that contains + Write them in a [`.env` file](https://docs.docker.com/compose/env-file/) at the same directory that contains `docker-compose.yml`. # Run the Production Server Run the production server container: docker-compose start
2
0.055556
1
1
2b87bbf32e46a5339d99c3293e91dcf2c88d0c92
extensions/gdata/module/scripts/project-injection.js
extensions/gdata/module/scripts/project-injection.js
// Client side resources to be injected for gData extension // Add items to the exporter menu MenuBar.insertBefore( [ "core/project", "core/export", "core/export-templating" ], [ { "label":"Google Spreadsheet", "click": function() {} }, { "label":"Google Data", "click": function() {} }, {} // separator ] ); var gdataExtension = {};
// Client side resources to be injected for gData extension // Add items to the exporter menu //ExportManager.MenuItems.append( // [ "core/project", "core/export", "core/export-templating" ], // [ // { // "label":"Google Spreadsheet", // "click": function() {} // }, // { // "label":"Google Data", // "click": function() {} // }, // {} // separator // ] //); var gdataExtension = {};
Comment out unused exporter injection. Target has moved anyway
Comment out unused exporter injection. Target has moved anyway git-svn-id: 434d687192588585fc4b74a81d202f670dfb77fb@1550 7d457c2a-affb-35e4-300a-418c747d4874
JavaScript
mit
DTL-FAIRData/FAIRifier,DTL-FAIRData/FAIRifier,DTL-FAIRData/FAIRifier,DTL-FAIRData/FAIRifier,DTL-FAIRData/FAIRifier,DTL-FAIRData/FAIRifier
javascript
## Code Before: // Client side resources to be injected for gData extension // Add items to the exporter menu MenuBar.insertBefore( [ "core/project", "core/export", "core/export-templating" ], [ { "label":"Google Spreadsheet", "click": function() {} }, { "label":"Google Data", "click": function() {} }, {} // separator ] ); var gdataExtension = {}; ## Instruction: Comment out unused exporter injection. Target has moved anyway git-svn-id: 434d687192588585fc4b74a81d202f670dfb77fb@1550 7d457c2a-affb-35e4-300a-418c747d4874 ## Code After: // Client side resources to be injected for gData extension // Add items to the exporter menu //ExportManager.MenuItems.append( // [ "core/project", "core/export", "core/export-templating" ], // [ // { // "label":"Google Spreadsheet", // "click": function() {} // }, // { // "label":"Google Data", // "click": function() {} // }, // {} // separator // ] //); var gdataExtension = {};
// Client side resources to be injected for gData extension // Add items to the exporter menu - MenuBar.insertBefore( + //ExportManager.MenuItems.append( - [ "core/project", "core/export", "core/export-templating" ], + // [ "core/project", "core/export", "core/export-templating" ], ? ++ - [ + // [ ? ++ - { + // { ? ++ - "label":"Google Spreadsheet", + // "label":"Google Spreadsheet", ? ++ - "click": function() {} + // "click": function() {} ? ++ - }, + // }, ? ++ - { + // { ? ++ - "label":"Google Data", + // "label":"Google Data", ? ++ - "click": function() {} + // "click": function() {} ? ++ - }, + // }, ? ++ - {} // separator + // {} // separator ? ++ - ] + // ] ? ++ - ); + //); var gdataExtension = {};
28
1.473684
14
14
74088ac949f675a6eb268e6180a3b8d278a429e8
app/models/concerns/randomizable.rb
app/models/concerns/randomizable.rb
module Randomizable extend ActiveSupport::Concern class_methods do def sort_by_random(seed = rand(10_000_000)) ids = pluck(:id).shuffle(random: Random.new(seed)) return all if ids.empty? ids_with_order = ids.map.with_index { |id, order| "(#{id}, #{order})" }.join(", ") joins("LEFT JOIN (VALUES #{ids_with_order}) AS ids(id, ordering) ON #{table_name}.id = ids.id") .order("ids.ordering") end end end
module Randomizable extend ActiveSupport::Concern class_methods do def sort_by_random(seed = rand(10_000_000)) ids = order(:id).pluck(:id).shuffle(random: Random.new(seed)) return all if ids.empty? ids_with_order = ids.map.with_index { |id, order| "(#{id}, #{order})" }.join(", ") joins("LEFT JOIN (VALUES #{ids_with_order}) AS ids(id, ordering) ON #{table_name}.id = ids.id") .order("ids.ordering") end end end
Make random IDs with the same seed consistent
Make random IDs with the same seed consistent The order of the array before being shuffled needs to be the same if we want to have the same array after being shuffled with a certain seed. We were using `pluck(:id)`, which doesn't guarantee the order of the elements returned. Replacing it with `order(:id).pluck(:id)` adds an `ORDER BY` clause and so guarantees the order of the elements.
Ruby
agpl-3.0
consul/consul,AyuntamientoMadrid/participacion,AyuntamientoPuertoReal/decidePuertoReal,AyuntamientoMadrid/participacion,usabi/consul_san_borondon,consul/consul,usabi/consul_san_borondon,AyuntamientoMadrid/participacion,consul/consul,usabi/consul_san_borondon,AyuntamientoPuertoReal/decidePuertoReal,AyuntamientoPuertoReal/decidePuertoReal,consul/consul,consul/consul,usabi/consul_san_borondon,AyuntamientoMadrid/participacion
ruby
## Code Before: module Randomizable extend ActiveSupport::Concern class_methods do def sort_by_random(seed = rand(10_000_000)) ids = pluck(:id).shuffle(random: Random.new(seed)) return all if ids.empty? ids_with_order = ids.map.with_index { |id, order| "(#{id}, #{order})" }.join(", ") joins("LEFT JOIN (VALUES #{ids_with_order}) AS ids(id, ordering) ON #{table_name}.id = ids.id") .order("ids.ordering") end end end ## Instruction: Make random IDs with the same seed consistent The order of the array before being shuffled needs to be the same if we want to have the same array after being shuffled with a certain seed. We were using `pluck(:id)`, which doesn't guarantee the order of the elements returned. Replacing it with `order(:id).pluck(:id)` adds an `ORDER BY` clause and so guarantees the order of the elements. ## Code After: module Randomizable extend ActiveSupport::Concern class_methods do def sort_by_random(seed = rand(10_000_000)) ids = order(:id).pluck(:id).shuffle(random: Random.new(seed)) return all if ids.empty? ids_with_order = ids.map.with_index { |id, order| "(#{id}, #{order})" }.join(", ") joins("LEFT JOIN (VALUES #{ids_with_order}) AS ids(id, ordering) ON #{table_name}.id = ids.id") .order("ids.ordering") end end end
module Randomizable extend ActiveSupport::Concern class_methods do def sort_by_random(seed = rand(10_000_000)) - ids = pluck(:id).shuffle(random: Random.new(seed)) + ids = order(:id).pluck(:id).shuffle(random: Random.new(seed)) ? +++++++++++ return all if ids.empty? ids_with_order = ids.map.with_index { |id, order| "(#{id}, #{order})" }.join(", ") joins("LEFT JOIN (VALUES #{ids_with_order}) AS ids(id, ordering) ON #{table_name}.id = ids.id") .order("ids.ordering") end end end
2
0.125
1
1
103ae46c7fb9251fccfca39e0ae345e9c1fce9f6
client/views/lotto/lotto_add.js
client/views/lotto/lotto_add.js
Template.lottoAdd.created = function() { Session.set('lottoAddErrors', {}); }; Template.lottoAdd.rendered = function() { this.find('input[name=date]').valueAsDate = new Date(); }; Template.lottoAdd.helpers({ errorMessage: function(field) { return Session.get('lottoAddErrors')[field]; }, errorClass: function (field) { return !!Session.get('lottoAddErrors')[field] ? 'has-error' : ''; } }); Template.lottoAdd.events({ 'submit form': function(e) { e.preventDefault(); var lotto = { date: moment(e.target.date.value).toDate() }; if (!lotto.date) { var errors = {}; errors.date = "Please select a date"; return Session.set('lottoAddErrors', errors); } Meteor.call('lottoInsert', lotto, function(error, result) { if(error) { return throwError(error.reason); } if(result.lottoExists) { throwError('Lotto for this date already exists'); } Router.go('lottoPage', {_id: result._id}); }); } });
Template.lottoAdd.created = function() { Session.set('lottoAddErrors', {}); }; Template.lottoAdd.rendered = function() { this.find('#date').valueAsDate = moment().day(5).toDate(); }; Template.lottoAdd.helpers({ errorMessage: function(field) { return Session.get('lottoAddErrors')[field]; }, errorClass: function (field) { return !!Session.get('lottoAddErrors')[field] ? 'has-error' : ''; } }); Template.lottoAdd.events({ 'submit form': function(e) { e.preventDefault(); var lotto = { date: moment(e.target.date.value).toDate() }; if (!lotto.date) { var errors = {}; errors.date = "Please select a date"; return Session.set('lottoAddErrors', errors); } Meteor.call('lottoInsert', lotto, function(error, result) { if(error) { return throwError(error.reason); } if(result.lottoExists) { throwError('Lotto for this date already exists'); } Router.go('lottoPage', {_id: result._id}); }); } });
Set the date on the input box for new lotto to the next Saturday
Set the date on the input box for new lotto to the next Saturday
JavaScript
mit
jujaga/ice-lotto-meteor,charlieman/ice-lotto-meteor,charlieman/ice-lotto-meteor,jujaga/ice-lotto-meteor
javascript
## Code Before: Template.lottoAdd.created = function() { Session.set('lottoAddErrors', {}); }; Template.lottoAdd.rendered = function() { this.find('input[name=date]').valueAsDate = new Date(); }; Template.lottoAdd.helpers({ errorMessage: function(field) { return Session.get('lottoAddErrors')[field]; }, errorClass: function (field) { return !!Session.get('lottoAddErrors')[field] ? 'has-error' : ''; } }); Template.lottoAdd.events({ 'submit form': function(e) { e.preventDefault(); var lotto = { date: moment(e.target.date.value).toDate() }; if (!lotto.date) { var errors = {}; errors.date = "Please select a date"; return Session.set('lottoAddErrors', errors); } Meteor.call('lottoInsert', lotto, function(error, result) { if(error) { return throwError(error.reason); } if(result.lottoExists) { throwError('Lotto for this date already exists'); } Router.go('lottoPage', {_id: result._id}); }); } }); ## Instruction: Set the date on the input box for new lotto to the next Saturday ## Code After: Template.lottoAdd.created = function() { Session.set('lottoAddErrors', {}); }; Template.lottoAdd.rendered = function() { this.find('#date').valueAsDate = moment().day(5).toDate(); }; Template.lottoAdd.helpers({ errorMessage: function(field) { return Session.get('lottoAddErrors')[field]; }, errorClass: function (field) { return !!Session.get('lottoAddErrors')[field] ? 'has-error' : ''; } }); Template.lottoAdd.events({ 'submit form': function(e) { e.preventDefault(); var lotto = { date: moment(e.target.date.value).toDate() }; if (!lotto.date) { var errors = {}; errors.date = "Please select a date"; return Session.set('lottoAddErrors', errors); } Meteor.call('lottoInsert', lotto, function(error, result) { if(error) { return throwError(error.reason); } if(result.lottoExists) { throwError('Lotto for this date already exists'); } Router.go('lottoPage', {_id: result._id}); }); } });
Template.lottoAdd.created = function() { Session.set('lottoAddErrors', {}); }; Template.lottoAdd.rendered = function() { - this.find('input[name=date]').valueAsDate = new Date(); + this.find('#date').valueAsDate = moment().day(5).toDate(); }; Template.lottoAdd.helpers({ errorMessage: function(field) { return Session.get('lottoAddErrors')[field]; }, errorClass: function (field) { return !!Session.get('lottoAddErrors')[field] ? 'has-error' : ''; } }); Template.lottoAdd.events({ 'submit form': function(e) { e.preventDefault(); var lotto = { date: moment(e.target.date.value).toDate() }; if (!lotto.date) { var errors = {}; errors.date = "Please select a date"; return Session.set('lottoAddErrors', errors); } Meteor.call('lottoInsert', lotto, function(error, result) { if(error) { return throwError(error.reason); } if(result.lottoExists) { throwError('Lotto for this date already exists'); } Router.go('lottoPage', {_id: result._id}); }); } });
2
0.04878
1
1
8587e62d184bcc6f28988c6a25b4bbf227d85ed8
src/diskdrive.js
src/diskdrive.js
var exec = require('child_process').exec; var self = module.exports; self.eject = function(id) { // are we running on mac? if (process.platform === 'darwin') { // setup optional argument, on mac, will default to 1 id = (typeof id === 'undefined') ? 1 : id; exec('drutil tray eject ' + id, function(err, stdout, stderr) { if (err) { console.log('ERROR: DiskDrive, when executing bash cmd: ' + err); return; } // if it came here, it went all perfectly and it ejected. }); // are we running on linux? } else if (process.platform === 'linux') { // setup optional argument, on linux, will default to '' (empty string) id = (typeof id === 'undefined') ? '' : id; exec('eject ' + id, function(err, stdout, stderr) { if (err) { console.log('ERROR: DiskDrive, when executing bash cmd: ' + err); return; } // if it came here, it went all perfectly and it ejected. }); } else { console.log('ERROR: Unsupported DiskDrive platform (' + process.platform + ').'); } };
var exec = require('child_process').exec; var self = module.exports; /** * Eject the specified disk drive. * @param {int|string} id Locator for the disk drive. * @param {Function} callback Optional callback for disk drive ejection completion / error. */ self.eject = function(id, callback) { // are we running on mac? if (process.platform === 'darwin') { // setup optional argument, on mac, will default to 1 id = (typeof id === 'undefined') ? 1 : id; exec('drutil tray eject ' + id, function(err, stdout, stderr) { if (err && callback) { // error occurred and callback exists callback(err); } else if (callback) { // no error, but callback for completion callback(null); } }); // are we running on linux? } else if (process.platform === 'linux') { // setup optional argument, on linux, will default to '' (empty string) id = (typeof id === 'undefined') ? '' : id; exec('eject ' + id, function(err, stdout, stderr) { if (err && callback) { callback(err); } else if (callback) { // no error, callback for completion callback(null); } }); } else { process.nextTick(callback.bind(null, 'unsupported platform: ' + process.platform)); } };
Support for completion callback with error
Support for completion callback with error
JavaScript
mit
brendanashworth/diskdrive
javascript
## Code Before: var exec = require('child_process').exec; var self = module.exports; self.eject = function(id) { // are we running on mac? if (process.platform === 'darwin') { // setup optional argument, on mac, will default to 1 id = (typeof id === 'undefined') ? 1 : id; exec('drutil tray eject ' + id, function(err, stdout, stderr) { if (err) { console.log('ERROR: DiskDrive, when executing bash cmd: ' + err); return; } // if it came here, it went all perfectly and it ejected. }); // are we running on linux? } else if (process.platform === 'linux') { // setup optional argument, on linux, will default to '' (empty string) id = (typeof id === 'undefined') ? '' : id; exec('eject ' + id, function(err, stdout, stderr) { if (err) { console.log('ERROR: DiskDrive, when executing bash cmd: ' + err); return; } // if it came here, it went all perfectly and it ejected. }); } else { console.log('ERROR: Unsupported DiskDrive platform (' + process.platform + ').'); } }; ## Instruction: Support for completion callback with error ## Code After: var exec = require('child_process').exec; var self = module.exports; /** * Eject the specified disk drive. * @param {int|string} id Locator for the disk drive. * @param {Function} callback Optional callback for disk drive ejection completion / error. */ self.eject = function(id, callback) { // are we running on mac? if (process.platform === 'darwin') { // setup optional argument, on mac, will default to 1 id = (typeof id === 'undefined') ? 1 : id; exec('drutil tray eject ' + id, function(err, stdout, stderr) { if (err && callback) { // error occurred and callback exists callback(err); } else if (callback) { // no error, but callback for completion callback(null); } }); // are we running on linux? } else if (process.platform === 'linux') { // setup optional argument, on linux, will default to '' (empty string) id = (typeof id === 'undefined') ? '' : id; exec('eject ' + id, function(err, stdout, stderr) { if (err && callback) { callback(err); } else if (callback) { // no error, callback for completion callback(null); } }); } else { process.nextTick(callback.bind(null, 'unsupported platform: ' + process.platform)); } };
var exec = require('child_process').exec; var self = module.exports; + /** + * Eject the specified disk drive. + * @param {int|string} id Locator for the disk drive. + * @param {Function} callback Optional callback for disk drive ejection completion / error. + */ - self.eject = function(id) { + self.eject = function(id, callback) { ? ++++++++++ // are we running on mac? if (process.platform === 'darwin') { // setup optional argument, on mac, will default to 1 id = (typeof id === 'undefined') ? 1 : id; exec('drutil tray eject ' + id, function(err, stdout, stderr) { - if (err) { - console.log('ERROR: DiskDrive, when executing bash cmd: ' + err); - return; + if (err && callback) { + // error occurred and callback exists + callback(err); + } else if (callback) { + // no error, but callback for completion + callback(null); } - - // if it came here, it went all perfectly and it ejected. }); // are we running on linux? } else if (process.platform === 'linux') { // setup optional argument, on linux, will default to '' (empty string) id = (typeof id === 'undefined') ? '' : id; exec('eject ' + id, function(err, stdout, stderr) { - if (err) { - console.log('ERROR: DiskDrive, when executing bash cmd: ' + err); - return; + if (err && callback) { + callback(err); + } else if (callback) { + // no error, callback for completion + callback(null); } - - // if it came here, it went all perfectly and it ejected. }); } else { - console.log('ERROR: Unsupported DiskDrive platform (' + process.platform + ').'); + process.nextTick(callback.bind(null, 'unsupported platform: ' + process.platform)); } };
30
0.857143
18
12
92014e92af1929dc2a9c54fb1e28f63404fbec6c
composer.json
composer.json
{ "name": "prevostc/goalio-rememberme", "description": "Adding Remember Me functionalitiy to ZfcUser", "type": "library", "license": "BSD-3-Clause", "keywords": [ "zf2", "zfcuser" ], "homepage": "https://github.com/prevostc/GoalioRememberMe", "require": { "zf-commons/zfc-user": "1.*" }, "autoload": { "psr-0": { "GoalioRememberMe": "src/" }, "classmap": [ "./Module.php" ] } }
{ "name": "goalio/goalio-rememberme", "description": "Adding Remember Me functionalitiy to ZfcUser", "type": "library", "license": "BSD-3-Clause", "keywords": [ "zf2", "zfcuser" ], "homepage": "https://github.com/goalio/GoalioRememberMe", "authors": [ { "name": "Philipp Dobrigkeit", "email": "p.dobrigkeit@goalio.de", "homepage": "http://www.goalio.de" } ], "require": { "zf-commons/zfc-user": "1.*" }, "autoload": { "psr-0": { "GoalioRememberMe": "src/" }, "classmap": [ "./Module.php" ] } }
Revert "Add package to packagist"
Revert "Add package to packagist" This reverts commit 8811e23ac2cf644a9f600f1defba1c0bc28fcc80.
JSON
bsd-3-clause
goalio/GoalioRememberMe,goalio/GoalioRememberMe
json
## Code Before: { "name": "prevostc/goalio-rememberme", "description": "Adding Remember Me functionalitiy to ZfcUser", "type": "library", "license": "BSD-3-Clause", "keywords": [ "zf2", "zfcuser" ], "homepage": "https://github.com/prevostc/GoalioRememberMe", "require": { "zf-commons/zfc-user": "1.*" }, "autoload": { "psr-0": { "GoalioRememberMe": "src/" }, "classmap": [ "./Module.php" ] } } ## Instruction: Revert "Add package to packagist" This reverts commit 8811e23ac2cf644a9f600f1defba1c0bc28fcc80. ## Code After: { "name": "goalio/goalio-rememberme", "description": "Adding Remember Me functionalitiy to ZfcUser", "type": "library", "license": "BSD-3-Clause", "keywords": [ "zf2", "zfcuser" ], "homepage": "https://github.com/goalio/GoalioRememberMe", "authors": [ { "name": "Philipp Dobrigkeit", "email": "p.dobrigkeit@goalio.de", "homepage": "http://www.goalio.de" } ], "require": { "zf-commons/zfc-user": "1.*" }, "autoload": { "psr-0": { "GoalioRememberMe": "src/" }, "classmap": [ "./Module.php" ] } }
{ - "name": "prevostc/goalio-rememberme", ? ^^^^ ^^^ + "name": "goalio/goalio-rememberme", ? ^ ^^^^ "description": "Adding Remember Me functionalitiy to ZfcUser", "type": "library", "license": "BSD-3-Clause", "keywords": [ "zf2", "zfcuser" ], - "homepage": "https://github.com/prevostc/GoalioRememberMe", ? ^^^^ ^^^ + "homepage": "https://github.com/goalio/GoalioRememberMe", ? ^ ^^^^ + "authors": [ + { + "name": "Philipp Dobrigkeit", + "email": "p.dobrigkeit@goalio.de", + "homepage": "http://www.goalio.de" + } + ], "require": { "zf-commons/zfc-user": "1.*" }, "autoload": { "psr-0": { "GoalioRememberMe": "src/" }, "classmap": [ "./Module.php" ] } }
11
0.5
9
2
769f69a05366f37150e5b94240eb60586f162f19
imports/api/database-controller/graduation-requirement/graduationRequirement.js
imports/api/database-controller/graduation-requirement/graduationRequirement.js
import { mongo } from 'meteor/mongo'; import { SimpleSchema } from 'meteor/aldeed:simple-schema'; class GraduationRequirementCollection extends Mongo.Collection {} const GraduationRequirements = new GraduationRequirementCollection('gradiationRequirement'); const gradRequirementSchema = { requirementName: { type: String }, requirementModules: { type: [object], optional: true } } GraduationRequirements.attachSchema(gradRequirementSchema);
import { mongo } from 'meteor/mongo'; import { SimpleSchema } from 'meteor/aldeed:simple-schema'; /// This Component handles the initialization of the graduation requirement collection /// requirementModule should be in he following format : /// module code: boolean true/false /// e.g : CS1231: false /// the boolean is to indicate in the logic section if the following module requirement has been fulfilled class GraduationRequirementCollection extends Mongo.Collection {} const GraduationRequirements = new GraduationRequirementCollection('graduationRequirement'); const gradRequirementSchema = { requirementName: { type: String }, requirementModules: { type: [Object], optional: true } } GraduationRequirements.attachSchema(gradRequirementSchema);
ADD collection description to the graduation Requirement database
ADD collection description to the graduation Requirement database
JavaScript
mit
nus-mtp/nus-oracle,nus-mtp/nus-oracle
javascript
## Code Before: import { mongo } from 'meteor/mongo'; import { SimpleSchema } from 'meteor/aldeed:simple-schema'; class GraduationRequirementCollection extends Mongo.Collection {} const GraduationRequirements = new GraduationRequirementCollection('gradiationRequirement'); const gradRequirementSchema = { requirementName: { type: String }, requirementModules: { type: [object], optional: true } } GraduationRequirements.attachSchema(gradRequirementSchema); ## Instruction: ADD collection description to the graduation Requirement database ## Code After: import { mongo } from 'meteor/mongo'; import { SimpleSchema } from 'meteor/aldeed:simple-schema'; /// This Component handles the initialization of the graduation requirement collection /// requirementModule should be in he following format : /// module code: boolean true/false /// e.g : CS1231: false /// the boolean is to indicate in the logic section if the following module requirement has been fulfilled class GraduationRequirementCollection extends Mongo.Collection {} const GraduationRequirements = new GraduationRequirementCollection('graduationRequirement'); const gradRequirementSchema = { requirementName: { type: String }, requirementModules: { type: [Object], optional: true } } GraduationRequirements.attachSchema(gradRequirementSchema);
import { mongo } from 'meteor/mongo'; import { SimpleSchema } from 'meteor/aldeed:simple-schema'; + /// This Component handles the initialization of the graduation requirement collection + /// requirementModule should be in he following format : + /// module code: boolean true/false + /// e.g : CS1231: false + /// the boolean is to indicate in the logic section if the following module requirement has been fulfilled + class GraduationRequirementCollection extends Mongo.Collection {} - const GraduationRequirements = new GraduationRequirementCollection('gradiationRequirement'); ? ^ + const GraduationRequirements = new GraduationRequirementCollection('graduationRequirement'); ? ^ const gradRequirementSchema = { requirementName: { type: String }, requirementModules: { - type: [object], ? ^ + type: [Object], ? ^ optional: true } } GraduationRequirements.attachSchema(gradRequirementSchema);
10
0.555556
8
2
aa7d5a843067c752b26e5d74473756afacfe467d
tests/data/images/README_smell.md
tests/data/images/README_smell.md
Figures showing a subset of GO terms related to 'smell.' * [**'Smell' GO terms without relationships loaded**](#smell-go-terms-without-relationships-loaded) % go_plot --obo=tests/data/smell.obo -o tests/data/images/smell_r0.png * [**'Smell' GO terms with relationships loaded**](#smell-go-terms-with-relationships-loaded) % go_plot --obo=tests/data/smell.obo -o tests/data/images/smell_r1.png -r ## 'Smell' GO terms without relationships loaded % go_plot --obo=tests/data/smell.obo -o tests/data/images/smell_r0.png ![smell without relationships](smell_r0.png) ## 'Smell' GO terms with relationships loaded % go_plot --obo=tests/data/smell.obo -o tests/data/images/smell_r1.png -r ![smell with relationships](smell_r1.png) Copyright (C) 2010-2018. Haibao Tang et al. All rights reserved.
Figures showing a subset of GO terms related to 'smell.' * [**'Smell' GO terms without relationships loaded**](#smell-go-terms-without-relationships-loaded) % go_plot --obo=tests/data/smell.obo -o tests/data/images/smell_r0.png * [**'Smell' GO terms with relationships loaded**](#smell-go-terms-with-relationships-loaded) % go_plot --obo=tests/data/smell.obo -o tests/data/images/smell_r1.png -r ## 'Smell' GO terms without relationships loaded % go_plot --obo=tests/data/smell.obo -o tests/data/images/smell_r0.png ![smell without relationships](smell_r0.png) ## 'Smell' GO terms with relationships loaded % go_plot --obo=tests/data/smell.obo -o tests/data/images/smell_r1.png -r | Color | relationship | |---------|----------------------| |magenta | part_of | |purple | regulates | |red | positively regulates | |blue | negatively regulates | ![smell with relationships](smell_r1.png) Copyright (C) 2010-2018. Haibao Tang et al. All rights reserved.
Add color key for relationships
Add color key for relationships
Markdown
bsd-2-clause
tanghaibao/goatools,tanghaibao/goatools
markdown
## Code Before: Figures showing a subset of GO terms related to 'smell.' * [**'Smell' GO terms without relationships loaded**](#smell-go-terms-without-relationships-loaded) % go_plot --obo=tests/data/smell.obo -o tests/data/images/smell_r0.png * [**'Smell' GO terms with relationships loaded**](#smell-go-terms-with-relationships-loaded) % go_plot --obo=tests/data/smell.obo -o tests/data/images/smell_r1.png -r ## 'Smell' GO terms without relationships loaded % go_plot --obo=tests/data/smell.obo -o tests/data/images/smell_r0.png ![smell without relationships](smell_r0.png) ## 'Smell' GO terms with relationships loaded % go_plot --obo=tests/data/smell.obo -o tests/data/images/smell_r1.png -r ![smell with relationships](smell_r1.png) Copyright (C) 2010-2018. Haibao Tang et al. All rights reserved. ## Instruction: Add color key for relationships ## Code After: Figures showing a subset of GO terms related to 'smell.' * [**'Smell' GO terms without relationships loaded**](#smell-go-terms-without-relationships-loaded) % go_plot --obo=tests/data/smell.obo -o tests/data/images/smell_r0.png * [**'Smell' GO terms with relationships loaded**](#smell-go-terms-with-relationships-loaded) % go_plot --obo=tests/data/smell.obo -o tests/data/images/smell_r1.png -r ## 'Smell' GO terms without relationships loaded % go_plot --obo=tests/data/smell.obo -o tests/data/images/smell_r0.png ![smell without relationships](smell_r0.png) ## 'Smell' GO terms with relationships loaded % go_plot --obo=tests/data/smell.obo -o tests/data/images/smell_r1.png -r | Color | relationship | |---------|----------------------| |magenta | part_of | |purple | regulates | |red | positively regulates | |blue | negatively regulates | ![smell with relationships](smell_r1.png) Copyright (C) 2010-2018. Haibao Tang et al. All rights reserved.
Figures showing a subset of GO terms related to 'smell.' * [**'Smell' GO terms without relationships loaded**](#smell-go-terms-without-relationships-loaded) % go_plot --obo=tests/data/smell.obo -o tests/data/images/smell_r0.png * [**'Smell' GO terms with relationships loaded**](#smell-go-terms-with-relationships-loaded) % go_plot --obo=tests/data/smell.obo -o tests/data/images/smell_r1.png -r ## 'Smell' GO terms without relationships loaded % go_plot --obo=tests/data/smell.obo -o tests/data/images/smell_r0.png ![smell without relationships](smell_r0.png) ## 'Smell' GO terms with relationships loaded % go_plot --obo=tests/data/smell.obo -o tests/data/images/smell_r1.png -r + + | Color | relationship | + |---------|----------------------| + |magenta | part_of | + |purple | regulates | + |red | positively regulates | + |blue | negatively regulates | + ![smell with relationships](smell_r1.png) Copyright (C) 2010-2018. Haibao Tang et al. All rights reserved.
8
0.444444
8
0
298c54b0e0ae32ec2c6674fee8b60d2fefa4ae7e
lock_file_darwin.go
lock_file_darwin.go
// +build darwin package daemon /* #define __DARWIN_UNIX03 0 #define KERNEL #define _DARWIN_USE_64_BIT_INODE #include <dirent.h> #include <fcntl.h> #include <sys/param.h> */ import "C" import ( "syscall" "unsafe" ) func lockFile(fd uintptr) error { err := syscall.Flock(int(fd), syscall.LOCK_EX|syscall.LOCK_NB) if err == syscall.EWOULDBLOCK { err = ErrWouldBlock } return err } func unlockFile(fd uintptr) error { err := syscall.Flock(int(fd), syscall.LOCK_UN) if err == syscall.EWOULDBLOCK { err = ErrWouldBlock } return err } func getFdName(fd uintptr) (name string, err error) { buf := make([]C.char, int(C.MAXPATHLEN)+1) _, _, errno := syscall.Syscall(syscall.SYS_FCNTL, fd, syscall.F_GETPATH, uintptr(unsafe.Pointer(&buf[0]))) if errno == 0 { return C.GoString(&buf[0]), nil } return "", errno }
// +build darwin package daemon import ( "syscall" "unsafe" ) import "C" // darwin's MAXPATHLEN const maxpathlen = 1024 func lockFile(fd uintptr) error { err := syscall.Flock(int(fd), syscall.LOCK_EX|syscall.LOCK_NB) if err == syscall.EWOULDBLOCK { err = ErrWouldBlock } return err } func unlockFile(fd uintptr) error { err := syscall.Flock(int(fd), syscall.LOCK_UN) if err == syscall.EWOULDBLOCK { err = ErrWouldBlock } return err } func getFdName(fd uintptr) (name string, err error) { buf := make([]C.char, maxpathlen+1) _, _, errno := syscall.Syscall(syscall.SYS_FCNTL, fd, syscall.F_GETPATH, uintptr(unsafe.Pointer(&buf[0]))) if errno == 0 { return C.GoString(&buf[0]), nil } return "", errno }
Remove unused imports of .h files from implementaion for darwin
Remove unused imports of .h files from implementaion for darwin
Go
mit
sevlyar/go-daemon
go
## Code Before: // +build darwin package daemon /* #define __DARWIN_UNIX03 0 #define KERNEL #define _DARWIN_USE_64_BIT_INODE #include <dirent.h> #include <fcntl.h> #include <sys/param.h> */ import "C" import ( "syscall" "unsafe" ) func lockFile(fd uintptr) error { err := syscall.Flock(int(fd), syscall.LOCK_EX|syscall.LOCK_NB) if err == syscall.EWOULDBLOCK { err = ErrWouldBlock } return err } func unlockFile(fd uintptr) error { err := syscall.Flock(int(fd), syscall.LOCK_UN) if err == syscall.EWOULDBLOCK { err = ErrWouldBlock } return err } func getFdName(fd uintptr) (name string, err error) { buf := make([]C.char, int(C.MAXPATHLEN)+1) _, _, errno := syscall.Syscall(syscall.SYS_FCNTL, fd, syscall.F_GETPATH, uintptr(unsafe.Pointer(&buf[0]))) if errno == 0 { return C.GoString(&buf[0]), nil } return "", errno } ## Instruction: Remove unused imports of .h files from implementaion for darwin ## Code After: // +build darwin package daemon import ( "syscall" "unsafe" ) import "C" // darwin's MAXPATHLEN const maxpathlen = 1024 func lockFile(fd uintptr) error { err := syscall.Flock(int(fd), syscall.LOCK_EX|syscall.LOCK_NB) if err == syscall.EWOULDBLOCK { err = ErrWouldBlock } return err } func unlockFile(fd uintptr) error { err := syscall.Flock(int(fd), syscall.LOCK_UN) if err == syscall.EWOULDBLOCK { err = ErrWouldBlock } return err } func getFdName(fd uintptr) (name string, err error) { buf := make([]C.char, maxpathlen+1) _, _, errno := syscall.Syscall(syscall.SYS_FCNTL, fd, syscall.F_GETPATH, uintptr(unsafe.Pointer(&buf[0]))) if errno == 0 { return C.GoString(&buf[0]), nil } return "", errno }
// +build darwin package daemon - - /* - #define __DARWIN_UNIX03 0 - #define KERNEL - #define _DARWIN_USE_64_BIT_INODE - #include <dirent.h> - #include <fcntl.h> - #include <sys/param.h> - */ - import "C" import ( "syscall" "unsafe" ) + + import "C" + + // darwin's MAXPATHLEN + const maxpathlen = 1024 func lockFile(fd uintptr) error { err := syscall.Flock(int(fd), syscall.LOCK_EX|syscall.LOCK_NB) if err == syscall.EWOULDBLOCK { err = ErrWouldBlock } return err } func unlockFile(fd uintptr) error { err := syscall.Flock(int(fd), syscall.LOCK_UN) if err == syscall.EWOULDBLOCK { err = ErrWouldBlock } return err } func getFdName(fd uintptr) (name string, err error) { - buf := make([]C.char, int(C.MAXPATHLEN)+1) + buf := make([]C.char, maxpathlen+1) _, _, errno := syscall.Syscall(syscall.SYS_FCNTL, fd, syscall.F_GETPATH, uintptr(unsafe.Pointer(&buf[0]))) if errno == 0 { return C.GoString(&buf[0]), nil } return "", errno }
17
0.395349
6
11
2380a674fa806c85a90f0d7c68c9b252c257243f
README.md
README.md
Clone this repo or [download the zip file from Github](https://github.com/worona/worona/archive/master.zip). ```bash git clone https://github.com/worona/worona.git cd worona ``` ---- [**Install Node**](https://nodejs.org/en/) if you haven't installed it yet. We recommend v4. ---- [**Install Meteor**](https://www.meteor.com/install) if you haven't installed it yet: ```bash curl https://install.meteor.com/ | sh ``` ---- Run `npm run install:all` to install all dependencies. It may take quite a while. Don't despair. ```bash npm run install:all ``` ## Development Run the dashboard client. ```bash cd dashboard/client npm start ``` Open another terminal and run the tests watcher. ```bash npm test ``` Open another terminal and run the dashboard server. ```bash cd dahsboard/server npm start ``` ---
Clone this repo or [download the zip file from Github](https://github.com/worona/worona/archive/master.zip). ```bash git clone https://github.com/worona/worona.git cd worona ``` ---- [**Install Node**](https://nodejs.org/en/) if you haven't installed it yet. We recommend v4. ---- [**Install Meteor**](https://www.meteor.com/install) if you haven't installed it yet: ```bash curl https://install.meteor.com/ | sh ``` ---- Run `npm run install:all` to install all dependencies. It may take quite a while. Don't despair. ```bash npm install # do this first to install recuersive-install npm run install:all ``` ## Development Run the dashboard client. ```bash cd dashboard/client npm start ``` Open another terminal and run the tests watcher. ```bash npm test ``` Open another terminal and run the dashboard server. ```bash cd dahsboard/server npm start ``` ---
Add nam install instructions to docs.
Add nam install instructions to docs.
Markdown
mit
worona/worona-dashboard,worona/worona,worona/worona-core,worona/worona-dashboard,worona/worona-core,worona/worona,worona/worona
markdown
## Code Before: Clone this repo or [download the zip file from Github](https://github.com/worona/worona/archive/master.zip). ```bash git clone https://github.com/worona/worona.git cd worona ``` ---- [**Install Node**](https://nodejs.org/en/) if you haven't installed it yet. We recommend v4. ---- [**Install Meteor**](https://www.meteor.com/install) if you haven't installed it yet: ```bash curl https://install.meteor.com/ | sh ``` ---- Run `npm run install:all` to install all dependencies. It may take quite a while. Don't despair. ```bash npm run install:all ``` ## Development Run the dashboard client. ```bash cd dashboard/client npm start ``` Open another terminal and run the tests watcher. ```bash npm test ``` Open another terminal and run the dashboard server. ```bash cd dahsboard/server npm start ``` --- ## Instruction: Add nam install instructions to docs. ## Code After: Clone this repo or [download the zip file from Github](https://github.com/worona/worona/archive/master.zip). ```bash git clone https://github.com/worona/worona.git cd worona ``` ---- [**Install Node**](https://nodejs.org/en/) if you haven't installed it yet. We recommend v4. ---- [**Install Meteor**](https://www.meteor.com/install) if you haven't installed it yet: ```bash curl https://install.meteor.com/ | sh ``` ---- Run `npm run install:all` to install all dependencies. It may take quite a while. Don't despair. ```bash npm install # do this first to install recuersive-install npm run install:all ``` ## Development Run the dashboard client. ```bash cd dashboard/client npm start ``` Open another terminal and run the tests watcher. ```bash npm test ``` Open another terminal and run the dashboard server. ```bash cd dahsboard/server npm start ``` ---
Clone this repo or [download the zip file from Github](https://github.com/worona/worona/archive/master.zip). ```bash git clone https://github.com/worona/worona.git cd worona ``` ---- [**Install Node**](https://nodejs.org/en/) if you haven't installed it yet. We recommend v4. ---- [**Install Meteor**](https://www.meteor.com/install) if you haven't installed it yet: ```bash curl https://install.meteor.com/ | sh ``` ---- Run `npm run install:all` to install all dependencies. It may take quite a while. Don't despair. ```bash + npm install # do this first to install recuersive-install npm run install:all ``` ## Development Run the dashboard client. ```bash cd dashboard/client npm start ``` Open another terminal and run the tests watcher. ```bash npm test ``` Open another terminal and run the dashboard server. ```bash cd dahsboard/server npm start ``` ---
1
0.019608
1
0
f25bb0821a8b567136ae8dc9530473b3e841db00
README.md
README.md
tomayto or tomahto Pomodoro bot for Telegram. ## Usage - /go - Start a pomodoro session - /check - Check remaining time for the current session - /count - Show how many sessions do you have - /cancel - Stop this session ![telegram screenshot](https://raw.githubusercontent.com/heycalmdown/clj-tomato-bot/master/doc/sceenshot.png =480x) ## Features - Can have a pomodoro session in a Telegram messenger - Notify the current state of the session - Support multiple devices - Show remaining time on the fly ## Not featured yet - Sharing a pomodoro session with your friend - Stack-based task management ## License Copyright © 2016 Kei Son Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.
tomayto or tomahto Pomodoro bot for Telegram. ## Usage - /go - Start a pomodoro session - /check - Check remaining time for the current session - /count - Show how many sessions do you have - /cancel - Stop this session <img alt="telegram screenshot" src="https://raw.githubusercontent.com/heycalmdown/clj-tomato-bot/master/doc/sceenshot.png" width="480px"> ## Features - Can have a pomodoro session in a Telegram messenger - Notify the current state of the session - Support multiple devices - Show remaining time on the fly ## Not featured yet - Sharing a pomodoro session with your friend - Stack-based task management ## License Copyright © 2016 Kei Son Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.
Fix that github doesn't support =123x to resize image
Fix that github doesn't support =123x to resize image
Markdown
epl-1.0
heycalmdown/clj-tomato-bot
markdown
## Code Before: tomayto or tomahto Pomodoro bot for Telegram. ## Usage - /go - Start a pomodoro session - /check - Check remaining time for the current session - /count - Show how many sessions do you have - /cancel - Stop this session ![telegram screenshot](https://raw.githubusercontent.com/heycalmdown/clj-tomato-bot/master/doc/sceenshot.png =480x) ## Features - Can have a pomodoro session in a Telegram messenger - Notify the current state of the session - Support multiple devices - Show remaining time on the fly ## Not featured yet - Sharing a pomodoro session with your friend - Stack-based task management ## License Copyright © 2016 Kei Son Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version. ## Instruction: Fix that github doesn't support =123x to resize image ## Code After: tomayto or tomahto Pomodoro bot for Telegram. ## Usage - /go - Start a pomodoro session - /check - Check remaining time for the current session - /count - Show how many sessions do you have - /cancel - Stop this session <img alt="telegram screenshot" src="https://raw.githubusercontent.com/heycalmdown/clj-tomato-bot/master/doc/sceenshot.png" width="480px"> ## Features - Can have a pomodoro session in a Telegram messenger - Notify the current state of the session - Support multiple devices - Show remaining time on the fly ## Not featured yet - Sharing a pomodoro session with your friend - Stack-based task management ## License Copyright © 2016 Kei Son Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.
tomayto or tomahto Pomodoro bot for Telegram. ## Usage - /go - Start a pomodoro session - /check - Check remaining time for the current session - /count - Show how many sessions do you have - /cancel - Stop this session - - ![telegram screenshot](https://raw.githubusercontent.com/heycalmdown/clj-tomato-bot/master/doc/sceenshot.png =480x) ? ^^ ^^ ^ + <img alt="telegram screenshot" src="https://raw.githubusercontent.com/heycalmdown/clj-tomato-bot/master/doc/sceenshot.png" width="480px"> ? ^^^^^^^^^^ ^^^^^^^ + +++++ + + ^^ ## Features - Can have a pomodoro session in a Telegram messenger - Notify the current state of the session - Support multiple devices - Show remaining time on the fly ## Not featured yet - Sharing a pomodoro session with your friend - Stack-based task management ## License Copyright © 2016 Kei Son Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.
3
0.085714
1
2
687592754a80397e4e44585f232e76b7d3360780
pod_manager/db.py
pod_manager/db.py
import redis from pod_manager.settings import REDIS_HOST, REDIS_PORT, REDIS_DB def get_client(): client = redis.Redis(host=REDIS_HOST, port=REDIS_PORT, db=REDIS_DB) return client
import pickle import redis from pod_manager.settings import REDIS_HOST, REDIS_PORT, REDIS_DB __all__ = [ 'get_client', 'cache_object', 'get_object' ] def get_client(): client = redis.Redis(host=REDIS_HOST, port=REDIS_PORT, db=REDIS_DB) return client def cache_object(client, key, obj, ttl=60): pipe = client.pipeline() data = pickle.dumps(obj) pipe.set(key, data) if ttl: pipe.expire(key, ttl) pipe.execute() def get_object(client, key): data = client.get(key) if not data: return None obj = pickle.loads(data) return obj
Add cache_object and get_object functions.
Add cache_object and get_object functions.
Python
apache-2.0
racker/pod-manager
python
## Code Before: import redis from pod_manager.settings import REDIS_HOST, REDIS_PORT, REDIS_DB def get_client(): client = redis.Redis(host=REDIS_HOST, port=REDIS_PORT, db=REDIS_DB) return client ## Instruction: Add cache_object and get_object functions. ## Code After: import pickle import redis from pod_manager.settings import REDIS_HOST, REDIS_PORT, REDIS_DB __all__ = [ 'get_client', 'cache_object', 'get_object' ] def get_client(): client = redis.Redis(host=REDIS_HOST, port=REDIS_PORT, db=REDIS_DB) return client def cache_object(client, key, obj, ttl=60): pipe = client.pipeline() data = pickle.dumps(obj) pipe.set(key, data) if ttl: pipe.expire(key, ttl) pipe.execute() def get_object(client, key): data = client.get(key) if not data: return None obj = pickle.loads(data) return obj
+ import pickle import redis from pod_manager.settings import REDIS_HOST, REDIS_PORT, REDIS_DB + __all__ = [ + 'get_client', + 'cache_object', + 'get_object' + ] + def get_client(): client = redis.Redis(host=REDIS_HOST, port=REDIS_PORT, db=REDIS_DB) return client + + def cache_object(client, key, obj, ttl=60): + pipe = client.pipeline() + data = pickle.dumps(obj) + pipe.set(key, data) + + if ttl: + pipe.expire(key, ttl) + + pipe.execute() + + def get_object(client, key): + data = client.get(key) + + if not data: + return None + + obj = pickle.loads(data) + return obj
26
3.714286
26
0
0141340d2abddc954ea4388fe31629d98189632c
tests/test_exceptions.py
tests/test_exceptions.py
from marshmallow.exceptions import ValidationError class TestValidationError: def test_stores_message_in_list(self): err = ValidationError('foo') assert err.messages == ['foo'] def test_can_pass_list_of_messages(self): err = ValidationError(['foo', 'bar']) assert err.messages == ['foo', 'bar']
from marshmallow.exceptions import ValidationError class TestValidationError: def test_stores_message_in_list(self): err = ValidationError('foo') assert err.messages == ['foo'] def test_can_pass_list_of_messages(self): err = ValidationError(['foo', 'bar']) assert err.messages == ['foo', 'bar'] def test_stores_dictionaries(self): messages = {'user': {'email': ['email is invalid']}} err = ValidationError(messages) assert err.messages == messages
Add test for storing dictionaries on ValidationError
Add test for storing dictionaries on ValidationError
Python
mit
0xDCA/marshmallow,Bachmann1234/marshmallow,xLegoz/marshmallow,bartaelterman/marshmallow,VladimirPal/marshmallow,daniloakamine/marshmallow,mwstobo/marshmallow,dwieeb/marshmallow,etataurov/marshmallow,maximkulkin/marshmallow,marshmallow-code/marshmallow,0xDCA/marshmallow,quxiaolong1504/marshmallow,Tim-Erwin/marshmallow
python
## Code Before: from marshmallow.exceptions import ValidationError class TestValidationError: def test_stores_message_in_list(self): err = ValidationError('foo') assert err.messages == ['foo'] def test_can_pass_list_of_messages(self): err = ValidationError(['foo', 'bar']) assert err.messages == ['foo', 'bar'] ## Instruction: Add test for storing dictionaries on ValidationError ## Code After: from marshmallow.exceptions import ValidationError class TestValidationError: def test_stores_message_in_list(self): err = ValidationError('foo') assert err.messages == ['foo'] def test_can_pass_list_of_messages(self): err = ValidationError(['foo', 'bar']) assert err.messages == ['foo', 'bar'] def test_stores_dictionaries(self): messages = {'user': {'email': ['email is invalid']}} err = ValidationError(messages) assert err.messages == messages
from marshmallow.exceptions import ValidationError class TestValidationError: def test_stores_message_in_list(self): err = ValidationError('foo') assert err.messages == ['foo'] def test_can_pass_list_of_messages(self): err = ValidationError(['foo', 'bar']) assert err.messages == ['foo', 'bar'] + + def test_stores_dictionaries(self): + messages = {'user': {'email': ['email is invalid']}} + err = ValidationError(messages) + assert err.messages == messages
5
0.416667
5
0
aef8f710022c0a727a26e5b0fb966c12bcd3f9ec
.github/ISSUE_TEMPLATE.md
.github/ISSUE_TEMPLATE.md
**Have you read the [FAQ](https://goo.gl/JE1Sy5) and checked for duplicate issues**: **What version of Shaka Player are you using**: **Can you reproduce the issue with our latest release version**: **Can you reproduce the issue with the latest code from `master`**: **Are you using the demo app or your own custom app**: **If custom app, can you reproduce the issue using our demo app**: **What browser and OS are you using**: **What are the manifest and license server URIs**: *(you can send the URIs to <shaka-player-issues@google.com> instead, but please use GitHub and the template for the rest)* **What did you do?** **What did you expect to happen?** **What actually happened?**
**Have you read the [FAQ](https://goo.gl/JE1Sy5) and checked for duplicate open issues?**: **What version of Shaka Player are you using?**: **Can you reproduce the issue with our latest release version?**: **Can you reproduce the issue with the latest code from `master`?**: **Are you using the demo app or your own custom app?**: **If custom app, can you reproduce the issue using our demo app?**: **What browser and OS are you using?**: **What are the manifest and license server URIs?**: *(NOTE: you can send the URIs to <shaka-player-issues@google.com> instead, but please use GitHub and the template for the rest)* *(NOTE: a copy of the manifest text or an attached manifest will **not** be enough to reproduce your issue, and we **will** ask you to send a URI instead)* **What did you do?** **What did you expect to happen?** **What actually happened?**
Update the issue template with stricter wording
Update the issue template with stricter wording Many people either ignore the template or fail to send us the URIs we need for repro. This adds language making it clear what we need. Change-Id: I4da8d0dd7d7a203e71e5cc6c55b99e2f27e8d642
Markdown
apache-2.0
shaka-project/shaka-player,vimond/shaka-player,shaka-project/shaka-player,TheModMaker/shaka-player,tvoli/shaka-player,vimond/shaka-player,vimond/shaka-player,tvoli/shaka-player,shaka-project/shaka-player,TheModMaker/shaka-player,tvoli/shaka-player,TheModMaker/shaka-player,tvoli/shaka-player,TheModMaker/shaka-player,shaka-project/shaka-player
markdown
## Code Before: **Have you read the [FAQ](https://goo.gl/JE1Sy5) and checked for duplicate issues**: **What version of Shaka Player are you using**: **Can you reproduce the issue with our latest release version**: **Can you reproduce the issue with the latest code from `master`**: **Are you using the demo app or your own custom app**: **If custom app, can you reproduce the issue using our demo app**: **What browser and OS are you using**: **What are the manifest and license server URIs**: *(you can send the URIs to <shaka-player-issues@google.com> instead, but please use GitHub and the template for the rest)* **What did you do?** **What did you expect to happen?** **What actually happened?** ## Instruction: Update the issue template with stricter wording Many people either ignore the template or fail to send us the URIs we need for repro. This adds language making it clear what we need. Change-Id: I4da8d0dd7d7a203e71e5cc6c55b99e2f27e8d642 ## Code After: **Have you read the [FAQ](https://goo.gl/JE1Sy5) and checked for duplicate open issues?**: **What version of Shaka Player are you using?**: **Can you reproduce the issue with our latest release version?**: **Can you reproduce the issue with the latest code from `master`?**: **Are you using the demo app or your own custom app?**: **If custom app, can you reproduce the issue using our demo app?**: **What browser and OS are you using?**: **What are the manifest and license server URIs?**: *(NOTE: you can send the URIs to <shaka-player-issues@google.com> instead, but please use GitHub and the template for the rest)* *(NOTE: a copy of the manifest text or an attached manifest will **not** be enough to reproduce your issue, and we **will** ask you to send a URI instead)* **What did you do?** **What did you expect to happen?** **What actually happened?**
- **Have you read the [FAQ](https://goo.gl/JE1Sy5) and checked for duplicate issues**: - **What version of Shaka Player are you using**: + **Have you read the [FAQ](https://goo.gl/JE1Sy5) and checked for duplicate open issues?**: - **Can you reproduce the issue with our latest release version**: + **What version of Shaka Player are you using?**: - **Can you reproduce the issue with the latest code from `master`**: ? ^^^ ^^^ ^^^^^^^^^^ ^ + **Can you reproduce the issue with our latest release version?**: ? ^^^ ^^^^^^ ^ ^^^^^ - **Are you using the demo app or your own custom app**: + **Can you reproduce the issue with the latest code from `master`?**: - **If custom app, can you reproduce the issue using our demo app**: + **Are you using the demo app or your own custom app?**: - **What browser and OS are you using**: + **If custom app, can you reproduce the issue using our demo app?**: + **What browser and OS are you using?**: - **What are the manifest and license server URIs**: - *(you can send the URIs to <shaka-player-issues@google.com> instead, but please use GitHub and the template for the rest)* + **What are the manifest and license server URIs?**: + *(NOTE: you can send the URIs to <shaka-player-issues@google.com> instead, but please use GitHub and the template for the rest)* + *(NOTE: a copy of the manifest text or an attached manifest will **not** be enough to reproduce your issue, and we **will** ask you to send a URI instead)* **What did you do?** - **What did you expect to happen?** - **What actually happened?**
21
0.807692
10
11
1afcc0363e2d1787f46c5ade0ef3224885211eb0
app/views/transfers/index.html.erb
app/views/transfers/index.html.erb
<div class='container-fluid transfer'> <div class='col-md-2'></div> <div class='col-md-8'> <div class='info'> <div class='col-md-12'> <h1>History</h1> </div> <% @transfers.each do |transfer| %> <hr> <div class='col-md-12'> <h3>From</h3> <p><%= transfer.outgoing_account.user.name %></p> </div> <div class='col-md-12'> <h3>To</h3> <p><%= transfer.incoming_account.user.name %></p> </div> <div class='col-md-4'> <h3>Amount</h3> <p><%= transfer.amount %></p> </div> <div class='col-md-8'> <h3>Created On</h3> <p><%= transfer.created_at %></p> </div> <% end %> <hr> <div class='col-md-12'> <p> <%= link_to 'Go Back to Your Account', account_path(current_user.account), class: 'btn btn-default' %> </p> </div> </div> </div> </div> <div class='col-md-2'></div> </div>
<div class='container-fluid transfer'> <div class='col-md-2'></div> <div class='col-md-8'> <div class='info'> <div class='col-md-12'> <h1>History</h1> </div> <% if @transfers.empty? %> <hr> <h3>There are no transfers yet. To transfer funds, click <%= link_to 'here', new_transfer_path %>.</h3> <% else %> <% @transfers.each do |transfer| %> <hr> <div class='col-md-12'> <h3>From</h3> <p><%= transfer.outgoing_account.user.name %></p> </div> <div class='col-md-12'> <h3>To</h3> <p><%= transfer.incoming_account.user.name %></p> </div> <div class='col-md-4'> <h3>Amount</h3> <p><%= transfer.amount %></p> </div> <div class='col-md-8'> <h3>Created On</h3> <p><%= transfer.created_at %></p> </div> <% end %> <% end %> <hr> <div class='col-md-12'> <p> <%= link_to 'Go Back to Your Account', account_path(current_user.account), class: 'btn btn-default' %> </p> </div> </div> </div> </div> <div class='col-md-2'></div> </div>
Fix history message when there are no transfers
Fix history message when there are no transfers
HTML+ERB
mit
turingschool-examples/urbank,turingschool-examples/urbank,turingschool-examples/urbank
html+erb
## Code Before: <div class='container-fluid transfer'> <div class='col-md-2'></div> <div class='col-md-8'> <div class='info'> <div class='col-md-12'> <h1>History</h1> </div> <% @transfers.each do |transfer| %> <hr> <div class='col-md-12'> <h3>From</h3> <p><%= transfer.outgoing_account.user.name %></p> </div> <div class='col-md-12'> <h3>To</h3> <p><%= transfer.incoming_account.user.name %></p> </div> <div class='col-md-4'> <h3>Amount</h3> <p><%= transfer.amount %></p> </div> <div class='col-md-8'> <h3>Created On</h3> <p><%= transfer.created_at %></p> </div> <% end %> <hr> <div class='col-md-12'> <p> <%= link_to 'Go Back to Your Account', account_path(current_user.account), class: 'btn btn-default' %> </p> </div> </div> </div> </div> <div class='col-md-2'></div> </div> ## Instruction: Fix history message when there are no transfers ## Code After: <div class='container-fluid transfer'> <div class='col-md-2'></div> <div class='col-md-8'> <div class='info'> <div class='col-md-12'> <h1>History</h1> </div> <% if @transfers.empty? %> <hr> <h3>There are no transfers yet. To transfer funds, click <%= link_to 'here', new_transfer_path %>.</h3> <% else %> <% @transfers.each do |transfer| %> <hr> <div class='col-md-12'> <h3>From</h3> <p><%= transfer.outgoing_account.user.name %></p> </div> <div class='col-md-12'> <h3>To</h3> <p><%= transfer.incoming_account.user.name %></p> </div> <div class='col-md-4'> <h3>Amount</h3> <p><%= transfer.amount %></p> </div> <div class='col-md-8'> <h3>Created On</h3> <p><%= transfer.created_at %></p> </div> <% end %> <% end %> <hr> <div class='col-md-12'> <p> <%= link_to 'Go Back to Your Account', account_path(current_user.account), class: 'btn btn-default' %> </p> </div> </div> </div> </div> <div class='col-md-2'></div> </div>
<div class='container-fluid transfer'> <div class='col-md-2'></div> <div class='col-md-8'> <div class='info'> <div class='col-md-12'> <h1>History</h1> </div> - <% @transfers.each do |transfer| %> + <% if @transfers.empty? %> <hr> + <h3>There are no transfers yet. To transfer funds, click <%= link_to 'here', new_transfer_path %>.</h3> + <% else %> + <% @transfers.each do |transfer| %> + <hr> - <div class='col-md-12'> + <div class='col-md-12'> ? ++ - <h3>From</h3> + <h3>From</h3> ? ++ - <p><%= transfer.outgoing_account.user.name %></p> + <p><%= transfer.outgoing_account.user.name %></p> ? ++ - </div> + </div> ? ++ - <div class='col-md-12'> + <div class='col-md-12'> ? ++ - <h3>To</h3> + <h3>To</h3> ? ++ - <p><%= transfer.incoming_account.user.name %></p> + <p><%= transfer.incoming_account.user.name %></p> ? ++ - </div> + </div> ? ++ - <div class='col-md-4'> + <div class='col-md-4'> ? ++ - <h3>Amount</h3> + <h3>Amount</h3> ? ++ - <p><%= transfer.amount %></p> + <p><%= transfer.amount %></p> ? ++ - </div> + </div> ? ++ - <div class='col-md-8'> + <div class='col-md-8'> ? ++ - <h3>Created On</h3> + <h3>Created On</h3> ? ++ - <p><%= transfer.created_at %></p> + <p><%= transfer.created_at %></p> ? ++ - </div> + </div> ? ++ + <% end %> <% end %> <hr> <div class='col-md-12'> <p> <%= link_to 'Go Back to Your Account', account_path(current_user.account), class: 'btn btn-default' %> </p> </div> </div> </div> </div> <div class='col-md-2'></div> </div>
39
1.114286
22
17
9697b8d10a8312fb9e07009ce62a8e380e68bc76
test/js/organismDetailsSpec.js
test/js/organismDetailsSpec.js
describe("Test the organismDetails file", function() { it("Test for getBestName", function() { expect(getBestName({})).toBe(''); }); });
describe("Test the organismDetails file", function() { it("Test for getBestName on empty set", function() { expect(getBestName({})).toBe(''); }); it("Test for getBestName with only sciname", function() { expect(getBestName({'scientificName': 'Mus musculus'})).toBe('Mus musculus'); expect(getBestName({'scientificName': 'Vulpes zerda', 'vernacularNames': []})).toBe('Vulpes zerda'); }); it("Test for getBestName with common names (no preffered name)", function() { expect(getBestName({'scientificName': 'Vulpes zerda', 'vernacularNames': [{'language': 'en', 'vernacularName': 'Fennec'}]})).toBe('Fennec'); }); it("Test for getBestName with common names (preffered name)", function() { expect(getBestName({})).toBe(''); }); });
Expand test case for getBestName
Expand test case for getBestName
JavaScript
mit
molbiodiv/fennec,molbiodiv/fennec,molbiodiv/fennec,molbiodiv/fennec,molbiodiv/fennec
javascript
## Code Before: describe("Test the organismDetails file", function() { it("Test for getBestName", function() { expect(getBestName({})).toBe(''); }); }); ## Instruction: Expand test case for getBestName ## Code After: describe("Test the organismDetails file", function() { it("Test for getBestName on empty set", function() { expect(getBestName({})).toBe(''); }); it("Test for getBestName with only sciname", function() { expect(getBestName({'scientificName': 'Mus musculus'})).toBe('Mus musculus'); expect(getBestName({'scientificName': 'Vulpes zerda', 'vernacularNames': []})).toBe('Vulpes zerda'); }); it("Test for getBestName with common names (no preffered name)", function() { expect(getBestName({'scientificName': 'Vulpes zerda', 'vernacularNames': [{'language': 'en', 'vernacularName': 'Fennec'}]})).toBe('Fennec'); }); it("Test for getBestName with common names (preffered name)", function() { expect(getBestName({})).toBe(''); }); });
describe("Test the organismDetails file", function() { - it("Test for getBestName", function() { + it("Test for getBestName on empty set", function() { ? +++++++++++++ + expect(getBestName({})).toBe(''); + }); + it("Test for getBestName with only sciname", function() { + expect(getBestName({'scientificName': 'Mus musculus'})).toBe('Mus musculus'); + expect(getBestName({'scientificName': 'Vulpes zerda', 'vernacularNames': []})).toBe('Vulpes zerda'); + }); + it("Test for getBestName with common names (no preffered name)", function() { + expect(getBestName({'scientificName': 'Vulpes zerda', 'vernacularNames': [{'language': 'en', 'vernacularName': 'Fennec'}]})).toBe('Fennec'); + }); + it("Test for getBestName with common names (preffered name)", function() { expect(getBestName({})).toBe(''); }); });
12
2
11
1
2997804bc8f0b8aa20154b887db76208862c76ab
lib/osm_leeds.rb
lib/osm_leeds.rb
require 'overpass_api_ruby' require 'nokogiri' class OSMLeeds BORDER = {n: 53.9458558, e: -1.2903452, s: 53.6983747, w: -1.8003617} def initialize @overpass = OverpassAPI.new(bbox: BORDER, json: true) end # Runs the given query on Overpass def query(hash) @overpass.query(query_xml hash) end private # Generates an XML query for the union of the given key-value pairs def query_xml(hash) Nokogiri::XML::Builder.new do |x| x.query(type: 'node') do hash.each do |k,v| x.send(:'has-kv', k: k, v: v) end end end.doc.root.to_s end end
require 'overpass_api_ruby' require 'nokogiri' class OSMLeeds BORDER = {n: 53.9458558, e: -1.2903452, s: 53.6983747, w: -1.8003617} def initialize @overpass = OverpassAPI.new(bbox: BORDER, json: true) end # Runs the given query on Overpass def query(hash) @overpass.query(query_xml hash) end private # Generates an XML query for the union of the given key-value pairs def query_xml(hash) Nokogiri::XML::Builder.new do |x| x.union do %w{node way}.each do |t| x.query(type: t) do hash.each do |k,v| x.send(:'has-kv', k: k, v: v) end end end end end.doc.root.to_s end end
Make sure we search both nodes and ways
Make sure we search both nodes and ways
Ruby
mit
fishpercolator/gsoh,fishpercolator/gsoh,fishpercolator/gsoh
ruby
## Code Before: require 'overpass_api_ruby' require 'nokogiri' class OSMLeeds BORDER = {n: 53.9458558, e: -1.2903452, s: 53.6983747, w: -1.8003617} def initialize @overpass = OverpassAPI.new(bbox: BORDER, json: true) end # Runs the given query on Overpass def query(hash) @overpass.query(query_xml hash) end private # Generates an XML query for the union of the given key-value pairs def query_xml(hash) Nokogiri::XML::Builder.new do |x| x.query(type: 'node') do hash.each do |k,v| x.send(:'has-kv', k: k, v: v) end end end.doc.root.to_s end end ## Instruction: Make sure we search both nodes and ways ## Code After: require 'overpass_api_ruby' require 'nokogiri' class OSMLeeds BORDER = {n: 53.9458558, e: -1.2903452, s: 53.6983747, w: -1.8003617} def initialize @overpass = OverpassAPI.new(bbox: BORDER, json: true) end # Runs the given query on Overpass def query(hash) @overpass.query(query_xml hash) end private # Generates an XML query for the union of the given key-value pairs def query_xml(hash) Nokogiri::XML::Builder.new do |x| x.union do %w{node way}.each do |t| x.query(type: t) do hash.each do |k,v| x.send(:'has-kv', k: k, v: v) end end end end end.doc.root.to_s end end
require 'overpass_api_ruby' require 'nokogiri' class OSMLeeds BORDER = {n: 53.9458558, e: -1.2903452, s: 53.6983747, w: -1.8003617} def initialize @overpass = OverpassAPI.new(bbox: BORDER, json: true) end # Runs the given query on Overpass def query(hash) @overpass.query(query_xml hash) end private # Generates an XML query for the union of the given key-value pairs def query_xml(hash) Nokogiri::XML::Builder.new do |x| + x.union do + %w{node way}.each do |t| - x.query(type: 'node') do ? ^^^^^^ + x.query(type: t) do ? ++++ ^ - hash.each do |k,v| + hash.each do |k,v| ? ++++ - x.send(:'has-kv', k: k, v: v) + x.send(:'has-kv', k: k, v: v) ? ++++ + end + end end end end.doc.root.to_s end end
10
0.344828
7
3
8ab6b473f22a3223f7c3a4fcb40375158b75fec7
bower.json
bower.json
{ "name": "GIMS", "license": "MIT", "private": true, "dependencies": { "angular-bootstrap-colorpicker": "v3.0.5", "angular-highcharts-directive": "*", "angular-http-auth": "v1.2.1", "angular-mocks": "v1.2.13", "angular-resource": "v1.2.13", "angular-route": "v1.2.13", "angular-scenario": "v1.2.13", "angular-bootstrap": "0.10.0", "angular-ui-select2": "v0.0.5", "highcharts.com": "v3.0.9", "html5shiv": "3.7.0", "jquery": "v2.1.0", "lodash": "v2.4.1", "ng-grid": "v2.0.7", "restangular": "v1.3.1", "sprintf": "v0.7", "angular-ui-utils": "bower", "autofill-event": "~1.0.0", "angular-animate": "~1.2.14" } }
{ "name": "GIMS", "license": "MIT", "private": true, "dependencies": { "angular-bootstrap-colorpicker": "v3.0.5", "angular-highcharts-directive": "*", "angular-http-auth": "v1.2.1", "angular-animate": "~1.2.14", "angular-mocks": "~1.2.14", "angular-resource": "~1.2.14", "angular-route": "~1.2.14", "angular-scenario": "~1.2.14", "angular-bootstrap": "0.10.0", "angular-ui-select2": "v0.0.5", "highcharts.com": "v3.0.9", "html5shiv": "3.7.0", "jquery": "v2.1.0", "lodash": "v2.4.1", "ng-grid": "v2.0.7", "restangular": "v1.3.1", "sprintf": "v0.7", "angular-ui-utils": "bower", "autofill-event": "~1.0.0" } }
Upgrade Angular packages to 1.2.14
Upgrade Angular packages to 1.2.14
JSON
mit
Ecodev/gims,Ecodev/gims,Ecodev/gims,Ecodev/gims,Ecodev/gims
json
## Code Before: { "name": "GIMS", "license": "MIT", "private": true, "dependencies": { "angular-bootstrap-colorpicker": "v3.0.5", "angular-highcharts-directive": "*", "angular-http-auth": "v1.2.1", "angular-mocks": "v1.2.13", "angular-resource": "v1.2.13", "angular-route": "v1.2.13", "angular-scenario": "v1.2.13", "angular-bootstrap": "0.10.0", "angular-ui-select2": "v0.0.5", "highcharts.com": "v3.0.9", "html5shiv": "3.7.0", "jquery": "v2.1.0", "lodash": "v2.4.1", "ng-grid": "v2.0.7", "restangular": "v1.3.1", "sprintf": "v0.7", "angular-ui-utils": "bower", "autofill-event": "~1.0.0", "angular-animate": "~1.2.14" } } ## Instruction: Upgrade Angular packages to 1.2.14 ## Code After: { "name": "GIMS", "license": "MIT", "private": true, "dependencies": { "angular-bootstrap-colorpicker": "v3.0.5", "angular-highcharts-directive": "*", "angular-http-auth": "v1.2.1", "angular-animate": "~1.2.14", "angular-mocks": "~1.2.14", "angular-resource": "~1.2.14", "angular-route": "~1.2.14", "angular-scenario": "~1.2.14", "angular-bootstrap": "0.10.0", "angular-ui-select2": "v0.0.5", "highcharts.com": "v3.0.9", "html5shiv": "3.7.0", "jquery": "v2.1.0", "lodash": "v2.4.1", "ng-grid": "v2.0.7", "restangular": "v1.3.1", "sprintf": "v0.7", "angular-ui-utils": "bower", "autofill-event": "~1.0.0" } }
{ "name": "GIMS", "license": "MIT", "private": true, "dependencies": { "angular-bootstrap-colorpicker": "v3.0.5", "angular-highcharts-directive": "*", "angular-http-auth": "v1.2.1", + "angular-animate": "~1.2.14", - "angular-mocks": "v1.2.13", ? ^ ^ + "angular-mocks": "~1.2.14", ? ^ ^ - "angular-resource": "v1.2.13", ? ^ ^ + "angular-resource": "~1.2.14", ? ^ ^ - "angular-route": "v1.2.13", ? ^ ^ + "angular-route": "~1.2.14", ? ^ ^ - "angular-scenario": "v1.2.13", ? ^ ^ + "angular-scenario": "~1.2.14", ? ^ ^ "angular-bootstrap": "0.10.0", "angular-ui-select2": "v0.0.5", "highcharts.com": "v3.0.9", "html5shiv": "3.7.0", "jquery": "v2.1.0", "lodash": "v2.4.1", "ng-grid": "v2.0.7", "restangular": "v1.3.1", "sprintf": "v0.7", "angular-ui-utils": "bower", - "autofill-event": "~1.0.0", ? - + "autofill-event": "~1.0.0" - "angular-animate": "~1.2.14" } }
12
0.461538
6
6
0d7a1f6cfe71e1cc0e8d7736b5094f9ef328278c
src/SFA.DAS.EmployerUsers.Users.Database/StoredProcedures/GetUsersWithExpiredRegistrations.sql
src/SFA.DAS.EmployerUsers.Users.Database/StoredProcedures/GetUsersWithExpiredRegistrations.sql
CREATE PROCEDURE [dbo].[GetUsersWithExpiredRegistrations] AS SELECT Id, FirstName, LastName, Email, Password, Salt, PasswordProfileId, IsActive, FailedLoginAttempts, IsLocked FROM [User] u LEFT JOIN UserSecurityCode sc ON u.Id = sc.UserId AND sc.ExpiryTime > GETDATE() WHERE u.IsActive = 0 AND sc.Code IS NULL GO
CREATE PROCEDURE [dbo].[GetUsersWithExpiredRegistrations] AS SELECT Id, FirstName, LastName, Email, Password, Salt, PasswordProfileId, IsActive, FailedLoginAttempts, IsLocked FROM [User] WHERE IsActive = 0 AND Id NOT IN ( SELECT UserId FROM UserSecurityCode WHERE ExpiryTime >= GETDATE() ) GO
Update get users for deletion sproc to eb more 'readable'
Update get users for deletion sproc to eb more 'readable'
SQL
mit
SkillsFundingAgency/das-employerusers,SkillsFundingAgency/das-employerusers,SkillsFundingAgency/das-employerusers
sql
## Code Before: CREATE PROCEDURE [dbo].[GetUsersWithExpiredRegistrations] AS SELECT Id, FirstName, LastName, Email, Password, Salt, PasswordProfileId, IsActive, FailedLoginAttempts, IsLocked FROM [User] u LEFT JOIN UserSecurityCode sc ON u.Id = sc.UserId AND sc.ExpiryTime > GETDATE() WHERE u.IsActive = 0 AND sc.Code IS NULL GO ## Instruction: Update get users for deletion sproc to eb more 'readable' ## Code After: CREATE PROCEDURE [dbo].[GetUsersWithExpiredRegistrations] AS SELECT Id, FirstName, LastName, Email, Password, Salt, PasswordProfileId, IsActive, FailedLoginAttempts, IsLocked FROM [User] WHERE IsActive = 0 AND Id NOT IN ( SELECT UserId FROM UserSecurityCode WHERE ExpiryTime >= GETDATE() ) GO
CREATE PROCEDURE [dbo].[GetUsersWithExpiredRegistrations] AS SELECT Id, FirstName, LastName, Email, Password, Salt, PasswordProfileId, IsActive, FailedLoginAttempts, IsLocked - FROM [User] u ? -- + FROM [User] - LEFT JOIN UserSecurityCode sc - ON u.Id = sc.UserId - AND sc.ExpiryTime > GETDATE() - WHERE u.IsActive = 0 ? -- + WHERE IsActive = 0 - AND sc.Code IS NULL + AND Id NOT IN + ( + SELECT UserId + FROM UserSecurityCode + WHERE ExpiryTime >= GETDATE() + ) GO
14
0.7
8
6
c630b42e4b52bb2012d10be381161fc82923f4c1
src/com/mendix/widget/carousel/components/CarouselItem.ts
src/com/mendix/widget/carousel/components/CarouselItem.ts
import { DOM } from "react"; interface CarouselItemProps { imageUrl: string; active?: boolean; } export const CarouselItem = (props: CarouselItemProps) => { return ( DOM.div({ className: props.active ? "item active" : "item" }, DOM.img({ alt: "item", height: 300, src: props.imageUrl, width: 900 }) ) ); };
import { DOM } from "react"; export interface CarouselItemProps { imageUrl: string; active?: boolean; } export const CarouselItem = (props: CarouselItemProps) => { return ( DOM.div({ className: props.active ? "item active" : "item" }, DOM.img({ alt: "item", src: props.imageUrl }) ) ); };
Remove hardcoded carousel image dimensions
Remove hardcoded carousel image dimensions
TypeScript
apache-2.0
mendixlabs/carousel,FlockOfBirds/carousel,mendixlabs/carousel,FlockOfBirds/carousel
typescript
## Code Before: import { DOM } from "react"; interface CarouselItemProps { imageUrl: string; active?: boolean; } export const CarouselItem = (props: CarouselItemProps) => { return ( DOM.div({ className: props.active ? "item active" : "item" }, DOM.img({ alt: "item", height: 300, src: props.imageUrl, width: 900 }) ) ); }; ## Instruction: Remove hardcoded carousel image dimensions ## Code After: import { DOM } from "react"; export interface CarouselItemProps { imageUrl: string; active?: boolean; } export const CarouselItem = (props: CarouselItemProps) => { return ( DOM.div({ className: props.active ? "item active" : "item" }, DOM.img({ alt: "item", src: props.imageUrl }) ) ); };
import { DOM } from "react"; - interface CarouselItemProps { + export interface CarouselItemProps { ? +++++++ imageUrl: string; active?: boolean; } export const CarouselItem = (props: CarouselItemProps) => { return ( DOM.div({ className: props.active ? "item active" : "item" }, - DOM.img({ alt: "item", height: 300, src: props.imageUrl, width: 900 }) ? ------------- ------------ + DOM.img({ alt: "item", src: props.imageUrl }) ) ); };
4
0.285714
2
2
06be77e7e579ca0c77d2a56e7862e98391447eb9
package.json
package.json
{ "name": "titanium-backbone", "version": "0.0.8", "description": "Framework for Titanium apps built with Backbone", "private": true, "dependencies": { "async": "0.1.x", "backbone": "0.9.x", "commander": "0.5.x", "jade": "0.20.x", "pretty-data": "0.20.x", "underscore": "1.3.x", "node-uuid": "1.3.x", "stitch-up":"git+ssh://git@github.com:trabian/stitch-up.git#master" }, "bin": { "titanium-backbone": "./bin/titanium-backbone" }, "main": "./lib/index.coffee", "stitch": { "paths": [ "src" ], "vendorDependencies": [ "node_modules/backbone/backbone.js", "node_modules/underscore/underscore.js" ] } }
{ "name": "titanium-backbone", "version": "0.0.8", "description": "Framework for Titanium apps built with Backbone", "private": true, "dependencies": { "async": "0.1.x", "backbone": "0.9.x", "commander": "0.5.x", "jade": "0.20.x", "pretty-data": "0.20.x", "underscore": "1.3.x", "node-uuid": "1.3.x", "stitch-up":"git+ssh://git@github.com:trabian/stitch-up.git#master" }, "bin": { "titanium-backbone": "./bin/titanium-backbone" }, "main": "./lib/index.coffee", "stitch": { "paths": [ "src" ], "dependencies": [ "node_modules/underscore/underscore.js", "node_modules/backbone/backbone.js" ] } }
Include underscore and Backbone in app-impl.js
Include underscore and Backbone in app-impl.js
JSON
mit
vcu/titanium-backbone,trabian/titanium-backbone,trabian/titanium-backbone,vcu/titanium-backbone
json
## Code Before: { "name": "titanium-backbone", "version": "0.0.8", "description": "Framework for Titanium apps built with Backbone", "private": true, "dependencies": { "async": "0.1.x", "backbone": "0.9.x", "commander": "0.5.x", "jade": "0.20.x", "pretty-data": "0.20.x", "underscore": "1.3.x", "node-uuid": "1.3.x", "stitch-up":"git+ssh://git@github.com:trabian/stitch-up.git#master" }, "bin": { "titanium-backbone": "./bin/titanium-backbone" }, "main": "./lib/index.coffee", "stitch": { "paths": [ "src" ], "vendorDependencies": [ "node_modules/backbone/backbone.js", "node_modules/underscore/underscore.js" ] } } ## Instruction: Include underscore and Backbone in app-impl.js ## Code After: { "name": "titanium-backbone", "version": "0.0.8", "description": "Framework for Titanium apps built with Backbone", "private": true, "dependencies": { "async": "0.1.x", "backbone": "0.9.x", "commander": "0.5.x", "jade": "0.20.x", "pretty-data": "0.20.x", "underscore": "1.3.x", "node-uuid": "1.3.x", "stitch-up":"git+ssh://git@github.com:trabian/stitch-up.git#master" }, "bin": { "titanium-backbone": "./bin/titanium-backbone" }, "main": "./lib/index.coffee", "stitch": { "paths": [ "src" ], "dependencies": [ "node_modules/underscore/underscore.js", "node_modules/backbone/backbone.js" ] } }
{ "name": "titanium-backbone", "version": "0.0.8", "description": "Framework for Titanium apps built with Backbone", "private": true, "dependencies": { "async": "0.1.x", "backbone": "0.9.x", "commander": "0.5.x", "jade": "0.20.x", "pretty-data": "0.20.x", "underscore": "1.3.x", "node-uuid": "1.3.x", "stitch-up":"git+ssh://git@github.com:trabian/stitch-up.git#master" }, "bin": { "titanium-backbone": "./bin/titanium-backbone" }, "main": "./lib/index.coffee", "stitch": { "paths": [ "src" ], - "vendorDependencies": [ ? --- --- + "dependencies": [ - "node_modules/backbone/backbone.js", - "node_modules/underscore/underscore.js" + "node_modules/underscore/underscore.js", ? + + "node_modules/backbone/backbone.js" ] } }
6
0.206897
3
3
60288500c0eca5d620a81637bc4d0d7e290befd4
lib/qtcamimagemode.h
lib/qtcamimagemode.h
// -*- c++ -*- #ifndef QT_CAM_IMAGE_MODE_H #define QT_CAM_IMAGE_MODE_H #include "qtcammode.h" #include <gst/pbutils/encoding-profile.h> class QtCamDevicePrivate; class QtCamImageModePrivate; class QtCamImageSettings; class QtCamImageMode : public QtCamMode { Q_OBJECT public: QtCamImageMode(QtCamDevicePrivate *d, QObject *parent = 0); ~QtCamImageMode(); virtual bool canCapture(); virtual void applySettings(); bool capture(const QString& fileName); bool setSettings(const QtCamImageSettings& settings); void setProfile(GstEncodingProfile *profile); signals: void imageSaved(const QString& fileName); protected: virtual void start(); virtual void stop(); private: QtCamImageModePrivate *d_ptr; }; #endif /* QT_CAM_IMAGE_MODE_H */
// -*- c++ -*- #ifndef QT_CAM_IMAGE_MODE_H #define QT_CAM_IMAGE_MODE_H #include "qtcammode.h" #include <gst/pbutils/encoding-profile.h> class QtCamDevicePrivate; class QtCamImageModePrivate; class QtCamImageSettings; class QtCamImageMode : public QtCamMode { Q_OBJECT public: QtCamImageMode(QtCamDevicePrivate *d, QObject *parent = 0); ~QtCamImageMode(); virtual bool canCapture(); virtual void applySettings(); bool capture(const QString& fileName); bool setSettings(const QtCamImageSettings& settings); void setProfile(GstEncodingProfile *profile); protected: virtual void start(); virtual void stop(); private: QtCamImageModePrivate *d_ptr; }; #endif /* QT_CAM_IMAGE_MODE_H */
Remove imageSaved() signal as it is old code.
Remove imageSaved() signal as it is old code.
C
lgpl-2.1
mlehtima/cameraplus,mer-hybris-kis3/cameraplus,mer-hybris-kis3/cameraplus,alinelena/cameraplus,mer-hybris-kis3/cameraplus,alinelena/cameraplus,mlehtima/cameraplus,alinelena/cameraplus,foolab/cameraplus,mer-hybris-kis3/cameraplus,foolab/cameraplus,foolab/cameraplus,mlehtima/cameraplus,foolab/cameraplus,mlehtima/cameraplus,alinelena/cameraplus
c
## Code Before: // -*- c++ -*- #ifndef QT_CAM_IMAGE_MODE_H #define QT_CAM_IMAGE_MODE_H #include "qtcammode.h" #include <gst/pbutils/encoding-profile.h> class QtCamDevicePrivate; class QtCamImageModePrivate; class QtCamImageSettings; class QtCamImageMode : public QtCamMode { Q_OBJECT public: QtCamImageMode(QtCamDevicePrivate *d, QObject *parent = 0); ~QtCamImageMode(); virtual bool canCapture(); virtual void applySettings(); bool capture(const QString& fileName); bool setSettings(const QtCamImageSettings& settings); void setProfile(GstEncodingProfile *profile); signals: void imageSaved(const QString& fileName); protected: virtual void start(); virtual void stop(); private: QtCamImageModePrivate *d_ptr; }; #endif /* QT_CAM_IMAGE_MODE_H */ ## Instruction: Remove imageSaved() signal as it is old code. ## Code After: // -*- c++ -*- #ifndef QT_CAM_IMAGE_MODE_H #define QT_CAM_IMAGE_MODE_H #include "qtcammode.h" #include <gst/pbutils/encoding-profile.h> class QtCamDevicePrivate; class QtCamImageModePrivate; class QtCamImageSettings; class QtCamImageMode : public QtCamMode { Q_OBJECT public: QtCamImageMode(QtCamDevicePrivate *d, QObject *parent = 0); ~QtCamImageMode(); virtual bool canCapture(); virtual void applySettings(); bool capture(const QString& fileName); bool setSettings(const QtCamImageSettings& settings); void setProfile(GstEncodingProfile *profile); protected: virtual void start(); virtual void stop(); private: QtCamImageModePrivate *d_ptr; }; #endif /* QT_CAM_IMAGE_MODE_H */
// -*- c++ -*- #ifndef QT_CAM_IMAGE_MODE_H #define QT_CAM_IMAGE_MODE_H #include "qtcammode.h" #include <gst/pbutils/encoding-profile.h> class QtCamDevicePrivate; class QtCamImageModePrivate; class QtCamImageSettings; class QtCamImageMode : public QtCamMode { Q_OBJECT public: QtCamImageMode(QtCamDevicePrivate *d, QObject *parent = 0); ~QtCamImageMode(); virtual bool canCapture(); virtual void applySettings(); bool capture(const QString& fileName); bool setSettings(const QtCamImageSettings& settings); void setProfile(GstEncodingProfile *profile); - signals: - void imageSaved(const QString& fileName); - protected: virtual void start(); virtual void stop(); private: QtCamImageModePrivate *d_ptr; }; #endif /* QT_CAM_IMAGE_MODE_H */
3
0.075
0
3
9fe2514b370f58c5531fd22830713791fac0b3a5
leetcode/019.remove-nth-node-from-end-of-list.go
leetcode/019.remove-nth-node-from-end-of-list.go
package leetcode /** * Definition for singly-linked list. * type ListNode struct { * Val int * Next *ListNode * } */ func removeNthFromEnd(head *ListNode, n int) *ListNode { n1, n2 := head, head for i := 0; i < n; i++ { n2 = n2.Next } if n2 == nil { return head.Next } for n2.Next != nil { n1 = n1.Next n2 = n2.Next } n1.Next = n1.Next.Next return head }
package leetcode /** * Definition for singly-linked list. * type ListNode struct { * Val int * Next *ListNode * } */ func removeNthFromEnd(head *ListNode, n int) *ListNode { /* 4 ms var count int for node := head; node != nil; node = node.Next { count++ } if n = count - n + 1; n == 1 { return head.Next } for node := head; node != nil; node = node.Next { if n--; n == 1 { if next := node.Next; next != nil { node.Next = next.Next } break } } return head */ n1, n2 := head, head for i := 0; i < n; i++ { n2 = n2.Next } if n2 == nil { return head.Next } for n2.Next != nil { n1 = n1.Next n2 = n2.Next } n1.Next = n1.Next.Next return head }
Remove Nth Node From End of List
Remove Nth Node From End of List
Go
apache-2.0
4396/leetcode
go
## Code Before: package leetcode /** * Definition for singly-linked list. * type ListNode struct { * Val int * Next *ListNode * } */ func removeNthFromEnd(head *ListNode, n int) *ListNode { n1, n2 := head, head for i := 0; i < n; i++ { n2 = n2.Next } if n2 == nil { return head.Next } for n2.Next != nil { n1 = n1.Next n2 = n2.Next } n1.Next = n1.Next.Next return head } ## Instruction: Remove Nth Node From End of List ## Code After: package leetcode /** * Definition for singly-linked list. * type ListNode struct { * Val int * Next *ListNode * } */ func removeNthFromEnd(head *ListNode, n int) *ListNode { /* 4 ms var count int for node := head; node != nil; node = node.Next { count++ } if n = count - n + 1; n == 1 { return head.Next } for node := head; node != nil; node = node.Next { if n--; n == 1 { if next := node.Next; next != nil { node.Next = next.Next } break } } return head */ n1, n2 := head, head for i := 0; i < n; i++ { n2 = n2.Next } if n2 == nil { return head.Next } for n2.Next != nil { n1 = n1.Next n2 = n2.Next } n1.Next = n1.Next.Next return head }
package leetcode /** * Definition for singly-linked list. * type ListNode struct { * Val int * Next *ListNode * } */ func removeNthFromEnd(head *ListNode, n int) *ListNode { + /* 4 ms + var count int + for node := head; node != nil; node = node.Next { + count++ + } + if n = count - n + 1; n == 1 { + return head.Next + } + for node := head; node != nil; node = node.Next { + if n--; n == 1 { + if next := node.Next; next != nil { + node.Next = next.Next + } + break + } + } + return head + */ n1, n2 := head, head for i := 0; i < n; i++ { n2 = n2.Next } if n2 == nil { return head.Next } for n2.Next != nil { n1 = n1.Next n2 = n2.Next } n1.Next = n1.Next.Next return head }
18
0.75
18
0
2fc2924f8a6b1258a37a26f2bb6f7369f86fad60
Cargo.toml
Cargo.toml
[package] name = "conrod" version = "0.1.2" authors = [ "Mitchell Nordine <mitchell.nordine@gmail.com>", "Sven Nilsen <bvssvni@gmail.com>" ] keywords = ["ui", "widgets", "immediate-mode", "piston"] description = "An easy-to-use, immediate-mode, 2D GUI library" license = "MIT" readme = "README.md" repository = "https://github.com/pistondevelopers/conrod.git" homepage = "https://github.com/pistondevelopers/conrod" [lib] name = "conrod" path = "./src/lib.rs" [dependencies] bitflags = "*" clock_ticks = "0.0.6" elmesque = "0.1.0" piston = "0.1.3" piston2d-graphics = "0.0.48" num = "*" rand = "*" rustc-serialize = "*" vecmath = "0.0.23" [dev-dependencies] gfx = "0.6.*" gfx_device_gl = "0.4.*" piston-viewport = "0.0.3" piston_window = "0.0.8" piston2d-gfx_graphics = "0.1.21" piston2d-opengl_graphics = "0.0.17" pistoncore-glutin_window = "0.0.9"
[package] name = "conrod" version = "0.1.3" authors = [ "Mitchell Nordine <mitchell.nordine@gmail.com>", "Sven Nilsen <bvssvni@gmail.com>" ] keywords = ["ui", "widgets", "immediate-mode", "piston"] description = "An easy-to-use, immediate-mode, 2D GUI library" license = "MIT" readme = "README.md" repository = "https://github.com/pistondevelopers/conrod.git" homepage = "https://github.com/pistondevelopers/conrod" [lib] name = "conrod" path = "./src/lib.rs" [dependencies] bitflags = "*" clock_ticks = "0.0.6" elmesque = "0.1.*" piston = "0.1.3" piston2d-graphics = "0.1.3" num = "*" rand = "*" rustc-serialize = "*" vecmath = "0.0.23" [dev-dependencies] gfx = "0.6.*" gfx_device_gl = "0.4.*" piston-viewport = "0.1.0" piston_window = "0.1.0" piston2d-gfx_graphics = "0.1.22" piston2d-opengl_graphics = "0.1.0" pistoncore-glutin_window = "0.1.0"
Use latest crates.io dependencies, increment version
Use latest crates.io dependencies, increment version
TOML
mit
tempbottle/conrod,natemara/conrod,TheNeikos/conrod,youprofit/conrod
toml
## Code Before: [package] name = "conrod" version = "0.1.2" authors = [ "Mitchell Nordine <mitchell.nordine@gmail.com>", "Sven Nilsen <bvssvni@gmail.com>" ] keywords = ["ui", "widgets", "immediate-mode", "piston"] description = "An easy-to-use, immediate-mode, 2D GUI library" license = "MIT" readme = "README.md" repository = "https://github.com/pistondevelopers/conrod.git" homepage = "https://github.com/pistondevelopers/conrod" [lib] name = "conrod" path = "./src/lib.rs" [dependencies] bitflags = "*" clock_ticks = "0.0.6" elmesque = "0.1.0" piston = "0.1.3" piston2d-graphics = "0.0.48" num = "*" rand = "*" rustc-serialize = "*" vecmath = "0.0.23" [dev-dependencies] gfx = "0.6.*" gfx_device_gl = "0.4.*" piston-viewport = "0.0.3" piston_window = "0.0.8" piston2d-gfx_graphics = "0.1.21" piston2d-opengl_graphics = "0.0.17" pistoncore-glutin_window = "0.0.9" ## Instruction: Use latest crates.io dependencies, increment version ## Code After: [package] name = "conrod" version = "0.1.3" authors = [ "Mitchell Nordine <mitchell.nordine@gmail.com>", "Sven Nilsen <bvssvni@gmail.com>" ] keywords = ["ui", "widgets", "immediate-mode", "piston"] description = "An easy-to-use, immediate-mode, 2D GUI library" license = "MIT" readme = "README.md" repository = "https://github.com/pistondevelopers/conrod.git" homepage = "https://github.com/pistondevelopers/conrod" [lib] name = "conrod" path = "./src/lib.rs" [dependencies] bitflags = "*" clock_ticks = "0.0.6" elmesque = "0.1.*" piston = "0.1.3" piston2d-graphics = "0.1.3" num = "*" rand = "*" rustc-serialize = "*" vecmath = "0.0.23" [dev-dependencies] gfx = "0.6.*" gfx_device_gl = "0.4.*" piston-viewport = "0.1.0" piston_window = "0.1.0" piston2d-gfx_graphics = "0.1.22" piston2d-opengl_graphics = "0.1.0" pistoncore-glutin_window = "0.1.0"
[package] name = "conrod" - version = "0.1.2" ? ^ + version = "0.1.3" ? ^ authors = [ "Mitchell Nordine <mitchell.nordine@gmail.com>", "Sven Nilsen <bvssvni@gmail.com>" ] keywords = ["ui", "widgets", "immediate-mode", "piston"] description = "An easy-to-use, immediate-mode, 2D GUI library" license = "MIT" readme = "README.md" repository = "https://github.com/pistondevelopers/conrod.git" homepage = "https://github.com/pistondevelopers/conrod" [lib] name = "conrod" path = "./src/lib.rs" [dependencies] bitflags = "*" clock_ticks = "0.0.6" - elmesque = "0.1.0" ? ^ + elmesque = "0.1.*" ? ^ piston = "0.1.3" - piston2d-graphics = "0.0.48" ? ^ ^^ + piston2d-graphics = "0.1.3" ? ^ ^ num = "*" rand = "*" rustc-serialize = "*" vecmath = "0.0.23" [dev-dependencies] gfx = "0.6.*" gfx_device_gl = "0.4.*" - piston-viewport = "0.0.3" ? -- + piston-viewport = "0.1.0" ? ++ - piston_window = "0.0.8" ? -- + piston_window = "0.1.0" ? ++ - piston2d-gfx_graphics = "0.1.21" ? ^ + piston2d-gfx_graphics = "0.1.22" ? ^ - piston2d-opengl_graphics = "0.0.17" ? --- + piston2d-opengl_graphics = "0.1.0" ? ++ - pistoncore-glutin_window = "0.0.9" ? -- + pistoncore-glutin_window = "0.1.0" ? ++
16
0.380952
8
8
e0f9aabeb708187e146593132cd3221c9e0a8714
lib/gecko/record/order.rb
lib/gecko/record/order.rb
require 'gecko/record/base' module Gecko module Record class Order < Base has_many :fulfillments has_many :invoices has_many :order_line_items belongs_to :company belongs_to :shipping_address belongs_to :billing_address belongs_to :user belongs_to :assignee, class_name: "User" belongs_to :stock_location, class_name: "Location" belongs_to :currency attribute :order_number, String attribute :phone_number, String attribute :email, String attribute :notes, String attribute :reference_number, String attribute :status, String attribute :payment_status, String attribute :invoice_status, String attribute :invoice_numbers, Hash[Integer => String] attribute :packed_status, String attribute :fulfillment_status, String attribute :tax_type, String attribute :issued_at, Date attribute :ship_at, Date attribute :tax_override, String attribute :tax_label, String attribute :tracking_number, String attribute :source_url, String attribute :total, BigDecimal attribute :source_id, String ## DEPRECATED attribute :source, String end class OrderAdapter < BaseAdapter end end end
require 'gecko/record/base' module Gecko module Record class Order < Base has_many :fulfillments has_many :invoices has_many :order_line_items belongs_to :company belongs_to :shipping_address, class_name: "Address" belongs_to :billing_address, class_name: "Address" belongs_to :user belongs_to :assignee, class_name: "User" belongs_to :stock_location, class_name: "Location" belongs_to :currency attribute :order_number, String attribute :phone_number, String attribute :email, String attribute :notes, String attribute :reference_number, String attribute :status, String attribute :payment_status, String attribute :invoice_status, String attribute :invoice_numbers, Hash[Integer => String] attribute :packed_status, String attribute :fulfillment_status, String attribute :tax_type, String attribute :issued_at, Date attribute :ship_at, Date attribute :tax_override, String attribute :tax_label, String attribute :tracking_number, String attribute :source_url, String attribute :total, BigDecimal attribute :source_id, String ## DEPRECATED attribute :source, String end class OrderAdapter < BaseAdapter end end end
Set class_name for Order addresses
Set class_name for Order addresses
Ruby
mit
tradegecko/gecko
ruby
## Code Before: require 'gecko/record/base' module Gecko module Record class Order < Base has_many :fulfillments has_many :invoices has_many :order_line_items belongs_to :company belongs_to :shipping_address belongs_to :billing_address belongs_to :user belongs_to :assignee, class_name: "User" belongs_to :stock_location, class_name: "Location" belongs_to :currency attribute :order_number, String attribute :phone_number, String attribute :email, String attribute :notes, String attribute :reference_number, String attribute :status, String attribute :payment_status, String attribute :invoice_status, String attribute :invoice_numbers, Hash[Integer => String] attribute :packed_status, String attribute :fulfillment_status, String attribute :tax_type, String attribute :issued_at, Date attribute :ship_at, Date attribute :tax_override, String attribute :tax_label, String attribute :tracking_number, String attribute :source_url, String attribute :total, BigDecimal attribute :source_id, String ## DEPRECATED attribute :source, String end class OrderAdapter < BaseAdapter end end end ## Instruction: Set class_name for Order addresses ## Code After: require 'gecko/record/base' module Gecko module Record class Order < Base has_many :fulfillments has_many :invoices has_many :order_line_items belongs_to :company belongs_to :shipping_address, class_name: "Address" belongs_to :billing_address, class_name: "Address" belongs_to :user belongs_to :assignee, class_name: "User" belongs_to :stock_location, class_name: "Location" belongs_to :currency attribute :order_number, String attribute :phone_number, String attribute :email, String attribute :notes, String attribute :reference_number, String attribute :status, String attribute :payment_status, String attribute :invoice_status, String attribute :invoice_numbers, Hash[Integer => String] attribute :packed_status, String attribute :fulfillment_status, String attribute :tax_type, String attribute :issued_at, Date attribute :ship_at, Date attribute :tax_override, String attribute :tax_label, String attribute :tracking_number, String attribute :source_url, String attribute :total, BigDecimal attribute :source_id, String ## DEPRECATED attribute :source, String end class OrderAdapter < BaseAdapter end end end
require 'gecko/record/base' module Gecko module Record class Order < Base has_many :fulfillments has_many :invoices has_many :order_line_items belongs_to :company - belongs_to :shipping_address - belongs_to :billing_address + belongs_to :shipping_address, class_name: "Address" + belongs_to :billing_address, class_name: "Address" belongs_to :user belongs_to :assignee, class_name: "User" belongs_to :stock_location, class_name: "Location" belongs_to :currency attribute :order_number, String attribute :phone_number, String attribute :email, String attribute :notes, String attribute :reference_number, String attribute :status, String attribute :payment_status, String attribute :invoice_status, String attribute :invoice_numbers, Hash[Integer => String] attribute :packed_status, String attribute :fulfillment_status, String attribute :tax_type, String attribute :issued_at, Date attribute :ship_at, Date attribute :tax_override, String attribute :tax_label, String attribute :tracking_number, String attribute :source_url, String attribute :total, BigDecimal attribute :source_id, String ## DEPRECATED attribute :source, String end class OrderAdapter < BaseAdapter end end end
4
0.086957
2
2
2cdef982d4803e6c770d92e1ffd00974341c0916
src/Oro/Bundle/EmailBundle/Model/EmailTemplateInterface.php
src/Oro/Bundle/EmailBundle/Model/EmailTemplateInterface.php
<?php namespace Oro\Bundle\EmailBundle\Model; /** * Represents an email message template */ interface EmailTemplateInterface { /** * Gets email template type * * @return string */ public function getType(); /** * Gets email subject * * @return string */ public function getSubject(); /** * Gets email template content * * @return string */ public function getContent(); /** * Sets email template content * * @param string $content * @return EmailTemplateInterface */ public function setContent($content); /** * Sets email subject * * @param string $subject * @return EmailTemplateInterface */ public function setSubject($subject); }
<?php namespace Oro\Bundle\EmailBundle\Model; /** * Represents an email message template */ interface EmailTemplateInterface { /** * Gets email template type * * @return string */ public function getType(); /** * Gets email subject * * @return string */ public function getSubject(); /** * Gets email template content * * @return string */ public function getContent(); /** * Sets email template content * * @param string $content * * @return EmailTemplateInterface */ public function setContent($content); /** * Sets email subject * * @param string $subject * * @return EmailTemplateInterface */ public function setSubject($subject); }
Fix Major issues mentioned in Scrutinizer builds - Edit
BAP-4676: Fix Major issues mentioned in Scrutinizer builds - Edit
PHP
mit
morontt/platform,Djamy/platform,northdakota/platform,2ndkauboy/platform,ramunasd/platform,orocrm/platform,orocrm/platform,trustify/oroplatform,Djamy/platform,geoffroycochard/platform,ramunasd/platform,hugeval/platform,orocrm/platform,geoffroycochard/platform,morontt/platform,2ndkauboy/platform,ramunasd/platform,hugeval/platform,morontt/platform,hugeval/platform,2ndkauboy/platform,geoffroycochard/platform,trustify/oroplatform,Djamy/platform,trustify/oroplatform,northdakota/platform,northdakota/platform
php
## Code Before: <?php namespace Oro\Bundle\EmailBundle\Model; /** * Represents an email message template */ interface EmailTemplateInterface { /** * Gets email template type * * @return string */ public function getType(); /** * Gets email subject * * @return string */ public function getSubject(); /** * Gets email template content * * @return string */ public function getContent(); /** * Sets email template content * * @param string $content * @return EmailTemplateInterface */ public function setContent($content); /** * Sets email subject * * @param string $subject * @return EmailTemplateInterface */ public function setSubject($subject); } ## Instruction: BAP-4676: Fix Major issues mentioned in Scrutinizer builds - Edit ## Code After: <?php namespace Oro\Bundle\EmailBundle\Model; /** * Represents an email message template */ interface EmailTemplateInterface { /** * Gets email template type * * @return string */ public function getType(); /** * Gets email subject * * @return string */ public function getSubject(); /** * Gets email template content * * @return string */ public function getContent(); /** * Sets email template content * * @param string $content * * @return EmailTemplateInterface */ public function setContent($content); /** * Sets email subject * * @param string $subject * * @return EmailTemplateInterface */ public function setSubject($subject); }
<?php namespace Oro\Bundle\EmailBundle\Model; /** * Represents an email message template */ interface EmailTemplateInterface { /** * Gets email template type * * @return string */ public function getType(); /** * Gets email subject * * @return string */ public function getSubject(); /** * Gets email template content * * @return string */ public function getContent(); /** * Sets email template content * * @param string $content + * * @return EmailTemplateInterface */ public function setContent($content); /** * Sets email subject * * @param string $subject + * * @return EmailTemplateInterface */ public function setSubject($subject); }
2
0.043478
2
0
22a98ddc7fd16c4b2e6cb7c020d96bc971d26196
devops/chat-ops/cloudwatch-alarms/src/channels.js
devops/chat-ops/cloudwatch-alarms/src/channels.js
/** @typedef {import('./index').EventBridgeCloudWatchAlarmsEvent} EventBridgeCloudWatchAlarmsEvent */ module.exports = { /** * @param {EventBridgeCloudWatchAlarmsEvent} event * @returns {String} A Slack channel identifier */ channel(event) { const name = event.detail.alarmName; if (name.startsWith('FATAL')) { return '#ops-fatal'; } else if (name.startsWith('ERROR')) { return '#ops-error'; } // } else if (name.startsWith('WARN')) { // return '#ops-warn'; // } else if (name.startsWith('INFO')) { // return '#ops-info'; // } else if (name.startsWith('CRITICAL')) { // return '#ops-info'; // } else if (name.startsWith('MAJOR')) { // return '#ops-info'; // } else if (name.startsWith('MINOR')) { // return '#ops-info'; // } return '#sandbox2'; }, };
/** @typedef {import('./index').EventBridgeCloudWatchAlarmsEvent} EventBridgeCloudWatchAlarmsEvent */ module.exports = { /** * @param {EventBridgeCloudWatchAlarmsEvent} event * @returns {String} A Slack channel identifier */ channel(event) { const name = event.detail.alarmName; if (name.startsWith('FATAL')) { return '#ops-fatal'; } else if (name.startsWith('ERROR')) { return '#ops-error'; } else if (name.startsWith('WARN')) { return '#ops-warn'; } // } else if (name.startsWith('WARN')) { // return '#ops-warn'; // } else if (name.startsWith('INFO')) { // return '#ops-info'; // } else if (name.startsWith('CRITICAL')) { // return '#ops-info'; // } else if (name.startsWith('MAJOR')) { // return '#ops-info'; // } else if (name.startsWith('MINOR')) { // return '#ops-info'; // } return '#sandbox2'; }, };
Send WARN alarms to ops-warn
Send WARN alarms to ops-warn
JavaScript
mit
PRX/Infrastructure,PRX/Infrastructure,PRX/Infrastructure,PRX/Infrastructure,PRX/Infrastructure
javascript
## Code Before: /** @typedef {import('./index').EventBridgeCloudWatchAlarmsEvent} EventBridgeCloudWatchAlarmsEvent */ module.exports = { /** * @param {EventBridgeCloudWatchAlarmsEvent} event * @returns {String} A Slack channel identifier */ channel(event) { const name = event.detail.alarmName; if (name.startsWith('FATAL')) { return '#ops-fatal'; } else if (name.startsWith('ERROR')) { return '#ops-error'; } // } else if (name.startsWith('WARN')) { // return '#ops-warn'; // } else if (name.startsWith('INFO')) { // return '#ops-info'; // } else if (name.startsWith('CRITICAL')) { // return '#ops-info'; // } else if (name.startsWith('MAJOR')) { // return '#ops-info'; // } else if (name.startsWith('MINOR')) { // return '#ops-info'; // } return '#sandbox2'; }, }; ## Instruction: Send WARN alarms to ops-warn ## Code After: /** @typedef {import('./index').EventBridgeCloudWatchAlarmsEvent} EventBridgeCloudWatchAlarmsEvent */ module.exports = { /** * @param {EventBridgeCloudWatchAlarmsEvent} event * @returns {String} A Slack channel identifier */ channel(event) { const name = event.detail.alarmName; if (name.startsWith('FATAL')) { return '#ops-fatal'; } else if (name.startsWith('ERROR')) { return '#ops-error'; } else if (name.startsWith('WARN')) { return '#ops-warn'; } // } else if (name.startsWith('WARN')) { // return '#ops-warn'; // } else if (name.startsWith('INFO')) { // return '#ops-info'; // } else if (name.startsWith('CRITICAL')) { // return '#ops-info'; // } else if (name.startsWith('MAJOR')) { // return '#ops-info'; // } else if (name.startsWith('MINOR')) { // return '#ops-info'; // } return '#sandbox2'; }, };
/** @typedef {import('./index').EventBridgeCloudWatchAlarmsEvent} EventBridgeCloudWatchAlarmsEvent */ module.exports = { /** * @param {EventBridgeCloudWatchAlarmsEvent} event * @returns {String} A Slack channel identifier */ channel(event) { const name = event.detail.alarmName; if (name.startsWith('FATAL')) { return '#ops-fatal'; } else if (name.startsWith('ERROR')) { return '#ops-error'; + } else if (name.startsWith('WARN')) { + return '#ops-warn'; } // } else if (name.startsWith('WARN')) { // return '#ops-warn'; // } else if (name.startsWith('INFO')) { // return '#ops-info'; // } else if (name.startsWith('CRITICAL')) { // return '#ops-info'; // } else if (name.startsWith('MAJOR')) { // return '#ops-info'; // } else if (name.startsWith('MINOR')) { // return '#ops-info'; // } return '#sandbox2'; }, };
2
0.066667
2
0
9b1b02dd69d73f3e4446b3811afc17fd9acdd7cd
.github/PULL_REQUEST_TEMPLATE.md
.github/PULL_REQUEST_TEMPLATE.md
* [ ] The code complies with the [Coding Guidelines for C#](https://www.csharpcodingguidelines.com/). * [ ] The changes are covered by a new or existing set of unit tests which follow the Arrange-Act-Assert syntax such as is used [in this example](https://github.com/fluentassertions/fluentassertions/blob/daaf35b9b59b622c96d0c034e8972a020b2bee55/Tests/FluentAssertions.Shared.Specs/BasicEquivalencySpecs.cs#L33). * [ ] If the contribution affects the documentation, please include your changes to [**documentation.md**](https://github.com/fluentassertions/fluentassertions/blob/master/docs/_pages/documentation.md) in this pull request so the documentation will appear on the [website](https://www.fluentassertions.com).
* [ ] The code complies with the [Coding Guidelines for C#](https://www.csharpcodingguidelines.com/). * [ ] The changes are covered by a new or existing set of unit tests which follow the Arrange-Act-Assert syntax such as is used [in this example](https://github.com/fluentassertions/fluentassertions/blob/daaf35b9b59b622c96d0c034e8972a020b2bee55/Tests/FluentAssertions.Shared.Specs/BasicEquivalencySpecs.cs#L33). * [ ] If the contribution affects [the documentation](https://github.com/fluentassertions/fluentassertions/tree/master/docs/_pages), please include your changes in this pull request so the documentation will appear on the [website](https://www.fluentassertions.com).
Fix link to documentation in pull request template
Fix link to documentation in pull request template
Markdown
apache-2.0
dennisdoomen/fluentassertions,jnyrup/fluentassertions,fluentassertions/fluentassertions,fluentassertions/fluentassertions,jnyrup/fluentassertions,dennisdoomen/fluentassertions
markdown
## Code Before: * [ ] The code complies with the [Coding Guidelines for C#](https://www.csharpcodingguidelines.com/). * [ ] The changes are covered by a new or existing set of unit tests which follow the Arrange-Act-Assert syntax such as is used [in this example](https://github.com/fluentassertions/fluentassertions/blob/daaf35b9b59b622c96d0c034e8972a020b2bee55/Tests/FluentAssertions.Shared.Specs/BasicEquivalencySpecs.cs#L33). * [ ] If the contribution affects the documentation, please include your changes to [**documentation.md**](https://github.com/fluentassertions/fluentassertions/blob/master/docs/_pages/documentation.md) in this pull request so the documentation will appear on the [website](https://www.fluentassertions.com). ## Instruction: Fix link to documentation in pull request template ## Code After: * [ ] The code complies with the [Coding Guidelines for C#](https://www.csharpcodingguidelines.com/). * [ ] The changes are covered by a new or existing set of unit tests which follow the Arrange-Act-Assert syntax such as is used [in this example](https://github.com/fluentassertions/fluentassertions/blob/daaf35b9b59b622c96d0c034e8972a020b2bee55/Tests/FluentAssertions.Shared.Specs/BasicEquivalencySpecs.cs#L33). * [ ] If the contribution affects [the documentation](https://github.com/fluentassertions/fluentassertions/tree/master/docs/_pages), please include your changes in this pull request so the documentation will appear on the [website](https://www.fluentassertions.com).
* [ ] The code complies with the [Coding Guidelines for C#](https://www.csharpcodingguidelines.com/). * [ ] The changes are covered by a new or existing set of unit tests which follow the Arrange-Act-Assert syntax such as is used [in this example](https://github.com/fluentassertions/fluentassertions/blob/daaf35b9b59b622c96d0c034e8972a020b2bee55/Tests/FluentAssertions.Shared.Specs/BasicEquivalencySpecs.cs#L33). - * [ ] If the contribution affects the documentation, please include your changes to [**documentation.md**](https://github.com/fluentassertions/fluentassertions/blob/master/docs/_pages/documentation.md) in this pull request so the documentation will appear on the [website](https://www.fluentassertions.com). ? -------------------------------------------------- ^^^^^^^^^^^^^^^^^^^^ ^^^^ ----------------- + * [ ] If the contribution affects [the documentation](https://github.com/fluentassertions/fluentassertions/tree/master/docs/_pages), please include your changes in this pull request so the documentation will appear on the [website](https://www.fluentassertions.com). ? ^^^^^^^^^^^^^^^^^ ^^^^ +++++++++++++++++++++++++++++
2
0.5
1
1
bd50ef20cf470e7d0c26bb1419e2f854f885a811
config/schedule.rb
config/schedule.rb
env 'PATH', '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' every :day, at: '9:00am' do runner 'Assignment.send_reminders!' end
env 'PATH', '/opt/ruby/bin:/usr/sbin:/usr/bin:/sbin:/bin' every :day, at: '9:00am' do runner 'Assignment.send_reminders!' end
Change the path to where ruby will be
Change the path to where ruby will be
Ruby
mit
umts/screaming-dinosaur,umts/garrulous-garbanzo,umts/screaming-dinosaur,umts/garrulous-garbanzo,umts/screaming-dinosaur,umts/garrulous-garbanzo
ruby
## Code Before: env 'PATH', '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' every :day, at: '9:00am' do runner 'Assignment.send_reminders!' end ## Instruction: Change the path to where ruby will be ## Code After: env 'PATH', '/opt/ruby/bin:/usr/sbin:/usr/bin:/sbin:/bin' every :day, at: '9:00am' do runner 'Assignment.send_reminders!' end
- env 'PATH', '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' ? ---------- ^^^^^^^^^^^^^ + env 'PATH', '/opt/ruby/bin:/usr/sbin:/usr/bin:/sbin:/bin' ? +++++ ^ every :day, at: '9:00am' do runner 'Assignment.send_reminders!' end
2
0.4
1
1
c02dd8f9919886b31d3cf8b84d70aa458562e19f
README.md
README.md
Procedural planet generator using WebGL made for the course TNM084 (Procedural Methods for Images) at Linköping University. ### Setup Make sure you have [Node.js](https://nodejs.org/en/) installed. Then, install `grunt-cli` and our our dependencies using: ```bash npm install -g grunt-cli npm install ``` ### Run Run the application for development: ```bash grunt dev ``` Then open [`localhost:3000`](http://localhost:3000) in your browser (preferably Chrome(ium)). ### Build and Deploy Build it for deployment: ```bash grunt deploy ``` This builds, minifies and hashes the JS, followed by appending the hash to the file name. This busts the cache if the file has changed. (It also changes the reference to the js file in [`index.html`](index.html).) Then deploy this to your favourite static hosting solution.
Procedural planet generator using WebGL made for the course TNM084 (Procedural Methods for Images) at Linköping University. [![Screen shot](report/images/app.png)](http://klaseskilson.se/TNM084-my-little-planet/) ### Setup Make sure you have [Node.js](https://nodejs.org/en/) installed. Then, install `grunt-cli` and our our dependencies using: ```bash npm install -g grunt-cli npm install ``` ### Run Run the application for development: ```bash grunt dev ``` Then open [`localhost:3000`](http://localhost:3000) in your browser (preferably Chrome(ium)). ### Build and Deploy Build it for deployment: ```bash grunt deploy ``` This builds, minifies and hashes the JS, followed by appending the hash to the file name. This busts the cache if the file has changed. (It also changes the reference to the js file in [`index.html`](index.html).) Then deploy this to your favourite static hosting solution.
Add screen shot to readme
Add screen shot to readme
Markdown
isc
klaseskilson/TNM084-my-little-planet,klaseskilson/TNM084-my-little-planet
markdown
## Code Before: Procedural planet generator using WebGL made for the course TNM084 (Procedural Methods for Images) at Linköping University. ### Setup Make sure you have [Node.js](https://nodejs.org/en/) installed. Then, install `grunt-cli` and our our dependencies using: ```bash npm install -g grunt-cli npm install ``` ### Run Run the application for development: ```bash grunt dev ``` Then open [`localhost:3000`](http://localhost:3000) in your browser (preferably Chrome(ium)). ### Build and Deploy Build it for deployment: ```bash grunt deploy ``` This builds, minifies and hashes the JS, followed by appending the hash to the file name. This busts the cache if the file has changed. (It also changes the reference to the js file in [`index.html`](index.html).) Then deploy this to your favourite static hosting solution. ## Instruction: Add screen shot to readme ## Code After: Procedural planet generator using WebGL made for the course TNM084 (Procedural Methods for Images) at Linköping University. [![Screen shot](report/images/app.png)](http://klaseskilson.se/TNM084-my-little-planet/) ### Setup Make sure you have [Node.js](https://nodejs.org/en/) installed. Then, install `grunt-cli` and our our dependencies using: ```bash npm install -g grunt-cli npm install ``` ### Run Run the application for development: ```bash grunt dev ``` Then open [`localhost:3000`](http://localhost:3000) in your browser (preferably Chrome(ium)). ### Build and Deploy Build it for deployment: ```bash grunt deploy ``` This builds, minifies and hashes the JS, followed by appending the hash to the file name. This busts the cache if the file has changed. (It also changes the reference to the js file in [`index.html`](index.html).) Then deploy this to your favourite static hosting solution.
Procedural planet generator using WebGL made for the course TNM084 (Procedural Methods for Images) at Linköping University. + + [![Screen shot](report/images/app.png)](http://klaseskilson.se/TNM084-my-little-planet/) ### Setup Make sure you have [Node.js](https://nodejs.org/en/) installed. Then, install `grunt-cli` and our our dependencies using: ```bash npm install -g grunt-cli npm install ``` ### Run Run the application for development: ```bash grunt dev ``` Then open [`localhost:3000`](http://localhost:3000) in your browser (preferably Chrome(ium)). ### Build and Deploy Build it for deployment: ```bash grunt deploy ``` This builds, minifies and hashes the JS, followed by appending the hash to the file name. This busts the cache if the file has changed. (It also changes the reference to the js file in [`index.html`](index.html).) Then deploy this to your favourite static hosting solution.
2
0.052632
2
0
d610ef7ad9ea74192e36f232f2a67f61f0ad09f1
app/helpers/search_summary_manifest.yml
app/helpers/search_summary_manifest.yml
- id: categories label: categories labelPreposition: under the filtersPreposition: conjunction: and - id: pricing label: labelePreposition: filtersPreposition: with a conjunction: and a - id: minimum_contract_period label: Minimum contract period namePreposition: with a filtersPreposition: of an conjunction: of an - id: service_management name: namePreposition: filtersPreposition: where conjunction: of an filters: - id: dataExtractionRemoval preposition: they have a - id: datacentresEUCode preposition: their - id: dataBackupRecovery preposition: they have a - id: selfServiceProvisioning preposition: they have - id: supportForThirdParties preposition: - id: datacentre_tier name: datacentre tiers namePreposition: with filtersPreposition: to the levels conjunction: and - id: networks-the-service-is-directly-connected-to name: directly connected to the networks\: namePreposition: filtersPreposition: conjunction: and - id: interoperability name: namePreposition: filtersPreposition: conjunction: and
- id: Categories label: categories labelPreposition: under the filtersPreposition: conjunction: and - id: Pricing label: labelPreposition: filtersPreposition: with a conjunction: and a - id: Minimum contract period label: minimum contract period labelPreposition: with a filtersPreposition: of an conjunction: of an - id: Service management label: labelPreposition: filtersPreposition: where conjunction: of an filters: - id: dataExtractionRemoval preposition: they have a - id: datacentresEUCode preposition: their - id: dataBackupRecovery preposition: they have a - id: selfServiceProvisioning preposition: they have - id: supportForThirdParties preposition: - id: Datacentre tier label: datacentre tiers labelPreposition: with filtersPreposition: to the levels conjunction: and - id: Networks the service is directly connected to label: "directly connected to the networks:" labelPreposition: filtersPreposition: conjunction: and - id: Interoperability label: labelPreposition: filtersPreposition: conjunction: and
Make entries in summary manifest uniform
Make entries in summary manifest uniform
YAML
mit
mtekel/digitalmarketplace-buyer-frontend,alphagov/digitalmarketplace-buyer-frontend,alphagov/digitalmarketplace-buyer-frontend,AusDTO/dto-digitalmarketplace-buyer-frontend,mtekel/digitalmarketplace-buyer-frontend,alphagov/digitalmarketplace-buyer-frontend,alphagov/digitalmarketplace-buyer-frontend,AusDTO/dto-digitalmarketplace-buyer-frontend,AusDTO/dto-digitalmarketplace-buyer-frontend,mtekel/digitalmarketplace-buyer-frontend,mtekel/digitalmarketplace-buyer-frontend,AusDTO/dto-digitalmarketplace-buyer-frontend
yaml
## Code Before: - id: categories label: categories labelPreposition: under the filtersPreposition: conjunction: and - id: pricing label: labelePreposition: filtersPreposition: with a conjunction: and a - id: minimum_contract_period label: Minimum contract period namePreposition: with a filtersPreposition: of an conjunction: of an - id: service_management name: namePreposition: filtersPreposition: where conjunction: of an filters: - id: dataExtractionRemoval preposition: they have a - id: datacentresEUCode preposition: their - id: dataBackupRecovery preposition: they have a - id: selfServiceProvisioning preposition: they have - id: supportForThirdParties preposition: - id: datacentre_tier name: datacentre tiers namePreposition: with filtersPreposition: to the levels conjunction: and - id: networks-the-service-is-directly-connected-to name: directly connected to the networks\: namePreposition: filtersPreposition: conjunction: and - id: interoperability name: namePreposition: filtersPreposition: conjunction: and ## Instruction: Make entries in summary manifest uniform ## Code After: - id: Categories label: categories labelPreposition: under the filtersPreposition: conjunction: and - id: Pricing label: labelPreposition: filtersPreposition: with a conjunction: and a - id: Minimum contract period label: minimum contract period labelPreposition: with a filtersPreposition: of an conjunction: of an - id: Service management label: labelPreposition: filtersPreposition: where conjunction: of an filters: - id: dataExtractionRemoval preposition: they have a - id: datacentresEUCode preposition: their - id: dataBackupRecovery preposition: they have a - id: selfServiceProvisioning preposition: they have - id: supportForThirdParties preposition: - id: Datacentre tier label: datacentre tiers labelPreposition: with filtersPreposition: to the levels conjunction: and - id: Networks the service is directly connected to label: "directly connected to the networks:" labelPreposition: filtersPreposition: conjunction: and - id: Interoperability label: labelPreposition: filtersPreposition: conjunction: and
- - id: categories ? ^ + id: Categories ? ^ label: categories labelPreposition: under the filtersPreposition: conjunction: and - - id: pricing ? ^ + id: Pricing ? ^ label: - labelePreposition: ? - + labelPreposition: filtersPreposition: with a conjunction: and a - - id: minimum_contract_period ? ^ ^ ^ + id: Minimum contract period ? ^ ^ ^ - label: Minimum contract period ? ^ + label: minimum contract period ? ^ - namePreposition: with a ? ^ ^ + labelPreposition: with a ? ^ ^ + filtersPreposition: of an conjunction: of an - - id: service_management ? ^ ^ + id: Service management ? ^ ^ - name: + label: - namePreposition: ? ^ ^ + labelPreposition: ? ^ ^ + filtersPreposition: where conjunction: of an filters: - id: dataExtractionRemoval preposition: they have a - id: datacentresEUCode preposition: their - id: dataBackupRecovery preposition: they have a - id: selfServiceProvisioning preposition: they have - id: supportForThirdParties preposition: - - id: datacentre_tier ? ^ ^ + id: Datacentre tier ? ^ ^ - name: datacentre tiers ? ^ ^ + label: datacentre tiers ? ^ ^ + - namePreposition: with ? ^ ^ + labelPreposition: with ? ^ ^ + filtersPreposition: to the levels conjunction: and - - id: networks-the-service-is-directly-connected-to ? ^ ^ ^ ^ ^ ^ ^ + id: Networks the service is directly connected to ? ^ ^ ^ ^ ^ ^ ^ - name: directly connected to the networks\: ? ^ ^ - + label: "directly connected to the networks:" ? ^ ^ + + + - namePreposition: ? ^ ^ + labelPreposition: ? ^ ^ + filtersPreposition: conjunction: and - - id: interoperability ? ^ + id: Interoperability ? ^ - name: + label: - namePreposition: ? ^ ^ + labelPreposition: ? ^ ^ + filtersPreposition: conjunction: and
36
0.62069
18
18
7a9ca4a397c8b04e3585432f7ff941faa18a89c2
server/logger.go
server/logger.go
package server import ( "net/http" "github.com/influxdata/chronograf" ) // Logger is middleware that logs the request func Logger(logger chronograf.Logger, next http.Handler) http.Handler { fn := func(w http.ResponseWriter, r *http.Request) { logger. WithField("component", "server"). WithField("remote_addr", r.RemoteAddr). WithField("method", r.Method). WithField("url", r.URL). Info("Request") next.ServeHTTP(w, r) } return http.HandlerFunc(fn) }
package server import ( "net/http" "time" "github.com/influxdata/chronograf" ) // Logger is middleware that logs the request func Logger(logger chronograf.Logger, next http.Handler) http.Handler { fn := func(w http.ResponseWriter, r *http.Request) { now := time.Now() logger. WithField("component", "server"). WithField("remote_addr", r.RemoteAddr). WithField("method", r.Method). WithField("url", r.URL). Info("Request") next.ServeHTTP(w, r) later := time.Now() elapsed := later.Sub(now) logger. WithField("component", "server"). WithField("remote_addr", r.RemoteAddr). WithField("response_time", elapsed.String()). Info("Success") } return http.HandlerFunc(fn) }
Add logging of response times
Add logging of response times This makes monitoring Chronograf :+1:
Go
agpl-3.0
brianbaker/chronograf,brianbaker/chronograf,brianbaker/chronograf,brianbaker/chronograf,brianbaker/chronograf
go
## Code Before: package server import ( "net/http" "github.com/influxdata/chronograf" ) // Logger is middleware that logs the request func Logger(logger chronograf.Logger, next http.Handler) http.Handler { fn := func(w http.ResponseWriter, r *http.Request) { logger. WithField("component", "server"). WithField("remote_addr", r.RemoteAddr). WithField("method", r.Method). WithField("url", r.URL). Info("Request") next.ServeHTTP(w, r) } return http.HandlerFunc(fn) } ## Instruction: Add logging of response times This makes monitoring Chronograf :+1: ## Code After: package server import ( "net/http" "time" "github.com/influxdata/chronograf" ) // Logger is middleware that logs the request func Logger(logger chronograf.Logger, next http.Handler) http.Handler { fn := func(w http.ResponseWriter, r *http.Request) { now := time.Now() logger. WithField("component", "server"). WithField("remote_addr", r.RemoteAddr). WithField("method", r.Method). WithField("url", r.URL). Info("Request") next.ServeHTTP(w, r) later := time.Now() elapsed := later.Sub(now) logger. WithField("component", "server"). WithField("remote_addr", r.RemoteAddr). WithField("response_time", elapsed.String()). Info("Success") } return http.HandlerFunc(fn) }
package server import ( "net/http" + "time" "github.com/influxdata/chronograf" ) // Logger is middleware that logs the request func Logger(logger chronograf.Logger, next http.Handler) http.Handler { fn := func(w http.ResponseWriter, r *http.Request) { + now := time.Now() logger. WithField("component", "server"). WithField("remote_addr", r.RemoteAddr). WithField("method", r.Method). WithField("url", r.URL). Info("Request") next.ServeHTTP(w, r) + later := time.Now() + elapsed := later.Sub(now) + + logger. + WithField("component", "server"). + WithField("remote_addr", r.RemoteAddr). + WithField("response_time", elapsed.String()). + Info("Success") } return http.HandlerFunc(fn) }
10
0.47619
10
0
44807c6a0d55ed7603b1a1ed835fd306687bbf33
install.sh
install.sh
ln -s .bash_profile ~/.bash_profile
ln -s .bash_profile ~/.bash_profile git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
Add git lg for pretty log prints
Add git lg for pretty log prints
Shell
mit
Ozmodiar/dotfiles
shell
## Code Before: ln -s .bash_profile ~/.bash_profile ## Instruction: Add git lg for pretty log prints ## Code After: ln -s .bash_profile ~/.bash_profile git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
ln -s .bash_profile ~/.bash_profile + + + git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
3
1.5
3
0
241131e3e9d3b31d2adee6a4fadcd03a00b9eeae
pubspec.yaml
pubspec.yaml
name: observe version: 0.9.0 author: Web UI Team <web-ui-dev@dartlang.org> description: > Observable properties and objects for use in Model-Driven-Views (MDV). MDV extends HTML and the DOM APIs to support a sensible separation between the UI (DOM) of a document or application and its underlying data (model). Updates to the model are reflected in the DOM and user input into the DOM is immediately assigned to the model. homepage: https://www.dartlang.org/polymer-dart/ dependencies: analyzer: ">=0.10.1 <0.11.0" barback: ">=0.9.0 <0.10.0" logging: ">=0.9.0 <0.10.0" path: ">=0.9.0 <0.10.0" source_maps: ">=0.9.0 <0.10.0" dev_dependencies: unittest: ">=0.9.0 <0.10.0" environment: sdk: ">=1.0.0 <2.0.0"
name: observe author: Web UI Team <web-ui-dev@dartlang.org> description: > Observable properties and objects for use in Model-Driven-Views (MDV). MDV extends HTML and the DOM APIs to support a sensible separation between the UI (DOM) of a document or application and its underlying data (model). Updates to the model are reflected in the DOM and user input into the DOM is immediately assigned to the model. homepage: https://www.dartlang.org/polymer-dart/ dependencies: analyzer: any barback: any logging: any path: any source_maps: any dev_dependencies: unittest: any
Revert "add versions and constraints for packages and samples"
Revert "add versions and constraints for packages and samples" This is currently blocking us from testing samples. BUG= R=kasperl@google.com Review URL: https://codereview.chromium.org//59513007 git-svn-id: dae132d4ca6f88932ad8a9ec3641c81ad1592b72@29960 260f80e4-7a28-3924-810f-c04153c831b5
YAML
bsd-3-clause
dart-archive/observe,dart-lang/observe
yaml
## Code Before: name: observe version: 0.9.0 author: Web UI Team <web-ui-dev@dartlang.org> description: > Observable properties and objects for use in Model-Driven-Views (MDV). MDV extends HTML and the DOM APIs to support a sensible separation between the UI (DOM) of a document or application and its underlying data (model). Updates to the model are reflected in the DOM and user input into the DOM is immediately assigned to the model. homepage: https://www.dartlang.org/polymer-dart/ dependencies: analyzer: ">=0.10.1 <0.11.0" barback: ">=0.9.0 <0.10.0" logging: ">=0.9.0 <0.10.0" path: ">=0.9.0 <0.10.0" source_maps: ">=0.9.0 <0.10.0" dev_dependencies: unittest: ">=0.9.0 <0.10.0" environment: sdk: ">=1.0.0 <2.0.0" ## Instruction: Revert "add versions and constraints for packages and samples" This is currently blocking us from testing samples. BUG= R=kasperl@google.com Review URL: https://codereview.chromium.org//59513007 git-svn-id: dae132d4ca6f88932ad8a9ec3641c81ad1592b72@29960 260f80e4-7a28-3924-810f-c04153c831b5 ## Code After: name: observe author: Web UI Team <web-ui-dev@dartlang.org> description: > Observable properties and objects for use in Model-Driven-Views (MDV). MDV extends HTML and the DOM APIs to support a sensible separation between the UI (DOM) of a document or application and its underlying data (model). Updates to the model are reflected in the DOM and user input into the DOM is immediately assigned to the model. homepage: https://www.dartlang.org/polymer-dart/ dependencies: analyzer: any barback: any logging: any path: any source_maps: any dev_dependencies: unittest: any
name: observe - version: 0.9.0 author: Web UI Team <web-ui-dev@dartlang.org> description: > Observable properties and objects for use in Model-Driven-Views (MDV). MDV extends HTML and the DOM APIs to support a sensible separation between the UI (DOM) of a document or application and its underlying data (model). Updates to the model are reflected in the DOM and user input into the DOM is immediately assigned to the model. homepage: https://www.dartlang.org/polymer-dart/ dependencies: - analyzer: ">=0.10.1 <0.11.0" - barback: ">=0.9.0 <0.10.0" - logging: ">=0.9.0 <0.10.0" - path: ">=0.9.0 <0.10.0" - source_maps: ">=0.9.0 <0.10.0" + analyzer: any + barback: any + logging: any + path: any + source_maps: any dev_dependencies: + unittest: any - unittest: ">=0.9.0 <0.10.0" - environment: - sdk: ">=1.0.0 <2.0.0"
15
0.75
6
9
5938a872641614d7f4a6af8505791f2aa68df701
packages/components/containers/filePreview/UnsupportedPreview.tsx
packages/components/containers/filePreview/UnsupportedPreview.tsx
import React from 'react'; import { c } from 'ttag'; import unsupportedPreviewSvg from 'design-system/assets/img/errors/broken-file.svg'; import corruptedPreviewSvg from 'design-system/assets/img/errors/broken-image.svg'; import { PrimaryButton } from '../../components'; import { useActiveBreakpoint } from '../../hooks'; import { classnames } from '../../helpers'; interface Props { type?: 'file' | 'image'; onSave?: () => void; } const UnsupportedPreview = ({ onSave, type = 'file' }: Props) => { const { isNarrow } = useActiveBreakpoint(); return ( <div className="centered-absolute text-center w100 pl1 pr1"> <img className={classnames(['mb1', isNarrow ? 'w150p' : 'w200p'])} src={type === 'file' ? unsupportedPreviewSvg : corruptedPreviewSvg} alt={c('Info').t`Unsupported file`} /> <h2 className={classnames(['p0-25 text-bold', isNarrow && 'h3'])}>{c('Info').t`No preview available`}</h2> {onSave && ( <PrimaryButton size={!isNarrow ? 'large' : undefined} className={classnames(['text-bold', !isNarrow && 'w150p'])} onClick={onSave} >{c('Action').t`Download`}</PrimaryButton> )} </div> ); }; export default UnsupportedPreview;
import React from 'react'; import { c } from 'ttag'; import unsupportedPreviewSvg from 'design-system/assets/img/errors/preview-unavailable.svg'; import corruptedPreviewSvg from 'design-system/assets/img/errors/broken-image.svg'; import { PrimaryButton } from '../../components'; import { useActiveBreakpoint } from '../../hooks'; import { classnames } from '../../helpers'; interface Props { type?: 'file' | 'image'; onSave?: () => void; } const UnsupportedPreview = ({ onSave, type = 'file' }: Props) => { const { isNarrow } = useActiveBreakpoint(); return ( <div className="centered-absolute text-center w100 pl1 pr1"> <img className={classnames(['mb1', isNarrow ? 'w150p' : 'w200p'])} src={type === 'file' ? unsupportedPreviewSvg : corruptedPreviewSvg} alt={c('Info').t`Unsupported file`} /> <h2 className={classnames(['p0-25 text-bold', isNarrow && 'h3'])}>{c('Info').t`No preview available`}</h2> {onSave && ( <PrimaryButton size={!isNarrow ? 'large' : undefined} className={classnames(['text-bold', !isNarrow && 'w150p'])} onClick={onSave} >{c('Action').t`Download`}</PrimaryButton> )} </div> ); }; export default UnsupportedPreview;
Replace illustration for unavailable preview
Replace illustration for unavailable preview
TypeScript
mit
ProtonMail/WebClient,ProtonMail/WebClient,ProtonMail/WebClient
typescript
## Code Before: import React from 'react'; import { c } from 'ttag'; import unsupportedPreviewSvg from 'design-system/assets/img/errors/broken-file.svg'; import corruptedPreviewSvg from 'design-system/assets/img/errors/broken-image.svg'; import { PrimaryButton } from '../../components'; import { useActiveBreakpoint } from '../../hooks'; import { classnames } from '../../helpers'; interface Props { type?: 'file' | 'image'; onSave?: () => void; } const UnsupportedPreview = ({ onSave, type = 'file' }: Props) => { const { isNarrow } = useActiveBreakpoint(); return ( <div className="centered-absolute text-center w100 pl1 pr1"> <img className={classnames(['mb1', isNarrow ? 'w150p' : 'w200p'])} src={type === 'file' ? unsupportedPreviewSvg : corruptedPreviewSvg} alt={c('Info').t`Unsupported file`} /> <h2 className={classnames(['p0-25 text-bold', isNarrow && 'h3'])}>{c('Info').t`No preview available`}</h2> {onSave && ( <PrimaryButton size={!isNarrow ? 'large' : undefined} className={classnames(['text-bold', !isNarrow && 'w150p'])} onClick={onSave} >{c('Action').t`Download`}</PrimaryButton> )} </div> ); }; export default UnsupportedPreview; ## Instruction: Replace illustration for unavailable preview ## Code After: import React from 'react'; import { c } from 'ttag'; import unsupportedPreviewSvg from 'design-system/assets/img/errors/preview-unavailable.svg'; import corruptedPreviewSvg from 'design-system/assets/img/errors/broken-image.svg'; import { PrimaryButton } from '../../components'; import { useActiveBreakpoint } from '../../hooks'; import { classnames } from '../../helpers'; interface Props { type?: 'file' | 'image'; onSave?: () => void; } const UnsupportedPreview = ({ onSave, type = 'file' }: Props) => { const { isNarrow } = useActiveBreakpoint(); return ( <div className="centered-absolute text-center w100 pl1 pr1"> <img className={classnames(['mb1', isNarrow ? 'w150p' : 'w200p'])} src={type === 'file' ? unsupportedPreviewSvg : corruptedPreviewSvg} alt={c('Info').t`Unsupported file`} /> <h2 className={classnames(['p0-25 text-bold', isNarrow && 'h3'])}>{c('Info').t`No preview available`}</h2> {onSave && ( <PrimaryButton size={!isNarrow ? 'large' : undefined} className={classnames(['text-bold', !isNarrow && 'w150p'])} onClick={onSave} >{c('Action').t`Download`}</PrimaryButton> )} </div> ); }; export default UnsupportedPreview;
import React from 'react'; import { c } from 'ttag'; - import unsupportedPreviewSvg from 'design-system/assets/img/errors/broken-file.svg'; ? -------- + import unsupportedPreviewSvg from 'design-system/assets/img/errors/preview-unavailable.svg'; ? ++++++++++++++++ import corruptedPreviewSvg from 'design-system/assets/img/errors/broken-image.svg'; import { PrimaryButton } from '../../components'; import { useActiveBreakpoint } from '../../hooks'; import { classnames } from '../../helpers'; interface Props { type?: 'file' | 'image'; onSave?: () => void; } const UnsupportedPreview = ({ onSave, type = 'file' }: Props) => { const { isNarrow } = useActiveBreakpoint(); return ( <div className="centered-absolute text-center w100 pl1 pr1"> <img className={classnames(['mb1', isNarrow ? 'w150p' : 'w200p'])} src={type === 'file' ? unsupportedPreviewSvg : corruptedPreviewSvg} alt={c('Info').t`Unsupported file`} /> <h2 className={classnames(['p0-25 text-bold', isNarrow && 'h3'])}>{c('Info').t`No preview available`}</h2> {onSave && ( <PrimaryButton size={!isNarrow ? 'large' : undefined} className={classnames(['text-bold', !isNarrow && 'w150p'])} onClick={onSave} >{c('Action').t`Download`}</PrimaryButton> )} </div> ); }; export default UnsupportedPreview;
2
0.052632
1
1
942dca1c79c3c60307dbf7b88bcfebf53430c016
test/sphere.test.coffee
test/sphere.test.coffee
Sphere = require '../sim/sphere' Vec = require('three').Vector3 assert = require 'assert' {expect} = require 'chai' describe 'Sphere', -> it 'should trilaterate properly', -> s1 = new Sphere 1, new Vec 0, 0, 0 s2 = new Sphere 1, new Vec 1, 0, 0 s3 = new Sphere 1, new Vec .5, 1, 0 [i1, i2] = Sphere.trilaterate [s1, s2, s3] console.log i1, i2 expect(new Vec().copy(i1).distanceTo(s1.center)).to.be.closeTo s1.radius, 1e-5
Sphere = require '../sim/sphere' Vec = require('three').Vector3 assert = require 'assert' {expect} = require 'chai' describe 'Sphere', -> it 'should trilaterate properly', -> s1 = new Sphere 1, new Vec 0, 0, 0 s2 = new Sphere 1, new Vec 1, 0, 0 s3 = new Sphere 1, new Vec .5, 1, 0 [i1, i2] = Sphere.trilaterate [s1, s2, s3] [s1,s2,s3].forEach (sphere) -> [i1, i2].forEach (intersection) -> expect(new Vec().copy(intersection).distanceTo(sphere.center)).to.be.closeTo sphere.radius, 1e-5
Test all intersections against all spheres
Test all intersections against all spheres
CoffeeScript
bsd-3-clause
r24y/teleprint,r24y/teleprint,r24y/delta-calibration,r24y/delta-calibration
coffeescript
## Code Before: Sphere = require '../sim/sphere' Vec = require('three').Vector3 assert = require 'assert' {expect} = require 'chai' describe 'Sphere', -> it 'should trilaterate properly', -> s1 = new Sphere 1, new Vec 0, 0, 0 s2 = new Sphere 1, new Vec 1, 0, 0 s3 = new Sphere 1, new Vec .5, 1, 0 [i1, i2] = Sphere.trilaterate [s1, s2, s3] console.log i1, i2 expect(new Vec().copy(i1).distanceTo(s1.center)).to.be.closeTo s1.radius, 1e-5 ## Instruction: Test all intersections against all spheres ## Code After: Sphere = require '../sim/sphere' Vec = require('three').Vector3 assert = require 'assert' {expect} = require 'chai' describe 'Sphere', -> it 'should trilaterate properly', -> s1 = new Sphere 1, new Vec 0, 0, 0 s2 = new Sphere 1, new Vec 1, 0, 0 s3 = new Sphere 1, new Vec .5, 1, 0 [i1, i2] = Sphere.trilaterate [s1, s2, s3] [s1,s2,s3].forEach (sphere) -> [i1, i2].forEach (intersection) -> expect(new Vec().copy(intersection).distanceTo(sphere.center)).to.be.closeTo sphere.radius, 1e-5
Sphere = require '../sim/sphere' Vec = require('three').Vector3 assert = require 'assert' {expect} = require 'chai' describe 'Sphere', -> it 'should trilaterate properly', -> s1 = new Sphere 1, new Vec 0, 0, 0 s2 = new Sphere 1, new Vec 1, 0, 0 s3 = new Sphere 1, new Vec .5, 1, 0 [i1, i2] = Sphere.trilaterate [s1, s2, s3] - console.log i1, i2 + [s1,s2,s3].forEach (sphere) -> + [i1, i2].forEach (intersection) -> - expect(new Vec().copy(i1).distanceTo(s1.center)).to.be.closeTo s1.radius, 1e-5 ? ^ ^ ^ + expect(new Vec().copy(intersection).distanceTo(sphere.center)).to.be.closeTo sphere.radius, 1e-5 ? ++++ ^^^^^^^^^^^ ^^^^^ ^^^^^
5
0.333333
3
2
1ed5eff3305992ce184269e3ea9ffeea283b1e57
etc/vcl_snippets_basic_auth/recv.vcl
etc/vcl_snippets_basic_auth/recv.vcl
# Check Basic auth against a table. /admin URLs are no basic auth protected to avoid the possibility of people # locking themselves out if ( table.lookup(magentomodule_basic_auth, regsub(req.http.Authorization, "^Basic ", ""), "NOTFOUND") == "NOTFOUND" && req.url !~ "^/(index\.php/)?admin(_.*)?/" ) { error 971; }
# Check Basic auth against a table. /admin URLs are not basic auth protected to avoid the possibility of people # locking themselves out if ( table.lookup(magentomodule_basic_auth, regsub(req.http.Authorization, "^Basic ", ""), "NOTFOUND") == "NOTFOUND" && !req.url ~ "^/(index\.php/)?admin(_.*)?/" && !req.url ~ "^/pub/static/" ) { error 971; }
Make sure we also allow /pub/static
Make sure we also allow /pub/static
VCL
bsd-3-clause
fastly/fastly-magento2,fastly/fastly-magento2,fastly/fastly-magento2,fastly/fastly-magento2
vcl
## Code Before: # Check Basic auth against a table. /admin URLs are no basic auth protected to avoid the possibility of people # locking themselves out if ( table.lookup(magentomodule_basic_auth, regsub(req.http.Authorization, "^Basic ", ""), "NOTFOUND") == "NOTFOUND" && req.url !~ "^/(index\.php/)?admin(_.*)?/" ) { error 971; } ## Instruction: Make sure we also allow /pub/static ## Code After: # Check Basic auth against a table. /admin URLs are not basic auth protected to avoid the possibility of people # locking themselves out if ( table.lookup(magentomodule_basic_auth, regsub(req.http.Authorization, "^Basic ", ""), "NOTFOUND") == "NOTFOUND" && !req.url ~ "^/(index\.php/)?admin(_.*)?/" && !req.url ~ "^/pub/static/" ) { error 971; }
- # Check Basic auth against a table. /admin URLs are no basic auth protected to avoid the possibility of people + # Check Basic auth against a table. /admin URLs are not basic auth protected to avoid the possibility of people ? + # locking themselves out if ( table.lookup(magentomodule_basic_auth, regsub(req.http.Authorization, "^Basic ", ""), "NOTFOUND") == "NOTFOUND" && - req.url !~ "^/(index\.php/)?admin(_.*)?/" ) { ? - ^^^ + !req.url ~ "^/(index\.php/)?admin(_.*)?/" && ? + ^^ + !req.url ~ "^/pub/static/" ) { error 971; }
5
0.833333
3
2
103bf9912d106c32571a4d75bc97478f6dcfe59a
doc/development/ideas.rst
doc/development/ideas.rst
.. _development_ideas: ********************************** Ideas for future QuTiP development ********************************** Ideas for significant new features are listed here. For the general roadmap, see :doc:`roadmap`. .. toctree:: :maxdepth: 1 ideas/qutip-interactive.rst ideas/pulse-level-quantum-circuits.rst ideas/quantum-error-mitigation.rst ideas/heom-gpu.rst Completed Projects ================== These projects have been completed: .. toctree:: :maxdepth: 1 ideas/tensorflow-data-backend.rst
.. _development_ideas: ********************************** Ideas for future QuTiP development ********************************** Ideas for significant new features are listed here. For the general roadmap, see :doc:`roadmap`. .. toctree:: :maxdepth: 1 ideas/qutip-interactive.rst ideas/pulse-level-quantum-circuits.rst ideas/quantum-error-mitigation.rst ideas/heom-gpu.rst Google Summer of Code ===================== Many possible extensions and improvements to QuTiP have been documented as part of `Google Summer of Code <https://summerofcode.withgoogle.com/>`_: * `GSoC 2021 <https://github.com/qutip/qutip/wiki/Google-Summer-of-Code-2021/>`_ * `GSoC 2022 <https://github.com/qutip/qutip/wiki/Google-Summer-of-Code-2022/>`_ Completed Projects ================== These projects have been completed: .. toctree:: :maxdepth: 1 ideas/tensorflow-data-backend.rst
Add link to GSoC project lists.
Add link to GSoC project lists.
reStructuredText
bsd-3-clause
qutip/qutip,qutip/qutip
restructuredtext
## Code Before: .. _development_ideas: ********************************** Ideas for future QuTiP development ********************************** Ideas for significant new features are listed here. For the general roadmap, see :doc:`roadmap`. .. toctree:: :maxdepth: 1 ideas/qutip-interactive.rst ideas/pulse-level-quantum-circuits.rst ideas/quantum-error-mitigation.rst ideas/heom-gpu.rst Completed Projects ================== These projects have been completed: .. toctree:: :maxdepth: 1 ideas/tensorflow-data-backend.rst ## Instruction: Add link to GSoC project lists. ## Code After: .. _development_ideas: ********************************** Ideas for future QuTiP development ********************************** Ideas for significant new features are listed here. For the general roadmap, see :doc:`roadmap`. .. toctree:: :maxdepth: 1 ideas/qutip-interactive.rst ideas/pulse-level-quantum-circuits.rst ideas/quantum-error-mitigation.rst ideas/heom-gpu.rst Google Summer of Code ===================== Many possible extensions and improvements to QuTiP have been documented as part of `Google Summer of Code <https://summerofcode.withgoogle.com/>`_: * `GSoC 2021 <https://github.com/qutip/qutip/wiki/Google-Summer-of-Code-2021/>`_ * `GSoC 2022 <https://github.com/qutip/qutip/wiki/Google-Summer-of-Code-2022/>`_ Completed Projects ================== These projects have been completed: .. toctree:: :maxdepth: 1 ideas/tensorflow-data-backend.rst
.. _development_ideas: ********************************** Ideas for future QuTiP development ********************************** Ideas for significant new features are listed here. For the general roadmap, see :doc:`roadmap`. .. toctree:: :maxdepth: 1 ideas/qutip-interactive.rst ideas/pulse-level-quantum-circuits.rst ideas/quantum-error-mitigation.rst ideas/heom-gpu.rst + + Google Summer of Code + ===================== + + Many possible extensions and improvements to QuTiP have been documented as + part of `Google Summer of Code <https://summerofcode.withgoogle.com/>`_: + + * `GSoC 2021 <https://github.com/qutip/qutip/wiki/Google-Summer-of-Code-2021/>`_ + * `GSoC 2022 <https://github.com/qutip/qutip/wiki/Google-Summer-of-Code-2022/>`_ + + + Completed Projects ================== These projects have been completed: .. toctree:: :maxdepth: 1 ideas/tensorflow-data-backend.rst
12
0.461538
12
0
0db7e78d7ddce5cdd084ee523e889c5153cd9130
.travis.yml
.travis.yml
language: ruby rvm: - '2.2.1' services: - elasticsearch before_install: - sudo apt-get install -qq phantomjs before_script: - psql -c 'create database pf_engine_test;' -U postgres - psql -U postgres pf_engine_test < spec/dummy/db/structure.sql script: - bundle exec rake notifications: email: false
language: ruby rvm: - '2.2.1' services: - elasticsearch before_install: - sudo apt-get install -qq phantomjs before_script: - psql -c 'create database peoplefinder_test;' -U postgres - psql -U postgres peoplefinder_test < db/structure.sql script: - bundle exec rake notifications: email: false
Configure Travis CI to run without the engine
Configure Travis CI to run without the engine
YAML
mit
ministryofjustice/peoplefinder,MjAbuz/peoplefinder,MjAbuz/peoplefinder,ministryofjustice/peoplefinder,MjAbuz/peoplefinder,ministryofjustice/peoplefinder,ministryofjustice/peoplefinder,ministryofjustice/peoplefinder,MjAbuz/peoplefinder
yaml
## Code Before: language: ruby rvm: - '2.2.1' services: - elasticsearch before_install: - sudo apt-get install -qq phantomjs before_script: - psql -c 'create database pf_engine_test;' -U postgres - psql -U postgres pf_engine_test < spec/dummy/db/structure.sql script: - bundle exec rake notifications: email: false ## Instruction: Configure Travis CI to run without the engine ## Code After: language: ruby rvm: - '2.2.1' services: - elasticsearch before_install: - sudo apt-get install -qq phantomjs before_script: - psql -c 'create database peoplefinder_test;' -U postgres - psql -U postgres peoplefinder_test < db/structure.sql script: - bundle exec rake notifications: email: false
language: ruby rvm: - '2.2.1' services: - elasticsearch before_install: - sudo apt-get install -qq phantomjs before_script: - - psql -c 'create database pf_engine_test;' -U postgres ? ---- + - psql -c 'create database peoplefinder_test;' -U postgres ? +++++ + + - - psql -U postgres pf_engine_test < spec/dummy/db/structure.sql ? ---- ----------- + - psql -U postgres peoplefinder_test < db/structure.sql ? +++++ + + script: - bundle exec rake notifications: email: false
4
0.285714
2
2
bd2ae69320c2bc2607db824bd4f43ad61b53f2e0
app/views/quiz_instances/go.html.erb
app/views/quiz_instances/go.html.erb
<% content_for :heading do -%><%= @obj.quiz.display %><% end -%> <%= flashes! %> <%= form_tag(quiz_quiz_instance_go_path(@obj.quiz, @obj), method: :post) do %> <%= data_row(heading: t("myplaceonline.quiz_items.quiz_question"), prefix_heading: true, content: @question.quiz_question, wrap: false) %> <% @question.quiz_item_files.each do |pic| %> <p><%= image_content(pic.identity_file, true, useThumbnail: false) %></p> <% end %> <%= input_field( type: Myp::FIELD_RADIO, name: :choice, value: @choice, placeholder: "myplaceonline.quiz_items.correct_choice", radio_options: @question.quiz.available_choices, translate_radio_options: false, ) %> <%= render(partial: "shared/footer", locals: { items: [ { content: submit_tag(t("myplaceonline.general.submit"), "data-icon" => "action", "data-iconpos" => "top", style: "background-color: green") }, { title: t("myplaceonline.category.quiz_instances").singularize, link: quiz_quiz_instances_path(@obj.quiz), icon: "back", }, ] }) %> <% end %>
<% content_for :heading do -%><%= @obj.quiz.display %><% end -%> <%= flashes! %> <%= form_tag(quiz_quiz_instance_go_path(@obj.quiz, @obj), method: :post) do %> <%= data_row(heading: t("myplaceonline.quiz_items.quiz_question"), prefix_heading: true, content: @question.quiz_question, wrap: false, markdown: true) %> <% @question.quiz_item_files.each do |pic| %> <p><%= image_content(pic.identity_file, true, useThumbnail: false) %></p> <% end %> <%= input_field( type: Myp::FIELD_RADIO, name: :choice, value: @choice, placeholder: "myplaceonline.quiz_items.correct_choice", radio_options: @question.quiz.available_choices, translate_radio_options: false, ) %> <%= render(partial: "shared/footer", locals: { items: [ { content: submit_tag(t("myplaceonline.general.submit"), "data-icon" => "action", "data-iconpos" => "top", style: "background-color: green") }, { title: t("myplaceonline.category.quiz_instances").singularize, link: quiz_quiz_instances_path(@obj.quiz), icon: "back", }, ] }) %> <% end %>
Use markdown for quiz question in quiz instances
Use markdown for quiz question in quiz instances
HTML+ERB
agpl-3.0
myplaceonline/myplaceonline_rails,myplaceonline/myplaceonline_rails,myplaceonline/myplaceonline_rails
html+erb
## Code Before: <% content_for :heading do -%><%= @obj.quiz.display %><% end -%> <%= flashes! %> <%= form_tag(quiz_quiz_instance_go_path(@obj.quiz, @obj), method: :post) do %> <%= data_row(heading: t("myplaceonline.quiz_items.quiz_question"), prefix_heading: true, content: @question.quiz_question, wrap: false) %> <% @question.quiz_item_files.each do |pic| %> <p><%= image_content(pic.identity_file, true, useThumbnail: false) %></p> <% end %> <%= input_field( type: Myp::FIELD_RADIO, name: :choice, value: @choice, placeholder: "myplaceonline.quiz_items.correct_choice", radio_options: @question.quiz.available_choices, translate_radio_options: false, ) %> <%= render(partial: "shared/footer", locals: { items: [ { content: submit_tag(t("myplaceonline.general.submit"), "data-icon" => "action", "data-iconpos" => "top", style: "background-color: green") }, { title: t("myplaceonline.category.quiz_instances").singularize, link: quiz_quiz_instances_path(@obj.quiz), icon: "back", }, ] }) %> <% end %> ## Instruction: Use markdown for quiz question in quiz instances ## Code After: <% content_for :heading do -%><%= @obj.quiz.display %><% end -%> <%= flashes! %> <%= form_tag(quiz_quiz_instance_go_path(@obj.quiz, @obj), method: :post) do %> <%= data_row(heading: t("myplaceonline.quiz_items.quiz_question"), prefix_heading: true, content: @question.quiz_question, wrap: false, markdown: true) %> <% @question.quiz_item_files.each do |pic| %> <p><%= image_content(pic.identity_file, true, useThumbnail: false) %></p> <% end %> <%= input_field( type: Myp::FIELD_RADIO, name: :choice, value: @choice, placeholder: "myplaceonline.quiz_items.correct_choice", radio_options: @question.quiz.available_choices, translate_radio_options: false, ) %> <%= render(partial: "shared/footer", locals: { items: [ { content: submit_tag(t("myplaceonline.general.submit"), "data-icon" => "action", "data-iconpos" => "top", style: "background-color: green") }, { title: t("myplaceonline.category.quiz_instances").singularize, link: quiz_quiz_instances_path(@obj.quiz), icon: "back", }, ] }) %> <% end %>
<% content_for :heading do -%><%= @obj.quiz.display %><% end -%> <%= flashes! %> <%= form_tag(quiz_quiz_instance_go_path(@obj.quiz, @obj), method: :post) do %> - <%= data_row(heading: t("myplaceonline.quiz_items.quiz_question"), prefix_heading: true, content: @question.quiz_question, wrap: false) %> + <%= data_row(heading: t("myplaceonline.quiz_items.quiz_question"), prefix_heading: true, content: @question.quiz_question, wrap: false, markdown: true) %> ? ++++++++++++++++ <% @question.quiz_item_files.each do |pic| %> <p><%= image_content(pic.identity_file, true, useThumbnail: false) %></p> <% end %> <%= input_field( type: Myp::FIELD_RADIO, name: :choice, value: @choice, placeholder: "myplaceonline.quiz_items.correct_choice", radio_options: @question.quiz.available_choices, translate_radio_options: false, ) %> <%= render(partial: "shared/footer", locals: { items: [ { content: submit_tag(t("myplaceonline.general.submit"), "data-icon" => "action", "data-iconpos" => "top", style: "background-color: green") }, { title: t("myplaceonline.category.quiz_instances").singularize, link: quiz_quiz_instances_path(@obj.quiz), icon: "back", }, ] }) %> <% end %>
2
0.052632
1
1
01bb6be3e97dd45b26c535466635750c6674a91f
build.properties
build.properties
mod_version=1.1.0-beta14 mod_name=Taam mod_group=net.teamio.taam mc_version=1.10.2 forge_version=12.18.1.2064 forge_mappings=snapshot_20160930 mcmultipart_version=1.2.1 jei_mc_version=1.10.2 jei_version=3.12.3.292
mod_version=1.1.0-beta14 mod_name=Taam mod_group=net.teamio.taam mc_version=1.10.2 forge_version=12.18.1.2064 forge_mappings=stable_29 mcmultipart_version=1.2.1 jei_mc_version=1.10.2 jei_version=3.12.3.292
Update to latest stable mappings
Update to latest stable mappings
INI
mit
Team-IO/taam
ini
## Code Before: mod_version=1.1.0-beta14 mod_name=Taam mod_group=net.teamio.taam mc_version=1.10.2 forge_version=12.18.1.2064 forge_mappings=snapshot_20160930 mcmultipart_version=1.2.1 jei_mc_version=1.10.2 jei_version=3.12.3.292 ## Instruction: Update to latest stable mappings ## Code After: mod_version=1.1.0-beta14 mod_name=Taam mod_group=net.teamio.taam mc_version=1.10.2 forge_version=12.18.1.2064 forge_mappings=stable_29 mcmultipart_version=1.2.1 jei_mc_version=1.10.2 jei_version=3.12.3.292
mod_version=1.1.0-beta14 mod_name=Taam mod_group=net.teamio.taam mc_version=1.10.2 forge_version=12.18.1.2064 - forge_mappings=snapshot_20160930 + forge_mappings=stable_29 mcmultipart_version=1.2.1 jei_mc_version=1.10.2 jei_version=3.12.3.292
2
0.222222
1
1
48451cda2fa15ccc73fc67872cb88c96db35e7c7
_includes/map.html
_includes/map.html
{% assign location = site.data.locations[page.location] %} <h4>Location</h4> {{ location.name }}{% if defined?(location.room) %} , Raumnummer: {{ location.room }} {% endif %} <br> {{ location.address }} <br> {{ location.postcode }} <div id="map" style="width: 400px; height: 400px"></div> <script> var map = L.map('map').setView([{{ location.latitude }}, {{ location.longitude }}], 17); L.tileLayer('https://{s}.tiles.mapbox.com/v3/{id}/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' + 'Imagery © <a href="http://mapbox.com">Mapbox</a>', id: 'examples.map-i875mjb7' }).addTo(map); L.marker([{{ location.latitude }}, {{ location.longitude }}]).addTo(map); </script>
{% assign location = site.data.locations[page.location] %} {% if defined?(location) %} <h4>Location</h4> {{ location.name }}{% if defined?(location.room) %} , Raumnummer: {{ location.room }} {% endif %} <br> {{ location.address }} <br> {{ location.postcode }} <div id="map" style="width: 400px; height: 400px"></div> <script> var map = L.map('map').setView([{{ location.latitude }}, {{ location.longitude }}], 17); L.tileLayer('https://{s}.tiles.mapbox.com/v3/{id}/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' + 'Imagery © <a href="http://mapbox.com">Mapbox</a>', id: 'examples.map-i875mjb7' }).addTo(map); L.marker([{{ location.latitude }}, {{ location.longitude }}]).addTo(map); </script> {% endif %}
Exclude location view if no location is defined
Exclude location view if no location is defined
HTML
mit
fhopf/jugka-site,jugka/jugka-site,jugka/jugka-site,jugka/jugka-site,jugka/jugka,fhopf/jugka-site,jugka/jugka,jugka/jugka,fhopf/jugka-site
html
## Code Before: {% assign location = site.data.locations[page.location] %} <h4>Location</h4> {{ location.name }}{% if defined?(location.room) %} , Raumnummer: {{ location.room }} {% endif %} <br> {{ location.address }} <br> {{ location.postcode }} <div id="map" style="width: 400px; height: 400px"></div> <script> var map = L.map('map').setView([{{ location.latitude }}, {{ location.longitude }}], 17); L.tileLayer('https://{s}.tiles.mapbox.com/v3/{id}/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' + 'Imagery © <a href="http://mapbox.com">Mapbox</a>', id: 'examples.map-i875mjb7' }).addTo(map); L.marker([{{ location.latitude }}, {{ location.longitude }}]).addTo(map); </script> ## Instruction: Exclude location view if no location is defined ## Code After: {% assign location = site.data.locations[page.location] %} {% if defined?(location) %} <h4>Location</h4> {{ location.name }}{% if defined?(location.room) %} , Raumnummer: {{ location.room }} {% endif %} <br> {{ location.address }} <br> {{ location.postcode }} <div id="map" style="width: 400px; height: 400px"></div> <script> var map = L.map('map').setView([{{ location.latitude }}, {{ location.longitude }}], 17); L.tileLayer('https://{s}.tiles.mapbox.com/v3/{id}/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' + 'Imagery © <a href="http://mapbox.com">Mapbox</a>', id: 'examples.map-i875mjb7' }).addTo(map); L.marker([{{ location.latitude }}, {{ location.longitude }}]).addTo(map); </script> {% endif %}
{% assign location = site.data.locations[page.location] %} + {% if defined?(location) %} <h4>Location</h4> {{ location.name }}{% if defined?(location.room) %} , Raumnummer: {{ location.room }} {% endif %} <br> {{ location.address }} <br> {{ location.postcode }} <div id="map" style="width: 400px; height: 400px"></div> <script> var map = L.map('map').setView([{{ location.latitude }}, {{ location.longitude }}], 17); L.tileLayer('https://{s}.tiles.mapbox.com/v3/{id}/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' + 'Imagery © <a href="http://mapbox.com">Mapbox</a>', id: 'examples.map-i875mjb7' }).addTo(map); L.marker([{{ location.latitude }}, {{ location.longitude }}]).addTo(map); </script> + {% endif %}
2
0.083333
2
0
ef104c64930619c82f36073f2a09aad8ee4c1d68
lib/PHPCfg/Op/Terminal/StaticVar.php
lib/PHPCfg/Op/Terminal/StaticVar.php
<?php namespace PHPCfg\Op\Terminal; use PHPCfg\Block; use PHPCfg\Operand; use PHPCfg\Op\Terminal; class StaticVar extends Terminal { public $var; public $default; public $defaultVar; public function __construct(Operand $var, Block $defaultBlock, Operand $defaultVar, array $attributes = array()) { parent::__construct($attributes); $this->var = $var; $this->defaultBlock = $defaultBlock; $this->defaultVar = $defaultVar; } public function getVariableNames() { return ['var', 'defaultVar']; } public function getSubBlocks() { return ['defaultBlock']; } }
<?php namespace PHPCfg\Op\Terminal; use PHPCfg\Block; use PHPCfg\Operand; use PHPCfg\Op\Terminal; class StaticVar extends Terminal { public $var; public $default; public $defaultVar; public function __construct(Operand $var, Block $defaultBlock = null, Operand $defaultVar = null, array $attributes = array()) { parent::__construct($attributes); $this->var = $var; $this->defaultBlock = $defaultBlock; $this->defaultVar = $defaultVar; } public function getVariableNames() { return ['var', 'defaultVar']; } public function getSubBlocks() { return ['defaultBlock']; } }
Fix issue with static variables without initializers
Fix issue with static variables without initializers
PHP
mit
RustJason/php-cfg,RustJason/php-cfg,mwijngaard/php-cfg,mwijngaard/php-cfg,fntlnz/php-cfg,fntlnz/php-cfg,ircmaxell/php-cfg,ircmaxell/php-cfg
php
## Code Before: <?php namespace PHPCfg\Op\Terminal; use PHPCfg\Block; use PHPCfg\Operand; use PHPCfg\Op\Terminal; class StaticVar extends Terminal { public $var; public $default; public $defaultVar; public function __construct(Operand $var, Block $defaultBlock, Operand $defaultVar, array $attributes = array()) { parent::__construct($attributes); $this->var = $var; $this->defaultBlock = $defaultBlock; $this->defaultVar = $defaultVar; } public function getVariableNames() { return ['var', 'defaultVar']; } public function getSubBlocks() { return ['defaultBlock']; } } ## Instruction: Fix issue with static variables without initializers ## Code After: <?php namespace PHPCfg\Op\Terminal; use PHPCfg\Block; use PHPCfg\Operand; use PHPCfg\Op\Terminal; class StaticVar extends Terminal { public $var; public $default; public $defaultVar; public function __construct(Operand $var, Block $defaultBlock = null, Operand $defaultVar = null, array $attributes = array()) { parent::__construct($attributes); $this->var = $var; $this->defaultBlock = $defaultBlock; $this->defaultVar = $defaultVar; } public function getVariableNames() { return ['var', 'defaultVar']; } public function getSubBlocks() { return ['defaultBlock']; } }
<?php namespace PHPCfg\Op\Terminal; use PHPCfg\Block; use PHPCfg\Operand; use PHPCfg\Op\Terminal; class StaticVar extends Terminal { public $var; public $default; public $defaultVar; - public function __construct(Operand $var, Block $defaultBlock, Operand $defaultVar, array $attributes = array()) { + public function __construct(Operand $var, Block $defaultBlock = null, Operand $defaultVar = null, array $attributes = array()) { ? +++++++ +++++++ parent::__construct($attributes); $this->var = $var; $this->defaultBlock = $defaultBlock; $this->defaultVar = $defaultVar; } public function getVariableNames() { return ['var', 'defaultVar']; } public function getSubBlocks() { return ['defaultBlock']; } }
2
0.071429
1
1
c1469686fc808342e579412bd42e59aeee8b4350
_sass/_jug.scss
_sass/_jug.scss
/* * pages */ .page-title { font-size: 36px; letter-spacing: -1px; line-height: 1; } /* events */ .event-meta { overflow: auto; } .post-list img.icon { display: block; max-height: 32px; float: none; } img.speaker { float: left; width: 200px; margin: 10px; } img.speaker.right { float: right; } .navbar-image { height: 48px; float: left; } #brand.navbar-brand { margin-left: 0; font-size: x-large; } .navbar-menu-item { font-size: large; } .overview h3 { margin-bottom: 0; }
/* * pages */ .page-title { font-size: 36px; letter-spacing: -1px; line-height: 1; } /* events */ .event-meta { overflow: auto; } .post-list img.icon { display: block; max-height: 32px; float: none; } img.speaker { float: left; width: 200px; margin: 10px; } img.speaker.right { float: right; } .navbar-image { height: 48px; float: left; } #brand.navbar-brand { margin-left: 0; font-size: x-large; } .navbar-menu-item { font-size: large; } .overview h3 { margin-bottom: 0; } .post ul { display: inline-block; }
Fix list style in posts/events.
Fix list style in posts/events.
SCSS
apache-2.0
JUG-Ostfalen/JUG-Ostfalen.github.io,JUG-Ostfalen/JUG-Ostfalen.github.io
scss
## Code Before: /* * pages */ .page-title { font-size: 36px; letter-spacing: -1px; line-height: 1; } /* events */ .event-meta { overflow: auto; } .post-list img.icon { display: block; max-height: 32px; float: none; } img.speaker { float: left; width: 200px; margin: 10px; } img.speaker.right { float: right; } .navbar-image { height: 48px; float: left; } #brand.navbar-brand { margin-left: 0; font-size: x-large; } .navbar-menu-item { font-size: large; } .overview h3 { margin-bottom: 0; } ## Instruction: Fix list style in posts/events. ## Code After: /* * pages */ .page-title { font-size: 36px; letter-spacing: -1px; line-height: 1; } /* events */ .event-meta { overflow: auto; } .post-list img.icon { display: block; max-height: 32px; float: none; } img.speaker { float: left; width: 200px; margin: 10px; } img.speaker.right { float: right; } .navbar-image { height: 48px; float: left; } #brand.navbar-brand { margin-left: 0; font-size: x-large; } .navbar-menu-item { font-size: large; } .overview h3 { margin-bottom: 0; } .post ul { display: inline-block; }
/* * pages */ .page-title { font-size: 36px; letter-spacing: -1px; line-height: 1; } /* events */ .event-meta { overflow: auto; } .post-list img.icon { display: block; max-height: 32px; float: none; } img.speaker { float: left; width: 200px; margin: 10px; } img.speaker.right { float: right; } .navbar-image { height: 48px; float: left; } #brand.navbar-brand { margin-left: 0; font-size: x-large; } .navbar-menu-item { font-size: large; } .overview h3 { margin-bottom: 0; } + + .post ul { + display: inline-block; + }
4
0.08
4
0
c5d8b1f44120761b0919882d86dbf2460aa72671
tmp/post_upgrade_command.php
tmp/post_upgrade_command.php
<?php /* upgrade embedded users serial console */ require_once("globals.inc"); require_once("config.inc"); require_once("functions.inc"); if(file_exists("/usr/local/bin/git") && isset($config['system']['gitsync']['synconupgrade'])) { if(isset($config['system']['gitsync']['repositoryurl'])) exec("cd /root/pfsense/pfSenseGITREPO/pfSenseGITREPO && git config remote.origin.url " . escapeshellarg($config['system']['gitsync']['repositoryurl'])); if(isset($config['system']['gitsync']['branch'])) system("pfSsh.php playback gitsync " . escapeshellarg($config['system']['gitsync']['branch']) . " --upgrading"); } if($g['platform'] == "embedded") { $config['system']['enableserial'] = true; write_config(); } $newslicedir = ""; if ($ARGV[1] != "") $newslicedir = '/tmp' . $ARGV[1]; setup_serial_port("upgrade", $newslicedir); $files_to_process = file("/etc/pfSense.obsoletedfiles"); foreach($files_to_process as $filename) if(file_exists($filename)) exec("/bin/rm -f $filename"); ?>
<?php /* upgrade embedded users serial console */ require_once("globals.inc"); require_once("config.inc"); require_once("functions.inc"); if(file_exists("/usr/local/bin/git") && isset($config['system']['gitsync']['synconupgrade'])) { if(!empty($config['system']['gitsync']['repositoryurl'])) exec("cd /root/pfsense/pfSenseGITREPO/pfSenseGITREPO && git config remote.origin.url " . escapeshellarg($config['system']['gitsync']['repositoryurl'])); if(!empty($config['system']['gitsync']['branch'])) system("pfSsh.php playback gitsync " . escapeshellarg($config['system']['gitsync']['branch']) . " --upgrading"); } if($g['platform'] == "embedded") { $config['system']['enableserial'] = true; write_config(); } $newslicedir = ""; if ($ARGV[1] != "") $newslicedir = '/tmp' . $ARGV[1]; setup_serial_port("upgrade", $newslicedir); $files_to_process = file("/etc/pfSense.obsoletedfiles"); foreach($files_to_process as $filename) if(file_exists($filename)) exec("/bin/rm -f $filename"); ?>
Use !empty instead of isset to prevent accidental deletion of the last used repository URL when firmware update gitsync settings have been saved without a repository URL.
Use !empty instead of isset to prevent accidental deletion of the last used repository URL when firmware update gitsync settings have been saved without a repository URL.
PHP
apache-2.0
phil-davis/pfsense,jxmx/pfsense,pfsense/pfsense,pfsense/pfsense,pfsense/pfsense,BlackstarGroup/pfsense,dennypage/pfsense,NewEraCracker/pfsense,ch1c4um/pfsense,BlackstarGroup/pfsense,NOYB/pfsense,ptorsten/pfsense,BlackstarGroup/pfsense,dennypage/pfsense,brunostein/pfsense,NewEraCracker/pfsense,NOYB/pfsense,phil-davis/pfsense,jxmx/pfsense,brunostein/pfsense,ch1c4um/pfsense,dennypage/pfsense,dennypage/pfsense,phil-davis/pfsense,ptorsten/pfsense,brunostein/pfsense,ch1c4um/pfsense,NewEraCracker/pfsense,phil-davis/pfsense,NewEraCracker/pfsense,pfsense/pfsense,jxmx/pfsense,BlackstarGroup/pfsense,NOYB/pfsense,ch1c4um/pfsense,ptorsten/pfsense
php
## Code Before: <?php /* upgrade embedded users serial console */ require_once("globals.inc"); require_once("config.inc"); require_once("functions.inc"); if(file_exists("/usr/local/bin/git") && isset($config['system']['gitsync']['synconupgrade'])) { if(isset($config['system']['gitsync']['repositoryurl'])) exec("cd /root/pfsense/pfSenseGITREPO/pfSenseGITREPO && git config remote.origin.url " . escapeshellarg($config['system']['gitsync']['repositoryurl'])); if(isset($config['system']['gitsync']['branch'])) system("pfSsh.php playback gitsync " . escapeshellarg($config['system']['gitsync']['branch']) . " --upgrading"); } if($g['platform'] == "embedded") { $config['system']['enableserial'] = true; write_config(); } $newslicedir = ""; if ($ARGV[1] != "") $newslicedir = '/tmp' . $ARGV[1]; setup_serial_port("upgrade", $newslicedir); $files_to_process = file("/etc/pfSense.obsoletedfiles"); foreach($files_to_process as $filename) if(file_exists($filename)) exec("/bin/rm -f $filename"); ?> ## Instruction: Use !empty instead of isset to prevent accidental deletion of the last used repository URL when firmware update gitsync settings have been saved without a repository URL. ## Code After: <?php /* upgrade embedded users serial console */ require_once("globals.inc"); require_once("config.inc"); require_once("functions.inc"); if(file_exists("/usr/local/bin/git") && isset($config['system']['gitsync']['synconupgrade'])) { if(!empty($config['system']['gitsync']['repositoryurl'])) exec("cd /root/pfsense/pfSenseGITREPO/pfSenseGITREPO && git config remote.origin.url " . escapeshellarg($config['system']['gitsync']['repositoryurl'])); if(!empty($config['system']['gitsync']['branch'])) system("pfSsh.php playback gitsync " . escapeshellarg($config['system']['gitsync']['branch']) . " --upgrading"); } if($g['platform'] == "embedded") { $config['system']['enableserial'] = true; write_config(); } $newslicedir = ""; if ($ARGV[1] != "") $newslicedir = '/tmp' . $ARGV[1]; setup_serial_port("upgrade", $newslicedir); $files_to_process = file("/etc/pfSense.obsoletedfiles"); foreach($files_to_process as $filename) if(file_exists($filename)) exec("/bin/rm -f $filename"); ?>
<?php /* upgrade embedded users serial console */ require_once("globals.inc"); require_once("config.inc"); require_once("functions.inc"); if(file_exists("/usr/local/bin/git") && isset($config['system']['gitsync']['synconupgrade'])) { - if(isset($config['system']['gitsync']['repositoryurl'])) ? ^^^ + if(!empty($config['system']['gitsync']['repositoryurl'])) ? ^ ++ + exec("cd /root/pfsense/pfSenseGITREPO/pfSenseGITREPO && git config remote.origin.url " . escapeshellarg($config['system']['gitsync']['repositoryurl'])); - if(isset($config['system']['gitsync']['branch'])) ? ^^^ + if(!empty($config['system']['gitsync']['branch'])) ? ^ ++ + system("pfSsh.php playback gitsync " . escapeshellarg($config['system']['gitsync']['branch']) . " --upgrading"); } if($g['platform'] == "embedded") { $config['system']['enableserial'] = true; write_config(); } $newslicedir = ""; if ($ARGV[1] != "") $newslicedir = '/tmp' . $ARGV[1]; setup_serial_port("upgrade", $newslicedir); $files_to_process = file("/etc/pfSense.obsoletedfiles"); foreach($files_to_process as $filename) if(file_exists($filename)) exec("/bin/rm -f $filename"); ?>
4
0.133333
2
2
8e2596db204d2f6779280309aaa06d90872e9fb2
tests/test_bot_support.py
tests/test_bot_support.py
from __future__ import unicode_literals import pytest from .test_bot import TestBot class TestBotSupport(TestBot): @pytest.mark.parametrize('url,result', [ ('https://google.com', ['https://google.com']), ('google.com', ['google.com']), ('google.com/search?q=instabot', ['google.com/search?q=instabot']), ('https://google.com/search?q=instabot', ['https://google.com/search?q=instabot']), ('мвд.рф', ['мвд.рф']), ('https://мвд.рф', ['https://мвд.рф']), ('http://мвд.рф/news/', ['http://мвд.рф/news/']), ('hello, google.com/search?q=test and bing.com', ['google.com/search?q=test', 'bing.com']), ]) def test_extract_urls(self, url, result): assert self.BOT.extract_urls(url) == result
from __future__ import unicode_literals import os import pytest from .test_bot import TestBot class TestBotSupport(TestBot): @pytest.mark.parametrize('url,result', [ ('https://google.com', ['https://google.com']), ('google.com', ['google.com']), ('google.com/search?q=instabot', ['google.com/search?q=instabot']), ('https://google.com/search?q=instabot', ['https://google.com/search?q=instabot']), ('мвд.рф', ['мвд.рф']), ('https://мвд.рф', ['https://мвд.рф']), ('http://мвд.рф/news/', ['http://мвд.рф/news/']), ('hello, google.com/search?q=test and bing.com', ['google.com/search?q=test', 'bing.com']), ]) def test_extract_urls(self, url, result): assert self.BOT.extract_urls(url) == result def test_check_if_file_exist(self): test_file = open('test', 'w') assert self.BOT.check_if_file_exists('test') test_file.close() os.remove('test') def test_check_if_file_exist_fail(self): assert not self.BOT.check_if_file_exists('test')
Add test on check file if exist
Add test on check file if exist
Python
apache-2.0
instagrambot/instabot,ohld/instabot,instagrambot/instabot
python
## Code Before: from __future__ import unicode_literals import pytest from .test_bot import TestBot class TestBotSupport(TestBot): @pytest.mark.parametrize('url,result', [ ('https://google.com', ['https://google.com']), ('google.com', ['google.com']), ('google.com/search?q=instabot', ['google.com/search?q=instabot']), ('https://google.com/search?q=instabot', ['https://google.com/search?q=instabot']), ('мвд.рф', ['мвд.рф']), ('https://мвд.рф', ['https://мвд.рф']), ('http://мвд.рф/news/', ['http://мвд.рф/news/']), ('hello, google.com/search?q=test and bing.com', ['google.com/search?q=test', 'bing.com']), ]) def test_extract_urls(self, url, result): assert self.BOT.extract_urls(url) == result ## Instruction: Add test on check file if exist ## Code After: from __future__ import unicode_literals import os import pytest from .test_bot import TestBot class TestBotSupport(TestBot): @pytest.mark.parametrize('url,result', [ ('https://google.com', ['https://google.com']), ('google.com', ['google.com']), ('google.com/search?q=instabot', ['google.com/search?q=instabot']), ('https://google.com/search?q=instabot', ['https://google.com/search?q=instabot']), ('мвд.рф', ['мвд.рф']), ('https://мвд.рф', ['https://мвд.рф']), ('http://мвд.рф/news/', ['http://мвд.рф/news/']), ('hello, google.com/search?q=test and bing.com', ['google.com/search?q=test', 'bing.com']), ]) def test_extract_urls(self, url, result): assert self.BOT.extract_urls(url) == result def test_check_if_file_exist(self): test_file = open('test', 'w') assert self.BOT.check_if_file_exists('test') test_file.close() os.remove('test') def test_check_if_file_exist_fail(self): assert not self.BOT.check_if_file_exists('test')
from __future__ import unicode_literals + + import os import pytest from .test_bot import TestBot class TestBotSupport(TestBot): @pytest.mark.parametrize('url,result', [ ('https://google.com', ['https://google.com']), ('google.com', ['google.com']), ('google.com/search?q=instabot', ['google.com/search?q=instabot']), ('https://google.com/search?q=instabot', ['https://google.com/search?q=instabot']), ('мвд.рф', ['мвд.рф']), ('https://мвд.рф', ['https://мвд.рф']), ('http://мвд.рф/news/', ['http://мвд.рф/news/']), ('hello, google.com/search?q=test and bing.com', ['google.com/search?q=test', 'bing.com']), ]) def test_extract_urls(self, url, result): assert self.BOT.extract_urls(url) == result + + def test_check_if_file_exist(self): + test_file = open('test', 'w') + + assert self.BOT.check_if_file_exists('test') + + test_file.close() + os.remove('test') + + def test_check_if_file_exist_fail(self): + assert not self.BOT.check_if_file_exists('test')
13
0.619048
13
0
66bd4ad40101008e286dd2ad9252240de03930fd
README.md
README.md
[![Build Status](https://travis-ci.org/Acosix/alfresco-maven.svg?branch=master)](https://travis-ci.org/Acosix/alfresco-maven) # About This project defines the Maven build framework used by Acosix GmbH for building Alfresco-related libraries and modules. Acosix GmbH deliberately does not use the [Alfresco SDK](https://github.com/Alfresco/alfresco-sdk) which contains too many assumptions / opinions. The latest version (3.0 at the time of writing) even hard-wires some of the assumptions into plugin behaviour with little configurability. Earlier versions regularly caused side effects with standard Maven plugins related to source code or JavaDoc attachments. This makes it hard to customize / adapt SDK-based projects to specific requirements or simply different patterns of use - even regarding something simple as custom resource directories.
[![Build Status](https://travis-ci.org/Acosix/alfresco-maven.svg?branch=master)](https://travis-ci.org/Acosix/alfresco-maven) # About This project defines the Maven build framework used by Acosix GmbH for building Alfresco-related libraries and modules. Acosix GmbH deliberately does not use the [Alfresco SDK](https://github.com/Alfresco/alfresco-sdk) which contains too many assumptions / opinions. The latest version (3.0 at the time of writing) even hard-wires some of the assumptions into plugin behaviour with little configurability. Earlier versions regularly caused side effects with standard Maven plugins related to source code or JavaDoc attachments. This makes it hard to customize / adapt SDK-based projects to specific requirements or simply different patterns of use - even regarding something simple as custom resource directories. # Use in projects TBD ## Using SNAPSHOT builds In order to use a pre-built SNAPSHOT artifact published to the Open Source Sonatype Repository Hosting site, the artifact repository may need to be added to the POM, global settings.xml or an artifact repository proxy server. The following is the XML snippet for inclusion in a POM file. ```xml <repositories> <repository> <id>ossrh</id> <url>https://oss.sonatype.org/content/repositories/snapshots</url> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> ```
Add note about SNAPSHOT repository and correct minor typo
Add note about SNAPSHOT repository and correct minor typo
Markdown
apache-2.0
Acosix/alfresco-maven
markdown
## Code Before: [![Build Status](https://travis-ci.org/Acosix/alfresco-maven.svg?branch=master)](https://travis-ci.org/Acosix/alfresco-maven) # About This project defines the Maven build framework used by Acosix GmbH for building Alfresco-related libraries and modules. Acosix GmbH deliberately does not use the [Alfresco SDK](https://github.com/Alfresco/alfresco-sdk) which contains too many assumptions / opinions. The latest version (3.0 at the time of writing) even hard-wires some of the assumptions into plugin behaviour with little configurability. Earlier versions regularly caused side effects with standard Maven plugins related to source code or JavaDoc attachments. This makes it hard to customize / adapt SDK-based projects to specific requirements or simply different patterns of use - even regarding something simple as custom resource directories. ## Instruction: Add note about SNAPSHOT repository and correct minor typo ## Code After: [![Build Status](https://travis-ci.org/Acosix/alfresco-maven.svg?branch=master)](https://travis-ci.org/Acosix/alfresco-maven) # About This project defines the Maven build framework used by Acosix GmbH for building Alfresco-related libraries and modules. Acosix GmbH deliberately does not use the [Alfresco SDK](https://github.com/Alfresco/alfresco-sdk) which contains too many assumptions / opinions. The latest version (3.0 at the time of writing) even hard-wires some of the assumptions into plugin behaviour with little configurability. Earlier versions regularly caused side effects with standard Maven plugins related to source code or JavaDoc attachments. This makes it hard to customize / adapt SDK-based projects to specific requirements or simply different patterns of use - even regarding something simple as custom resource directories. # Use in projects TBD ## Using SNAPSHOT builds In order to use a pre-built SNAPSHOT artifact published to the Open Source Sonatype Repository Hosting site, the artifact repository may need to be added to the POM, global settings.xml or an artifact repository proxy server. The following is the XML snippet for inclusion in a POM file. ```xml <repositories> <repository> <id>ossrh</id> <url>https://oss.sonatype.org/content/repositories/snapshots</url> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> ```
[![Build Status](https://travis-ci.org/Acosix/alfresco-maven.svg?branch=master)](https://travis-ci.org/Acosix/alfresco-maven) # About This project defines the Maven build framework used by Acosix GmbH for building Alfresco-related libraries and modules. Acosix GmbH deliberately does not use the [Alfresco SDK](https://github.com/Alfresco/alfresco-sdk) which contains too many assumptions / opinions. The latest version (3.0 at the time of writing) even hard-wires some of the assumptions into plugin behaviour with little configurability. Earlier versions regularly caused side effects with standard Maven plugins related to source code or JavaDoc attachments. This makes it hard to customize / adapt SDK-based projects to specific requirements or simply different patterns of use - even regarding something simple as custom resource directories. + + # Use in projects + + TBD + + ## Using SNAPSHOT builds + + In order to use a pre-built SNAPSHOT artifact published to the Open Source Sonatype Repository Hosting site, the artifact repository may need to be added to the POM, global settings.xml or an artifact repository proxy server. The following is the XML snippet for inclusion in a POM file. + + ```xml + <repositories> + <repository> + <id>ossrh</id> + <url>https://oss.sonatype.org/content/repositories/snapshots</url> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + </repositories> + ```
20
3.333333
20
0
aef7b1a4c2a4d21b4d836f3fd499f0a073ea8cbd
.travis.yml
.travis.yml
language: python python: - "2.7" # - "3.4" # command to install dependencies install: - "pip install -r requirements.txt" - "pip install -e ." - "pip install coverage" - "pip install coveralls" - "pip install scrutinizer-ocular" # command to run tests script: - coverage run --source=economicpy setup.py test after_success: - coveralls - ocular
dist: trusty sudo: required addons: sonarqube: token: secure: "YHpi5ZtRDFlDtmLuJDO2tDli7lmL6erlg2EIjT1V/Hj5AFTXQ3VFgNnyqgvkbOQVzSshnWSSZLUfkUoWvCOMlReYg8mRB+tqgtTQROiCxL9r4Uxzpnkb4UWLJlbbRynMjgTbpAFWBYbfKMd7Z1qiPL74xXlXDkUbEYyxBCENKXY=" jdk: - oraclejdk8 script: - sonar-scanner cache: directories: - '$HOME/.sonar/cache' language: python python: - "2.7" # - "3.4" # command to install dependencies install: - "pip install -r requirements.txt" - "pip install -e ." - "pip install coverage" - "pip install coveralls" - "pip install scrutinizer-ocular" # command to run tests script: - coverage run --source=economicpy setup.py test after_success: - coveralls - ocular
Add sonarqube inspections after each build
Add sonarqube inspections after each build
YAML
mit
pawel-lewtak/economic-py
yaml
## Code Before: language: python python: - "2.7" # - "3.4" # command to install dependencies install: - "pip install -r requirements.txt" - "pip install -e ." - "pip install coverage" - "pip install coveralls" - "pip install scrutinizer-ocular" # command to run tests script: - coverage run --source=economicpy setup.py test after_success: - coveralls - ocular ## Instruction: Add sonarqube inspections after each build ## Code After: dist: trusty sudo: required addons: sonarqube: token: secure: "YHpi5ZtRDFlDtmLuJDO2tDli7lmL6erlg2EIjT1V/Hj5AFTXQ3VFgNnyqgvkbOQVzSshnWSSZLUfkUoWvCOMlReYg8mRB+tqgtTQROiCxL9r4Uxzpnkb4UWLJlbbRynMjgTbpAFWBYbfKMd7Z1qiPL74xXlXDkUbEYyxBCENKXY=" jdk: - oraclejdk8 script: - sonar-scanner cache: directories: - '$HOME/.sonar/cache' language: python python: - "2.7" # - "3.4" # command to install dependencies install: - "pip install -r requirements.txt" - "pip install -e ." - "pip install coverage" - "pip install coveralls" - "pip install scrutinizer-ocular" # command to run tests script: - coverage run --source=economicpy setup.py test after_success: - coveralls - ocular
+ dist: trusty + sudo: required + addons: + sonarqube: + token: + secure: "YHpi5ZtRDFlDtmLuJDO2tDli7lmL6erlg2EIjT1V/Hj5AFTXQ3VFgNnyqgvkbOQVzSshnWSSZLUfkUoWvCOMlReYg8mRB+tqgtTQROiCxL9r4Uxzpnkb4UWLJlbbRynMjgTbpAFWBYbfKMd7Z1qiPL74xXlXDkUbEYyxBCENKXY=" + jdk: + - oraclejdk8 + script: + - sonar-scanner + cache: + directories: + - '$HOME/.sonar/cache' language: python python: - "2.7" # - "3.4" # command to install dependencies install: - "pip install -r requirements.txt" - "pip install -e ." - "pip install coverage" - "pip install coveralls" - "pip install scrutinizer-ocular" # command to run tests script: - coverage run --source=economicpy setup.py test after_success: - coveralls - ocular
13
0.722222
13
0
fe5e76c4fecc3ea75b7c7f79fddd5d80bd27d0cd
receiver/.travis.yml
receiver/.travis.yml
language: go go: - '1.5' - '1.6' install: - make deps script: - make test
language: go go: - '1.5' - '1.6' before_install: - cd receiver install: - make deps script: - make test
Move to receiver directory in Travis CI
Move to receiver directory in Travis CI
YAML
mit
dtan4/paus-gitreceive,dtan4/paus-gitreceive,dtan4/paus-gitreceive,dtan4/paus-gitreceive
yaml
## Code Before: language: go go: - '1.5' - '1.6' install: - make deps script: - make test ## Instruction: Move to receiver directory in Travis CI ## Code After: language: go go: - '1.5' - '1.6' before_install: - cd receiver install: - make deps script: - make test
language: go go: - '1.5' - '1.6' + before_install: + - cd receiver install: - make deps script: - make test
2
0.25
2
0
f1f5b01eb37dfa9b97a2fba45c5ca9061914d711
README.md
README.md
ArduinoTetris ============= Classic Tetris game running on an Arduino-compatible MicroView. MicroView Arduino-compatible C port by Richard Birkby Original JavaScript implementation - Jake Gordon - https://github.com/jakesgordon/javascript-tetris MIT licenced
ArduinoTetris ============= Classic Tetris game running on an Arduino-compatible MicroView. MicroView Arduino-compatible C port by Richard Birkby Original JavaScript implementation - Jake Gordon - https://github.com/jakesgordon/javascript-tetris http://youtu.be/t3QOeQbEHVs MIT licenced
Add link to YouTube video
Add link to YouTube video
Markdown
mit
rbirkby/ArduinoTetris,rbirkby/ArduinoTetris
markdown
## Code Before: ArduinoTetris ============= Classic Tetris game running on an Arduino-compatible MicroView. MicroView Arduino-compatible C port by Richard Birkby Original JavaScript implementation - Jake Gordon - https://github.com/jakesgordon/javascript-tetris MIT licenced ## Instruction: Add link to YouTube video ## Code After: ArduinoTetris ============= Classic Tetris game running on an Arduino-compatible MicroView. MicroView Arduino-compatible C port by Richard Birkby Original JavaScript implementation - Jake Gordon - https://github.com/jakesgordon/javascript-tetris http://youtu.be/t3QOeQbEHVs MIT licenced
ArduinoTetris ============= Classic Tetris game running on an Arduino-compatible MicroView. MicroView Arduino-compatible C port by Richard Birkby Original JavaScript implementation - Jake Gordon - https://github.com/jakesgordon/javascript-tetris + http://youtu.be/t3QOeQbEHVs + + MIT licenced
3
0.333333
3
0
779c985a0ec8bf2e213f6268886d2a491e07209a
app/models/record.rb
app/models/record.rb
class Record < ActiveRecord::Base extend InheritenceBaseNaming belongs_to :domain has_one :user, through: :domain validates :domain, presence: true default_scope order: [:name, :priority] TYPE_CLASS = { "A" => "AddressRecord", "MX" => "MailRecord", }.freeze CLASS_TYPE = TYPE_CLASS.invert.freeze TYPES = TYPE_CLASS.keys.freeze def self.[] type TYPE_CLASS[type].constantize end def humanized_type CLASS_TYPE[self.class.name] end def humanized_name name.presence || domain.name end def self.requires_priority? false end delegate :requires_priority?, to: :class end
class Record < ActiveRecord::Base extend InheritenceBaseNaming belongs_to :domain, counter_cache: true has_one :user, through: :domain validates :domain, presence: true default_scope order: [:name, :priority] TYPE_CLASS = { "A" => "AddressRecord", "MX" => "MailRecord", }.freeze CLASS_TYPE = TYPE_CLASS.invert.freeze TYPES = TYPE_CLASS.keys.freeze def self.[] type TYPE_CLASS[type].constantize end def humanized_type CLASS_TYPE[self.class.name] end def humanized_name name.presence || domain.name end def self.requires_priority? false end delegate :requires_priority?, to: :class end
Fix the domain counter cache support
Fix the domain counter cache support
Ruby
mit
sj26/christen,sj26/christen
ruby
## Code Before: class Record < ActiveRecord::Base extend InheritenceBaseNaming belongs_to :domain has_one :user, through: :domain validates :domain, presence: true default_scope order: [:name, :priority] TYPE_CLASS = { "A" => "AddressRecord", "MX" => "MailRecord", }.freeze CLASS_TYPE = TYPE_CLASS.invert.freeze TYPES = TYPE_CLASS.keys.freeze def self.[] type TYPE_CLASS[type].constantize end def humanized_type CLASS_TYPE[self.class.name] end def humanized_name name.presence || domain.name end def self.requires_priority? false end delegate :requires_priority?, to: :class end ## Instruction: Fix the domain counter cache support ## Code After: class Record < ActiveRecord::Base extend InheritenceBaseNaming belongs_to :domain, counter_cache: true has_one :user, through: :domain validates :domain, presence: true default_scope order: [:name, :priority] TYPE_CLASS = { "A" => "AddressRecord", "MX" => "MailRecord", }.freeze CLASS_TYPE = TYPE_CLASS.invert.freeze TYPES = TYPE_CLASS.keys.freeze def self.[] type TYPE_CLASS[type].constantize end def humanized_type CLASS_TYPE[self.class.name] end def humanized_name name.presence || domain.name end def self.requires_priority? false end delegate :requires_priority?, to: :class end
class Record < ActiveRecord::Base extend InheritenceBaseNaming - belongs_to :domain + belongs_to :domain, counter_cache: true has_one :user, through: :domain validates :domain, presence: true default_scope order: [:name, :priority] TYPE_CLASS = { "A" => "AddressRecord", "MX" => "MailRecord", }.freeze CLASS_TYPE = TYPE_CLASS.invert.freeze TYPES = TYPE_CLASS.keys.freeze def self.[] type TYPE_CLASS[type].constantize end def humanized_type CLASS_TYPE[self.class.name] end def humanized_name name.presence || domain.name end def self.requires_priority? false end delegate :requires_priority?, to: :class end
2
0.057143
1
1
1090acb35ea4ce5c8d17db716539d3354feabc12
nodeconductor/iaas/migrations/0038_securitygroup_state.py
nodeconductor/iaas/migrations/0038_securitygroup_state.py
from __future__ import unicode_literals from django.db import models, migrations import django_fsm class Migration(migrations.Migration): dependencies = [ ('iaas', '0037_init_security_groups_quotas'), ] operations = [ migrations.AddField( model_name='securitygroup', name='state', field=django_fsm.FSMIntegerField(default=1, choices=[(1, 'Sync Scheduled'), (2, 'Syncing'), (3, 'In Sync'), (4, 'Erred')]), preserve_default=True, ), ]
from __future__ import unicode_literals from django.db import models, migrations import django_fsm def mark_security_groups_as_synced(apps, schema_editor): SecurityGroup = apps.get_model('iaas', 'SecurityGroup') SecurityGroup.objects.all().update(state=3) class Migration(migrations.Migration): dependencies = [ ('iaas', '0037_init_security_groups_quotas'), ] operations = [ migrations.AddField( model_name='securitygroup', name='state', field=django_fsm.FSMIntegerField(default=1, choices=[(1, 'Sync Scheduled'), (2, 'Syncing'), (3, 'In Sync'), (4, 'Erred')]), preserve_default=True, ), migrations.RunPython(mark_security_groups_as_synced), ]
Mark all exist security groups as synced
Mark all exist security groups as synced - itacloud-4843
Python
mit
opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor
python
## Code Before: from __future__ import unicode_literals from django.db import models, migrations import django_fsm class Migration(migrations.Migration): dependencies = [ ('iaas', '0037_init_security_groups_quotas'), ] operations = [ migrations.AddField( model_name='securitygroup', name='state', field=django_fsm.FSMIntegerField(default=1, choices=[(1, 'Sync Scheduled'), (2, 'Syncing'), (3, 'In Sync'), (4, 'Erred')]), preserve_default=True, ), ] ## Instruction: Mark all exist security groups as synced - itacloud-4843 ## Code After: from __future__ import unicode_literals from django.db import models, migrations import django_fsm def mark_security_groups_as_synced(apps, schema_editor): SecurityGroup = apps.get_model('iaas', 'SecurityGroup') SecurityGroup.objects.all().update(state=3) class Migration(migrations.Migration): dependencies = [ ('iaas', '0037_init_security_groups_quotas'), ] operations = [ migrations.AddField( model_name='securitygroup', name='state', field=django_fsm.FSMIntegerField(default=1, choices=[(1, 'Sync Scheduled'), (2, 'Syncing'), (3, 'In Sync'), (4, 'Erred')]), preserve_default=True, ), migrations.RunPython(mark_security_groups_as_synced), ]
from __future__ import unicode_literals from django.db import models, migrations import django_fsm + + + def mark_security_groups_as_synced(apps, schema_editor): + SecurityGroup = apps.get_model('iaas', 'SecurityGroup') + SecurityGroup.objects.all().update(state=3) class Migration(migrations.Migration): dependencies = [ ('iaas', '0037_init_security_groups_quotas'), ] operations = [ migrations.AddField( model_name='securitygroup', name='state', field=django_fsm.FSMIntegerField(default=1, choices=[(1, 'Sync Scheduled'), (2, 'Syncing'), (3, 'In Sync'), (4, 'Erred')]), preserve_default=True, ), + migrations.RunPython(mark_security_groups_as_synced), ]
6
0.3
6
0
25e92982b33f901f6b59efb47ca143332e290ac2
src/Resources/skeletons/BaseExtension/fluid_styled_content/Resources/Private/Language/locallang_db.xlf.twig
src/Resources/skeletons/BaseExtension/fluid_styled_content/Resources/Private/Language/locallang_db.xlf.twig
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <xliff version="1.0"> <file source-language="en" datatype="plaintext" original="messages" date="{{ 'now'|date('Y-m-d\TH:i:s\Z', 'UTC') }}"> <header> <authorName>{{ package.author.name }}</authorName> <authorEmail>{{ package.author.email }}</authorEmail> </header> <body> <trans-unit id="backend_layout.example"> <source>Example</source> </trans-unit> <trans-unit id="backend_layout.column.normal"> <source>Normal</source> </trans-unit> </body> </file> </xliff>
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <xliff version="1.0"> <file source-language="en" datatype="plaintext" original="messages" date="{{ 'now'|date('Y-m-d\TH:i:s\Z', 'UTC') }}"> <header> <authorName>{{ package.author.name }}</authorName> <authorEmail>{{ package.author.email }}</authorEmail> </header> <body> </body> </file> </xliff>
Remove obsolete language labels from locallang_db
[BUGFIX] Remove obsolete language labels from locallang_db
Twig
mit
benjaminkott/packagebuilder,benjaminkott/packagebuilder,benjaminkott/packagebuilder
twig
## Code Before: <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <xliff version="1.0"> <file source-language="en" datatype="plaintext" original="messages" date="{{ 'now'|date('Y-m-d\TH:i:s\Z', 'UTC') }}"> <header> <authorName>{{ package.author.name }}</authorName> <authorEmail>{{ package.author.email }}</authorEmail> </header> <body> <trans-unit id="backend_layout.example"> <source>Example</source> </trans-unit> <trans-unit id="backend_layout.column.normal"> <source>Normal</source> </trans-unit> </body> </file> </xliff> ## Instruction: [BUGFIX] Remove obsolete language labels from locallang_db ## Code After: <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <xliff version="1.0"> <file source-language="en" datatype="plaintext" original="messages" date="{{ 'now'|date('Y-m-d\TH:i:s\Z', 'UTC') }}"> <header> <authorName>{{ package.author.name }}</authorName> <authorEmail>{{ package.author.email }}</authorEmail> </header> <body> </body> </file> </xliff>
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <xliff version="1.0"> <file source-language="en" datatype="plaintext" original="messages" date="{{ 'now'|date('Y-m-d\TH:i:s\Z', 'UTC') }}"> <header> <authorName>{{ package.author.name }}</authorName> <authorEmail>{{ package.author.email }}</authorEmail> </header> <body> - <trans-unit id="backend_layout.example"> - <source>Example</source> - </trans-unit> - <trans-unit id="backend_layout.column.normal"> - <source>Normal</source> - </trans-unit> </body> </file> </xliff>
6
0.352941
0
6
f9ad6b45a8890fe05a4626f50d2dc5839a76cea6
src/main/java/com/herocc/bukkit/core/commands/CommandFakeblock.java
src/main/java/com/herocc/bukkit/core/commands/CommandFakeblock.java
package com.herocc.bukkit.core.commands; import org.bukkit.Material; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import com.herocc.bukkit.core.Core; import net.md_5.bungee.api.ChatColor; public class CommandFakeblock implements CommandExecutor { private final Core plugin = Core.getPlugin(); @SuppressWarnings("deprecation") @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] arg) { if (cmd.getName().equalsIgnoreCase("fakeblock")) { if (sender.hasPermission("core.head.get")) { Player player = (Player) sender; player.sendBlockChange(player.getLocation(), Material.WOOL, (byte) 0); sender.sendMessage("The block has changed!"); } else { sender.sendMessage(ChatColor.RED + "Sorry, You do not have permission to use this command!"); } } return false; } }
package com.herocc.bukkit.core.commands; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import com.herocc.bukkit.core.Core; public class CommandFakeblock implements CommandExecutor { private final Core plugin = Core.getPlugin(); @SuppressWarnings("deprecation") @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] arg) { if (cmd.getName().equalsIgnoreCase("fakeblock")) { if (sender.hasPermission("core.head.get")) { Player player = (Player) sender; player.sendBlockChange(player.getLocation(), Material.WOOL, (byte) 0); sender.sendMessage("The block has changed!"); } else { sender.sendMessage(ChatColor.RED + "Sorry, You do not have permission to use this command!"); } } return false; } }
Use the ChatColor from Bukkit instead of BungeeCord.
Use the ChatColor from Bukkit instead of BungeeCord.
Java
lgpl-2.1
HeroiCraft/Core
java
## Code Before: package com.herocc.bukkit.core.commands; import org.bukkit.Material; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import com.herocc.bukkit.core.Core; import net.md_5.bungee.api.ChatColor; public class CommandFakeblock implements CommandExecutor { private final Core plugin = Core.getPlugin(); @SuppressWarnings("deprecation") @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] arg) { if (cmd.getName().equalsIgnoreCase("fakeblock")) { if (sender.hasPermission("core.head.get")) { Player player = (Player) sender; player.sendBlockChange(player.getLocation(), Material.WOOL, (byte) 0); sender.sendMessage("The block has changed!"); } else { sender.sendMessage(ChatColor.RED + "Sorry, You do not have permission to use this command!"); } } return false; } } ## Instruction: Use the ChatColor from Bukkit instead of BungeeCord. ## Code After: package com.herocc.bukkit.core.commands; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import com.herocc.bukkit.core.Core; public class CommandFakeblock implements CommandExecutor { private final Core plugin = Core.getPlugin(); @SuppressWarnings("deprecation") @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] arg) { if (cmd.getName().equalsIgnoreCase("fakeblock")) { if (sender.hasPermission("core.head.get")) { Player player = (Player) sender; player.sendBlockChange(player.getLocation(), Material.WOOL, (byte) 0); sender.sendMessage("The block has changed!"); } else { sender.sendMessage(ChatColor.RED + "Sorry, You do not have permission to use this command!"); } } return false; } }
package com.herocc.bukkit.core.commands; + import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import com.herocc.bukkit.core.Core; - - import net.md_5.bungee.api.ChatColor; public class CommandFakeblock implements CommandExecutor { private final Core plugin = Core.getPlugin(); @SuppressWarnings("deprecation") @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] arg) { if (cmd.getName().equalsIgnoreCase("fakeblock")) { if (sender.hasPermission("core.head.get")) { Player player = (Player) sender; player.sendBlockChange(player.getLocation(), Material.WOOL, (byte) 0); sender.sendMessage("The block has changed!"); } else { sender.sendMessage(ChatColor.RED + "Sorry, You do not have permission to use this command!"); } } return false; } }
3
0.096774
1
2
909bf0c1cc94fff58773aa57bd2ded233cd53a6d
docs/api/parsing.rst
docs/api/parsing.rst
cmd2.parsing =============== .. autoclass:: cmd2.Statement :members: .. attribute:: command The name of the command after shortcuts and macros have been expanded .. attribute:: args The arguments to the command as a string with spaces between the words, excluding output redirection and command terminators. If the user used quotes in their input, they remain here, and you will have to handle them on your own. .. attribute:: arg_list The arguments to the command as a list, excluding output redirection and command terminators. Each argument is represented as an element in the list. Quoted arguments remain quoted. If you want to remove the quotes, use :func:`cmd2.utils.strip_quotes` or use ``argv[1:]`` .. attribute:: raw If you want full access to exactly what the user typed at the input prompt you can get it, but you'll have to parse it on your own, including: - shortcuts and aliases - quoted commands and arguments - output redirection - multi-line command terminator handling If you use multiline commands, all the input will be passed to you in this string, but there will be embedded newlines where the user hit return to continue the command on the next line. .. autoclass:: cmd2.parsing.StatementParser :members: .. automethod:: __init__
cmd2.parsing =============== .. autoclass:: cmd2.Statement :members: .. attribute:: command The name of the command after shortcuts and macros have been expanded .. attribute:: multiline_command If the command is a multi-line command, the name of the command will be in this attribute. Otherwise, it will be an empty string. .. attribute:: args The arguments to the command as a string with spaces between the words, excluding output redirection and command terminators. If the user used quotes in their input, they remain here, and you will have to handle them on your own. .. attribute:: arg_list The arguments to the command as a list, excluding output redirection and command terminators. Each argument is represented as an element in the list. Quoted arguments remain quoted. If you want to remove the quotes, use :func:`cmd2.utils.strip_quotes` or use ``argv[1:]`` .. attribute:: raw If you want full access to exactly what the user typed at the input prompt you can get it, but you'll have to parse it on your own, including: - shortcuts and aliases - quoted commands and arguments - output redirection - multi-line command terminator handling If you use multiline commands, all the input will be passed to you in this string, but there will be embedded newlines where the user hit return to continue the command on the next line. .. autoclass:: cmd2.parsing.StatementParser :members: .. automethod:: __init__
Add documentation of multiline_command attribute
Add documentation of multiline_command attribute
reStructuredText
mit
python-cmd2/cmd2,python-cmd2/cmd2
restructuredtext
## Code Before: cmd2.parsing =============== .. autoclass:: cmd2.Statement :members: .. attribute:: command The name of the command after shortcuts and macros have been expanded .. attribute:: args The arguments to the command as a string with spaces between the words, excluding output redirection and command terminators. If the user used quotes in their input, they remain here, and you will have to handle them on your own. .. attribute:: arg_list The arguments to the command as a list, excluding output redirection and command terminators. Each argument is represented as an element in the list. Quoted arguments remain quoted. If you want to remove the quotes, use :func:`cmd2.utils.strip_quotes` or use ``argv[1:]`` .. attribute:: raw If you want full access to exactly what the user typed at the input prompt you can get it, but you'll have to parse it on your own, including: - shortcuts and aliases - quoted commands and arguments - output redirection - multi-line command terminator handling If you use multiline commands, all the input will be passed to you in this string, but there will be embedded newlines where the user hit return to continue the command on the next line. .. autoclass:: cmd2.parsing.StatementParser :members: .. automethod:: __init__ ## Instruction: Add documentation of multiline_command attribute ## Code After: cmd2.parsing =============== .. autoclass:: cmd2.Statement :members: .. attribute:: command The name of the command after shortcuts and macros have been expanded .. attribute:: multiline_command If the command is a multi-line command, the name of the command will be in this attribute. Otherwise, it will be an empty string. .. attribute:: args The arguments to the command as a string with spaces between the words, excluding output redirection and command terminators. If the user used quotes in their input, they remain here, and you will have to handle them on your own. .. attribute:: arg_list The arguments to the command as a list, excluding output redirection and command terminators. Each argument is represented as an element in the list. Quoted arguments remain quoted. If you want to remove the quotes, use :func:`cmd2.utils.strip_quotes` or use ``argv[1:]`` .. attribute:: raw If you want full access to exactly what the user typed at the input prompt you can get it, but you'll have to parse it on your own, including: - shortcuts and aliases - quoted commands and arguments - output redirection - multi-line command terminator handling If you use multiline commands, all the input will be passed to you in this string, but there will be embedded newlines where the user hit return to continue the command on the next line. .. autoclass:: cmd2.parsing.StatementParser :members: .. automethod:: __init__
cmd2.parsing =============== .. autoclass:: cmd2.Statement :members: .. attribute:: command The name of the command after shortcuts and macros have been expanded + + .. attribute:: multiline_command + + If the command is a multi-line command, the name of the command will be + in this attribute. Otherwise, it will be an empty string. .. attribute:: args The arguments to the command as a string with spaces between the words, excluding output redirection and command terminators. If the user used quotes in their input, they remain here, and you will have to handle them on your own. .. attribute:: arg_list The arguments to the command as a list, excluding output redirection and command terminators. Each argument is represented as an element in the list. Quoted arguments remain quoted. If you want to remove the quotes, use :func:`cmd2.utils.strip_quotes` or use ``argv[1:]`` .. attribute:: raw If you want full access to exactly what the user typed at the input prompt you can get it, but you'll have to parse it on your own, including: - shortcuts and aliases - quoted commands and arguments - output redirection - multi-line command terminator handling If you use multiline commands, all the input will be passed to you in this string, but there will be embedded newlines where the user hit return to continue the command on the next line. .. autoclass:: cmd2.parsing.StatementParser :members: .. automethod:: __init__
5
0.111111
5
0
37d46eaba38db965cee53a9073337af1c474a54e
src/sphinx/whats_new/3.2.rst
src/sphinx/whats_new/3.2.rst
What's New in 3.2 ################# Core ==== * `#3743 <https://github.com/gatling/gatling/issues/3743>`__: JMESPath support, see :ref:`here <http-check-jsonpath>`
What's New in 3.2 ################# Core ==== * `#3724 <https://github.com/gatling/gatling/issues/3724>`__: Custom Pebble Extensions registering * `#3735 <https://github.com/gatling/gatling/issues/3735>`__: PebbleFileBody now supports template inheritance * `#3743 <https://github.com/gatling/gatling/issues/3743>`__: JMESPath support, see :ref:`here <http-check-jsonpath>`
Add missing what's new entries
Add missing what's new entries
reStructuredText
apache-2.0
gatling/gatling,gatling/gatling,gatling/gatling,gatling/gatling,gatling/gatling
restructuredtext
## Code Before: What's New in 3.2 ################# Core ==== * `#3743 <https://github.com/gatling/gatling/issues/3743>`__: JMESPath support, see :ref:`here <http-check-jsonpath>` ## Instruction: Add missing what's new entries ## Code After: What's New in 3.2 ################# Core ==== * `#3724 <https://github.com/gatling/gatling/issues/3724>`__: Custom Pebble Extensions registering * `#3735 <https://github.com/gatling/gatling/issues/3735>`__: PebbleFileBody now supports template inheritance * `#3743 <https://github.com/gatling/gatling/issues/3743>`__: JMESPath support, see :ref:`here <http-check-jsonpath>`
What's New in 3.2 ################# Core ==== + * `#3724 <https://github.com/gatling/gatling/issues/3724>`__: Custom Pebble Extensions registering + * `#3735 <https://github.com/gatling/gatling/issues/3735>`__: PebbleFileBody now supports template inheritance * `#3743 <https://github.com/gatling/gatling/issues/3743>`__: JMESPath support, see :ref:`here <http-check-jsonpath>`
2
0.285714
2
0
ef980661130b68cfed37d32f29e3ad6069361fb9
lib/feedpaper.js
lib/feedpaper.js
var Cache = require('./cache'); var fs = require('fs'); var handlers = require('./handlers'); var Ute = require('ute'); var util = require('./util'); function FeedPaper() { this.ute = new Ute(); this.init(); } FeedPaper.prototype.init = function () { var categoryList = []; var urlLookup = {}; var conf = JSON.parse(fs.readFileSync('conf/data.json')); conf.forEach(function (category) { var feeds = []; category.feeds.forEach(function (feed) { var feedId = util.slug(feed.title); feeds.push({ id : feedId, title: feed.title, url : feed.url }); urlLookup[feedId] = feed.url; }); categoryList.push({ id : util.slug(category.title), title: category.title, feeds: feeds }); }); this.cache = new Cache(categoryList, urlLookup); }; FeedPaper.prototype.start = function () { var self = this; handlers.cache = this.cache; this.ute.start(handlers); this.cache.build(function (err) { if (err) { console.error(err); } self.cache.refresh(); }); }; module.exports = FeedPaper;
var Cache = require('./cache'); var fs = require('fs'); var handlers = require('./handlers'); var Ute = require('ute'); var util = require('./util'); function FeedPaper() { this.ute = new Ute(); this.init(); } FeedPaper.prototype.init = function () { var categoryList = []; var urlLookup = {}; console.log('[i] Loading data'); var conf = JSON.parse(fs.readFileSync('conf/data.json')); conf.forEach(function (category) { var feeds = []; category.feeds.forEach(function (feed) { var feedId = util.slug(feed.title); feeds.push({ id : feedId, title: feed.title, url : feed.url }); urlLookup[feedId] = feed.url; }); categoryList.push({ id : util.slug(category.title), title: category.title, feeds: feeds }); }); this.cache = new Cache(categoryList, urlLookup); }; FeedPaper.prototype.start = function () { var self = this; handlers.cache = this.cache; this.ute.start(handlers); this.cache.build(function (err) { if (err) { console.error(err); } self.cache.refresh(); }); }; module.exports = FeedPaper;
Add loading data log message.
Add loading data log message.
JavaScript
mit
cliffano/feedpaper,cliffano/feedpaper,cliffano/feedpaper
javascript
## Code Before: var Cache = require('./cache'); var fs = require('fs'); var handlers = require('./handlers'); var Ute = require('ute'); var util = require('./util'); function FeedPaper() { this.ute = new Ute(); this.init(); } FeedPaper.prototype.init = function () { var categoryList = []; var urlLookup = {}; var conf = JSON.parse(fs.readFileSync('conf/data.json')); conf.forEach(function (category) { var feeds = []; category.feeds.forEach(function (feed) { var feedId = util.slug(feed.title); feeds.push({ id : feedId, title: feed.title, url : feed.url }); urlLookup[feedId] = feed.url; }); categoryList.push({ id : util.slug(category.title), title: category.title, feeds: feeds }); }); this.cache = new Cache(categoryList, urlLookup); }; FeedPaper.prototype.start = function () { var self = this; handlers.cache = this.cache; this.ute.start(handlers); this.cache.build(function (err) { if (err) { console.error(err); } self.cache.refresh(); }); }; module.exports = FeedPaper; ## Instruction: Add loading data log message. ## Code After: var Cache = require('./cache'); var fs = require('fs'); var handlers = require('./handlers'); var Ute = require('ute'); var util = require('./util'); function FeedPaper() { this.ute = new Ute(); this.init(); } FeedPaper.prototype.init = function () { var categoryList = []; var urlLookup = {}; console.log('[i] Loading data'); var conf = JSON.parse(fs.readFileSync('conf/data.json')); conf.forEach(function (category) { var feeds = []; category.feeds.forEach(function (feed) { var feedId = util.slug(feed.title); feeds.push({ id : feedId, title: feed.title, url : feed.url }); urlLookup[feedId] = feed.url; }); categoryList.push({ id : util.slug(category.title), title: category.title, feeds: feeds }); }); this.cache = new Cache(categoryList, urlLookup); }; FeedPaper.prototype.start = function () { var self = this; handlers.cache = this.cache; this.ute.start(handlers); this.cache.build(function (err) { if (err) { console.error(err); } self.cache.refresh(); }); }; module.exports = FeedPaper;
var Cache = require('./cache'); var fs = require('fs'); var handlers = require('./handlers'); var Ute = require('ute'); var util = require('./util'); function FeedPaper() { this.ute = new Ute(); this.init(); } FeedPaper.prototype.init = function () { var categoryList = []; var urlLookup = {}; + + console.log('[i] Loading data'); var conf = JSON.parse(fs.readFileSync('conf/data.json')); conf.forEach(function (category) { var feeds = []; category.feeds.forEach(function (feed) { var feedId = util.slug(feed.title); feeds.push({ id : feedId, title: feed.title, url : feed.url }); urlLookup[feedId] = feed.url; }); categoryList.push({ id : util.slug(category.title), title: category.title, feeds: feeds }); }); this.cache = new Cache(categoryList, urlLookup); }; FeedPaper.prototype.start = function () { var self = this; handlers.cache = this.cache; this.ute.start(handlers); this.cache.build(function (err) { if (err) { console.error(err); } self.cache.refresh(); }); }; module.exports = FeedPaper;
2
0.037037
2
0
d1c8b63ef47f05815021cc6a17e844aed2caee4f
roles/openshift_manageiq/vars/main.yml
roles/openshift_manageiq/vars/main.yml
manageiq_cluster_role: apiVersion: v1 kind: ClusterRole metadata: name: management-infra-admin rules: - resources: - pods/proxy verbs: - '*' manageiq_service_account: apiVersion: v1 kind: ServiceAccount metadata: name: management-admin manageiq_image_inspector_service_account: apiVersion: v1 kind: ServiceAccount metadata: name: inspector-admin manage_iq_tmp_conf: /tmp/manageiq_admin.kubeconfig manage_iq_tasks: - policy add-role-to-user -n management-infra admin -z management-admin - policy add-role-to-user -n management-infra management-infra-admin -z management-admin - policy add-cluster-role-to-user cluster-reader system:serviceaccount:management-infra:management-admin - policy add-scc-to-user privileged system:serviceaccount:management-infra:management-admin - policy add-cluster-role-to-user system:image-puller system:serviceaccount:management-infra:inspector-admin - policy add-scc-to-user privileged system:serviceaccount:management-infra:inspector-admin manage_iq_openshift_3_2_tasks: - policy add-cluster-role-to-user system:image-auditor system:serviceaccount:management-infra:management-admin
manageiq_cluster_role: apiVersion: v1 kind: ClusterRole metadata: name: management-infra-admin rules: - resources: - pods/proxy verbs: - '*' manageiq_service_account: apiVersion: v1 kind: ServiceAccount metadata: name: management-admin manageiq_image_inspector_service_account: apiVersion: v1 kind: ServiceAccount metadata: name: inspector-admin manage_iq_tmp_conf: /tmp/manageiq_admin.kubeconfig manage_iq_tasks: - policy add-role-to-user -n management-infra admin -z management-admin - policy add-role-to-user -n management-infra management-infra-admin -z management-admin - policy add-cluster-role-to-user cluster-reader system:serviceaccount:management-infra:management-admin - policy add-scc-to-user privileged system:serviceaccount:management-infra:management-admin - policy add-cluster-role-to-user system:image-puller system:serviceaccount:management-infra:inspector-admin - policy add-scc-to-user privileged system:serviceaccount:management-infra:inspector-admin - policy add-cluster-role-to-user self-provisioner system:serviceaccount:management-infra:management-admin manage_iq_openshift_3_2_tasks: - policy add-cluster-role-to-user system:image-auditor system:serviceaccount:management-infra:management-admin
Add role to manageiq to allow creation of projects
Add role to manageiq to allow creation of projects
YAML
apache-2.0
git001/openshift-ansible,nhr/openshift-ansible,DG-i/openshift-ansible,EricMountain-1A/openshift-ansible,markllama/openshift-ansible,liggitt/openshift-ansible,maxamillion/openshift-ansible,detiber/openshift-ansible,tagliateller/openshift-ansible,sdodson/openshift-ansible,git001/openshift-ansible,ttindell2/openshift-ansible,sosiouxme/openshift-ansible,detiber/openshift-ansible,bparees/openshift-ansible,EricMountain-1A/openshift-ansible,thoraxe/openshift-ansible,mmahut/openshift-ansible,ewolinetz/openshift-ansible,nhr/openshift-ansible,abutcher/openshift-ansible,thoraxe/openshift-ansible,sosiouxme/openshift-ansible,aveshagarwal/openshift-ansible,anpingli/openshift-ansible,liggitt/openshift-ansible,zhiwliu/openshift-ansible,brenton/openshift-ansible,nak3/openshift-ansible,rjhowe/openshift-ansible,DG-i/openshift-ansible,ewolinetz/openshift-ansible,maxamillion/openshift-ansible,sosiouxme/openshift-ansible,DG-i/openshift-ansible,maxamillion/openshift-ansible,rhdedgar/openshift-ansible,twiest/openshift-ansible,maxamillion/openshift-ansible,bparees/openshift-ansible,markllama/openshift-ansible,sdodson/openshift-ansible,aveshagarwal/openshift-ansible,miminar/openshift-ansible,tagliateller/openshift-ansible,markllama/openshift-ansible,mmahut/openshift-ansible,EricMountain-1A/openshift-ansible,ewolinetz/openshift-ansible,sosiouxme/openshift-ansible,detiber/openshift-ansible,rjhowe/openshift-ansible,ttindell2/openshift-ansible,zhiwliu/openshift-ansible,akubicharm/openshift-ansible,abutcher/openshift-ansible,git001/openshift-ansible,mmahut/openshift-ansible,wbrefvem/openshift-ansible,ttindell2/openshift-ansible,nhr/openshift-ansible,ttindell2/openshift-ansible,akubicharm/openshift-ansible,abutcher/openshift-ansible,wbrefvem/openshift-ansible,zhiwliu/openshift-ansible,markllama/openshift-ansible,liggitt/openshift-ansible,gburges/openshift-ansible,mwoodson/openshift-ansible,kwoodson/openshift-ansible,wbrefvem/openshift-ansible,akubicharm/openshift-ansible,ttindell2/openshift-ansible,ewolinetz/openshift-ansible,sosiouxme/openshift-ansible,rjhowe/openshift-ansible,sdodson/openshift-ansible,jwhonce/openshift-ansible,aveshagarwal/openshift-ansible,jwhonce/openshift-ansible,rjhowe/openshift-ansible,twiest/openshift-ansible,twiest/openshift-ansible,miminar/openshift-ansible,DG-i/openshift-ansible,jwhonce/openshift-ansible,openshift/openshift-ansible,tagliateller/openshift-ansible,git001/openshift-ansible,kwoodson/openshift-ansible,rjhowe/openshift-ansible,brenton/openshift-ansible,thoraxe/openshift-ansible,akubicharm/openshift-ansible,brenton/openshift-ansible,miminar/openshift-ansible,jwhonce/openshift-ansible,liggitt/openshift-ansible,thoraxe/openshift-ansible,EricMountain-1A/openshift-ansible,aveshagarwal/openshift-ansible,twiest/openshift-ansible,liggitt/openshift-ansible,akram/openshift-ansible,miminar/openshift-ansible,wbrefvem/openshift-ansible,anpingli/openshift-ansible,sdodson/openshift-ansible,detiber/openshift-ansible,zhiwliu/openshift-ansible,tagliateller/openshift-ansible,mmahut/openshift-ansible,zhiwliu/openshift-ansible,jwhonce/openshift-ansible,mwoodson/openshift-ansible,twiest/openshift-ansible,abutcher/openshift-ansible,abutcher/openshift-ansible,nak3/openshift-ansible,gburges/openshift-ansible,sdodson/openshift-ansible,detiber/openshift-ansible,aveshagarwal/openshift-ansible,wbrefvem/openshift-ansible,tagliateller/openshift-ansible,openshift/openshift-ansible,ewolinetz/openshift-ansible,rhdedgar/openshift-ansible,akubicharm/openshift-ansible,miminar/openshift-ansible,EricMountain-1A/openshift-ansible,akram/openshift-ansible,mmahut/openshift-ansible,markllama/openshift-ansible,maxamillion/openshift-ansible
yaml
## Code Before: manageiq_cluster_role: apiVersion: v1 kind: ClusterRole metadata: name: management-infra-admin rules: - resources: - pods/proxy verbs: - '*' manageiq_service_account: apiVersion: v1 kind: ServiceAccount metadata: name: management-admin manageiq_image_inspector_service_account: apiVersion: v1 kind: ServiceAccount metadata: name: inspector-admin manage_iq_tmp_conf: /tmp/manageiq_admin.kubeconfig manage_iq_tasks: - policy add-role-to-user -n management-infra admin -z management-admin - policy add-role-to-user -n management-infra management-infra-admin -z management-admin - policy add-cluster-role-to-user cluster-reader system:serviceaccount:management-infra:management-admin - policy add-scc-to-user privileged system:serviceaccount:management-infra:management-admin - policy add-cluster-role-to-user system:image-puller system:serviceaccount:management-infra:inspector-admin - policy add-scc-to-user privileged system:serviceaccount:management-infra:inspector-admin manage_iq_openshift_3_2_tasks: - policy add-cluster-role-to-user system:image-auditor system:serviceaccount:management-infra:management-admin ## Instruction: Add role to manageiq to allow creation of projects ## Code After: manageiq_cluster_role: apiVersion: v1 kind: ClusterRole metadata: name: management-infra-admin rules: - resources: - pods/proxy verbs: - '*' manageiq_service_account: apiVersion: v1 kind: ServiceAccount metadata: name: management-admin manageiq_image_inspector_service_account: apiVersion: v1 kind: ServiceAccount metadata: name: inspector-admin manage_iq_tmp_conf: /tmp/manageiq_admin.kubeconfig manage_iq_tasks: - policy add-role-to-user -n management-infra admin -z management-admin - policy add-role-to-user -n management-infra management-infra-admin -z management-admin - policy add-cluster-role-to-user cluster-reader system:serviceaccount:management-infra:management-admin - policy add-scc-to-user privileged system:serviceaccount:management-infra:management-admin - policy add-cluster-role-to-user system:image-puller system:serviceaccount:management-infra:inspector-admin - policy add-scc-to-user privileged system:serviceaccount:management-infra:inspector-admin - policy add-cluster-role-to-user self-provisioner system:serviceaccount:management-infra:management-admin manage_iq_openshift_3_2_tasks: - policy add-cluster-role-to-user system:image-auditor system:serviceaccount:management-infra:management-admin
manageiq_cluster_role: apiVersion: v1 kind: ClusterRole metadata: name: management-infra-admin rules: - resources: - pods/proxy verbs: - '*' manageiq_service_account: apiVersion: v1 kind: ServiceAccount metadata: name: management-admin manageiq_image_inspector_service_account: apiVersion: v1 kind: ServiceAccount metadata: name: inspector-admin manage_iq_tmp_conf: /tmp/manageiq_admin.kubeconfig manage_iq_tasks: - policy add-role-to-user -n management-infra admin -z management-admin - policy add-role-to-user -n management-infra management-infra-admin -z management-admin - policy add-cluster-role-to-user cluster-reader system:serviceaccount:management-infra:management-admin - policy add-scc-to-user privileged system:serviceaccount:management-infra:management-admin - policy add-cluster-role-to-user system:image-puller system:serviceaccount:management-infra:inspector-admin - policy add-scc-to-user privileged system:serviceaccount:management-infra:inspector-admin + - policy add-cluster-role-to-user self-provisioner system:serviceaccount:management-infra:management-admin manage_iq_openshift_3_2_tasks: - policy add-cluster-role-to-user system:image-auditor system:serviceaccount:management-infra:management-admin
1
0.028571
1
0
bb55b287101d82a70446552bb8fea7eb51a6837d
build/filter.sh
build/filter.sh
git clone https://github.com/geramirez/concourse-filter pushd concourse-filter go build exec &> >(./concourse-filter) popd
go install github.com/geramirez/concourse-filter export CREDENTIAL_FILTER_WHITELIST=`env | cut -d '=' -f 1 | grep -v '^_$' | xargs echo | tr ' ' ','` exec &> >($GOPATH/bin/concourse-filter)
Create initial Concourse Filter whitelist from docker bootup env vars
Create initial Concourse Filter whitelist from docker bootup env vars [#120319485] Signed-off-by: James Wen <3b2f4c88287a5fcd7db73a67dd1ab82807db04ee@columbia.edu>
Shell
apache-2.0
cloudfoundry/buildpacks-ci,orange-cloudfoundry/buildpacks-ci,orange-cloudfoundry/buildpacks-ci,cloudfoundry/buildpacks-ci,cloudfoundry/buildpacks-ci,orange-cloudfoundry/buildpacks-ci,cloudfoundry/buildpacks-ci,cloudfoundry/buildpacks-ci
shell
## Code Before: git clone https://github.com/geramirez/concourse-filter pushd concourse-filter go build exec &> >(./concourse-filter) popd ## Instruction: Create initial Concourse Filter whitelist from docker bootup env vars [#120319485] Signed-off-by: James Wen <3b2f4c88287a5fcd7db73a67dd1ab82807db04ee@columbia.edu> ## Code After: go install github.com/geramirez/concourse-filter export CREDENTIAL_FILTER_WHITELIST=`env | cut -d '=' -f 1 | grep -v '^_$' | xargs echo | tr ' ' ','` exec &> >($GOPATH/bin/concourse-filter)
- git clone https://github.com/geramirez/concourse-filter ? -------------- + go install github.com/geramirez/concourse-filter ? ++ ++ +++ + export CREDENTIAL_FILTER_WHITELIST=`env | cut -d '=' -f 1 | grep -v '^_$' | xargs echo | tr ' ' ','` - pushd concourse-filter - go build - exec &> >(./concourse-filter) ? - ^ + exec &> >($GOPATH/bin/concourse-filter) ? ^^^^^^^^^^^ - popd
8
1.333333
3
5
5229c5c06af7e3d74ecebc0adee8d0b3667732ad
src/Flarum/Api/Actions/Discussions/Create.php
src/Flarum/Api/Actions/Discussions/Create.php
<?php namespace Flarum\Api\Actions\Discussions; use Event; use Flarum\Core\Discussions\Commands\StartDiscussionCommand; use Flarum\Core\Users\User; use Flarum\Api\Actions\Base; use Flarum\Api\Serializers\DiscussionSerializer; class Create extends Base { /** * Start a new discussion. * * @return Response */ protected function run() { // By default, the only required attributes of a discussion are the // title and the content. We'll extract these from the request data // and pass them through to the StartDiscussionCommand. $title = $this->input('discussions.title'); $content = $this->input('discussions.content'); $command = new StartDiscussionCommand($title, $content, User::current()); Event::fire('Flarum.Api.Actions.Discussions.Create.WillExecuteCommand', [$command, $this->document]); $discussion = $this->commandBus->execute($command); $serializer = new DiscussionSerializer(['posts']); $this->document->setPrimaryElement($serializer->resource($discussion)); return $this->respondWithDocument(); } }
<?php namespace Flarum\Api\Actions\Discussions; use Event; use Flarum\Core\Discussions\Commands\StartDiscussionCommand; use Flarum\Core\Discussions\Commands\ReadDiscussionCommand; use Flarum\Core\Users\User; use Flarum\Api\Actions\Base; use Flarum\Api\Serializers\DiscussionSerializer; class Create extends Base { /** * Start a new discussion. * * @return Response */ protected function run() { // By default, the only required attributes of a discussion are the // title and the content. We'll extract these from the request data // and pass them through to the StartDiscussionCommand. $title = $this->input('discussions.title'); $content = $this->input('discussions.content'); $user = User::current(); $command = new StartDiscussionCommand($title, $content, $user); Event::fire('Flarum.Api.Actions.Discussions.Create.WillExecuteCommand', [$command, $this->document]); $discussion = $this->commandBus->execute($command); // After creating the discussion, we assume that the user has seen all // of the posts in the discussion; thus, we will mark the discussion // as read if they are logged in. if ($user->exists) { $command = new ReadDiscussionCommand($discussion->id, $user, 1); $this->commandBus->execute($command); } $serializer = new DiscussionSerializer(['posts']); $this->document->setPrimaryElement($serializer->resource($discussion)); return $this->respondWithDocument(); } }
Mark a discussion as read when it is created
Mark a discussion as read when it is created
PHP
mit
dungphanxuan/core,Luceos/core,kirkbushell/core,Luceos/core,huytd/core,liukaijv/core,datitisev/core,datitisev/core,malayladu/core,malayladu/core,kidaa/core,Albert221/core,falconchen/core,renyuneyun/core,liukaijv/core,dungphanxuan/core,billmn/core,dungphanxuan/core,flarum/core,renyuneyun/core,utkarshx/core,zaksoup/core,zaksoup/core,Albert221/core,datitisev/core,jubianchi/core,Luceos/core,Onyx47/core,flarum/core,kidaa/core,vuthaihoc/core,billmn/core,Albert221/core,vuthaihoc/core,utkarshx/core,malayladu/core,zaksoup/core,flarum/core,vuthaihoc/core,renyuneyun/core,huytd/core,falconchen/core,Onyx47/core,falconchen/core,kirkbushell/core,malayladu/core,Onyx47/core,Albert221/core,billmn/core,datitisev/core,Luceos/core,kidaa/core,renyuneyun/core,jubianchi/core,kirkbushell/core,kirkbushell/core
php
## Code Before: <?php namespace Flarum\Api\Actions\Discussions; use Event; use Flarum\Core\Discussions\Commands\StartDiscussionCommand; use Flarum\Core\Users\User; use Flarum\Api\Actions\Base; use Flarum\Api\Serializers\DiscussionSerializer; class Create extends Base { /** * Start a new discussion. * * @return Response */ protected function run() { // By default, the only required attributes of a discussion are the // title and the content. We'll extract these from the request data // and pass them through to the StartDiscussionCommand. $title = $this->input('discussions.title'); $content = $this->input('discussions.content'); $command = new StartDiscussionCommand($title, $content, User::current()); Event::fire('Flarum.Api.Actions.Discussions.Create.WillExecuteCommand', [$command, $this->document]); $discussion = $this->commandBus->execute($command); $serializer = new DiscussionSerializer(['posts']); $this->document->setPrimaryElement($serializer->resource($discussion)); return $this->respondWithDocument(); } } ## Instruction: Mark a discussion as read when it is created ## Code After: <?php namespace Flarum\Api\Actions\Discussions; use Event; use Flarum\Core\Discussions\Commands\StartDiscussionCommand; use Flarum\Core\Discussions\Commands\ReadDiscussionCommand; use Flarum\Core\Users\User; use Flarum\Api\Actions\Base; use Flarum\Api\Serializers\DiscussionSerializer; class Create extends Base { /** * Start a new discussion. * * @return Response */ protected function run() { // By default, the only required attributes of a discussion are the // title and the content. We'll extract these from the request data // and pass them through to the StartDiscussionCommand. $title = $this->input('discussions.title'); $content = $this->input('discussions.content'); $user = User::current(); $command = new StartDiscussionCommand($title, $content, $user); Event::fire('Flarum.Api.Actions.Discussions.Create.WillExecuteCommand', [$command, $this->document]); $discussion = $this->commandBus->execute($command); // After creating the discussion, we assume that the user has seen all // of the posts in the discussion; thus, we will mark the discussion // as read if they are logged in. if ($user->exists) { $command = new ReadDiscussionCommand($discussion->id, $user, 1); $this->commandBus->execute($command); } $serializer = new DiscussionSerializer(['posts']); $this->document->setPrimaryElement($serializer->resource($discussion)); return $this->respondWithDocument(); } }
<?php namespace Flarum\Api\Actions\Discussions; use Event; use Flarum\Core\Discussions\Commands\StartDiscussionCommand; + use Flarum\Core\Discussions\Commands\ReadDiscussionCommand; use Flarum\Core\Users\User; use Flarum\Api\Actions\Base; use Flarum\Api\Serializers\DiscussionSerializer; class Create extends Base { /** * Start a new discussion. * * @return Response */ protected function run() { // By default, the only required attributes of a discussion are the // title and the content. We'll extract these from the request data // and pass them through to the StartDiscussionCommand. $title = $this->input('discussions.title'); $content = $this->input('discussions.content'); + $user = User::current(); - $command = new StartDiscussionCommand($title, $content, User::current()); ? ^ ----------- + $command = new StartDiscussionCommand($title, $content, $user); ? ^^ Event::fire('Flarum.Api.Actions.Discussions.Create.WillExecuteCommand', [$command, $this->document]); $discussion = $this->commandBus->execute($command); + + // After creating the discussion, we assume that the user has seen all + // of the posts in the discussion; thus, we will mark the discussion + // as read if they are logged in. + if ($user->exists) { + $command = new ReadDiscussionCommand($discussion->id, $user, 1); + $this->commandBus->execute($command); + } $serializer = new DiscussionSerializer(['posts']); $this->document->setPrimaryElement($serializer->resource($discussion)); return $this->respondWithDocument(); } }
12
0.342857
11
1
a490be43b4ee2b5e8f2458f555876472eb5b5485
meta-genivi-dev/poky/meta/recipes-graphics/wayland/weston/weston.ini
meta-genivi-dev/poky/meta/recipes-graphics/wayland/weston/weston.ini
[core] shell=ivi-shell.so [ivi-shell] ivi-module=ivi-controller.so ivi-input-module=ivi-input-controller.so transition-duration=300 cursor-theme=default [keyboard] keymap_layout=de [input-method] path=
[core] shell=ivi-shell.so [ivi-shell] ivi-module=ivi-controller.so ivi-input-module=ivi-input-controller.so transition-duration=300 cursor-theme=default [input-method] path=
Set keyboard layout to default (English)
Set keyboard layout to default (English) The keyboard layout is set to German in weston.ini. This change removes that setting making weston load the default layout i.e. English. [GDP-574] GDP has German keyboard layout Signed-off-by: Viktor Sjölind <de9bdef9475b3a1b942c4473840195297b5e2350@pelagicore.com>
INI
mit
GENIVI/genivi-dev-platform,chbae/genivi-dev-platform,gunnarx/genivi-dev-platform,chbae/genivi-dev-platform,GENIVI/genivi-dev-platform,chbae/genivi-dev-platform,chbae/genivi-dev-platform,GENIVI/genivi-dev-platform,GENIVI/genivi-dev-platform,gunnarx/genivi-dev-platform,gunnarx/genivi-dev-platform,gunnarx/genivi-dev-platform
ini
## Code Before: [core] shell=ivi-shell.so [ivi-shell] ivi-module=ivi-controller.so ivi-input-module=ivi-input-controller.so transition-duration=300 cursor-theme=default [keyboard] keymap_layout=de [input-method] path= ## Instruction: Set keyboard layout to default (English) The keyboard layout is set to German in weston.ini. This change removes that setting making weston load the default layout i.e. English. [GDP-574] GDP has German keyboard layout Signed-off-by: Viktor Sjölind <de9bdef9475b3a1b942c4473840195297b5e2350@pelagicore.com> ## Code After: [core] shell=ivi-shell.so [ivi-shell] ivi-module=ivi-controller.so ivi-input-module=ivi-input-controller.so transition-duration=300 cursor-theme=default [input-method] path=
[core] shell=ivi-shell.so [ivi-shell] ivi-module=ivi-controller.so ivi-input-module=ivi-input-controller.so transition-duration=300 cursor-theme=default - [keyboard] - keymap_layout=de - [input-method] path=
3
0.214286
0
3
54b42da112d6f64c390063c0f42941c0cca5b50c
source/index.rst
source/index.rst
.. uthcode documentation master file, created by sphinx-quickstart on Sat Oct 24 18:08:47 2009. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. ======= Uthcode ======= Uthcode is a platform to learn programming using problem solving approach. A language is learnt by writing code; solving problems which demonstrate the features of the language lend to certian amount of creative problem solving joy using that language. The problems and solutions in Uthcode can easily be verified by running on ideone sandbox. And collabration and improvement most welcome by sending a pull request via Github. Happy Hacking! Stay updated via `Uthcode blog`_ or follow uthcode on twitter `@uthcode`_ .. _Uthcode blog: http://blog.uthcode.com .. _@uthcode: http://www.twitter.com/uthcode C Programming Language ====================== .. toctree:: :maxdepth: 2 cprogramming/index Python ====== .. toctree:: :maxdepth: 2 python/index .. git_changelog::
.. uthcode documentation master file, created by sphinx-quickstart on Sat Oct 24 18:08:47 2009. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. ======= Uthcode ======= Uthcode is a platform to learn programming using problem solving approach. A language is learnt by writing code; solving problems which demonstrate the features of the language lend to certian amount of creative problem solving joy using that language. The problems and solutions in Uthcode can easily be verified by running on ideone sandbox. And collabration and improvement most welcome by sending a pull request via Github. Happy Hacking! Stay updated via `Uthcode blog`_ or follow uthcode on twitter `@uthcode`_ .. _Uthcode blog: http://blog.uthcode.com .. _@uthcode: http://www.twitter.com/uthcode C Programming Language ====================== .. toctree:: :maxdepth: 2 cprogramming/index Python Programming Language =========================== .. toctree:: :maxdepth: 2 python/index .. git_changelog::
Call it Python Programming Language
Call it Python Programming Language
reStructuredText
bsd-3-clause
gusyussh/learntosolveit,shabbir005/learntosolveit,shabbir005/learntosolveit,whcdanny/learntosolveit,adeshmukh/learntosolveit,adeshmukh/learntosolveit,shabbir005/learntosolveit,beqa2323/learntosolveit,whcdanny/learntosolveit,whcdanny/learntosolveit,adsznzhang/learntosolveit,beqa2323/learntosolveit,beqa2323/learntosolveit,adeshmukh/learntosolveit,adsznzhang/learntosolveit,adeshmukh/learntosolveit,gusyussh/learntosolveit,whcdanny/learntosolveit,shabbir005/learntosolveit,adeshmukh/learntosolveit,beqa2323/learntosolveit,gusyussh/learntosolveit,whcdanny/learntosolveit,gusyussh/learntosolveit,adsznzhang/learntosolveit,whcdanny/learntosolveit,adeshmukh/learntosolveit,beqa2323/learntosolveit,adsznzhang/learntosolveit,gusyussh/learntosolveit,shabbir005/learntosolveit,gusyussh/learntosolveit,adsznzhang/learntosolveit,shabbir005/learntosolveit,beqa2323/learntosolveit,shabbir005/learntosolveit,gusyussh/learntosolveit,adsznzhang/learntosolveit,gusyussh/learntosolveit,shabbir005/learntosolveit,gusyussh/learntosolveit,shabbir005/learntosolveit
restructuredtext
## Code Before: .. uthcode documentation master file, created by sphinx-quickstart on Sat Oct 24 18:08:47 2009. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. ======= Uthcode ======= Uthcode is a platform to learn programming using problem solving approach. A language is learnt by writing code; solving problems which demonstrate the features of the language lend to certian amount of creative problem solving joy using that language. The problems and solutions in Uthcode can easily be verified by running on ideone sandbox. And collabration and improvement most welcome by sending a pull request via Github. Happy Hacking! Stay updated via `Uthcode blog`_ or follow uthcode on twitter `@uthcode`_ .. _Uthcode blog: http://blog.uthcode.com .. _@uthcode: http://www.twitter.com/uthcode C Programming Language ====================== .. toctree:: :maxdepth: 2 cprogramming/index Python ====== .. toctree:: :maxdepth: 2 python/index .. git_changelog:: ## Instruction: Call it Python Programming Language ## Code After: .. uthcode documentation master file, created by sphinx-quickstart on Sat Oct 24 18:08:47 2009. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. ======= Uthcode ======= Uthcode is a platform to learn programming using problem solving approach. A language is learnt by writing code; solving problems which demonstrate the features of the language lend to certian amount of creative problem solving joy using that language. The problems and solutions in Uthcode can easily be verified by running on ideone sandbox. And collabration and improvement most welcome by sending a pull request via Github. Happy Hacking! Stay updated via `Uthcode blog`_ or follow uthcode on twitter `@uthcode`_ .. _Uthcode blog: http://blog.uthcode.com .. _@uthcode: http://www.twitter.com/uthcode C Programming Language ====================== .. toctree:: :maxdepth: 2 cprogramming/index Python Programming Language =========================== .. toctree:: :maxdepth: 2 python/index .. git_changelog::
.. uthcode documentation master file, created by sphinx-quickstart on Sat Oct 24 18:08:47 2009. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. ======= Uthcode ======= Uthcode is a platform to learn programming using problem solving approach. A language is learnt by writing code; solving problems which demonstrate the features of the language lend to certian amount of creative problem solving joy using that language. The problems and solutions in Uthcode can easily be verified by running on ideone sandbox. And collabration and improvement most welcome by sending a pull request via Github. Happy Hacking! Stay updated via `Uthcode blog`_ or follow uthcode on twitter `@uthcode`_ .. _Uthcode blog: http://blog.uthcode.com .. _@uthcode: http://www.twitter.com/uthcode C Programming Language ====================== .. toctree:: :maxdepth: 2 cprogramming/index - Python - ====== + Python Programming Language + =========================== .. toctree:: :maxdepth: 2 python/index .. git_changelog::
4
0.086957
2
2
68e2232b76eb4f47365a08524f1634ea859b2ed8
jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/HartbeatEndpoint.java
jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/HartbeatEndpoint.java
package org.jboss.aerogear.unifiedpush.rest; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import com.datastax.driver.core.utils.UUIDs; import com.qmino.miredot.annotations.ReturnType; @Path("/hartbeat") public class HartbeatEndpoint extends AbstractBaseEndpoint { /** * Hartbeat Endpoint * * @return Hartbeat in form of time-based UUID. * @statuscode 200 Successful response for your request */ @GET @Produces(MediaType.APPLICATION_JSON) @ReturnType("java.lang.String") public Response hartbeat(@Context HttpServletRequest request) { return appendAllowOriginHeader(Response.ok().entity(quote(UUIDs.timeBased().toString())), request); } }
package org.jboss.aerogear.unifiedpush.rest; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.GET; import javax.ws.rs.OPTIONS; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import com.datastax.driver.core.utils.UUIDs; import com.qmino.miredot.annotations.ReturnType; @Path("/hartbeat") public class HartbeatEndpoint extends AbstractBaseEndpoint { @OPTIONS @ReturnType("java.lang.Void") public Response crossOriginForApplication(@Context HttpHeaders headers) { return appendPreflightResponseHeaders(headers, Response.ok()).build(); } /** * Hartbeat Endpoint * * @return Hartbeat in form of time-based UUID. * @statuscode 200 Successful response for your request */ @GET @Produces(MediaType.APPLICATION_JSON) @ReturnType("java.lang.String") public Response hartbeat(@Context HttpServletRequest request) { return appendAllowOriginHeader(Response.ok().entity(quote(UUIDs.timeBased().toString())), request); } }
Add OPTIONS to hartbeat API
Add OPTIONS to hartbeat API
Java
apache-2.0
aerobase/unifiedpush-server,C-B4/unifiedpush-server,C-B4/unifiedpush-server,aerobase/unifiedpush-server,aerobase/unifiedpush-server,C-B4/unifiedpush-server,C-B4/unifiedpush-server
java
## Code Before: package org.jboss.aerogear.unifiedpush.rest; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import com.datastax.driver.core.utils.UUIDs; import com.qmino.miredot.annotations.ReturnType; @Path("/hartbeat") public class HartbeatEndpoint extends AbstractBaseEndpoint { /** * Hartbeat Endpoint * * @return Hartbeat in form of time-based UUID. * @statuscode 200 Successful response for your request */ @GET @Produces(MediaType.APPLICATION_JSON) @ReturnType("java.lang.String") public Response hartbeat(@Context HttpServletRequest request) { return appendAllowOriginHeader(Response.ok().entity(quote(UUIDs.timeBased().toString())), request); } } ## Instruction: Add OPTIONS to hartbeat API ## Code After: package org.jboss.aerogear.unifiedpush.rest; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.GET; import javax.ws.rs.OPTIONS; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import com.datastax.driver.core.utils.UUIDs; import com.qmino.miredot.annotations.ReturnType; @Path("/hartbeat") public class HartbeatEndpoint extends AbstractBaseEndpoint { @OPTIONS @ReturnType("java.lang.Void") public Response crossOriginForApplication(@Context HttpHeaders headers) { return appendPreflightResponseHeaders(headers, Response.ok()).build(); } /** * Hartbeat Endpoint * * @return Hartbeat in form of time-based UUID. * @statuscode 200 Successful response for your request */ @GET @Produces(MediaType.APPLICATION_JSON) @ReturnType("java.lang.String") public Response hartbeat(@Context HttpServletRequest request) { return appendAllowOriginHeader(Response.ok().entity(quote(UUIDs.timeBased().toString())), request); } }
package org.jboss.aerogear.unifiedpush.rest; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.GET; + import javax.ws.rs.OPTIONS; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; + import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import com.datastax.driver.core.utils.UUIDs; import com.qmino.miredot.annotations.ReturnType; @Path("/hartbeat") public class HartbeatEndpoint extends AbstractBaseEndpoint { + + @OPTIONS + @ReturnType("java.lang.Void") + public Response crossOriginForApplication(@Context HttpHeaders headers) { + return appendPreflightResponseHeaders(headers, Response.ok()).build(); + } + /** * Hartbeat Endpoint * * @return Hartbeat in form of time-based UUID. * @statuscode 200 Successful response for your request */ @GET @Produces(MediaType.APPLICATION_JSON) @ReturnType("java.lang.String") public Response hartbeat(@Context HttpServletRequest request) { return appendAllowOriginHeader(Response.ok().entity(quote(UUIDs.timeBased().toString())), request); } }
9
0.321429
9
0
53c7d27f9097c6c80b080f2708f34cbfa296db5e
index.js
index.js
'use strict'; const path = require('path'); const pkg = require(path.resolve('./package.json')); const semver = require('semver'); const versions = require('./versions.json'); const presetEnv = require.resolve('babel-preset-env'); const presetStage3 = require.resolve('babel-preset-stage-3'); module.exports = function() { const targets = {}; if (typeof pkg.browserslist === 'object' && pkg.browserslist.length) { targets.browsers = pkg.browserslist; } if (typeof pkg.engines === 'object' && pkg.engines.node) { const version = pkg.engines.node; if (semver.valid(version)) { targets.node = version; } else if (semver.validRange(version)) { targets.node = semver.minSatisfying(versions.node, version); } } return { presets: [ [presetEnv, {targets}], presetStage3, ], }; };
'use strict'; const path = require('path'); const pkg = require(path.resolve('./package.json')); const semver = require('semver'); const versions = require('./versions.json'); const presetEnv = require.resolve('babel-preset-env'); const presetStage3 = require.resolve('babel-preset-stage-3'); module.exports = function() { const targets = {}; if (pkg.browserslist) { targets.browsers = pkg.browserslist; } if (pkg.engines && pkg.engines.node) { const version = pkg.engines.node; if (semver.valid(version)) { targets.node = version; } else if (semver.validRange(version)) { targets.node = semver.minSatisfying(versions.node, version); } } return { presets: [ [presetEnv, {targets}], presetStage3, ], }; };
Simplify the checks for package.json objects
:hammer: Simplify the checks for package.json objects
JavaScript
mit
jamieconnolly/babel-preset
javascript
## Code Before: 'use strict'; const path = require('path'); const pkg = require(path.resolve('./package.json')); const semver = require('semver'); const versions = require('./versions.json'); const presetEnv = require.resolve('babel-preset-env'); const presetStage3 = require.resolve('babel-preset-stage-3'); module.exports = function() { const targets = {}; if (typeof pkg.browserslist === 'object' && pkg.browserslist.length) { targets.browsers = pkg.browserslist; } if (typeof pkg.engines === 'object' && pkg.engines.node) { const version = pkg.engines.node; if (semver.valid(version)) { targets.node = version; } else if (semver.validRange(version)) { targets.node = semver.minSatisfying(versions.node, version); } } return { presets: [ [presetEnv, {targets}], presetStage3, ], }; }; ## Instruction: :hammer: Simplify the checks for package.json objects ## Code After: 'use strict'; const path = require('path'); const pkg = require(path.resolve('./package.json')); const semver = require('semver'); const versions = require('./versions.json'); const presetEnv = require.resolve('babel-preset-env'); const presetStage3 = require.resolve('babel-preset-stage-3'); module.exports = function() { const targets = {}; if (pkg.browserslist) { targets.browsers = pkg.browserslist; } if (pkg.engines && pkg.engines.node) { const version = pkg.engines.node; if (semver.valid(version)) { targets.node = version; } else if (semver.validRange(version)) { targets.node = semver.minSatisfying(versions.node, version); } } return { presets: [ [presetEnv, {targets}], presetStage3, ], }; };
'use strict'; const path = require('path'); const pkg = require(path.resolve('./package.json')); const semver = require('semver'); const versions = require('./versions.json'); const presetEnv = require.resolve('babel-preset-env'); const presetStage3 = require.resolve('babel-preset-stage-3'); module.exports = function() { const targets = {}; - if (typeof pkg.browserslist === 'object' && pkg.browserslist.length) { + if (pkg.browserslist) { targets.browsers = pkg.browserslist; } - if (typeof pkg.engines === 'object' && pkg.engines.node) { ? ------- ------------- + if (pkg.engines && pkg.engines.node) { const version = pkg.engines.node; if (semver.valid(version)) { targets.node = version; } else if (semver.validRange(version)) { targets.node = semver.minSatisfying(versions.node, version); } } return { presets: [ [presetEnv, {targets}], presetStage3, ], }; };
4
0.117647
2
2
e96df96e13e47ab983fbdbcf58bd00ebd0ff9e5b
public/js/layout.js
public/js/layout.js
var fixedWidth = 220; var minWidth = 660; var fixedPadding = 100; function layoutWidth() { var wWidth = $(window).width(); var bodyPadding = Math.max(Math.floor(wWidth / fixedWidth)-3, 1) * 100; if ($(".container").length) { var width = wWidth - bodyPadding; var newWidth = Math.floor(width / fixedWidth) * fixedWidth; if (newWidth < minWidth) newWidth = minWidth; $(".container").width(newWidth); } } $(document).ready(function() { layoutWidth(); $(window).resize(function(){ layoutWidth(); }); });
var fixedWidth = 220; var minWidth = 660; var fixedPadding = 100; var delayResize = null; function layoutWidth() { var wWidth = $(window).width(); var bodyPadding = Math.max(Math.floor(wWidth / fixedWidth)-3, 1) * 100; if ($(".container").length) { var width = wWidth - bodyPadding; var newWidth = Math.floor(width / fixedWidth) * fixedWidth; if (newWidth < minWidth) newWidth = minWidth; $(".container").width(newWidth); } } function layoutResize() { clearTimeout(delayResize); delayResize = setTimeout(layoutWidth, 250); } $(document).ready(function() { layoutWidth(); $(window).resize(function(){ layoutResize(); }); });
Add timeout when resizing container (prevent close multicall that can cause performance issue)
Add timeout when resizing container (prevent close multicall that can cause performance issue)
JavaScript
mit
hernantas/MangaReader,hernantas/MangaReader,hernantas/MangaReader
javascript
## Code Before: var fixedWidth = 220; var minWidth = 660; var fixedPadding = 100; function layoutWidth() { var wWidth = $(window).width(); var bodyPadding = Math.max(Math.floor(wWidth / fixedWidth)-3, 1) * 100; if ($(".container").length) { var width = wWidth - bodyPadding; var newWidth = Math.floor(width / fixedWidth) * fixedWidth; if (newWidth < minWidth) newWidth = minWidth; $(".container").width(newWidth); } } $(document).ready(function() { layoutWidth(); $(window).resize(function(){ layoutWidth(); }); }); ## Instruction: Add timeout when resizing container (prevent close multicall that can cause performance issue) ## Code After: var fixedWidth = 220; var minWidth = 660; var fixedPadding = 100; var delayResize = null; function layoutWidth() { var wWidth = $(window).width(); var bodyPadding = Math.max(Math.floor(wWidth / fixedWidth)-3, 1) * 100; if ($(".container").length) { var width = wWidth - bodyPadding; var newWidth = Math.floor(width / fixedWidth) * fixedWidth; if (newWidth < minWidth) newWidth = minWidth; $(".container").width(newWidth); } } function layoutResize() { clearTimeout(delayResize); delayResize = setTimeout(layoutWidth, 250); } $(document).ready(function() { layoutWidth(); $(window).resize(function(){ layoutResize(); }); });
var fixedWidth = 220; var minWidth = 660; var fixedPadding = 100; + var delayResize = null; function layoutWidth() { var wWidth = $(window).width(); var bodyPadding = Math.max(Math.floor(wWidth / fixedWidth)-3, 1) * 100; if ($(".container").length) { var width = wWidth - bodyPadding; var newWidth = Math.floor(width / fixedWidth) * fixedWidth; if (newWidth < minWidth) newWidth = minWidth; $(".container").width(newWidth); } } + function layoutResize() + { + clearTimeout(delayResize); + delayResize = setTimeout(layoutWidth, 250); + } + $(document).ready(function() { layoutWidth(); $(window).resize(function(){ - layoutWidth(); ? ^ ^^^ + layoutResize(); ? ^^^ ^^ }); });
9
0.36
8
1
af40af64320bac8940a32318a8706fea17a17012
lib/farm/tasks.rb
lib/farm/tasks.rb
require 'cgi' require 'yaml' namespace :farm do desc "Farm out a method call." task :run => :environment do puts YAML.load(CGI.unescape(ENV['CMD'])).perform end end
require 'cgi' require 'yaml' namespace :farm do task :run => :environment do puts YAML.load(CGI.unescape(ENV['CMD'])).perform end end
Remove description for farm:run since this task shouldn't be run manually.
Remove description for farm:run since this task shouldn't be run manually.
Ruby
mit
mattmanning/farm
ruby
## Code Before: require 'cgi' require 'yaml' namespace :farm do desc "Farm out a method call." task :run => :environment do puts YAML.load(CGI.unescape(ENV['CMD'])).perform end end ## Instruction: Remove description for farm:run since this task shouldn't be run manually. ## Code After: require 'cgi' require 'yaml' namespace :farm do task :run => :environment do puts YAML.load(CGI.unescape(ENV['CMD'])).perform end end
require 'cgi' require 'yaml' namespace :farm do - desc "Farm out a method call." task :run => :environment do puts YAML.load(CGI.unescape(ENV['CMD'])).perform end end
1
0.111111
0
1
d48a225eeefa9c88e7f71d234443a0c6209f54d3
README.md
README.md
Tracking our networth has never been this fun
Tracking our networth has never been this fun # Motivation There's really two fundamental ways to track your financial progress. + Track and stay within your budget + Track and stay within your networth The first one (your budget) is valient and great for starters. It helps to bring structure to your spending, and it's fun to "make it to the end of the month before the end of the money". The major problem with budgeting is that you only get an idea of spending, and not really if you are advanving. Let's say you diligently follow your budget of $1900, then good for you. But,if you are only taking home $2000, then you are only saving $1200/year. Not really enough to build a suitable nest egg. Instead, if you focus on your networth (i.e. add up your bank accounts and subtract your credit cards, mortgage, car loans), you can see if you are truly improving (or not). Not only that, you do bunch of other neat stuff like see *how* much of your salary you are saving, without having to track a single receipt. # Features This application will make it easy to track your networth, and really only needs you to log in once a month and update things. That's it # Mock-Ups Check out `./mockups` to see the proposed design. # Technology The application will be built using HTML, JavaScript, CSS, SASS, and Elixir.
Add motivation for the project
Add motivation for the project
Markdown
mit
aforward/wuw,aforward/wuw
markdown
## Code Before: Tracking our networth has never been this fun ## Instruction: Add motivation for the project ## Code After: Tracking our networth has never been this fun # Motivation There's really two fundamental ways to track your financial progress. + Track and stay within your budget + Track and stay within your networth The first one (your budget) is valient and great for starters. It helps to bring structure to your spending, and it's fun to "make it to the end of the month before the end of the money". The major problem with budgeting is that you only get an idea of spending, and not really if you are advanving. Let's say you diligently follow your budget of $1900, then good for you. But,if you are only taking home $2000, then you are only saving $1200/year. Not really enough to build a suitable nest egg. Instead, if you focus on your networth (i.e. add up your bank accounts and subtract your credit cards, mortgage, car loans), you can see if you are truly improving (or not). Not only that, you do bunch of other neat stuff like see *how* much of your salary you are saving, without having to track a single receipt. # Features This application will make it easy to track your networth, and really only needs you to log in once a month and update things. That's it # Mock-Ups Check out `./mockups` to see the proposed design. # Technology The application will be built using HTML, JavaScript, CSS, SASS, and Elixir.
+ Tracking our networth has never been this fun + + + # Motivation + + There's really two fundamental ways to track your financial progress. + + + Track and stay within your budget + + Track and stay within your networth + + The first one (your budget) is valient and great for starters. + It helps to bring structure to your spending, and it's fun to + "make it to the end of the month before the end of the money". + + The major problem with budgeting is that you only get an + idea of spending, and not really if you are advanving. Let's say + you diligently follow your budget of $1900, then good for you. + + But,if you are only taking home $2000, then you are only saving $1200/year. + Not really enough to build a suitable nest egg. + + Instead, if you focus on your networth (i.e. add up your bank accounts and subtract your + credit cards, mortgage, car loans), you can see if you are truly improving (or not). + + Not only that, you do bunch of other neat stuff like see *how* much of your salary + you are saving, without having to track a single receipt. + + # Features + + This application will make it easy to track your networth, and really only needs you to log + in once a month and update things. That's it + + # Mock-Ups + + Check out `./mockups` to see the proposed design. + + # Technology + + The application will be built using HTML, JavaScript, CSS, SASS, and Elixir.
39
39
39
0
91b04b7bd8a69999a93daf74cefed33b0d81fc3b
src/Carriers/CarrierInterface.php
src/Carriers/CarrierInterface.php
<?php namespace Enzyme\Axiom\Carriers; /** * Holds a collection of read-only data for instance creation. */ interface CarrierInterface { /** * Get the associated value for the given key. * * @param string $key * * @return mixed */ public function getValueFor($key); }
<?php namespace Enzyme\Axiom\Carriers; /** * Holds a collection of read-only data for instance creation. */ interface CarrierInterface { /** * Get the associated value for the given key. * * @param string $key * * @return mixed */ public function getValueFor($key); /** * Check if there is an associated value for the given key. * * @param string $key * * @return mixed */ public function hasValueFor($key); }
Add has value check method on carrier interface.
Add has value check method on carrier interface.
PHP
mit
enzyme/axiom
php
## Code Before: <?php namespace Enzyme\Axiom\Carriers; /** * Holds a collection of read-only data for instance creation. */ interface CarrierInterface { /** * Get the associated value for the given key. * * @param string $key * * @return mixed */ public function getValueFor($key); } ## Instruction: Add has value check method on carrier interface. ## Code After: <?php namespace Enzyme\Axiom\Carriers; /** * Holds a collection of read-only data for instance creation. */ interface CarrierInterface { /** * Get the associated value for the given key. * * @param string $key * * @return mixed */ public function getValueFor($key); /** * Check if there is an associated value for the given key. * * @param string $key * * @return mixed */ public function hasValueFor($key); }
<?php namespace Enzyme\Axiom\Carriers; /** * Holds a collection of read-only data for instance creation. */ interface CarrierInterface { /** * Get the associated value for the given key. * * @param string $key * * @return mixed */ public function getValueFor($key); + + /** + * Check if there is an associated value for the given key. + * + * @param string $key + * + * @return mixed + */ + public function hasValueFor($key); }
9
0.5
9
0
18959857d9e576dc641ddf884676d955d1312854
library/Admin/library/Admin/Form/Song.js
library/Admin/library/Admin/Form/Song.js
/** * @class Admin_Form_Song * @extends CM_Form_Abstract */ var Admin_Form_Song = CM_Form_Abstract.extend({ _class: 'Admin_Form_Song' });
/** * @class Admin_Form_Song * @extends CM_Form_Abstract */ var Admin_Form_Song = CM_Form_Abstract.extend({ _class: 'Admin_Form_Song', childrenEvents: { 'Denkmal_FormField_FileSong uploadComplete': function(field, files) { this._setLabelFromFilename(files[0].name); } }, /** * @param {String} filename */ _setLabelFromFilename: function(filename) { filename = filename.replace(/\.[^\.]+$/, ''); this.getField('label').setValue(filename); } });
Set default label on song upload from filename
Set default label on song upload from filename
JavaScript
mit
njam/denkmal.org,njam/denkmal.org,njam/denkmal.org,fvovan/denkmal.org,njam/denkmal.org,denkmal/denkmal.org,denkmal/denkmal.org,denkmal/denkmal.org,fvovan/denkmal.org,denkmal/denkmal.org,fvovan/denkmal.org,njam/denkmal.org,fvovan/denkmal.org,fvovan/denkmal.org,denkmal/denkmal.org
javascript
## Code Before: /** * @class Admin_Form_Song * @extends CM_Form_Abstract */ var Admin_Form_Song = CM_Form_Abstract.extend({ _class: 'Admin_Form_Song' }); ## Instruction: Set default label on song upload from filename ## Code After: /** * @class Admin_Form_Song * @extends CM_Form_Abstract */ var Admin_Form_Song = CM_Form_Abstract.extend({ _class: 'Admin_Form_Song', childrenEvents: { 'Denkmal_FormField_FileSong uploadComplete': function(field, files) { this._setLabelFromFilename(files[0].name); } }, /** * @param {String} filename */ _setLabelFromFilename: function(filename) { filename = filename.replace(/\.[^\.]+$/, ''); this.getField('label').setValue(filename); } });
/** * @class Admin_Form_Song * @extends CM_Form_Abstract */ var Admin_Form_Song = CM_Form_Abstract.extend({ - _class: 'Admin_Form_Song' + _class: 'Admin_Form_Song', ? + + + childrenEvents: { + 'Denkmal_FormField_FileSong uploadComplete': function(field, files) { + this._setLabelFromFilename(files[0].name); + } + }, + + /** + * @param {String} filename + */ + _setLabelFromFilename: function(filename) { + filename = filename.replace(/\.[^\.]+$/, ''); + this.getField('label').setValue(filename); + } });
16
2.285714
15
1
bd210296e72b4375d947760df3b17e447a631f31
.travis.yml
.travis.yml
language: objective-c cache: - bundler before_install: bundle install script: pod lib testing notifications: slack: secure: rVGQq6qThM/5m49iaXrVxNa+r4pc1X4CP/jcqClLsBYePnxghTOYMe903yjOoPCkTYUh8LY7GYX0LjkxGoo/rxwRiPNVRxRV0SsFEfOR2xBfBcw8WqxGCq8X0pKCwP1aSIl13tAdgxvtq6N/VrC8chWlX9RmxwAHzZqRTRR1ukk= env: global: secure: L6HcaW+lYEBgPwuA6VnkiqBmnh+NkZMqsGOd+lhkkQABpduauln3vxkZ8DJ4SggmRLwM0XG1Fe+rkIZ9oVVovuNL58+vpQzAsWplPNvHpGt2InrVHauCqp4r5dr23XA6B118cz+hkmUx64NX/zZEgTD9IphkZEMTzU1jHHgIb2c=
language: objective-c cache: - bundler before_install: - bundle install - pod keys ManagementAPIAccessToken $CONTENTFUL_MANAGEMENT_API_ACCESS_TOKEN ManagementSDK.xcodeproj script: pod lib testing notifications: slack: secure: rVGQq6qThM/5m49iaXrVxNa+r4pc1X4CP/jcqClLsBYePnxghTOYMe903yjOoPCkTYUh8LY7GYX0LjkxGoo/rxwRiPNVRxRV0SsFEfOR2xBfBcw8WqxGCq8X0pKCwP1aSIl13tAdgxvtq6N/VrC8chWlX9RmxwAHzZqRTRR1ukk= env: global: secure: L6HcaW+lYEBgPwuA6VnkiqBmnh+NkZMqsGOd+lhkkQABpduauln3vxkZ8DJ4SggmRLwM0XG1Fe+rkIZ9oVVovuNL58+vpQzAsWplPNvHpGt2InrVHauCqp4r5dr23XA6B118cz+hkmUx64NX/zZEgTD9IphkZEMTzU1jHHgIb2c=
Use cocoapods-keys to store credentials.
Use cocoapods-keys to store credentials. Travis, be working!
YAML
mit
contentful/contentful-management.objc,contentful/contentful-management.objc
yaml
## Code Before: language: objective-c cache: - bundler before_install: bundle install script: pod lib testing notifications: slack: secure: rVGQq6qThM/5m49iaXrVxNa+r4pc1X4CP/jcqClLsBYePnxghTOYMe903yjOoPCkTYUh8LY7GYX0LjkxGoo/rxwRiPNVRxRV0SsFEfOR2xBfBcw8WqxGCq8X0pKCwP1aSIl13tAdgxvtq6N/VrC8chWlX9RmxwAHzZqRTRR1ukk= env: global: secure: L6HcaW+lYEBgPwuA6VnkiqBmnh+NkZMqsGOd+lhkkQABpduauln3vxkZ8DJ4SggmRLwM0XG1Fe+rkIZ9oVVovuNL58+vpQzAsWplPNvHpGt2InrVHauCqp4r5dr23XA6B118cz+hkmUx64NX/zZEgTD9IphkZEMTzU1jHHgIb2c= ## Instruction: Use cocoapods-keys to store credentials. Travis, be working! ## Code After: language: objective-c cache: - bundler before_install: - bundle install - pod keys ManagementAPIAccessToken $CONTENTFUL_MANAGEMENT_API_ACCESS_TOKEN ManagementSDK.xcodeproj script: pod lib testing notifications: slack: secure: rVGQq6qThM/5m49iaXrVxNa+r4pc1X4CP/jcqClLsBYePnxghTOYMe903yjOoPCkTYUh8LY7GYX0LjkxGoo/rxwRiPNVRxRV0SsFEfOR2xBfBcw8WqxGCq8X0pKCwP1aSIl13tAdgxvtq6N/VrC8chWlX9RmxwAHzZqRTRR1ukk= env: global: secure: L6HcaW+lYEBgPwuA6VnkiqBmnh+NkZMqsGOd+lhkkQABpduauln3vxkZ8DJ4SggmRLwM0XG1Fe+rkIZ9oVVovuNL58+vpQzAsWplPNvHpGt2InrVHauCqp4r5dr23XA6B118cz+hkmUx64NX/zZEgTD9IphkZEMTzU1jHHgIb2c=
language: objective-c cache: - bundler - before_install: bundle install + before_install: + - bundle install + - pod keys ManagementAPIAccessToken $CONTENTFUL_MANAGEMENT_API_ACCESS_TOKEN ManagementSDK.xcodeproj script: pod lib testing notifications: slack: secure: rVGQq6qThM/5m49iaXrVxNa+r4pc1X4CP/jcqClLsBYePnxghTOYMe903yjOoPCkTYUh8LY7GYX0LjkxGoo/rxwRiPNVRxRV0SsFEfOR2xBfBcw8WqxGCq8X0pKCwP1aSIl13tAdgxvtq6N/VrC8chWlX9RmxwAHzZqRTRR1ukk= env: global: secure: L6HcaW+lYEBgPwuA6VnkiqBmnh+NkZMqsGOd+lhkkQABpduauln3vxkZ8DJ4SggmRLwM0XG1Fe+rkIZ9oVVovuNL58+vpQzAsWplPNvHpGt2InrVHauCqp4r5dr23XA6B118cz+hkmUx64NX/zZEgTD9IphkZEMTzU1jHHgIb2c=
4
0.363636
3
1
cf593129ee27da8c52bca7c3a99ea5826a9b73da
.travis.yml
.travis.yml
language: php php: - '5.6' - '7.0' env: CODECLIMATE_REPO_TOKEN: ce6fe1b4b137a9b37dcae62ee6eee5585b621e286fdd4ae576974b800a6bcdd2 ./vendor/bin/test-reporter before_script: - composer self-update install: travis_retry composer install --no-interaction --prefer-source script: phpunit --coverage-clover builds/logs/clover.xml
language: php php: - '5.6' - '7.0' env: CODECLIMATE_REPO_TOKEN: ce6fe1b4b137a9b37dcae62ee6eee5585b621e286fdd4ae576974b800a6bcdd2 before_script: - composer self-update install: travis_retry composer install --no-interaction --prefer-source script: phpunit --coverage-clover builds/logs/clover.xml after_success: # CodeClimate - vendor/bin/test-reporter
Send coverge report to CodeClimate
Send coverge report to CodeClimate
YAML
mit
zombiesplat/RaffleTools.API
yaml
## Code Before: language: php php: - '5.6' - '7.0' env: CODECLIMATE_REPO_TOKEN: ce6fe1b4b137a9b37dcae62ee6eee5585b621e286fdd4ae576974b800a6bcdd2 ./vendor/bin/test-reporter before_script: - composer self-update install: travis_retry composer install --no-interaction --prefer-source script: phpunit --coverage-clover builds/logs/clover.xml ## Instruction: Send coverge report to CodeClimate ## Code After: language: php php: - '5.6' - '7.0' env: CODECLIMATE_REPO_TOKEN: ce6fe1b4b137a9b37dcae62ee6eee5585b621e286fdd4ae576974b800a6bcdd2 before_script: - composer self-update install: travis_retry composer install --no-interaction --prefer-source script: phpunit --coverage-clover builds/logs/clover.xml after_success: # CodeClimate - vendor/bin/test-reporter
language: php php: - '5.6' - '7.0' env: - CODECLIMATE_REPO_TOKEN: ce6fe1b4b137a9b37dcae62ee6eee5585b621e286fdd4ae576974b800a6bcdd2 ./vendor/bin/test-reporter ? --------------------------- + CODECLIMATE_REPO_TOKEN: ce6fe1b4b137a9b37dcae62ee6eee5585b621e286fdd4ae576974b800a6bcdd2 before_script: - composer self-update install: travis_retry composer install --no-interaction --prefer-source script: phpunit --coverage-clover builds/logs/clover.xml + + after_success: + # CodeClimate + - vendor/bin/test-reporter
6
0.428571
5
1
37c0eea76d6aba1180f2a3eae90d7f38566bfc3f
packages/mono-master.py
packages/mono-master.py
import os class MonoMasterPackage(Package): def __init__(self): Package.__init__(self, 'mono', os.getenv('MONO_VERSION'), sources = ['git://github.com/mono/mono.git'], revision = os.getenv('MONO_BUILD_REVISION'), configure_flags = [ '--enable-nls=no', '--prefix=' + Package.profile.prefix, '--with-ikvm=yes', '--with-moonlight=no' ] ) if Package.profile.name == 'darwin': if not Package.profile.m64: self.configure_flags.extend([ # fix build on lion, it uses 64-bit host even with -m32 '--build=i386-apple-darwin11.2.0', ]) self.configure_flags.extend([ '--enable-loadedllvm' ]) self.sources.extend ([ # Fixes up pkg-config usage on the Mac 'patches/mcs-pkgconfig.patch' ]) self.configure = expand_macros ('CFLAGS="%{env.CFLAGS} -O2" ./autogen.sh', Package.profile) def prep (self): Package.prep (self) if Package.profile.name == 'darwin': for p in range (1, len (self.sources)): self.sh ('patch -p1 < "%{sources[' + str (p) + ']}"') MonoMasterPackage()
import os class MonoMasterPackage(Package): def __init__(self): Package.__init__(self, 'mono', os.getenv('MONO_VERSION'), sources = [os.getenv('MONO_REPOSITORY') or 'git://github.com/mono/mono.git'], revision = os.getenv('MONO_BUILD_REVISION'), configure_flags = [ '--enable-nls=no', '--prefix=' + Package.profile.prefix, '--with-ikvm=yes', '--with-moonlight=no' ] ) if Package.profile.name == 'darwin': if not Package.profile.m64: self.configure_flags.extend([ # fix build on lion, it uses 64-bit host even with -m32 '--build=i386-apple-darwin11.2.0', ]) self.configure_flags.extend([ '--enable-loadedllvm' ]) self.sources.extend ([ # Fixes up pkg-config usage on the Mac 'patches/mcs-pkgconfig.patch' ]) self.configure = expand_macros ('CFLAGS="%{env.CFLAGS} -O2" ./autogen.sh', Package.profile) def prep (self): Package.prep (self) if Package.profile.name == 'darwin': for p in range (1, len (self.sources)): self.sh ('patch -p1 < "%{sources[' + str (p) + ']}"') MonoMasterPackage()
Use MONO_REPOSITORY to set the repo URL
Use MONO_REPOSITORY to set the repo URL
Python
mit
mono/bockbuild,BansheeMediaPlayer/bockbuild,BansheeMediaPlayer/bockbuild,BansheeMediaPlayer/bockbuild,mono/bockbuild
python
## Code Before: import os class MonoMasterPackage(Package): def __init__(self): Package.__init__(self, 'mono', os.getenv('MONO_VERSION'), sources = ['git://github.com/mono/mono.git'], revision = os.getenv('MONO_BUILD_REVISION'), configure_flags = [ '--enable-nls=no', '--prefix=' + Package.profile.prefix, '--with-ikvm=yes', '--with-moonlight=no' ] ) if Package.profile.name == 'darwin': if not Package.profile.m64: self.configure_flags.extend([ # fix build on lion, it uses 64-bit host even with -m32 '--build=i386-apple-darwin11.2.0', ]) self.configure_flags.extend([ '--enable-loadedllvm' ]) self.sources.extend ([ # Fixes up pkg-config usage on the Mac 'patches/mcs-pkgconfig.patch' ]) self.configure = expand_macros ('CFLAGS="%{env.CFLAGS} -O2" ./autogen.sh', Package.profile) def prep (self): Package.prep (self) if Package.profile.name == 'darwin': for p in range (1, len (self.sources)): self.sh ('patch -p1 < "%{sources[' + str (p) + ']}"') MonoMasterPackage() ## Instruction: Use MONO_REPOSITORY to set the repo URL ## Code After: import os class MonoMasterPackage(Package): def __init__(self): Package.__init__(self, 'mono', os.getenv('MONO_VERSION'), sources = [os.getenv('MONO_REPOSITORY') or 'git://github.com/mono/mono.git'], revision = os.getenv('MONO_BUILD_REVISION'), configure_flags = [ '--enable-nls=no', '--prefix=' + Package.profile.prefix, '--with-ikvm=yes', '--with-moonlight=no' ] ) if Package.profile.name == 'darwin': if not Package.profile.m64: self.configure_flags.extend([ # fix build on lion, it uses 64-bit host even with -m32 '--build=i386-apple-darwin11.2.0', ]) self.configure_flags.extend([ '--enable-loadedllvm' ]) self.sources.extend ([ # Fixes up pkg-config usage on the Mac 'patches/mcs-pkgconfig.patch' ]) self.configure = expand_macros ('CFLAGS="%{env.CFLAGS} -O2" ./autogen.sh', Package.profile) def prep (self): Package.prep (self) if Package.profile.name == 'darwin': for p in range (1, len (self.sources)): self.sh ('patch -p1 < "%{sources[' + str (p) + ']}"') MonoMasterPackage()
import os class MonoMasterPackage(Package): def __init__(self): Package.__init__(self, 'mono', os.getenv('MONO_VERSION'), - sources = ['git://github.com/mono/mono.git'], + sources = [os.getenv('MONO_REPOSITORY') or 'git://github.com/mono/mono.git'], ? ++++++++++++++++++++++++++++++++ revision = os.getenv('MONO_BUILD_REVISION'), configure_flags = [ '--enable-nls=no', '--prefix=' + Package.profile.prefix, '--with-ikvm=yes', '--with-moonlight=no' ] ) if Package.profile.name == 'darwin': if not Package.profile.m64: self.configure_flags.extend([ # fix build on lion, it uses 64-bit host even with -m32 '--build=i386-apple-darwin11.2.0', ]) self.configure_flags.extend([ '--enable-loadedllvm' ]) self.sources.extend ([ # Fixes up pkg-config usage on the Mac 'patches/mcs-pkgconfig.patch' ]) self.configure = expand_macros ('CFLAGS="%{env.CFLAGS} -O2" ./autogen.sh', Package.profile) def prep (self): Package.prep (self) if Package.profile.name == 'darwin': for p in range (1, len (self.sources)): self.sh ('patch -p1 < "%{sources[' + str (p) + ']}"') MonoMasterPackage()
2
0.05
1
1
02c96dbdefd39e2d7444220e10ac18fe8b36bc37
scripts/build/prepareOSXPackage.sh
scripts/build/prepareOSXPackage.sh
set -e set -o xtrace TAG_NAME=$(cat tagname.txt) GTFolderZip=GlamorousToolkitOSX64 GTFolder=$GTFolderZip-$TAG_NAME mkdir -p $GTFolder libFolder=libOSX64 mkdir -p $libFolder unzip build-artifacts/GlamorousToolkitVM-*-mac64-bin.zip -d $GTFolder/ cp -rv GlamorousToolkit/* $GTFolder rm -rf $GTFolder/pharo-local package_binary() { curl https://dl.feenk.com/$1/osx/development/x86_64/lib$1.dylib -o lib$1.dylib cp lib$1.dylib $GTFolder cp lib$1.dylib $libFolder } package_binary Boxer package_binary Gleam package_binary Glutin package_binary Clipboard package_binary Skia zip -qyr $GTFolderZip.zip $GTFolder zip -qyr $libFolder.zip $libFolder rm -rf $GTFolder rm -rf $libFolder set +e
set -e set -o xtrace TAG_NAME=$(cat tagname.txt) GTFolderZip=GlamorousToolkitOSX64 GTFolder=$GTFolderZip-$TAG_NAME mkdir -p $GTFolder libFolder=libOSX64 mkdir -p $libFolder unzip build-artifacts/GlamorousToolkitVM-*-mac64-bin.zip -d $GTFolder/ cp -rv GlamorousToolkit/* $GTFolder rm -rf $GTFolder/pharo-local package_binary() { curl https://dl.feenk.com/$1/osx/development/x86_64/lib$1.dylib -o lib$1.dylib cp lib$1.dylib $GTFolder cp lib$1.dylib $libFolder } package_binary Boxer package_binary Gleam package_binary Glutin package_binary Winit package_binary Metal package_binary Clipboard package_binary Skia zip -qyr $GTFolderZip.zip $GTFolder zip -qyr $libFolder.zip $libFolder rm -rf $GTFolder rm -rf $libFolder set +e
Package winit and metal on osx
Package winit and metal on osx
Shell
mit
feenkcom/gtoolkit
shell
## Code Before: set -e set -o xtrace TAG_NAME=$(cat tagname.txt) GTFolderZip=GlamorousToolkitOSX64 GTFolder=$GTFolderZip-$TAG_NAME mkdir -p $GTFolder libFolder=libOSX64 mkdir -p $libFolder unzip build-artifacts/GlamorousToolkitVM-*-mac64-bin.zip -d $GTFolder/ cp -rv GlamorousToolkit/* $GTFolder rm -rf $GTFolder/pharo-local package_binary() { curl https://dl.feenk.com/$1/osx/development/x86_64/lib$1.dylib -o lib$1.dylib cp lib$1.dylib $GTFolder cp lib$1.dylib $libFolder } package_binary Boxer package_binary Gleam package_binary Glutin package_binary Clipboard package_binary Skia zip -qyr $GTFolderZip.zip $GTFolder zip -qyr $libFolder.zip $libFolder rm -rf $GTFolder rm -rf $libFolder set +e ## Instruction: Package winit and metal on osx ## Code After: set -e set -o xtrace TAG_NAME=$(cat tagname.txt) GTFolderZip=GlamorousToolkitOSX64 GTFolder=$GTFolderZip-$TAG_NAME mkdir -p $GTFolder libFolder=libOSX64 mkdir -p $libFolder unzip build-artifacts/GlamorousToolkitVM-*-mac64-bin.zip -d $GTFolder/ cp -rv GlamorousToolkit/* $GTFolder rm -rf $GTFolder/pharo-local package_binary() { curl https://dl.feenk.com/$1/osx/development/x86_64/lib$1.dylib -o lib$1.dylib cp lib$1.dylib $GTFolder cp lib$1.dylib $libFolder } package_binary Boxer package_binary Gleam package_binary Glutin package_binary Winit package_binary Metal package_binary Clipboard package_binary Skia zip -qyr $GTFolderZip.zip $GTFolder zip -qyr $libFolder.zip $libFolder rm -rf $GTFolder rm -rf $libFolder set +e
set -e set -o xtrace TAG_NAME=$(cat tagname.txt) GTFolderZip=GlamorousToolkitOSX64 GTFolder=$GTFolderZip-$TAG_NAME mkdir -p $GTFolder libFolder=libOSX64 mkdir -p $libFolder unzip build-artifacts/GlamorousToolkitVM-*-mac64-bin.zip -d $GTFolder/ cp -rv GlamorousToolkit/* $GTFolder rm -rf $GTFolder/pharo-local package_binary() { curl https://dl.feenk.com/$1/osx/development/x86_64/lib$1.dylib -o lib$1.dylib cp lib$1.dylib $GTFolder cp lib$1.dylib $libFolder } package_binary Boxer package_binary Gleam package_binary Glutin + package_binary Winit + package_binary Metal package_binary Clipboard package_binary Skia zip -qyr $GTFolderZip.zip $GTFolder zip -qyr $libFolder.zip $libFolder rm -rf $GTFolder rm -rf $libFolder set +e
2
0.058824
2
0
d1c4acc669ac1c908cb6fab6e0be5d5c2f310272
actionpack/test/template/erb/tag_helper_test.rb
actionpack/test/template/erb/tag_helper_test.rb
require "abstract_unit" require "template/erb/helper" module ERBTest class TagHelperTest < BlockTestCase extend ActiveSupport::Testing::Declarative test "percent equals works for content_tag and does not require parenthesis on method call" do assert_equal "<div>Hello world</div>", render_content("content_tag :div", "Hello world") end test "percent equals works for javascript_tag" do expected_output = "<script>\n//<![CDATA[\nalert('Hello')\n//]]>\n</script>" assert_equal expected_output, render_content("javascript_tag", "alert('Hello')") end test "percent equals works for javascript_tag with options" do expected_output = "<script id=\"the_js_tag\">\n//<![CDATA[\nalert('Hello')\n//]]>\n</script>" assert_equal expected_output, render_content("javascript_tag(:id => 'the_js_tag')", "alert('Hello')") end test "percent equals works with form tags" do expected_output = %r{<form.*action="foo".*method="post">.*hello*</form>} assert_match expected_output, render_content("form_tag('foo')", "<%= 'hello' %>") end test "percent equals works with fieldset tags" do expected_output = "<fieldset><legend>foo</legend>hello</fieldset>" assert_equal expected_output, render_content("field_set_tag('foo')", "<%= 'hello' %>") end end end
require "abstract_unit" require "template/erb/helper" module ERBTest class TagHelperTest < BlockTestCase test "percent equals works for content_tag and does not require parenthesis on method call" do assert_equal "<div>Hello world</div>", render_content("content_tag :div", "Hello world") end test "percent equals works for javascript_tag" do expected_output = "<script>\n//<![CDATA[\nalert('Hello')\n//]]>\n</script>" assert_equal expected_output, render_content("javascript_tag", "alert('Hello')") end test "percent equals works for javascript_tag with options" do expected_output = "<script id=\"the_js_tag\">\n//<![CDATA[\nalert('Hello')\n//]]>\n</script>" assert_equal expected_output, render_content("javascript_tag(:id => 'the_js_tag')", "alert('Hello')") end test "percent equals works with form tags" do expected_output = %r{<form.*action="foo".*method="post">.*hello*</form>} assert_match expected_output, render_content("form_tag('foo')", "<%= 'hello' %>") end test "percent equals works with fieldset tags" do expected_output = "<fieldset><legend>foo</legend>hello</fieldset>" assert_equal expected_output, render_content("field_set_tag('foo')", "<%= 'hello' %>") end end end
Remove AS declarative extension from erb tag test
Remove AS declarative extension from erb tag test The extension was removed in 22bc12ec374b8bdeb3818ca0a3eb787dd3ce39d8, making "test" an alias for minitest's "it".
Ruby
mit
rbhitchcock/rails,Spin42/rails,tjschuck/rails,Erol/rails,sealocal/rails,MSP-Greg/rails,fabianoleittes/rails,jeremy/rails,kachick/rails,palkan/rails,illacceptanything/illacceptanything,Sen-Zhang/rails,esparta/rails,mathieujobin/reduced-rails-for-travis,vassilevsky/rails,stefanmb/rails,MichaelSp/rails,mtsmfm/rails,Stellenticket/rails,amoody2108/TechForJustice,MichaelSp/rails,printercu/rails,mechanicles/rails,bogdanvlviv/rails,kmayer/rails,gfvcastro/rails,sergey-alekseev/rails,xlymian/rails,kmayer/rails,pschambacher/rails,palkan/rails,deraru/rails,MSP-Greg/rails,gcourtemanche/rails,coreyward/rails,repinel/rails,maicher/rails,illacceptanything/illacceptanything,pvalena/rails,hanystudy/rails,amoody2108/TechForJustice,pvalena/rails,88rabbit/newRails,Stellenticket/rails,kachick/rails,vipulnsward/rails,rafaelfranca/omg-rails,esparta/rails,voray/rails,odedniv/rails,illacceptanything/illacceptanything,iainbeeston/rails,flanger001/rails,richseviora/rails,bradleypriest/rails,yhirano55/rails,schuetzm/rails,betesh/rails,tjschuck/rails,vassilevsky/rails,jeremy/rails,mathieujobin/reduced-rails-for-travis,fabianoleittes/rails,arjes/rails,yawboakye/rails,pvalena/rails,yahonda/rails,yawboakye/rails,felipecvo/rails,ledestin/rails,kaspth/rails,rossta/rails,joonyou/rails,shioyama/rails,tjschuck/rails,stefanmb/rails,koic/rails,mtsmfm/rails,elfassy/rails,gauravtiwari/rails,kirs/rails-1,sergey-alekseev/rails,arunagw/rails,brchristian/rails,odedniv/rails,sealocal/rails,flanger001/rails,BlakeWilliams/rails,vassilevsky/rails,bradleypriest/rails,untidy-hair/rails,rbhitchcock/rails,samphilipd/rails,kddeisz/rails,yasslab/railsguides.jp,gfvcastro/rails,joonyou/rails,yasslab/railsguides.jp,notapatch/rails,mtsmfm/railstest,hanystudy/rails,lcreid/rails,matrinox/rails,yalab/rails,Vasfed/rails,BlakeWilliams/rails,flanger001/rails,Edouard-chin/rails,stefanmb/rails,pschambacher/rails,repinel/rails,Edouard-chin/rails,Spin42/rails,deraru/rails,kirs/rails-1,esparta/rails,aditya-kapoor/rails,tgxworld/rails,MSP-Greg/rails,yahonda/rails,utilum/rails,untidy-hair/rails,Erol/rails,yahonda/rails,baerjam/rails,pschambacher/rails,BlakeWilliams/rails,starknx/rails,gavingmiller/rails,kamipo/rails,lucasmazza/rails,marklocklear/rails,Stellenticket/rails,kaspth/rails,schuetzm/rails,kddeisz/rails,tgxworld/rails,lucasmazza/rails,richseviora/rails,georgeclaghorn/rails,betesh/rails,Erol/rails,georgeclaghorn/rails,ledestin/rails,deraru/rails,ngpestelos/rails,xlymian/rails,yhirano55/rails,rails/rails,deraru/rails,mathieujobin/reduced-rails-for-travis,tgxworld/rails,fabianoleittes/rails,flanger001/rails,georgeclaghorn/rails,kenta-s/rails,joonyou/rails,kmayer/rails,yasslab/railsguides.jp,mijoharas/rails,elfassy/rails,Edouard-chin/rails,vipulnsward/rails,ttanimichi/rails,mohitnatoo/rails,illacceptanything/illacceptanything,Edouard-chin/rails,mtsmfm/railstest,notapatch/rails,assain/rails,illacceptanything/illacceptanything,shioyama/rails,voray/rails,maicher/rails,printercu/rails,arjes/rails,Sen-Zhang/rails,yasslab/railsguides.jp,mechanicles/rails,gcourtemanche/rails,bradleypriest/rails,aditya-kapoor/rails,ngpestelos/rails,88rabbit/newRails,EmmaB/rails-1,rails/rails,Envek/rails,illacceptanything/illacceptanything,kmcphillips/rails,yawboakye/rails,amoody2108/TechForJustice,mijoharas/rails,illacceptanything/illacceptanything,betesh/rails,xlymian/rails,riseshia/railsguides.kr,tijwelch/rails,illacceptanything/illacceptanything,aditya-kapoor/rails,bogdanvlviv/rails,prathamesh-sonpatki/rails,rails/rails,alecspopa/rails,maicher/rails,lcreid/rails,fabianoleittes/rails,tijwelch/rails,mohitnatoo/rails,utilum/rails,riseshia/railsguides.kr,kddeisz/rails,tjschuck/rails,coreyward/rails,kmcphillips/rails,felipecvo/rails,eileencodes/rails,kamipo/rails,travisofthenorth/rails,travisofthenorth/rails,vipulnsward/rails,printercu/rails,odedniv/rails,pvalena/rails,untidy-hair/rails,riseshia/railsguides.kr,untidy-hair/rails,Vasfed/rails,shioyama/rails,iainbeeston/rails,travisofthenorth/rails,rafaelfranca/omg-rails,notapatch/rails,schuetzm/rails,bolek/rails,iainbeeston/rails,baerjam/rails,brchristian/rails,arunagw/rails,Spin42/rails,yalab/rails,illacceptanything/illacceptanything,voray/rails,marklocklear/rails,lcreid/rails,Envek/rails,Vasfed/rails,samphilipd/rails,bogdanvlviv/rails,felipecvo/rails,kenta-s/rails,joonyou/rails,prathamesh-sonpatki/rails,elfassy/rails,palkan/rails,travisofthenorth/rails,yhirano55/rails,assain/rails,yalab/rails,Envek/rails,prathamesh-sonpatki/rails,gauravtiwari/rails,yawboakye/rails,EmmaB/rails-1,rafaelfranca/omg-rails,kddeisz/rails,kmcphillips/rails,Envek/rails,MichaelSp/rails,brchristian/rails,richseviora/rails,vipulnsward/rails,marklocklear/rails,baerjam/rails,rossta/rails,ttanimichi/rails,coreyward/rails,kmcphillips/rails,lucasmazza/rails,iainbeeston/rails,illacceptanything/illacceptanything,gavingmiller/rails,illacceptanything/illacceptanything,Erol/rails,illacceptanything/illacceptanything,riseshia/railsguides.kr,sergey-alekseev/rails,repinel/rails,rails/rails,koic/rails,esparta/rails,mohitnatoo/rails,kaspth/rails,starknx/rails,EmmaB/rails-1,arunagw/rails,ttanimichi/rails,BlakeWilliams/rails,samphilipd/rails,illacceptanything/illacceptanything,ledestin/rails,kamipo/rails,bolek/rails,rbhitchcock/rails,arjes/rails,repinel/rails,mechanicles/rails,illacceptanything/illacceptanything,baerjam/rails,Vasfed/rails,utilum/rails,jeremy/rails,schuetzm/rails,jeremy/rails,printercu/rails,palkan/rails,alecspopa/rails,gfvcastro/rails,yalab/rails,MSP-Greg/rails,koic/rails,bolek/rails,gfvcastro/rails,Sen-Zhang/rails,illacceptanything/illacceptanything,notapatch/rails,bogdanvlviv/rails,88rabbit/newRails,sealocal/rails,mtsmfm/rails,mijoharas/rails,kenta-s/rails,mohitnatoo/rails,gavingmiller/rails,rossta/rails,eileencodes/rails,shioyama/rails,eileencodes/rails,utilum/rails,tijwelch/rails,matrinox/rails,kachick/rails,gauravtiwari/rails,ngpestelos/rails,Stellenticket/rails,prathamesh-sonpatki/rails,tgxworld/rails,georgeclaghorn/rails,alecspopa/rails,yhirano55/rails,gcourtemanche/rails,arunagw/rails,mtsmfm/railstest,assain/rails,mechanicles/rails,betesh/rails,kirs/rails-1,lcreid/rails,matrinox/rails,hanystudy/rails,yahonda/rails,eileencodes/rails,aditya-kapoor/rails,assain/rails,starknx/rails
ruby
## Code Before: require "abstract_unit" require "template/erb/helper" module ERBTest class TagHelperTest < BlockTestCase extend ActiveSupport::Testing::Declarative test "percent equals works for content_tag and does not require parenthesis on method call" do assert_equal "<div>Hello world</div>", render_content("content_tag :div", "Hello world") end test "percent equals works for javascript_tag" do expected_output = "<script>\n//<![CDATA[\nalert('Hello')\n//]]>\n</script>" assert_equal expected_output, render_content("javascript_tag", "alert('Hello')") end test "percent equals works for javascript_tag with options" do expected_output = "<script id=\"the_js_tag\">\n//<![CDATA[\nalert('Hello')\n//]]>\n</script>" assert_equal expected_output, render_content("javascript_tag(:id => 'the_js_tag')", "alert('Hello')") end test "percent equals works with form tags" do expected_output = %r{<form.*action="foo".*method="post">.*hello*</form>} assert_match expected_output, render_content("form_tag('foo')", "<%= 'hello' %>") end test "percent equals works with fieldset tags" do expected_output = "<fieldset><legend>foo</legend>hello</fieldset>" assert_equal expected_output, render_content("field_set_tag('foo')", "<%= 'hello' %>") end end end ## Instruction: Remove AS declarative extension from erb tag test The extension was removed in 22bc12ec374b8bdeb3818ca0a3eb787dd3ce39d8, making "test" an alias for minitest's "it". ## Code After: require "abstract_unit" require "template/erb/helper" module ERBTest class TagHelperTest < BlockTestCase test "percent equals works for content_tag and does not require parenthesis on method call" do assert_equal "<div>Hello world</div>", render_content("content_tag :div", "Hello world") end test "percent equals works for javascript_tag" do expected_output = "<script>\n//<![CDATA[\nalert('Hello')\n//]]>\n</script>" assert_equal expected_output, render_content("javascript_tag", "alert('Hello')") end test "percent equals works for javascript_tag with options" do expected_output = "<script id=\"the_js_tag\">\n//<![CDATA[\nalert('Hello')\n//]]>\n</script>" assert_equal expected_output, render_content("javascript_tag(:id => 'the_js_tag')", "alert('Hello')") end test "percent equals works with form tags" do expected_output = %r{<form.*action="foo".*method="post">.*hello*</form>} assert_match expected_output, render_content("form_tag('foo')", "<%= 'hello' %>") end test "percent equals works with fieldset tags" do expected_output = "<fieldset><legend>foo</legend>hello</fieldset>" assert_equal expected_output, render_content("field_set_tag('foo')", "<%= 'hello' %>") end end end
require "abstract_unit" require "template/erb/helper" module ERBTest class TagHelperTest < BlockTestCase - - extend ActiveSupport::Testing::Declarative - test "percent equals works for content_tag and does not require parenthesis on method call" do assert_equal "<div>Hello world</div>", render_content("content_tag :div", "Hello world") end test "percent equals works for javascript_tag" do expected_output = "<script>\n//<![CDATA[\nalert('Hello')\n//]]>\n</script>" assert_equal expected_output, render_content("javascript_tag", "alert('Hello')") end test "percent equals works for javascript_tag with options" do expected_output = "<script id=\"the_js_tag\">\n//<![CDATA[\nalert('Hello')\n//]]>\n</script>" assert_equal expected_output, render_content("javascript_tag(:id => 'the_js_tag')", "alert('Hello')") end test "percent equals works with form tags" do expected_output = %r{<form.*action="foo".*method="post">.*hello*</form>} assert_match expected_output, render_content("form_tag('foo')", "<%= 'hello' %>") end test "percent equals works with fieldset tags" do expected_output = "<fieldset><legend>foo</legend>hello</fieldset>" assert_equal expected_output, render_content("field_set_tag('foo')", "<%= 'hello' %>") end end end
3
0.090909
0
3
bdcfcd8109499829d4e65f637a06e048270fccee
doc/markdown/singlerow.md
doc/markdown/singlerow.md
<!-- dash: #singlerow | Element | ###:Section --> ## Single Row Element - #singlerow {} The single row element is a shortcut for a table with one row. Commonly used by CSS anti-purists to get simple layouts to work in cross-browser scenarious. See [this site](http://giveupandusetables.com) for more information. ### Usage ```erlang #singlerow { cells=[ #tablecell { body="Cell Text" }, #tablecell { body=#link { text="Link" }} ]} ``` ### Attributes * `cells` (One or more tablecell elements.) - Set the table cells to be rendered within this row. ### See Also * [base element](./element_base.md) * [tableheader element](./tableheader.md) * [tablecell element](./tablecell.md)
<!-- dash: #singlerow | Element | ###:Section --> ## Single Row Element - #singlerow {} The single row element is a shortcut for a table with one row. Commonly used by CSS anti-purists to get simple layouts to work in cross-browser scenarious. ### Usage ```erlang #singlerow { cells=[ #tablecell { body="Cell Text" }, #tablecell { body=#link { text="Link" }} ]} ``` ### Attributes * `cells` (One or more tablecell elements.) - Set the table cells to be rendered within this row. ### See Also * [base element](./element_base.md) * [tableheader element](./tableheader.md) * [tablecell element](./tablecell.md)
Remove link to spam site
Remove link to spam site giveupandusetables.com has been taken over and is now a spam/ad site.
Markdown
mit
nitrogen/nitrogen_core,choptastic/nitrogen_core,nitrogen/nitrogen_core,nitrogen/nitrogen_core,choptastic/nitrogen_core,choptastic/nitrogen_core,nitrogen/nitrogen_core
markdown
## Code Before: <!-- dash: #singlerow | Element | ###:Section --> ## Single Row Element - #singlerow {} The single row element is a shortcut for a table with one row. Commonly used by CSS anti-purists to get simple layouts to work in cross-browser scenarious. See [this site](http://giveupandusetables.com) for more information. ### Usage ```erlang #singlerow { cells=[ #tablecell { body="Cell Text" }, #tablecell { body=#link { text="Link" }} ]} ``` ### Attributes * `cells` (One or more tablecell elements.) - Set the table cells to be rendered within this row. ### See Also * [base element](./element_base.md) * [tableheader element](./tableheader.md) * [tablecell element](./tablecell.md) ## Instruction: Remove link to spam site giveupandusetables.com has been taken over and is now a spam/ad site. ## Code After: <!-- dash: #singlerow | Element | ###:Section --> ## Single Row Element - #singlerow {} The single row element is a shortcut for a table with one row. Commonly used by CSS anti-purists to get simple layouts to work in cross-browser scenarious. ### Usage ```erlang #singlerow { cells=[ #tablecell { body="Cell Text" }, #tablecell { body=#link { text="Link" }} ]} ``` ### Attributes * `cells` (One or more tablecell elements.) - Set the table cells to be rendered within this row. ### See Also * [base element](./element_base.md) * [tableheader element](./tableheader.md) * [tablecell element](./tablecell.md)
<!-- dash: #singlerow | Element | ###:Section --> ## Single Row Element - #singlerow {} The single row element is a shortcut for a table with one row. Commonly used by CSS anti-purists to get simple layouts to work in cross-browser scenarious. - See [this site](http://giveupandusetables.com) for more information. ### Usage ```erlang #singlerow { cells=[ #tablecell { body="Cell Text" }, #tablecell { body=#link { text="Link" }} ]} ``` ### Attributes * `cells` (One or more tablecell elements.) - Set the table cells to be rendered within this row. ### See Also * [base element](./element_base.md) * [tableheader element](./tableheader.md) * [tablecell element](./tablecell.md)
1
0.029412
0
1
3b7a66d68214ce392963ce001f6e7b89b18e4a25
examples/sinatra/config.ru
examples/sinatra/config.ru
require 'opal' require 'sinatra' get '/' do <<-EOS <!doctype html> <html> <head> <script src="/assets/application.js"></script> </head> </html> EOS end map '/assets' do env = Opal::Environment.new env.append_path 'app' run env end run Sinatra::Application
require 'opal' require 'sinatra' opal = Opal::Server.new {|s| s.append_path 'app' s.main = 'application' } map '/__opal_source_maps__' do run opal.source_maps end map '/assets' do run opal.sprockets end get '/' do <<-EOS <!doctype html> <html> <head> <script src="/assets/application.js"></script> </head> </html> EOS end run Sinatra::Application
Add sourcemaps support to sinatra example
Add sourcemaps support to sinatra example
Ruby
mit
gausie/opal,catprintlabs/opal,c42engineering/opal,gausie/opal,jannishuebl/opal,Ajedi32/opal,wied03/opal,opal/opal,kachick/opal,castwide/opal,jgaskins/opal,kachick/opal,castwide/opal,c42engineering/opal,iliabylich/opal,Flikofbluelight747/opal,fazibear/opal,jannishuebl/opal,Mogztter/opal,suyesh/opal,fazibear/opal,opal/opal,c42engineering/opal,opal/opal,domgetter/opal,wied03/opal,bbatsov/opal,wied03/opal,suyesh/opal,jgaskins/opal,iliabylich/opal,gabrielrios/opal,kachick/opal,merongivian/opal,fazibear/opal,gausie/opal,catprintlabs/opal,bbatsov/opal,jannishuebl/opal,merongivian/opal,suyesh/opal,iliabylich/opal,Ajedi32/opal,domgetter/opal,Ajedi32/opal,kachick/opal,jgaskins/opal,gabrielrios/opal,merongivian/opal,bbatsov/opal,Flikofbluelight747/opal,catprintlabs/opal,gabrielrios/opal,Mogztter/opal,Mogztter/opal,Mogztter/opal,Flikofbluelight747/opal,castwide/opal,opal/opal
ruby
## Code Before: require 'opal' require 'sinatra' get '/' do <<-EOS <!doctype html> <html> <head> <script src="/assets/application.js"></script> </head> </html> EOS end map '/assets' do env = Opal::Environment.new env.append_path 'app' run env end run Sinatra::Application ## Instruction: Add sourcemaps support to sinatra example ## Code After: require 'opal' require 'sinatra' opal = Opal::Server.new {|s| s.append_path 'app' s.main = 'application' } map '/__opal_source_maps__' do run opal.source_maps end map '/assets' do run opal.sprockets end get '/' do <<-EOS <!doctype html> <html> <head> <script src="/assets/application.js"></script> </head> </html> EOS end run Sinatra::Application
require 'opal' require 'sinatra' + + opal = Opal::Server.new {|s| + s.append_path 'app' + s.main = 'application' + } + + map '/__opal_source_maps__' do + run opal.source_maps + end + + map '/assets' do + run opal.sprockets + end get '/' do <<-EOS <!doctype html> <html> <head> <script src="/assets/application.js"></script> </head> </html> EOS end - map '/assets' do - env = Opal::Environment.new - env.append_path 'app' - run env - end - run Sinatra::Application
19
0.904762
13
6
26146a9143d2eaefc0ae691a1c92ddb7d66135b6
frontend/bower.json
frontend/bower.json
{ "name": "rescue-mission", "dependencies": { "handlebars": "~1.3.0", "jquery": "^1.11.1", "qunit": "~1.12.0", "ember-qunit": "~0.1.8", "ember": "1.6.1", "ember-resolver": "~0.1.5", "loader": "stefanpenner/loader.js#1.0.0", "ember-cli-shims": "stefanpenner/ember-cli-shims#0.0.2", "ember-load-initializers": "stefanpenner/ember-load-initializers#0.0.2", "ember-qunit-notifications": "^0.0.3", "ember-cli-test-loader": "rjackson/ember-cli-test-loader#0.0.2" }, "devDependencies": { "foundation": "~5.3.1", "ember-validations": "http://builds.dockyard.com.s3.amazonaws.com/ember-validations/latest/ember-validations.js", "ember-easyForm": "http://builds.dockyard.com.s3.amazonaws.com/ember-easyForm/latest/ember-easyForm.js", "marked": "~0.3.2" } }
{ "name": "rescue-mission", "dependencies": { "handlebars": "~1.3.0", "jquery": "^1.11.1", "qunit": "~1.12.0", "ember-qunit": "~0.1.8", "ember": "components/ember#beta", "ember-resolver": "~0.1.5", "loader": "stefanpenner/loader.js#1.0.0", "ember-cli-shims": "stefanpenner/ember-cli-shims#0.0.2", "ember-load-initializers": "stefanpenner/ember-load-initializers#0.0.2", "ember-qunit-notifications": "^0.0.3", "ember-cli-test-loader": "rjackson/ember-cli-test-loader#0.0.2" }, "devDependencies": { "foundation": "~5.3.1", "ember-validations": "http://builds.dockyard.com.s3.amazonaws.com/ember-validations/latest/ember-validations.js", "ember-easyForm": "http://builds.dockyard.com.s3.amazonaws.com/ember-easyForm/latest/ember-easyForm.js", "marked": "~0.3.2" }, "resolutions": { "ember": "beta" } }
Use Beta build of Ember
Use Beta build of Ember
JSON
mit
LaunchAcademy/rescue_mission,LaunchAcademy/rescue_mission,LaunchAcademy/rescue_mission
json
## Code Before: { "name": "rescue-mission", "dependencies": { "handlebars": "~1.3.0", "jquery": "^1.11.1", "qunit": "~1.12.0", "ember-qunit": "~0.1.8", "ember": "1.6.1", "ember-resolver": "~0.1.5", "loader": "stefanpenner/loader.js#1.0.0", "ember-cli-shims": "stefanpenner/ember-cli-shims#0.0.2", "ember-load-initializers": "stefanpenner/ember-load-initializers#0.0.2", "ember-qunit-notifications": "^0.0.3", "ember-cli-test-loader": "rjackson/ember-cli-test-loader#0.0.2" }, "devDependencies": { "foundation": "~5.3.1", "ember-validations": "http://builds.dockyard.com.s3.amazonaws.com/ember-validations/latest/ember-validations.js", "ember-easyForm": "http://builds.dockyard.com.s3.amazonaws.com/ember-easyForm/latest/ember-easyForm.js", "marked": "~0.3.2" } } ## Instruction: Use Beta build of Ember ## Code After: { "name": "rescue-mission", "dependencies": { "handlebars": "~1.3.0", "jquery": "^1.11.1", "qunit": "~1.12.0", "ember-qunit": "~0.1.8", "ember": "components/ember#beta", "ember-resolver": "~0.1.5", "loader": "stefanpenner/loader.js#1.0.0", "ember-cli-shims": "stefanpenner/ember-cli-shims#0.0.2", "ember-load-initializers": "stefanpenner/ember-load-initializers#0.0.2", "ember-qunit-notifications": "^0.0.3", "ember-cli-test-loader": "rjackson/ember-cli-test-loader#0.0.2" }, "devDependencies": { "foundation": "~5.3.1", "ember-validations": "http://builds.dockyard.com.s3.amazonaws.com/ember-validations/latest/ember-validations.js", "ember-easyForm": "http://builds.dockyard.com.s3.amazonaws.com/ember-easyForm/latest/ember-easyForm.js", "marked": "~0.3.2" }, "resolutions": { "ember": "beta" } }
{ "name": "rescue-mission", "dependencies": { "handlebars": "~1.3.0", "jquery": "^1.11.1", "qunit": "~1.12.0", "ember-qunit": "~0.1.8", - "ember": "1.6.1", + "ember": "components/ember#beta", "ember-resolver": "~0.1.5", "loader": "stefanpenner/loader.js#1.0.0", "ember-cli-shims": "stefanpenner/ember-cli-shims#0.0.2", "ember-load-initializers": "stefanpenner/ember-load-initializers#0.0.2", "ember-qunit-notifications": "^0.0.3", "ember-cli-test-loader": "rjackson/ember-cli-test-loader#0.0.2" }, "devDependencies": { "foundation": "~5.3.1", "ember-validations": "http://builds.dockyard.com.s3.amazonaws.com/ember-validations/latest/ember-validations.js", "ember-easyForm": "http://builds.dockyard.com.s3.amazonaws.com/ember-easyForm/latest/ember-easyForm.js", "marked": "~0.3.2" + }, + "resolutions": { + "ember": "beta" } }
5
0.227273
4
1
1a4b908c3f0eeb83fb910fa15ca98721d8655cfa
README.md
README.md
Small PHP Helpers ================= This set of small libraries is intended to give missing PHP functionality or easy shortcuts for everyday situations. Up until now these functions are not tested but are mere reminders of functions to be implemented.
Small PHP Helpers ================= This set of small libraries is intended as easy shortcuts for everyday situations. * Toolshed: Missing PHP-functions like quoted <code>echo()</code> or a better replacement for <code>empty()</code> * SuperPDO: Gently improves functionality of PDO, see http://www.php.net/manual/en/book.pdo.php
Split documentation to reflect different purposes of files
Split documentation to reflect different purposes of files
Markdown
mit
fboes/small-php-helpers
markdown
## Code Before: Small PHP Helpers ================= This set of small libraries is intended to give missing PHP functionality or easy shortcuts for everyday situations. Up until now these functions are not tested but are mere reminders of functions to be implemented. ## Instruction: Split documentation to reflect different purposes of files ## Code After: Small PHP Helpers ================= This set of small libraries is intended as easy shortcuts for everyday situations. * Toolshed: Missing PHP-functions like quoted <code>echo()</code> or a better replacement for <code>empty()</code> * SuperPDO: Gently improves functionality of PDO, see http://www.php.net/manual/en/book.pdo.php
Small PHP Helpers ================= - This set of small libraries is intended to give missing PHP functionality or easy shortcuts for everyday situations. ? ^^^^^^^^^^ ------------------------- + This set of small libraries is intended as easy shortcuts for everyday situations. ? ^ - Up until now these functions are not tested but are mere reminders of functions to be implemented. + * Toolshed: Missing PHP-functions like quoted <code>echo()</code> or a better replacement for <code>empty()</code> + * SuperPDO: Gently improves functionality of PDO, see http://www.php.net/manual/en/book.pdo.php
5
0.833333
3
2
bfe3e97e634149c3cfdb4ae9a31ab58d15277355
examples/playbooks/mysql.yml
examples/playbooks/mysql.yml
--- - hosts: all user: root vars: mysql_root_password: 'password' tasks: - name: Create database user action: mysql_user loginpass=$mysql_root_password user=bob passwd=12345 priv=*.*:ALL state=present - name: Create database action: mysql_db loginpass=$mysql_root_password db=bobdata state=present - name: Ensure no user named 'sally' exists action: mysql_user loginpass=$mysql_root_password user=sally state=absent
--- - hosts: all user: root tasks: - name: Create database user action: mysql_user user=bob password=12345 priv=*.*:ALL state=present - name: Create database action: mysql_db db=bobdata state=present - name: Ensure no user named 'sally' exists and delete if found. action: mysql_user user=sally state=absent
Update the example playbook for the new MySQL parameter format
Update the example playbook for the new MySQL parameter format
YAML
mit
thaim/ansible,thaim/ansible
yaml
## Code Before: --- - hosts: all user: root vars: mysql_root_password: 'password' tasks: - name: Create database user action: mysql_user loginpass=$mysql_root_password user=bob passwd=12345 priv=*.*:ALL state=present - name: Create database action: mysql_db loginpass=$mysql_root_password db=bobdata state=present - name: Ensure no user named 'sally' exists action: mysql_user loginpass=$mysql_root_password user=sally state=absent ## Instruction: Update the example playbook for the new MySQL parameter format ## Code After: --- - hosts: all user: root tasks: - name: Create database user action: mysql_user user=bob password=12345 priv=*.*:ALL state=present - name: Create database action: mysql_db db=bobdata state=present - name: Ensure no user named 'sally' exists and delete if found. action: mysql_user user=sally state=absent
--- - hosts: all user: root - vars: - mysql_root_password: 'password' - tasks: - name: Create database user - action: mysql_user loginpass=$mysql_root_password user=bob passwd=12345 priv=*.*:ALL state=present ? ------------------------------- + action: mysql_user user=bob password=12345 priv=*.*:ALL state=present ? ++ - name: Create database - action: mysql_db loginpass=$mysql_root_password db=bobdata state=present ? ------------------------------- + action: mysql_db db=bobdata state=present - - name: Ensure no user named 'sally' exists + - name: Ensure no user named 'sally' exists and delete if found. ? +++++++++++++++++++++ - action: mysql_user loginpass=$mysql_root_password user=sally state=absent ? ------------------------------- + action: mysql_user user=sally state=absent
11
0.611111
4
7
fe96fd45b4450c9a266cd03e09784e5cc100bc03
src/styles/widgets/ToggleSwitchWidget.less
src/styles/widgets/ToggleSwitchWidget.less
@import '../common'; .oo-ui-toggleSwitchWidget { position: relative; display: inline-block; vertical-align: middle; overflow: hidden; .oo-ui-box-sizing( border-box ); .oo-ui-transform( translateZ( 0 ) ); &.oo-ui-widget-enabled { cursor: pointer; } &-grip { position: absolute; display: block; .oo-ui-box-sizing( border-box ); } .theme-oo-ui-toggleSwitchWidget(); }
@import '../common'; .oo-ui-toggleSwitchWidget { position: relative; display: inline-block; vertical-align: middle; overflow: hidden; .oo-ui-box-sizing( border-box ); .oo-ui-force-webkit-gpu(); &.oo-ui-widget-enabled { cursor: pointer; } &-grip { position: absolute; display: block; .oo-ui-box-sizing( border-box ); } .theme-oo-ui-toggleSwitchWidget(); }
Replace `transform` with dedicated mixin
Replace `transform` with dedicated mixin Replacing `transform` with dedicated “GPU hack” mixin. Change-Id: Iac4acb6728ad82e2d834b703fd31ffd31a324908
Less
mit
wikimedia/oojs-ui,wikimedia/oojs-ui,wikimedia/oojs-ui,wikimedia/oojs-ui
less
## Code Before: @import '../common'; .oo-ui-toggleSwitchWidget { position: relative; display: inline-block; vertical-align: middle; overflow: hidden; .oo-ui-box-sizing( border-box ); .oo-ui-transform( translateZ( 0 ) ); &.oo-ui-widget-enabled { cursor: pointer; } &-grip { position: absolute; display: block; .oo-ui-box-sizing( border-box ); } .theme-oo-ui-toggleSwitchWidget(); } ## Instruction: Replace `transform` with dedicated mixin Replacing `transform` with dedicated “GPU hack” mixin. Change-Id: Iac4acb6728ad82e2d834b703fd31ffd31a324908 ## Code After: @import '../common'; .oo-ui-toggleSwitchWidget { position: relative; display: inline-block; vertical-align: middle; overflow: hidden; .oo-ui-box-sizing( border-box ); .oo-ui-force-webkit-gpu(); &.oo-ui-widget-enabled { cursor: pointer; } &-grip { position: absolute; display: block; .oo-ui-box-sizing( border-box ); } .theme-oo-ui-toggleSwitchWidget(); }
@import '../common'; .oo-ui-toggleSwitchWidget { position: relative; display: inline-block; vertical-align: middle; overflow: hidden; .oo-ui-box-sizing( border-box ); - .oo-ui-transform( translateZ( 0 ) ); + .oo-ui-force-webkit-gpu(); &.oo-ui-widget-enabled { cursor: pointer; } &-grip { position: absolute; display: block; .oo-ui-box-sizing( border-box ); } .theme-oo-ui-toggleSwitchWidget(); }
2
0.090909
1
1
6086b970e6c37ca4f343291a35bbb9e533109c1c
flask_wiki/backend/routes.py
flask_wiki/backend/routes.py
from flask_wiki.backend.backend import api from flask_wiki.backend.views import PageView api.add_resource(PageView, '/pages-list', endpoint='pages-list')
from flask_wiki.backend.backend import api from flask_wiki.backend.views import PageView, PageDetail api.add_resource(PageView, '/pages-list', endpoint='pages-list') api.add_resource(PageDetail, '/pages/<slug>', endpoint='page-detail')
Support for page-detail url added.
Support for page-detail url added.
Python
bsd-2-clause
gcavalcante8808/flask-wiki,gcavalcante8808/flask-wiki,gcavalcante8808/flask-wiki
python
## Code Before: from flask_wiki.backend.backend import api from flask_wiki.backend.views import PageView api.add_resource(PageView, '/pages-list', endpoint='pages-list') ## Instruction: Support for page-detail url added. ## Code After: from flask_wiki.backend.backend import api from flask_wiki.backend.views import PageView, PageDetail api.add_resource(PageView, '/pages-list', endpoint='pages-list') api.add_resource(PageDetail, '/pages/<slug>', endpoint='page-detail')
from flask_wiki.backend.backend import api - from flask_wiki.backend.views import PageView + from flask_wiki.backend.views import PageView, PageDetail ? ++++++++++++ api.add_resource(PageView, '/pages-list', endpoint='pages-list') + api.add_resource(PageDetail, '/pages/<slug>', endpoint='page-detail')
3
0.75
2
1
5875baf754d3bcc911f828fc3ecb302ac6da967f
tagcache/lock.py
tagcache/lock.py
import os import fcntl from tagcache.utils import open_file class FileLock(object): def __init__(self, path): self.path = path self.fd = None def acquire(self, ex=False, nb=False): """ Acquire a lock on a path. :param ex (optional): default False, acquire a exclusive lock if True :param nb (optional): default False, non blocking if True :return: True on success :raise: raise RuntimeError if a lock has been acquired """ if self.fd is not None: raise RuntimeError("A lock has been held") try: # open or create the lock file self.fd = open_file(self.path, os.O_RDWR|os.O_CREAT) lock_flags = fcntl.LOCK_EX if ex else fcntl.LOCK_SH if nb: lock_flags |= fcntl.LOCK_NB fcntl.flock(self.fd, lock_flags) return True except Exception, e: if self.fd is not None: os.close(self.fd) self.fd = None return False def release(self): """ Release the lock. """ if self.fd is None: return fcntl.flock(self.fd, fcntl.LOCK_UN) self.fd = None
import os import fcntl from tagcache.utils import open_file class FileLock(object): def __init__(self, path): self.path = path self.fd = None @property def is_acquired(self): return self.fd is not None def acquire(self, ex=False, nb=False): """ Acquire a lock on a path. :param ex (optional): default False, acquire a exclusive lock if True :param nb (optional): default False, non blocking if True :return: True on success :raise: raise RuntimeError if a lock has been acquired """ if self.fd is not None: raise RuntimeError("A lock has been held") try: # open or create the lock file self.fd = open_file(self.path, os.O_RDWR|os.O_CREAT) lock_flags = fcntl.LOCK_EX if ex else fcntl.LOCK_SH if nb: lock_flags |= fcntl.LOCK_NB fcntl.flock(self.fd, lock_flags) return True except Exception, e: if self.fd is not None: os.close(self.fd) self.fd = None return False def release(self): """ Release the lock. """ if self.fd is None: return fcntl.flock(self.fd, fcntl.LOCK_UN) self.fd = None
Add `is_acquired` property to FileLock
Add `is_acquired` property to FileLock
Python
mit
huangjunwen/tagcache
python
## Code Before: import os import fcntl from tagcache.utils import open_file class FileLock(object): def __init__(self, path): self.path = path self.fd = None def acquire(self, ex=False, nb=False): """ Acquire a lock on a path. :param ex (optional): default False, acquire a exclusive lock if True :param nb (optional): default False, non blocking if True :return: True on success :raise: raise RuntimeError if a lock has been acquired """ if self.fd is not None: raise RuntimeError("A lock has been held") try: # open or create the lock file self.fd = open_file(self.path, os.O_RDWR|os.O_CREAT) lock_flags = fcntl.LOCK_EX if ex else fcntl.LOCK_SH if nb: lock_flags |= fcntl.LOCK_NB fcntl.flock(self.fd, lock_flags) return True except Exception, e: if self.fd is not None: os.close(self.fd) self.fd = None return False def release(self): """ Release the lock. """ if self.fd is None: return fcntl.flock(self.fd, fcntl.LOCK_UN) self.fd = None ## Instruction: Add `is_acquired` property to FileLock ## Code After: import os import fcntl from tagcache.utils import open_file class FileLock(object): def __init__(self, path): self.path = path self.fd = None @property def is_acquired(self): return self.fd is not None def acquire(self, ex=False, nb=False): """ Acquire a lock on a path. :param ex (optional): default False, acquire a exclusive lock if True :param nb (optional): default False, non blocking if True :return: True on success :raise: raise RuntimeError if a lock has been acquired """ if self.fd is not None: raise RuntimeError("A lock has been held") try: # open or create the lock file self.fd = open_file(self.path, os.O_RDWR|os.O_CREAT) lock_flags = fcntl.LOCK_EX if ex else fcntl.LOCK_SH if nb: lock_flags |= fcntl.LOCK_NB fcntl.flock(self.fd, lock_flags) return True except Exception, e: if self.fd is not None: os.close(self.fd) self.fd = None return False def release(self): """ Release the lock. """ if self.fd is None: return fcntl.flock(self.fd, fcntl.LOCK_UN) self.fd = None
import os import fcntl from tagcache.utils import open_file class FileLock(object): def __init__(self, path): self.path = path self.fd = None + + @property + def is_acquired(self): + + return self.fd is not None def acquire(self, ex=False, nb=False): """ Acquire a lock on a path. :param ex (optional): default False, acquire a exclusive lock if True :param nb (optional): default False, non blocking if True :return: True on success :raise: raise RuntimeError if a lock has been acquired """ if self.fd is not None: raise RuntimeError("A lock has been held") try: # open or create the lock file self.fd = open_file(self.path, os.O_RDWR|os.O_CREAT) lock_flags = fcntl.LOCK_EX if ex else fcntl.LOCK_SH if nb: lock_flags |= fcntl.LOCK_NB fcntl.flock(self.fd, lock_flags) return True except Exception, e: if self.fd is not None: os.close(self.fd) self.fd = None return False def release(self): """ Release the lock. """ if self.fd is None: return fcntl.flock(self.fd, fcntl.LOCK_UN) self.fd = None
5
0.072464
5
0
672e2b737e8ba0f014506a0eb5a94ed473fea73e
src/client/components/line-and-bubble-chart/line-and-bubble-chart.css
src/client/components/line-and-bubble-chart/line-and-bubble-chart.css
.axis path, .axis line { fill: none; stroke: #000; shape-rendering: crispEdges; } .x.axis path { display: none; } .line, .point { fill: white; stroke: steelblue; stroke-width: 1.5px; }
.axis path, .axis line { fill: none; stroke: #000; shape-rendering: crispEdges; } .x.axis path { display: none; } .line, .point { stroke: steelblue; stroke-width: 1.5px; } .line { fill: none; } .point { fill: white; }
Improve styling for LineAndBubble chart
Improve styling for LineAndBubble chart Do not render a fill color for the line itself.
CSS
mpl-2.0
jugglinmike/cee,jugglinmike/cee,councilforeconed/interactive-activities,councilforeconed/interactive-activities,councilforeconed/interactive-activities
css
## Code Before: .axis path, .axis line { fill: none; stroke: #000; shape-rendering: crispEdges; } .x.axis path { display: none; } .line, .point { fill: white; stroke: steelblue; stroke-width: 1.5px; } ## Instruction: Improve styling for LineAndBubble chart Do not render a fill color for the line itself. ## Code After: .axis path, .axis line { fill: none; stroke: #000; shape-rendering: crispEdges; } .x.axis path { display: none; } .line, .point { stroke: steelblue; stroke-width: 1.5px; } .line { fill: none; } .point { fill: white; }
.axis path, .axis line { fill: none; stroke: #000; shape-rendering: crispEdges; } .x.axis path { display: none; } .line, .point { - fill: white; stroke: steelblue; stroke-width: 1.5px; } + .line { + fill: none; + } + .point { + fill: white; + }
7
0.4375
6
1
e3951698cc656aaf7e3450f461d32483d3c53bdf
lib/mirah/jvm/types/null_type.rb
lib/mirah/jvm/types/null_type.rb
module Mirah module JVM module Types class NullType < Type def initialize super('java.lang.Object') end def to_s "Type(null)" end def null? true end def compatible?(other) !other.primitive? end def assignable_from?(other) !other.primitive? end end end end end
module Mirah module JVM module Types class NullType < Type def initialize super(BiteScript::ASM::ClassMirror.load('java.lang.Object')) end def to_s "Type(null)" end def null? true end def compatible?(other) !other.primitive? end def assignable_from?(other) !other.primitive? end end end end end
Add a class mirror to the NullType
Add a class mirror to the NullType
Ruby
apache-2.0
KeenS/mirah,nuclearsandwich/mirah,mirah/mirah,mirah/mirah,nuclearsandwich/mirah,aspleenic/mirah,uujava/mirah,felixvf/mirah,mirah/mirah,mirah/mirah,felixvf/mirah,KeenS/mirah,felixvf/mirah,uujava/mirah,aspleenic/mirah,uujava/mirah,uujava/mirah,aspleenic/mirah,KeenS/mirah,uujava/mirah,nuclearsandwich/mirah,aspleenic/mirah,felixvf/mirah,aspleenic/mirah,KeenS/mirah
ruby
## Code Before: module Mirah module JVM module Types class NullType < Type def initialize super('java.lang.Object') end def to_s "Type(null)" end def null? true end def compatible?(other) !other.primitive? end def assignable_from?(other) !other.primitive? end end end end end ## Instruction: Add a class mirror to the NullType ## Code After: module Mirah module JVM module Types class NullType < Type def initialize super(BiteScript::ASM::ClassMirror.load('java.lang.Object')) end def to_s "Type(null)" end def null? true end def compatible?(other) !other.primitive? end def assignable_from?(other) !other.primitive? end end end end end
module Mirah module JVM module Types class NullType < Type def initialize - super('java.lang.Object') + super(BiteScript::ASM::ClassMirror.load('java.lang.Object')) end def to_s "Type(null)" end def null? true end def compatible?(other) !other.primitive? end def assignable_from?(other) !other.primitive? end end end end end
2
0.074074
1
1
74518f6fe3bdc856eeae99998b0a64ca0a5a3865
_posts/2016-08-05-blogs.md
_posts/2016-08-05-blogs.md
--- layout: post title: "Blogs." date: 2016-08-05 20:34:26 image: '/assets/img/' description: 'Blogs.' main-class: 'blog' color: '#EB7728' tags: - blog categories: twitter_text: 'Put your twitter description here.' introduction: 'Blogs are updated frequently by forum members.' --- ## Tutorial on creating CSE Software Interest in our website? Want to create a similar one? Click [here](/blog/portal_tutorial.pdf) for tutorial. ## Sample blog posts * [Sample 1](/blog/sample.html) * [Sample 2](/blog/sample2.html)
--- layout: post title: "Blogs." date: 2016-08-05 20:34:26 image: '/assets/img/' description: 'Blogs.' main-class: 'blog' color: '#EB7728' tags: - blog categories: twitter_text: 'Put your twitter description here.' introduction: 'Contribute a Blog to CSE Software.' --- ## Tutorial on creating CSE Software Interest in our website? Want to create a similar one? Click [here](/blog/portal_tutorial.pdf) for tutorial. ## Sample blog posts * [Sample 1](/blog/sample.html) * [Sample 2](/blog/sample2.html)
Change description of Blog card
Change description of Blog card
Markdown
mit
CSE-Software/CSE-Software.github.io,CSE-Software/CSE-Software.github.io,CSE-Software/CSE-Software.github.io
markdown
## Code Before: --- layout: post title: "Blogs." date: 2016-08-05 20:34:26 image: '/assets/img/' description: 'Blogs.' main-class: 'blog' color: '#EB7728' tags: - blog categories: twitter_text: 'Put your twitter description here.' introduction: 'Blogs are updated frequently by forum members.' --- ## Tutorial on creating CSE Software Interest in our website? Want to create a similar one? Click [here](/blog/portal_tutorial.pdf) for tutorial. ## Sample blog posts * [Sample 1](/blog/sample.html) * [Sample 2](/blog/sample2.html) ## Instruction: Change description of Blog card ## Code After: --- layout: post title: "Blogs." date: 2016-08-05 20:34:26 image: '/assets/img/' description: 'Blogs.' main-class: 'blog' color: '#EB7728' tags: - blog categories: twitter_text: 'Put your twitter description here.' introduction: 'Contribute a Blog to CSE Software.' --- ## Tutorial on creating CSE Software Interest in our website? Want to create a similar one? Click [here](/blog/portal_tutorial.pdf) for tutorial. ## Sample blog posts * [Sample 1](/blog/sample.html) * [Sample 2](/blog/sample2.html)
--- layout: post title: "Blogs." date: 2016-08-05 20:34:26 image: '/assets/img/' description: 'Blogs.' main-class: 'blog' color: '#EB7728' tags: - blog categories: twitter_text: 'Put your twitter description here.' - introduction: 'Blogs are updated frequently by forum members.' + introduction: 'Contribute a Blog to CSE Software.' --- ## Tutorial on creating CSE Software Interest in our website? Want to create a similar one? Click [here](/blog/portal_tutorial.pdf) for tutorial. ## Sample blog posts * [Sample 1](/blog/sample.html) * [Sample 2](/blog/sample2.html)
2
0.066667
1
1
b1060920d5de992002558e68b2d6545db4c27967
.travis.yml
.travis.yml
sudo: false cache: directories: - $HOME/download - $HOME/.cache/pip language: python python: - "3.3" - "3.4" # command to install dependencies before_install: # Install miniconda to avoid compiling scipy - mkdir -p download - cd download - wget -c http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh - chmod +x miniconda.sh - ./miniconda.sh -b - cd .. - export PATH=/home/travis/miniconda/bin:$PATH - conda update --yes conda install: - if [[ $TRAVIS_PYTHON_VERSION == '3.3' ]]; then conda create --yes -q -n pyenv mkl python=3.3 numpy scipy nose pyparsing pip flake8 six pep8 pyflakes; fi - if [[ $TRAVIS_PYTHON_VERSION == '3.4' ]]; then conda create --yes -q -n pyenv mkl python=3.4 numpy scipy nose pyparsing pip flake8 six pep8 pyflakes; fi - source activate pyenv - pip install theano - pip install . # command to run tests, e.g. python setup.py test script: - nosetests -v
sudo: false cache: directories: - $HOME/download - $HOME/.cache/pip language: python python: - "3.3" - "3.4" # command to install dependencies before_install: # Install miniconda to avoid compiling scipy - mkdir -p download - cd download - wget -c http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh - chmod +x miniconda.sh - ./miniconda.sh -b -p $HOME/miniconda - cd .. - export PATH=/home/travis/miniconda/bin:$PATH - conda update --yes conda install: - if [[ $TRAVIS_PYTHON_VERSION == '3.3' ]]; then conda create --yes -q -n pyenv mkl python=3.3 numpy scipy nose pyparsing pip flake8 six pep8 pyflakes; fi - if [[ $TRAVIS_PYTHON_VERSION == '3.4' ]]; then conda create --yes -q -n pyenv mkl python=3.4 numpy scipy nose pyparsing pip flake8 six pep8 pyflakes; fi - source activate pyenv - pip install theano - pip install . # command to run tests, e.g. python setup.py test script: - nosetests -v
Use a fixed path for miniconda
Use a fixed path for miniconda
YAML
bsd-3-clause
ASalvail/smartlearner,SMART-Lab/smartpy,MarcCote/smartlearner,SMART-Lab/smartlearner
yaml
## Code Before: sudo: false cache: directories: - $HOME/download - $HOME/.cache/pip language: python python: - "3.3" - "3.4" # command to install dependencies before_install: # Install miniconda to avoid compiling scipy - mkdir -p download - cd download - wget -c http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh - chmod +x miniconda.sh - ./miniconda.sh -b - cd .. - export PATH=/home/travis/miniconda/bin:$PATH - conda update --yes conda install: - if [[ $TRAVIS_PYTHON_VERSION == '3.3' ]]; then conda create --yes -q -n pyenv mkl python=3.3 numpy scipy nose pyparsing pip flake8 six pep8 pyflakes; fi - if [[ $TRAVIS_PYTHON_VERSION == '3.4' ]]; then conda create --yes -q -n pyenv mkl python=3.4 numpy scipy nose pyparsing pip flake8 six pep8 pyflakes; fi - source activate pyenv - pip install theano - pip install . # command to run tests, e.g. python setup.py test script: - nosetests -v ## Instruction: Use a fixed path for miniconda ## Code After: sudo: false cache: directories: - $HOME/download - $HOME/.cache/pip language: python python: - "3.3" - "3.4" # command to install dependencies before_install: # Install miniconda to avoid compiling scipy - mkdir -p download - cd download - wget -c http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh - chmod +x miniconda.sh - ./miniconda.sh -b -p $HOME/miniconda - cd .. - export PATH=/home/travis/miniconda/bin:$PATH - conda update --yes conda install: - if [[ $TRAVIS_PYTHON_VERSION == '3.3' ]]; then conda create --yes -q -n pyenv mkl python=3.3 numpy scipy nose pyparsing pip flake8 six pep8 pyflakes; fi - if [[ $TRAVIS_PYTHON_VERSION == '3.4' ]]; then conda create --yes -q -n pyenv mkl python=3.4 numpy scipy nose pyparsing pip flake8 six pep8 pyflakes; fi - source activate pyenv - pip install theano - pip install . # command to run tests, e.g. python setup.py test script: - nosetests -v
sudo: false cache: directories: - $HOME/download - $HOME/.cache/pip language: python python: - "3.3" - "3.4" # command to install dependencies before_install: # Install miniconda to avoid compiling scipy - mkdir -p download - cd download - wget -c http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh - chmod +x miniconda.sh - - ./miniconda.sh -b + - ./miniconda.sh -b -p $HOME/miniconda - cd .. - export PATH=/home/travis/miniconda/bin:$PATH - conda update --yes conda install: - if [[ $TRAVIS_PYTHON_VERSION == '3.3' ]]; then conda create --yes -q -n pyenv mkl python=3.3 numpy scipy nose pyparsing pip flake8 six pep8 pyflakes; fi - if [[ $TRAVIS_PYTHON_VERSION == '3.4' ]]; then conda create --yes -q -n pyenv mkl python=3.4 numpy scipy nose pyparsing pip flake8 six pep8 pyflakes; fi - source activate pyenv - pip install theano - pip install . # command to run tests, e.g. python setup.py test script: - nosetests -v
2
0.060606
1
1
afa8a04758bbd8a34eb898266bea12aa77211873
README.md
README.md
Octarine is an application for OS X 10.10 and later that helps to manage a collection of electronic parts: * Search [Octopart's](https://octopart.com) library of millions of parts. * Retain bookmarks to the parts you're interested in. * Organize the parts as you see fit (by project, by vendor, by drawer in your basement). * Quickly access data sheets for your parts. ![Search screenshot] (https://github.com/microtherion/Octarine/raw/master/Documentation/Screenshots/Search.png) ![Organize screenshot] (https://github.com/microtherion/Octarine/raw/master/Documentation/Screenshots/Organize.png)
Octarine is an application for OS X 10.10 and later that helps to manage a collection of electronic parts: * Search [Octopart's](https://octopart.com) library of millions of parts. * Retain bookmarks to the parts you're interested in. * Organize the parts as you see fit (by project, by vendor, by drawer in your basement). * Quickly access data sheets for your parts. ![Search screenshot] (https://github.com/microtherion/Octarine/raw/master/Documentation/Screenshots/Search.png) ![Datasheets screenshot] (https://github.com/microtherion/Octarine/raw/master/Documentation/Screenshots/Datasheet.png) ![Organize screenshot] (https://github.com/microtherion/Octarine/raw/master/Documentation/Screenshots/Organize.png)
Add data sheet screen shot
Add data sheet screen shot
Markdown
bsd-2-clause
microtherion/Octarine
markdown
## Code Before: Octarine is an application for OS X 10.10 and later that helps to manage a collection of electronic parts: * Search [Octopart's](https://octopart.com) library of millions of parts. * Retain bookmarks to the parts you're interested in. * Organize the parts as you see fit (by project, by vendor, by drawer in your basement). * Quickly access data sheets for your parts. ![Search screenshot] (https://github.com/microtherion/Octarine/raw/master/Documentation/Screenshots/Search.png) ![Organize screenshot] (https://github.com/microtherion/Octarine/raw/master/Documentation/Screenshots/Organize.png) ## Instruction: Add data sheet screen shot ## Code After: Octarine is an application for OS X 10.10 and later that helps to manage a collection of electronic parts: * Search [Octopart's](https://octopart.com) library of millions of parts. * Retain bookmarks to the parts you're interested in. * Organize the parts as you see fit (by project, by vendor, by drawer in your basement). * Quickly access data sheets for your parts. ![Search screenshot] (https://github.com/microtherion/Octarine/raw/master/Documentation/Screenshots/Search.png) ![Datasheets screenshot] (https://github.com/microtherion/Octarine/raw/master/Documentation/Screenshots/Datasheet.png) ![Organize screenshot] (https://github.com/microtherion/Octarine/raw/master/Documentation/Screenshots/Organize.png)
Octarine is an application for OS X 10.10 and later that helps to manage a collection of electronic parts: * Search [Octopart's](https://octopart.com) library of millions of parts. * Retain bookmarks to the parts you're interested in. * Organize the parts as you see fit (by project, by vendor, by drawer in your basement). * Quickly access data sheets for your parts. ![Search screenshot] (https://github.com/microtherion/Octarine/raw/master/Documentation/Screenshots/Search.png) + ![Datasheets screenshot] + (https://github.com/microtherion/Octarine/raw/master/Documentation/Screenshots/Datasheet.png) + ![Organize screenshot] (https://github.com/microtherion/Octarine/raw/master/Documentation/Screenshots/Organize.png)
3
0.230769
3
0
5937fa11b00316cf5b0cee3731847f199d3bf871
lib/moltin/api/rest_client_wrapper.rb
lib/moltin/api/rest_client_wrapper.rb
require 'moltin/api/request' class Moltin::Api::RestClientWrapper def initialize(path, custom_headers = {}) @instance = RestClient::Resource.new( Moltin::Api::Request.build_endpoint(path), { verify_ssl: OpenSSL::SSL::VERIFY_NONE, headers: Moltin::Api::Request.headers(custom_headers), } ) end def get @instance.get do |response| yield response end end end
require 'moltin/api/request' class Moltin::Api::RestClientWrapper def initialize(path, custom_headers = {}) @instance = RestClient::Resource.new( Moltin::Api::Request.build_endpoint(path), { verify_ssl: OpenSSL::SSL::VERIFY_NONE, headers: Moltin::Api::Request.headers(custom_headers), } ) end def get @instance.get do |response| yield response end end def post data @instance.post data do |response| yield response end end def delete @instance.delete do |response| yield response end end end
Add POST and DELETE methods to rest client wrapper
Add POST and DELETE methods to rest client wrapper
Ruby
mit
moltin/ruby-sdk,moltin/ruby-sdk
ruby
## Code Before: require 'moltin/api/request' class Moltin::Api::RestClientWrapper def initialize(path, custom_headers = {}) @instance = RestClient::Resource.new( Moltin::Api::Request.build_endpoint(path), { verify_ssl: OpenSSL::SSL::VERIFY_NONE, headers: Moltin::Api::Request.headers(custom_headers), } ) end def get @instance.get do |response| yield response end end end ## Instruction: Add POST and DELETE methods to rest client wrapper ## Code After: require 'moltin/api/request' class Moltin::Api::RestClientWrapper def initialize(path, custom_headers = {}) @instance = RestClient::Resource.new( Moltin::Api::Request.build_endpoint(path), { verify_ssl: OpenSSL::SSL::VERIFY_NONE, headers: Moltin::Api::Request.headers(custom_headers), } ) end def get @instance.get do |response| yield response end end def post data @instance.post data do |response| yield response end end def delete @instance.delete do |response| yield response end end end
require 'moltin/api/request' class Moltin::Api::RestClientWrapper - def initialize(path, custom_headers = {}) @instance = RestClient::Resource.new( Moltin::Api::Request.build_endpoint(path), { verify_ssl: OpenSSL::SSL::VERIFY_NONE, headers: Moltin::Api::Request.headers(custom_headers), } ) end def get @instance.get do |response| yield response end end + def post data + @instance.post data do |response| + yield response + end + end + + def delete + @instance.delete do |response| + yield response + end + end end
12
0.571429
11
1
0c63cc5e9bd7beedb8890222aa8a4a9ce454ad71
exampleLists.txt
exampleLists.txt
[ one, two, three, four ] [1,[1,2,[ ,, ]]] [dsd,[kdd], "ddd"] [ Blinky, Inky, [some, inner, nesting], Pinky,[ j] ,kjl, (1,2,3), jkj] m = do { action1 ; action2 ; action3 } mkTabbedView :: forall db . Typeable db => [(String, Maybe (EditM db ()), UntypedWebView db)] -> WebViewM db (WebView db (TabbedView db)) mkTabbedView labelsEditActionsTabViews = mkWebView $ \vid (TabbedView selectedTab _ _) -> do { let (labels, mEditActions,tabViews) = unzip3 labelsEditActionsTabViews ; selectionViews <- sequence [ mkLinkView label $ do { viewEdit vid $ \((TabbedView _ sas twvs) :: TabbedView db) -> TabbedView i sas twvs ; case mEditAction of Nothing -> return () Just ea -> ea } | (i, label, mEditAction) <- zip3 [0..] labels mEditActions ] ; return $ TabbedView selectedTab selectionViews tabViews }
[ one, two, three, four ] [1,[1,2,[ ,, ]]] [dsd,[kdd], "ddd"] [ Blinky, Inky, [some, inner, nesting], Pinky,[ j] ,kjl, (1,2,3), jkj] m = do { action1 ; action2 ; action3 } variation = { action1; action2 } mkTabbedView :: forall db . Typeable db => [(String, Maybe (EditM db ()), UntypedWebView db)] -> WebViewM db (WebView db (TabbedView db)) mkTabbedView labelsEditActionsTabViews = mkWebView $ \vid (TabbedView selectedTab _ _) -> do { let (labels, mEditActions,tabViews) = unzip3 labelsEditActionsTabViews ; selectionViews <- sequence [ mkLinkView label $ do { viewEdit vid $ \((TabbedView _ sas twvs) :: TabbedView db) -> TabbedView i sas twvs ; case mEditAction of Nothing -> return () Just ea -> ea } | (i, label, mEditAction) <- zip3 [0..] labels mEditActions ] ; return $ TabbedView selectedTab selectionViews tabViews }
Add example with alternative layout
Add example with alternative layout
Text
mit
Oblosys/atom-list-edit
text
## Code Before: [ one, two, three, four ] [1,[1,2,[ ,, ]]] [dsd,[kdd], "ddd"] [ Blinky, Inky, [some, inner, nesting], Pinky,[ j] ,kjl, (1,2,3), jkj] m = do { action1 ; action2 ; action3 } mkTabbedView :: forall db . Typeable db => [(String, Maybe (EditM db ()), UntypedWebView db)] -> WebViewM db (WebView db (TabbedView db)) mkTabbedView labelsEditActionsTabViews = mkWebView $ \vid (TabbedView selectedTab _ _) -> do { let (labels, mEditActions,tabViews) = unzip3 labelsEditActionsTabViews ; selectionViews <- sequence [ mkLinkView label $ do { viewEdit vid $ \((TabbedView _ sas twvs) :: TabbedView db) -> TabbedView i sas twvs ; case mEditAction of Nothing -> return () Just ea -> ea } | (i, label, mEditAction) <- zip3 [0..] labels mEditActions ] ; return $ TabbedView selectedTab selectionViews tabViews } ## Instruction: Add example with alternative layout ## Code After: [ one, two, three, four ] [1,[1,2,[ ,, ]]] [dsd,[kdd], "ddd"] [ Blinky, Inky, [some, inner, nesting], Pinky,[ j] ,kjl, (1,2,3), jkj] m = do { action1 ; action2 ; action3 } variation = { action1; action2 } mkTabbedView :: forall db . Typeable db => [(String, Maybe (EditM db ()), UntypedWebView db)] -> WebViewM db (WebView db (TabbedView db)) mkTabbedView labelsEditActionsTabViews = mkWebView $ \vid (TabbedView selectedTab _ _) -> do { let (labels, mEditActions,tabViews) = unzip3 labelsEditActionsTabViews ; selectionViews <- sequence [ mkLinkView label $ do { viewEdit vid $ \((TabbedView _ sas twvs) :: TabbedView db) -> TabbedView i sas twvs ; case mEditAction of Nothing -> return () Just ea -> ea } | (i, label, mEditAction) <- zip3 [0..] labels mEditActions ] ; return $ TabbedView selectedTab selectionViews tabViews }
[ one, two, three, four ] [1,[1,2,[ ,, ]]] [dsd,[kdd], "ddd"] [ Blinky, Inky, [some, inner, nesting], Pinky,[ j] ,kjl, (1,2,3), jkj] m = do { action1 ; action2 ; action3 } + + variation = { + action1; + action2 + } mkTabbedView :: forall db . Typeable db => [(String, Maybe (EditM db ()), UntypedWebView db)] -> WebViewM db (WebView db (TabbedView db)) mkTabbedView labelsEditActionsTabViews = mkWebView $ \vid (TabbedView selectedTab _ _) -> do { let (labels, mEditActions,tabViews) = unzip3 labelsEditActionsTabViews ; selectionViews <- sequence [ mkLinkView label $ do { viewEdit vid $ \((TabbedView _ sas twvs) :: TabbedView db) -> TabbedView i sas twvs ; case mEditAction of Nothing -> return () Just ea -> ea } | (i, label, mEditAction) <- zip3 [0..] labels mEditActions ] ; return $ TabbedView selectedTab selectionViews tabViews }
5
0.178571
5
0
000b2ec2f763058783838f1b9a5cd011ff82ec60
composer.json
composer.json
{ "name": "mnapoli/externals", "license": "MIT", "type": "project", "autoload": { "psr-4": { "Externals\\": "src/" } }, "require": { "php": "~7.0", "php-di/php-di": "~5.1", "mnapoli/silly": "^1.3", "stratify/framework": "~0.1.3", "doctrine/annotations": "^1.2", "mnapoli/imapi": "dev-master", "doctrine/dbal": "^2.5", "stratify/twig-module": "^0.1.1", "twig/extensions": "~1.0", "ornicar/gravatar-bundle": "^1.1", "misd/linkify": "^1.1", "vlucas/phpdotenv": "^2.3" }, "repositories": [ { "type": "vcs", "url": "git@github.com:mnapoli/Imapi.git" } ], "minimum-stability": "beta", "prefer-stable": true }
{ "name": "mnapoli/externals", "license": "MIT", "type": "project", "autoload": { "psr-4": { "Externals\\": "src/" } }, "require": { "php": "~7.0", "php-di/php-di": "~5.1", "mnapoli/silly": "^1.3", "stratify/framework": "~0.1.3", "doctrine/annotations": "^1.2", "mnapoli/imapi": "dev-master", "doctrine/dbal": "^2.5", "stratify/twig-module": "^0.1.1", "twig/extensions": "~1.0", "ornicar/gravatar-bundle": "^1.1", "misd/linkify": "^1.1", "vlucas/phpdotenv": "^2.3" }, "repositories": [ { "type": "vcs", "url": "git@github.com:mnapoli/Imapi.git" } ], "config": { "secure-http": false }, "minimum-stability": "beta", "prefer-stable": true }
Allow installing dependencies without HTTPS for Horde_Imap
Allow installing dependencies without HTTPS for Horde_Imap
JSON
mit
mnapoli/externals,mnapoli/externals
json
## Code Before: { "name": "mnapoli/externals", "license": "MIT", "type": "project", "autoload": { "psr-4": { "Externals\\": "src/" } }, "require": { "php": "~7.0", "php-di/php-di": "~5.1", "mnapoli/silly": "^1.3", "stratify/framework": "~0.1.3", "doctrine/annotations": "^1.2", "mnapoli/imapi": "dev-master", "doctrine/dbal": "^2.5", "stratify/twig-module": "^0.1.1", "twig/extensions": "~1.0", "ornicar/gravatar-bundle": "^1.1", "misd/linkify": "^1.1", "vlucas/phpdotenv": "^2.3" }, "repositories": [ { "type": "vcs", "url": "git@github.com:mnapoli/Imapi.git" } ], "minimum-stability": "beta", "prefer-stable": true } ## Instruction: Allow installing dependencies without HTTPS for Horde_Imap ## Code After: { "name": "mnapoli/externals", "license": "MIT", "type": "project", "autoload": { "psr-4": { "Externals\\": "src/" } }, "require": { "php": "~7.0", "php-di/php-di": "~5.1", "mnapoli/silly": "^1.3", "stratify/framework": "~0.1.3", "doctrine/annotations": "^1.2", "mnapoli/imapi": "dev-master", "doctrine/dbal": "^2.5", "stratify/twig-module": "^0.1.1", "twig/extensions": "~1.0", "ornicar/gravatar-bundle": "^1.1", "misd/linkify": "^1.1", "vlucas/phpdotenv": "^2.3" }, "repositories": [ { "type": "vcs", "url": "git@github.com:mnapoli/Imapi.git" } ], "config": { "secure-http": false }, "minimum-stability": "beta", "prefer-stable": true }
{ "name": "mnapoli/externals", "license": "MIT", "type": "project", "autoload": { "psr-4": { "Externals\\": "src/" } }, "require": { "php": "~7.0", "php-di/php-di": "~5.1", "mnapoli/silly": "^1.3", "stratify/framework": "~0.1.3", "doctrine/annotations": "^1.2", "mnapoli/imapi": "dev-master", "doctrine/dbal": "^2.5", "stratify/twig-module": "^0.1.1", "twig/extensions": "~1.0", "ornicar/gravatar-bundle": "^1.1", "misd/linkify": "^1.1", "vlucas/phpdotenv": "^2.3" }, "repositories": [ { "type": "vcs", "url": "git@github.com:mnapoli/Imapi.git" } ], + "config": { + "secure-http": false + }, "minimum-stability": "beta", "prefer-stable": true }
3
0.09375
3
0
a4eb952cc2e583d3b7786f5dea101d1e013c8159
services/controllers/utils.py
services/controllers/utils.py
def map_range(x, in_min, in_max, out_min, out_max): out_delta = out_max - out_min in_delta = in_max - in_min return (x - in_min) * out_delta / in_delta + out_min
def lerp(a, b, t): return (1.0 - t) * a + t * b def map_range(x, in_min, in_max, out_min, out_max): out_delta = out_max - out_min in_delta = in_max - in_min return (x - in_min) * out_delta / in_delta + out_min
Add function for linear interpolation (lerp)
Add function for linear interpolation (lerp)
Python
bsd-3-clause
gizmo-cda/g2x-submarine-v2,gizmo-cda/g2x-submarine-v2,gizmo-cda/g2x-submarine-v2,gizmo-cda/g2x-submarine-v2
python
## Code Before: def map_range(x, in_min, in_max, out_min, out_max): out_delta = out_max - out_min in_delta = in_max - in_min return (x - in_min) * out_delta / in_delta + out_min ## Instruction: Add function for linear interpolation (lerp) ## Code After: def lerp(a, b, t): return (1.0 - t) * a + t * b def map_range(x, in_min, in_max, out_min, out_max): out_delta = out_max - out_min in_delta = in_max - in_min return (x - in_min) * out_delta / in_delta + out_min
+ def lerp(a, b, t): + return (1.0 - t) * a + t * b + + def map_range(x, in_min, in_max, out_min, out_max): out_delta = out_max - out_min in_delta = in_max - in_min return (x - in_min) * out_delta / in_delta + out_min
4
0.8
4
0