commit
stringlengths 40
40
| old_file
stringlengths 4
237
| new_file
stringlengths 4
237
| old_contents
stringlengths 1
4.24k
| new_contents
stringlengths 5
4.84k
| subject
stringlengths 15
778
| message
stringlengths 16
6.86k
| lang
stringlengths 1
30
| license
stringclasses 13
values | repos
stringlengths 5
116k
| config
stringlengths 1
30
| content
stringlengths 105
8.72k
|
---|---|---|---|---|---|---|---|---|---|---|---|
6fc5e76634aa4bc9753c45cab10a16d0eb8fd801 | tasks/common.yml | tasks/common.yml | ---
- yum: name={{ item }} state=installed
with_items:
- python-passlib
- httpd
- mod_ssl
- service: name=httpd state=started enabled=yes
- copy: src={{ item }} dest=/etc/httpd/conf.d/{{ item }} owner=root group=apache mode=0644
with_items:
- name_vhost.conf
- mod_filter.conf
- remove_sslv3.conf
- mod_status.conf
- various.conf
notify: restart httpd
- shell: lokkit -s {{ item }}
with_items:
- http
- https
when: ansible_distribution_major_version == '6' and (ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat')
- shell: firewall-cmd --permanent --add-port={{ item }}/tcp
with_items:
- http
- https
when: ansible_distribution == 'Fedora' or ansible_distribution_major_version == '7'
- lineinfile: dest=/etc/logrotate.conf regexp="^rotate" line="rotate {{ log_retention_week }}" state=present
when: log_retention_week is defined
| ---
- yum: name={{ item }} state=installed
with_items:
- python-passlib
- httpd
- mod_ssl
- service: name=httpd state=started enabled=yes
- copy: src={{ item }} dest=/etc/httpd/conf.d/{{ item }} owner=root group=apache mode=0644
with_items:
- name_vhost.conf
- mod_filter.conf
- remove_sslv3.conf
- mod_status.conf
- various.conf
notify: restart httpd
- shell: lokkit -s {{ item }}
with_items:
- http
- https
when: ansible_distribution_major_version == '6' and (ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat')
- firewalld: service={{ item }} permanent=true state=enabled immediate=yes
with_items:
- http
- https
when: ansible_distribution == 'Fedora' or ansible_distribution_major_version == '7'
- lineinfile: dest=/etc/logrotate.conf regexp="^rotate" line="rotate {{ log_retention_week }}" state=present
when: log_retention_week is defined
| Use the firewalld module instead of the shell | Use the firewalld module instead of the shell
| YAML | mit | OSAS/ansible-role-httpd | yaml | ## Code Before:
---
- yum: name={{ item }} state=installed
with_items:
- python-passlib
- httpd
- mod_ssl
- service: name=httpd state=started enabled=yes
- copy: src={{ item }} dest=/etc/httpd/conf.d/{{ item }} owner=root group=apache mode=0644
with_items:
- name_vhost.conf
- mod_filter.conf
- remove_sslv3.conf
- mod_status.conf
- various.conf
notify: restart httpd
- shell: lokkit -s {{ item }}
with_items:
- http
- https
when: ansible_distribution_major_version == '6' and (ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat')
- shell: firewall-cmd --permanent --add-port={{ item }}/tcp
with_items:
- http
- https
when: ansible_distribution == 'Fedora' or ansible_distribution_major_version == '7'
- lineinfile: dest=/etc/logrotate.conf regexp="^rotate" line="rotate {{ log_retention_week }}" state=present
when: log_retention_week is defined
## Instruction:
Use the firewalld module instead of the shell
## Code After:
---
- yum: name={{ item }} state=installed
with_items:
- python-passlib
- httpd
- mod_ssl
- service: name=httpd state=started enabled=yes
- copy: src={{ item }} dest=/etc/httpd/conf.d/{{ item }} owner=root group=apache mode=0644
with_items:
- name_vhost.conf
- mod_filter.conf
- remove_sslv3.conf
- mod_status.conf
- various.conf
notify: restart httpd
- shell: lokkit -s {{ item }}
with_items:
- http
- https
when: ansible_distribution_major_version == '6' and (ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat')
- firewalld: service={{ item }} permanent=true state=enabled immediate=yes
with_items:
- http
- https
when: ansible_distribution == 'Fedora' or ansible_distribution_major_version == '7'
- lineinfile: dest=/etc/logrotate.conf regexp="^rotate" line="rotate {{ log_retention_week }}" state=present
when: log_retention_week is defined
|
4fb482a24444bb45ffa69ef317d918a1f7dd060d | _includes/footers.html | _includes/footers.html | <footer class="footer">
<div class="content has-text-centered">
<p>
© <strong>My Personal Web</strong> by
<a href="{{ site.url }}">Bervianto Leo Pratama</a>. The source code is
licensed <a href="http://opensource.org/licenses/mit-license.php">MIT</a>.
The website content is licensed
<a href="http://creativecommons.org/licenses/by-nc-sa/4.0/"
>CC BY NC SA 4.0</a
>.
</p>
</div>
{% include component/social-links.html %}
</footer>
| <footer class="footer">
{% include component/social-links.html %}
<section class="section">
<div class="content has-text-centered">
<p>
© <strong>My Personal Web</strong> by
<a href="{{ site.url }}">Bervianto Leo Pratama</a>. The source code is
licensed
<a href="http://opensource.org/licenses/mit-license.php">MIT</a>. The
website content is licensed
<a href="http://creativecommons.org/licenses/by-nc-sa/4.0/"
>CC BY NC SA 4.0</a
>.
</p>
</div>
</section>
</footer>
| Change position copyright into bottom | Change position copyright into bottom
| HTML | mit | berviantoleo/berviantoleo.github.io,berviantoleo/berviantoleo.github.io,berviantoleo/berviantoleo.github.io,berviantoleo/berviantoleo.github.io | html | ## Code Before:
<footer class="footer">
<div class="content has-text-centered">
<p>
© <strong>My Personal Web</strong> by
<a href="{{ site.url }}">Bervianto Leo Pratama</a>. The source code is
licensed <a href="http://opensource.org/licenses/mit-license.php">MIT</a>.
The website content is licensed
<a href="http://creativecommons.org/licenses/by-nc-sa/4.0/"
>CC BY NC SA 4.0</a
>.
</p>
</div>
{% include component/social-links.html %}
</footer>
## Instruction:
Change position copyright into bottom
## Code After:
<footer class="footer">
{% include component/social-links.html %}
<section class="section">
<div class="content has-text-centered">
<p>
© <strong>My Personal Web</strong> by
<a href="{{ site.url }}">Bervianto Leo Pratama</a>. The source code is
licensed
<a href="http://opensource.org/licenses/mit-license.php">MIT</a>. The
website content is licensed
<a href="http://creativecommons.org/licenses/by-nc-sa/4.0/"
>CC BY NC SA 4.0</a
>.
</p>
</div>
</section>
</footer>
|
8b200cf5c228624e0fb3b9af05a2fc17e5abc682 | core/app/backbone/views/subchannel_item_view.coffee | core/app/backbone/views/subchannel_item_view.coffee | class window.SubchannelItemView extends Backbone.Marionette.ItemView
tagName: "li"
events:
click: "clickHandler"
"click .close": "destroySubchannel"
template: "subchannels/_subchannel_item"
initialize: ->
@model.bind "destroy", @close, this
destroySubchannel: (e) ->
@model.destroy() if confirm("Are you sure you want to remove this channel from your channel?")
e.stopPropagation()
false
onRender: ->
@$('i.close').hide() unless currentChannel.user().get('id') == currentUser.get('id')
clickHandler: (e) ->
return if e.metaKey or e.ctrlKey or e.altKey
mp_track "Channel: Click on subchannel",
channel_id: currentChannel.id
subchannel_id: @model.id
Backbone.history.navigate @model.get("created_by").username + "/channels/" + @model.id, true
e.preventDefault()
false
| class window.SubchannelItemView extends Backbone.Marionette.ItemView
tagName: "li"
events:
click: "clickHandler"
"click .close": "destroySubchannel"
template: "subchannels/_subchannel_item"
initialize: ->
@model.bind "destroy", @close, this
destroySubchannel: (e) ->
@model.destroy() if confirm("Are you sure you want to remove this channel from your channel?")
e.stopPropagation()
false
onRender: ->
@$('i.close').hide() unless currentChannel.user().get('id') == currentUser.get('id')
clickHandler: (e) ->
mp_track "Channel: Click on subchannel",
channel_id: currentChannel.id
subchannel_id: @model.id
@defaultClickHandler e
| Use defaultClickHandler to navigate to subChannel | Use defaultClickHandler to navigate to subChannel
| CoffeeScript | mit | Factlink/factlink-core,daukantas/factlink-core,daukantas/factlink-core,Factlink/factlink-core,daukantas/factlink-core,Factlink/factlink-core,Factlink/factlink-core,daukantas/factlink-core | coffeescript | ## Code Before:
class window.SubchannelItemView extends Backbone.Marionette.ItemView
tagName: "li"
events:
click: "clickHandler"
"click .close": "destroySubchannel"
template: "subchannels/_subchannel_item"
initialize: ->
@model.bind "destroy", @close, this
destroySubchannel: (e) ->
@model.destroy() if confirm("Are you sure you want to remove this channel from your channel?")
e.stopPropagation()
false
onRender: ->
@$('i.close').hide() unless currentChannel.user().get('id') == currentUser.get('id')
clickHandler: (e) ->
return if e.metaKey or e.ctrlKey or e.altKey
mp_track "Channel: Click on subchannel",
channel_id: currentChannel.id
subchannel_id: @model.id
Backbone.history.navigate @model.get("created_by").username + "/channels/" + @model.id, true
e.preventDefault()
false
## Instruction:
Use defaultClickHandler to navigate to subChannel
## Code After:
class window.SubchannelItemView extends Backbone.Marionette.ItemView
tagName: "li"
events:
click: "clickHandler"
"click .close": "destroySubchannel"
template: "subchannels/_subchannel_item"
initialize: ->
@model.bind "destroy", @close, this
destroySubchannel: (e) ->
@model.destroy() if confirm("Are you sure you want to remove this channel from your channel?")
e.stopPropagation()
false
onRender: ->
@$('i.close').hide() unless currentChannel.user().get('id') == currentUser.get('id')
clickHandler: (e) ->
mp_track "Channel: Click on subchannel",
channel_id: currentChannel.id
subchannel_id: @model.id
@defaultClickHandler e
|
51d162e6ddba5169c8c15b22e71667302512f8c7 | blog/programming/fp/haskell/_posts/2016-03-09-functional-programming-with-haskell.markdown | blog/programming/fp/haskell/_posts/2016-03-09-functional-programming-with-haskell.markdown | ---
layout: post
title: "Functional Programming with Haskell"
date: 2016-03-08 22:11:26 +0000
categories: fp haskell blog highlight programming
teaser: Learning functional programming with Haskell
img-url: /img/content/haskell-600x600.png
permalink: /blog/fp/haskell-intro
---
Learning functional programming with Haskell as part of the [Functional Programming module](http://www.cs.ox.ac.uk/softeng/subjects/FPR.html)
at University of Oxford.
Study notes, code and lots more here: [https://github.com/anuragkapur/ox-fpr](https://github.com/anuragkapur/ox-fpr) | ---
layout: post
title: "Functional Programming with Haskell"
date: 2016-03-08 22:11:26 +0000
categories: fp haskell blog highlight programming
teaser: Learning functional programming with Haskell
img-url: /img/content/haskell-600x600.png
---
Learning functional programming with Haskell as part of the [Functional Programming module](http://www.cs.ox.ac.uk/softeng/subjects/FPR.html)
at University of Oxford.
Study notes, code and lots more here: [https://github.com/anuragkapur/ox-fpr](https://github.com/anuragkapur/ox-fpr)
| Remove permalink from haskell post | Remove permalink from haskell post
| Markdown | cc0-1.0 | anuragkapur/anuragkapur.github.io,anuragkapur/anuragkapur.github.io | markdown | ## Code Before:
---
layout: post
title: "Functional Programming with Haskell"
date: 2016-03-08 22:11:26 +0000
categories: fp haskell blog highlight programming
teaser: Learning functional programming with Haskell
img-url: /img/content/haskell-600x600.png
permalink: /blog/fp/haskell-intro
---
Learning functional programming with Haskell as part of the [Functional Programming module](http://www.cs.ox.ac.uk/softeng/subjects/FPR.html)
at University of Oxford.
Study notes, code and lots more here: [https://github.com/anuragkapur/ox-fpr](https://github.com/anuragkapur/ox-fpr)
## Instruction:
Remove permalink from haskell post
## Code After:
---
layout: post
title: "Functional Programming with Haskell"
date: 2016-03-08 22:11:26 +0000
categories: fp haskell blog highlight programming
teaser: Learning functional programming with Haskell
img-url: /img/content/haskell-600x600.png
---
Learning functional programming with Haskell as part of the [Functional Programming module](http://www.cs.ox.ac.uk/softeng/subjects/FPR.html)
at University of Oxford.
Study notes, code and lots more here: [https://github.com/anuragkapur/ox-fpr](https://github.com/anuragkapur/ox-fpr)
|
9bb8f4a3c99e5b43ffa5fd9297930ee102326ab1 | lib/specter/file.rb | lib/specter/file.rb | class Specter
class File
def name
@_name
end
def initialize(name)
@_name = name
end
def passed
@_passed ||= []
end
def passed?
not failed?
end
def failed
@_failed ||= []
end
def failed?
failed.any?
end
def run
fork do
begin
Specter.current.store :file, self
Specter.now.file = self
filename = name
Specter::Scope.new filename do
load filename
end.run
rescue Exception => exception
fail exception
ensure
Specter.current.delete :file
Specter.now.file = nil
exit 1 if failed?
end
end
Process.wait
$?.success?
end
def pass
values = {file: Specter.now.file, subject: Specter.now.subject, scopes: Specter.now.scopes, spec: Specter.now.spec}
passed << values
Specter::Reporter.progress values
end
def fail(exception)
values = {file: Specter.now.file, subject: Specter.now.subject, scopes: Specter.now.scopes, spec: Specter.now.spec, exception: exception}
failed << values
Specter::Reporter.progress values
end
end
end
| class Specter
class File
def name
@_name
end
def initialize(name)
@_name = name
end
def passed
@_passed ||= []
end
def passed?
not failed?
end
def failed
@_failed ||= []
end
def failed?
failed.any?
end
def run
fork do
begin
Specter.now.file = self
filename = name
Specter::Scope.new filename do
load filename
end.run
rescue Exception => exception
fail exception
ensure
Specter.now.file = nil
exit 1 if failed?
end
end
Process.wait
$?.success?
end
def pass
values = {file: Specter.now.file, subject: Specter.now.subject, scopes: Specter.now.scopes, spec: Specter.now.spec}
passed << values
Specter::Reporter.progress values
end
def fail(exception)
values = {file: Specter.now.file, subject: Specter.now.subject, scopes: Specter.now.scopes, spec: Specter.now.spec, exception: exception}
failed << values
Specter::Reporter.progress values
end
end
end
| Remove calls to old current context. | Remove calls to old current context.
| Ruby | mit | Erol/specter | ruby | ## Code Before:
class Specter
class File
def name
@_name
end
def initialize(name)
@_name = name
end
def passed
@_passed ||= []
end
def passed?
not failed?
end
def failed
@_failed ||= []
end
def failed?
failed.any?
end
def run
fork do
begin
Specter.current.store :file, self
Specter.now.file = self
filename = name
Specter::Scope.new filename do
load filename
end.run
rescue Exception => exception
fail exception
ensure
Specter.current.delete :file
Specter.now.file = nil
exit 1 if failed?
end
end
Process.wait
$?.success?
end
def pass
values = {file: Specter.now.file, subject: Specter.now.subject, scopes: Specter.now.scopes, spec: Specter.now.spec}
passed << values
Specter::Reporter.progress values
end
def fail(exception)
values = {file: Specter.now.file, subject: Specter.now.subject, scopes: Specter.now.scopes, spec: Specter.now.spec, exception: exception}
failed << values
Specter::Reporter.progress values
end
end
end
## Instruction:
Remove calls to old current context.
## Code After:
class Specter
class File
def name
@_name
end
def initialize(name)
@_name = name
end
def passed
@_passed ||= []
end
def passed?
not failed?
end
def failed
@_failed ||= []
end
def failed?
failed.any?
end
def run
fork do
begin
Specter.now.file = self
filename = name
Specter::Scope.new filename do
load filename
end.run
rescue Exception => exception
fail exception
ensure
Specter.now.file = nil
exit 1 if failed?
end
end
Process.wait
$?.success?
end
def pass
values = {file: Specter.now.file, subject: Specter.now.subject, scopes: Specter.now.scopes, spec: Specter.now.spec}
passed << values
Specter::Reporter.progress values
end
def fail(exception)
values = {file: Specter.now.file, subject: Specter.now.subject, scopes: Specter.now.scopes, spec: Specter.now.spec, exception: exception}
failed << values
Specter::Reporter.progress values
end
end
end
|
24f0e3c9495526690599593ef3c759f39785176e | _includes/header.html | _includes/header.html | <header>
<div class="hero" style="background-image: url('{{ page.hero_image | default: site.hero_image | absolute_url }}');">
<div class="overlay"></div>
<div class="page-title">
<h1 class="title">
{% if page.title == 'Home' %}
{{ site.title | escape }}
{% else %}
{{ page.title | default: site.title | escape }}
{% endif %}
</h1>
<div class="description">
{{ page.description | default: site.description | markdownify }}
</div>
</div>
</div>
</header>
<nav class="menu">
<ul class="nav">
{% for page in site.pages %}
{% if page.title %}
<li class="nav-item">
<a class="nav-link" href="{{ page.url | relative_url }}">{{ page.title | escape }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
</nav>
| <header>
<div class="hero" style="background-image: url('{{ page.hero_image | default: site.hero_image | absolute_url }}');">
<div class="overlay"></div>
<div class="page-title">
<h1 class="title">
{% if page.title == 'Home' %}
{{ site.title | escape }}
{% else %}
{{ page.title | default: site.title | escape }}
{% endif %}
</h1>
<div class="description">
{{ page.description | default: site.description | markdownify }}
</div>
</div>
</div>
</header>
<nav class="menu">
<ul class="nav">
{% assign sorted_menu = site.pages | sort: 'position' %}
{% for page in sorted_menu %}
{% if page.title %}
<li class="nav-item">
<a class="nav-link" href="{{ page.url | relative_url }}">{{ page.title | escape }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
</nav>
| Sort menu pages by position | Sort menu pages by position
| HTML | mit | dajocarter/dajekyll,dajocarter/dajekyll,dajocarter/dajekyll | html | ## Code Before:
<header>
<div class="hero" style="background-image: url('{{ page.hero_image | default: site.hero_image | absolute_url }}');">
<div class="overlay"></div>
<div class="page-title">
<h1 class="title">
{% if page.title == 'Home' %}
{{ site.title | escape }}
{% else %}
{{ page.title | default: site.title | escape }}
{% endif %}
</h1>
<div class="description">
{{ page.description | default: site.description | markdownify }}
</div>
</div>
</div>
</header>
<nav class="menu">
<ul class="nav">
{% for page in site.pages %}
{% if page.title %}
<li class="nav-item">
<a class="nav-link" href="{{ page.url | relative_url }}">{{ page.title | escape }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
</nav>
## Instruction:
Sort menu pages by position
## Code After:
<header>
<div class="hero" style="background-image: url('{{ page.hero_image | default: site.hero_image | absolute_url }}');">
<div class="overlay"></div>
<div class="page-title">
<h1 class="title">
{% if page.title == 'Home' %}
{{ site.title | escape }}
{% else %}
{{ page.title | default: site.title | escape }}
{% endif %}
</h1>
<div class="description">
{{ page.description | default: site.description | markdownify }}
</div>
</div>
</div>
</header>
<nav class="menu">
<ul class="nav">
{% assign sorted_menu = site.pages | sort: 'position' %}
{% for page in sorted_menu %}
{% if page.title %}
<li class="nav-item">
<a class="nav-link" href="{{ page.url | relative_url }}">{{ page.title | escape }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
</nav>
|
4b547221e897daebdb2ba6ce72a3aa188dde9c97 | provision/proxy.yaml | provision/proxy.yaml | ---
- name: Deploy the proxy
hosts: proxy
remote_user: root
roles:
- proxy
| ---
- name: Deploy the proxy
hosts: proxy
remote_user: ubuntu
become: yes
become_method: sudo
roles:
- proxy
| Configure sudo in playbook rather than command line | Configure sudo in playbook rather than command line
| YAML | mit | edunham/ansible-rust-infra,edunham/ansible-rust-infra,edunham/ansible-rust-infra | yaml | ## Code Before:
---
- name: Deploy the proxy
hosts: proxy
remote_user: root
roles:
- proxy
## Instruction:
Configure sudo in playbook rather than command line
## Code After:
---
- name: Deploy the proxy
hosts: proxy
remote_user: ubuntu
become: yes
become_method: sudo
roles:
- proxy
|
369964986df0ca558c2e340bc8d15272296af67e | tools/debug_launcher.py | tools/debug_launcher.py | from __future__ import print_function
import sys
import os
import time
import socket
import argparse
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument('--launch-adapter')
parser.add_argument('--lldb')
parser.add_argument('--wait-port')
args = parser.parse_args()
if args.launch_adapter:
lldb = args.lldb or 'lldb'
cmd = [lldb, '-b',
'-O', 'command script import %s' % args.launch_adapter,
'-O', 'script import ptvsd; ptvsd.enable_attach(address=("0.0.0.0", 3000)); ptvsd.wait_for_attach(); adapter.run_tcp_session(4711)',
]
print('Launching', cmd)
subprocess.Popen(cmd, preexec_fn=lambda: os.setsid())
if args.wait_port:
port = int(args.wait_port)
print('Waiting for port %d' % port)
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
while True:
result = sock.connect_ex(('127.0.0.1', port))
if result == 0:
break
time.sleep(0.5)
print('Port opened')
sock.shutdown(socket.SHUT_WR)
sock.close()
| from __future__ import print_function
import sys
import os
import time
import socket
import argparse
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument('--launch-adapter')
parser.add_argument('--lldb')
parser.add_argument('--wait-port')
args = parser.parse_args()
if args.launch_adapter:
lldb = args.lldb or 'lldb'
cmd = [lldb, '-b',
'-O', 'command script import %s' % args.launch_adapter,
'-O', 'script sys.argv=["lldb"]; import ptvsd; ptvsd.enable_attach(address=("0.0.0.0", 3000)); ptvsd.wait_for_attach()',
'-O', 'script adapter.run_tcp_session(4711)',
]
print('Launching', cmd)
if sys.platform != 'win32':
subprocess.Popen(cmd, preexec_fn=lambda: os.setsid())
else:
subprocess.Popen(cmd, creationflags=subprocess.CREATE_NEW_CONSOLE)
if args.wait_port:
port = int(args.wait_port)
print('Waiting for port %d' % port)
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
while True:
result = sock.connect_ex(('127.0.0.1', port))
if result == 0:
break
time.sleep(0.5)
print('Port opened')
sock.shutdown(socket.SHUT_WR)
sock.close()
| Fix python debugging on Windows. | Fix python debugging on Windows.
| Python | mit | vadimcn/vscode-lldb,vadimcn/vscode-lldb,vadimcn/vscode-lldb,vadimcn/vscode-lldb,vadimcn/vscode-lldb,vadimcn/vscode-lldb,vadimcn/vscode-lldb | python | ## Code Before:
from __future__ import print_function
import sys
import os
import time
import socket
import argparse
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument('--launch-adapter')
parser.add_argument('--lldb')
parser.add_argument('--wait-port')
args = parser.parse_args()
if args.launch_adapter:
lldb = args.lldb or 'lldb'
cmd = [lldb, '-b',
'-O', 'command script import %s' % args.launch_adapter,
'-O', 'script import ptvsd; ptvsd.enable_attach(address=("0.0.0.0", 3000)); ptvsd.wait_for_attach(); adapter.run_tcp_session(4711)',
]
print('Launching', cmd)
subprocess.Popen(cmd, preexec_fn=lambda: os.setsid())
if args.wait_port:
port = int(args.wait_port)
print('Waiting for port %d' % port)
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
while True:
result = sock.connect_ex(('127.0.0.1', port))
if result == 0:
break
time.sleep(0.5)
print('Port opened')
sock.shutdown(socket.SHUT_WR)
sock.close()
## Instruction:
Fix python debugging on Windows.
## Code After:
from __future__ import print_function
import sys
import os
import time
import socket
import argparse
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument('--launch-adapter')
parser.add_argument('--lldb')
parser.add_argument('--wait-port')
args = parser.parse_args()
if args.launch_adapter:
lldb = args.lldb or 'lldb'
cmd = [lldb, '-b',
'-O', 'command script import %s' % args.launch_adapter,
'-O', 'script sys.argv=["lldb"]; import ptvsd; ptvsd.enable_attach(address=("0.0.0.0", 3000)); ptvsd.wait_for_attach()',
'-O', 'script adapter.run_tcp_session(4711)',
]
print('Launching', cmd)
if sys.platform != 'win32':
subprocess.Popen(cmd, preexec_fn=lambda: os.setsid())
else:
subprocess.Popen(cmd, creationflags=subprocess.CREATE_NEW_CONSOLE)
if args.wait_port:
port = int(args.wait_port)
print('Waiting for port %d' % port)
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
while True:
result = sock.connect_ex(('127.0.0.1', port))
if result == 0:
break
time.sleep(0.5)
print('Port opened')
sock.shutdown(socket.SHUT_WR)
sock.close()
|
fcae7875b3c7e91a1419c8b6d19204c56ace0911 | src/index.jsx | src/index.jsx | import React from 'react';
import { render } from 'react-dom';
const App = () => <h1>Hello Tabio</h1>;
render(<App />, document.getElementById('root'));
| import React, { Component } from 'react';
import { render } from 'react-dom';
class App extends Component {
constructor(props) {
super(props);
this.state = { foo: 'bar' };
}
render() {
return (
<h1>
{this.state.foo}
</h1>
);
}
}
render(<App />, document.getElementById('root'));
| Convert App into a stateful component | Convert App into a stateful component
| JSX | mit | colebemis/tabio,colebemis/tabio | jsx | ## Code Before:
import React from 'react';
import { render } from 'react-dom';
const App = () => <h1>Hello Tabio</h1>;
render(<App />, document.getElementById('root'));
## Instruction:
Convert App into a stateful component
## Code After:
import React, { Component } from 'react';
import { render } from 'react-dom';
class App extends Component {
constructor(props) {
super(props);
this.state = { foo: 'bar' };
}
render() {
return (
<h1>
{this.state.foo}
</h1>
);
}
}
render(<App />, document.getElementById('root'));
|
ef02305eb909ebd0878d931f68133e96ec6b0521 | config/newemacs/settings/helm-settings.el | config/newemacs/settings/helm-settings.el | (use-package helm
:config
(setq helm-split-window-default-side 'below)
(helm-mode 1)
:bind
(("M-x" . helm-M-x)))
(use-package helm-ls-git
:config
(progn
(use-package evil-leader
:config
(define-key helm-map (kbd "<tab>") 'helm-execute-persistent-action)
(evil-leader/set-key
"ff" 'helm-find-files
"fr" 'helm-recentf
"bb" 'helm-buffers-list
"fp" 'helm-browse-project))))
(provide 'helm-settings)
| (use-package helm
:config
(setq helm-split-window-default-side 'below)
(helm-mode 1)
:bind
(("M-x" . helm-M-x)))
(use-package helm-ls-git
:config
(progn
(use-package evil-leader
:config
(setq recentf-max-menu-items 1000)
(define-key helm-map (kbd "<tab>") 'helm-execute-persistent-action)
(evil-leader/set-key
"ff" 'helm-find-files
"fr" 'helm-recentf
"bb" 'helm-buffers-list
"fp" 'helm-browse-project))))
(provide 'helm-settings)
| Set the number of recenf files list | Set the number of recenf files list
| Emacs Lisp | mit | rogerzanoni/dotfiles | emacs-lisp | ## Code Before:
(use-package helm
:config
(setq helm-split-window-default-side 'below)
(helm-mode 1)
:bind
(("M-x" . helm-M-x)))
(use-package helm-ls-git
:config
(progn
(use-package evil-leader
:config
(define-key helm-map (kbd "<tab>") 'helm-execute-persistent-action)
(evil-leader/set-key
"ff" 'helm-find-files
"fr" 'helm-recentf
"bb" 'helm-buffers-list
"fp" 'helm-browse-project))))
(provide 'helm-settings)
## Instruction:
Set the number of recenf files list
## Code After:
(use-package helm
:config
(setq helm-split-window-default-side 'below)
(helm-mode 1)
:bind
(("M-x" . helm-M-x)))
(use-package helm-ls-git
:config
(progn
(use-package evil-leader
:config
(setq recentf-max-menu-items 1000)
(define-key helm-map (kbd "<tab>") 'helm-execute-persistent-action)
(evil-leader/set-key
"ff" 'helm-find-files
"fr" 'helm-recentf
"bb" 'helm-buffers-list
"fp" 'helm-browse-project))))
(provide 'helm-settings)
|
9dd459e0f75762a4661bed1afe50251727fad788 | recursion-vs-iteration/recursion_matt.rb | recursion-vs-iteration/recursion_matt.rb | def is_prime?(num)
factors = []
range = (2..num-1).to_a
if num == 1
return false
elsif num == 2
return true
elsif lowest_factor(num) == nil
return true
else
range.each do | poss_factor |
if num % poss_factor == 0
factors << poss_factor
end
end
if factors.length == 0
return true
else
return false
end
end
end | require "benchmark"
def all_prime_factors_recursive(num, factors = [])
return nil if num == 1
return factors << num if is_prime?(num) # base case: breaks the recursion
# base case must be conditional
factors << lowest_factor(num)
num = num / lowest_factor(num)
all_prime_factors_recursive(num, factors) # the recursion
end
def is_prime?(num)
factors = []
range = (2..num-1).to_a
if num == 1
return false
elsif num == 2
return true
elsif lowest_factor(num) == nil
return true
else
range.each do | poss_factor |
if num % poss_factor == 0
factors << poss_factor
end
end
if factors.length == 0
return true
else
return false
end
end
end
def lowest_factor(num)
range = (2..num-1).to_a
return range.find { |poss_factor| (num % poss_factor) == 0 } #finds the first possible factor
end
puts Benchmark.measure{all_prime_factors_recursive(123123123)} | Add benchmark and working recursion solution | Add benchmark and working recursion solution
| Ruby | mit | codemecurtis/sealions-evening-review-sessions | ruby | ## Code Before:
def is_prime?(num)
factors = []
range = (2..num-1).to_a
if num == 1
return false
elsif num == 2
return true
elsif lowest_factor(num) == nil
return true
else
range.each do | poss_factor |
if num % poss_factor == 0
factors << poss_factor
end
end
if factors.length == 0
return true
else
return false
end
end
end
## Instruction:
Add benchmark and working recursion solution
## Code After:
require "benchmark"
def all_prime_factors_recursive(num, factors = [])
return nil if num == 1
return factors << num if is_prime?(num) # base case: breaks the recursion
# base case must be conditional
factors << lowest_factor(num)
num = num / lowest_factor(num)
all_prime_factors_recursive(num, factors) # the recursion
end
def is_prime?(num)
factors = []
range = (2..num-1).to_a
if num == 1
return false
elsif num == 2
return true
elsif lowest_factor(num) == nil
return true
else
range.each do | poss_factor |
if num % poss_factor == 0
factors << poss_factor
end
end
if factors.length == 0
return true
else
return false
end
end
end
def lowest_factor(num)
range = (2..num-1).to_a
return range.find { |poss_factor| (num % poss_factor) == 0 } #finds the first possible factor
end
puts Benchmark.measure{all_prime_factors_recursive(123123123)} |
e3d3378c4e7363b80d9995f843585a768585c1db | pycon/templates/account/base.html | pycon/templates/account/base.html | {% extends "site_base.html" %}
{% load url from future %}
{% load i18n %}
{% block body_class %}account{% endblock %}
{% block page_content %}
<div class="container">
<div class="row">
<aside class="list span3">
<ul class="nav nav-list">
<li class="nav-header">{% trans "Account" %}</li>
<li><a href="{% url "account_settings" %}">{% trans "Settings" %}</a></li>
<li><a href="{% url "account_password" %}">{% trans "Change password" %}</a></li>
<li><a href="{% url "social_auth_associations" %}">{% trans "Associations" %}</a></li>
<li><a href="{% url "account_delete" %}">{% trans "Delete account" %}</a></li>
</ul>
</aside>
<div class="span8">
{% block body %}{% endblock %}
</div>
</div>
</div>
{% endblock %}
| {% extends "site_base.html" %}
{% load url from future %}
{% load i18n %}
{% block body_class %}account{% endblock %}
{% block page_content %}
<aside>
<h3>{% trans "Settings" %}</h3>
<ul class="nav nav-list">
<li><a href="{% url "account_settings" %}">{% trans "Preferences" %}</a></li>
<li><a href="{% url "account_password" %}">{% trans "Change password" %}</a></li>
<li><a href="{% url "social_auth_associations" %}">{% trans "Associations" %}</a></li>
<li><a href="{% url "account_delete" %}">{% trans "Delete account" %}</a></li>
</ul>
</aside>
{% block body %}{% endblock %}
{% endblock %}
| Improve slightly the nav for the settings pages | Improve slightly the nav for the settings pages
| HTML | bsd-3-clause | PyCon/pycon,PyCon/pycon,PyCon/pycon,PyCon/pycon | html | ## Code Before:
{% extends "site_base.html" %}
{% load url from future %}
{% load i18n %}
{% block body_class %}account{% endblock %}
{% block page_content %}
<div class="container">
<div class="row">
<aside class="list span3">
<ul class="nav nav-list">
<li class="nav-header">{% trans "Account" %}</li>
<li><a href="{% url "account_settings" %}">{% trans "Settings" %}</a></li>
<li><a href="{% url "account_password" %}">{% trans "Change password" %}</a></li>
<li><a href="{% url "social_auth_associations" %}">{% trans "Associations" %}</a></li>
<li><a href="{% url "account_delete" %}">{% trans "Delete account" %}</a></li>
</ul>
</aside>
<div class="span8">
{% block body %}{% endblock %}
</div>
</div>
</div>
{% endblock %}
## Instruction:
Improve slightly the nav for the settings pages
## Code After:
{% extends "site_base.html" %}
{% load url from future %}
{% load i18n %}
{% block body_class %}account{% endblock %}
{% block page_content %}
<aside>
<h3>{% trans "Settings" %}</h3>
<ul class="nav nav-list">
<li><a href="{% url "account_settings" %}">{% trans "Preferences" %}</a></li>
<li><a href="{% url "account_password" %}">{% trans "Change password" %}</a></li>
<li><a href="{% url "social_auth_associations" %}">{% trans "Associations" %}</a></li>
<li><a href="{% url "account_delete" %}">{% trans "Delete account" %}</a></li>
</ul>
</aside>
{% block body %}{% endblock %}
{% endblock %}
|
6442380a52b5a108449eda763710fd332f030b70 | app/controllers/georgia/application_controller.rb | app/controllers/georgia/application_controller.rb | module Georgia
class ApplicationController < ActionController::Base
# Required otherwise get the error 'uninitialized Ability'
# require 'devise'
helper 'georgia/ui'
helper 'georgia/internationalization'
helper 'georgia/form_actions'
helper 'georgia/routes'
protect_from_forgery
before_filter :authenticate_user!, except: :login
def login
render 'users/sessions/new'
end
def current_ability
@current_ability ||= Georgia::Ability.new(current_user)
end
end
end
| module Georgia
class ApplicationController < ActionController::Base
# Required otherwise get the error 'uninitialized Ability'
# require 'devise'
layout 'georgia/application'
helper 'georgia/ui'
helper 'georgia/internationalization'
helper 'georgia/form_actions'
helper 'georgia/routes'
protect_from_forgery
before_filter :authenticate_user!, except: :login
def login
render 'users/sessions/new'
end
def current_ability
@current_ability ||= Georgia::Ability.new(current_user)
end
end
end
| Set the layout on application | Set the layout on application
| Ruby | mit | georgia-cms/georgia,georgia-cms/georgia,georgia-cms/georgia | ruby | ## Code Before:
module Georgia
class ApplicationController < ActionController::Base
# Required otherwise get the error 'uninitialized Ability'
# require 'devise'
helper 'georgia/ui'
helper 'georgia/internationalization'
helper 'georgia/form_actions'
helper 'georgia/routes'
protect_from_forgery
before_filter :authenticate_user!, except: :login
def login
render 'users/sessions/new'
end
def current_ability
@current_ability ||= Georgia::Ability.new(current_user)
end
end
end
## Instruction:
Set the layout on application
## Code After:
module Georgia
class ApplicationController < ActionController::Base
# Required otherwise get the error 'uninitialized Ability'
# require 'devise'
layout 'georgia/application'
helper 'georgia/ui'
helper 'georgia/internationalization'
helper 'georgia/form_actions'
helper 'georgia/routes'
protect_from_forgery
before_filter :authenticate_user!, except: :login
def login
render 'users/sessions/new'
end
def current_ability
@current_ability ||= Georgia::Ability.new(current_user)
end
end
end
|
d52ac2465f287262808a2323abab59aa042b0699 | Tasks/XamarinAndroid/make.json | Tasks/XamarinAndroid/make.json | {
"common": [
{
"module": "../Common/MSBuildHelpers",
"type": "ps"
},
{
"module": "../Common/MSBuildHelpers",
"type": "node",
"compile": true
}
],
"rm": [
{
"items": [
"node_modules/msbuildhelpers/node_modules/vsts-task-lib"
],
"options": "-Rf"
}
],
"externals": {
"nugetv2": [
{
"name": "VstsTaskSdk",
"version": "0.7.1",
"repository": "https://www.powershellgallery.com/api/v2/",
"cp": [
{
"source": [
"*.ps1",
"*.psd1",
"*.psm1",
"lib.json",
"Strings"
],
"dest": "ps_modules/VstsTaskSdk/",
"options": "-R"
}
]
}
]
}
} | {
"common": [
{
"module": "../Common/MSBuildHelpers",
"type": "ps"
},
{
"module": "../Common/MSBuildHelpers",
"type": "node",
"compile": true
}
],
"rm": [
{
"items": [
"node_modules/msbuildhelpers/node_modules/vsts-task-lib"
],
"options": "-Rf"
}
],
"externals": {
"nugetv2": [
{
"name": "VstsTaskSdk",
"version": "0.8.2",
"repository": "https://www.powershellgallery.com/api/v2/",
"cp": [
{
"source": [
"*.dll",
"*.ps1",
"*.psd1",
"*.psm1",
"lib.json",
"Strings"
],
"dest": "ps_modules/VstsTaskSdk/",
"options": "-R"
}
]
}
]
}
} | Fix XamarinAndroid's 64k environment variable limit issue | Fix XamarinAndroid's 64k environment variable limit issue
| JSON | mit | grawcho/vso-agent-tasks,aldoms/vsts-tasks,jotaylo/vsts-tasks,aldoms/vsts-tasks,grawcho/vso-agent-tasks,Microsoft/vsts-tasks,pascalberger/vso-agent-tasks,Microsoft/vsts-tasks,grawcho/vso-agent-tasks,jotaylo/vsts-tasks,dylan-smith/vso-agent-tasks,dylan-smith/vso-agent-tasks,grawcho/vso-agent-tasks,vithati/vsts-tasks,vithati/vsts-tasks,grawcho/vso-agent-tasks,grawcho/vso-agent-tasks,Microsoft/vso-agent-tasks,Microsoft/vsts-tasks,pascalberger/vso-agent-tasks,Microsoft/vso-agent-tasks,dylan-smith/vso-agent-tasks,Microsoft/vsts-tasks,dylan-smith/vso-agent-tasks,pascalberger/vso-agent-tasks,pascalberger/vso-agent-tasks,Microsoft/vsts-tasks,jotaylo/vsts-tasks,vithati/vsts-tasks,vithati/vsts-tasks,aldoms/vsts-tasks,Microsoft/vso-agent-tasks,jotaylo/vsts-tasks,aldoms/vsts-tasks,aldoms/vsts-tasks,dylan-smith/vso-agent-tasks,vithati/vsts-tasks,jotaylo/vsts-tasks,pascalberger/vso-agent-tasks | json | ## Code Before:
{
"common": [
{
"module": "../Common/MSBuildHelpers",
"type": "ps"
},
{
"module": "../Common/MSBuildHelpers",
"type": "node",
"compile": true
}
],
"rm": [
{
"items": [
"node_modules/msbuildhelpers/node_modules/vsts-task-lib"
],
"options": "-Rf"
}
],
"externals": {
"nugetv2": [
{
"name": "VstsTaskSdk",
"version": "0.7.1",
"repository": "https://www.powershellgallery.com/api/v2/",
"cp": [
{
"source": [
"*.ps1",
"*.psd1",
"*.psm1",
"lib.json",
"Strings"
],
"dest": "ps_modules/VstsTaskSdk/",
"options": "-R"
}
]
}
]
}
}
## Instruction:
Fix XamarinAndroid's 64k environment variable limit issue
## Code After:
{
"common": [
{
"module": "../Common/MSBuildHelpers",
"type": "ps"
},
{
"module": "../Common/MSBuildHelpers",
"type": "node",
"compile": true
}
],
"rm": [
{
"items": [
"node_modules/msbuildhelpers/node_modules/vsts-task-lib"
],
"options": "-Rf"
}
],
"externals": {
"nugetv2": [
{
"name": "VstsTaskSdk",
"version": "0.8.2",
"repository": "https://www.powershellgallery.com/api/v2/",
"cp": [
{
"source": [
"*.dll",
"*.ps1",
"*.psd1",
"*.psm1",
"lib.json",
"Strings"
],
"dest": "ps_modules/VstsTaskSdk/",
"options": "-R"
}
]
}
]
}
} |
19543d9456fddad5d3719c3c9db9fb058be9742f | package.json | package.json | {
"name": "jstreegrid",
"description": "grid plugin for jstree",
"version": "3.5.30",
"url": "https://github.com/deitch/jstree-grid",
"author": {"name":"Avi Deitcher","url":"https://github.com/deitch"},
"contributors": [
{
"name": "jochenberger",
"url": "https://github.com/jochenberger"
},
{
"name": "ChrisRaven",
"url": "https://github.com/ChrisRaven"
},
{
"name": "Brabus",
"url": "https://github.com/side-by-side"
},
{
"name": "Adam Jimenez",
"url": "https://github.com/adamjimenez"
},
{
"name": "QueroBartk",
"url": "https://github.com/QueroBartK"
}
],
"dependencies": {
"jstree":">=3.0.0"
},
"keywords":[
"jquery",
"jstree",
"grid",
"javascript"
],
"repository": {
"type" : "git",
"url" : "http://github.com/deitch/jstree-grid.git"
},
"license" : "MIT"
}
| {
"name": "jstreegrid",
"description": "grid plugin for jstree",
"version": "3.6.0",
"url": "https://github.com/deitch/jstree-grid",
"author": {"name":"Avi Deitcher","url":"https://github.com/deitch"},
"contributors": [
{
"name": "jochenberger",
"url": "https://github.com/jochenberger"
},
{
"name": "ChrisRaven",
"url": "https://github.com/ChrisRaven"
},
{
"name": "Brabus",
"url": "https://github.com/side-by-side"
},
{
"name": "Adam Jimenez",
"url": "https://github.com/adamjimenez"
},
{
"name": "QueroBartk",
"url": "https://github.com/QueroBartK"
},
{
"name": "OgreTransporter",
"url": "https://github.com/OgreTransporter"
}
],
"dependencies": {
"jstree":">=3.0.0"
},
"keywords":[
"jquery",
"jstree",
"grid",
"javascript"
],
"repository": {
"type" : "git",
"url" : "http://github.com/deitch/jstree-grid.git"
},
"license" : "MIT"
}
| Bump version number, add OgreTransporter as contributor | Bump version number, add OgreTransporter as contributor
| JSON | mit | deitch/jstree-grid,deitch/jstree-grid,deitch/jstree-grid | json | ## Code Before:
{
"name": "jstreegrid",
"description": "grid plugin for jstree",
"version": "3.5.30",
"url": "https://github.com/deitch/jstree-grid",
"author": {"name":"Avi Deitcher","url":"https://github.com/deitch"},
"contributors": [
{
"name": "jochenberger",
"url": "https://github.com/jochenberger"
},
{
"name": "ChrisRaven",
"url": "https://github.com/ChrisRaven"
},
{
"name": "Brabus",
"url": "https://github.com/side-by-side"
},
{
"name": "Adam Jimenez",
"url": "https://github.com/adamjimenez"
},
{
"name": "QueroBartk",
"url": "https://github.com/QueroBartK"
}
],
"dependencies": {
"jstree":">=3.0.0"
},
"keywords":[
"jquery",
"jstree",
"grid",
"javascript"
],
"repository": {
"type" : "git",
"url" : "http://github.com/deitch/jstree-grid.git"
},
"license" : "MIT"
}
## Instruction:
Bump version number, add OgreTransporter as contributor
## Code After:
{
"name": "jstreegrid",
"description": "grid plugin for jstree",
"version": "3.6.0",
"url": "https://github.com/deitch/jstree-grid",
"author": {"name":"Avi Deitcher","url":"https://github.com/deitch"},
"contributors": [
{
"name": "jochenberger",
"url": "https://github.com/jochenberger"
},
{
"name": "ChrisRaven",
"url": "https://github.com/ChrisRaven"
},
{
"name": "Brabus",
"url": "https://github.com/side-by-side"
},
{
"name": "Adam Jimenez",
"url": "https://github.com/adamjimenez"
},
{
"name": "QueroBartk",
"url": "https://github.com/QueroBartK"
},
{
"name": "OgreTransporter",
"url": "https://github.com/OgreTransporter"
}
],
"dependencies": {
"jstree":">=3.0.0"
},
"keywords":[
"jquery",
"jstree",
"grid",
"javascript"
],
"repository": {
"type" : "git",
"url" : "http://github.com/deitch/jstree-grid.git"
},
"license" : "MIT"
}
|
fe9699fea8d10cce1c04b8ff70baf327d3e6bf13 | lib/yeb/http_request_handler.rb | lib/yeb/http_request_handler.rb | module Yeb
class HTTPRequestHandler
attr_reader :app_manager
def initialize
@app_manager = AppManager.new
end
def get_response(request)
hostname = Hostname.from_http_request(request)
app = app_manager.get_app_for_hostname(hostname)
socket = app.socket
socket.send(request, 0)
response = socket.recv(4 * 1024 * 1024)
socket.close
response
rescue AppNotFoundError => e
Response.new do |r|
r.status = 404
r.body = Template.render(:app_not_found_error, {
:app_name => e.app_name
})
end
rescue AppStartFailedError => e
Response.new do |r|
r.status = 502
r.body = Template.render(:app_start_failed_error, {
:app_name => e.app_name,
:stdout => e.stdout
})
end
rescue => e
Response.new do |r|
r.status = 500
r.body = Template.render(:unknown_error, { :exception => e })
end
end
end
end
| module Yeb
class HTTPRequestHandler
attr_reader :apps_dir, :sockets_dir
def initialize(apps_dir, sockets_dir)
@apps_dir = apps_dir
@sockets_dir = sockets_dir
end
def get_response(request)
hostname = Hostname.from_http_request(request)
vhost = VirtualHost.new(hostname, apps_dir, sockets_dir)
socket = vhost.socket
socket.send(request, 0)
response = socket.recv(4 * 1024 * 1024)
socket.close
response
rescue AppNotFoundError => e
Response.new do |r|
r.status = 404
r.body = Template.render(:app_not_found_error, {
:app_name => e.app_name
})
end
rescue AppStartFailedError => e
Response.new do |r|
r.status = 502
r.body = Template.render(:app_start_failed_error, {
:app_name => e.app_name,
:stdout => e.stdout
})
end
rescue => e
Response.new do |r|
r.status = 500
r.body = Template.render(:unknown_error, { :exception => e })
end
end
end
end
| Use VirtualHost instead of AppManager | Use VirtualHost instead of AppManager
| Ruby | mit | sickill/yeb,sickill/yeb | ruby | ## Code Before:
module Yeb
class HTTPRequestHandler
attr_reader :app_manager
def initialize
@app_manager = AppManager.new
end
def get_response(request)
hostname = Hostname.from_http_request(request)
app = app_manager.get_app_for_hostname(hostname)
socket = app.socket
socket.send(request, 0)
response = socket.recv(4 * 1024 * 1024)
socket.close
response
rescue AppNotFoundError => e
Response.new do |r|
r.status = 404
r.body = Template.render(:app_not_found_error, {
:app_name => e.app_name
})
end
rescue AppStartFailedError => e
Response.new do |r|
r.status = 502
r.body = Template.render(:app_start_failed_error, {
:app_name => e.app_name,
:stdout => e.stdout
})
end
rescue => e
Response.new do |r|
r.status = 500
r.body = Template.render(:unknown_error, { :exception => e })
end
end
end
end
## Instruction:
Use VirtualHost instead of AppManager
## Code After:
module Yeb
class HTTPRequestHandler
attr_reader :apps_dir, :sockets_dir
def initialize(apps_dir, sockets_dir)
@apps_dir = apps_dir
@sockets_dir = sockets_dir
end
def get_response(request)
hostname = Hostname.from_http_request(request)
vhost = VirtualHost.new(hostname, apps_dir, sockets_dir)
socket = vhost.socket
socket.send(request, 0)
response = socket.recv(4 * 1024 * 1024)
socket.close
response
rescue AppNotFoundError => e
Response.new do |r|
r.status = 404
r.body = Template.render(:app_not_found_error, {
:app_name => e.app_name
})
end
rescue AppStartFailedError => e
Response.new do |r|
r.status = 502
r.body = Template.render(:app_start_failed_error, {
:app_name => e.app_name,
:stdout => e.stdout
})
end
rescue => e
Response.new do |r|
r.status = 500
r.body = Template.render(:unknown_error, { :exception => e })
end
end
end
end
|
7872a2327f9dea7d4c1f5a3054b6be6bba25fdd4 | scripts/migration/migrate_deleted_wikis.py | scripts/migration/migrate_deleted_wikis.py | import logging
import sys
from modularodm import Q
from framework.transactions.context import TokuTransaction
from website.app import init_app
from website.models import NodeLog
from scripts import utils as script_utils
logger = logging.getLogger(__name__)
def get_targets():
return NodeLog.find(Q('action', 'eq', NodeLog.WIKI_DELETED))
def migrate(targets, dry_run=True):
# iterate over targets
for log in targets:
node = log.node
versions = node.wiki_pages_versions
current = node.wiki_pages_current
updated_versions = {}
for wiki in versions:
if wiki in current:
updated_versions[wiki] = versions[wiki]
with TokuTransaction():
node.wiki_pages_versions = updated_versions
node.save()
if dry_run:
raise RuntimeError('Dry run, transaction rolled back.')
def main():
dry_run = False
if '--dry' in sys.argv:
dry_run = True
if not dry_run:
script_utils.add_file_logger(logger, __file__)
init_app(set_backends=True, routes=False)
with TokuTransaction():
migrate(targets=get_targets(), dry_run=dry_run)
if __name__ == "__main__":
main()
| import logging
import sys
from modularodm import Q
from framework.transactions.context import TokuTransaction
from website.app import init_app
from website.models import NodeLog
from scripts import utils as script_utils
logger = logging.getLogger(__name__)
def get_targets():
return NodeLog.find(Q('action', 'eq', NodeLog.WIKI_DELETED))
def migrate(targets, dry_run=True):
# iterate over targets
for log in targets:
node = log.node
versions = node.wiki_pages_versions
current = node.wiki_pages_current
updated_versions = {}
for wiki in versions:
if wiki in current:
updated_versions[wiki] = versions[wiki]
node.wiki_pages_versions = updated_versions
node.save()
def main():
dry_run = False
if '--dry' in sys.argv:
dry_run = True
if not dry_run:
script_utils.add_file_logger(logger, __file__)
init_app(set_backends=True, routes=False)
with TokuTransaction():
migrate(targets=get_targets(), dry_run=dry_run)
if dry_run:
raise RuntimeError('Dry run, transaction rolled back.')
if __name__ == "__main__":
main()
| Remove TokuTransaction in migrate function | Remove TokuTransaction in migrate function
| Python | apache-2.0 | hmoco/osf.io,samchrisinger/osf.io,hmoco/osf.io,icereval/osf.io,caneruguz/osf.io,cwisecarver/osf.io,chrisseto/osf.io,erinspace/osf.io,SSJohns/osf.io,monikagrabowska/osf.io,crcresearch/osf.io,crcresearch/osf.io,laurenrevere/osf.io,leb2dg/osf.io,crcresearch/osf.io,baylee-d/osf.io,leb2dg/osf.io,saradbowman/osf.io,sloria/osf.io,felliott/osf.io,mluke93/osf.io,adlius/osf.io,SSJohns/osf.io,mluke93/osf.io,binoculars/osf.io,mluo613/osf.io,felliott/osf.io,amyshi188/osf.io,brianjgeiger/osf.io,Johnetordoff/osf.io,mfraezz/osf.io,DanielSBrown/osf.io,mluo613/osf.io,erinspace/osf.io,adlius/osf.io,mluke93/osf.io,acshi/osf.io,abought/osf.io,wearpants/osf.io,laurenrevere/osf.io,wearpants/osf.io,cslzchen/osf.io,mattclark/osf.io,rdhyee/osf.io,binoculars/osf.io,hmoco/osf.io,laurenrevere/osf.io,monikagrabowska/osf.io,baylee-d/osf.io,hmoco/osf.io,emetsger/osf.io,saradbowman/osf.io,mfraezz/osf.io,TomBaxter/osf.io,Nesiehr/osf.io,rdhyee/osf.io,abought/osf.io,abought/osf.io,rdhyee/osf.io,leb2dg/osf.io,DanielSBrown/osf.io,aaxelb/osf.io,samchrisinger/osf.io,chrisseto/osf.io,caseyrollins/osf.io,felliott/osf.io,alexschiller/osf.io,DanielSBrown/osf.io,Nesiehr/osf.io,amyshi188/osf.io,chrisseto/osf.io,brianjgeiger/osf.io,Johnetordoff/osf.io,mluo613/osf.io,rdhyee/osf.io,felliott/osf.io,abought/osf.io,samchrisinger/osf.io,alexschiller/osf.io,baylee-d/osf.io,Johnetordoff/osf.io,monikagrabowska/osf.io,cslzchen/osf.io,brianjgeiger/osf.io,mluo613/osf.io,DanielSBrown/osf.io,TomBaxter/osf.io,HalcyonChimera/osf.io,acshi/osf.io,TomBaxter/osf.io,emetsger/osf.io,adlius/osf.io,caseyrollins/osf.io,CenterForOpenScience/osf.io,wearpants/osf.io,emetsger/osf.io,monikagrabowska/osf.io,acshi/osf.io,aaxelb/osf.io,SSJohns/osf.io,brianjgeiger/osf.io,amyshi188/osf.io,chennan47/osf.io,sloria/osf.io,icereval/osf.io,mattclark/osf.io,alexschiller/osf.io,monikagrabowska/osf.io,binoculars/osf.io,wearpants/osf.io,samchrisinger/osf.io,HalcyonChimera/osf.io,amyshi188/osf.io,chrisseto/osf.io,cwisecarver/osf.io,aaxelb/osf.io,erinspace/osf.io,cslzchen/osf.io,aaxelb/osf.io,caneruguz/osf.io,pattisdr/osf.io,mluo613/osf.io,cwisecarver/osf.io,alexschiller/osf.io,chennan47/osf.io,pattisdr/osf.io,CenterForOpenScience/osf.io,CenterForOpenScience/osf.io,sloria/osf.io,mattclark/osf.io,mfraezz/osf.io,Nesiehr/osf.io,emetsger/osf.io,HalcyonChimera/osf.io,Johnetordoff/osf.io,leb2dg/osf.io,cslzchen/osf.io,pattisdr/osf.io,SSJohns/osf.io,icereval/osf.io,caneruguz/osf.io,alexschiller/osf.io,chennan47/osf.io,acshi/osf.io,caseyrollins/osf.io,mluke93/osf.io,CenterForOpenScience/osf.io,adlius/osf.io,HalcyonChimera/osf.io,Nesiehr/osf.io,acshi/osf.io,caneruguz/osf.io,mfraezz/osf.io,cwisecarver/osf.io | python | ## Code Before:
import logging
import sys
from modularodm import Q
from framework.transactions.context import TokuTransaction
from website.app import init_app
from website.models import NodeLog
from scripts import utils as script_utils
logger = logging.getLogger(__name__)
def get_targets():
return NodeLog.find(Q('action', 'eq', NodeLog.WIKI_DELETED))
def migrate(targets, dry_run=True):
# iterate over targets
for log in targets:
node = log.node
versions = node.wiki_pages_versions
current = node.wiki_pages_current
updated_versions = {}
for wiki in versions:
if wiki in current:
updated_versions[wiki] = versions[wiki]
with TokuTransaction():
node.wiki_pages_versions = updated_versions
node.save()
if dry_run:
raise RuntimeError('Dry run, transaction rolled back.')
def main():
dry_run = False
if '--dry' in sys.argv:
dry_run = True
if not dry_run:
script_utils.add_file_logger(logger, __file__)
init_app(set_backends=True, routes=False)
with TokuTransaction():
migrate(targets=get_targets(), dry_run=dry_run)
if __name__ == "__main__":
main()
## Instruction:
Remove TokuTransaction in migrate function
## Code After:
import logging
import sys
from modularodm import Q
from framework.transactions.context import TokuTransaction
from website.app import init_app
from website.models import NodeLog
from scripts import utils as script_utils
logger = logging.getLogger(__name__)
def get_targets():
return NodeLog.find(Q('action', 'eq', NodeLog.WIKI_DELETED))
def migrate(targets, dry_run=True):
# iterate over targets
for log in targets:
node = log.node
versions = node.wiki_pages_versions
current = node.wiki_pages_current
updated_versions = {}
for wiki in versions:
if wiki in current:
updated_versions[wiki] = versions[wiki]
node.wiki_pages_versions = updated_versions
node.save()
def main():
dry_run = False
if '--dry' in sys.argv:
dry_run = True
if not dry_run:
script_utils.add_file_logger(logger, __file__)
init_app(set_backends=True, routes=False)
with TokuTransaction():
migrate(targets=get_targets(), dry_run=dry_run)
if dry_run:
raise RuntimeError('Dry run, transaction rolled back.')
if __name__ == "__main__":
main()
|
ff163b3489429880058024f7c85884da5c0070df | docs/withdraw.rst | docs/withdraw.rst | Withdraw Endpoints
==================
`Place a withdrawal <binance.html#binance.client.Client.withdraw>`_
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Make sure you enable Withdrawal permissions for your API Key to use this call.
You must have withdrawn to the address through the website and approved the withdraw via email before you can withdraw using the API.
Raises a `BinanceWithdrawException <binance.html#binance.exceptions.BinanceWithdrawException>`_ if the withdraw fails.
.. code:: python
from binance.exceptions import BinanceApiException, BinanceWithdrawException
try:
result = client.withdraw(
asset='ETH',
address='<eth_address>',
amount=100)
except BinanceApiException as e:
print(e)
except BinanceWithdrawException as e:
print(e)
else:
print("Success")
`Fetch deposit history <binance.html#binance.client.Client.get_deposit_history>`_
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code:: python
deposits = client.get_deposit_history()
btc_deposits = client.get_deposit_history(asset='BTC')
`Fetch withdraw history <binance.html#binance.client.Client.get_withdraw_history>`_
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code:: python
withdraws = client.get_withdraw_history()
btc_withdraws = client.get_withdraw_history(asset='BTC')
| Withdraw Endpoints
==================
`Place a withdrawal <binance.html#binance.client.Client.withdraw>`_
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Make sure you enable Withdrawal permissions for your API Key to use this call.
You must have withdrawn to the address through the website and approved the withdraw via email before you can withdraw using the API.
Raises a `BinanceWithdrawException <binance.html#binance.exceptions.BinanceWithdrawException>`_ if the withdraw fails.
.. code:: python
from binance.exceptions import BinanceApiException, BinanceWithdrawException
try:
result = client.withdraw(
asset='ETH',
address='<eth_address>',
amount=100)
except BinanceApiException as e:
print(e)
except BinanceWithdrawException as e:
print(e)
else:
print("Success")
`Fetch deposit history <binance.html#binance.client.Client.get_deposit_history>`_
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code:: python
deposits = client.get_deposit_history()
btc_deposits = client.get_deposit_history(asset='BTC')
`Fetch withdraw history <binance.html#binance.client.Client.get_withdraw_history>`_
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code:: python
withdraws = client.get_withdraw_history()
btc_withdraws = client.get_withdraw_history(asset='BTC')
`Get deposit address <binance.html#binance.client.Client.get_deposit_address>`_
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code:: python
address = client.get_deposit_address('BTC)
| Add documentation about deposit address endpoint | Add documentation about deposit address endpoint
| reStructuredText | mit | sammchardy/python-binance | restructuredtext | ## Code Before:
Withdraw Endpoints
==================
`Place a withdrawal <binance.html#binance.client.Client.withdraw>`_
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Make sure you enable Withdrawal permissions for your API Key to use this call.
You must have withdrawn to the address through the website and approved the withdraw via email before you can withdraw using the API.
Raises a `BinanceWithdrawException <binance.html#binance.exceptions.BinanceWithdrawException>`_ if the withdraw fails.
.. code:: python
from binance.exceptions import BinanceApiException, BinanceWithdrawException
try:
result = client.withdraw(
asset='ETH',
address='<eth_address>',
amount=100)
except BinanceApiException as e:
print(e)
except BinanceWithdrawException as e:
print(e)
else:
print("Success")
`Fetch deposit history <binance.html#binance.client.Client.get_deposit_history>`_
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code:: python
deposits = client.get_deposit_history()
btc_deposits = client.get_deposit_history(asset='BTC')
`Fetch withdraw history <binance.html#binance.client.Client.get_withdraw_history>`_
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code:: python
withdraws = client.get_withdraw_history()
btc_withdraws = client.get_withdraw_history(asset='BTC')
## Instruction:
Add documentation about deposit address endpoint
## Code After:
Withdraw Endpoints
==================
`Place a withdrawal <binance.html#binance.client.Client.withdraw>`_
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Make sure you enable Withdrawal permissions for your API Key to use this call.
You must have withdrawn to the address through the website and approved the withdraw via email before you can withdraw using the API.
Raises a `BinanceWithdrawException <binance.html#binance.exceptions.BinanceWithdrawException>`_ if the withdraw fails.
.. code:: python
from binance.exceptions import BinanceApiException, BinanceWithdrawException
try:
result = client.withdraw(
asset='ETH',
address='<eth_address>',
amount=100)
except BinanceApiException as e:
print(e)
except BinanceWithdrawException as e:
print(e)
else:
print("Success")
`Fetch deposit history <binance.html#binance.client.Client.get_deposit_history>`_
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code:: python
deposits = client.get_deposit_history()
btc_deposits = client.get_deposit_history(asset='BTC')
`Fetch withdraw history <binance.html#binance.client.Client.get_withdraw_history>`_
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code:: python
withdraws = client.get_withdraw_history()
btc_withdraws = client.get_withdraw_history(asset='BTC')
`Get deposit address <binance.html#binance.client.Client.get_deposit_address>`_
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code:: python
address = client.get_deposit_address('BTC)
|
17a6d0e65b319e6166bbad7fd0f79169f75ddcbb | recipes-kde-support/polkit-qt-1_git.bb | recipes-kde-support/polkit-qt-1_git.bb | LICENSE = "LGPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=7dbc59dc445b2261c4fb2f9466e3446a"
DEPENDS = "automoc4-native polkit"
RDEPENDS_${PN} = "libqtcore4 polkit"
inherit qt4x11 cmake
SRC_URI = "git://anongit.kde.org/polkit-qt-1.git;branch=master"
## Tag v0.103.0
SRCREV = "26045cb6da3efb1eba8612ef47ffa63da64ae9a0"
EXTRA_OECMAKE =+ "-DAUTOMOC4_EXECUTABLE=${STAGING_BINDIR_NATIVE}/automoc4 \
-DUSE_COMMON_CMAKE_PACKAGE_CONFIG_DIR=FALSE"
FILES_${PN}-dev = "${libdir}/PolkitQt-1/cmake"
PV = "v0.103.0+git${SRCPV}"
S = "${WORKDIR}/git"
| LICENSE = "LGPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=7dbc59dc445b2261c4fb2f9466e3446a"
DEPENDS = "automoc4-native polkit"
RDEPENDS_${PN} = "libqtcore4 polkit"
inherit qt4x11 cmake kde_exports
SRC_URI = "git://anongit.kde.org/polkit-qt-1.git;branch=master"
## Tag v0.103.0
SRCREV = "26045cb6da3efb1eba8612ef47ffa63da64ae9a0"
EXTRA_OECMAKE += "-DAUTOMOC4_EXECUTABLE=${STAGING_BINDIR_NATIVE}/automoc4 \
-DUSE_COMMON_CMAKE_PACKAGE_CONFIG_DIR=FALSE"
KDE_EXPORT_FILES = "${S}/PolkitQt-1Config.cmake"
FILES_${PN}-dev += "${libdir}/PolkitQt-1/cmake"
PV = "v0.103.0+git${SRCPV}"
S = "${WORKDIR}/git"
| Fix cmake search path for includes and libraries | polkit-qt-1: Fix cmake search path for includes and libraries
Signed-off-by: Samuel Stirtzel <[email protected]>
| BitBake | mit | Angstrom-distribution/meta-kde,koenkooi/meta-kde4,Angstrom-distribution/meta-kde,koenkooi/meta-kde4 | bitbake | ## Code Before:
LICENSE = "LGPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=7dbc59dc445b2261c4fb2f9466e3446a"
DEPENDS = "automoc4-native polkit"
RDEPENDS_${PN} = "libqtcore4 polkit"
inherit qt4x11 cmake
SRC_URI = "git://anongit.kde.org/polkit-qt-1.git;branch=master"
## Tag v0.103.0
SRCREV = "26045cb6da3efb1eba8612ef47ffa63da64ae9a0"
EXTRA_OECMAKE =+ "-DAUTOMOC4_EXECUTABLE=${STAGING_BINDIR_NATIVE}/automoc4 \
-DUSE_COMMON_CMAKE_PACKAGE_CONFIG_DIR=FALSE"
FILES_${PN}-dev = "${libdir}/PolkitQt-1/cmake"
PV = "v0.103.0+git${SRCPV}"
S = "${WORKDIR}/git"
## Instruction:
polkit-qt-1: Fix cmake search path for includes and libraries
Signed-off-by: Samuel Stirtzel <[email protected]>
## Code After:
LICENSE = "LGPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=7dbc59dc445b2261c4fb2f9466e3446a"
DEPENDS = "automoc4-native polkit"
RDEPENDS_${PN} = "libqtcore4 polkit"
inherit qt4x11 cmake kde_exports
SRC_URI = "git://anongit.kde.org/polkit-qt-1.git;branch=master"
## Tag v0.103.0
SRCREV = "26045cb6da3efb1eba8612ef47ffa63da64ae9a0"
EXTRA_OECMAKE += "-DAUTOMOC4_EXECUTABLE=${STAGING_BINDIR_NATIVE}/automoc4 \
-DUSE_COMMON_CMAKE_PACKAGE_CONFIG_DIR=FALSE"
KDE_EXPORT_FILES = "${S}/PolkitQt-1Config.cmake"
FILES_${PN}-dev += "${libdir}/PolkitQt-1/cmake"
PV = "v0.103.0+git${SRCPV}"
S = "${WORKDIR}/git"
|
7b1fcedb5b7915c849e260cd42a1e68d603d2276 | tests/index.js | tests/index.js |
'use strict';
const isPlainObj = require( 'is-plain-obj' );
test( 'index.js', () => {
const config = require( '../index.js' );
expect( isPlainObj( config ) ).toBe( true );
expect( Array.isArray( config.extends ) ).toBe( true );
expect( Array.isArray( config.plugins ) ).toBe( true );
expect( isPlainObj( config.rules ) ).toBe( true );
});
|
'use strict';
const isPlainObj = require( 'is-plain-obj' );
test( 'index.js', () => {
const config = require( '../index.js' );
expect( isPlainObj( config ) ).toBe( true );
expect( Array.isArray( config.extends ) ).toBe( true );
expect( isPlainObj( config.rules ) ).toBe( true );
});
| Fix test to not expect plugins to be defined | Fix test to not expect plugins to be defined
| JavaScript | mit | ChromatixAU/stylelint-config-chromatix | javascript | ## Code Before:
'use strict';
const isPlainObj = require( 'is-plain-obj' );
test( 'index.js', () => {
const config = require( '../index.js' );
expect( isPlainObj( config ) ).toBe( true );
expect( Array.isArray( config.extends ) ).toBe( true );
expect( Array.isArray( config.plugins ) ).toBe( true );
expect( isPlainObj( config.rules ) ).toBe( true );
});
## Instruction:
Fix test to not expect plugins to be defined
## Code After:
'use strict';
const isPlainObj = require( 'is-plain-obj' );
test( 'index.js', () => {
const config = require( '../index.js' );
expect( isPlainObj( config ) ).toBe( true );
expect( Array.isArray( config.extends ) ).toBe( true );
expect( isPlainObj( config.rules ) ).toBe( true );
});
|
cfec3971d9769bf02edc73a9535dbb5c1603397b | templates/results/case/list/_case_list_item.html | templates/results/case/list/_case_list_item.html | {% load url from future %}
{% load results filters %}
<article id="runcaseversion-id-{{ runcaseversion.id }}" class="listitem">
{% include "results/_status.html" with item=runcaseversion.caseversion %}
<header class="itemhead">
<div class="completion" data-perc="{{ runcaseversion.completion|percentage }}">{{ runcaseversion.completion|percentage|percentage }}</div>
<div class="name">
<h3 class="title" title="{{ runcaseversion.name }}">{{ runcaseversion.caseversion.name }}</h3>
</div>
<div class="run">{{ runcaseversion.run }}</div>
<div class="product-version">{{ runcaseversion.run.productversion }}</div>
{% url "results_results" rcv_id=runcaseversion.id as detail_url %}
{% include "results/_results_summary.html" with results=runcaseversion.result_summary %}
</header>
{% url results_runcaseversion_details runcaseversion.id as details_url %}
{# _case_details.html loaded via ajax #}
{% include "lists/_itembody.html" %}
</article>
| {% load url from future %}
{% load results filters %}
<article id="runcaseversion-id-{{ runcaseversion.id }}" class="listitem">
{% include "results/_status.html" with item=runcaseversion.caseversion %}
<header class="itemhead">
<div class="completion" data-perc="{{ runcaseversion.completion|percentage }}">{{ runcaseversion.completion|percentage }}</div>
<div class="name">
<h3 class="title" title="{{ runcaseversion.name }}">{{ runcaseversion.caseversion.name }}</h3>
</div>
<div class="run">{{ runcaseversion.run }}</div>
<div class="product-version">{{ runcaseversion.run.productversion }}</div>
{% url "results_results" rcv_id=runcaseversion.id as detail_url %}
{% include "results/_results_summary.html" with results=runcaseversion.result_summary %}
</header>
{% url results_runcaseversion_details runcaseversion.id as details_url %}
{# _case_details.html loaded via ajax #}
{% include "lists/_itembody.html" %}
</article>
| Fix double-application of percentage filter in results by case list. | Fix double-application of percentage filter in results by case list.
| HTML | bsd-2-clause | bobsilverberg/moztrap,mccarrmb/moztrap,mozilla/moztrap,mccarrmb/moztrap,shinglyu/moztrap,bobsilverberg/moztrap,shinglyu/moztrap,shinglyu/moztrap,mccarrmb/moztrap,mozilla/moztrap,shinglyu/moztrap,bobsilverberg/moztrap,shinglyu/moztrap,bobsilverberg/moztrap,mccarrmb/moztrap,mccarrmb/moztrap,mozilla/moztrap,mozilla/moztrap,mozilla/moztrap | html | ## Code Before:
{% load url from future %}
{% load results filters %}
<article id="runcaseversion-id-{{ runcaseversion.id }}" class="listitem">
{% include "results/_status.html" with item=runcaseversion.caseversion %}
<header class="itemhead">
<div class="completion" data-perc="{{ runcaseversion.completion|percentage }}">{{ runcaseversion.completion|percentage|percentage }}</div>
<div class="name">
<h3 class="title" title="{{ runcaseversion.name }}">{{ runcaseversion.caseversion.name }}</h3>
</div>
<div class="run">{{ runcaseversion.run }}</div>
<div class="product-version">{{ runcaseversion.run.productversion }}</div>
{% url "results_results" rcv_id=runcaseversion.id as detail_url %}
{% include "results/_results_summary.html" with results=runcaseversion.result_summary %}
</header>
{% url results_runcaseversion_details runcaseversion.id as details_url %}
{# _case_details.html loaded via ajax #}
{% include "lists/_itembody.html" %}
</article>
## Instruction:
Fix double-application of percentage filter in results by case list.
## Code After:
{% load url from future %}
{% load results filters %}
<article id="runcaseversion-id-{{ runcaseversion.id }}" class="listitem">
{% include "results/_status.html" with item=runcaseversion.caseversion %}
<header class="itemhead">
<div class="completion" data-perc="{{ runcaseversion.completion|percentage }}">{{ runcaseversion.completion|percentage }}</div>
<div class="name">
<h3 class="title" title="{{ runcaseversion.name }}">{{ runcaseversion.caseversion.name }}</h3>
</div>
<div class="run">{{ runcaseversion.run }}</div>
<div class="product-version">{{ runcaseversion.run.productversion }}</div>
{% url "results_results" rcv_id=runcaseversion.id as detail_url %}
{% include "results/_results_summary.html" with results=runcaseversion.result_summary %}
</header>
{% url results_runcaseversion_details runcaseversion.id as details_url %}
{# _case_details.html loaded via ajax #}
{% include "lists/_itembody.html" %}
</article>
|
8a8818159059cc92e00406a407a97f02a8458e2e | Build/Grunt-Options/autoprefixer.js | Build/Grunt-Options/autoprefixer.js | /**
* Grunt-autoprefixer
* @description Autoprefixer parses CSS and adds vendor-prefixed CSS properties using the Can I Use database.
* @docs https://github.com/nDmitry/grunt-autoprefixer
*/
var config = require('../Config'),
sassTaskConfig = require('./sass');
module.exports = {
options: {
browsers: config.project.browserSupport
},
css: {
src: config.Sass.paths.distDir + '/*.css'
}
};
| /**
* Grunt-autoprefixer
* @description Autoprefixer parses CSS and adds vendor-prefixed CSS properties using the Can I Use database.
* @docs https://github.com/nDmitry/grunt-autoprefixer
*/
var config = require('../Config');
module.exports = {
options: {
browsers: config.project.browserSupport
},
css: {
src: config.Sass.paths.distDir + '/*.css'
}
};
| Remove an unnecessary file import of the sass config | [MISC] Remove an unnecessary file import of the sass config
| JavaScript | mit | t3b/t3b_template,t3b/t3b_template,t3b/t3b_template,t3b/t3b_template,t3b/t3b_template | javascript | ## Code Before:
/**
* Grunt-autoprefixer
* @description Autoprefixer parses CSS and adds vendor-prefixed CSS properties using the Can I Use database.
* @docs https://github.com/nDmitry/grunt-autoprefixer
*/
var config = require('../Config'),
sassTaskConfig = require('./sass');
module.exports = {
options: {
browsers: config.project.browserSupport
},
css: {
src: config.Sass.paths.distDir + '/*.css'
}
};
## Instruction:
[MISC] Remove an unnecessary file import of the sass config
## Code After:
/**
* Grunt-autoprefixer
* @description Autoprefixer parses CSS and adds vendor-prefixed CSS properties using the Can I Use database.
* @docs https://github.com/nDmitry/grunt-autoprefixer
*/
var config = require('../Config');
module.exports = {
options: {
browsers: config.project.browserSupport
},
css: {
src: config.Sass.paths.distDir + '/*.css'
}
};
|
61ad8c254780e0115de29101cca247063577a88b | patzilla/navigator/static/vendor/serviva/serviva.css | patzilla/navigator/static/vendor/serviva/serviva.css | @import "texgyreadventor.css";
.header-container {
color: #ddd;
height: 8rem;
}
.header-content {
height: 100%;
margin: 0px;
}
.header-content-left {
background-color: white;
height: inherit;
background-image: url("/static/vendor/serviva/serviva-logo.png");
background-repeat: no-repeat;
background-size: 70%;
background-position: center;
}
.header-content-right {
height: inherit;
margin: 0px !important;
display: flex;
justify-content: right;
background-color: #0062A1;
font-family: TeXGyreAdventor;
font-size: 4.0rem;
line-height: normal;
}
.header-content-right-inner {
margin-right: 1rem !important;
}
.header-content-small {
font-size: 1.5rem;
}
| @import "texgyreadventor.css";
#header-region {
position: -webkit-sticky;
position: sticky;
top: 0;
z-index: 9999;
}
.header-container {
color: #ddd;
height: 8rem;
}
.header-content {
height: 100%;
margin: 0px;
}
.header-content-left {
background-color: white;
height: inherit;
background-image: url("/static/vendor/serviva/serviva-logo.png");
background-repeat: no-repeat;
background-size: 70%;
background-position: center;
}
.header-content-right {
height: inherit;
margin: 0px !important;
display: flex;
justify-content: right;
background-color: #0062A1;
font-family: TeXGyreAdventor;
font-size: 4.0rem;
line-height: normal;
}
.header-content-right-inner {
margin-right: 1rem !important;
}
.header-content-small {
font-size: 1.5rem;
}
| Add stickyness to vendor header | [ui] Add stickyness to vendor header | CSS | agpl-3.0 | ip-tools/ip-navigator,ip-tools/ip-navigator,ip-tools/ip-navigator,ip-tools/ip-navigator | css | ## Code Before:
@import "texgyreadventor.css";
.header-container {
color: #ddd;
height: 8rem;
}
.header-content {
height: 100%;
margin: 0px;
}
.header-content-left {
background-color: white;
height: inherit;
background-image: url("/static/vendor/serviva/serviva-logo.png");
background-repeat: no-repeat;
background-size: 70%;
background-position: center;
}
.header-content-right {
height: inherit;
margin: 0px !important;
display: flex;
justify-content: right;
background-color: #0062A1;
font-family: TeXGyreAdventor;
font-size: 4.0rem;
line-height: normal;
}
.header-content-right-inner {
margin-right: 1rem !important;
}
.header-content-small {
font-size: 1.5rem;
}
## Instruction:
[ui] Add stickyness to vendor header
## Code After:
@import "texgyreadventor.css";
#header-region {
position: -webkit-sticky;
position: sticky;
top: 0;
z-index: 9999;
}
.header-container {
color: #ddd;
height: 8rem;
}
.header-content {
height: 100%;
margin: 0px;
}
.header-content-left {
background-color: white;
height: inherit;
background-image: url("/static/vendor/serviva/serviva-logo.png");
background-repeat: no-repeat;
background-size: 70%;
background-position: center;
}
.header-content-right {
height: inherit;
margin: 0px !important;
display: flex;
justify-content: right;
background-color: #0062A1;
font-family: TeXGyreAdventor;
font-size: 4.0rem;
line-height: normal;
}
.header-content-right-inner {
margin-right: 1rem !important;
}
.header-content-small {
font-size: 1.5rem;
}
|
3027e7a33ba49eaed6e396c2b57c5031816b9a36 | cookbooks/maintenance/recipes/default.rb | cookbooks/maintenance/recipes/default.rb | include_recipe 'useful_tools'
include_recipe 'maintenance::users'
include_recipe 'maintenance::admin_users'
| include_recipe 'maintanance::useful_tools'
include_recipe 'maintenance::users'
include_recipe 'maintenance::admin_users'
| Fix link to useful tools. | Fix link to useful tools. | Ruby | mit | dmitriy-kiriyenko/old-morgan | ruby | ## Code Before:
include_recipe 'useful_tools'
include_recipe 'maintenance::users'
include_recipe 'maintenance::admin_users'
## Instruction:
Fix link to useful tools.
## Code After:
include_recipe 'maintanance::useful_tools'
include_recipe 'maintenance::users'
include_recipe 'maintenance::admin_users'
|
938057258ca202558df840ce8ba4cc24909dbaeb | stylesheets/blog.css | stylesheets/blog.css | section {
margin-left: 15%;
margin-right: 15%;
}
section h1 {
text-align: center;
margin-top: 0px;
}
section h2 {
text-align: center;
font-size: small;
}
article img {
width: 40%;
}
section p {
text-align: justify;
margin-bottom: 1%;
}
section ul {
margin-left: 15%;
list-style-type: circle;
padding-left: 3%;
}
section li {
width: 80%;
}
.code {
font-family: monospace;
background-color: gray;
display: block;
position: relative;
text-align: left;
overflow: auto;
}
.center {
margin: auto;
width: 30%;
border: 1px solid navy;
padding: 10px;
margin-bottom: 1%;
} | section {
margin-left: 15%;
margin-right: 15%;
}
section h1 {
text-align: center;
margin-top: 0px;
}
section h2 {
text-align: center;
font-size: small;
}
article h1 {
text-align: left;
}
article img {
width: 40%;
}
section p {
text-align: justify;
margin-bottom: 1%;
}
section ul {
margin-left: 15%;
list-style-type: circle;
padding-left: 3%;
}
section li {
width: 80%;
}
.code {
font-family: monospace;
background-color: #B1BFB5;
display: block;
position: relative;
text-align: left;
overflow: auto;
}
.center {
margin: auto;
width: 100%;
border: 1px solid navy;
padding: 10px;
margin-bottom: 1%;
} | Reformat code blocks and align article headers | Reformat code blocks and align article headers
| CSS | mit | FTLam11/FTLam11.github.io,FTLam11/FTLam11.github.io,FTLam11/FTLam11.github.io | css | ## Code Before:
section {
margin-left: 15%;
margin-right: 15%;
}
section h1 {
text-align: center;
margin-top: 0px;
}
section h2 {
text-align: center;
font-size: small;
}
article img {
width: 40%;
}
section p {
text-align: justify;
margin-bottom: 1%;
}
section ul {
margin-left: 15%;
list-style-type: circle;
padding-left: 3%;
}
section li {
width: 80%;
}
.code {
font-family: monospace;
background-color: gray;
display: block;
position: relative;
text-align: left;
overflow: auto;
}
.center {
margin: auto;
width: 30%;
border: 1px solid navy;
padding: 10px;
margin-bottom: 1%;
}
## Instruction:
Reformat code blocks and align article headers
## Code After:
section {
margin-left: 15%;
margin-right: 15%;
}
section h1 {
text-align: center;
margin-top: 0px;
}
section h2 {
text-align: center;
font-size: small;
}
article h1 {
text-align: left;
}
article img {
width: 40%;
}
section p {
text-align: justify;
margin-bottom: 1%;
}
section ul {
margin-left: 15%;
list-style-type: circle;
padding-left: 3%;
}
section li {
width: 80%;
}
.code {
font-family: monospace;
background-color: #B1BFB5;
display: block;
position: relative;
text-align: left;
overflow: auto;
}
.center {
margin: auto;
width: 100%;
border: 1px solid navy;
padding: 10px;
margin-bottom: 1%;
} |
459109ca2b13559940005f6ddf640d3ddbf49a01 | CesiumKit/JSONEncodable.swift | CesiumKit/JSONEncodable.swift | //
// JSONEncodable.swift
// CesiumKit
//
// Created by Ryan Walklin on 29/02/2016.
// Copyright © 2016 Test Toast. All rights reserved.
//
import Foundation
protocol JSONEncodable {
init (json: JSONObject) throws
func toJSON () -> JSONObject
} | //
// JSONEncodable.swift
// CesiumKit
//
// Created by Ryan Walklin on 29/02/2016.
// Copyright © 2016 Test Toast. All rights reserved.
//
import Foundation
protocol JSONEncodable {
init (fromJSON json: JSON) throws
func toJSON () -> JSON
}
| Use JSON rather than JSONObject directly | Use JSON rather than JSONObject directly
| Swift | apache-2.0 | tokyovigilante/CesiumKit,tokyovigilante/CesiumKit | swift | ## Code Before:
//
// JSONEncodable.swift
// CesiumKit
//
// Created by Ryan Walklin on 29/02/2016.
// Copyright © 2016 Test Toast. All rights reserved.
//
import Foundation
protocol JSONEncodable {
init (json: JSONObject) throws
func toJSON () -> JSONObject
}
## Instruction:
Use JSON rather than JSONObject directly
## Code After:
//
// JSONEncodable.swift
// CesiumKit
//
// Created by Ryan Walklin on 29/02/2016.
// Copyright © 2016 Test Toast. All rights reserved.
//
import Foundation
protocol JSONEncodable {
init (fromJSON json: JSON) throws
func toJSON () -> JSON
}
|
fe55272aea47fdc84fcdef972d473a75f0aa749f | app.rb | app.rb | require 'bundler'
require 'json'
Bundler.require
class Lib2Issue < Sinatra::Base
use Rack::Deflater
configure do
set :logging, true
set :dump_errors, false
set :raise_errors, true
set :show_exceptions, false
end
before do
request.body.rewind
@request_payload = JSON.parse request.body.read
end
post '/webhook' do
content_type :json
begin
version = SemanticRange.valid(@request_payload['version'])
rescue
version = @request_payload['version']
end
unless ENV['SKIP_PRERELEASE'] && version.is_a?(SemanticRange::Version) && version.prerelease.present?
create_issue(@request_payload['repository'], @request_payload['platform'], @request_payload['name'], @request_payload['version'])
end
status 200
body ''
end
def create_issue(repository, platform, name, version)
client = Octokit::Client.new(access_token: ENV['GITHUB_TOKEN'])
client.create_issue(repository, "Upgrade #{name} to version #{version}",
"Libraries.io has found that there is a newer version of #{name} that this project depends on.
More info: https://libraries.io/#{platform.downcase}/#{name}/#{version}",
labels: ENV['GITHUB_LABELS'])
end
end
| require 'bundler'
require 'json'
Bundler.require
class Lib2Issue < Sinatra::Base
use Rack::Deflater
configure do
set :logging, true
set :dump_errors, false
set :raise_errors, true
set :show_exceptions, false
end
before do
request.body.rewind
@request_payload = JSON.parse request.body.read
end
post '/webhook' do
content_type :json
unless ENV['SKIP_PRERELEASE'] && prerelease?(@request_payload['platform'], @request_payload['version'])
create_issue(@request_payload['repository'], @request_payload['platform'], @request_payload['name'], @request_payload['version'])
end
status 200
body ''
end
def prerelease?(platform, version)
begin
version = SemanticRange.valid(version)
version.prerelease.present?
rescue
if platform.downcase == 'rubygems'
!!(version =~ /[a-zA-Z]/)
else
false
end
end
end
def create_issue(repository, platform, name, version)
client = Octokit::Client.new(access_token: ENV['GITHUB_TOKEN'])
client.create_issue(repository, "Upgrade #{name} to version #{version}",
"Libraries.io has found that there is a newer version of #{name} that this project depends on.
More info: https://libraries.io/#{platform.downcase}/#{name}/#{version}",
labels: ENV['GITHUB_LABELS'])
end
end
| Handle prerelease formats in rubygems | Handle prerelease formats in rubygems | Ruby | mit | librariesio/lib2issues,librariesio/lib2issues | ruby | ## Code Before:
require 'bundler'
require 'json'
Bundler.require
class Lib2Issue < Sinatra::Base
use Rack::Deflater
configure do
set :logging, true
set :dump_errors, false
set :raise_errors, true
set :show_exceptions, false
end
before do
request.body.rewind
@request_payload = JSON.parse request.body.read
end
post '/webhook' do
content_type :json
begin
version = SemanticRange.valid(@request_payload['version'])
rescue
version = @request_payload['version']
end
unless ENV['SKIP_PRERELEASE'] && version.is_a?(SemanticRange::Version) && version.prerelease.present?
create_issue(@request_payload['repository'], @request_payload['platform'], @request_payload['name'], @request_payload['version'])
end
status 200
body ''
end
def create_issue(repository, platform, name, version)
client = Octokit::Client.new(access_token: ENV['GITHUB_TOKEN'])
client.create_issue(repository, "Upgrade #{name} to version #{version}",
"Libraries.io has found that there is a newer version of #{name} that this project depends on.
More info: https://libraries.io/#{platform.downcase}/#{name}/#{version}",
labels: ENV['GITHUB_LABELS'])
end
end
## Instruction:
Handle prerelease formats in rubygems
## Code After:
require 'bundler'
require 'json'
Bundler.require
class Lib2Issue < Sinatra::Base
use Rack::Deflater
configure do
set :logging, true
set :dump_errors, false
set :raise_errors, true
set :show_exceptions, false
end
before do
request.body.rewind
@request_payload = JSON.parse request.body.read
end
post '/webhook' do
content_type :json
unless ENV['SKIP_PRERELEASE'] && prerelease?(@request_payload['platform'], @request_payload['version'])
create_issue(@request_payload['repository'], @request_payload['platform'], @request_payload['name'], @request_payload['version'])
end
status 200
body ''
end
def prerelease?(platform, version)
begin
version = SemanticRange.valid(version)
version.prerelease.present?
rescue
if platform.downcase == 'rubygems'
!!(version =~ /[a-zA-Z]/)
else
false
end
end
end
def create_issue(repository, platform, name, version)
client = Octokit::Client.new(access_token: ENV['GITHUB_TOKEN'])
client.create_issue(repository, "Upgrade #{name} to version #{version}",
"Libraries.io has found that there is a newer version of #{name} that this project depends on.
More info: https://libraries.io/#{platform.downcase}/#{name}/#{version}",
labels: ENV['GITHUB_LABELS'])
end
end
|
35100991e28d9d42815dab248da100c05c4259d8 | examples/basic/server.coffee | examples/basic/server.coffee | exists = require('fs').exists
app = module.exports = require('express')()
JFUM = require '../../src/index.coffee'
jfum = new JFUM()
app.options '/upload', jfum.optionsHandler.bind(jfum)
app.post '/upload', jfum.postHandler.bind(jfum), (req, res, next) ->
console.log req.jfum
return res.json foo: 'bar' if req.jfum is null
exists req.jfum.file, (exist) ->
console.log "File #{if exist then 'exists' else 'does not exist'}!"
res.end()
app.listen 8080 if not module.parent
| exists = require('fs').exists
app = module.exports = require('express')()
JFUM = require '../../src/index.coffee'
jfum = new JFUM
minFileSize: 0
maxFileSize: 10000000000
acceptFileTypes: /\.(gif|jpe?g|png)$/i
app.options '/upload', jfum.optionsHandler.bind(jfum)
app.post '/upload', jfum.postHandler.bind(jfum), (req, res, next) ->
console.log req.jfum
return res.json foo: 'bar' if req.jfum is null
exists req.jfum.file, (exist) ->
console.log "File #{if exist then 'exists' else 'does not exist'}!"
res.end()
app.listen 8080 if not module.parent
| Add JFUM options to example | Add JFUM options to example
| CoffeeScript | mit | Turistforeningen/node-jfum,Turistforeningen/node-jfum | coffeescript | ## Code Before:
exists = require('fs').exists
app = module.exports = require('express')()
JFUM = require '../../src/index.coffee'
jfum = new JFUM()
app.options '/upload', jfum.optionsHandler.bind(jfum)
app.post '/upload', jfum.postHandler.bind(jfum), (req, res, next) ->
console.log req.jfum
return res.json foo: 'bar' if req.jfum is null
exists req.jfum.file, (exist) ->
console.log "File #{if exist then 'exists' else 'does not exist'}!"
res.end()
app.listen 8080 if not module.parent
## Instruction:
Add JFUM options to example
## Code After:
exists = require('fs').exists
app = module.exports = require('express')()
JFUM = require '../../src/index.coffee'
jfum = new JFUM
minFileSize: 0
maxFileSize: 10000000000
acceptFileTypes: /\.(gif|jpe?g|png)$/i
app.options '/upload', jfum.optionsHandler.bind(jfum)
app.post '/upload', jfum.postHandler.bind(jfum), (req, res, next) ->
console.log req.jfum
return res.json foo: 'bar' if req.jfum is null
exists req.jfum.file, (exist) ->
console.log "File #{if exist then 'exists' else 'does not exist'}!"
res.end()
app.listen 8080 if not module.parent
|
dde7df2579bcf72592a960865309c400108a603c | metadata/com.jlyr.txt | metadata/com.jlyr.txt | Category:Multimedia
License:GPLv3
Web Site:http://code.google.com/p/jlyr/
Source Code:http://code.google.com/p/jlyr/source/checkout
Issue Tracker:http://code.google.com/p/jlyr/issues/list
Summary:Get Lyrics
Description:
You can search for lyrics from a list of lyrics websites without leaving the app or go to popular search engines. If you have a Scrobbler installed and a music player that supports it then JLyr can detect what you are listening to and search for the lyrics automatically
.
Repo Type:git-svn
Repo:http://jlyr.googlecode.com/svn/trunk/
Build Version:1.0,1,19
#not in the market
Update Check Mode:None
| Category:Multimedia
License:GPLv3
Web Site:http://code.google.com/p/jlyr/
Source Code:http://code.google.com/p/jlyr/source/checkout
Issue Tracker:http://code.google.com/p/jlyr/issues/list
Summary:Get Lyrics
Description:
You can search for lyrics from a list of lyrics websites without leaving the
app or go to popular search engines. If you have a Scrobbler installed and a
music player that supports it then JLyr can detect what you are listening to
and search for the lyrics automatically
.
Repo Type:git-svn
Repo:http://jlyr.googlecode.com/svn/trunk/
Build Version:1.0,1,19
Update Check Mode:None
Current Version:1.0
Current Version Code:1
| Set current version for Just Lyrics | Set current version for Just Lyrics
| Text | agpl-3.0 | f-droid/fdroiddata,f-droid/fdroiddata,f-droid/fdroid-data | text | ## Code Before:
Category:Multimedia
License:GPLv3
Web Site:http://code.google.com/p/jlyr/
Source Code:http://code.google.com/p/jlyr/source/checkout
Issue Tracker:http://code.google.com/p/jlyr/issues/list
Summary:Get Lyrics
Description:
You can search for lyrics from a list of lyrics websites without leaving the app or go to popular search engines. If you have a Scrobbler installed and a music player that supports it then JLyr can detect what you are listening to and search for the lyrics automatically
.
Repo Type:git-svn
Repo:http://jlyr.googlecode.com/svn/trunk/
Build Version:1.0,1,19
#not in the market
Update Check Mode:None
## Instruction:
Set current version for Just Lyrics
## Code After:
Category:Multimedia
License:GPLv3
Web Site:http://code.google.com/p/jlyr/
Source Code:http://code.google.com/p/jlyr/source/checkout
Issue Tracker:http://code.google.com/p/jlyr/issues/list
Summary:Get Lyrics
Description:
You can search for lyrics from a list of lyrics websites without leaving the
app or go to popular search engines. If you have a Scrobbler installed and a
music player that supports it then JLyr can detect what you are listening to
and search for the lyrics automatically
.
Repo Type:git-svn
Repo:http://jlyr.googlecode.com/svn/trunk/
Build Version:1.0,1,19
Update Check Mode:None
Current Version:1.0
Current Version Code:1
|
ea14bf4781b4a1e17253bf4f648cbfbd1e94c642 | lib/serverspec/matchers.rb | lib/serverspec/matchers.rb | require 'serverspec/matchers/be_mounted'
require 'serverspec/matchers/be_resolvable'
require 'serverspec/matchers/be_reachable'
require 'serverspec/matchers/be_installed'
require 'serverspec/matchers/be_running'
require 'serverspec/matchers/contain'
require 'serverspec/matchers/have_entry'
require 'serverspec/matchers/belong_to_group'
require 'serverspec/matchers/be_readable'
require 'serverspec/matchers/be_writable'
require 'serverspec/matchers/be_executable'
require 'serverspec/matchers/return_exit_status'
require 'serverspec/matchers/return_stdout'
require 'serverspec/matchers/return_stderr'
require 'serverspec/matchers/match_md5checksum'
require 'serverspec/matchers/have_rule'
| require 'serverspec/matchers/be_mounted'
require 'serverspec/matchers/contain'
require 'serverspec/matchers/be_readable'
require 'serverspec/matchers/be_writable'
require 'serverspec/matchers/be_executable'
require 'serverspec/matchers/match_md5checksum'
# host
require 'serverspec/matchers/be_resolvable'
require 'serverspec/matchers/be_reachable'
# package
require 'serverspec/matchers/be_installed'
# service
require 'serverspec/matchers/be_running'
# user
require 'serverspec/matchers/belong_to_group'
require 'serverspec/matchers/return_exit_status'
require 'serverspec/matchers/return_stdout'
require 'serverspec/matchers/return_stderr'
# ipfiter, ipnat, iptables
require 'serverspec/matchers/have_rule'
# cron, routing_table
require 'serverspec/matchers/have_entry'
| Arrange the order of lines | Arrange the order of lines
| Ruby | mit | sergueik/serverspec,kui/serverspec,doc75/serverspec,catatsuy/serverspec,DarrellMozingo/serverspec,minimum2scp/serverspec,supertylerc/serverspec,treydock/serverspec,nishigori/serverspec,a3no/serverspec,higanworks/serverspec,vincentbernat/serverspec,tmtk75/serverspec,kitak/serverspec,ihassin/serverspec,serverspec/serverspec,ijin/serverspec,muddydixon/serverspec,punkle/serverspec,naga2raja/serverspec,pmenglund/serverspec,bitglue/serverspec,darklore/serverspec,zakkie/serverspec,aibou/serverspec,k1LoW/serverspec,RoboticCheese/serverspec,pfaffle/serverspec,dhoer/serverspec,mizzy/serverspec,presto53/serverspec,inokappa/serverspec,orangain/serverspec,youpy/serverspec,mekf/serverspec,tagomoris/serverspec,podenski/serverspec,netmarkjp/serverspec,yono/serverspec,ShawInnes/serverspec,smontanari/serverspec,linyows/serverspec,elmundio87/serverspec,benr/serverspec,shatano/serverspec,tacahilo/serverspec,takai/serverspec,Plus81/serverspec,uroesch/serverspec,aschmidt75/serverspec,cosmo0920/serverspec,hunner/serverspec,3100/serverspec,cl-lab-k/serverspec,tatsuyafw/serverspec,elibus/serverspec,hanazuki/serverspec | ruby | ## Code Before:
require 'serverspec/matchers/be_mounted'
require 'serverspec/matchers/be_resolvable'
require 'serverspec/matchers/be_reachable'
require 'serverspec/matchers/be_installed'
require 'serverspec/matchers/be_running'
require 'serverspec/matchers/contain'
require 'serverspec/matchers/have_entry'
require 'serverspec/matchers/belong_to_group'
require 'serverspec/matchers/be_readable'
require 'serverspec/matchers/be_writable'
require 'serverspec/matchers/be_executable'
require 'serverspec/matchers/return_exit_status'
require 'serverspec/matchers/return_stdout'
require 'serverspec/matchers/return_stderr'
require 'serverspec/matchers/match_md5checksum'
require 'serverspec/matchers/have_rule'
## Instruction:
Arrange the order of lines
## Code After:
require 'serverspec/matchers/be_mounted'
require 'serverspec/matchers/contain'
require 'serverspec/matchers/be_readable'
require 'serverspec/matchers/be_writable'
require 'serverspec/matchers/be_executable'
require 'serverspec/matchers/match_md5checksum'
# host
require 'serverspec/matchers/be_resolvable'
require 'serverspec/matchers/be_reachable'
# package
require 'serverspec/matchers/be_installed'
# service
require 'serverspec/matchers/be_running'
# user
require 'serverspec/matchers/belong_to_group'
require 'serverspec/matchers/return_exit_status'
require 'serverspec/matchers/return_stdout'
require 'serverspec/matchers/return_stderr'
# ipfiter, ipnat, iptables
require 'serverspec/matchers/have_rule'
# cron, routing_table
require 'serverspec/matchers/have_entry'
|
c96a45f3c32122bbcb5ae5cf26379ee93c7d3321 | .rubocop.yml | .rubocop.yml | AllCops:
Exclude:
- vendor/**/*
- ruby/**/*
- test/**/*
- files/**/*
- .kitchen/**/*
AlignParameters:
Enabled: false
Encoding:
Enabled: false
UselessAssignment:
Enabled: false
LineLength:
Max: 300
MethodLength:
Max: 11
HashSyntax:
Enabled: false
IfUnlessModifier:
Enabled: false
TrivialAccessors:
ExactNameMatch: true
Style/RegexpLiteral:
Enabled: false
| AllCops:
Exclude:
- vendor/**/*
- ruby/**/*
- test/**/*
- files/**/*
- .kitchen/**/*
AlignParameters:
Enabled: false
Encoding:
Enabled: false
UselessAssignment:
Enabled: false
LineLength:
Max: 300
MethodLength:
Max: 11
HashSyntax:
Enabled: false
IfUnlessModifier:
Enabled: false
TrivialAccessors:
ExactNameMatch: true
Style/RegexpLiteral:
Enabled: false
Style/ExtraSpacing:
Enabled: false
| Disable the extra space cop | Disable the extra space cop
Signed-off-by: Tim Smith <[email protected]>
| YAML | apache-2.0 | svanzoest-cookbooks/apache2,svanzoest-cookbooks/apache2,svanzoest-cookbooks/apache2 | yaml | ## Code Before:
AllCops:
Exclude:
- vendor/**/*
- ruby/**/*
- test/**/*
- files/**/*
- .kitchen/**/*
AlignParameters:
Enabled: false
Encoding:
Enabled: false
UselessAssignment:
Enabled: false
LineLength:
Max: 300
MethodLength:
Max: 11
HashSyntax:
Enabled: false
IfUnlessModifier:
Enabled: false
TrivialAccessors:
ExactNameMatch: true
Style/RegexpLiteral:
Enabled: false
## Instruction:
Disable the extra space cop
Signed-off-by: Tim Smith <[email protected]>
## Code After:
AllCops:
Exclude:
- vendor/**/*
- ruby/**/*
- test/**/*
- files/**/*
- .kitchen/**/*
AlignParameters:
Enabled: false
Encoding:
Enabled: false
UselessAssignment:
Enabled: false
LineLength:
Max: 300
MethodLength:
Max: 11
HashSyntax:
Enabled: false
IfUnlessModifier:
Enabled: false
TrivialAccessors:
ExactNameMatch: true
Style/RegexpLiteral:
Enabled: false
Style/ExtraSpacing:
Enabled: false
|
97d1cf01d99d3c9154c701827210e597995c72a8 | platforms/os2-gcc/platform.cmake | platforms/os2-gcc/platform.cmake | set (PLIBSYS_THREAD_MODEL none)
set (PLIBSYS_IPC_MODEL none)
set (PLIBSYS_TIME_PROFILER_MODEL generic)
set (PLIBSYS_DIR_MODEL none)
set (PLIBSYS_LIBRARYLOADER_MODEL none)
| set (PLIBSYS_THREAD_MODEL none)
set (PLIBSYS_IPC_MODEL none)
set (PLIBSYS_TIME_PROFILER_MODEL generic)
set (PLIBSYS_DIR_MODEL none)
set (PLIBSYS_LIBRARYLOADER_MODEL none)
set (PLIBSYS_PLATFORM_LINK_LIBRARIES os2386)
| Add os2386 library to linkage list | os2: Add os2386 library to linkage list
| CMake | unknown | saprykin/plibsys,saprykin/plib,saprykin/plibsys,saprykin/plibsys,saprykin/plib | cmake | ## Code Before:
set (PLIBSYS_THREAD_MODEL none)
set (PLIBSYS_IPC_MODEL none)
set (PLIBSYS_TIME_PROFILER_MODEL generic)
set (PLIBSYS_DIR_MODEL none)
set (PLIBSYS_LIBRARYLOADER_MODEL none)
## Instruction:
os2: Add os2386 library to linkage list
## Code After:
set (PLIBSYS_THREAD_MODEL none)
set (PLIBSYS_IPC_MODEL none)
set (PLIBSYS_TIME_PROFILER_MODEL generic)
set (PLIBSYS_DIR_MODEL none)
set (PLIBSYS_LIBRARYLOADER_MODEL none)
set (PLIBSYS_PLATFORM_LINK_LIBRARIES os2386)
|
45649acb3aa5027e7856d2839e358d1c5a7302c5 | forums/templates/agora/_category_panel.html | forums/templates/agora/_category_panel.html | <div class="panel panel-default">
<div class="panel-heading">Categories</div>
{% if categories %}
<ul class="list-group">
{% for category in categories %}
<li class="list-group-item">
<a href="{% url "agora_category" category.pk %}">
{{ category.title }}
</a>
</li>
{% endfor %}
</ul>
{% else %}
<div class="panel-body">
There are currently no categories
</div>
{% endif %}
</div> | <div class="panel panel-default">
<div class="panel-heading">Categories</div>
{% if categories %}
<ul class="list-group">
{% for category in categories %}
<li class="list-group-item">
<a href="{% url "agora_category" category.pk %}">
{{ category.title }}
</a>
<span class="badge pull-right">{% if category.forums.count > 0%}{{ category.forums.count }}{% endif %}</span>
</li>
{% endfor %}
</ul>
{% else %}
<div class="panel-body">
There are currently no categories
</div>
{% endif %}
</div> | Add badge counts of forums | Add badge counts of forums | HTML | mit | pinax/pinax-project-forums,pinax/pinax-project-forums | html | ## Code Before:
<div class="panel panel-default">
<div class="panel-heading">Categories</div>
{% if categories %}
<ul class="list-group">
{% for category in categories %}
<li class="list-group-item">
<a href="{% url "agora_category" category.pk %}">
{{ category.title }}
</a>
</li>
{% endfor %}
</ul>
{% else %}
<div class="panel-body">
There are currently no categories
</div>
{% endif %}
</div>
## Instruction:
Add badge counts of forums
## Code After:
<div class="panel panel-default">
<div class="panel-heading">Categories</div>
{% if categories %}
<ul class="list-group">
{% for category in categories %}
<li class="list-group-item">
<a href="{% url "agora_category" category.pk %}">
{{ category.title }}
</a>
<span class="badge pull-right">{% if category.forums.count > 0%}{{ category.forums.count }}{% endif %}</span>
</li>
{% endfor %}
</ul>
{% else %}
<div class="panel-body">
There are currently no categories
</div>
{% endif %}
</div> |
5d9c4134ca6ff2458904adad01989cee2287cf0d | setup.cfg | setup.cfg | [nosetests]
where = tests
with-coverage=true
cover-package = sqla_taskq
cover-html = true
cover-html-dir = htmlcov
| [nosetests]
where = tests
with-coverage = true
cover-package = .
cover-html = true
cover-html-dir = htmlcov
[aliases]
release = egg_info sdist register upload
| Fix cover package and add alias to publish the package | Fix cover package and add alias to publish the package
| INI | mit | LeResKP/sqla-taskq | ini | ## Code Before:
[nosetests]
where = tests
with-coverage=true
cover-package = sqla_taskq
cover-html = true
cover-html-dir = htmlcov
## Instruction:
Fix cover package and add alias to publish the package
## Code After:
[nosetests]
where = tests
with-coverage = true
cover-package = .
cover-html = true
cover-html-dir = htmlcov
[aliases]
release = egg_info sdist register upload
|
9a7bdb63b2e2f60c3d9374fa092aa5fca3de7436 | app/models/concerns/adminable/resource_concern.rb | app/models/concerns/adminable/resource_concern.rb | module Adminable
module ResourceConcern
extend ActiveSupport::Concern
def adminable
%i(title name email login id).each do |name|
return OpenStruct.new(name: public_send(name)) unless try(name).nil?
end
end
end
end
| module Adminable
module ResourceConcern
extend ActiveSupport::Concern
def adminable
%i(title name email login id).each do |name|
begin
return OpenStruct.new(name: public_send(name))
rescue NoMethodError
next
end
end
end
end
end
| Refactor resource concern adminable method | Refactor resource concern adminable method
| Ruby | mit | droptheplot/adminable,droptheplot/adminable,droptheplot/adminable | ruby | ## Code Before:
module Adminable
module ResourceConcern
extend ActiveSupport::Concern
def adminable
%i(title name email login id).each do |name|
return OpenStruct.new(name: public_send(name)) unless try(name).nil?
end
end
end
end
## Instruction:
Refactor resource concern adminable method
## Code After:
module Adminable
module ResourceConcern
extend ActiveSupport::Concern
def adminable
%i(title name email login id).each do |name|
begin
return OpenStruct.new(name: public_send(name))
rescue NoMethodError
next
end
end
end
end
end
|
4fe5b22815f78e92b096430579c7880e51d3096e | .github/build-and-push-rpm.sh | .github/build-and-push-rpm.sh |
set -e
secret=$1
type=$2
docker run -e BROKER_RELEASE=$type -v $(pwd):/opt/orion --workdir=/opt/orion fiware/orion-ci:rpm8 make rpm
for file in "$(pwd)/rpm/RPMS/x86_64"/*
do
filename=$(basename $file)
echo "Uploading $filename"
curl -v -f -u telefonica-github:$secret --upload-file $file https://nexus.lab.fiware.org/repository/el/8/x86_64/$type/$filename
done |
set -e
secret=$1
type=$2
if [ "$type" == "release" ]
then
type="1"
fi
docker run -e BROKER_RELEASE=$type -v $(pwd):/opt/orion --workdir=/opt/orion fiware/orion-ci:rpm8 make rpm
for file in "$(pwd)/rpm/RPMS/x86_64"/*
do
filename=$(basename $file)
echo "Uploading $filename"
curl -v -f -u telefonica-github:$secret --upload-file $file https://nexus.lab.fiware.org/repository/el/8/x86_64/$type/$filename
done
| FIX avoid "-release" in autogenerated release RPMs | FIX avoid "-release" in autogenerated release RPMs | Shell | agpl-3.0 | telefonicaid/fiware-orion,telefonicaid/fiware-orion,telefonicaid/fiware-orion,telefonicaid/fiware-orion,telefonicaid/fiware-orion,telefonicaid/fiware-orion | shell | ## Code Before:
set -e
secret=$1
type=$2
docker run -e BROKER_RELEASE=$type -v $(pwd):/opt/orion --workdir=/opt/orion fiware/orion-ci:rpm8 make rpm
for file in "$(pwd)/rpm/RPMS/x86_64"/*
do
filename=$(basename $file)
echo "Uploading $filename"
curl -v -f -u telefonica-github:$secret --upload-file $file https://nexus.lab.fiware.org/repository/el/8/x86_64/$type/$filename
done
## Instruction:
FIX avoid "-release" in autogenerated release RPMs
## Code After:
set -e
secret=$1
type=$2
if [ "$type" == "release" ]
then
type="1"
fi
docker run -e BROKER_RELEASE=$type -v $(pwd):/opt/orion --workdir=/opt/orion fiware/orion-ci:rpm8 make rpm
for file in "$(pwd)/rpm/RPMS/x86_64"/*
do
filename=$(basename $file)
echo "Uploading $filename"
curl -v -f -u telefonica-github:$secret --upload-file $file https://nexus.lab.fiware.org/repository/el/8/x86_64/$type/$filename
done
|
1cdcc2955572c4dbdc4c1e20f58725b410bb7e35 | README.md | README.md |
This project runs the [GeoTrellis](http://geotrellis.io) website. It is
composed of two pieces:
1. A static content container with nginx
2. A Spray server running GeoTrellis operations
## Running Locally
You need [Docker](https://www.docker.com/) to build and run the website.
Once you have it, running the entire site is easy:
```console
> make start
```
This will expose `localhost:8080` to listen for HTTP requests.
## Deploying
Deploying on AWS should be relatively simple as well (note that terraform
is required in addition to docker for this step):
```console
> make deploy
```
|
This project runs the [GeoTrellis](http://geotrellis.io) website. It is
composed of two pieces:
1. A static content container with nginx
2. A Spray server running GeoTrellis operations
## Running Locally
You need [Docker](https://www.docker.com/) to build and run the website.
Once you have it, running the entire site is easy:
```console
> make start
```
This will expose `localhost:8080` to listen for HTTP requests.
## Deploying
Deploying on AWS should be relatively simple as well (note that terraform
is required in addition to docker for this step). Note that, because the terraform
state is stored on S3, any updates can be applied without having to tear
down the previous deployment. Keep in mind, too, that containers are
tagged according to the SHA of the commit from which they come - to
ensure that ECS picks up the updated container, verify that all changes have
been committed.
```console
> make deploy
```
| Add remote state to readme | Add remote state to readme
| Markdown | apache-2.0 | geotrellis/geotrellis-site,geotrellis/geotrellis-site,geotrellis/geotrellis-site,geotrellis/geotrellis-site | markdown | ## Code Before:
This project runs the [GeoTrellis](http://geotrellis.io) website. It is
composed of two pieces:
1. A static content container with nginx
2. A Spray server running GeoTrellis operations
## Running Locally
You need [Docker](https://www.docker.com/) to build and run the website.
Once you have it, running the entire site is easy:
```console
> make start
```
This will expose `localhost:8080` to listen for HTTP requests.
## Deploying
Deploying on AWS should be relatively simple as well (note that terraform
is required in addition to docker for this step):
```console
> make deploy
```
## Instruction:
Add remote state to readme
## Code After:
This project runs the [GeoTrellis](http://geotrellis.io) website. It is
composed of two pieces:
1. A static content container with nginx
2. A Spray server running GeoTrellis operations
## Running Locally
You need [Docker](https://www.docker.com/) to build and run the website.
Once you have it, running the entire site is easy:
```console
> make start
```
This will expose `localhost:8080` to listen for HTTP requests.
## Deploying
Deploying on AWS should be relatively simple as well (note that terraform
is required in addition to docker for this step). Note that, because the terraform
state is stored on S3, any updates can be applied without having to tear
down the previous deployment. Keep in mind, too, that containers are
tagged according to the SHA of the commit from which they come - to
ensure that ECS picks up the updated container, verify that all changes have
been committed.
```console
> make deploy
```
|
2b57827c7b8c552c7e84bc8b1ad44d54baab894b | app/javascript/components/Events/PerformanceCompetition/Show/Maps/RoundMap/CompetitorsList/CompetitorResult/ExitAltitude.js | app/javascript/components/Events/PerformanceCompetition/Show/Maps/RoundMap/CompetitorsList/CompetitorResult/ExitAltitude.js | import React from 'react'
import PropTypes from 'prop-types'
import { useI18n } from 'components/TranslationsProvider'
const maxAltitude = 3353
const minAltitude = 3200
const ExitAltitude = ({ altitude }) => {
const { t } = useI18n()
if (!altitude) return null
const showWarning = altitude < minAltitude || altitude > maxAltitude
return (
<span>
Exit: {altitude}m
{showWarning && (
<>
<i className="fas fa-exclamation-triangle text-warning" />
</>
)} {t('units.m')}
</span>
)
}
ExitAltitude.propTypes = {
altitude: PropTypes.number
}
ExitAltitude.defaultProps = {
altitude: undefined
}
export default ExitAltitude
| import React from 'react'
import PropTypes from 'prop-types'
import { useI18n } from 'components/TranslationsProvider'
const maxAltitude = 3353
const minAltitude = 3200
const ExitAltitude = ({ altitude }) => {
const { t } = useI18n()
if (!altitude) return null
const showWarning = altitude < minAltitude || altitude > maxAltitude
return (
<span>
Exit: {altitude} {t('units.m')}
{showWarning && (
<>
<i className="fas fa-exclamation-triangle text-warning" />
</>
)}
</span>
)
}
ExitAltitude.propTypes = {
altitude: PropTypes.number
}
ExitAltitude.defaultProps = {
altitude: undefined
}
export default ExitAltitude
| Fix exit altitude units placement | Fix exit altitude units placement
| JavaScript | agpl-3.0 | skyderby/skyderby,skyderby/skyderby,skyderby/skyderby,skyderby/skyderby,skyderby/skyderby | javascript | ## Code Before:
import React from 'react'
import PropTypes from 'prop-types'
import { useI18n } from 'components/TranslationsProvider'
const maxAltitude = 3353
const minAltitude = 3200
const ExitAltitude = ({ altitude }) => {
const { t } = useI18n()
if (!altitude) return null
const showWarning = altitude < minAltitude || altitude > maxAltitude
return (
<span>
Exit: {altitude}m
{showWarning && (
<>
<i className="fas fa-exclamation-triangle text-warning" />
</>
)} {t('units.m')}
</span>
)
}
ExitAltitude.propTypes = {
altitude: PropTypes.number
}
ExitAltitude.defaultProps = {
altitude: undefined
}
export default ExitAltitude
## Instruction:
Fix exit altitude units placement
## Code After:
import React from 'react'
import PropTypes from 'prop-types'
import { useI18n } from 'components/TranslationsProvider'
const maxAltitude = 3353
const minAltitude = 3200
const ExitAltitude = ({ altitude }) => {
const { t } = useI18n()
if (!altitude) return null
const showWarning = altitude < minAltitude || altitude > maxAltitude
return (
<span>
Exit: {altitude} {t('units.m')}
{showWarning && (
<>
<i className="fas fa-exclamation-triangle text-warning" />
</>
)}
</span>
)
}
ExitAltitude.propTypes = {
altitude: PropTypes.number
}
ExitAltitude.defaultProps = {
altitude: undefined
}
export default ExitAltitude
|
4bc8f424597d1a669aa248444481afa245e9d2e9 | jkind/src/jkind/JKindSettings.java | jkind/src/jkind/JKindSettings.java | package jkind;
public class JKindSettings extends Settings {
public int n = 200;
public int timeout = 100;
public boolean excel = false;
public boolean xml = false;
public boolean xmlToStdout = false;
public boolean boundedModelChecking = true;
public boolean kInduction = true;
public boolean invariantGeneration = true;
public int pdrMax = 1;
public boolean inductiveCounterexamples = false;
public boolean reduceIvc = false;
public boolean smoothCounterexamples = false;
public boolean intervalGeneralization = false;
public boolean inline = true;
public SolverOption solver = SolverOption.SMTINTERPOL;
public boolean scratch = false;
public String writeAdvice = null;
public String readAdvice = null;
}
| package jkind;
public class JKindSettings extends Settings {
public int n = Integer.MAX_VALUE;
public int timeout = Integer.MAX_VALUE;
public boolean excel = false;
public boolean xml = false;
public boolean xmlToStdout = false;
public boolean boundedModelChecking = true;
public boolean kInduction = true;
public boolean invariantGeneration = true;
public int pdrMax = 1;
public boolean inductiveCounterexamples = false;
public boolean reduceIvc = false;
public boolean smoothCounterexamples = false;
public boolean intervalGeneralization = false;
public boolean inline = true;
public SolverOption solver = SolverOption.SMTINTERPOL;
public boolean scratch = false;
public String writeAdvice = null;
public String readAdvice = null;
}
| Change timeout and depth to be effectively unbounded by default | Change timeout and depth to be effectively unbounded by default
| Java | bsd-3-clause | agacek/jkind,lgwagner/jkind,andrewkatis/jkind-1,andrewkatis/jkind-1,backesj/jkind,lgwagner/jkind,backesj/jkind,agacek/jkind | java | ## Code Before:
package jkind;
public class JKindSettings extends Settings {
public int n = 200;
public int timeout = 100;
public boolean excel = false;
public boolean xml = false;
public boolean xmlToStdout = false;
public boolean boundedModelChecking = true;
public boolean kInduction = true;
public boolean invariantGeneration = true;
public int pdrMax = 1;
public boolean inductiveCounterexamples = false;
public boolean reduceIvc = false;
public boolean smoothCounterexamples = false;
public boolean intervalGeneralization = false;
public boolean inline = true;
public SolverOption solver = SolverOption.SMTINTERPOL;
public boolean scratch = false;
public String writeAdvice = null;
public String readAdvice = null;
}
## Instruction:
Change timeout and depth to be effectively unbounded by default
## Code After:
package jkind;
public class JKindSettings extends Settings {
public int n = Integer.MAX_VALUE;
public int timeout = Integer.MAX_VALUE;
public boolean excel = false;
public boolean xml = false;
public boolean xmlToStdout = false;
public boolean boundedModelChecking = true;
public boolean kInduction = true;
public boolean invariantGeneration = true;
public int pdrMax = 1;
public boolean inductiveCounterexamples = false;
public boolean reduceIvc = false;
public boolean smoothCounterexamples = false;
public boolean intervalGeneralization = false;
public boolean inline = true;
public SolverOption solver = SolverOption.SMTINTERPOL;
public boolean scratch = false;
public String writeAdvice = null;
public String readAdvice = null;
}
|
cc6c40b64f8dfde533977883124e22e0fbc80e5c | soco/__init__.py | soco/__init__.py | from __future__ import unicode_literals
""" SoCo (Sonos Controller) is a simple library to control Sonos speakers """
# Will be parsed by setup.py to determine package metadata
__author__ = 'Rahim Sonawalla <[email protected]>'
__version__ = '0.7'
__website__ = 'https://github.com/SoCo/SoCo'
__license__ = 'MIT License'
from .core import discover, SoCo, SonosDiscovery
from .exceptions import SoCoException, UnknownSoCoException
__all__ = ['discover', 'SonosDiscovery', 'SoCo', 'SoCoException', 'UnknownSoCoException']
# http://docs.python.org/2/howto/logging.html#library-config
# Avoids spurious error messages if no logger is configured by the user
import logging
logging.getLogger(__name__).addHandler(logging.NullHandler())
| from __future__ import unicode_literals
""" SoCo (Sonos Controller) is a simple library to control Sonos speakers """
# Will be parsed by setup.py to determine package metadata
__author__ = 'The SoCo-Team <[email protected]>'
__version__ = '0.7'
__website__ = 'https://github.com/SoCo/SoCo'
__license__ = 'MIT License'
from .core import discover, SoCo, SonosDiscovery
from .exceptions import SoCoException, UnknownSoCoException
__all__ = ['discover', 'SonosDiscovery', 'SoCo', 'SoCoException', 'UnknownSoCoException']
# http://docs.python.org/2/howto/logging.html#library-config
# Avoids spurious error messages if no logger is configured by the user
import logging
logging.getLogger(__name__).addHandler(logging.NullHandler())
| Update author info to "The SoCo-Team" | Update author info to "The SoCo-Team"
| Python | mit | TrondKjeldas/SoCo,flavio/SoCo,dundeemt/SoCo,xxdede/SoCo,KennethNielsen/SoCo,petteraas/SoCo,bwhaley/SoCo,xxdede/SoCo,oyvindmal/SocoWebService,TrondKjeldas/SoCo,TrondKjeldas/SoCo,petteraas/SoCo,dajobe/SoCo,intfrr/SoCo,intfrr/SoCo,xxdede/SoCo,fgend31/SoCo,jlmcgehee21/SoCo,DPH/SoCo,dsully/SoCo,meska/SoCo,bwhaley/SoCo,dajobe/SoCo,SoCo/SoCo,flavio/SoCo,lawrenceakka/SoCo,SoCo/SoCo,lawrenceakka/SoCo,KennethNielsen/SoCo,bwhaley/SoCo,fxstein/SoCo,petteraas/SoCo,fgend31/SoCo,jlmcgehee21/SoCo,fxstein/SoCo,simonalpha/SoCo,DPH/SoCo,oyvindmal/SocoWebService,simonalpha/SoCo,meska/SoCo,dundeemt/SoCo,dsully/SoCo | python | ## Code Before:
from __future__ import unicode_literals
""" SoCo (Sonos Controller) is a simple library to control Sonos speakers """
# Will be parsed by setup.py to determine package metadata
__author__ = 'Rahim Sonawalla <[email protected]>'
__version__ = '0.7'
__website__ = 'https://github.com/SoCo/SoCo'
__license__ = 'MIT License'
from .core import discover, SoCo, SonosDiscovery
from .exceptions import SoCoException, UnknownSoCoException
__all__ = ['discover', 'SonosDiscovery', 'SoCo', 'SoCoException', 'UnknownSoCoException']
# http://docs.python.org/2/howto/logging.html#library-config
# Avoids spurious error messages if no logger is configured by the user
import logging
logging.getLogger(__name__).addHandler(logging.NullHandler())
## Instruction:
Update author info to "The SoCo-Team"
## Code After:
from __future__ import unicode_literals
""" SoCo (Sonos Controller) is a simple library to control Sonos speakers """
# Will be parsed by setup.py to determine package metadata
__author__ = 'The SoCo-Team <[email protected]>'
__version__ = '0.7'
__website__ = 'https://github.com/SoCo/SoCo'
__license__ = 'MIT License'
from .core import discover, SoCo, SonosDiscovery
from .exceptions import SoCoException, UnknownSoCoException
__all__ = ['discover', 'SonosDiscovery', 'SoCo', 'SoCoException', 'UnknownSoCoException']
# http://docs.python.org/2/howto/logging.html#library-config
# Avoids spurious error messages if no logger is configured by the user
import logging
logging.getLogger(__name__).addHandler(logging.NullHandler())
|
84a7b7fd8612121379700498c61e7c292eb8262a | malcolm/controllers/builtin/defaultcontroller.py | malcolm/controllers/builtin/defaultcontroller.py | from malcolm.core import Controller, DefaultStateMachine, Hook, \
method_only_in, method_takes
sm = DefaultStateMachine
@sm.insert
@method_takes()
class DefaultController(Controller):
Resetting = Hook()
Disabling = Hook()
@method_takes()
def disable(self):
try:
self.transition(sm.DISABLING, "Disabling")
self.run_hook(self.Disabling)
self.transition(sm.DISABLED, "Done Disabling")
except Exception as e: # pylint:disable=broad-except
self.log_exception("Fault occurred while Disabling")
self.transition(sm.FAULT, str(e))
raise
@method_only_in(sm.DISABLED, sm.FAULT)
def reset(self):
try:
self.transition(sm.RESETTING, "Resetting")
self.run_hook(self.Resetting)
self.transition(sm.AFTER_RESETTING, "Done Resetting")
except Exception as e: # pylint:disable=broad-except
self.log_exception("Fault occurred while Resetting")
self.transition(sm.FAULT, str(e))
raise | from malcolm.core import Controller, DefaultStateMachine, Hook, \
method_only_in, method_takes
sm = DefaultStateMachine
@sm.insert
@method_takes()
class DefaultController(Controller):
Resetting = Hook()
Disabling = Hook()
@method_takes()
def disable(self):
try:
self.transition(sm.DISABLING, "Disabling")
self.run_hook(self.Disabling, self.create_part_tasks())
self.transition(sm.DISABLED, "Done Disabling")
except Exception as e: # pylint:disable=broad-except
self.log_exception("Fault occurred while Disabling")
self.transition(sm.FAULT, str(e))
raise
@method_only_in(sm.DISABLED, sm.FAULT)
def reset(self):
try:
self.transition(sm.RESETTING, "Resetting")
self.run_hook(self.Resetting, self.create_part_tasks())
self.transition(self.stateMachine.AFTER_RESETTING, "Done Resetting")
except Exception as e: # pylint:disable=broad-except
self.log_exception("Fault occurred while Resetting")
self.transition(sm.FAULT, str(e))
raise
| Make part task creation explicit | Make part task creation explicit
| Python | apache-2.0 | dls-controls/pymalcolm,dls-controls/pymalcolm,dls-controls/pymalcolm | python | ## Code Before:
from malcolm.core import Controller, DefaultStateMachine, Hook, \
method_only_in, method_takes
sm = DefaultStateMachine
@sm.insert
@method_takes()
class DefaultController(Controller):
Resetting = Hook()
Disabling = Hook()
@method_takes()
def disable(self):
try:
self.transition(sm.DISABLING, "Disabling")
self.run_hook(self.Disabling)
self.transition(sm.DISABLED, "Done Disabling")
except Exception as e: # pylint:disable=broad-except
self.log_exception("Fault occurred while Disabling")
self.transition(sm.FAULT, str(e))
raise
@method_only_in(sm.DISABLED, sm.FAULT)
def reset(self):
try:
self.transition(sm.RESETTING, "Resetting")
self.run_hook(self.Resetting)
self.transition(sm.AFTER_RESETTING, "Done Resetting")
except Exception as e: # pylint:disable=broad-except
self.log_exception("Fault occurred while Resetting")
self.transition(sm.FAULT, str(e))
raise
## Instruction:
Make part task creation explicit
## Code After:
from malcolm.core import Controller, DefaultStateMachine, Hook, \
method_only_in, method_takes
sm = DefaultStateMachine
@sm.insert
@method_takes()
class DefaultController(Controller):
Resetting = Hook()
Disabling = Hook()
@method_takes()
def disable(self):
try:
self.transition(sm.DISABLING, "Disabling")
self.run_hook(self.Disabling, self.create_part_tasks())
self.transition(sm.DISABLED, "Done Disabling")
except Exception as e: # pylint:disable=broad-except
self.log_exception("Fault occurred while Disabling")
self.transition(sm.FAULT, str(e))
raise
@method_only_in(sm.DISABLED, sm.FAULT)
def reset(self):
try:
self.transition(sm.RESETTING, "Resetting")
self.run_hook(self.Resetting, self.create_part_tasks())
self.transition(self.stateMachine.AFTER_RESETTING, "Done Resetting")
except Exception as e: # pylint:disable=broad-except
self.log_exception("Fault occurred while Resetting")
self.transition(sm.FAULT, str(e))
raise
|
f7b46ce3d531d9f165288f75630b633453cef2e1 | .travis.yml | .travis.yml | language: cpp
matrix:
include:
- os: osx
osx_image: xcode9.3
env:
- TARGET=mac TEST=test
- os: osx
osx_image: xcode7.3
env:
- TARGET=mac TEST=test
- os: linux
dist: xenial
env:
- TARGET=linux TEST=test
- os: linux
services:
- docker
before_install:
- docker run -d --name cosmic -v $(pwd):/libsfz -w /libsfz ubuntu:cosmic sleep infinity
- docker ps
install:
- $SH apt-get update
- $SH apt-get install -y --no-install-recommends build-essential clang make python
env:
- TARGET=linux TEST=test SH="docker exec cosmic"
- os: linux
services:
- docker
before_install:
- docker run -d --name cosmic -v $(pwd):/libsfz -w /libsfz ubuntu:cosmic sleep infinity
- docker ps
install:
- $SH apt-get update
- $SH apt-get install -y --no-install-recommends build-essential clang make python
- $SH apt-get install -y --no-install-recommends mingw-w64 xvfb wine
env:
- TARGET=win TEST=test-wine SH="docker exec cosmic"
script:
- $SH ./configure -o $TARGET
- $SH make
- $SH make $TEST
| language: cpp
matrix:
include:
- os: osx
osx_image: xcode11.5
env:
- TARGET=mac TEST=test
# - os: osx
# osx_image: xcode7.3
# env:
# - TARGET=mac TEST=test
- os: linux
dist: xenial
env:
- TARGET=linux TEST=test
- os: linux
services:
- docker
before_install:
- docker run -d --name focal -v $(pwd):/libsfz -w /libsfz ubuntu:focal sleep infinity
- docker ps
install:
- $SH apt-get update
- $SH apt-get install -y --no-install-recommends build-essential clang make python
env:
- TARGET=linux TEST=test SH="docker exec focal"
- os: linux
services:
- docker
before_install:
- docker run -d --name focal -v $(pwd):/libsfz -w /libsfz ubuntu:focal sleep infinity
- docker ps
install:
- $SH apt-get update
- $SH apt-get install -y --no-install-recommends build-essential clang make python
- $SH apt-get install -y --no-install-recommends mingw-w64 xvfb wine
env:
- TARGET=win TEST=test-wine SH="docker exec -e DEBIAN_FRONTEND=noninteractive focal"
script:
- $SH ./configure -o $TARGET
- $SH make
- $SH make $TEST
| Test on macOS 10.15, Ubuntu 20.04 focal | Test on macOS 10.15, Ubuntu 20.04 focal
| YAML | mit | sfiera/libsfz,sfiera/libsfz | yaml | ## Code Before:
language: cpp
matrix:
include:
- os: osx
osx_image: xcode9.3
env:
- TARGET=mac TEST=test
- os: osx
osx_image: xcode7.3
env:
- TARGET=mac TEST=test
- os: linux
dist: xenial
env:
- TARGET=linux TEST=test
- os: linux
services:
- docker
before_install:
- docker run -d --name cosmic -v $(pwd):/libsfz -w /libsfz ubuntu:cosmic sleep infinity
- docker ps
install:
- $SH apt-get update
- $SH apt-get install -y --no-install-recommends build-essential clang make python
env:
- TARGET=linux TEST=test SH="docker exec cosmic"
- os: linux
services:
- docker
before_install:
- docker run -d --name cosmic -v $(pwd):/libsfz -w /libsfz ubuntu:cosmic sleep infinity
- docker ps
install:
- $SH apt-get update
- $SH apt-get install -y --no-install-recommends build-essential clang make python
- $SH apt-get install -y --no-install-recommends mingw-w64 xvfb wine
env:
- TARGET=win TEST=test-wine SH="docker exec cosmic"
script:
- $SH ./configure -o $TARGET
- $SH make
- $SH make $TEST
## Instruction:
Test on macOS 10.15, Ubuntu 20.04 focal
## Code After:
language: cpp
matrix:
include:
- os: osx
osx_image: xcode11.5
env:
- TARGET=mac TEST=test
# - os: osx
# osx_image: xcode7.3
# env:
# - TARGET=mac TEST=test
- os: linux
dist: xenial
env:
- TARGET=linux TEST=test
- os: linux
services:
- docker
before_install:
- docker run -d --name focal -v $(pwd):/libsfz -w /libsfz ubuntu:focal sleep infinity
- docker ps
install:
- $SH apt-get update
- $SH apt-get install -y --no-install-recommends build-essential clang make python
env:
- TARGET=linux TEST=test SH="docker exec focal"
- os: linux
services:
- docker
before_install:
- docker run -d --name focal -v $(pwd):/libsfz -w /libsfz ubuntu:focal sleep infinity
- docker ps
install:
- $SH apt-get update
- $SH apt-get install -y --no-install-recommends build-essential clang make python
- $SH apt-get install -y --no-install-recommends mingw-w64 xvfb wine
env:
- TARGET=win TEST=test-wine SH="docker exec -e DEBIAN_FRONTEND=noninteractive focal"
script:
- $SH ./configure -o $TARGET
- $SH make
- $SH make $TEST
|
d87a4970478105ee55727ab94c9aac68d66229d3 | test/macros/defaults/misc.html | test/macros/defaults/misc.html | <!--
@it ignores the double dot ('..') pattern used as a macro
lorem
..
ipsum
-->
loremipsum
<!--
@it allows any quantity of whitespace characters between the dot and the macro name
. ft B
-->
<strong>
<!--
@it produces empty output
lorem
.de
.ne
.fi
\m
\d
\u
ipsum
-->
loremipsum | <!--
@it ignores the double dot ('..') pattern used as a macro
lorem
..
ipsum
-->
loremipsum
<!--
@it allows any quantity of whitespace characters between the dot and the macro name
. ft B
-->
<strong>
<!--
@it produces empty output
lorem
.de
.ne
.fi
\m
\d
\u
ipsum
-->
loremipsum
<!--
@it handles double line breaks
lorem
ipsum
-->
lorem
<br>
<br>
ipsum | Add a failing test, describing an use case where multiple new lines are together | Add a failing test, describing an use case where multiple new lines are together
| HTML | mit | roperzh/jroff,roperzh/jroff | html | ## Code Before:
<!--
@it ignores the double dot ('..') pattern used as a macro
lorem
..
ipsum
-->
loremipsum
<!--
@it allows any quantity of whitespace characters between the dot and the macro name
. ft B
-->
<strong>
<!--
@it produces empty output
lorem
.de
.ne
.fi
\m
\d
\u
ipsum
-->
loremipsum
## Instruction:
Add a failing test, describing an use case where multiple new lines are together
## Code After:
<!--
@it ignores the double dot ('..') pattern used as a macro
lorem
..
ipsum
-->
loremipsum
<!--
@it allows any quantity of whitespace characters between the dot and the macro name
. ft B
-->
<strong>
<!--
@it produces empty output
lorem
.de
.ne
.fi
\m
\d
\u
ipsum
-->
loremipsum
<!--
@it handles double line breaks
lorem
ipsum
-->
lorem
<br>
<br>
ipsum |
9cf1a9cab8aa6bdedcbef6799dc523b09921074b | packages/react-atlas-core/src/TextArea/README.md | packages/react-atlas-core/src/TextArea/README.md |
<TextArea/>
###### Non-resizable textarea:
<div>
<TextArea placeholder="Enter text here..." small resizable={false}/>
<TextArea placeholder="Enter text here..." medium resizable={false}/>
<TextArea placeholder="Enter text here..." large resizable={false}/>
<TextArea placeholder="Enter text here..." resizable={false}/>
</div>
###### Textarea with header above:
<TextArea header="This is a TextArea"/>
###### Small textarea:
<TextArea small/>
###### Medium textarea:
<TextArea medium/>
###### Large textarea:
<TextArea large/>
###### Placeholder text:
<TextArea placeholder="Enter product details here..."/>
###### Disabled textarea:
<TextArea disabled/>
###### Required validation:
<TextArea required header="Description"/>
###### Maximum length validation:
<TextArea maxLength={20}/>
###### Both validations at the same time:
<TextArea required maxLength={20}/>
###### onChange handler:
<TextArea onChange={ () => { alert('onChange executed!'); } }/>
###### TextArea Tooltip requires Label:
<TextArea label="tooltip header" tooltip="tip of the tool"/>
###### TextArea tooltip right false:
<TextArea label="tooltip header" tooltip="tip of the tool" tooltipRight={false} /> |
<TextArea/>
###### Non-resizable textarea:
<div>
<TextArea placeholder="Enter text here..." small resizable={false}/>
<TextArea placeholder="Enter text here..." medium resizable={false}/>
<TextArea placeholder="Enter text here..." large resizable={false}/>
<TextArea placeholder="Enter text here..." resizable={false}/>
</div>
###### Textarea with header above:
<TextArea header="This is a TextArea"/>
###### Small textarea:
<TextArea small/>
###### Medium textarea:
<TextArea medium/>
###### Large textarea:
<TextArea large/>
###### Placeholder text:
<TextArea placeholder="Enter product details here..."/>
###### Disabled textarea:
<TextArea disabled/>
###### Required validation:
<TextArea required header="Description"/>
###### Maximum length validation:
<TextArea maxLength={20}/>
###### Both validations at the same time:
<TextArea required maxLength={20}/>
###### onChange handler:
<TextArea onChange={ () => { alert('onChange executed!'); } }/>
###### TextArea Tooltip requires Label:
<TextArea label="tooltip header" tooltip="Example tooltip message"/>
###### TextArea tooltip right false:
<TextArea label="tooltip header" tooltip="Example tooltip message" tooltipRight={false} />
| Use a more appropriate example message. | Use a more appropriate example message. | Markdown | mit | Magneticmagnum/react-atlas,DigitalRiver/react-atlas | markdown | ## Code Before:
<TextArea/>
###### Non-resizable textarea:
<div>
<TextArea placeholder="Enter text here..." small resizable={false}/>
<TextArea placeholder="Enter text here..." medium resizable={false}/>
<TextArea placeholder="Enter text here..." large resizable={false}/>
<TextArea placeholder="Enter text here..." resizable={false}/>
</div>
###### Textarea with header above:
<TextArea header="This is a TextArea"/>
###### Small textarea:
<TextArea small/>
###### Medium textarea:
<TextArea medium/>
###### Large textarea:
<TextArea large/>
###### Placeholder text:
<TextArea placeholder="Enter product details here..."/>
###### Disabled textarea:
<TextArea disabled/>
###### Required validation:
<TextArea required header="Description"/>
###### Maximum length validation:
<TextArea maxLength={20}/>
###### Both validations at the same time:
<TextArea required maxLength={20}/>
###### onChange handler:
<TextArea onChange={ () => { alert('onChange executed!'); } }/>
###### TextArea Tooltip requires Label:
<TextArea label="tooltip header" tooltip="tip of the tool"/>
###### TextArea tooltip right false:
<TextArea label="tooltip header" tooltip="tip of the tool" tooltipRight={false} />
## Instruction:
Use a more appropriate example message.
## Code After:
<TextArea/>
###### Non-resizable textarea:
<div>
<TextArea placeholder="Enter text here..." small resizable={false}/>
<TextArea placeholder="Enter text here..." medium resizable={false}/>
<TextArea placeholder="Enter text here..." large resizable={false}/>
<TextArea placeholder="Enter text here..." resizable={false}/>
</div>
###### Textarea with header above:
<TextArea header="This is a TextArea"/>
###### Small textarea:
<TextArea small/>
###### Medium textarea:
<TextArea medium/>
###### Large textarea:
<TextArea large/>
###### Placeholder text:
<TextArea placeholder="Enter product details here..."/>
###### Disabled textarea:
<TextArea disabled/>
###### Required validation:
<TextArea required header="Description"/>
###### Maximum length validation:
<TextArea maxLength={20}/>
###### Both validations at the same time:
<TextArea required maxLength={20}/>
###### onChange handler:
<TextArea onChange={ () => { alert('onChange executed!'); } }/>
###### TextArea Tooltip requires Label:
<TextArea label="tooltip header" tooltip="Example tooltip message"/>
###### TextArea tooltip right false:
<TextArea label="tooltip header" tooltip="Example tooltip message" tooltipRight={false} />
|
acafc058a11e27c9f3fd58642e36fbc83303e8ac | README.md | README.md |
A task queue for PHP.
## Producers
`PMG\Queue\Producer` creates jobs and puts them into the Queue.
## Consumers
`PMG\Queue\Consumer` fetches jobs from the queue and acts on them.
|
A task queue for PHP.
## Glossary & Core Concepts
- A **queue** is a single bucket into which *messages* are put and fetched.
PMG\Queue supports having multiple queues handled by a single consumer and
producer.
- A **producer** puts *messages* into the queue.
- A **consumper** pulls *messages* out of the queue and acts on it.
- A **message** is serializable object that goes into the queue. Messages must
implement `PMG\Queue\Message`, which is an empty marker interface.
- **Routers** connect messages with their appropriate queues.
- **Handlers** are used by consumers to execute messages. This are simple
callables.
- A **handler resolver** locates handlers for messages.
## Messages
Messages are serializable PHP values that go into the queue. Only strings or
objects are allowed. The queue which a message goes in is determined by a router.
| Make some notes about serialization | Make some notes about serialization
| Markdown | apache-2.0 | AgencyPMG/Queue | markdown | ## Code Before:
A task queue for PHP.
## Producers
`PMG\Queue\Producer` creates jobs and puts them into the Queue.
## Consumers
`PMG\Queue\Consumer` fetches jobs from the queue and acts on them.
## Instruction:
Make some notes about serialization
## Code After:
A task queue for PHP.
## Glossary & Core Concepts
- A **queue** is a single bucket into which *messages* are put and fetched.
PMG\Queue supports having multiple queues handled by a single consumer and
producer.
- A **producer** puts *messages* into the queue.
- A **consumper** pulls *messages* out of the queue and acts on it.
- A **message** is serializable object that goes into the queue. Messages must
implement `PMG\Queue\Message`, which is an empty marker interface.
- **Routers** connect messages with their appropriate queues.
- **Handlers** are used by consumers to execute messages. This are simple
callables.
- A **handler resolver** locates handlers for messages.
## Messages
Messages are serializable PHP values that go into the queue. Only strings or
objects are allowed. The queue which a message goes in is determined by a router.
|
66595ac9f3a3c78391685e6968345eab94636c3a | config/initializers/load_resque.rb | config/initializers/load_resque.rb | require 'resque'
require 'resque/failure/base'
require 'resque/failure/multiple'
require 'resque/failure/redis'
# Load automatically all resque files from lib/resque
Dir[Rails.root.join("lib/resque/*.rb")].each {|f| require f}
Resque.redis = "#{Cartodb.config[:redis]['host']}:#{Cartodb.config[:redis]['port']}"
| require 'resque'
require 'resque/failure/base'
require 'resque/failure/multiple'
require 'resque/failure/redis'
# Load automatically all resque files from lib/resque
Dir[Rails.root.join("lib/resque/*.rb")].each {|f| require f}
Resque.redis = "#{Cartodb.config[:redis]['host']}:#{Cartodb.config[:redis]['port']}"
Resque::Metrics.watch_fork
| Add resque fork metrics too | Add resque fork metrics too
| Ruby | bsd-3-clause | codeandtheory/cartodb,UCL-ShippingGroup/cartodb-1,raquel-ucl/cartodb,DigitalCoder/cartodb,future-analytics/cartodb,dbirchak/cartodb,nyimbi/cartodb,nuxcode/cartodb,raquel-ucl/cartodb,UCL-ShippingGroup/cartodb-1,DigitalCoder/cartodb,CartoDB/cartodb,nuxcode/cartodb,thorncp/cartodb,splashblot/dronedb,nuxcode/cartodb,UCL-ShippingGroup/cartodb-1,DigitalCoder/cartodb,CartoDB/cartodb,future-analytics/cartodb,nyimbi/cartodb,splashblot/dronedb,splashblot/dronedb,future-analytics/cartodb,thorncp/cartodb,splashblot/dronedb,nyimbi/cartodb,future-analytics/cartodb,dbirchak/cartodb,UCL-ShippingGroup/cartodb-1,splashblot/dronedb,thorncp/cartodb,CartoDB/cartodb,nyimbi/cartodb,codeandtheory/cartodb,CartoDB/cartodb,bloomberg/cartodb,codeandtheory/cartodb,raquel-ucl/cartodb,bloomberg/cartodb,raquel-ucl/cartodb,thorncp/cartodb,dbirchak/cartodb,thorncp/cartodb,bloomberg/cartodb,DigitalCoder/cartodb,nyimbi/cartodb,dbirchak/cartodb,codeandtheory/cartodb,DigitalCoder/cartodb,bloomberg/cartodb,dbirchak/cartodb,nuxcode/cartodb,UCL-ShippingGroup/cartodb-1,nuxcode/cartodb,future-analytics/cartodb,raquel-ucl/cartodb,codeandtheory/cartodb,bloomberg/cartodb,CartoDB/cartodb | ruby | ## Code Before:
require 'resque'
require 'resque/failure/base'
require 'resque/failure/multiple'
require 'resque/failure/redis'
# Load automatically all resque files from lib/resque
Dir[Rails.root.join("lib/resque/*.rb")].each {|f| require f}
Resque.redis = "#{Cartodb.config[:redis]['host']}:#{Cartodb.config[:redis]['port']}"
## Instruction:
Add resque fork metrics too
## Code After:
require 'resque'
require 'resque/failure/base'
require 'resque/failure/multiple'
require 'resque/failure/redis'
# Load automatically all resque files from lib/resque
Dir[Rails.root.join("lib/resque/*.rb")].each {|f| require f}
Resque.redis = "#{Cartodb.config[:redis]['host']}:#{Cartodb.config[:redis]['port']}"
Resque::Metrics.watch_fork
|
9671b7e1b5d5b4a1afd2d2d0f58178b67786f835 | tests/n1ql/fts/index/fts_cf2_qf2_index.json | tests/n1ql/fts/index/fts_cf2_qf2_index.json | {
"name": "",
"type": "fulltext-index",
"params": {
"doc_config": {
"docid_prefix_delim": "",
"docid_regexp": "",
"mode": "type_field",
"type_field": "type"
},
"mapping": {
"default_analyzer": "standard",
"default_datetime_parser": "dateTimeOptional",
"default_field": "_all",
"default_mapping": {
"dynamic": false,
"enabled": true,
"properties": {
"email": {
"enabled": true,
"dynamic": false,
"fields": [
{
"name": "email",
"type": "text",
"store": false,
"index": true,
"include_term_vectors": false,
"include_in_all": true,
"docvalues": false
}
]
}
}
},
"default_type": "_default",
"docvalues_dynamic": true,
"index_dynamic": true,
"store_dynamic": false,
"type_field": "_type"
},
"store": {
"indexType": "scorch",
"kvStoreName": ""
}
},
"sourceType": "couchbase",
"sourceName": "bucket-1",
"sourceUUID": "",
"sourceParams": {},
"planParams": {
"maxPartitionsPerPIndex": 1024,
"indexPartitions": 1,
"numReplicas": 0
},
"uuid": ""
} | {
"name": "",
"type": "fulltext-index",
"params": {
"doc_config": {
"docid_prefix_delim": "",
"docid_regexp": "",
"mode": "type_field",
"type_field": "type"
},
"mapping": {
"default_analyzer": "standard",
"default_datetime_parser": "dateTimeOptional",
"default_field": "_all",
"default_mapping": {
"dynamic": false,
"enabled": true,
"properties": {
"email": {
"enabled": true,
"dynamic": false,
"fields": [
{
"name": "email",
"type": "text",
"store": false,
"index": true,
"include_term_vectors": false,
"include_in_all": false,
"docvalues": false,
"analyzer": "keyword"
}
]
}
}
},
"default_type": "_default",
"docvalues_dynamic": true,
"index_dynamic": true,
"store_dynamic": false,
"type_field": "_type"
},
"store": {
"indexType": "scorch",
"kvStoreName": ""
}
},
"sourceType": "couchbase",
"sourceName": "bucket-1",
"sourceUUID": "",
"sourceParams": {},
"planParams": {
"maxPartitionsPerPIndex": 1024,
"indexPartitions": 1,
"numReplicas": 0
},
"uuid": ""
} | Index definition changed for CF2 & QF2 tests cases | Index definition changed for CF2 & QF2 tests cases
Change-Id: Idc3a71539ec2cda798cf6b6c6691138ce054c6af
Reviewed-on: http://review.couchbase.org/113664
Reviewed-by: Girish Benakappa <[email protected]>
Tested-by: Build Bot <[email protected]>
| JSON | apache-2.0 | couchbase/perfrunner,couchbase/perfrunner,couchbase/perfrunner,couchbase/perfrunner,couchbase/perfrunner,couchbase/perfrunner | json | ## Code Before:
{
"name": "",
"type": "fulltext-index",
"params": {
"doc_config": {
"docid_prefix_delim": "",
"docid_regexp": "",
"mode": "type_field",
"type_field": "type"
},
"mapping": {
"default_analyzer": "standard",
"default_datetime_parser": "dateTimeOptional",
"default_field": "_all",
"default_mapping": {
"dynamic": false,
"enabled": true,
"properties": {
"email": {
"enabled": true,
"dynamic": false,
"fields": [
{
"name": "email",
"type": "text",
"store": false,
"index": true,
"include_term_vectors": false,
"include_in_all": true,
"docvalues": false
}
]
}
}
},
"default_type": "_default",
"docvalues_dynamic": true,
"index_dynamic": true,
"store_dynamic": false,
"type_field": "_type"
},
"store": {
"indexType": "scorch",
"kvStoreName": ""
}
},
"sourceType": "couchbase",
"sourceName": "bucket-1",
"sourceUUID": "",
"sourceParams": {},
"planParams": {
"maxPartitionsPerPIndex": 1024,
"indexPartitions": 1,
"numReplicas": 0
},
"uuid": ""
}
## Instruction:
Index definition changed for CF2 & QF2 tests cases
Change-Id: Idc3a71539ec2cda798cf6b6c6691138ce054c6af
Reviewed-on: http://review.couchbase.org/113664
Reviewed-by: Girish Benakappa <[email protected]>
Tested-by: Build Bot <[email protected]>
## Code After:
{
"name": "",
"type": "fulltext-index",
"params": {
"doc_config": {
"docid_prefix_delim": "",
"docid_regexp": "",
"mode": "type_field",
"type_field": "type"
},
"mapping": {
"default_analyzer": "standard",
"default_datetime_parser": "dateTimeOptional",
"default_field": "_all",
"default_mapping": {
"dynamic": false,
"enabled": true,
"properties": {
"email": {
"enabled": true,
"dynamic": false,
"fields": [
{
"name": "email",
"type": "text",
"store": false,
"index": true,
"include_term_vectors": false,
"include_in_all": false,
"docvalues": false,
"analyzer": "keyword"
}
]
}
}
},
"default_type": "_default",
"docvalues_dynamic": true,
"index_dynamic": true,
"store_dynamic": false,
"type_field": "_type"
},
"store": {
"indexType": "scorch",
"kvStoreName": ""
}
},
"sourceType": "couchbase",
"sourceName": "bucket-1",
"sourceUUID": "",
"sourceParams": {},
"planParams": {
"maxPartitionsPerPIndex": 1024,
"indexPartitions": 1,
"numReplicas": 0
},
"uuid": ""
} |
e88c1315829c08f7c89116b656db8d014c208497 | tests/ami/requirements.txt | tests/ami/requirements.txt | git+https://github.com/apache/libcloud.git@trunk#egg=apache-libcloud
paramiko==2.7.1
Jinja2==2.11.1
| git+https://github.com/Kami/libcloud.git@paramiko_compression_and_keepalive#egg=apache-libcloud
#git+https://github.com/apache/libcloud.git@trunk#egg=apache-libcloud
paramiko==2.7.1
Jinja2==2.11.1
| Test use libcloud version which utilizes keep alive and compression. | Test use libcloud version which utilizes keep alive and compression.
| Text | apache-2.0 | scalyr/scalyr-agent-2,scalyr/scalyr-agent-2,scalyr/scalyr-agent-2,scalyr/scalyr-agent-2,imron/scalyr-agent-2 | text | ## Code Before:
git+https://github.com/apache/libcloud.git@trunk#egg=apache-libcloud
paramiko==2.7.1
Jinja2==2.11.1
## Instruction:
Test use libcloud version which utilizes keep alive and compression.
## Code After:
git+https://github.com/Kami/libcloud.git@paramiko_compression_and_keepalive#egg=apache-libcloud
#git+https://github.com/apache/libcloud.git@trunk#egg=apache-libcloud
paramiko==2.7.1
Jinja2==2.11.1
|
45737f5c296c0c802fcaca02f77cab2d38b4ec15 | etc/centos/ansible/tasks/basic_tools.yml | etc/centos/ansible/tasks/basic_tools.yml | - name: install basic tools
yum: name={{ item }} state=present
with_items:
- epel-release
- http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
- man
- man-pages
- zsh
- tree
- wget
- bind-utils
- nc
- tmpwatch
- ntp
- cronie-anacron
- libselinux-python
sudo: yes
| - name: install basic tools
yum: name={{ item }} state=present
with_items:
- epel-release
- http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
- man
- man-pages
- zsh
- tree
- wget
- bind-utils
- nc
- tmpwatch
- ntp
- cronie-anacron
- libselinux-python
- fuse-libs
sudo: yes
| Add fuse-libs to basic tools | Add fuse-libs to basic tools
| YAML | mit | masa0x80/dotfiles,masa0x80/dotfiles,masa0x80/dotfiles,masa0x80/dotfiles | yaml | ## Code Before:
- name: install basic tools
yum: name={{ item }} state=present
with_items:
- epel-release
- http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
- man
- man-pages
- zsh
- tree
- wget
- bind-utils
- nc
- tmpwatch
- ntp
- cronie-anacron
- libselinux-python
sudo: yes
## Instruction:
Add fuse-libs to basic tools
## Code After:
- name: install basic tools
yum: name={{ item }} state=present
with_items:
- epel-release
- http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
- man
- man-pages
- zsh
- tree
- wget
- bind-utils
- nc
- tmpwatch
- ntp
- cronie-anacron
- libselinux-python
- fuse-libs
sudo: yes
|
1ed6fad7409567c39155fa25ef58e3fe067a91c7 | README.md | README.md |
An online tool, located at [http://climate.qubs.ca/](http://climate.qubs.ca/), for visualizing QUBS real-time climate
data sourced from the [API](http://climate.qubs.ca/api/). Written by [David Lougheed](mailto:[email protected]).
## Dependencies
Uses Bower for package management and Highcharts (not-for-profit project license) for graphing.
|
An online tool, located at [http://climate.qubs.ca/](http://climate.qubs.ca/), for visualizing QUBS real-time climate
data sourced from the [API](http://climate.qubs.ca/api/). Written by [David Lougheed](mailto:[email protected]).
## Dependencies
Uses [Bower](https://bower.io/) for package management and Highcharts (not-for-profit project license) for graphing.
## Installation
1. Download the latest release from the [Releases page](https://github.com/qubs/climate-data-visualizer/releases).
2. Unzip the resulting file in a directory publicly accessible from the web.
3. Make sure you have Bower installed. In the installation directory, run `bower install`.
## Configuration
1. Open up the `index.html` file. Find a line labeled `BEGINNING OF CONFIGURATION`. All lines between that line and the
configuration end label should be edited to match the installation specifics on the host server.
| Add installation and configuration instructions. Link to Bower. | Add installation and configuration instructions. Link to Bower.
| Markdown | apache-2.0 | qubs/climate-data-visualizer,qubs/climate-data-visualizer | markdown | ## Code Before:
An online tool, located at [http://climate.qubs.ca/](http://climate.qubs.ca/), for visualizing QUBS real-time climate
data sourced from the [API](http://climate.qubs.ca/api/). Written by [David Lougheed](mailto:[email protected]).
## Dependencies
Uses Bower for package management and Highcharts (not-for-profit project license) for graphing.
## Instruction:
Add installation and configuration instructions. Link to Bower.
## Code After:
An online tool, located at [http://climate.qubs.ca/](http://climate.qubs.ca/), for visualizing QUBS real-time climate
data sourced from the [API](http://climate.qubs.ca/api/). Written by [David Lougheed](mailto:[email protected]).
## Dependencies
Uses [Bower](https://bower.io/) for package management and Highcharts (not-for-profit project license) for graphing.
## Installation
1. Download the latest release from the [Releases page](https://github.com/qubs/climate-data-visualizer/releases).
2. Unzip the resulting file in a directory publicly accessible from the web.
3. Make sure you have Bower installed. In the installation directory, run `bower install`.
## Configuration
1. Open up the `index.html` file. Find a line labeled `BEGINNING OF CONFIGURATION`. All lines between that line and the
configuration end label should be edited to match the installation specifics on the host server.
|
38ba78d555d1cc3990b130da8c78e0ee34419b03 | package.json | package.json | {
"name": "republia-times",
"version": "0.0.1",
"description": "A port of the flash game Republia Times to the web.",
"author": "Brandon Johnson <[email protected]>",
"private": true,
"scripts": {
"build": "set NODE_ENV=production& webpack --progress --colors",
"watch": "webpack -d --progress --colors --watch"
},
"devDependencies": {
"babel-loader": "5.0.0",
"webpack": "1.7.3",
"envify-loader": "0.1.0"
},
"dependencies": {
"immutable": "3.7.1",
"react": "0.13.1",
"lodash": "3.6.0"
}
}
| {
"name": "republia-times",
"version": "0.0.1",
"description": "A port of the flash game Republia Times to the web.",
"author": "Brandon Johnson <[email protected]>",
"private": true,
"scripts": {
"build": "set NODE_ENV=production& webpack --progress --colors",
"watch": "webpack -d --progress --colors --watch"
},
"devDependencies": {
"babel-loader": "5.3.2",
"webpack": "1.11.0",
"envify-loader": "0.1.0"
},
"dependencies": {
"immutable": "3.7.4",
"react": "0.13.3",
"lodash": "3.10.1"
}
}
| Update dependencies to the latest versions | Update dependencies to the latest versions
| JSON | isc | bjohn465/republia-times,bjohn465/republia-times | json | ## Code Before:
{
"name": "republia-times",
"version": "0.0.1",
"description": "A port of the flash game Republia Times to the web.",
"author": "Brandon Johnson <[email protected]>",
"private": true,
"scripts": {
"build": "set NODE_ENV=production& webpack --progress --colors",
"watch": "webpack -d --progress --colors --watch"
},
"devDependencies": {
"babel-loader": "5.0.0",
"webpack": "1.7.3",
"envify-loader": "0.1.0"
},
"dependencies": {
"immutable": "3.7.1",
"react": "0.13.1",
"lodash": "3.6.0"
}
}
## Instruction:
Update dependencies to the latest versions
## Code After:
{
"name": "republia-times",
"version": "0.0.1",
"description": "A port of the flash game Republia Times to the web.",
"author": "Brandon Johnson <[email protected]>",
"private": true,
"scripts": {
"build": "set NODE_ENV=production& webpack --progress --colors",
"watch": "webpack -d --progress --colors --watch"
},
"devDependencies": {
"babel-loader": "5.3.2",
"webpack": "1.11.0",
"envify-loader": "0.1.0"
},
"dependencies": {
"immutable": "3.7.4",
"react": "0.13.3",
"lodash": "3.10.1"
}
}
|
85fb8daa7c1db12ddfeead9bfd413d13734a45f0 | requirements.txt | requirements.txt | cmd2==0.6.8
cryptography==2.3.1
jsonschema==2.6.0
lxml==4.2.1
ndg-httpsclient==0.5.0
pyasn1==0.4.3
pyOpenSSL==18.0.0
PyYAML==3.11
-e git+https://github.com/LabAdvComp/parcel.git@d2670ce65ef6ea3dda0b1bab56a3342bed675958#egg=parcel
| cmd2==0.6.8
cryptography==2.3.1
jsonschema==2.6.0
lxml==4.2.1
ndg-httpsclient==0.5.0
pyasn1==0.4.3
pyOpenSSL==18.0.0
-e git+https://github.com/LabAdvComp/parcel.git@d2670ce65ef6ea3dda0b1bab56a3342bed675958#egg=parcel
PyYAML==3.12
| Update pyyaml from 3.11 to 3.12 | Update pyyaml from 3.11 to 3.12 | Text | apache-2.0 | NCI-GDC/gdc-client,NCI-GDC/gdc-client | text | ## Code Before:
cmd2==0.6.8
cryptography==2.3.1
jsonschema==2.6.0
lxml==4.2.1
ndg-httpsclient==0.5.0
pyasn1==0.4.3
pyOpenSSL==18.0.0
PyYAML==3.11
-e git+https://github.com/LabAdvComp/parcel.git@d2670ce65ef6ea3dda0b1bab56a3342bed675958#egg=parcel
## Instruction:
Update pyyaml from 3.11 to 3.12
## Code After:
cmd2==0.6.8
cryptography==2.3.1
jsonschema==2.6.0
lxml==4.2.1
ndg-httpsclient==0.5.0
pyasn1==0.4.3
pyOpenSSL==18.0.0
-e git+https://github.com/LabAdvComp/parcel.git@d2670ce65ef6ea3dda0b1bab56a3342bed675958#egg=parcel
PyYAML==3.12
|
26acf08c923fb6e5f578422c4ed6c063307c8dae | lib/light_params/lash.rb | lib/light_params/lash.rb | require 'active_model'
module LightParams
class Lash < Hash
include PropertiesConfiguration
include ActiveModel::Serializers::JSON
def initialize(params = {})
LashBuilder.lash_params(self, params).each_pair do |k, v|
self[k.to_sym] = v
end
end
def self.name
@name || super
end
def self.from_json(json)
new(JSON.parse(json))
rescue => e
raise(Errors::JsonParseError, e.message)
end
def attributes
OpenStruct.new(keys: self.class.config[:properties])
end
end
end
| require 'active_model'
module LightParams
class Lash < Hash
include PropertiesConfiguration
include ActiveModel::Serializers::JSON
def initialize(params = {})
LashBuilder.lash_params(self, params).each_pair do |k, v|
self[k.to_sym] = v
end
end
def self.name
@name || super
end
def self.from_json(json, include_root = false)
hash = JSON.parse(json)
hash = hash.values.first if include_root
new(hash)
rescue => e
raise(Errors::JsonParseError, e.message)
end
def attributes
OpenStruct.new(keys: self.class.config[:properties])
end
end
end
| Add ability to parse from json with and without root element | Add ability to parse from json with and without root element
| Ruby | mit | pniemczyk/light_params | ruby | ## Code Before:
require 'active_model'
module LightParams
class Lash < Hash
include PropertiesConfiguration
include ActiveModel::Serializers::JSON
def initialize(params = {})
LashBuilder.lash_params(self, params).each_pair do |k, v|
self[k.to_sym] = v
end
end
def self.name
@name || super
end
def self.from_json(json)
new(JSON.parse(json))
rescue => e
raise(Errors::JsonParseError, e.message)
end
def attributes
OpenStruct.new(keys: self.class.config[:properties])
end
end
end
## Instruction:
Add ability to parse from json with and without root element
## Code After:
require 'active_model'
module LightParams
class Lash < Hash
include PropertiesConfiguration
include ActiveModel::Serializers::JSON
def initialize(params = {})
LashBuilder.lash_params(self, params).each_pair do |k, v|
self[k.to_sym] = v
end
end
def self.name
@name || super
end
def self.from_json(json, include_root = false)
hash = JSON.parse(json)
hash = hash.values.first if include_root
new(hash)
rescue => e
raise(Errors::JsonParseError, e.message)
end
def attributes
OpenStruct.new(keys: self.class.config[:properties])
end
end
end
|
2088c985047c7997ed73da4b4a38cca9dba8d292 | app/view/twig/email/pingtest.twig | app/view/twig/email/pingtest.twig | <p style="color: #204460;"><strong>This is a test e-mail from Bolt!</strong></p>
<p></p>
<p>
This was sent from the Bolt site with the name {{ sitename }} and the IP
address of {{ ip }}, by the user {{ user }}
</p>
| <p style="color: #204460;"><strong>This is a test e-mail from Bolt!</strong></p>
<p></p>
<p>
This was sent from the Bolt site with the following details:
<table>
<tr><td><b>Site title</b></td><td>{{ sitename }}</td></tr>
<tr><td><b>User name</b></td><td>{{ user }}</td></tr>
<tr><td><b>IP address</b></td><td>{{ ip }}</td></tr>
</table>
</p>
| Make email check Twig template a bit nicer | Make email check Twig template a bit nicer
| Twig | mit | electrolinux/bolt,CarsonF/bolt,hugin2005/bolt,rarila/bolt,cdowdy/bolt,nikgo/bolt,one988/cm,electrolinux/bolt,Eiskis/bolt-base,Calinou/bolt,Intendit/bolt,richardhinkamp/bolt,Raistlfiren/bolt,pygillier/bolt,Raistlfiren/bolt,lenvanessen/bolt,bolt/bolt,hugin2005/bolt,cdowdy/bolt,kendoctor/bolt,tekjava/bolt,bolt/bolt,tekjava/bolt,rarila/bolt,cdowdy/bolt,kendoctor/bolt,CarsonF/bolt,lenvanessen/bolt,nantunes/bolt,richardhinkamp/bolt,nikgo/bolt,GawainLynch/bolt,GawainLynch/bolt,hannesl/bolt,xeddmc/bolt,hugin2005/bolt,romulo1984/bolt,romulo1984/bolt,rarila/bolt,romulo1984/bolt,Calinou/bolt,pygillier/bolt,rarila/bolt,nikgo/bolt,winiceo/bolt,rossriley/bolt,CarsonF/bolt,nantunes/bolt,one988/cm,nantunes/bolt,winiceo/bolt,HonzaMikula/masivnipostele,Eiskis/bolt-base,GawainLynch/bolt,CarsonF/bolt,marcin-piela/bolt,codesman/bolt,HonzaMikula/masivnipostele,joshuan/bolt,rossriley/bolt,joshuan/bolt,pygillier/bolt,romulo1984/bolt,nikgo/bolt,hannesl/bolt,joshuan/bolt,Raistlfiren/bolt,kendoctor/bolt,Calinou/bolt,richardhinkamp/bolt,bolt/bolt,bolt/bolt,tekjava/bolt,Raistlfiren/bolt,Eiskis/bolt-base,winiceo/bolt,codesman/bolt,xeddmc/bolt,rossriley/bolt,electrolinux/bolt,rossriley/bolt,codesman/bolt,Intendit/bolt,Calinou/bolt,HonzaMikula/masivnipostele,winiceo/bolt,HonzaMikula/masivnipostele,marcin-piela/bolt,marcin-piela/bolt,hugin2005/bolt,Intendit/bolt,tekjava/bolt,one988/cm,marcin-piela/bolt,electrolinux/bolt,lenvanessen/bolt,richardhinkamp/bolt,xeddmc/bolt,cdowdy/bolt,kendoctor/bolt,codesman/bolt,hannesl/bolt,joshuan/bolt,xeddmc/bolt,lenvanessen/bolt,one988/cm,hannesl/bolt,GawainLynch/bolt,nantunes/bolt,Eiskis/bolt-base,Intendit/bolt,pygillier/bolt | twig | ## Code Before:
<p style="color: #204460;"><strong>This is a test e-mail from Bolt!</strong></p>
<p></p>
<p>
This was sent from the Bolt site with the name {{ sitename }} and the IP
address of {{ ip }}, by the user {{ user }}
</p>
## Instruction:
Make email check Twig template a bit nicer
## Code After:
<p style="color: #204460;"><strong>This is a test e-mail from Bolt!</strong></p>
<p></p>
<p>
This was sent from the Bolt site with the following details:
<table>
<tr><td><b>Site title</b></td><td>{{ sitename }}</td></tr>
<tr><td><b>User name</b></td><td>{{ user }}</td></tr>
<tr><td><b>IP address</b></td><td>{{ ip }}</td></tr>
</table>
</p>
|
636f160c10c58d0ca7feb8cb1a8f746ee135746f | packages/jsonmvc-module-ui/src/fns/parsePatch.js | packages/jsonmvc-module-ui/src/fns/parsePatch.js |
function parsePatch(x) {
let reg = /(add|merge|remove)\s([\/[a-z0-9]+)(?:\s([0-9]+|\[[a-z0-9\-]+\]|\'[a-z0-9]+\'|\"[a-z0-9]+\"|{[a-z\s0-9{}"':,]+}))?/gi
let found
let results = []
while ((found = reg.exec(x)) !== null) {
let op = found[1]
let path = found[2]
let value = found[3]
let patch = {
op,
path
}
if (op !== 'remove') {
patch.value = value
}
results.push(patch)
}
return results
}
export default parsePatch |
let text = '[a-z0-9\-+&\/]*'
let op = '(add|merge|replace)'
let separator = '\\s'
let path = '([\\/[a-z0-9]+)'
let valueObj = `({[a-z\\s0-9{}"':,]+})`
let valueNumber = `-?(?:(?:[1-9]\d*)|0)\.?\d*`
let valueText = `('.*?')`
let patchReg =
op +
separator +
path +
`(?:\\s([0-9]+|\\[[a-z0-9\-]+\\]|\\'[a-z0-9]+\\'|\\"[a-z0-9]+\\"|))?`
let updateReg =
'(add|replace)' +
separator +
path +
separator +
'(?:' + valueText + '|' + valueNumber + ')'
let removeReg =
'(remove)' +
separator +
path
let mergeReg =
'(merge)' +
separator +
path +
separator +
valueObj
function parsePatch(x) {
let reg = new RegExp(updateReg, 'gi')
let found
let results = []
while ((found = reg.exec(x)) !== null) {
let op = found[1]
let path = found[2]
let value = found[3] || found[4]
let patch = {
op,
path
}
if (op !== 'remove') {
patch.value = value
}
results.push(patch)
}
return results
}
export default parsePatch | Add complex regexp matching for patches. | Add complex regexp matching for patches.
| JavaScript | mit | jsonmvc/jsonmvc,jsonmvc/jsonmvc | javascript | ## Code Before:
function parsePatch(x) {
let reg = /(add|merge|remove)\s([\/[a-z0-9]+)(?:\s([0-9]+|\[[a-z0-9\-]+\]|\'[a-z0-9]+\'|\"[a-z0-9]+\"|{[a-z\s0-9{}"':,]+}))?/gi
let found
let results = []
while ((found = reg.exec(x)) !== null) {
let op = found[1]
let path = found[2]
let value = found[3]
let patch = {
op,
path
}
if (op !== 'remove') {
patch.value = value
}
results.push(patch)
}
return results
}
export default parsePatch
## Instruction:
Add complex regexp matching for patches.
## Code After:
let text = '[a-z0-9\-+&\/]*'
let op = '(add|merge|replace)'
let separator = '\\s'
let path = '([\\/[a-z0-9]+)'
let valueObj = `({[a-z\\s0-9{}"':,]+})`
let valueNumber = `-?(?:(?:[1-9]\d*)|0)\.?\d*`
let valueText = `('.*?')`
let patchReg =
op +
separator +
path +
`(?:\\s([0-9]+|\\[[a-z0-9\-]+\\]|\\'[a-z0-9]+\\'|\\"[a-z0-9]+\\"|))?`
let updateReg =
'(add|replace)' +
separator +
path +
separator +
'(?:' + valueText + '|' + valueNumber + ')'
let removeReg =
'(remove)' +
separator +
path
let mergeReg =
'(merge)' +
separator +
path +
separator +
valueObj
function parsePatch(x) {
let reg = new RegExp(updateReg, 'gi')
let found
let results = []
while ((found = reg.exec(x)) !== null) {
let op = found[1]
let path = found[2]
let value = found[3] || found[4]
let patch = {
op,
path
}
if (op !== 'remove') {
patch.value = value
}
results.push(patch)
}
return results
}
export default parsePatch |
43a277b6de8f6387d68533a4a5b2a1ee869202c6 | js/src/util.js | js/src/util.js | /** Wrap DOM selector methods:
* document.querySelector,
* document.getElementById,
* document.getElementsByClassName]
*/
const dom = {
query(arg) {
return document.querySelector(arg);
},
id(arg) {
return document.getElementById(arg);
},
class(arg) {
return document.getElementsByClassName(arg);
},
};
/**
* Returns a (nested) propery from an object, or undefined if it doesn't exist
* @param {String | Array} props - An array of properties or a single property
* @param {Object | Array} obj
*/
const path = (props, obj) => {
let nested = obj;
const properties = typeof props === 'string' ? props.split('.') : props;
for (let i = 0; i < properties.length; i++) {
nested = nested[properties[i]];
if (nested === undefined) {
return nested;
}
}
return nested;
};
module.exports = {
dom,
path,
};
| /** Wrap DOM selector methods:
* document.querySelector,
* document.getElementById,
* document.getElementsByClassName]
*/
const dom = {
query(arg) {
return document.querySelector(arg);
},
id(arg) {
return document.getElementById(arg);
},
class(arg) {
return document.getElementsByClassName(arg);
},
};
/**
* Returns a (nested) propery from an object, or undefined if it doesn't exist
* @param {String | Array} props - An array of properties or a single property
* @param {Object | Array} obj
*/
const path = (props, obj) => {
let nested = obj;
const properties = typeof props === 'string' ? props.split('.') : props;
for (const property of properties) {
nested = nested[property];
if (nested === undefined) {
return nested;
}
}
return nested;
};
/**
* Converts a string to proper case (e.g. 'camera' => 'Camera')
* @param {String} text
* @returns {String}
*/
const properCase = text => `${text[0].toUpperCase()}${text.slice(1)}`;
module.exports = {
dom,
path,
properCase,
};
| Add properCase. Use 'for-of' statement in path. | Add properCase. Use 'for-of' statement in path.
| JavaScript | mit | opentok/accelerator-core-js,adrice727/accelerator-core-js,opentok/accelerator-core-js,adrice727/accelerator-core-js | javascript | ## Code Before:
/** Wrap DOM selector methods:
* document.querySelector,
* document.getElementById,
* document.getElementsByClassName]
*/
const dom = {
query(arg) {
return document.querySelector(arg);
},
id(arg) {
return document.getElementById(arg);
},
class(arg) {
return document.getElementsByClassName(arg);
},
};
/**
* Returns a (nested) propery from an object, or undefined if it doesn't exist
* @param {String | Array} props - An array of properties or a single property
* @param {Object | Array} obj
*/
const path = (props, obj) => {
let nested = obj;
const properties = typeof props === 'string' ? props.split('.') : props;
for (let i = 0; i < properties.length; i++) {
nested = nested[properties[i]];
if (nested === undefined) {
return nested;
}
}
return nested;
};
module.exports = {
dom,
path,
};
## Instruction:
Add properCase. Use 'for-of' statement in path.
## Code After:
/** Wrap DOM selector methods:
* document.querySelector,
* document.getElementById,
* document.getElementsByClassName]
*/
const dom = {
query(arg) {
return document.querySelector(arg);
},
id(arg) {
return document.getElementById(arg);
},
class(arg) {
return document.getElementsByClassName(arg);
},
};
/**
* Returns a (nested) propery from an object, or undefined if it doesn't exist
* @param {String | Array} props - An array of properties or a single property
* @param {Object | Array} obj
*/
const path = (props, obj) => {
let nested = obj;
const properties = typeof props === 'string' ? props.split('.') : props;
for (const property of properties) {
nested = nested[property];
if (nested === undefined) {
return nested;
}
}
return nested;
};
/**
* Converts a string to proper case (e.g. 'camera' => 'Camera')
* @param {String} text
* @returns {String}
*/
const properCase = text => `${text[0].toUpperCase()}${text.slice(1)}`;
module.exports = {
dom,
path,
properCase,
};
|
a38d8429da6d7bdccd5a956fa9a4717282da84c7 | webpack.production.config.js | webpack.production.config.js | const config = require("./webpack.config");
const webpack = require("webpack");
const cdnUrl = process.env.CDN_URL || "/";
config.plugins = (config.plugins || []).concat([
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify("production")
},
SENTRY_DSN: JSON.stringify(
"https://[email protected]/146021"
)
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: true
})
]);
config.output.publicPath = `${cdnUrl}built/`;
config.entry.winamp.unshift("./js/googleAnalytics.min.js");
module.exports = config;
| const config = require("./webpack.config");
const webpack = require("webpack");
const cdnUrl = process.env.CDN_URL || "/";
config.devtool = "source-map";
config.plugins = (config.plugins || []).concat([
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify("production")
},
SENTRY_DSN: JSON.stringify(
"https://[email protected]/146021"
)
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: true
})
]);
config.output.publicPath = `${cdnUrl}built/`;
config.entry.winamp.unshift("./js/googleAnalytics.min.js");
module.exports = config;
| Enable source maps for prod | Enable source maps for prod
| JavaScript | mit | captbaritone/winamp2-js,captbaritone/winamp2-js,captbaritone/winamp2-js | javascript | ## Code Before:
const config = require("./webpack.config");
const webpack = require("webpack");
const cdnUrl = process.env.CDN_URL || "/";
config.plugins = (config.plugins || []).concat([
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify("production")
},
SENTRY_DSN: JSON.stringify(
"https://[email protected]/146021"
)
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: true
})
]);
config.output.publicPath = `${cdnUrl}built/`;
config.entry.winamp.unshift("./js/googleAnalytics.min.js");
module.exports = config;
## Instruction:
Enable source maps for prod
## Code After:
const config = require("./webpack.config");
const webpack = require("webpack");
const cdnUrl = process.env.CDN_URL || "/";
config.devtool = "source-map";
config.plugins = (config.plugins || []).concat([
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify("production")
},
SENTRY_DSN: JSON.stringify(
"https://[email protected]/146021"
)
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: true
})
]);
config.output.publicPath = `${cdnUrl}built/`;
config.entry.winamp.unshift("./js/googleAnalytics.min.js");
module.exports = config;
|
b176c6b6b4840847b627a610b3e3f20686cd5e74 | app/constants/AppConstants.js | app/constants/AppConstants.js | export default {
API_URL: 'https://api.hel.fi/respa/v1',
DATE_FORMAT: 'YYYY-MM-DD',
NOTIFICATION_DEFAULTS: {
message: '',
type: 'info',
timeOut: 5000,
hidden: false,
},
REQUIRED_API_HEADERS: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
SUPPORTED_SEARCH_FILTERS: {
date: '',
people: '',
purpose: '',
search: '',
},
TIME_FORMAT: 'H:mm',
};
| export default {
API_URL: 'https://api.hel.fi/respa/v1',
DATE_FORMAT: 'YYYY-MM-DD',
NOTIFICATION_DEFAULTS: {
message: '',
type: 'info',
timeOut: 5000,
hidden: false,
},
REQUIRED_API_HEADERS: {
'Accept': 'application/json',
'Accept-Language': 'fi',
'Content-Type': 'application/json',
},
SUPPORTED_SEARCH_FILTERS: {
date: '',
people: '',
purpose: '',
search: '',
},
TIME_FORMAT: 'H:mm',
};
| Add Accept-Language header to all API requests | Add Accept-Language header to all API requests
In the pilot version of the service the Accept-Language is
always "fi".
Closes #188.
| JavaScript | mit | fastmonkeys/respa-ui | javascript | ## Code Before:
export default {
API_URL: 'https://api.hel.fi/respa/v1',
DATE_FORMAT: 'YYYY-MM-DD',
NOTIFICATION_DEFAULTS: {
message: '',
type: 'info',
timeOut: 5000,
hidden: false,
},
REQUIRED_API_HEADERS: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
SUPPORTED_SEARCH_FILTERS: {
date: '',
people: '',
purpose: '',
search: '',
},
TIME_FORMAT: 'H:mm',
};
## Instruction:
Add Accept-Language header to all API requests
In the pilot version of the service the Accept-Language is
always "fi".
Closes #188.
## Code After:
export default {
API_URL: 'https://api.hel.fi/respa/v1',
DATE_FORMAT: 'YYYY-MM-DD',
NOTIFICATION_DEFAULTS: {
message: '',
type: 'info',
timeOut: 5000,
hidden: false,
},
REQUIRED_API_HEADERS: {
'Accept': 'application/json',
'Accept-Language': 'fi',
'Content-Type': 'application/json',
},
SUPPORTED_SEARCH_FILTERS: {
date: '',
people: '',
purpose: '',
search: '',
},
TIME_FORMAT: 'H:mm',
};
|
171f915b482318ba0772b031651f33de8c18b18b | ansible/playbook.yml | ansible/playbook.yml | ---
# This playbook will set up a vagrant box for generic LAMP development.
# See the various roles (especially roles/*/tasks/main.yml) for more details.
# Looks for the [devbox] section in the hosts file to determine which machines
# to operate on.
- hosts: t3devbox
sudo: True
# Looks for roles/{role}/tasks/main.yml for tasks, roles/{role}/handlers/main.yml
# for handlers, etcetera.
roles:
- common
- user
- nginx
- php
- db
- tools
- ansible
- bootstrap-webproject
- cleanup
vars_files:
- "global_vars/devbox.yml"
| ---
# This playbook will set up a vagrant box for generic LAMP development.
# See the various roles (especially roles/*/tasks/main.yml) for more details.
# Looks for the [devbox] section in the hosts file to determine which machines
# to operate on.
- hosts: t3devbox
sudo: True
vars_prompt:
- name: bootstrap_webproject
prompt: "Bootstrap webproject? Y/n"
default: "Y"
# Looks for roles/{role}/tasks/main.yml for tasks, roles/{role}/handlers/main.yml
# for handlers, etcetera.
roles:
- common
- user
- nginx
- php
- db
- tools
- ansible
- { role: bootstrap-webproject, when: bootstrap_webproject == "Y" or bootstrap_webproject == "y" }
- cleanup
vars_files:
- "global_vars/devbox.yml"
| Add prompt whether or not to run "bootstrap-webproject" role | [TASK] Add prompt whether or not to run "bootstrap-webproject" role
| YAML | mit | benjaminrau/devbox | yaml | ## Code Before:
---
# This playbook will set up a vagrant box for generic LAMP development.
# See the various roles (especially roles/*/tasks/main.yml) for more details.
# Looks for the [devbox] section in the hosts file to determine which machines
# to operate on.
- hosts: t3devbox
sudo: True
# Looks for roles/{role}/tasks/main.yml for tasks, roles/{role}/handlers/main.yml
# for handlers, etcetera.
roles:
- common
- user
- nginx
- php
- db
- tools
- ansible
- bootstrap-webproject
- cleanup
vars_files:
- "global_vars/devbox.yml"
## Instruction:
[TASK] Add prompt whether or not to run "bootstrap-webproject" role
## Code After:
---
# This playbook will set up a vagrant box for generic LAMP development.
# See the various roles (especially roles/*/tasks/main.yml) for more details.
# Looks for the [devbox] section in the hosts file to determine which machines
# to operate on.
- hosts: t3devbox
sudo: True
vars_prompt:
- name: bootstrap_webproject
prompt: "Bootstrap webproject? Y/n"
default: "Y"
# Looks for roles/{role}/tasks/main.yml for tasks, roles/{role}/handlers/main.yml
# for handlers, etcetera.
roles:
- common
- user
- nginx
- php
- db
- tools
- ansible
- { role: bootstrap-webproject, when: bootstrap_webproject == "Y" or bootstrap_webproject == "y" }
- cleanup
vars_files:
- "global_vars/devbox.yml"
|
25ec5f9e141aba19c1174ad6fdf9d0dfcbc89b58 | Http/frontendRoutes.php | Http/frontendRoutes.php | <?php
use Illuminate\Routing\Router;
/** @var Router $router */
if (! App::runningInConsole()) {
$router->get('{uri}', ['uses' => 'PublicController@uri', 'as' => 'page']);
$router->get('/', ['uses' => 'PublicController@homepage', 'as' => 'homepage']);
}
| <?php
use Illuminate\Routing\Router;
/** @var Router $router */
if (! App::runningInConsole()) {
$router->get('/', ['uses' => 'PublicController@homepage', 'as' => 'homepage']);
$router->any('{uri}', ['uses' => 'PublicController@uri', 'as' => 'page'])->where('uri', '.*');
}
| Allow to have slugs with multiple parts. | Allow to have slugs with multiple parts.
| PHP | mit | AsgardCms/Page,oimken/Page,AsgardCms/Page,oimken/Page,mikemand/Page,mikemand/Page | php | ## Code Before:
<?php
use Illuminate\Routing\Router;
/** @var Router $router */
if (! App::runningInConsole()) {
$router->get('{uri}', ['uses' => 'PublicController@uri', 'as' => 'page']);
$router->get('/', ['uses' => 'PublicController@homepage', 'as' => 'homepage']);
}
## Instruction:
Allow to have slugs with multiple parts.
## Code After:
<?php
use Illuminate\Routing\Router;
/** @var Router $router */
if (! App::runningInConsole()) {
$router->get('/', ['uses' => 'PublicController@homepage', 'as' => 'homepage']);
$router->any('{uri}', ['uses' => 'PublicController@uri', 'as' => 'page'])->where('uri', '.*');
}
|
3afe29d7e96b691f74aa7e8ce01f60a2cebdc499 | src/Styleguide/Elements/Separator.tsx | src/Styleguide/Elements/Separator.tsx | import React from "react"
import styled from "styled-components"
import { space, SpaceProps, themeGet } from "styled-system"
const HR = styled.div.attrs<SpaceProps>({})`
${space};
border-top: 1px solid ${themeGet("colors.black10")};
width: 100%;
`
export class Separator extends React.Component {
render() {
return <HR mb={2} />
}
}
| // @ts-ignore
import React from "react"
import { color } from "@artsy/palette"
import styled from "styled-components"
import { space, SpaceProps } from "styled-system"
interface SeparatorProps extends SpaceProps {}
export const Separator = styled.div.attrs<SeparatorProps>({})`
${space};
border-top: 1px solid ${color("black10")};
width: 100%;
`
| Remove notion of spacing from separator | Remove notion of spacing from separator
| TypeScript | mit | artsy/reaction-force,xtina-starr/reaction,artsy/reaction-force,xtina-starr/reaction,artsy/reaction,artsy/reaction,xtina-starr/reaction,artsy/reaction,xtina-starr/reaction | typescript | ## Code Before:
import React from "react"
import styled from "styled-components"
import { space, SpaceProps, themeGet } from "styled-system"
const HR = styled.div.attrs<SpaceProps>({})`
${space};
border-top: 1px solid ${themeGet("colors.black10")};
width: 100%;
`
export class Separator extends React.Component {
render() {
return <HR mb={2} />
}
}
## Instruction:
Remove notion of spacing from separator
## Code After:
// @ts-ignore
import React from "react"
import { color } from "@artsy/palette"
import styled from "styled-components"
import { space, SpaceProps } from "styled-system"
interface SeparatorProps extends SpaceProps {}
export const Separator = styled.div.attrs<SeparatorProps>({})`
${space};
border-top: 1px solid ${color("black10")};
width: 100%;
`
|
8f1fd79bd0d1901b2385c196e5b1abc87b80b42e | CHANGELOG.md | CHANGELOG.md | Change Log
==========
Version 1.0 *(2013-07-10)*
----------------------------
Initial release.
| Change Log
==========
Version 1.1 *(2013-08-28)*
----------------------------
* When the servlet is mounted at `/foo/*`, requests to `/foo` now succeed, setting `PATH_INFO` to the empty string.
Version 1.0 *(2013-07-10)*
----------------------------
Initial release.
| Document pending changes for this release. | Document pending changes for this release.
| Markdown | apache-2.0 | square/rack-servlet,square/rack-servlet | markdown | ## Code Before:
Change Log
==========
Version 1.0 *(2013-07-10)*
----------------------------
Initial release.
## Instruction:
Document pending changes for this release.
## Code After:
Change Log
==========
Version 1.1 *(2013-08-28)*
----------------------------
* When the servlet is mounted at `/foo/*`, requests to `/foo` now succeed, setting `PATH_INFO` to the empty string.
Version 1.0 *(2013-07-10)*
----------------------------
Initial release.
|
072526a6ec1794edc0f729f2ecb66c47ed38abb9 | harmony/extensions/rng.py | harmony/extensions/rng.py | import random
from discord.ext import commands
class RNG:
def __init__(self, bot):
self.bot = bot
@commands.command()
async def roll(self, dice: str = None):
"""Roll some dice.
Keyword arguments:
dice -- number of dice (X) and faces (Y) in the format XdY
"""
if not dice:
await self.bot.say('Usage: !roll XdY')
return
try:
num_dice, num_faces = map(int, dice.split('d'))
except Exception:
await self.bot.say('Format is XdY')
return
if num_dice > 20 or num_faces > 1000:
await self.bot.say('Max 20 dice and 1000 faces')
return
if num_dice < 1 or num_faces < 1:
await self.bot.say('Stick to positive numbers')
return
total = sum((random.randrange(1, num_faces) for _ in range(int(num_dice))))
await self.bot.say(str(total))
@commands.command()
async def choose(self, *choices: str):
"""
Choose between the options
Keyword arguments:
choices -- Space separated list of options
"""
await self.bot.say(random.choice(choices))
def setup(bot):
bot.add_cog(RNG(bot))
| import random
from discord.ext import commands
class RNG:
def __init__(self, bot):
self.bot = bot
@commands.command()
async def roll(self, dice: str):
"""Roll some dice.
Keyword arguments:
dice -- number of dice (X) and faces (Y) in the format XdY
"""
try:
num_faces, num_dice = map(int, dice.split('d'))
except Exception:
await self.bot.say('Format is XdY!')
return
rolls = [random.randint(1, num_faces) for _ in range(num_dice)]
await self.bot.say(', '.join(rolls) + ' (total {})'.format(sum(rolls)))
@commands.command()
async def choose(self, *choices: str):
"""
Choose between the options
Keyword arguments:
choices -- Space separated list of options
"""
await self.bot.say(random.choice(choices))
def setup(bot):
bot.add_cog(RNG(bot))
| Make roll better and worse | Make roll better and worse
| Python | apache-2.0 | knyghty/harmony | python | ## Code Before:
import random
from discord.ext import commands
class RNG:
def __init__(self, bot):
self.bot = bot
@commands.command()
async def roll(self, dice: str = None):
"""Roll some dice.
Keyword arguments:
dice -- number of dice (X) and faces (Y) in the format XdY
"""
if not dice:
await self.bot.say('Usage: !roll XdY')
return
try:
num_dice, num_faces = map(int, dice.split('d'))
except Exception:
await self.bot.say('Format is XdY')
return
if num_dice > 20 or num_faces > 1000:
await self.bot.say('Max 20 dice and 1000 faces')
return
if num_dice < 1 or num_faces < 1:
await self.bot.say('Stick to positive numbers')
return
total = sum((random.randrange(1, num_faces) for _ in range(int(num_dice))))
await self.bot.say(str(total))
@commands.command()
async def choose(self, *choices: str):
"""
Choose between the options
Keyword arguments:
choices -- Space separated list of options
"""
await self.bot.say(random.choice(choices))
def setup(bot):
bot.add_cog(RNG(bot))
## Instruction:
Make roll better and worse
## Code After:
import random
from discord.ext import commands
class RNG:
def __init__(self, bot):
self.bot = bot
@commands.command()
async def roll(self, dice: str):
"""Roll some dice.
Keyword arguments:
dice -- number of dice (X) and faces (Y) in the format XdY
"""
try:
num_faces, num_dice = map(int, dice.split('d'))
except Exception:
await self.bot.say('Format is XdY!')
return
rolls = [random.randint(1, num_faces) for _ in range(num_dice)]
await self.bot.say(', '.join(rolls) + ' (total {})'.format(sum(rolls)))
@commands.command()
async def choose(self, *choices: str):
"""
Choose between the options
Keyword arguments:
choices -- Space separated list of options
"""
await self.bot.say(random.choice(choices))
def setup(bot):
bot.add_cog(RNG(bot))
|
f214aadafa45d7023ce276c9ea6d1200426f3478 | test/helper.rb | test/helper.rb | require 'rubygems'
require 'bundler'
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end
require 'test/unit'
require 'shoulda-context'
unless ENV['TEST_GEM']
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
end
#$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'inteltech_sms'
class Test::Unit::TestCase
end
| require 'rubygems'
require 'bundler'
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end
require 'test/unit'
require 'shoulda-context'
unless ENV['TEST_GEM']
puts "test/helper: Adding ../lib to $LOAD_PATH"
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
end
#$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'inteltech_sms'
class Test::Unit::TestCase
end
| Comment when ../lib added to load path | Comment when ../lib added to load path
| Ruby | mit | ianheggie/inteltech_sms | ruby | ## Code Before:
require 'rubygems'
require 'bundler'
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end
require 'test/unit'
require 'shoulda-context'
unless ENV['TEST_GEM']
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
end
#$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'inteltech_sms'
class Test::Unit::TestCase
end
## Instruction:
Comment when ../lib added to load path
## Code After:
require 'rubygems'
require 'bundler'
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end
require 'test/unit'
require 'shoulda-context'
unless ENV['TEST_GEM']
puts "test/helper: Adding ../lib to $LOAD_PATH"
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
end
#$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'inteltech_sms'
class Test::Unit::TestCase
end
|
62f4c6b7d24176284054b13c4e1e9b6d631c7b42 | basicTest.py | basicTest.py | import slither, pygame, time
snakey = slither.Sprite()
snakey.setCostumeByName("costume0")
SoExcited = slither.Sprite()
SoExcited.addCostume("SoExcited.png", "avatar")
SoExcited.setCostumeByNumber(0)
SoExcited.goTo(300, 300)
SoExcited.setScaleTo(0.33)
slither.slitherStage.setColor(40, 222, 40)
screen = slither.setup() # Begin slither
continueLoop = True
while continueLoop:
slither.blit(screen) # Display
snakey.changeXBy(1)
SoExcited.changeDirectionBy(1)
# Handle quitting
for event in pygame.event.get():
if event.type == pygame.QUIT:
continueLoop = False
time.sleep(0.01)
| import slither, pygame, time
snakey = slither.Sprite()
snakey.setCostumeByName("costume0")
SoExcited = slither.Sprite()
SoExcited.addCostume("SoExcited.png", "avatar")
SoExcited.setCostumeByNumber(0)
SoExcited.goTo(300, 300)
SoExcited.setScaleTo(0.33)
slither.slitherStage.setColor(40, 222, 40)
screen = slither.setup() # Begin slither
def run_a_frame():
snakey.changeXBy(1)
SoExcited.changeDirectionBy(1)
slither.runMainLoop(run_a_frame)
| Update basic test Now uses the new format by @BookOwl. | Update basic test
Now uses the new format by @BookOwl.
| Python | mit | PySlither/Slither,PySlither/Slither | python | ## Code Before:
import slither, pygame, time
snakey = slither.Sprite()
snakey.setCostumeByName("costume0")
SoExcited = slither.Sprite()
SoExcited.addCostume("SoExcited.png", "avatar")
SoExcited.setCostumeByNumber(0)
SoExcited.goTo(300, 300)
SoExcited.setScaleTo(0.33)
slither.slitherStage.setColor(40, 222, 40)
screen = slither.setup() # Begin slither
continueLoop = True
while continueLoop:
slither.blit(screen) # Display
snakey.changeXBy(1)
SoExcited.changeDirectionBy(1)
# Handle quitting
for event in pygame.event.get():
if event.type == pygame.QUIT:
continueLoop = False
time.sleep(0.01)
## Instruction:
Update basic test
Now uses the new format by @BookOwl.
## Code After:
import slither, pygame, time
snakey = slither.Sprite()
snakey.setCostumeByName("costume0")
SoExcited = slither.Sprite()
SoExcited.addCostume("SoExcited.png", "avatar")
SoExcited.setCostumeByNumber(0)
SoExcited.goTo(300, 300)
SoExcited.setScaleTo(0.33)
slither.slitherStage.setColor(40, 222, 40)
screen = slither.setup() # Begin slither
def run_a_frame():
snakey.changeXBy(1)
SoExcited.changeDirectionBy(1)
slither.runMainLoop(run_a_frame)
|
fb2bd5aba24cf1144d381403ab82f7da0a78fedf | src/components/WeaveElement.js | src/components/WeaveElement.js | import React, { Component } from 'react';
import '../styles/WeaveElement.css';
import '../styles/Scheme4.css';
class WeaveElement extends Component {
constructor() {
super();
this.handleClick = this.handleClick.bind(this);
}
componentState() {
const {row, col, currentState} = this.props;
if (currentState.weaves[row]) {
if (currentState.weaves[row][col] === undefined
|| currentState.weaves[row][col] === false) {
return false;
} else {
return true;
}
} else {
return false;
}
}
render() {
const style = this.componentState()
? "WeaveElement redWeaveElement"
: "WeaveElement whiteElement";
return (<div onClick={this.handleClick} className={style}></div>);
}
handleClick(e) {
if (this.componentState()) this.props.offClick(this.props.row, this.props.col);
else this.props.onClick(this.props.row, this.props.col);
}
}
export default WeaveElement;
| import React, { Component } from 'react';
import '../styles/WeaveElement.css';
import '../styles/Scheme4.css';
class WeaveElement extends Component {
constructor() {
super();
this.handleClick = this.handleClick.bind(this);
}
getThreadingNumber() {
const {col, currentState} = this.props;
const threadingState = currentState.threadings;
return (typeof threadingState[col] === 'number' )
? threadingState[col]
: -1;
}
getTreadlingNumber() {
const {row, currentState} = this.props;
const treadlingState = currentState.treadlings;
return (typeof treadlingState[row] === 'number' )
? treadlingState[row]
: -1;
}
getTieUpState(threadingNum, treadlingNum) {
if (threadingNum === -1 || treadlingNum === -1) return false;
const tieUpState = this.props.currentState.tieUp;
return (tieUpState[threadingNum] && tieUpState[threadingNum][treadlingNum])
? true
: false;
}
componentState() {
return this.getTieUpState(this.getThreadingNumber(), this.getTreadlingNumber());
}
render() {
const style = this.componentState()
? "WeaveElement redWeaveElement"
: "WeaveElement whiteElement";
return (<div onClick={this.handleClick} className={style}></div>);
}
handleClick(e) {
if (this.componentState()) this.props.offClick(this.props.row, this.props.col);
else this.props.onClick(this.props.row, this.props.col);
}
}
export default WeaveElement;
| Add more methods for weave's intersection | Add more methods for weave's intersection
| JavaScript | mit | nobus/weaver,nobus/weaver | javascript | ## Code Before:
import React, { Component } from 'react';
import '../styles/WeaveElement.css';
import '../styles/Scheme4.css';
class WeaveElement extends Component {
constructor() {
super();
this.handleClick = this.handleClick.bind(this);
}
componentState() {
const {row, col, currentState} = this.props;
if (currentState.weaves[row]) {
if (currentState.weaves[row][col] === undefined
|| currentState.weaves[row][col] === false) {
return false;
} else {
return true;
}
} else {
return false;
}
}
render() {
const style = this.componentState()
? "WeaveElement redWeaveElement"
: "WeaveElement whiteElement";
return (<div onClick={this.handleClick} className={style}></div>);
}
handleClick(e) {
if (this.componentState()) this.props.offClick(this.props.row, this.props.col);
else this.props.onClick(this.props.row, this.props.col);
}
}
export default WeaveElement;
## Instruction:
Add more methods for weave's intersection
## Code After:
import React, { Component } from 'react';
import '../styles/WeaveElement.css';
import '../styles/Scheme4.css';
class WeaveElement extends Component {
constructor() {
super();
this.handleClick = this.handleClick.bind(this);
}
getThreadingNumber() {
const {col, currentState} = this.props;
const threadingState = currentState.threadings;
return (typeof threadingState[col] === 'number' )
? threadingState[col]
: -1;
}
getTreadlingNumber() {
const {row, currentState} = this.props;
const treadlingState = currentState.treadlings;
return (typeof treadlingState[row] === 'number' )
? treadlingState[row]
: -1;
}
getTieUpState(threadingNum, treadlingNum) {
if (threadingNum === -1 || treadlingNum === -1) return false;
const tieUpState = this.props.currentState.tieUp;
return (tieUpState[threadingNum] && tieUpState[threadingNum][treadlingNum])
? true
: false;
}
componentState() {
return this.getTieUpState(this.getThreadingNumber(), this.getTreadlingNumber());
}
render() {
const style = this.componentState()
? "WeaveElement redWeaveElement"
: "WeaveElement whiteElement";
return (<div onClick={this.handleClick} className={style}></div>);
}
handleClick(e) {
if (this.componentState()) this.props.offClick(this.props.row, this.props.col);
else this.props.onClick(this.props.row, this.props.col);
}
}
export default WeaveElement;
|
6388a8bd4c03578433710fe728af2f5e3d3b17bf | js/views/BookmarkMenu.module.css | js/views/BookmarkMenu.module.css |
/* Bookmark icon */
.iconBookmark {
margin-left: 4px;
z-index: 1060; /* in front of KmPlot dialog */
}
/* Copy bookmark input */
.bookmarkInput {
bottom: 0;
left: 0;
opacity: 0;
pointer-events: none;
position: fixed; /* Take input out of flow of app controls */
}
/* Import input */
.importInput[type='file'] {
display: none;
}
.placeholder {
visibility: hidden;
}
/* position above the app */
.wrapper {
margin: 5;
position: absolute;
right: 0;
top: 0;
}
.help {
justify-content: flex-end;
}
|
/* Bookmark icon */
.iconBookmark {
margin-left: 4px;
/* Using !important, because I can't out why the css ordering is wrong */
z-index: 1060 !important; /* in front of KmPlot dialog */
}
/* Copy bookmark input */
.bookmarkInput {
bottom: 0;
left: 0;
opacity: 0;
pointer-events: none;
position: fixed; /* Take input out of flow of app controls */
}
/* Import input */
.importInput[type='file'] {
display: none;
}
.placeholder {
visibility: hidden;
}
/* position above the app */
.wrapper {
margin: 5;
position: absolute;
right: 0;
top: 0;
}
.help {
justify-content: flex-end;
}
| Raise Bookmark menu over KM. | Raise Bookmark menu over KM.
| CSS | apache-2.0 | acthp/ucsc-xena-client,ucscXena/ucsc-xena-client,acthp/ucsc-xena-client,ucscXena/ucsc-xena-client,ucscXena/ucsc-xena-client,acthp/ucsc-xena-client,ucscXena/ucsc-xena-client,ucscXena/ucsc-xena-client | css | ## Code Before:
/* Bookmark icon */
.iconBookmark {
margin-left: 4px;
z-index: 1060; /* in front of KmPlot dialog */
}
/* Copy bookmark input */
.bookmarkInput {
bottom: 0;
left: 0;
opacity: 0;
pointer-events: none;
position: fixed; /* Take input out of flow of app controls */
}
/* Import input */
.importInput[type='file'] {
display: none;
}
.placeholder {
visibility: hidden;
}
/* position above the app */
.wrapper {
margin: 5;
position: absolute;
right: 0;
top: 0;
}
.help {
justify-content: flex-end;
}
## Instruction:
Raise Bookmark menu over KM.
## Code After:
/* Bookmark icon */
.iconBookmark {
margin-left: 4px;
/* Using !important, because I can't out why the css ordering is wrong */
z-index: 1060 !important; /* in front of KmPlot dialog */
}
/* Copy bookmark input */
.bookmarkInput {
bottom: 0;
left: 0;
opacity: 0;
pointer-events: none;
position: fixed; /* Take input out of flow of app controls */
}
/* Import input */
.importInput[type='file'] {
display: none;
}
.placeholder {
visibility: hidden;
}
/* position above the app */
.wrapper {
margin: 5;
position: absolute;
right: 0;
top: 0;
}
.help {
justify-content: flex-end;
}
|
d093295d2a63add1bdef03a0388367851a83c687 | modules/interfaces/type-test/helpers/sample-type-map.ts | modules/interfaces/type-test/helpers/sample-type-map.ts | import { GeneralTypeMap } from "../../src";
export interface SampleTypeMap extends GeneralTypeMap {
entities: {
member: { id: string; name: string };
message: {
id: string;
body: string;
};
};
customQueries: {
countMessagesOfMember: {
params: { memberId: string };
result: { count: number };
};
getCurrentVersion: {
result: { version: string };
};
};
customCommands: {
register: { params: { name: string }; result: { ok: 1 } };
};
auths: {
member: {
credentials: { email: string; password: string };
};
};
}
| import { GeneralTypeMap } from "../../src";
export interface SampleTypeMap extends GeneralTypeMap {
entities: {
member: { id: string; name: string };
message: {
id: string;
body: string;
};
};
customQueries: {
countMessagesOfMember: {
params: { memberId: string };
result: { count: number };
};
getCurrentVersion: {
result: { version: string };
};
};
customCommands: {
register: { params: { name: string }; result: { ok: 1 } };
};
auths: {
member: {
credentials: { email: string; password: string };
session: { externalId: string; ttl: number };
};
};
}
| Add test for custom session values | feat(interfaces): Add test for custom session values
| TypeScript | apache-2.0 | phenyl-js/phenyl,phenyl-js/phenyl,phenyl-js/phenyl,phenyl-js/phenyl | typescript | ## Code Before:
import { GeneralTypeMap } from "../../src";
export interface SampleTypeMap extends GeneralTypeMap {
entities: {
member: { id: string; name: string };
message: {
id: string;
body: string;
};
};
customQueries: {
countMessagesOfMember: {
params: { memberId: string };
result: { count: number };
};
getCurrentVersion: {
result: { version: string };
};
};
customCommands: {
register: { params: { name: string }; result: { ok: 1 } };
};
auths: {
member: {
credentials: { email: string; password: string };
};
};
}
## Instruction:
feat(interfaces): Add test for custom session values
## Code After:
import { GeneralTypeMap } from "../../src";
export interface SampleTypeMap extends GeneralTypeMap {
entities: {
member: { id: string; name: string };
message: {
id: string;
body: string;
};
};
customQueries: {
countMessagesOfMember: {
params: { memberId: string };
result: { count: number };
};
getCurrentVersion: {
result: { version: string };
};
};
customCommands: {
register: { params: { name: string }; result: { ok: 1 } };
};
auths: {
member: {
credentials: { email: string; password: string };
session: { externalId: string; ttl: number };
};
};
}
|
e78b3f53150a5f1c170b860f8719e982cf1c6f9e | integration/main.py | integration/main.py | import os
import sys
from spec import Spec, skip
from invoke import run
class Integration(Spec):
def setup(self):
from tessera.application import db
# Ensure we have a clean db target.
self.dbpath = db.engine.url.database
msg = "You seem to have a db in the default location ({0}) - please (re)move it before running tests to avoid collisions."
assert not os.path.exists(self.dbpath), msg.format(self.dbpath)
def teardown(self):
# Teardown only runs if setup completed, so the below will not nuke
# pre-existing dbs that cause setup's check to fail.
if os.path.exists(self.dbpath):
os.remove(self.dbpath)
def is_importable(self):
import tessera
assert tessera.app
assert tessera.db
def can_initdb(self):
from tessera.application import db
from tessera.model.database import Dashboard
# Make sure we can create and look at the DB
db.create_all()
assert len(Dashboard.query.all()) == 0
| import os
import sys
from spec import Spec, skip, eq_
from invoke import run
class Integration(Spec):
def setup(self):
from tessera.application import db
# Ensure we have a clean db target.
self.dbpath = db.engine.url.database
msg = "You seem to have a db in the default location ({0}) - please (re)move it before running tests to avoid collisions."
assert not os.path.exists(self.dbpath), msg.format(self.dbpath)
def teardown(self):
from tessera.application import db
# Teardown only runs if setup completed, so the below will not nuke
# pre-existing dbs that cause setup's check to fail.
if os.path.exists(self.dbpath):
os.remove(self.dbpath)
# Ensure no cached session crap
db.session.close_all()
def is_importable(self):
import tessera
assert tessera.app
assert tessera.db
def can_initdb(self):
from tessera.application import db
from tessera.model.database import Dashboard
# Make sure we can create and look at the DB
db.create_all()
eq_(len(Dashboard.query.all()), 0)
def can_import_fixtures(self):
from tessera.application import db
from tessera.importer.json import JsonImporter
from tessera.model.database import Dashboard
db.create_all()
path = os.path.abspath(os.path.join(
os.path.dirname(__file__), '..', 'demo', 'demo-gallery.json'
))
JsonImporter.import_file(path)
eq_(len(Dashboard.query.all()), 1)
| Fix state bleed, add fixture import test | Fix state bleed, add fixture import test
| Python | apache-2.0 | section-io/tessera,urbanairship/tessera,tessera-metrics/tessera,jmptrader/tessera,section-io/tessera,urbanairship/tessera,aalpern/tessera,section-io/tessera,jmptrader/tessera,filippog/tessera,aalpern/tessera,aalpern/tessera,Slach/tessera,Slach/tessera,urbanairship/tessera,urbanairship/tessera,Slach/tessera,jmptrader/tessera,jmptrader/tessera,tessera-metrics/tessera,aalpern/tessera,section-io/tessera,urbanairship/tessera,tessera-metrics/tessera,jmptrader/tessera,tessera-metrics/tessera,Slach/tessera,filippog/tessera,filippog/tessera,aalpern/tessera,tessera-metrics/tessera | python | ## Code Before:
import os
import sys
from spec import Spec, skip
from invoke import run
class Integration(Spec):
def setup(self):
from tessera.application import db
# Ensure we have a clean db target.
self.dbpath = db.engine.url.database
msg = "You seem to have a db in the default location ({0}) - please (re)move it before running tests to avoid collisions."
assert not os.path.exists(self.dbpath), msg.format(self.dbpath)
def teardown(self):
# Teardown only runs if setup completed, so the below will not nuke
# pre-existing dbs that cause setup's check to fail.
if os.path.exists(self.dbpath):
os.remove(self.dbpath)
def is_importable(self):
import tessera
assert tessera.app
assert tessera.db
def can_initdb(self):
from tessera.application import db
from tessera.model.database import Dashboard
# Make sure we can create and look at the DB
db.create_all()
assert len(Dashboard.query.all()) == 0
## Instruction:
Fix state bleed, add fixture import test
## Code After:
import os
import sys
from spec import Spec, skip, eq_
from invoke import run
class Integration(Spec):
def setup(self):
from tessera.application import db
# Ensure we have a clean db target.
self.dbpath = db.engine.url.database
msg = "You seem to have a db in the default location ({0}) - please (re)move it before running tests to avoid collisions."
assert not os.path.exists(self.dbpath), msg.format(self.dbpath)
def teardown(self):
from tessera.application import db
# Teardown only runs if setup completed, so the below will not nuke
# pre-existing dbs that cause setup's check to fail.
if os.path.exists(self.dbpath):
os.remove(self.dbpath)
# Ensure no cached session crap
db.session.close_all()
def is_importable(self):
import tessera
assert tessera.app
assert tessera.db
def can_initdb(self):
from tessera.application import db
from tessera.model.database import Dashboard
# Make sure we can create and look at the DB
db.create_all()
eq_(len(Dashboard.query.all()), 0)
def can_import_fixtures(self):
from tessera.application import db
from tessera.importer.json import JsonImporter
from tessera.model.database import Dashboard
db.create_all()
path = os.path.abspath(os.path.join(
os.path.dirname(__file__), '..', 'demo', 'demo-gallery.json'
))
JsonImporter.import_file(path)
eq_(len(Dashboard.query.all()), 1)
|
77f69e6f30817e31a34203cce6dbdbdc6eed86dd | server/app.js | server/app.js | // node dependencies
var express = require('express');
var db = require('./db');
var passport = require('passport');
var morgan = require('morgan');
var parser = require('body-parser');
// custom dependencies
var db = require('../db/Listings.js');
var db = require('../db/Users.js');
var db = require('../db/Categories.js');
// use middleware
server.use(session({
secret: 'hackyhackifiers',
resave: false,
saveUninitialized: true
}));
server.use(passport.initialize());
server.use(passport.session());
// Router
var app = express();
// configure passport
// passport.use(new LocalStrategy(User.authenticate()));
// passport.serializeUser(User.serializeUser());
// passport.deserializeUser(User.deserializeUser());
// Set what we are listening on.
app.set('port', 3000);
// Logging and parsing
app.use(morgan('dev'));
app.use(parser.json());
// Set up and use our routes
// app.use('/', router);
// var router = require('./routes.js');
// Serve the client files
app.use(express.static(__dirname + '/../client'));
// If we are being run directly, run the server.
if (!module.parent) {
app.listen(app.get('port'));
console.log('Listening on', app.get('port'));
}
module.exports.app = app;
| // node dependencies
var express = require('express');
var session = require('express-session');
var passport = require('passport');
var morgan = require('morgan');
var parser = require('body-parser');
// custom dependencies
var db = require('../db/db.js');
// var db = require('../db/Listings.js');
// var db = require('../db/Users.js');
// var db = require('../db/Categories.js');
var app = express();
// use middleware
app.use(session({
secret: 'hackyhackifiers',
resave: false,
saveUninitialized: true
}));
app.use(passport.initialize());
app.use(passport.session());
// Router
// configure passport
// passport.use(new LocalStrategy(User.authenticate()));
// passport.serializeUser(User.serializeUser());
// passport.deserializeUser(User.deserializeUser());
// Set what we are listening on.
app.set('port', 3000);
// Logging and parsing
app.use(morgan('dev'));
app.use(parser.json());
// Set up and use our routes
// app.use('/', router);
// var router = require('./routes.js');
// Serve the client files
app.use(express.static(__dirname + '/../client'));
// If we are being run directly, run the server.
if (!module.parent) {
app.listen(app.get('port'));
console.log('Listening on', app.get('port'));
}
module.exports.app = app;
| Fix db-connect commit (to working server state!) | Fix db-connect commit (to working server state!)
- Note: eventually, the node directive that requires 'db.js' will be
replaced by the commented out directives that require the
Listings/Users/Categories models.
| JavaScript | mit | aphavichitr/hackifieds,glistening-gibus/hackifieds,Hackifieds/hackifieds,glistening-gibus/hackifieds,Hackifieds/hackifieds,glistening-gibus/hackifieds,aphavichitr/hackifieds | javascript | ## Code Before:
// node dependencies
var express = require('express');
var db = require('./db');
var passport = require('passport');
var morgan = require('morgan');
var parser = require('body-parser');
// custom dependencies
var db = require('../db/Listings.js');
var db = require('../db/Users.js');
var db = require('../db/Categories.js');
// use middleware
server.use(session({
secret: 'hackyhackifiers',
resave: false,
saveUninitialized: true
}));
server.use(passport.initialize());
server.use(passport.session());
// Router
var app = express();
// configure passport
// passport.use(new LocalStrategy(User.authenticate()));
// passport.serializeUser(User.serializeUser());
// passport.deserializeUser(User.deserializeUser());
// Set what we are listening on.
app.set('port', 3000);
// Logging and parsing
app.use(morgan('dev'));
app.use(parser.json());
// Set up and use our routes
// app.use('/', router);
// var router = require('./routes.js');
// Serve the client files
app.use(express.static(__dirname + '/../client'));
// If we are being run directly, run the server.
if (!module.parent) {
app.listen(app.get('port'));
console.log('Listening on', app.get('port'));
}
module.exports.app = app;
## Instruction:
Fix db-connect commit (to working server state!)
- Note: eventually, the node directive that requires 'db.js' will be
replaced by the commented out directives that require the
Listings/Users/Categories models.
## Code After:
// node dependencies
var express = require('express');
var session = require('express-session');
var passport = require('passport');
var morgan = require('morgan');
var parser = require('body-parser');
// custom dependencies
var db = require('../db/db.js');
// var db = require('../db/Listings.js');
// var db = require('../db/Users.js');
// var db = require('../db/Categories.js');
var app = express();
// use middleware
app.use(session({
secret: 'hackyhackifiers',
resave: false,
saveUninitialized: true
}));
app.use(passport.initialize());
app.use(passport.session());
// Router
// configure passport
// passport.use(new LocalStrategy(User.authenticate()));
// passport.serializeUser(User.serializeUser());
// passport.deserializeUser(User.deserializeUser());
// Set what we are listening on.
app.set('port', 3000);
// Logging and parsing
app.use(morgan('dev'));
app.use(parser.json());
// Set up and use our routes
// app.use('/', router);
// var router = require('./routes.js');
// Serve the client files
app.use(express.static(__dirname + '/../client'));
// If we are being run directly, run the server.
if (!module.parent) {
app.listen(app.get('port'));
console.log('Listening on', app.get('port'));
}
module.exports.app = app;
|
e13073c9cc907022560e7ad6fe5f6d4f079bfd26 | share/migrations/_common/upgrade/2-3/002-insert_permissions.pl | share/migrations/_common/upgrade/2-3/002-insert_permissions.pl | use strict;
use warnings;
use DBIx::Class::Migration::RunScript;
migrate {
my $schema = shift->schema;
my $permission_rs = $schema->resultset('Permission');
$permission_rs->populate
([
{
name => 'doc',
description => 'User can view documents',
},{
name => 'doc_publish',
description => 'User can publish documents',
},{
name => 'doc_save',
description => 'User can save drafts',
},{
name => 'issue_read',
description => 'User can view own issues',
},{
name => 'issue_read_all',
description => 'User can view all issues',
},{
name => 'issue_write',
description => 'User can write to new and own issues',
},{
name => 'issue_write_all',
description => 'User can write to all issues',
},
]);
};
| use strict;
use warnings;
use DBIx::Class::Migration::RunScript;
migrate {
my $schema = shift->schema;
my $permission_rs = $schema->resultset('Permission');
$permission_rs->populate
([
{
name => 'doc',
description => 'User can view documents',
},{
name => 'doc_publish',
description => 'User can publish documents',
},{
name => 'doc_save',
description => 'User can save drafts',
},{
name => 'issue_read',
description => 'User can view own issues',
},{
name => 'issue_read_all',
description => 'User can view all issues',
},{
name => 'issue_write',
description => 'User can write to new and own issues',
},{
name => 'issue_write_all',
description => 'User can write to all issues',
},{
name => 'issue_read_project',
description => 'User can view all issues for certain projects',
},
]);
};
| Add permission to view all project issues | Add permission to view all project issues
| Perl | agpl-3.0 | ctrlo/Brass,ctrlo/Brass,ctrlo/Brass,ctrlo/Brass | perl | ## Code Before:
use strict;
use warnings;
use DBIx::Class::Migration::RunScript;
migrate {
my $schema = shift->schema;
my $permission_rs = $schema->resultset('Permission');
$permission_rs->populate
([
{
name => 'doc',
description => 'User can view documents',
},{
name => 'doc_publish',
description => 'User can publish documents',
},{
name => 'doc_save',
description => 'User can save drafts',
},{
name => 'issue_read',
description => 'User can view own issues',
},{
name => 'issue_read_all',
description => 'User can view all issues',
},{
name => 'issue_write',
description => 'User can write to new and own issues',
},{
name => 'issue_write_all',
description => 'User can write to all issues',
},
]);
};
## Instruction:
Add permission to view all project issues
## Code After:
use strict;
use warnings;
use DBIx::Class::Migration::RunScript;
migrate {
my $schema = shift->schema;
my $permission_rs = $schema->resultset('Permission');
$permission_rs->populate
([
{
name => 'doc',
description => 'User can view documents',
},{
name => 'doc_publish',
description => 'User can publish documents',
},{
name => 'doc_save',
description => 'User can save drafts',
},{
name => 'issue_read',
description => 'User can view own issues',
},{
name => 'issue_read_all',
description => 'User can view all issues',
},{
name => 'issue_write',
description => 'User can write to new and own issues',
},{
name => 'issue_write_all',
description => 'User can write to all issues',
},{
name => 'issue_read_project',
description => 'User can view all issues for certain projects',
},
]);
};
|
ec7ae3a9bbccc4a3ed247ea56e6c333af3fa8031 | tests/unit/components/checkbox/base.spec.js | tests/unit/components/checkbox/base.spec.js | import React from 'react';
import ReactDOM from 'react-dom';
import { Simulate } from 'react-addons-test-utils';
import Checkbox from '../../../../src/components/checkbox.jsx';
import toggleableTests from '../toggleable/base.spec.js';
import { render } from '../../../helpers/rendering.js';
import $ from 'jquery';
describe('Checkbox', function() {
toggleableTests(
props => render(<Checkbox {...props} />),
$component => Simulate.change($component.find(':checkbox')[0])
);
let $checkbox;
const onToggle = () => { };
describe('checked', function() {
beforeEach(function() {
const component = render(<Checkbox onToggle={onToggle} checked />);
$checkbox = $(':checkbox', ReactDOM.findDOMNode(component));
});
it('should be checked', function() {
expect($checkbox.is(':checked')).to.be.true;
});
});
describe('unchecked', function() {
beforeEach(function() {
const component = render(<Checkbox onToggle={onToggle} />);
$checkbox = $(':checkbox', ReactDOM.findDOMNode(component));
});
it('should be unchecked', function() {
expect($checkbox.is(':checked')).to.be.false;
});
});
});
| import React from 'react';
import ReactDOM from 'react-dom';
import { Simulate } from 'react-addons-test-utils';
import Checkbox from '../../../../src/components/checkbox.jsx';
import toggleableTests from '../toggleable/base.spec.js';
import { render } from '../../../helpers/rendering.js';
import $ from 'jquery';
describe('Checkbox', function() {
toggleableTests(
props => render(<Checkbox {...props} />),
$component => Simulate.change($component.find(':checkbox')[0])
);
function renderCheckbox(props) {
const component = render(<Checkbox onToggle={() => { }} {...props} />);
return $(':checkbox', ReactDOM.findDOMNode(component));
}
it('should mark the checkbox when checked', function() {
const $checkbox = renderCheckbox({ checked: true });
expect($checkbox.is(':checked')).to.be.true;
});
it('should not mark the checkbox when unchecked', function() {
const $checkbox = renderCheckbox({ checked: false });
expect($checkbox.is(':checked')).to.be.false;
});
});
| Refactor <Checkbox> tests to reduce duplication | Refactor <Checkbox> tests to reduce duplication
| JavaScript | mit | NiGhTTraX/react-test-buffet,NiGhTTraX/react-test-buffet,NiGhTTraX/react-test-buffet | javascript | ## Code Before:
import React from 'react';
import ReactDOM from 'react-dom';
import { Simulate } from 'react-addons-test-utils';
import Checkbox from '../../../../src/components/checkbox.jsx';
import toggleableTests from '../toggleable/base.spec.js';
import { render } from '../../../helpers/rendering.js';
import $ from 'jquery';
describe('Checkbox', function() {
toggleableTests(
props => render(<Checkbox {...props} />),
$component => Simulate.change($component.find(':checkbox')[0])
);
let $checkbox;
const onToggle = () => { };
describe('checked', function() {
beforeEach(function() {
const component = render(<Checkbox onToggle={onToggle} checked />);
$checkbox = $(':checkbox', ReactDOM.findDOMNode(component));
});
it('should be checked', function() {
expect($checkbox.is(':checked')).to.be.true;
});
});
describe('unchecked', function() {
beforeEach(function() {
const component = render(<Checkbox onToggle={onToggle} />);
$checkbox = $(':checkbox', ReactDOM.findDOMNode(component));
});
it('should be unchecked', function() {
expect($checkbox.is(':checked')).to.be.false;
});
});
});
## Instruction:
Refactor <Checkbox> tests to reduce duplication
## Code After:
import React from 'react';
import ReactDOM from 'react-dom';
import { Simulate } from 'react-addons-test-utils';
import Checkbox from '../../../../src/components/checkbox.jsx';
import toggleableTests from '../toggleable/base.spec.js';
import { render } from '../../../helpers/rendering.js';
import $ from 'jquery';
describe('Checkbox', function() {
toggleableTests(
props => render(<Checkbox {...props} />),
$component => Simulate.change($component.find(':checkbox')[0])
);
function renderCheckbox(props) {
const component = render(<Checkbox onToggle={() => { }} {...props} />);
return $(':checkbox', ReactDOM.findDOMNode(component));
}
it('should mark the checkbox when checked', function() {
const $checkbox = renderCheckbox({ checked: true });
expect($checkbox.is(':checked')).to.be.true;
});
it('should not mark the checkbox when unchecked', function() {
const $checkbox = renderCheckbox({ checked: false });
expect($checkbox.is(':checked')).to.be.false;
});
});
|
8e8e3c1027c361c3edf1053131fa2aa609f22a57 | package.json | package.json | {
"name": "react-page-middleware",
"version": "0.4.0",
"description": "Connect middleware for rendering pages with React JavaScript Library.",
"main": "src/index.js",
"dependencies": {
"node-terminal": "0.1.1",
"async": "0.2.9",
"es5-shim": "~2.1.0",
"React": "git://github.com/facebook/react.git",
"jstransform": "10.0.1",
"optimist": "0.6.0",
"node-haste": "git://github.com/facebook/node-haste.git",
"source-map": "~0.1.22",
"convert-source-map": "0.2.6",
"browser-builtins": "1.0.7"
},
"author": {
"name": "Lee Byron",
"email": "[email protected]",
"url": "http://github.com/leebyron"
},
"license": "Apache-2.0",
"repository" : {
"type" : "git",
"url" : "http://github.com/facebook/react-page-middleware.git"
}
}
| {
"name": "react-page-middleware",
"version": "0.4.0",
"description": "Connect middleware for rendering pages with React JavaScript Library.",
"main": "src/index.js",
"dependencies": {
"async": "0.2.9",
"browser-builtins": "1.0.7",
"convert-source-map": "0.2.6",
"es5-shim": "^4.1.0",
"node-haste": "^1.2.8",
"node-terminal": "0.1.1",
"optimist": "0.6.0",
"react-tools": "^0.13.0",
"source-map": "~0.1.22"
},
"author": {
"name": "Lee Byron",
"email": "[email protected]",
"url": "http://github.com/leebyron"
},
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "http://github.com/reactjs/react-page-middleware.git"
}
}
| Update deps, don't point at git repos | Update deps, don't point at git repos
We don't actually need to point at react git repo, nor node-haste. So
don't.
| JSON | apache-2.0 | facebookarchive/react-page-middleware,frantic/react-page-middleware,kwangkim/react-page-middleware | json | ## Code Before:
{
"name": "react-page-middleware",
"version": "0.4.0",
"description": "Connect middleware for rendering pages with React JavaScript Library.",
"main": "src/index.js",
"dependencies": {
"node-terminal": "0.1.1",
"async": "0.2.9",
"es5-shim": "~2.1.0",
"React": "git://github.com/facebook/react.git",
"jstransform": "10.0.1",
"optimist": "0.6.0",
"node-haste": "git://github.com/facebook/node-haste.git",
"source-map": "~0.1.22",
"convert-source-map": "0.2.6",
"browser-builtins": "1.0.7"
},
"author": {
"name": "Lee Byron",
"email": "[email protected]",
"url": "http://github.com/leebyron"
},
"license": "Apache-2.0",
"repository" : {
"type" : "git",
"url" : "http://github.com/facebook/react-page-middleware.git"
}
}
## Instruction:
Update deps, don't point at git repos
We don't actually need to point at react git repo, nor node-haste. So
don't.
## Code After:
{
"name": "react-page-middleware",
"version": "0.4.0",
"description": "Connect middleware for rendering pages with React JavaScript Library.",
"main": "src/index.js",
"dependencies": {
"async": "0.2.9",
"browser-builtins": "1.0.7",
"convert-source-map": "0.2.6",
"es5-shim": "^4.1.0",
"node-haste": "^1.2.8",
"node-terminal": "0.1.1",
"optimist": "0.6.0",
"react-tools": "^0.13.0",
"source-map": "~0.1.22"
},
"author": {
"name": "Lee Byron",
"email": "[email protected]",
"url": "http://github.com/leebyron"
},
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "http://github.com/reactjs/react-page-middleware.git"
}
}
|
4abac4cb7a6578ddcac1fbbb8d2262b3d6b0f593 | CMakeLists.txt | CMakeLists.txt | CMAKE_MINIMUM_REQUIRED (VERSION 2.8)
PROJECT(SpikeDB)
IF(APPLE)
SET(BOOST_ROOT "/opt/local/")
SET(CMAKE_LIBRARY_PATH /opt/local/lib ${CMAKE_LIBRARY_PATH} )
SET(CMAKE_MODULE_PATH /opt/local/lib)
SET(PYTHON_INCLUDE_PATH "/opt/local/Library/Frameworks/Python.framework/Headers")
SET(PYTHON_LIBRARIES "/opt/local/lib/libpython2.7.dylib")
SET(PYTHON_LIBRARY_DIRS "/opt/local/lib/")
FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation)
ELSE(APPLE)
SET(COREFOUNDATION_LIBRARY "")
ENDIF(APPLE)
SET(PythonLibs_FIND_VERSION 2.7)
FIND_PACKAGE(PkgConfig)
FIND_PACKAGE(PythonLibs REQUIRED)
FIND_PACKAGE(Boost COMPONENTS python REQUIRED)
pkg_check_modules(GTKMM gtkmm-2.4)
pkg_check_modules(CAIRO cairo)
pkg_check_modules(SQLITE3 sqlite3)
SET(PYTHON_INCLUDE_PATH /opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/)
ADD_SUBDIRECTORY(src)
| CMAKE_MINIMUM_REQUIRED (VERSION 2.8)
PROJECT(SpikeDB)
IF(APPLE)
SET(BOOST_ROOT "/opt/local/")
SET(CMAKE_LIBRARY_PATH /opt/local/lib ${CMAKE_LIBRARY_PATH} )
SET(CMAKE_MODULE_PATH /opt/local/lib)
SET(PYTHON_INCLUDE_PATH "/opt/local/Library/Frameworks/Python.framework/Headers")
SET(PYTHON_LIBRARIES "/opt/local/lib/libpython2.7.dylib")
SET(PYTHON_LIBRARY_DIRS "/opt/local/lib/")
FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation)
ELSE(APPLE)
SET(COREFOUNDATION_LIBRARY "")
ENDIF(APPLE)
SET(PythonLibs_FIND_VERSION 2.7)
FIND_PACKAGE(PkgConfig)
FIND_PACKAGE(PythonLibs REQUIRED)
FIND_PACKAGE(Boost COMPONENTS python REQUIRED)
pkg_check_modules(GTKMM gtkmm-2.4)
pkg_check_modules(CAIRO cairo)
pkg_check_modules(SQLITE3 sqlite3)
IF(APPLE)
SET(PYTHON_INCLUDE_PATH /opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/)
ENDIF(APPLE)
ADD_SUBDIRECTORY(src)
| Fix apple (macports) specific line in cmake | Fix apple (macports) specific line in cmake
| Text | bsd-3-clause | baubie/SpikeDB,baubie/SpikeDB,baubie/SpikeDB,baubie/SpikeDB | text | ## Code Before:
CMAKE_MINIMUM_REQUIRED (VERSION 2.8)
PROJECT(SpikeDB)
IF(APPLE)
SET(BOOST_ROOT "/opt/local/")
SET(CMAKE_LIBRARY_PATH /opt/local/lib ${CMAKE_LIBRARY_PATH} )
SET(CMAKE_MODULE_PATH /opt/local/lib)
SET(PYTHON_INCLUDE_PATH "/opt/local/Library/Frameworks/Python.framework/Headers")
SET(PYTHON_LIBRARIES "/opt/local/lib/libpython2.7.dylib")
SET(PYTHON_LIBRARY_DIRS "/opt/local/lib/")
FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation)
ELSE(APPLE)
SET(COREFOUNDATION_LIBRARY "")
ENDIF(APPLE)
SET(PythonLibs_FIND_VERSION 2.7)
FIND_PACKAGE(PkgConfig)
FIND_PACKAGE(PythonLibs REQUIRED)
FIND_PACKAGE(Boost COMPONENTS python REQUIRED)
pkg_check_modules(GTKMM gtkmm-2.4)
pkg_check_modules(CAIRO cairo)
pkg_check_modules(SQLITE3 sqlite3)
SET(PYTHON_INCLUDE_PATH /opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/)
ADD_SUBDIRECTORY(src)
## Instruction:
Fix apple (macports) specific line in cmake
## Code After:
CMAKE_MINIMUM_REQUIRED (VERSION 2.8)
PROJECT(SpikeDB)
IF(APPLE)
SET(BOOST_ROOT "/opt/local/")
SET(CMAKE_LIBRARY_PATH /opt/local/lib ${CMAKE_LIBRARY_PATH} )
SET(CMAKE_MODULE_PATH /opt/local/lib)
SET(PYTHON_INCLUDE_PATH "/opt/local/Library/Frameworks/Python.framework/Headers")
SET(PYTHON_LIBRARIES "/opt/local/lib/libpython2.7.dylib")
SET(PYTHON_LIBRARY_DIRS "/opt/local/lib/")
FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation)
ELSE(APPLE)
SET(COREFOUNDATION_LIBRARY "")
ENDIF(APPLE)
SET(PythonLibs_FIND_VERSION 2.7)
FIND_PACKAGE(PkgConfig)
FIND_PACKAGE(PythonLibs REQUIRED)
FIND_PACKAGE(Boost COMPONENTS python REQUIRED)
pkg_check_modules(GTKMM gtkmm-2.4)
pkg_check_modules(CAIRO cairo)
pkg_check_modules(SQLITE3 sqlite3)
IF(APPLE)
SET(PYTHON_INCLUDE_PATH /opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/)
ENDIF(APPLE)
ADD_SUBDIRECTORY(src)
|
a01333ee1dbef13bd6b8df38f30ddc02887f75b9 | app/helpers/application_helper.rb | app/helpers/application_helper.rb | module ApplicationHelper
def absolute_url(relative_url)
relative_url = url_for(relative_url) unless relative_url.is_a? String
(URI(request.url) + relative_url).to_s
end
def brand
content_tag :div, class: 'imgshr-brand' do
icon(:picture, class: 'imgshr-icon') + 'IMGSHR'
end
end
def controller_class
params[:controller] + '-' + params[:action]
end
# Convert flash message type to bootstrap class.
def flash_class(type)
({notice: :info, alert: :warning, error: :danger}[type.to_sym] || type).to_s
end
def gallery_referer?(picture)
URI(request.referer).path == url_for(picture.gallery)
end
# Helper for glyphicon span tags.
def icon(name, options = {})
name = name.to_s.gsub(/_/, '-')
content_tag :span, nil, class: "glyphicon glyphicon-#{name} #{options[:class]}", id: options[:id]
end
end
| module ApplicationHelper
def absolute_url(relative_url)
relative_url = url_for(relative_url) unless relative_url.is_a? String
(URI(request.url) + relative_url).to_s
end
def brand
content_tag :div, class: 'imgshr-brand' do
icon(:picture, class: 'imgshr-icon') + 'IMGSHR'
end
end
def controller_class
params[:controller] + '-' + params[:action]
end
# Convert flash message type to bootstrap class.
def flash_class(type)
({notice: :info, alert: :warning, error: :danger}[type.to_sym] || type).to_s
end
def gallery_referer?(picture)
return false unless request.referer
URI(request.referer).path == url_for(picture.gallery)
end
# Helper for glyphicon span tags.
def icon(name, options = {})
name = name.to_s.gsub(/_/, '-')
content_tag :span, nil, class: "glyphicon glyphicon-#{name} #{options[:class]}", id: options[:id]
end
end
| Fix exception in gallery_referer? helper, if referer nil. | Fix exception in gallery_referer? helper, if referer nil.
| Ruby | agpl-3.0 | nning/imgshr,nning/imgshr,nning/imgshr,nning/imgshr | ruby | ## Code Before:
module ApplicationHelper
def absolute_url(relative_url)
relative_url = url_for(relative_url) unless relative_url.is_a? String
(URI(request.url) + relative_url).to_s
end
def brand
content_tag :div, class: 'imgshr-brand' do
icon(:picture, class: 'imgshr-icon') + 'IMGSHR'
end
end
def controller_class
params[:controller] + '-' + params[:action]
end
# Convert flash message type to bootstrap class.
def flash_class(type)
({notice: :info, alert: :warning, error: :danger}[type.to_sym] || type).to_s
end
def gallery_referer?(picture)
URI(request.referer).path == url_for(picture.gallery)
end
# Helper for glyphicon span tags.
def icon(name, options = {})
name = name.to_s.gsub(/_/, '-')
content_tag :span, nil, class: "glyphicon glyphicon-#{name} #{options[:class]}", id: options[:id]
end
end
## Instruction:
Fix exception in gallery_referer? helper, if referer nil.
## Code After:
module ApplicationHelper
def absolute_url(relative_url)
relative_url = url_for(relative_url) unless relative_url.is_a? String
(URI(request.url) + relative_url).to_s
end
def brand
content_tag :div, class: 'imgshr-brand' do
icon(:picture, class: 'imgshr-icon') + 'IMGSHR'
end
end
def controller_class
params[:controller] + '-' + params[:action]
end
# Convert flash message type to bootstrap class.
def flash_class(type)
({notice: :info, alert: :warning, error: :danger}[type.to_sym] || type).to_s
end
def gallery_referer?(picture)
return false unless request.referer
URI(request.referer).path == url_for(picture.gallery)
end
# Helper for glyphicon span tags.
def icon(name, options = {})
name = name.to_s.gsub(/_/, '-')
content_tag :span, nil, class: "glyphicon glyphicon-#{name} #{options[:class]}", id: options[:id]
end
end
|
f936e1b869713c43d260827f46b8e819b02ed741 | src/main/java/net/md_5/bungee/command/CommandAlert.java | src/main/java/net/md_5/bungee/command/CommandAlert.java | package net.md_5.bungee.command;
import net.md_5.bungee.BungeeCord;
import net.md_5.bungee.ChatColor;
import net.md_5.bungee.Permission;
import net.md_5.bungee.UserConnection;
public class CommandAlert extends Command
{
@Override
public void execute(CommandSender sender, String[] args)
{
if (getPermission(sender) != Permission.ADMIN)
{
sender.sendMessage(ChatColor.RED + "You do not have permission to execute this command!");
return;
}
if (args.length == 0)
{
sender.sendMessage(ChatColor.RED + "You must supply a message.");
} else
{
StringBuilder builder = new StringBuilder();
if (!args[0].contains("&h")) //They want to hide the alert prefix
{
builder.append(ChatColor.DARK_PURPLE);
builder.append("[Alert] "); //No space at start.
} else
{
args[0].replaceAll("&h", ""); //Remove hide control code from message
}
for (String s : args)
{
builder.append(ChatColor.translateAlternateColorCodes('&', s)); //Allow custom colours
builder.append(" ");
}
String message = builder.substring(0, builder.length() - 1);
for (UserConnection con : BungeeCord.instance.connections.values())
{
con.sendMessage(message);
}
}
}
}
| package net.md_5.bungee.command;
import net.md_5.bungee.BungeeCord;
import net.md_5.bungee.ChatColor;
import net.md_5.bungee.Permission;
import net.md_5.bungee.UserConnection;
public class CommandAlert extends Command
{
@Override
public void execute(CommandSender sender, String[] args)
{
if (getPermission(sender) != Permission.ADMIN)
{
sender.sendMessage(ChatColor.RED + "You do not have permission to execute this command!");
return;
}
if (args.length == 0)
{
sender.sendMessage(ChatColor.RED + "You must supply a message.");
} else
{
StringBuilder builder = new StringBuilder();
if (!args[0].contains("&h")) //They want to hide the alert prefix
{
builder.append(ChatColor.DARK_PURPLE);
builder.append("[Alert] "); //No space at start.
}
for (String s : args)
{
s = s.replaceAll("&h", ""); //Fix replace
builder.append(ChatColor.translateAlternateColorCodes('&', s)); //Allow custom colours
builder.append(" ");
}
String message = builder.substring(0, builder.length() - 1);
for (UserConnection con : BungeeCord.instance.connections.values())
{
con.sendMessage(message);
}
}
}
}
| Fix &h not being removed from the message properly | Fix &h not being removed from the message properly | Java | bsd-3-clause | dentmaged/BungeeCord,LinEvil/BungeeCord,BlueAnanas/BungeeCord,ewized/BungeeCord,starlis/BungeeCord,dentmaged/BungeeCord,mariolars/BungeeCord,xxyy/BungeeCord,Xetius/BungeeCord,LetsPlayOnline/BungeeJumper,starlis/BungeeCord,GingerGeek/BungeeCord,BlueAnanas/BungeeCord,Yive/BungeeCord,GamesConMCGames/Bungeecord,ewized/BungeeCord,ewized/BungeeCord,XMeowTW/BungeeCord,Yive/BungeeCord,TCPR/BungeeCord,GamesConMCGames/Bungeecord,Xetius/BungeeCord,xxyy/BungeeCord,XMeowTW/BungeeCord,TCPR/BungeeCord,ConnorLinfoot/BungeeCord,LetsPlayOnline/BungeeJumper,ConnorLinfoot/BungeeCord,mariolars/BungeeCord,ConnorLinfoot/BungeeCord,BlueAnanas/BungeeCord,Yive/BungeeCord,GamesConMCGames/Bungeecord,PrisonPvP/BungeeCord,LolnetModPack/BungeeCord,LinEvil/BungeeCord,LolnetModPack/BungeeCord,btilm305/BungeeCord,xxyy/BungeeCord,Xetius/BungeeCord,LolnetModPack/BungeeCord,TCPR/BungeeCord,LinEvil/BungeeCord,GingerGeek/BungeeCord,btilm305/BungeeCord,btilm305/BungeeCord,mariolars/BungeeCord,PrisonPvP/BungeeCord,GingerGeek/BungeeCord,XMeowTW/BungeeCord,LetsPlayOnline/BungeeJumper,starlis/BungeeCord,PrisonPvP/BungeeCord,dentmaged/BungeeCord | java | ## Code Before:
package net.md_5.bungee.command;
import net.md_5.bungee.BungeeCord;
import net.md_5.bungee.ChatColor;
import net.md_5.bungee.Permission;
import net.md_5.bungee.UserConnection;
public class CommandAlert extends Command
{
@Override
public void execute(CommandSender sender, String[] args)
{
if (getPermission(sender) != Permission.ADMIN)
{
sender.sendMessage(ChatColor.RED + "You do not have permission to execute this command!");
return;
}
if (args.length == 0)
{
sender.sendMessage(ChatColor.RED + "You must supply a message.");
} else
{
StringBuilder builder = new StringBuilder();
if (!args[0].contains("&h")) //They want to hide the alert prefix
{
builder.append(ChatColor.DARK_PURPLE);
builder.append("[Alert] "); //No space at start.
} else
{
args[0].replaceAll("&h", ""); //Remove hide control code from message
}
for (String s : args)
{
builder.append(ChatColor.translateAlternateColorCodes('&', s)); //Allow custom colours
builder.append(" ");
}
String message = builder.substring(0, builder.length() - 1);
for (UserConnection con : BungeeCord.instance.connections.values())
{
con.sendMessage(message);
}
}
}
}
## Instruction:
Fix &h not being removed from the message properly
## Code After:
package net.md_5.bungee.command;
import net.md_5.bungee.BungeeCord;
import net.md_5.bungee.ChatColor;
import net.md_5.bungee.Permission;
import net.md_5.bungee.UserConnection;
public class CommandAlert extends Command
{
@Override
public void execute(CommandSender sender, String[] args)
{
if (getPermission(sender) != Permission.ADMIN)
{
sender.sendMessage(ChatColor.RED + "You do not have permission to execute this command!");
return;
}
if (args.length == 0)
{
sender.sendMessage(ChatColor.RED + "You must supply a message.");
} else
{
StringBuilder builder = new StringBuilder();
if (!args[0].contains("&h")) //They want to hide the alert prefix
{
builder.append(ChatColor.DARK_PURPLE);
builder.append("[Alert] "); //No space at start.
}
for (String s : args)
{
s = s.replaceAll("&h", ""); //Fix replace
builder.append(ChatColor.translateAlternateColorCodes('&', s)); //Allow custom colours
builder.append(" ");
}
String message = builder.substring(0, builder.length() - 1);
for (UserConnection con : BungeeCord.instance.connections.values())
{
con.sendMessage(message);
}
}
}
}
|
6fcc0a95349ad6bad15d4f8b06c34436e5c97d29 | roles/go/tasks/main.yml | roles/go/tasks/main.yml | ---
- name: gocode
file: path={{ home_dir }}/gocode state=directory
tags: go
- name: go get packages
command: go get {{ item }}
with_items: "{{ go_packages }}"
ignore_errors: yes
tags: go
# https://gist.github.com/bryanl/465a188d8495a2457fa8
- name: godoc launchctl config
template:
src: godoc.plist
dest: "{{ home_dir }}/Library/LaunchAgents/rcolvin.godoc.plist"
tags: go
- name: godoc launchctl load
command: "launchctl load {{ home_dir }}/Library/LaunchAgents/rcolvin.godoc.plist"
tags: go
| ---
- name: GOPATH dir
file:
path: "{{ home_dir }}/go"
state: directory
tags: go
- name: go get packages
command: go get {{ item }}
with_items: "{{ go_packages }}"
ignore_errors: yes
tags: go
# https://gist.github.com/bryanl/465a188d8495a2457fa8
- name: godoc launchctl config
template:
src: godoc.plist
dest: "{{ home_dir }}/Library/LaunchAgents/rcolvin.godoc.plist"
tags: go
- name: godoc launchctl load
command: "launchctl load {{ home_dir }}/Library/LaunchAgents/rcolvin.godoc.plist"
tags: go
| Use the new GOPATH default | Use the new GOPATH default
| YAML | mit | geetarista/mac-ansible | yaml | ## Code Before:
---
- name: gocode
file: path={{ home_dir }}/gocode state=directory
tags: go
- name: go get packages
command: go get {{ item }}
with_items: "{{ go_packages }}"
ignore_errors: yes
tags: go
# https://gist.github.com/bryanl/465a188d8495a2457fa8
- name: godoc launchctl config
template:
src: godoc.plist
dest: "{{ home_dir }}/Library/LaunchAgents/rcolvin.godoc.plist"
tags: go
- name: godoc launchctl load
command: "launchctl load {{ home_dir }}/Library/LaunchAgents/rcolvin.godoc.plist"
tags: go
## Instruction:
Use the new GOPATH default
## Code After:
---
- name: GOPATH dir
file:
path: "{{ home_dir }}/go"
state: directory
tags: go
- name: go get packages
command: go get {{ item }}
with_items: "{{ go_packages }}"
ignore_errors: yes
tags: go
# https://gist.github.com/bryanl/465a188d8495a2457fa8
- name: godoc launchctl config
template:
src: godoc.plist
dest: "{{ home_dir }}/Library/LaunchAgents/rcolvin.godoc.plist"
tags: go
- name: godoc launchctl load
command: "launchctl load {{ home_dir }}/Library/LaunchAgents/rcolvin.godoc.plist"
tags: go
|
e0ca4330b46d6c8f27befeefa7656b0a89331e5b | server/server.spec.js | server/server.spec.js | import Server from './server';
import { MockSocket } from './com/mocks';
describe('Server', function() {
beforeEach(function() {
this.server = new Server();
});
describe('connection of new client', function() {
beforeEach(function() {
this.client = new MockSocket();
this.server.connect(this.client);
this.message = this.client.lastMessage('init');
});
it('welcomes the player', function() {
expect(this.message.message).toEqual('welcome');
});
it('gives the player\'s name', function() {
expect(this.message.name).toMatch(/^Player [0-9]+$/);
});
it('gives the player\'s id', function() {
expect(this.message.id).toMatch(/^[0-9]+$/);
});
it('adds the client to its players list', function() {
expect(this.server.players).toHaveKey(this.client);
});
});
}); | import Server from './server';
import { MockSocket } from './com/mocks';
describe('Server', function() {
beforeEach(function() {
this.server = new Server();
});
describe('connection of new client', function() {
beforeEach(function() {
this.client = new MockSocket();
this.server.connect(this.client);
this.message = this.client.lastMessage('init');
});
it('welcomes the player', function() {
expect(this.message.message).toEqual('welcome');
});
it('gives the player\'s name', function() {
expect(this.message.name).toMatch(/^Player [0-9]+$/);
});
it('gives the player\'s id', function() {
expect(this.message.id).toMatch(/^[0-9]+$/);
});
it('adds the client to its players list', function() {
expect(this.server.players).toHaveKey(this.client);
});
});
describe('disconnection of a client', function() {
beforeEach(function() {
this.client = new MockSocket();
this.server.connect(this.client);
this.server.disconnect(this.client);
});
it('removes client from the list', function() {
expect(this.server.players).not.toHaveKey(this.client);
});
});
}); | Add tests about the server. | Add tests about the server.
| JavaScript | mit | Kineolyan/Catane,Kineolyan/Catane | javascript | ## Code Before:
import Server from './server';
import { MockSocket } from './com/mocks';
describe('Server', function() {
beforeEach(function() {
this.server = new Server();
});
describe('connection of new client', function() {
beforeEach(function() {
this.client = new MockSocket();
this.server.connect(this.client);
this.message = this.client.lastMessage('init');
});
it('welcomes the player', function() {
expect(this.message.message).toEqual('welcome');
});
it('gives the player\'s name', function() {
expect(this.message.name).toMatch(/^Player [0-9]+$/);
});
it('gives the player\'s id', function() {
expect(this.message.id).toMatch(/^[0-9]+$/);
});
it('adds the client to its players list', function() {
expect(this.server.players).toHaveKey(this.client);
});
});
});
## Instruction:
Add tests about the server.
## Code After:
import Server from './server';
import { MockSocket } from './com/mocks';
describe('Server', function() {
beforeEach(function() {
this.server = new Server();
});
describe('connection of new client', function() {
beforeEach(function() {
this.client = new MockSocket();
this.server.connect(this.client);
this.message = this.client.lastMessage('init');
});
it('welcomes the player', function() {
expect(this.message.message).toEqual('welcome');
});
it('gives the player\'s name', function() {
expect(this.message.name).toMatch(/^Player [0-9]+$/);
});
it('gives the player\'s id', function() {
expect(this.message.id).toMatch(/^[0-9]+$/);
});
it('adds the client to its players list', function() {
expect(this.server.players).toHaveKey(this.client);
});
});
describe('disconnection of a client', function() {
beforeEach(function() {
this.client = new MockSocket();
this.server.connect(this.client);
this.server.disconnect(this.client);
});
it('removes client from the list', function() {
expect(this.server.players).not.toHaveKey(this.client);
});
});
}); |
ebebe5f139fb2aa67a793ecde64396b70fb773eb | README.md | README.md |
Just type
```shell
rubyweb [document_root]
```
at the command line. For example:
```shell
rubyweb ~/web/
```
Will serve pages from `$HOME/web`.
If you leave off the document root, it will default to your current working directory.
|
```shell
gem install rubyweb
rubyweb
```
## Use
Just type
```shell
rubyweb [document_root]
```
at the command line. For example:
```shell
rubyweb ~/web/
```
Will serve pages from `$HOME/web`.
If you leave off the document root, it will default to your current working directory.
## Note
Running `rubyweb` at the command line is equivalent to typing:
```shell
ruby -run -r httpd . -p 8000
```
Where '.' is the document root.
You choose!
| Add note about ruby -run version | Add note about ruby -run version
| Markdown | mit | allolex/rubyweb | markdown | ## Code Before:
Just type
```shell
rubyweb [document_root]
```
at the command line. For example:
```shell
rubyweb ~/web/
```
Will serve pages from `$HOME/web`.
If you leave off the document root, it will default to your current working directory.
## Instruction:
Add note about ruby -run version
## Code After:
```shell
gem install rubyweb
rubyweb
```
## Use
Just type
```shell
rubyweb [document_root]
```
at the command line. For example:
```shell
rubyweb ~/web/
```
Will serve pages from `$HOME/web`.
If you leave off the document root, it will default to your current working directory.
## Note
Running `rubyweb` at the command line is equivalent to typing:
```shell
ruby -run -r httpd . -p 8000
```
Where '.' is the document root.
You choose!
|
b17e39436bde57558c1a9d6e70330a51dd1d0d19 | website/addons/osffiles/utils.py | website/addons/osffiles/utils.py | from website.addons.osffiles.exceptions import FileNotFoundError
def get_versions(filename, node):
"""Return file versions for a :class:`NodeFile`.
:raises: FileNotFoundError if file does not exists for the node.
"""
try:
return node.files_versions[filename.replace('.', '_')]
except KeyError:
raise FileNotFoundError('{0!r} not found for node {1!r}'.format(
filename, node._id
))
def get_latest_version_number(filename, node):
"""Return the current version number (0-indexed) for a NodeFile.
:raises: FileNotFoundError if file does not exists for the node.
"""
versions = get_versions(filename, node)
return len(versions) - 1
| from website.addons.osffiles.exceptions import FileNotFoundError
def get_versions(filename, node):
"""Return IDs for a file's version records.
:param str filename: The name of the file.
:param Node node: The node which has the requested file.
:return: List of ids (strings) for :class:`NodeFile` records.
:raises: FileNotFoundError if file does not exists for the node.
"""
try:
return node.files_versions[filename.replace('.', '_')]
except KeyError:
raise FileNotFoundError('{0!r} not found for node {1!r}'.format(
filename, node._id
))
def get_latest_version_number(filename, node):
"""Return the current version number (0-indexed) for a file.
:param str filename: The name of the file.
:param Node node: The node which has the requested file.
:raises: FileNotFoundError if file does not exists for the node.
"""
versions = get_versions(filename, node)
return len(versions) - 1
| Clarify documentation for get_versions and get_latest_version_number. | Clarify documentation for get_versions and get_latest_version_number.
| Python | apache-2.0 | bdyetton/prettychart,Johnetordoff/osf.io,caneruguz/osf.io,ZobairAlijan/osf.io,brandonPurvis/osf.io,arpitar/osf.io,GageGaskins/osf.io,DanielSBrown/osf.io,brianjgeiger/osf.io,fabianvf/osf.io,caseyrygt/osf.io,dplorimer/osf,MerlinZhang/osf.io,zkraime/osf.io,zkraime/osf.io,hmoco/osf.io,lamdnhan/osf.io,cosenal/osf.io,lyndsysimon/osf.io,HarryRybacki/osf.io,caseyrollins/osf.io,zamattiac/osf.io,ZobairAlijan/osf.io,RomanZWang/osf.io,cldershem/osf.io,cldershem/osf.io,asanfilippo7/osf.io,Johnetordoff/osf.io,laurenrevere/osf.io,asanfilippo7/osf.io,brianjgeiger/osf.io,TomBaxter/osf.io,mluo613/osf.io,rdhyee/osf.io,cosenal/osf.io,ticklemepierce/osf.io,Ghalko/osf.io,saradbowman/osf.io,emetsger/osf.io,cwisecarver/osf.io,mattclark/osf.io,petermalcolm/osf.io,CenterForOpenScience/osf.io,TomHeatwole/osf.io,reinaH/osf.io,pattisdr/osf.io,doublebits/osf.io,brianjgeiger/osf.io,Nesiehr/osf.io,kushG/osf.io,jmcarp/osf.io,zachjanicki/osf.io,abought/osf.io,RomanZWang/osf.io,haoyuchen1992/osf.io,pattisdr/osf.io,kushG/osf.io,monikagrabowska/osf.io,Nesiehr/osf.io,jolene-esposito/osf.io,TomBaxter/osf.io,doublebits/osf.io,Ghalko/osf.io,binoculars/osf.io,amyshi188/osf.io,wearpants/osf.io,Ghalko/osf.io,TomHeatwole/osf.io,kushG/osf.io,zkraime/osf.io,kwierman/osf.io,danielneis/osf.io,HalcyonChimera/osf.io,asanfilippo7/osf.io,jeffreyliu3230/osf.io,jeffreyliu3230/osf.io,ticklemepierce/osf.io,barbour-em/osf.io,TomBaxter/osf.io,lamdnhan/osf.io,jnayak1/osf.io,billyhunt/osf.io,acshi/osf.io,adlius/osf.io,AndrewSallans/osf.io,mfraezz/osf.io,leb2dg/osf.io,mluo613/osf.io,icereval/osf.io,Nesiehr/osf.io,AndrewSallans/osf.io,njantrania/osf.io,chrisseto/osf.io,doublebits/osf.io,chennan47/osf.io,HarryRybacki/osf.io,caseyrygt/osf.io,samanehsan/osf.io,DanielSBrown/osf.io,cslzchen/osf.io,dplorimer/osf,sloria/osf.io,RomanZWang/osf.io,bdyetton/prettychart,DanielSBrown/osf.io,haoyuchen1992/osf.io,caseyrollins/osf.io,HarryRybacki/osf.io,zamattiac/osf.io,jmcarp/osf.io,laurenrevere/osf.io,haoyuchen1992/osf.io,amyshi188/osf.io,wearpants/osf.io,ckc6cz/osf.io,doublebits/osf.io,fabianvf/osf.io,jnayak1/osf.io,barbour-em/osf.io,caseyrollins/osf.io,SSJohns/osf.io,lyndsysimon/osf.io,reinaH/osf.io,ticklemepierce/osf.io,brandonPurvis/osf.io,rdhyee/osf.io,DanielSBrown/osf.io,abought/osf.io,arpitar/osf.io,felliott/osf.io,zachjanicki/osf.io,revanthkolli/osf.io,alexschiller/osf.io,rdhyee/osf.io,CenterForOpenScience/osf.io,mattclark/osf.io,kch8qx/osf.io,binoculars/osf.io,crcresearch/osf.io,SSJohns/osf.io,HalcyonChimera/osf.io,abought/osf.io,rdhyee/osf.io,saradbowman/osf.io,CenterForOpenScience/osf.io,sbt9uc/osf.io,GaryKriebel/osf.io,monikagrabowska/osf.io,asanfilippo7/osf.io,njantrania/osf.io,samchrisinger/osf.io,MerlinZhang/osf.io,sbt9uc/osf.io,jinluyuan/osf.io,caseyrygt/osf.io,adlius/osf.io,barbour-em/osf.io,kwierman/osf.io,jnayak1/osf.io,aaxelb/osf.io,erinspace/osf.io,jeffreyliu3230/osf.io,adlius/osf.io,HalcyonChimera/osf.io,CenterForOpenScience/osf.io,cslzchen/osf.io,jolene-esposito/osf.io,jeffreyliu3230/osf.io,mluo613/osf.io,billyhunt/osf.io,GaryKriebel/osf.io,jnayak1/osf.io,Ghalko/osf.io,revanthkolli/osf.io,acshi/osf.io,fabianvf/osf.io,HalcyonChimera/osf.io,amyshi188/osf.io,RomanZWang/osf.io,ckc6cz/osf.io,hmoco/osf.io,jmcarp/osf.io,lamdnhan/osf.io,samanehsan/osf.io,mluke93/osf.io,bdyetton/prettychart,erinspace/osf.io,pattisdr/osf.io,TomHeatwole/osf.io,dplorimer/osf,GageGaskins/osf.io,SSJohns/osf.io,brandonPurvis/osf.io,danielneis/osf.io,njantrania/osf.io,petermalcolm/osf.io,ZobairAlijan/osf.io,leb2dg/osf.io,samanehsan/osf.io,SSJohns/osf.io,zachjanicki/osf.io,kch8qx/osf.io,cldershem/osf.io,caneruguz/osf.io,hmoco/osf.io,kwierman/osf.io,baylee-d/osf.io,haoyuchen1992/osf.io,barbour-em/osf.io,himanshuo/osf.io,samanehsan/osf.io,MerlinZhang/osf.io,felliott/osf.io,mluke93/osf.io,ckc6cz/osf.io,doublebits/osf.io,samchrisinger/osf.io,aaxelb/osf.io,RomanZWang/osf.io,arpitar/osf.io,monikagrabowska/osf.io,jinluyuan/osf.io,revanthkolli/osf.io,acshi/osf.io,icereval/osf.io,jinluyuan/osf.io,himanshuo/osf.io,adlius/osf.io,chrisseto/osf.io,cosenal/osf.io,caneruguz/osf.io,billyhunt/osf.io,petermalcolm/osf.io,alexschiller/osf.io,cwisecarver/osf.io,leb2dg/osf.io,sbt9uc/osf.io,cosenal/osf.io,lamdnhan/osf.io,mluke93/osf.io,aaxelb/osf.io,ckc6cz/osf.io,mluo613/osf.io,zamattiac/osf.io,mfraezz/osf.io,brandonPurvis/osf.io,billyhunt/osf.io,felliott/osf.io,cwisecarver/osf.io,monikagrabowska/osf.io,kch8qx/osf.io,acshi/osf.io,arpitar/osf.io,abought/osf.io,icereval/osf.io,crcresearch/osf.io,zachjanicki/osf.io,njantrania/osf.io,crcresearch/osf.io,jolene-esposito/osf.io,GageGaskins/osf.io,zkraime/osf.io,binoculars/osf.io,chennan47/osf.io,billyhunt/osf.io,ZobairAlijan/osf.io,acshi/osf.io,jolene-esposito/osf.io,TomHeatwole/osf.io,kushG/osf.io,brianjgeiger/osf.io,Johnetordoff/osf.io,KAsante95/osf.io,sloria/osf.io,revanthkolli/osf.io,kwierman/osf.io,monikagrabowska/osf.io,kch8qx/osf.io,cldershem/osf.io,mluke93/osf.io,wearpants/osf.io,sloria/osf.io,jinluyuan/osf.io,emetsger/osf.io,emetsger/osf.io,chrisseto/osf.io,kch8qx/osf.io,mfraezz/osf.io,zamattiac/osf.io,GageGaskins/osf.io,aaxelb/osf.io,laurenrevere/osf.io,GaryKriebel/osf.io,mattclark/osf.io,KAsante95/osf.io,caneruguz/osf.io,Johnetordoff/osf.io,dplorimer/osf,mfraezz/osf.io,mluo613/osf.io,lyndsysimon/osf.io,reinaH/osf.io,reinaH/osf.io,fabianvf/osf.io,himanshuo/osf.io,KAsante95/osf.io,danielneis/osf.io,alexschiller/osf.io,ticklemepierce/osf.io,MerlinZhang/osf.io,jmcarp/osf.io,leb2dg/osf.io,samchrisinger/osf.io,alexschiller/osf.io,himanshuo/osf.io,Nesiehr/osf.io,emetsger/osf.io,GageGaskins/osf.io,alexschiller/osf.io,chennan47/osf.io,brandonPurvis/osf.io,cslzchen/osf.io,KAsante95/osf.io,GaryKriebel/osf.io,bdyetton/prettychart,amyshi188/osf.io,HarryRybacki/osf.io,sbt9uc/osf.io,samchrisinger/osf.io,felliott/osf.io,caseyrygt/osf.io,hmoco/osf.io,chrisseto/osf.io,baylee-d/osf.io,cslzchen/osf.io,petermalcolm/osf.io,erinspace/osf.io,cwisecarver/osf.io,danielneis/osf.io,lyndsysimon/osf.io,baylee-d/osf.io,KAsante95/osf.io,wearpants/osf.io | python | ## Code Before:
from website.addons.osffiles.exceptions import FileNotFoundError
def get_versions(filename, node):
"""Return file versions for a :class:`NodeFile`.
:raises: FileNotFoundError if file does not exists for the node.
"""
try:
return node.files_versions[filename.replace('.', '_')]
except KeyError:
raise FileNotFoundError('{0!r} not found for node {1!r}'.format(
filename, node._id
))
def get_latest_version_number(filename, node):
"""Return the current version number (0-indexed) for a NodeFile.
:raises: FileNotFoundError if file does not exists for the node.
"""
versions = get_versions(filename, node)
return len(versions) - 1
## Instruction:
Clarify documentation for get_versions and get_latest_version_number.
## Code After:
from website.addons.osffiles.exceptions import FileNotFoundError
def get_versions(filename, node):
"""Return IDs for a file's version records.
:param str filename: The name of the file.
:param Node node: The node which has the requested file.
:return: List of ids (strings) for :class:`NodeFile` records.
:raises: FileNotFoundError if file does not exists for the node.
"""
try:
return node.files_versions[filename.replace('.', '_')]
except KeyError:
raise FileNotFoundError('{0!r} not found for node {1!r}'.format(
filename, node._id
))
def get_latest_version_number(filename, node):
"""Return the current version number (0-indexed) for a file.
:param str filename: The name of the file.
:param Node node: The node which has the requested file.
:raises: FileNotFoundError if file does not exists for the node.
"""
versions = get_versions(filename, node)
return len(versions) - 1
|
b42d2aa652b987865d3a6f55f601b98f21a76137 | lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/size/legend-size-types.js | lib/assets/javascripts/builder/editor/layers/layer-content-views/legend/size/legend-size-types.js | var _ = require('underscore');
var LegendTypes = require('builder/editor/layers/layer-content-views/legend/legend-types');
module.exports = [
{
value: LegendTypes.NONE,
tooltipTranslationKey: 'editor.legend.tooltips.style.none',
legendIcon: require('builder/editor/layers/layer-content-views/legend/carousel-icons/none.tpl'),
label: _t('editor.legend.types.none')
}, {
value: LegendTypes.BUBBLE,
tooltipTranslationKey: 'editor.legend.tooltips.style.bubble',
legendIcon: require('builder/editor/layers/layer-content-views/legend/carousel-icons/bubble.tpl'),
label: _t('editor.legend.types.bubble'),
isStyleCompatible: function (styleModel) {
var fill = styleModel.get('fill');
var stroke = styleModel.get('stroke');
var size;
if (!fill && !stroke || _.isEmpty(fill) && _.isEmpty(stroke)) return false;
size = fill && fill.size || stroke && stroke.size;
return size && size.attribute !== undefined;
}
}
];
| var _ = require('underscore');
var LegendTypes = require('builder/editor/layers/layer-content-views/legend/legend-types');
var styleHelper = require('builder/helpers/style');
module.exports = [
{
value: LegendTypes.NONE,
tooltipTranslationKey: 'editor.legend.tooltips.style.none',
legendIcon: require('builder/editor/layers/layer-content-views/legend/carousel-icons/none.tpl'),
label: _t('editor.legend.types.none')
}, {
value: LegendTypes.BUBBLE,
tooltipTranslationKey: 'editor.legend.tooltips.style.bubble',
legendIcon: require('builder/editor/layers/layer-content-views/legend/carousel-icons/bubble.tpl'),
label: _t('editor.legend.types.bubble'),
isStyleCompatible: function (styleModel) {
var size = styleHelper.getSize(styleModel);
if (size == null) return false;
return size && size.attribute !== undefined;
}
}
];
| Refactor bubble legend compatibility rules with styles for clarity | Refactor bubble legend compatibility rules with styles for clarity
| JavaScript | bsd-3-clause | CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb | javascript | ## Code Before:
var _ = require('underscore');
var LegendTypes = require('builder/editor/layers/layer-content-views/legend/legend-types');
module.exports = [
{
value: LegendTypes.NONE,
tooltipTranslationKey: 'editor.legend.tooltips.style.none',
legendIcon: require('builder/editor/layers/layer-content-views/legend/carousel-icons/none.tpl'),
label: _t('editor.legend.types.none')
}, {
value: LegendTypes.BUBBLE,
tooltipTranslationKey: 'editor.legend.tooltips.style.bubble',
legendIcon: require('builder/editor/layers/layer-content-views/legend/carousel-icons/bubble.tpl'),
label: _t('editor.legend.types.bubble'),
isStyleCompatible: function (styleModel) {
var fill = styleModel.get('fill');
var stroke = styleModel.get('stroke');
var size;
if (!fill && !stroke || _.isEmpty(fill) && _.isEmpty(stroke)) return false;
size = fill && fill.size || stroke && stroke.size;
return size && size.attribute !== undefined;
}
}
];
## Instruction:
Refactor bubble legend compatibility rules with styles for clarity
## Code After:
var _ = require('underscore');
var LegendTypes = require('builder/editor/layers/layer-content-views/legend/legend-types');
var styleHelper = require('builder/helpers/style');
module.exports = [
{
value: LegendTypes.NONE,
tooltipTranslationKey: 'editor.legend.tooltips.style.none',
legendIcon: require('builder/editor/layers/layer-content-views/legend/carousel-icons/none.tpl'),
label: _t('editor.legend.types.none')
}, {
value: LegendTypes.BUBBLE,
tooltipTranslationKey: 'editor.legend.tooltips.style.bubble',
legendIcon: require('builder/editor/layers/layer-content-views/legend/carousel-icons/bubble.tpl'),
label: _t('editor.legend.types.bubble'),
isStyleCompatible: function (styleModel) {
var size = styleHelper.getSize(styleModel);
if (size == null) return false;
return size && size.attribute !== undefined;
}
}
];
|
e580e70b617790e6785b59217c09ca746c56e56a | server.js | server.js | var express = require('express'),
app = express();
var scores = require('./server/routes/scores');
var users = require('./server/routes/users');
var chats = require('./server/routes/chats');
var rooms = require('./server/routes/rooms');
var paints = require('./server/routes/pictures');
var bodyParser = require('body-parser');
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/rollingpaint');
app.use(express.static('www'));
app.use(bodyParser.json()); // for parsing application/json
app.use(bodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded
app.use('/scores', scores);
app.use('/users', users);
app.use('/chats', chats);
app.use('/rooms', rooms);
app.use('/pictures', paints);
// CORS (Cross-Origin Resource Sharing) headers to support Cross-site HTTP requests
app.all('*', function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "X-Requested-With");
next();
});
// API Routes
// app.get('/blah', routeHandler);
app.set('port', process.env.PORT || 80);
app.listen(app.get('port'), function () {
console.log('Express server listening on port ' + app.get('port'));
});
| var express = require('express'),
app = express();
var scores = require('./server/routes/scores');
var users = require('./server/routes/users');
var chats = require('./server/routes/chats');
var rooms = require('./server/routes/rooms');
var paints = require('./server/routes/pictures');
var bodyParser = require('body-parser');
var mongoose = require('mongoose');
mongoose.connect(process.env.MONGODB || 'mongodb://localhost/rollingpaint');
app.use(express.static('www'));
app.use(bodyParser.json()); // for parsing application/json
app.use(bodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded
app.use('/scores', scores);
app.use('/users', users);
app.use('/chats', chats);
app.use('/rooms', rooms);
app.use('/pictures', paints);
// CORS (Cross-Origin Resource Sharing) headers to support Cross-site HTTP requests
app.all('*', function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "X-Requested-With");
next();
});
// API Routes
// app.get('/blah', routeHandler);
app.set('port', process.env.PORT || 80);
app.listen(app.get('port'), function () {
console.log('Express server listening on port ' + app.get('port'));
});
| Update mongoDB address by env. | Update mongoDB address by env.
| JavaScript | apache-2.0 | appsdev01/rollingpaint,appsdev01/rollingpaint | javascript | ## Code Before:
var express = require('express'),
app = express();
var scores = require('./server/routes/scores');
var users = require('./server/routes/users');
var chats = require('./server/routes/chats');
var rooms = require('./server/routes/rooms');
var paints = require('./server/routes/pictures');
var bodyParser = require('body-parser');
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/rollingpaint');
app.use(express.static('www'));
app.use(bodyParser.json()); // for parsing application/json
app.use(bodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded
app.use('/scores', scores);
app.use('/users', users);
app.use('/chats', chats);
app.use('/rooms', rooms);
app.use('/pictures', paints);
// CORS (Cross-Origin Resource Sharing) headers to support Cross-site HTTP requests
app.all('*', function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "X-Requested-With");
next();
});
// API Routes
// app.get('/blah', routeHandler);
app.set('port', process.env.PORT || 80);
app.listen(app.get('port'), function () {
console.log('Express server listening on port ' + app.get('port'));
});
## Instruction:
Update mongoDB address by env.
## Code After:
var express = require('express'),
app = express();
var scores = require('./server/routes/scores');
var users = require('./server/routes/users');
var chats = require('./server/routes/chats');
var rooms = require('./server/routes/rooms');
var paints = require('./server/routes/pictures');
var bodyParser = require('body-parser');
var mongoose = require('mongoose');
mongoose.connect(process.env.MONGODB || 'mongodb://localhost/rollingpaint');
app.use(express.static('www'));
app.use(bodyParser.json()); // for parsing application/json
app.use(bodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded
app.use('/scores', scores);
app.use('/users', users);
app.use('/chats', chats);
app.use('/rooms', rooms);
app.use('/pictures', paints);
// CORS (Cross-Origin Resource Sharing) headers to support Cross-site HTTP requests
app.all('*', function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "X-Requested-With");
next();
});
// API Routes
// app.get('/blah', routeHandler);
app.set('port', process.env.PORT || 80);
app.listen(app.get('port'), function () {
console.log('Express server listening on port ' + app.get('port'));
});
|
0b1a7c76b65eb53fdbd60126c8fc52e9a7b361cd | templates/settings.html | templates/settings.html | <!DOCTYPE html>
<html>
<head>
<title>Settings - Timpani</title>
<link href="/static/libs/pure/pure-min.css" rel="stylesheet">
<link href="/static/css/settings.css" rel="stylesheet">
</head>
<body>
{% include "admin_toolbar.html" %}
<div id="main-container" class="container">
<form class="pure-form" action="/settings" method="POST">
<label for="blog-title-input">Blog title</label>
<input id="blog-title-input" name="title" value="{{settings.title}}">
</form>
</div>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<title>Settings - Timpani</title>
<link href="/static/libs/pure/pure-min.css" rel="stylesheet">
<link href="/static/css/settings.css" rel="stylesheet">
</head>
<body>
{% include "admin_toolbar.html" %}
<div id="main-container" class="container">
<form class="pure-form" action="/settings" method="POST">
<label for="blog-title-input">Blog title</label>
<input id="blog-title-input" name="title" value="{{settings.title}}">
<label for="blog-subtitle-input">Blog subtitle</label>
<input id="blog-subtitle-input" name="subtitle" value="{{settings.subttile|default('')}}">
</form>
</div>
</body>
</html>
| Add subtitle input to template | Add subtitle input to template
| HTML | mit | ollien/Timpani,ollien/Timpani,ollien/Timpani | html | ## Code Before:
<!DOCTYPE html>
<html>
<head>
<title>Settings - Timpani</title>
<link href="/static/libs/pure/pure-min.css" rel="stylesheet">
<link href="/static/css/settings.css" rel="stylesheet">
</head>
<body>
{% include "admin_toolbar.html" %}
<div id="main-container" class="container">
<form class="pure-form" action="/settings" method="POST">
<label for="blog-title-input">Blog title</label>
<input id="blog-title-input" name="title" value="{{settings.title}}">
</form>
</div>
</body>
</html>
## Instruction:
Add subtitle input to template
## Code After:
<!DOCTYPE html>
<html>
<head>
<title>Settings - Timpani</title>
<link href="/static/libs/pure/pure-min.css" rel="stylesheet">
<link href="/static/css/settings.css" rel="stylesheet">
</head>
<body>
{% include "admin_toolbar.html" %}
<div id="main-container" class="container">
<form class="pure-form" action="/settings" method="POST">
<label for="blog-title-input">Blog title</label>
<input id="blog-title-input" name="title" value="{{settings.title}}">
<label for="blog-subtitle-input">Blog subtitle</label>
<input id="blog-subtitle-input" name="subtitle" value="{{settings.subttile|default('')}}">
</form>
</div>
</body>
</html>
|
0e1ae4134ebcffa5eb121e8ee757009dc1a4b0e2 | scripts/pre-deploy.sh | scripts/pre-deploy.sh |
set -e
# define color
RED='\033[0;31m'
NC='\033[0m' # No Color
# 0.1 check if on master
if [ "$(git rev-parse --abbrev-ref HEAD)" != "master" ]; then
echo "${RED}Not on master, please checkout master branch before running this script${NC}"
exit 1
fi
# 0.2 Check if all files are committed
if [ -z "$(git status --porcelain)" ]; then
echo "All tracked files are committed. Publishing on npm and bower. \n"
else
echo "${RED}There are uncommitted files. Please commit or stash first!${NC} \n\n"
git status
exit 1
fi
|
set -e
# define color
RED='\033[0;31m'
NC='\033[0m' # No Color
# 0.1 check if on master
if [ "$(git rev-parse --abbrev-ref HEAD)" != "master" ]; then
echo "${RED}Not on master, please checkout master branch before running this script${NC}"
exit 1
fi
# 0.2 Check if all files are committed
if [ -z "$(git status --porcelain)" ]; then
echo "All tracked files are committed. Publishing on npm and bower. \n"
else
echo "${RED}There are uncommitted files. Please commit or stash first!${NC} \n\n"
git status
exit 1
fi
# 0.3 Check if the Vega's schema repository exists in the same parent directory (as a sibling directory)
if ! [ -d "../schema" ]; then
echo "${RED} Vega-Lite schema cannot be updated if the vega/schema repository does not exist in the same parent directory. "
exit 1;
fi
| Update deploy script to check if a sibling `schema` repository exists. | Update deploy script to check if a sibling `schema` repository exists.
cc: da39a3ee5e6b4b0d3255bfef95601890afd80709@domoritz
| Shell | bsd-3-clause | uwdata/vega-lite,vega/vega-lite,vega/vega-lite,uwdata/vega-lite,uwdata/vega-lite,uwdata/vega-lite,uwdata/vega-lite,vega/vega-lite,vega/vega-lite,vega/vega-lite | shell | ## Code Before:
set -e
# define color
RED='\033[0;31m'
NC='\033[0m' # No Color
# 0.1 check if on master
if [ "$(git rev-parse --abbrev-ref HEAD)" != "master" ]; then
echo "${RED}Not on master, please checkout master branch before running this script${NC}"
exit 1
fi
# 0.2 Check if all files are committed
if [ -z "$(git status --porcelain)" ]; then
echo "All tracked files are committed. Publishing on npm and bower. \n"
else
echo "${RED}There are uncommitted files. Please commit or stash first!${NC} \n\n"
git status
exit 1
fi
## Instruction:
Update deploy script to check if a sibling `schema` repository exists.
cc: da39a3ee5e6b4b0d3255bfef95601890afd80709@domoritz
## Code After:
set -e
# define color
RED='\033[0;31m'
NC='\033[0m' # No Color
# 0.1 check if on master
if [ "$(git rev-parse --abbrev-ref HEAD)" != "master" ]; then
echo "${RED}Not on master, please checkout master branch before running this script${NC}"
exit 1
fi
# 0.2 Check if all files are committed
if [ -z "$(git status --porcelain)" ]; then
echo "All tracked files are committed. Publishing on npm and bower. \n"
else
echo "${RED}There are uncommitted files. Please commit or stash first!${NC} \n\n"
git status
exit 1
fi
# 0.3 Check if the Vega's schema repository exists in the same parent directory (as a sibling directory)
if ! [ -d "../schema" ]; then
echo "${RED} Vega-Lite schema cannot be updated if the vega/schema repository does not exist in the same parent directory. "
exit 1;
fi
|
727b7206e69a2b7d8bc303821d537ade315c310e | webpack-aot.config.js | webpack-aot.config.js | 'use strict';
const path = require('path');
const webpackConfig = require('./webpack.config.js');
const loaders = require('./webpack/loaders');
const AotPlugin = require('@ngtools/webpack').AotPlugin;
webpackConfig.module.rules = [
loaders.tslint,
loaders.ts,
loaders.html,
loaders.globalCss,
loaders.componentCss,
loaders.file,
];
webpackConfig.plugins = webpackConfig.plugins.concat([
new AotPlugin({
tsConfigPath: path.join(__dirname, './tsconfig-aot.json'),
mainPath: path.join(__dirname, 'src', 'main.ts'),
entryModule: path.join(__dirname, 'src', 'app', 'app.module#AppModule'),
}),
]);
module.exports = webpackConfig;
| 'use strict';
const path = require('path');
const webpackConfig = require('./webpack.config.js');
const loaders = require('./webpack/loaders');
const AotPlugin = require('@ngtools/webpack').AotPlugin;
webpackConfig.module.rules = [
loaders.tslint,
loaders.ts,
loaders.html,
{ test: /\.css$/, use: 'raw-loader', include: /node_modules/ },
loaders.globalCss,
loaders.componentCss,
loaders.file,
];
webpackConfig.plugins = webpackConfig.plugins.concat([
new AotPlugin({
tsConfigPath: path.join(__dirname, './tsconfig-aot.json'),
mainPath: path.join(__dirname, 'src', 'main.ts'),
entryModule: path.join(__dirname, 'src', 'app', 'app.module#AppModule'),
}),
]);
module.exports = webpackConfig;
| Handle 3rd party components that use styleUrls for CSS | Handle 3rd party components that use styleUrls for CSS
| JavaScript | mit | rangle/angular2-starter,rangle/angular2-starter,rangle/angular2-starter | javascript | ## Code Before:
'use strict';
const path = require('path');
const webpackConfig = require('./webpack.config.js');
const loaders = require('./webpack/loaders');
const AotPlugin = require('@ngtools/webpack').AotPlugin;
webpackConfig.module.rules = [
loaders.tslint,
loaders.ts,
loaders.html,
loaders.globalCss,
loaders.componentCss,
loaders.file,
];
webpackConfig.plugins = webpackConfig.plugins.concat([
new AotPlugin({
tsConfigPath: path.join(__dirname, './tsconfig-aot.json'),
mainPath: path.join(__dirname, 'src', 'main.ts'),
entryModule: path.join(__dirname, 'src', 'app', 'app.module#AppModule'),
}),
]);
module.exports = webpackConfig;
## Instruction:
Handle 3rd party components that use styleUrls for CSS
## Code After:
'use strict';
const path = require('path');
const webpackConfig = require('./webpack.config.js');
const loaders = require('./webpack/loaders');
const AotPlugin = require('@ngtools/webpack').AotPlugin;
webpackConfig.module.rules = [
loaders.tslint,
loaders.ts,
loaders.html,
{ test: /\.css$/, use: 'raw-loader', include: /node_modules/ },
loaders.globalCss,
loaders.componentCss,
loaders.file,
];
webpackConfig.plugins = webpackConfig.plugins.concat([
new AotPlugin({
tsConfigPath: path.join(__dirname, './tsconfig-aot.json'),
mainPath: path.join(__dirname, 'src', 'main.ts'),
entryModule: path.join(__dirname, 'src', 'app', 'app.module#AppModule'),
}),
]);
module.exports = webpackConfig;
|
72f84b49ea9781f3252c49a1805c0ce19af5c635 | corehq/apps/case_search/dsl_utils.py | corehq/apps/case_search/dsl_utils.py | from django.utils.translation import gettext as _
from eulxml.xpath.ast import FunctionCall, UnaryExpression, serialize
from corehq.apps.case_search.exceptions import (
CaseFilterError,
XPathFunctionException,
)
from corehq.apps.case_search.xpath_functions import XPATH_VALUE_FUNCTIONS
def unwrap_value(value, context):
"""Returns the value of the node if it is wrapped in a function, otherwise just returns the node
"""
if isinstance(value, (str, int, float, bool)):
return value
if isinstance(value, UnaryExpression) and value.op == '-':
return -1 * value.right
if not isinstance(value, FunctionCall):
return value
try:
return XPATH_VALUE_FUNCTIONS[value.name](value, context)
except KeyError:
raise CaseFilterError(
_("We don't know what to do with the function \"{}\". Accepted functions are: {}").format(
value.name,
", ".join(list(XPATH_VALUE_FUNCTIONS.keys())),
),
serialize(value)
)
except XPathFunctionException as e:
raise CaseFilterError(str(e), serialize(value))
| from django.utils.translation import gettext as _
from eulxml.xpath.ast import FunctionCall, UnaryExpression, serialize
from corehq.apps.case_search.exceptions import (
CaseFilterError,
XPathFunctionException,
)
from corehq.apps.case_search.xpath_functions import XPATH_VALUE_FUNCTIONS
def unwrap_value(value, context):
"""Returns the value of the node if it is wrapped in a function, otherwise just returns the node
"""
if isinstance(value, UnaryExpression) and value.op == '-':
return -1 * value.right
if not isinstance(value, FunctionCall):
return value
try:
return XPATH_VALUE_FUNCTIONS[value.name](value, context)
except KeyError:
raise CaseFilterError(
_("We don't know what to do with the function \"{}\". Accepted functions are: {}").format(
value.name,
", ".join(list(XPATH_VALUE_FUNCTIONS.keys())),
),
serialize(value)
)
except XPathFunctionException as e:
raise CaseFilterError(str(e), serialize(value))
| Revert "support unwrapping of basic types" | Revert "support unwrapping of basic types"
This reverts commit 86a5a1c8
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | python | ## Code Before:
from django.utils.translation import gettext as _
from eulxml.xpath.ast import FunctionCall, UnaryExpression, serialize
from corehq.apps.case_search.exceptions import (
CaseFilterError,
XPathFunctionException,
)
from corehq.apps.case_search.xpath_functions import XPATH_VALUE_FUNCTIONS
def unwrap_value(value, context):
"""Returns the value of the node if it is wrapped in a function, otherwise just returns the node
"""
if isinstance(value, (str, int, float, bool)):
return value
if isinstance(value, UnaryExpression) and value.op == '-':
return -1 * value.right
if not isinstance(value, FunctionCall):
return value
try:
return XPATH_VALUE_FUNCTIONS[value.name](value, context)
except KeyError:
raise CaseFilterError(
_("We don't know what to do with the function \"{}\". Accepted functions are: {}").format(
value.name,
", ".join(list(XPATH_VALUE_FUNCTIONS.keys())),
),
serialize(value)
)
except XPathFunctionException as e:
raise CaseFilterError(str(e), serialize(value))
## Instruction:
Revert "support unwrapping of basic types"
This reverts commit 86a5a1c8
## Code After:
from django.utils.translation import gettext as _
from eulxml.xpath.ast import FunctionCall, UnaryExpression, serialize
from corehq.apps.case_search.exceptions import (
CaseFilterError,
XPathFunctionException,
)
from corehq.apps.case_search.xpath_functions import XPATH_VALUE_FUNCTIONS
def unwrap_value(value, context):
"""Returns the value of the node if it is wrapped in a function, otherwise just returns the node
"""
if isinstance(value, UnaryExpression) and value.op == '-':
return -1 * value.right
if not isinstance(value, FunctionCall):
return value
try:
return XPATH_VALUE_FUNCTIONS[value.name](value, context)
except KeyError:
raise CaseFilterError(
_("We don't know what to do with the function \"{}\". Accepted functions are: {}").format(
value.name,
", ".join(list(XPATH_VALUE_FUNCTIONS.keys())),
),
serialize(value)
)
except XPathFunctionException as e:
raise CaseFilterError(str(e), serialize(value))
|
d83deb887dad8e41a23c74d45bcfe52d8970969d | website/templates/emails/prereg_reminder.html.mako | website/templates/emails/prereg_reminder.html.mako | <%inherit file="notify_base.mako"/>
<%def name="content()">
<div style="margin: 40px;">
<br>
Dear ${fullname},
<br><br>
You have an unsubmitted preregistration on the Open Science Framework that could be eligible for a $1,000 prize as part of the <a href="https://cos.io/prereg">Prereg Challenge</a>. If you would like this to be considered for a prize, please complete <a href="${prereg_url}">your preregistration</a> and submit it for review, available on the last page of the preregistration form. This review process is required for a prize and simply checks to make sure the preregistration includes a complete analysis plan.
If you have questions about a particular field in the preregistration, you may review the <a href="https://cos.io/prereg">FAQ on the website</a>, <a href="mailto:[email protected]">email us with a question</a>, or use our <a href="https://cos.io/stats_consulting">free statistical consulting services</a>.
Thank you for using the OSF!
<br><br>
Sincerely,
<br>
The team at the Center for Open Science
</div>
</%def>
| <%inherit file="notify_base.mako"/>
<%def name="content()">
<div style="margin: 40px;">
<br>
Dear ${fullname},
<br><br>
You have an unsubmitted preregistration on the Open Science Framework that could be eligible for a $1,000 prize as part of the Prereg Challenge. If you would like this to be considered for a prize, please complete <a href="${prereg_url}">your preregistration</a> and submit it for review, available on the last page of the preregistration form. This review process is required for a prize and simply checks to make sure the preregistration includes a complete analysis plan.
If you have questions about a particular field in the preregistration, you may review the <a href="https://cos.io/prereg">FAQ on the website</a>, <a href="mailto:[email protected]">email us with a question</a>, or use our <a href="https://cos.io/stats_consulting">free statistical consulting services</a>.
Thank you for using the OSF!
<br><br>
Sincerely,
<br>
The team at the Center for Open Science
</div>
</%def>
| Remove link to prereg challenge | Remove link to prereg challenge
| Mako | apache-2.0 | mattclark/osf.io,Johnetordoff/osf.io,cslzchen/osf.io,cslzchen/osf.io,binoculars/osf.io,aaxelb/osf.io,HalcyonChimera/osf.io,pattisdr/osf.io,HalcyonChimera/osf.io,Johnetordoff/osf.io,laurenrevere/osf.io,sloria/osf.io,chennan47/osf.io,caseyrollins/osf.io,leb2dg/osf.io,mfraezz/osf.io,brianjgeiger/osf.io,baylee-d/osf.io,felliott/osf.io,laurenrevere/osf.io,sloria/osf.io,CenterForOpenScience/osf.io,erinspace/osf.io,Johnetordoff/osf.io,crcresearch/osf.io,saradbowman/osf.io,laurenrevere/osf.io,cslzchen/osf.io,icereval/osf.io,mfraezz/osf.io,TomBaxter/osf.io,aaxelb/osf.io,adlius/osf.io,leb2dg/osf.io,TomBaxter/osf.io,baylee-d/osf.io,cslzchen/osf.io,mfraezz/osf.io,adlius/osf.io,binoculars/osf.io,brianjgeiger/osf.io,erinspace/osf.io,brianjgeiger/osf.io,CenterForOpenScience/osf.io,icereval/osf.io,leb2dg/osf.io,mfraezz/osf.io,brianjgeiger/osf.io,caseyrollins/osf.io,adlius/osf.io,erinspace/osf.io,felliott/osf.io,HalcyonChimera/osf.io,mattclark/osf.io,crcresearch/osf.io,mattclark/osf.io,adlius/osf.io,baylee-d/osf.io,pattisdr/osf.io,TomBaxter/osf.io,caseyrollins/osf.io,crcresearch/osf.io,leb2dg/osf.io,CenterForOpenScience/osf.io,sloria/osf.io,HalcyonChimera/osf.io,binoculars/osf.io,pattisdr/osf.io,felliott/osf.io,felliott/osf.io,aaxelb/osf.io,chennan47/osf.io,chennan47/osf.io,Johnetordoff/osf.io,CenterForOpenScience/osf.io,icereval/osf.io,saradbowman/osf.io,aaxelb/osf.io | mako | ## Code Before:
<%inherit file="notify_base.mako"/>
<%def name="content()">
<div style="margin: 40px;">
<br>
Dear ${fullname},
<br><br>
You have an unsubmitted preregistration on the Open Science Framework that could be eligible for a $1,000 prize as part of the <a href="https://cos.io/prereg">Prereg Challenge</a>. If you would like this to be considered for a prize, please complete <a href="${prereg_url}">your preregistration</a> and submit it for review, available on the last page of the preregistration form. This review process is required for a prize and simply checks to make sure the preregistration includes a complete analysis plan.
If you have questions about a particular field in the preregistration, you may review the <a href="https://cos.io/prereg">FAQ on the website</a>, <a href="mailto:[email protected]">email us with a question</a>, or use our <a href="https://cos.io/stats_consulting">free statistical consulting services</a>.
Thank you for using the OSF!
<br><br>
Sincerely,
<br>
The team at the Center for Open Science
</div>
</%def>
## Instruction:
Remove link to prereg challenge
## Code After:
<%inherit file="notify_base.mako"/>
<%def name="content()">
<div style="margin: 40px;">
<br>
Dear ${fullname},
<br><br>
You have an unsubmitted preregistration on the Open Science Framework that could be eligible for a $1,000 prize as part of the Prereg Challenge. If you would like this to be considered for a prize, please complete <a href="${prereg_url}">your preregistration</a> and submit it for review, available on the last page of the preregistration form. This review process is required for a prize and simply checks to make sure the preregistration includes a complete analysis plan.
If you have questions about a particular field in the preregistration, you may review the <a href="https://cos.io/prereg">FAQ on the website</a>, <a href="mailto:[email protected]">email us with a question</a>, or use our <a href="https://cos.io/stats_consulting">free statistical consulting services</a>.
Thank you for using the OSF!
<br><br>
Sincerely,
<br>
The team at the Center for Open Science
</div>
</%def>
|
1aaa8efe3b92b32b147c3ca4156e3149c6803736 | src/main/assembly/secor.xml | src/main/assembly/secor.xml | <?xml version="1.0" encoding="UTF-8"?>
<assembly>
<id>bin</id>
<baseDirectory/>
<formats>
<format>tar.gz</format>
</formats>
<fileSets>
<fileSet>
<directory>src/main/scripts</directory>
<outputDirectory>scripts</outputDirectory>
<includes>
<include>*.sh</include>
</includes>
</fileSet>
<fileSet>
<directory>target</directory>
<outputDirectory></outputDirectory>
<includes>
<include>secor*.jar</include>
</includes>
</fileSet>
<fileSet>
<directory>target/classes</directory>
<outputDirectory></outputDirectory>
<includes>
<include>*.properties</include>
</includes>
</fileSet>
</fileSets>
<!-- use this section if you want to package dependencies -->
<dependencySets>
<dependencySet>
<outputDirectory>lib</outputDirectory>
<useStrictFiltering>true</useStrictFiltering>
<useProjectArtifact>false</useProjectArtifact>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
</assembly>
| <?xml version="1.0" encoding="UTF-8"?>
<assembly>
<id>bin</id>
<baseDirectory>adgear-secor-beh-${project.version}</baseDirectory>
<formats>
<format>tar.gz</format>
</formats>
<fileSets>
<fileSet>
<directory>src/main/scripts</directory>
<outputDirectory>scripts</outputDirectory>
<includes>
<include>*.sh</include>
</includes>
</fileSet>
<fileSet>
<directory>target</directory>
<outputDirectory></outputDirectory>
<includes>
<include>secor*.jar</include>
</includes>
</fileSet>
<fileSet>
<directory>target/classes</directory>
<outputDirectory></outputDirectory>
<includes>
<include>*.properties</include>
</includes>
</fileSet>
</fileSets>
<!-- use this section if you want to package dependencies -->
<dependencySets>
<dependencySet>
<outputDirectory>lib</outputDirectory>
<useStrictFiltering>true</useStrictFiltering>
<useProjectArtifact>false</useProjectArtifact>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
</assembly>
| Set baseDirectory in distribution config. | Set baseDirectory in distribution config.
| XML | apache-2.0 | adgear/secor,adgear/secor | xml | ## Code Before:
<?xml version="1.0" encoding="UTF-8"?>
<assembly>
<id>bin</id>
<baseDirectory/>
<formats>
<format>tar.gz</format>
</formats>
<fileSets>
<fileSet>
<directory>src/main/scripts</directory>
<outputDirectory>scripts</outputDirectory>
<includes>
<include>*.sh</include>
</includes>
</fileSet>
<fileSet>
<directory>target</directory>
<outputDirectory></outputDirectory>
<includes>
<include>secor*.jar</include>
</includes>
</fileSet>
<fileSet>
<directory>target/classes</directory>
<outputDirectory></outputDirectory>
<includes>
<include>*.properties</include>
</includes>
</fileSet>
</fileSets>
<!-- use this section if you want to package dependencies -->
<dependencySets>
<dependencySet>
<outputDirectory>lib</outputDirectory>
<useStrictFiltering>true</useStrictFiltering>
<useProjectArtifact>false</useProjectArtifact>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
</assembly>
## Instruction:
Set baseDirectory in distribution config.
## Code After:
<?xml version="1.0" encoding="UTF-8"?>
<assembly>
<id>bin</id>
<baseDirectory>adgear-secor-beh-${project.version}</baseDirectory>
<formats>
<format>tar.gz</format>
</formats>
<fileSets>
<fileSet>
<directory>src/main/scripts</directory>
<outputDirectory>scripts</outputDirectory>
<includes>
<include>*.sh</include>
</includes>
</fileSet>
<fileSet>
<directory>target</directory>
<outputDirectory></outputDirectory>
<includes>
<include>secor*.jar</include>
</includes>
</fileSet>
<fileSet>
<directory>target/classes</directory>
<outputDirectory></outputDirectory>
<includes>
<include>*.properties</include>
</includes>
</fileSet>
</fileSets>
<!-- use this section if you want to package dependencies -->
<dependencySets>
<dependencySet>
<outputDirectory>lib</outputDirectory>
<useStrictFiltering>true</useStrictFiltering>
<useProjectArtifact>false</useProjectArtifact>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
</assembly>
|
d27cf39740127f1dec2c8d84277d6db2e57f44b8 | recipes/configure.rb | recipes/configure.rb |
include_recipe 'gitlab-omnibus::install'
template '/etc/gitlab/gitlab.rb' do
variables(
external_url: node['gitlab-omnibus']['external_url']
)
mode 0600
notifies :run, 'execute[gitlab-ctl reconfigure]'
end
|
include_recipe 'gitlab-omnibus::install'
template '/etc/gitlab/gitlab.rb' do
variables(
external_url: node['gitlab-omnibus']['external_url'],
enable_tls: node['gitlab-omnibus']['enable_tls'],
redirect_http_to_https: node['gitlab-omnibus']['nginx']['redirect_http_to_https'],
ssl_certificate: node['gitlab-omnibus']['nginx']['ssl_certificate'],
ssl_key: node['gitlab-omnibus']['nginx']['key'],
gitlab_email_from: node['gitlab-omnibus']['rails']['gitlab_email_from'],
ldap_enabled: node['gitlab-omnibus']['rails']['ldap_enabled'],
ldap_group_base: node['gitlab-omnibus']['rails']['ldap_group_base'],
ldap_user_filter: node['gitlab-omnibus']['rails']['ldap_user_filter']
)
mode 0600
notifies :run, 'execute[gitlab-ctl reconfigure]'
end
| Add more variables to template resource for gitlab.rb. | Add more variables to template resource for gitlab.rb.
| Ruby | apache-2.0 | xhost-cookbooks/gitlab-omnibus | ruby | ## Code Before:
include_recipe 'gitlab-omnibus::install'
template '/etc/gitlab/gitlab.rb' do
variables(
external_url: node['gitlab-omnibus']['external_url']
)
mode 0600
notifies :run, 'execute[gitlab-ctl reconfigure]'
end
## Instruction:
Add more variables to template resource for gitlab.rb.
## Code After:
include_recipe 'gitlab-omnibus::install'
template '/etc/gitlab/gitlab.rb' do
variables(
external_url: node['gitlab-omnibus']['external_url'],
enable_tls: node['gitlab-omnibus']['enable_tls'],
redirect_http_to_https: node['gitlab-omnibus']['nginx']['redirect_http_to_https'],
ssl_certificate: node['gitlab-omnibus']['nginx']['ssl_certificate'],
ssl_key: node['gitlab-omnibus']['nginx']['key'],
gitlab_email_from: node['gitlab-omnibus']['rails']['gitlab_email_from'],
ldap_enabled: node['gitlab-omnibus']['rails']['ldap_enabled'],
ldap_group_base: node['gitlab-omnibus']['rails']['ldap_group_base'],
ldap_user_filter: node['gitlab-omnibus']['rails']['ldap_user_filter']
)
mode 0600
notifies :run, 'execute[gitlab-ctl reconfigure]'
end
|
55b17598e45b619f45add151a380c037e6d63b04 | run-tests.ps1 | run-tests.ps1 |
$projects = Get-ChildItem .\test | ?{$_.PsIsContainer}
foreach($project in $projects) {
cd test/$project
dnx test
cd ../../
} |
$projects = Get-ChildItem .\test | ?{$_.PsIsContainer}
foreach($project in $projects) {
# Display project name
$project
# Move to the project
cd test/$project
# Run test
dnx test
# Move back to the solution root
cd ../../
} | Update test runner PS script | Update test runner PS script
| PowerShell | mit | justinyoo/Scissorhands.NET,aliencube/Scissorhands.NET,ujuc/Scissorhands.NET,aliencube/Scissorhands.NET,justinyoo/Scissorhands.NET,GetScissorhands/Scissorhands.NET,ujuc/Scissorhands.NET,GetScissorhands/Scissorhands.NET,GetScissorhands/Scissorhands.NET,justinyoo/Scissorhands.NET,ujuc/Scissorhands.NET,aliencube/Scissorhands.NET | powershell | ## Code Before:
$projects = Get-ChildItem .\test | ?{$_.PsIsContainer}
foreach($project in $projects) {
cd test/$project
dnx test
cd ../../
}
## Instruction:
Update test runner PS script
## Code After:
$projects = Get-ChildItem .\test | ?{$_.PsIsContainer}
foreach($project in $projects) {
# Display project name
$project
# Move to the project
cd test/$project
# Run test
dnx test
# Move back to the solution root
cd ../../
} |
9b544e2d1acfc7a427440975c7f24ff2b2081b3e | README.md | README.md |
Adds convenience routines to the Image class
Version 2.x is for SilverStripe 3.1.x. & 3.2.x
This is version 2.0.2
|
Adds convenience routines to the Image class.
**Note:** This module was designed for SilverStripe 2.4. The version supporting
SilverStripe 3.x exists only to simplify migrating 2.4 sites to 3.x. All of its
functionality exists natively in SilverStripe 3.x. There will be no further
development of this module.
Version 2.x is for SilverStripe 3.1.x. & 3.2.x
This is version 2.0.2
| Add note indicating legacy status | Add note indicating legacy status
| Markdown | mit | Quinn-Interactive/silverstripe-image-extension | markdown | ## Code Before:
Adds convenience routines to the Image class
Version 2.x is for SilverStripe 3.1.x. & 3.2.x
This is version 2.0.2
## Instruction:
Add note indicating legacy status
## Code After:
Adds convenience routines to the Image class.
**Note:** This module was designed for SilverStripe 2.4. The version supporting
SilverStripe 3.x exists only to simplify migrating 2.4 sites to 3.x. All of its
functionality exists natively in SilverStripe 3.x. There will be no further
development of this module.
Version 2.x is for SilverStripe 3.1.x. & 3.2.x
This is version 2.0.2
|
e95fae900ae7b55f4f6022db58ac89bbb9cd7566 | .circleci/config.yml | .circleci/config.yml | version: 2
references:
steps: &steps
- checkout
- type: cache-restore
key: airports-bundler-{{ checksum "airports.gemspec" }}
- run: gem install bundler
- run: bundle install --path vendor/bundle
- type: cache-save
key: airports-bundler-{{ checksum "airports.gemspec" }}
paths:
- vendor/bundle
- type: shell
command: |
bundle exec rspec --profile 10 \
--format RspecJunitFormatter \
--out /tmp/test-results/rspec.xml \
--format progress \
spec
- type: store_test_results
path: /tmp/test-results
- run: bundle exec rubocop
jobs:
build-ruby22:
docker:
- image: ruby:2.2
steps: *steps
build-ruby23:
docker:
- image: ruby:2.3
steps: *steps
build-ruby24:
docker:
- image: ruby:2.4
steps: *steps
build-ruby25:
docker:
- image: ruby:2.5
steps: *steps
workflows:
version: 2
tests:
jobs:
- build-ruby22
- build-ruby23
- build-ruby24
- build-ruby25
| version: 2
references:
steps: &steps
- checkout
- type: cache-restore
key: airports-bundler-{{ checksum "airports.gemspec" }}
- run: gem install bundler
- run: bundle install --path vendor/bundle
- type: cache-save
key: airports-bundler-{{ checksum "airports.gemspec" }}
paths:
- vendor/bundle
- type: shell
command: |
bundle exec rspec --profile 10 \
--format RspecJunitFormatter \
--out /tmp/test-results/rspec.xml \
--format progress \
spec
- type: store_test_results
path: /tmp/test-results
- run: bundle exec rubocop
jobs:
build-ruby24:
docker:
- image: ruby:2.4
steps: *steps
build-ruby25:
docker:
- image: ruby:2.5
steps: *steps
workflows:
version: 2
tests:
jobs:
- build-ruby24
- build-ruby25
| Stop running CircleCI builds with Ruby 2.2 and 2.3 | Stop running CircleCI builds with Ruby 2.2 and 2.3
| YAML | mit | timrogers/airports,timrogers/airports | yaml | ## Code Before:
version: 2
references:
steps: &steps
- checkout
- type: cache-restore
key: airports-bundler-{{ checksum "airports.gemspec" }}
- run: gem install bundler
- run: bundle install --path vendor/bundle
- type: cache-save
key: airports-bundler-{{ checksum "airports.gemspec" }}
paths:
- vendor/bundle
- type: shell
command: |
bundle exec rspec --profile 10 \
--format RspecJunitFormatter \
--out /tmp/test-results/rspec.xml \
--format progress \
spec
- type: store_test_results
path: /tmp/test-results
- run: bundle exec rubocop
jobs:
build-ruby22:
docker:
- image: ruby:2.2
steps: *steps
build-ruby23:
docker:
- image: ruby:2.3
steps: *steps
build-ruby24:
docker:
- image: ruby:2.4
steps: *steps
build-ruby25:
docker:
- image: ruby:2.5
steps: *steps
workflows:
version: 2
tests:
jobs:
- build-ruby22
- build-ruby23
- build-ruby24
- build-ruby25
## Instruction:
Stop running CircleCI builds with Ruby 2.2 and 2.3
## Code After:
version: 2
references:
steps: &steps
- checkout
- type: cache-restore
key: airports-bundler-{{ checksum "airports.gemspec" }}
- run: gem install bundler
- run: bundle install --path vendor/bundle
- type: cache-save
key: airports-bundler-{{ checksum "airports.gemspec" }}
paths:
- vendor/bundle
- type: shell
command: |
bundle exec rspec --profile 10 \
--format RspecJunitFormatter \
--out /tmp/test-results/rspec.xml \
--format progress \
spec
- type: store_test_results
path: /tmp/test-results
- run: bundle exec rubocop
jobs:
build-ruby24:
docker:
- image: ruby:2.4
steps: *steps
build-ruby25:
docker:
- image: ruby:2.5
steps: *steps
workflows:
version: 2
tests:
jobs:
- build-ruby24
- build-ruby25
|
5d59f800da9fb737cd87d47301793f750ca1cbdd | pysnow/exceptions.py | pysnow/exceptions.py |
class PysnowException(Exception):
pass
class InvalidUsage(PysnowException):
pass
class ResponseError(PysnowException):
message = "<empty>"
detail = "<empty>"
def __init__(self, error):
if "message" in error:
self.message = error["message"] or self.message
if "detail" in error:
self.detail = error["detail"] or self.detail
def __str__(self):
return "Error in response. Message: %s, Details: %s" % (
self.message,
self.detail,
)
class MissingResult(PysnowException):
pass
class NoResults(PysnowException):
pass
class EmptyContent(PysnowException):
pass
class MultipleResults(PysnowException):
pass
class MissingToken(PysnowException):
pass
class TokenCreateError(PysnowException):
def __init__(self, error, description, status_code):
self.error = error
self.description = description
self.snow_status_code = status_code
class QueryTypeError(PysnowException):
pass
class QueryMissingField(PysnowException):
pass
class QueryEmpty(PysnowException):
pass
class QueryExpressionError(PysnowException):
pass
class QueryMultipleExpressions(PysnowException):
pass
|
class PysnowException(Exception):
pass
class InvalidUsage(PysnowException):
pass
class UnexpectedResponseFormat(PysnowException):
pass
class ResponseError(PysnowException):
message = "<empty>"
detail = "<empty>"
def __init__(self, error):
if "message" in error:
self.message = error["message"] or self.message
if "detail" in error:
self.detail = error["detail"] or self.detail
def __str__(self):
return "Error in response. Message: %s, Details: %s" % (
self.message,
self.detail,
)
class MissingResult(PysnowException):
pass
class NoResults(PysnowException):
pass
class EmptyContent(PysnowException):
pass
class MultipleResults(PysnowException):
pass
class MissingToken(PysnowException):
pass
class TokenCreateError(PysnowException):
def __init__(self, error, description, status_code):
self.error = error
self.description = description
self.snow_status_code = status_code
class QueryTypeError(PysnowException):
pass
class QueryMissingField(PysnowException):
pass
class QueryEmpty(PysnowException):
pass
class QueryExpressionError(PysnowException):
pass
class QueryMultipleExpressions(PysnowException):
pass
| Add missing UnexpectedResponseFormat for backward compatability | Add missing UnexpectedResponseFormat for backward compatability
Signed-off-by: Abhijeet Kasurde <[email protected]>
| Python | mit | rbw0/pysnow | python | ## Code Before:
class PysnowException(Exception):
pass
class InvalidUsage(PysnowException):
pass
class ResponseError(PysnowException):
message = "<empty>"
detail = "<empty>"
def __init__(self, error):
if "message" in error:
self.message = error["message"] or self.message
if "detail" in error:
self.detail = error["detail"] or self.detail
def __str__(self):
return "Error in response. Message: %s, Details: %s" % (
self.message,
self.detail,
)
class MissingResult(PysnowException):
pass
class NoResults(PysnowException):
pass
class EmptyContent(PysnowException):
pass
class MultipleResults(PysnowException):
pass
class MissingToken(PysnowException):
pass
class TokenCreateError(PysnowException):
def __init__(self, error, description, status_code):
self.error = error
self.description = description
self.snow_status_code = status_code
class QueryTypeError(PysnowException):
pass
class QueryMissingField(PysnowException):
pass
class QueryEmpty(PysnowException):
pass
class QueryExpressionError(PysnowException):
pass
class QueryMultipleExpressions(PysnowException):
pass
## Instruction:
Add missing UnexpectedResponseFormat for backward compatability
Signed-off-by: Abhijeet Kasurde <[email protected]>
## Code After:
class PysnowException(Exception):
pass
class InvalidUsage(PysnowException):
pass
class UnexpectedResponseFormat(PysnowException):
pass
class ResponseError(PysnowException):
message = "<empty>"
detail = "<empty>"
def __init__(self, error):
if "message" in error:
self.message = error["message"] or self.message
if "detail" in error:
self.detail = error["detail"] or self.detail
def __str__(self):
return "Error in response. Message: %s, Details: %s" % (
self.message,
self.detail,
)
class MissingResult(PysnowException):
pass
class NoResults(PysnowException):
pass
class EmptyContent(PysnowException):
pass
class MultipleResults(PysnowException):
pass
class MissingToken(PysnowException):
pass
class TokenCreateError(PysnowException):
def __init__(self, error, description, status_code):
self.error = error
self.description = description
self.snow_status_code = status_code
class QueryTypeError(PysnowException):
pass
class QueryMissingField(PysnowException):
pass
class QueryEmpty(PysnowException):
pass
class QueryExpressionError(PysnowException):
pass
class QueryMultipleExpressions(PysnowException):
pass
|
5dd73a100d75e733c4cd8b40533935b05f6590f7 | .travis.yml | .travis.yml | language: go
sudo: false
go:
- 1.7
- 1.8
script:
- go vet ./...
- go build -v ./...
- go install -v
- go test -v ./ansi
- go test -v ./decorate
- go test -v ./decorate/basic
- go test -v ./decorate/curly
- go test -v ./generic
| language: go
sudo: false
os:
- linux
- osx
go:
- 1.7
- 1.8
script:
- go vet ./...
- go build -v ./...
- go install -v
- go test -v ./ansi
- go test -v ./decorate
- go test -v ./decorate/basic
- go test -v ./decorate/curly
- go test -v ./generic
| Add OSs to build script | Add OSs to build script
| YAML | mit | workanator/go-ataman | yaml | ## Code Before:
language: go
sudo: false
go:
- 1.7
- 1.8
script:
- go vet ./...
- go build -v ./...
- go install -v
- go test -v ./ansi
- go test -v ./decorate
- go test -v ./decorate/basic
- go test -v ./decorate/curly
- go test -v ./generic
## Instruction:
Add OSs to build script
## Code After:
language: go
sudo: false
os:
- linux
- osx
go:
- 1.7
- 1.8
script:
- go vet ./...
- go build -v ./...
- go install -v
- go test -v ./ansi
- go test -v ./decorate
- go test -v ./decorate/basic
- go test -v ./decorate/curly
- go test -v ./generic
|
dde58195761e930cee31a7feea063bae9613187a | example/src/main.cpp | example/src/main.cpp |
int main()
{
#ifdef TARGET_RASPBERRY_PI
ofSetupOpenGL(600, 500, OF_FULLSCREEN);
#else
ofSetupOpenGL(600, 500, OF_WINDOW);
#endif
ofRunApp(new ofApp());
} | // Accept arguments in the Pi version
int main(int argc, char* argv[]) {
bool fullscreen = false;
if (argc > 0) {
std::string fullscreenFlag = "-f";
for (int i = 0; i < argc; i++) {
if (strcmp(argv[i], fullscreenFlag.c_str()) == 0) {
fullscreen = true;
break;
}
}
}
if (fullscreen) {
ofSetupOpenGL(600, 500, OF_FULLSCREEN);
} else {
ofSetupOpenGL(800, 450, OF_WINDOW);
}
ofRunApp(new ofApp());
}
#else
int main() {
ofSetupOpenGL(800, 600, OF_WINDOW);
ofRunApp(new ofApp());
}
#endif
| Add -f flag option to RPi version of he example | Add -f flag option to RPi version of he example
| C++ | mit | PPilmeyer/ofxPiMapper | c++ | ## Code Before:
int main()
{
#ifdef TARGET_RASPBERRY_PI
ofSetupOpenGL(600, 500, OF_FULLSCREEN);
#else
ofSetupOpenGL(600, 500, OF_WINDOW);
#endif
ofRunApp(new ofApp());
}
## Instruction:
Add -f flag option to RPi version of he example
## Code After:
// Accept arguments in the Pi version
int main(int argc, char* argv[]) {
bool fullscreen = false;
if (argc > 0) {
std::string fullscreenFlag = "-f";
for (int i = 0; i < argc; i++) {
if (strcmp(argv[i], fullscreenFlag.c_str()) == 0) {
fullscreen = true;
break;
}
}
}
if (fullscreen) {
ofSetupOpenGL(600, 500, OF_FULLSCREEN);
} else {
ofSetupOpenGL(800, 450, OF_WINDOW);
}
ofRunApp(new ofApp());
}
#else
int main() {
ofSetupOpenGL(800, 600, OF_WINDOW);
ofRunApp(new ofApp());
}
#endif
|
29794e19d0a2a155e6b8693005fb05ee05d738ff | gcp/modules/gcp-stackdriver-lbm/resources/log_based_metrics/backup-exporter_error.json | gcp/modules/gcp-stackdriver-lbm/resources/log_based_metrics/backup-exporter_error.json | {
"name": "backup-exporter.error",
"filter": "resource.type=\"k8s_container\" AND resource.labels.cluster_name=\"k8s-cluster\" AND resource.labels.namespace_name=\"backup-exporter\" AND resource.labels.container_name=\"backup-container\" AND severity=ERROR AND textPayload:\"ERROR:\""
}
| {
"name": "backup-exporter.error",
"filter": "resource.type=\"k8s_container\" AND resource.labels.cluster_name=\"k8s-cluster\" AND resource.labels.namespace_name=\"backup-exporter\" AND resource.labels.container_name=\"backup-container\" AND severity=ERROR AND (textPayload:\"ERROR:\" OR textPayload:\"CommandException:\")"
}
| Cover other error case for the gsutil command | Cover other error case for the gsutil command
| JSON | bsd-3-clause | mrtyler/gpii-infra,mrtyler/gpii-infra,mrtyler/gpii-terraform,mrtyler/gpii-infra,mrtyler/gpii-terraform,mrtyler/gpii-infra,mrtyler/gpii-terraform | json | ## Code Before:
{
"name": "backup-exporter.error",
"filter": "resource.type=\"k8s_container\" AND resource.labels.cluster_name=\"k8s-cluster\" AND resource.labels.namespace_name=\"backup-exporter\" AND resource.labels.container_name=\"backup-container\" AND severity=ERROR AND textPayload:\"ERROR:\""
}
## Instruction:
Cover other error case for the gsutil command
## Code After:
{
"name": "backup-exporter.error",
"filter": "resource.type=\"k8s_container\" AND resource.labels.cluster_name=\"k8s-cluster\" AND resource.labels.namespace_name=\"backup-exporter\" AND resource.labels.container_name=\"backup-container\" AND severity=ERROR AND (textPayload:\"ERROR:\" OR textPayload:\"CommandException:\")"
}
|
0c221817845bcf78f0dddbc3433af934fd36477e | .travis.yml | .travis.yml | language: node_js
notifications:
email: true
node_js:
- '6'
script:
- npm test && npm run semantic-release
branches:
except:
- /^v\d+\.\d+\.\d+$/
| language: node_js
notifications:
email: true
install: rm -rf node_modules && npm install
node_js:
- '6'
script:
- npm test && npm run semantic-release
branches:
except:
- /^v\d+\.\d+\.\d+$/
| Install deps on Travis manually | chore: Install deps on Travis manually
| YAML | mit | finom/matreshka,matreshkajs/matreshka,finom/matreshka,matreshkajs/matreshka | yaml | ## Code Before:
language: node_js
notifications:
email: true
node_js:
- '6'
script:
- npm test && npm run semantic-release
branches:
except:
- /^v\d+\.\d+\.\d+$/
## Instruction:
chore: Install deps on Travis manually
## Code After:
language: node_js
notifications:
email: true
install: rm -rf node_modules && npm install
node_js:
- '6'
script:
- npm test && npm run semantic-release
branches:
except:
- /^v\d+\.\d+\.\d+$/
|
2f66b37aabd279f543a154b07f8c86d30226e950 | docker-entrypoint.sh | docker-entrypoint.sh | set -e
if [ "$CREATE_USER_UID" -a "$CREATE_USER_GID" ]; then
echo "Create 'site-owner' group with GID=$CREATE_USER_GID"
groupadd -g $CREATE_USER_GID site-owner
echo "Add 'www-data' user to group 'site-owner'"
usermod -a -G site-owner www-data
echo "Create 'site-owner' user with UID=$CREATE_USER_UID, GID=$CREATE_USER_GID"
useradd -d /var/www -g $CREATE_USER_GID -s /bin/false -M -N -u $CREATE_USER_UID site-owner
fi
if [ -n "$PACKAGE_DIR" -a -d "$PACKAGE_DIR" ]; then
cd $PACKAGE_DIR
if [ -f "$PACKAGE_DIR/yarn.lock" ]; then
/usr/bin/yarn install
else
/usr/bin/npm install
fi
fi
exec "$@"
| set -e
if [ "$CREATE_USER_UID" -a "$CREATE_USER_GID" ]; then
echo "Create 'site-owner' group with GID=$CREATE_USER_GID"
groupadd -g $CREATE_USER_GID site-owner
echo "Add 'www-data' user to group 'site-owner'"
usermod -a -G site-owner www-data
echo "Create 'site-owner' user with UID=$CREATE_USER_UID, GID=$CREATE_USER_GID"
useradd -d /var/www -g $CREATE_USER_GID -s /bin/false -M -N -u $CREATE_USER_UID site-owner
fi
if [ -n "$PACKAGE_DIR" -a -d "$PACKAGE_DIR" ]; then
/usr/bin/npm config set prefix "$NODE_PATH"
cd $PACKAGE_DIR
if [ -f "$PACKAGE_DIR/yarn.lock" ]; then
/usr/bin/yarn install
else
/usr/bin/npm install
fi
fi
exec "$@"
| Change Node.js prefix to $NODE_PATH | Change Node.js prefix to $NODE_PATH
| Shell | mit | antage/docker-nodejs | shell | ## Code Before:
set -e
if [ "$CREATE_USER_UID" -a "$CREATE_USER_GID" ]; then
echo "Create 'site-owner' group with GID=$CREATE_USER_GID"
groupadd -g $CREATE_USER_GID site-owner
echo "Add 'www-data' user to group 'site-owner'"
usermod -a -G site-owner www-data
echo "Create 'site-owner' user with UID=$CREATE_USER_UID, GID=$CREATE_USER_GID"
useradd -d /var/www -g $CREATE_USER_GID -s /bin/false -M -N -u $CREATE_USER_UID site-owner
fi
if [ -n "$PACKAGE_DIR" -a -d "$PACKAGE_DIR" ]; then
cd $PACKAGE_DIR
if [ -f "$PACKAGE_DIR/yarn.lock" ]; then
/usr/bin/yarn install
else
/usr/bin/npm install
fi
fi
exec "$@"
## Instruction:
Change Node.js prefix to $NODE_PATH
## Code After:
set -e
if [ "$CREATE_USER_UID" -a "$CREATE_USER_GID" ]; then
echo "Create 'site-owner' group with GID=$CREATE_USER_GID"
groupadd -g $CREATE_USER_GID site-owner
echo "Add 'www-data' user to group 'site-owner'"
usermod -a -G site-owner www-data
echo "Create 'site-owner' user with UID=$CREATE_USER_UID, GID=$CREATE_USER_GID"
useradd -d /var/www -g $CREATE_USER_GID -s /bin/false -M -N -u $CREATE_USER_UID site-owner
fi
if [ -n "$PACKAGE_DIR" -a -d "$PACKAGE_DIR" ]; then
/usr/bin/npm config set prefix "$NODE_PATH"
cd $PACKAGE_DIR
if [ -f "$PACKAGE_DIR/yarn.lock" ]; then
/usr/bin/yarn install
else
/usr/bin/npm install
fi
fi
exec "$@"
|
5b0ffcda19729f74d5c6f30c2cbe09e0cce84a4c | app/views/digital-register/journeys/v8/pre-sign-in.html | app/views/digital-register/journeys/v8/pre-sign-in.html | {{<govuk_template}}
{{$pageTitle}}
Sign in
{{/pageTitle}}
{{$head}}
{{>includes/head}}
<link href="/public/stylesheets/alphagov-static.css" media="screen" rel="stylesheet" type="text/css" />
<link href="/public/stylesheets/land-registry-elements.css" media="screen" rel="stylesheet" type="text/css" />
{{/head}}
{{$content}}
<main id="content" role="main">
{{>digital-register/includes/banner}}
<div class="text">
<h1 class="heading-xlarge">Sign in</h1>
<p class="lede">Have you used this service before?</p>
<form class="form" action="check-sign-in" method="get">
<div class="form-group">
<fieldset class="inline">
<label class="block-label" for="radio-inline-1">
<input id="radio-inline-1" type="radio" name="registered" value="yes" required>
Yes
</label>
<label class="block-label" for="radio-inline-2">
<input id="radio-inline-2" type="radio" name="registered" value="no" required>
No
</label>
</fieldset>
</div>
<div class="form-group">
<button class="button">Continue</button>
</div>
</form>
</div>
</main>
{{/content}}
{{$bodyEnd}}
{{>includes/scripts}}
{{/bodyEnd}}
{{/govuk_template}}
| {{<govuk_template}}
{{$pageTitle}}
Sign in
{{/pageTitle}}
{{$head}}
{{>includes/head}}
<link href="/public/stylesheets/alphagov-static.css" media="screen" rel="stylesheet" type="text/css" />
<link href="/public/stylesheets/land-registry-elements.css" media="screen" rel="stylesheet" type="text/css" />
{{/head}}
{{$content}}
<main id="content" role="main">
{{>digital-register/includes/banner}}
<div class="text">
<h1 class="heading-xlarge">Sign in</h1>
<p class="lede">Have you purchased documents using this service before?</p>
<form class="form" action="check-sign-in" method="get">
<div class="form-group">
<fieldset class="inline">
<label class="block-label" for="radio-inline-1">
<input id="radio-inline-1" type="radio" name="registered" value="yes" required>
Yes
</label>
<label class="block-label" for="radio-inline-2">
<input id="radio-inline-2" type="radio" name="registered" value="no" required>
No
</label>
</fieldset>
</div>
<div class="form-group">
<button class="button">Continue</button>
</div>
</form>
</div>
</main>
{{/content}}
{{$bodyEnd}}
{{>includes/scripts}}
{{/bodyEnd}}
{{/govuk_template}}
| Make the pre sign in question more understandable | Make the pre sign in question more understandable
| HTML | mit | LandRegistry/property-page-html-prototypes,LandRegistry/property-page-html-prototypes | html | ## Code Before:
{{<govuk_template}}
{{$pageTitle}}
Sign in
{{/pageTitle}}
{{$head}}
{{>includes/head}}
<link href="/public/stylesheets/alphagov-static.css" media="screen" rel="stylesheet" type="text/css" />
<link href="/public/stylesheets/land-registry-elements.css" media="screen" rel="stylesheet" type="text/css" />
{{/head}}
{{$content}}
<main id="content" role="main">
{{>digital-register/includes/banner}}
<div class="text">
<h1 class="heading-xlarge">Sign in</h1>
<p class="lede">Have you used this service before?</p>
<form class="form" action="check-sign-in" method="get">
<div class="form-group">
<fieldset class="inline">
<label class="block-label" for="radio-inline-1">
<input id="radio-inline-1" type="radio" name="registered" value="yes" required>
Yes
</label>
<label class="block-label" for="radio-inline-2">
<input id="radio-inline-2" type="radio" name="registered" value="no" required>
No
</label>
</fieldset>
</div>
<div class="form-group">
<button class="button">Continue</button>
</div>
</form>
</div>
</main>
{{/content}}
{{$bodyEnd}}
{{>includes/scripts}}
{{/bodyEnd}}
{{/govuk_template}}
## Instruction:
Make the pre sign in question more understandable
## Code After:
{{<govuk_template}}
{{$pageTitle}}
Sign in
{{/pageTitle}}
{{$head}}
{{>includes/head}}
<link href="/public/stylesheets/alphagov-static.css" media="screen" rel="stylesheet" type="text/css" />
<link href="/public/stylesheets/land-registry-elements.css" media="screen" rel="stylesheet" type="text/css" />
{{/head}}
{{$content}}
<main id="content" role="main">
{{>digital-register/includes/banner}}
<div class="text">
<h1 class="heading-xlarge">Sign in</h1>
<p class="lede">Have you purchased documents using this service before?</p>
<form class="form" action="check-sign-in" method="get">
<div class="form-group">
<fieldset class="inline">
<label class="block-label" for="radio-inline-1">
<input id="radio-inline-1" type="radio" name="registered" value="yes" required>
Yes
</label>
<label class="block-label" for="radio-inline-2">
<input id="radio-inline-2" type="radio" name="registered" value="no" required>
No
</label>
</fieldset>
</div>
<div class="form-group">
<button class="button">Continue</button>
</div>
</form>
</div>
</main>
{{/content}}
{{$bodyEnd}}
{{>includes/scripts}}
{{/bodyEnd}}
{{/govuk_template}}
|
7701bc6ab0b1e27daec6da83a8e50e2b9aaf1997 | .styleci.yml | .styleci.yml | preset: psr2
enabled:
- concat_without_spaces
- extra_empty_lines
- short_array_syntax
- method_separation
- multiline_array_trailing_comma
- no_empty_lines_after_phpdocs
- operators_spaces
- ordered_use
# - phpdoc_align
- phpdoc_indent
- phpdoc_inline_tag
- phpdoc_no_access
- phpdoc_no_package
- phpdoc_order
- phpdoc_scalar
- phpdoc_separation
- phpdoc_to_comment
- phpdoc_trim
- phpdoc_type_to_var
- phpdoc_types
- phpdoc_var_without_name
- return
- short_bool_cast
- single_quote
- spaces_after_semicolon
- spaces_cast
- standardize_not_equal
- ternary_spaces
- trim_array_spaces
- unalign_double_arrow
- unalign_equals
- unary_operators_spaces
- unneeded_control_parentheses
- unused_use
- whitespacy_lines
| preset: psr2
enabled:
- concat_without_spaces
- extra_empty_lines
- short_array_syntax
- method_separation
- multiline_array_trailing_comma
- no_empty_lines_after_phpdocs
- operators_spaces
- ordered_use
# - phpdoc_align
- phpdoc_indent
- phpdoc_inline_tag
- phpdoc_no_access
- phpdoc_no_package
- phpdoc_order
- phpdoc_scalar
- phpdoc_separation
- phpdoc_to_comment
- phpdoc_trim
- phpdoc_type_to_var
- phpdoc_types
- phpdoc_var_without_name
- return
- short_bool_cast
- single_quote
- spaces_after_semicolon
- spaces_cast
- standardize_not_equal
- ternary_spaces
- trim_array_spaces
- unalign_double_arrow
- unalign_equals
- unary_operators_spaces
- unneeded_control_parentheses
- unused_use
- whitespacy_lines
finder:
exclude:
- "src/Carbon/Doctrine/DateTimeType.php"
- "src/Carbon/Doctrine/DateTimeImmutableType.php"
| Exclude Doctrine types from StyleCI | Exclude Doctrine types from StyleCI | YAML | mit | lucasmichot/Carbon,briannesbitt/Carbon,kylekatarnls/Carbon | yaml | ## Code Before:
preset: psr2
enabled:
- concat_without_spaces
- extra_empty_lines
- short_array_syntax
- method_separation
- multiline_array_trailing_comma
- no_empty_lines_after_phpdocs
- operators_spaces
- ordered_use
# - phpdoc_align
- phpdoc_indent
- phpdoc_inline_tag
- phpdoc_no_access
- phpdoc_no_package
- phpdoc_order
- phpdoc_scalar
- phpdoc_separation
- phpdoc_to_comment
- phpdoc_trim
- phpdoc_type_to_var
- phpdoc_types
- phpdoc_var_without_name
- return
- short_bool_cast
- single_quote
- spaces_after_semicolon
- spaces_cast
- standardize_not_equal
- ternary_spaces
- trim_array_spaces
- unalign_double_arrow
- unalign_equals
- unary_operators_spaces
- unneeded_control_parentheses
- unused_use
- whitespacy_lines
## Instruction:
Exclude Doctrine types from StyleCI
## Code After:
preset: psr2
enabled:
- concat_without_spaces
- extra_empty_lines
- short_array_syntax
- method_separation
- multiline_array_trailing_comma
- no_empty_lines_after_phpdocs
- operators_spaces
- ordered_use
# - phpdoc_align
- phpdoc_indent
- phpdoc_inline_tag
- phpdoc_no_access
- phpdoc_no_package
- phpdoc_order
- phpdoc_scalar
- phpdoc_separation
- phpdoc_to_comment
- phpdoc_trim
- phpdoc_type_to_var
- phpdoc_types
- phpdoc_var_without_name
- return
- short_bool_cast
- single_quote
- spaces_after_semicolon
- spaces_cast
- standardize_not_equal
- ternary_spaces
- trim_array_spaces
- unalign_double_arrow
- unalign_equals
- unary_operators_spaces
- unneeded_control_parentheses
- unused_use
- whitespacy_lines
finder:
exclude:
- "src/Carbon/Doctrine/DateTimeType.php"
- "src/Carbon/Doctrine/DateTimeImmutableType.php"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.