commit
stringlengths
40
40
old_file
stringlengths
4
184
new_file
stringlengths
4
184
old_contents
stringlengths
1
3.6k
new_contents
stringlengths
5
3.38k
subject
stringlengths
15
778
message
stringlengths
16
6.74k
lang
stringclasses
201 values
license
stringclasses
13 values
repos
stringlengths
6
116k
config
stringclasses
201 values
content
stringlengths
137
7.24k
diff
stringlengths
26
5.55k
diff_length
int64
1
123
relative_diff_length
float64
0.01
89
n_lines_added
int64
0
108
n_lines_deleted
int64
0
106
6eae072f315b7ddcfe476a3d179bee2e6545393e
.travis.yml
.travis.yml
sudo: false before_install: gem install bundler rvm: - '2.2' - '2.3'
sudo: false before_install: gem install bundler rvm: - '2.5'
Upgrade rubies list on Travis
Upgrade rubies list on Travis
YAML
mit
Shopify/buildkit,Shopify/buildkit
yaml
## Code Before: sudo: false before_install: gem install bundler rvm: - '2.2' - '2.3' ## Instruction: Upgrade rubies list on Travis ## Code After: sudo: false before_install: gem install bundler rvm: - '2.5'
sudo: false before_install: gem install bundler rvm: - - '2.2' ? ^ + - '2.5' ? ^ - - '2.3' -
4
0.666667
1
3
2c4e8e7b5c982a7ae7bff2bb382d7089ddef8b6e
app.yaml
app.yaml
application: captain-pasty version: dev runtime: python27 api_version: 1 threadsafe: true handlers: - url: /static/ static_dir: static secure: always - url: /_ah/(mapreduce|queue|warmup).* script: project.wsgi.application login: admin - url: /.* script: project.wsgi.application secure: always skip_files: - ^(.*/)?#.*#$ - ^(.*/)?.*~$ - ^(.*/)?.*\.py[co]$ - ^(.*/)?.*/RCS/.*$ - ^(.*/)?\..*$ - ^node_modules/ - ^static/src/ - ^libs/.*\.(egg|dist)-info
application: captain-pasty version: captain-pasty runtime: python27 api_version: 1 threadsafe: true handlers: - url: /static/ static_dir: static secure: always - url: /_ah/(mapreduce|queue|warmup).* script: project.wsgi.application login: admin - url: /.* script: project.wsgi.application secure: always skip_files: - ^(.*/)?#.*#$ - ^(.*/)?.*~$ - ^(.*/)?.*\.py[co]$ - ^(.*/)?.*/RCS/.*$ - ^(.*/)?\..*$ - ^node_modules/ - ^static/src/ - ^libs/.*\.(egg|dist)-info
Set the default version to 'captain-pasty'.
Set the default version to 'captain-pasty'.
YAML
mit
davidwtbuxton/captain-pasty,davidwtbuxton/captain-pasty,davidwtbuxton/captain-pasty,davidwtbuxton/captain-pasty
yaml
## Code Before: application: captain-pasty version: dev runtime: python27 api_version: 1 threadsafe: true handlers: - url: /static/ static_dir: static secure: always - url: /_ah/(mapreduce|queue|warmup).* script: project.wsgi.application login: admin - url: /.* script: project.wsgi.application secure: always skip_files: - ^(.*/)?#.*#$ - ^(.*/)?.*~$ - ^(.*/)?.*\.py[co]$ - ^(.*/)?.*/RCS/.*$ - ^(.*/)?\..*$ - ^node_modules/ - ^static/src/ - ^libs/.*\.(egg|dist)-info ## Instruction: Set the default version to 'captain-pasty'. ## Code After: application: captain-pasty version: captain-pasty runtime: python27 api_version: 1 threadsafe: true handlers: - url: /static/ static_dir: static secure: always - url: /_ah/(mapreduce|queue|warmup).* script: project.wsgi.application login: admin - url: /.* script: project.wsgi.application secure: always skip_files: - ^(.*/)?#.*#$ - ^(.*/)?.*~$ - ^(.*/)?.*\.py[co]$ - ^(.*/)?.*/RCS/.*$ - ^(.*/)?\..*$ - ^node_modules/ - ^static/src/ - ^libs/.*\.(egg|dist)-info
application: captain-pasty - version: dev + version: captain-pasty runtime: python27 api_version: 1 threadsafe: true handlers: - url: /static/ static_dir: static secure: always - url: /_ah/(mapreduce|queue|warmup).* script: project.wsgi.application login: admin - url: /.* script: project.wsgi.application secure: always skip_files: - ^(.*/)?#.*#$ - ^(.*/)?.*~$ - ^(.*/)?.*\.py[co]$ - ^(.*/)?.*/RCS/.*$ - ^(.*/)?\..*$ - ^node_modules/ - ^static/src/ - ^libs/.*\.(egg|dist)-info
2
0.066667
1
1
e9b7e872ea33d742ec343146969e2287887c4024
scripts/engine.json
scripts/engine.json
{ "product" : "FabMo-Engine", "os" : "linux", "platform" : "edison", "system" : "handibot", "token" : "/fabmo/engine/install_token", "repository" : "https://github.com/FabMo/FabMo-Engine", "updaterNeeded" : "v2.0.0", "services" : ["fabmo"], "operations" : [ { "op" : "deleteFiles", "paths" : [ "/fabmo/engine" ] }, { "op" : "expandArchive", "src" : "files.tar.gz", "dest" : "/fabmo/engine" }, { "op" : "installFirmware", "src" : "g2.bin" }, { "op" : "deleteFiles", "paths" : [ "/opt/fabmo/approot" ] } ] }
{ "product" : "FabMo-Engine", "os" : "linux", "platform" : "edison", "system" : "handibot", "token" : "/fabmo/engine/install_token", "repository" : "https://github.com/FabMo/FabMo-Engine", "updaterNeeded" : "v2.0.0", "services" : ["fabmo"], "operations" : [ { "op" : "deleteFiles", "paths" : [ "/fabmo/engine" ] }, { "op" : "expandArchive", "src" : "files.tar.gz", "dest" : "/fabmo/engine" }, { "op" : "installFirmware", "src" : "g2.bin" }, { "op" : "deleteFiles", "paths" : [ "/opt/fabmo/approot", "/opt/fabmo/profiles" ] } ] }
Add profiles to the chop list
Add profiles to the chop list
JSON
apache-2.0
FabMo/FabMo-Updater,FabMo/FabMo-Updater,FabMo/FabMo-Updater,FabMo/FabMo-Updater
json
## Code Before: { "product" : "FabMo-Engine", "os" : "linux", "platform" : "edison", "system" : "handibot", "token" : "/fabmo/engine/install_token", "repository" : "https://github.com/FabMo/FabMo-Engine", "updaterNeeded" : "v2.0.0", "services" : ["fabmo"], "operations" : [ { "op" : "deleteFiles", "paths" : [ "/fabmo/engine" ] }, { "op" : "expandArchive", "src" : "files.tar.gz", "dest" : "/fabmo/engine" }, { "op" : "installFirmware", "src" : "g2.bin" }, { "op" : "deleteFiles", "paths" : [ "/opt/fabmo/approot" ] } ] } ## Instruction: Add profiles to the chop list ## Code After: { "product" : "FabMo-Engine", "os" : "linux", "platform" : "edison", "system" : "handibot", "token" : "/fabmo/engine/install_token", "repository" : "https://github.com/FabMo/FabMo-Engine", "updaterNeeded" : "v2.0.0", "services" : ["fabmo"], "operations" : [ { "op" : "deleteFiles", "paths" : [ "/fabmo/engine" ] }, { "op" : "expandArchive", "src" : "files.tar.gz", "dest" : "/fabmo/engine" }, { "op" : "installFirmware", "src" : "g2.bin" }, { "op" : "deleteFiles", "paths" : [ "/opt/fabmo/approot", "/opt/fabmo/profiles" ] } ] }
{ "product" : "FabMo-Engine", "os" : "linux", "platform" : "edison", "system" : "handibot", "token" : "/fabmo/engine/install_token", "repository" : "https://github.com/FabMo/FabMo-Engine", "updaterNeeded" : "v2.0.0", "services" : ["fabmo"], "operations" : [ { "op" : "deleteFiles", "paths" : [ "/fabmo/engine" ] }, { "op" : "expandArchive", "src" : "files.tar.gz", "dest" : "/fabmo/engine" }, { "op" : "installFirmware", "src" : "g2.bin" }, { "op" : "deleteFiles", "paths" : [ - "/opt/fabmo/approot" + "/opt/fabmo/approot", ? + + "/opt/fabmo/profiles" ] } ] }
3
0.090909
2
1
72fd4e20a537ff5ff0f454ba552ecb6e4d09b76d
test/test_gn.py
test/test_gn.py
''' GotoNewest tests ''' import unittest import sys sys.path.append('../src/') import gn TEST_DIR_NO_SUB = '/tmp/testnosub' TEST_DIR_ONE_SUB = '/tmp/testonesub' class TestGotoNewest(unittest.TestCase): ''' Test class for GotoNewest ''' def test_empty_base_dir(self): ''' If the base directory is empty, raise an AttributeError ''' self.assertRaises(AttributeError, gn.transfer, None) def test_base_dir_with_no_subdirs(self): ''' If the base directory has no subdirectories, raise an AttributeError ''' self.assertRaises(AttributeError, gn.transfer, TEST_DIR_NO_SUB) def test_one_subdirectory(self): ''' If there is only one subdirectory in the base directory, return the directory ''' self.assertEquals('temp', gn.transfer(TEST_DIR_ONE_SUB)) if __name__ == '__main__': unittest.main()
''' GotoNewest tests ''' import unittest import sys sys.path.append('../src/') import gn TEST_DIR_NO_SUB = '/tmp/testnosub' TEST_DIR_ONE_SUB = '/tmp/testonesub' TEST_DIR_TWO_SUB = '/tmp/testtwosub' class TestGotoNewest(unittest.TestCase): ''' Test class for GotoNewest ''' def test_empty_base_dir(self): ''' If the base directory is empty, raise an AttributeError ''' self.assertRaises(AttributeError, gn.transfer, None) def test_base_dir_with_no_subdirs(self): ''' If the base directory has no subdirectories, raise an AttributeError ''' self.assertRaises(AttributeError, gn.transfer, TEST_DIR_NO_SUB) def test_one_subdirectory(self): ''' If there is only one subdirectory in the base directory, return the directory ''' self.assertEquals('temp', gn.transfer(TEST_DIR_ONE_SUB)) def test_multiple_subdirectories(self): ''' If there are multiple subdirectories in the base directory, find the one created most recently and return it ''' self.assertEquals('temp2', gn.transfer(TEST_DIR_TWO_SUB)) if __name__ == '__main__': unittest.main()
Add test for multiple subdirectories
Add test for multiple subdirectories
Python
bsd-2-clause
ambidextrousTx/GotoNewest
python
## Code Before: ''' GotoNewest tests ''' import unittest import sys sys.path.append('../src/') import gn TEST_DIR_NO_SUB = '/tmp/testnosub' TEST_DIR_ONE_SUB = '/tmp/testonesub' class TestGotoNewest(unittest.TestCase): ''' Test class for GotoNewest ''' def test_empty_base_dir(self): ''' If the base directory is empty, raise an AttributeError ''' self.assertRaises(AttributeError, gn.transfer, None) def test_base_dir_with_no_subdirs(self): ''' If the base directory has no subdirectories, raise an AttributeError ''' self.assertRaises(AttributeError, gn.transfer, TEST_DIR_NO_SUB) def test_one_subdirectory(self): ''' If there is only one subdirectory in the base directory, return the directory ''' self.assertEquals('temp', gn.transfer(TEST_DIR_ONE_SUB)) if __name__ == '__main__': unittest.main() ## Instruction: Add test for multiple subdirectories ## Code After: ''' GotoNewest tests ''' import unittest import sys sys.path.append('../src/') import gn TEST_DIR_NO_SUB = '/tmp/testnosub' TEST_DIR_ONE_SUB = '/tmp/testonesub' TEST_DIR_TWO_SUB = '/tmp/testtwosub' class TestGotoNewest(unittest.TestCase): ''' Test class for GotoNewest ''' def test_empty_base_dir(self): ''' If the base directory is empty, raise an AttributeError ''' self.assertRaises(AttributeError, gn.transfer, None) def test_base_dir_with_no_subdirs(self): ''' If the base directory has no subdirectories, raise an AttributeError ''' self.assertRaises(AttributeError, gn.transfer, TEST_DIR_NO_SUB) def test_one_subdirectory(self): ''' If there is only one subdirectory in the base directory, return the directory ''' self.assertEquals('temp', gn.transfer(TEST_DIR_ONE_SUB)) def test_multiple_subdirectories(self): ''' If there are multiple subdirectories in the base directory, find the one created most recently and return it ''' self.assertEquals('temp2', gn.transfer(TEST_DIR_TWO_SUB)) if __name__ == '__main__': unittest.main()
''' GotoNewest tests ''' import unittest import sys sys.path.append('../src/') import gn TEST_DIR_NO_SUB = '/tmp/testnosub' TEST_DIR_ONE_SUB = '/tmp/testonesub' + TEST_DIR_TWO_SUB = '/tmp/testtwosub' class TestGotoNewest(unittest.TestCase): ''' Test class for GotoNewest ''' def test_empty_base_dir(self): ''' If the base directory is empty, raise an AttributeError ''' self.assertRaises(AttributeError, gn.transfer, None) def test_base_dir_with_no_subdirs(self): ''' If the base directory has no subdirectories, raise an AttributeError ''' self.assertRaises(AttributeError, gn.transfer, TEST_DIR_NO_SUB) def test_one_subdirectory(self): ''' If there is only one subdirectory in the base directory, return the directory ''' self.assertEquals('temp', gn.transfer(TEST_DIR_ONE_SUB)) + def test_multiple_subdirectories(self): + ''' If there are multiple subdirectories in the base + directory, find the one created most recently and + return it + ''' + self.assertEquals('temp2', gn.transfer(TEST_DIR_TWO_SUB)) + if __name__ == '__main__': unittest.main()
8
0.216216
8
0
606cb3475e2e4220822f924d13881dfaefb51aa4
teryt_tree/rest_framework_ext/viewsets.py
teryt_tree/rest_framework_ext/viewsets.py
import django_filters from django.shortcuts import get_object_or_404 try: from django_filters import rest_framework as filters except ImportError: # Back-ward compatible for django-rest-framework<3.7 from rest_framework import filters from rest_framework import viewsets from teryt_tree.models import JednostkaAdministracyjna from teryt_tree.rest_framework_ext.serializers import JednostkaAdministracyjnaSerializer def custom_area_filter(queryset, _, value): if not value: return queryset return queryset.area(get_object_or_404(JednostkaAdministracyjna, pk=value)) class JednostkaAdministracyjnaFilter(filters.FilterSet): area = django_filters.CharFilter(action=custom_area_filter) class Meta: model = JednostkaAdministracyjna fields = ['name', 'category', 'category__level', 'area'] class JednostkaAdministracyjnaViewSet(viewsets.ModelViewSet): queryset = (JednostkaAdministracyjna.objects. select_related('category'). prefetch_related('children'). all()) serializer_class = JednostkaAdministracyjnaSerializer filter_backends = (filters.DjangoFilterBackend,) filter_class = JednostkaAdministracyjnaFilter
import django_filters from django.shortcuts import get_object_or_404 from django.utils.translation import ugettext_lazy as _ try: from django_filters import rest_framework as filters except ImportError: # Back-ward compatible for django-rest-framework<3.7 from rest_framework import filters from rest_framework import viewsets from teryt_tree.models import JednostkaAdministracyjna from teryt_tree.rest_framework_ext.serializers import \ JednostkaAdministracyjnaSerializer def custom_area_filter(queryset, _, value): if not value: return queryset return queryset.area(get_object_or_404(JednostkaAdministracyjna, pk=value)) class JednostkaAdministracyjnaFilter(filters.FilterSet): area = django_filters.CharFilter( method=custom_area_filter, label=_("Area") ) class Meta: model = JednostkaAdministracyjna fields = ['name', 'category', 'category__level', 'area'] class JednostkaAdministracyjnaViewSet(viewsets.ModelViewSet): queryset = (JednostkaAdministracyjna.objects. select_related('category'). prefetch_related('children'). all()) serializer_class = JednostkaAdministracyjnaSerializer filter_backends = (filters.DjangoFilterBackend,) filter_class = JednostkaAdministracyjnaFilter
Update JednostkaAdministracyjnaFilter for new django-filters
Update JednostkaAdministracyjnaFilter for new django-filters
Python
bsd-3-clause
ad-m/django-teryt-tree
python
## Code Before: import django_filters from django.shortcuts import get_object_or_404 try: from django_filters import rest_framework as filters except ImportError: # Back-ward compatible for django-rest-framework<3.7 from rest_framework import filters from rest_framework import viewsets from teryt_tree.models import JednostkaAdministracyjna from teryt_tree.rest_framework_ext.serializers import JednostkaAdministracyjnaSerializer def custom_area_filter(queryset, _, value): if not value: return queryset return queryset.area(get_object_or_404(JednostkaAdministracyjna, pk=value)) class JednostkaAdministracyjnaFilter(filters.FilterSet): area = django_filters.CharFilter(action=custom_area_filter) class Meta: model = JednostkaAdministracyjna fields = ['name', 'category', 'category__level', 'area'] class JednostkaAdministracyjnaViewSet(viewsets.ModelViewSet): queryset = (JednostkaAdministracyjna.objects. select_related('category'). prefetch_related('children'). all()) serializer_class = JednostkaAdministracyjnaSerializer filter_backends = (filters.DjangoFilterBackend,) filter_class = JednostkaAdministracyjnaFilter ## Instruction: Update JednostkaAdministracyjnaFilter for new django-filters ## Code After: import django_filters from django.shortcuts import get_object_or_404 from django.utils.translation import ugettext_lazy as _ try: from django_filters import rest_framework as filters except ImportError: # Back-ward compatible for django-rest-framework<3.7 from rest_framework import filters from rest_framework import viewsets from teryt_tree.models import JednostkaAdministracyjna from teryt_tree.rest_framework_ext.serializers import \ JednostkaAdministracyjnaSerializer def custom_area_filter(queryset, _, value): if not value: return queryset return queryset.area(get_object_or_404(JednostkaAdministracyjna, pk=value)) class JednostkaAdministracyjnaFilter(filters.FilterSet): area = django_filters.CharFilter( method=custom_area_filter, label=_("Area") ) class Meta: model = JednostkaAdministracyjna fields = ['name', 'category', 'category__level', 'area'] class JednostkaAdministracyjnaViewSet(viewsets.ModelViewSet): queryset = (JednostkaAdministracyjna.objects. select_related('category'). prefetch_related('children'). all()) serializer_class = JednostkaAdministracyjnaSerializer filter_backends = (filters.DjangoFilterBackend,) filter_class = JednostkaAdministracyjnaFilter
import django_filters from django.shortcuts import get_object_or_404 + from django.utils.translation import ugettext_lazy as _ + try: from django_filters import rest_framework as filters except ImportError: # Back-ward compatible for django-rest-framework<3.7 from rest_framework import filters from rest_framework import viewsets from teryt_tree.models import JednostkaAdministracyjna - from teryt_tree.rest_framework_ext.serializers import JednostkaAdministracyjnaSerializer ? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + from teryt_tree.rest_framework_ext.serializers import \ ? ^ + JednostkaAdministracyjnaSerializer def custom_area_filter(queryset, _, value): if not value: return queryset return queryset.area(get_object_or_404(JednostkaAdministracyjna, pk=value)) class JednostkaAdministracyjnaFilter(filters.FilterSet): - area = django_filters.CharFilter(action=custom_area_filter) + area = django_filters.CharFilter( + method=custom_area_filter, + label=_("Area") + ) class Meta: model = JednostkaAdministracyjna fields = ['name', 'category', 'category__level', 'area'] class JednostkaAdministracyjnaViewSet(viewsets.ModelViewSet): queryset = (JednostkaAdministracyjna.objects. select_related('category'). prefetch_related('children'). all()) serializer_class = JednostkaAdministracyjnaSerializer filter_backends = (filters.DjangoFilterBackend,) filter_class = JednostkaAdministracyjnaFilter
10
0.30303
8
2
2c759135772568d895b06694cc59197a69e20423
README.md
README.md
[![Standard - JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](http://standardjs.com/) A Prototype Electron Application ```bash # Install npm install # Run npm start ``` #### electron-packager ``` # Package Application npm install electron-packager -g electron-packager . workbench --platform win32 arch--x64 --overwrite --win32metadata.CompanyName="Digital Super Glue" --win32metadata.ProductName="Workbench" --app-copyright "Copyright (C) 2017 Digital Super Glue, All rights reserved" ``` #### electron-builder ``` # Package, Installer and AutoUpdater npm install electron-builder -g # Create a test distribution npm run pack # Create full distribution (can take some time while creating installer) npm run dist ```
[![Standard - JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](http://standardjs.com/) A Prototype Electron Application ```bash # Install npm install # Run npm start ``` #### electron-packager ``` # Package Application npm install electron-packager -g electron-packager . workbench --platform win32 arch--x64 --overwrite --win32metadata.CompanyName="Digital Super Glue" --win32metadata.ProductName="Workbench" --app-copyright "Copyright (C) 2017 Digital Super Glue, All rights reserved" ``` #### electron-builder ``` # Package, Installer and AutoUpdater npm install electron-builder -g # Create a test distribution npm run pack # Create full distribution (can take some time while creating installer) npm run dist ``` standard ``` install npm install standard -g --save-dev run standard ```
Add standard package install instructions
Add standard package install instructions
Markdown
mit
ralphwillgoss/workbench-electron,ralphwillgoss/workbench-electron
markdown
## Code Before: [![Standard - JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](http://standardjs.com/) A Prototype Electron Application ```bash # Install npm install # Run npm start ``` #### electron-packager ``` # Package Application npm install electron-packager -g electron-packager . workbench --platform win32 arch--x64 --overwrite --win32metadata.CompanyName="Digital Super Glue" --win32metadata.ProductName="Workbench" --app-copyright "Copyright (C) 2017 Digital Super Glue, All rights reserved" ``` #### electron-builder ``` # Package, Installer and AutoUpdater npm install electron-builder -g # Create a test distribution npm run pack # Create full distribution (can take some time while creating installer) npm run dist ``` ## Instruction: Add standard package install instructions ## Code After: [![Standard - JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](http://standardjs.com/) A Prototype Electron Application ```bash # Install npm install # Run npm start ``` #### electron-packager ``` # Package Application npm install electron-packager -g electron-packager . workbench --platform win32 arch--x64 --overwrite --win32metadata.CompanyName="Digital Super Glue" --win32metadata.ProductName="Workbench" --app-copyright "Copyright (C) 2017 Digital Super Glue, All rights reserved" ``` #### electron-builder ``` # Package, Installer and AutoUpdater npm install electron-builder -g # Create a test distribution npm run pack # Create full distribution (can take some time while creating installer) npm run dist ``` standard ``` install npm install standard -g --save-dev run standard ```
[![Standard - JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](http://standardjs.com/) A Prototype Electron Application ```bash # Install npm install # Run npm start ``` #### electron-packager ``` # Package Application npm install electron-packager -g electron-packager . workbench --platform win32 arch--x64 --overwrite --win32metadata.CompanyName="Digital Super Glue" --win32metadata.ProductName="Workbench" --app-copyright "Copyright (C) 2017 Digital Super Glue, All rights reserved" ``` #### electron-builder ``` # Package, Installer and AutoUpdater npm install electron-builder -g # Create a test distribution npm run pack # Create full distribution (can take some time while creating installer) npm run dist ``` + + standard + ``` + install + npm install standard -g --save-dev + + run + standard + ```
9
0.290323
9
0
643e2b07e5a741e4e1e740b1ea3d32932d5e3631
.travis.yml
.travis.yml
language: php sudo: false cache: directories: - $HOME/.composer/cache matrix: include: - php: hhvm - php: 5.4 env: check_cs=true - php: 5.5 - php: 5.6 env: deps=low coverage=true - php: 5.6 env: deps=high coverage=true - php: 7.0 env: global: - deps=high - coverage=false - check_cs=false install: - if [ "$deps" = "low" ]; then composer --prefer-source --prefer-lowest update; fi; - if [ "$deps" != "low" ]; then composer --prefer-source update; fi; script: - if [ "$coverage" = "true" ]; then vendor/bin/phpunit --coverage-clover=coverage; fi; - if [ "$coverage" != "true" ]; then vendor/bin/phpunit; fi; - if [ "$check_cs" = "true" ]; then vendor/bin/php-cs-fixer fix --config-file=.php_cs --dry-run --diff; fi; after_script: - if [ "$coverage" = "true" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi; - if [ "$coverage" = "true" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage; fi;
language: php sudo: false cache: directories: - $HOME/.composer/cache matrix: include: - php: hhvm - php: 5.4 env: check_cs=true - php: 5.5 - php: 5.6 env: deps=low coverage=true - php: 5.6 env: deps=high coverage=true - php: 7.0 - php: 7.1 - php: 7.2 - php: 7.3 env: global: - deps=high - coverage=false - check_cs=false install: - if [ "$deps" = "low" ]; then composer --prefer-source --prefer-lowest update; fi; - if [ "$deps" != "low" ]; then composer --prefer-source update; fi; script: - if [ "$coverage" = "true" ]; then vendor/bin/phpunit --coverage-clover=coverage; fi; - if [ "$coverage" != "true" ]; then vendor/bin/phpunit; fi; - if [ "$check_cs" = "true" ]; then vendor/bin/php-cs-fixer fix --config-file=.php_cs --dry-run --diff; fi; after_script: - if [ "$coverage" = "true" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi; - if [ "$coverage" = "true" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage; fi;
Add PHP 7.1, 7.2, and 7.3 to Travis build matrix
Enhancement: Add PHP 7.1, 7.2, and 7.3 to Travis build matrix
YAML
mit
pyrech/composer-changelogs,pyrech/composer-changelogs
yaml
## Code Before: language: php sudo: false cache: directories: - $HOME/.composer/cache matrix: include: - php: hhvm - php: 5.4 env: check_cs=true - php: 5.5 - php: 5.6 env: deps=low coverage=true - php: 5.6 env: deps=high coverage=true - php: 7.0 env: global: - deps=high - coverage=false - check_cs=false install: - if [ "$deps" = "low" ]; then composer --prefer-source --prefer-lowest update; fi; - if [ "$deps" != "low" ]; then composer --prefer-source update; fi; script: - if [ "$coverage" = "true" ]; then vendor/bin/phpunit --coverage-clover=coverage; fi; - if [ "$coverage" != "true" ]; then vendor/bin/phpunit; fi; - if [ "$check_cs" = "true" ]; then vendor/bin/php-cs-fixer fix --config-file=.php_cs --dry-run --diff; fi; after_script: - if [ "$coverage" = "true" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi; - if [ "$coverage" = "true" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage; fi; ## Instruction: Enhancement: Add PHP 7.1, 7.2, and 7.3 to Travis build matrix ## Code After: language: php sudo: false cache: directories: - $HOME/.composer/cache matrix: include: - php: hhvm - php: 5.4 env: check_cs=true - php: 5.5 - php: 5.6 env: deps=low coverage=true - php: 5.6 env: deps=high coverage=true - php: 7.0 - php: 7.1 - php: 7.2 - php: 7.3 env: global: - deps=high - coverage=false - check_cs=false install: - if [ "$deps" = "low" ]; then composer --prefer-source --prefer-lowest update; fi; - if [ "$deps" != "low" ]; then composer --prefer-source update; fi; script: - if [ "$coverage" = "true" ]; then vendor/bin/phpunit --coverage-clover=coverage; fi; - if [ "$coverage" != "true" ]; then vendor/bin/phpunit; fi; - if [ "$check_cs" = "true" ]; then vendor/bin/php-cs-fixer fix --config-file=.php_cs --dry-run --diff; fi; after_script: - if [ "$coverage" = "true" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi; - if [ "$coverage" = "true" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage; fi;
language: php sudo: false cache: directories: - $HOME/.composer/cache matrix: include: - php: hhvm - php: 5.4 env: check_cs=true - php: 5.5 - php: 5.6 env: deps=low coverage=true - php: 5.6 env: deps=high coverage=true - php: 7.0 + - php: 7.1 + - php: 7.2 + - php: 7.3 env: global: - deps=high - coverage=false - check_cs=false install: - if [ "$deps" = "low" ]; then composer --prefer-source --prefer-lowest update; fi; - if [ "$deps" != "low" ]; then composer --prefer-source update; fi; script: - if [ "$coverage" = "true" ]; then vendor/bin/phpunit --coverage-clover=coverage; fi; - if [ "$coverage" != "true" ]; then vendor/bin/phpunit; fi; - if [ "$check_cs" = "true" ]; then vendor/bin/php-cs-fixer fix --config-file=.php_cs --dry-run --diff; fi; after_script: - if [ "$coverage" = "true" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi; - if [ "$coverage" = "true" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage; fi;
3
0.078947
3
0
f1dbbdf81199ee4e753361289aed7ecd95a3fc13
test/core/Enum.js
test/core/Enum.js
var Enum = require('../../core/Enum'); describe('Enum', function () { it('should create an enum and provide a lookup function', function () { var myEnum = Enum(['a', 'b', 'c']); console.log(myEnum); expect(myEnum).to.have.ownProperty('a'); expect(myEnum).to.have.ownProperty('b') expect(myEnum).to.have.ownProperty('c'); expect(myEnum.__lookup(myEnum.a)).to.equal('a'); expect(myEnum.__lookup(myEnum.b)).to.equal('b'); expect(myEnum.__lookup(myEnum.c)).to.equal('c'); }); it('should not be writable', function () { var myEnum = Enum(['a']); var prevValue = myEnum.a; myEnum.a = -1; expect(myEnum.a).to.equal(prevValue); var prevLookupFunction = myEnum.__lookup; myEnum.__lookup = 100; expect(myEnum.__lookup).to.equal(prevLookupFunction); }); });
var Enum = require('../../core/Enum'); describe('Enum', function () { it('should create an enum and provide a lookup function', function () { var myEnum = Enum(['a', 'b', 'c']); expect(myEnum).to.have.ownProperty('a'); expect(myEnum).to.have.ownProperty('b') expect(myEnum).to.have.ownProperty('c'); expect(myEnum.__lookup(myEnum.a)).to.equal('a'); expect(myEnum.__lookup(myEnum.b)).to.equal('b'); expect(myEnum.__lookup(myEnum.c)).to.equal('c'); }); it('should not be writable', function () { var myEnum = Enum(['a']); var prevValue = myEnum.a; myEnum.a = -1; expect(myEnum.a).to.equal(prevValue); var prevLookupFunction = myEnum.__lookup; myEnum.__lookup = 100; expect(myEnum.__lookup).to.equal(prevLookupFunction); }); });
Remove leftover logging in test
Remove leftover logging in test
JavaScript
mit
jpaulm/jsfbp
javascript
## Code Before: var Enum = require('../../core/Enum'); describe('Enum', function () { it('should create an enum and provide a lookup function', function () { var myEnum = Enum(['a', 'b', 'c']); console.log(myEnum); expect(myEnum).to.have.ownProperty('a'); expect(myEnum).to.have.ownProperty('b') expect(myEnum).to.have.ownProperty('c'); expect(myEnum.__lookup(myEnum.a)).to.equal('a'); expect(myEnum.__lookup(myEnum.b)).to.equal('b'); expect(myEnum.__lookup(myEnum.c)).to.equal('c'); }); it('should not be writable', function () { var myEnum = Enum(['a']); var prevValue = myEnum.a; myEnum.a = -1; expect(myEnum.a).to.equal(prevValue); var prevLookupFunction = myEnum.__lookup; myEnum.__lookup = 100; expect(myEnum.__lookup).to.equal(prevLookupFunction); }); }); ## Instruction: Remove leftover logging in test ## Code After: var Enum = require('../../core/Enum'); describe('Enum', function () { it('should create an enum and provide a lookup function', function () { var myEnum = Enum(['a', 'b', 'c']); expect(myEnum).to.have.ownProperty('a'); expect(myEnum).to.have.ownProperty('b') expect(myEnum).to.have.ownProperty('c'); expect(myEnum.__lookup(myEnum.a)).to.equal('a'); expect(myEnum.__lookup(myEnum.b)).to.equal('b'); expect(myEnum.__lookup(myEnum.c)).to.equal('c'); }); it('should not be writable', function () { var myEnum = Enum(['a']); var prevValue = myEnum.a; myEnum.a = -1; expect(myEnum.a).to.equal(prevValue); var prevLookupFunction = myEnum.__lookup; myEnum.__lookup = 100; expect(myEnum.__lookup).to.equal(prevLookupFunction); }); });
var Enum = require('../../core/Enum'); describe('Enum', function () { it('should create an enum and provide a lookup function', function () { var myEnum = Enum(['a', 'b', 'c']); - console.log(myEnum); + expect(myEnum).to.have.ownProperty('a'); expect(myEnum).to.have.ownProperty('b') expect(myEnum).to.have.ownProperty('c'); expect(myEnum.__lookup(myEnum.a)).to.equal('a'); expect(myEnum.__lookup(myEnum.b)).to.equal('b'); expect(myEnum.__lookup(myEnum.c)).to.equal('c'); }); it('should not be writable', function () { var myEnum = Enum(['a']); var prevValue = myEnum.a; myEnum.a = -1; expect(myEnum.a).to.equal(prevValue); var prevLookupFunction = myEnum.__lookup; myEnum.__lookup = 100; expect(myEnum.__lookup).to.equal(prevLookupFunction); }); });
2
0.074074
1
1
3b30dcc70cca6430594bdb3e35299252866b8577
array/move_zeros_to_end.py
array/move_zeros_to_end.py
def move_zeros(array): if len(array) < 1: return array else: list = [] zeros = 0 for i in array: if not i and type(i) is int or type(i) is float: zeros += 1 else: list.append(i) for i in range(0, zeros): list.append(0) return list
def move_zeros(array): result = [] zeros = 0 for i in array: if not i and type(i) is int or type(i) is float: zeros += 1 else: result.append(i) for i in range(0, zeros): result.append(0) return result
Change the variable name for clarity
Change the variable name for clarity
Python
mit
keon/algorithms,amaozhao/algorithms
python
## Code Before: def move_zeros(array): if len(array) < 1: return array else: list = [] zeros = 0 for i in array: if not i and type(i) is int or type(i) is float: zeros += 1 else: list.append(i) for i in range(0, zeros): list.append(0) return list ## Instruction: Change the variable name for clarity ## Code After: def move_zeros(array): result = [] zeros = 0 for i in array: if not i and type(i) is int or type(i) is float: zeros += 1 else: result.append(i) for i in range(0, zeros): result.append(0) return result
def move_zeros(array): + result = [] - if len(array) < 1: - return array - else: - list = [] - zeros = 0 ? ---- + zeros = 0 - for i in array: ? ---- + for i in array: - if not i and type(i) is int or type(i) is float: ? ---- + if not i and type(i) is int or type(i) is float: - zeros += 1 ? ---- + zeros += 1 - else: ? ---- + else: - list.append(i) ? ^^^^ -- + result.append(i) ? ^^^^ - for i in range(0, zeros): ? ---- + for i in range(0, zeros): - list.append(0) ? ^^^^ -- + result.append(0) ? ^^^^ - return list + return result
23
1.277778
10
13
35e84799b1b062fd3f0d697828ea53d36b621841
tox.ini
tox.ini
[tox] envlist = clean, py27, py35, stats recreate = true [testenv] passenv = LANG commands= coverage run -a setup.py test deps= setuptools coverage mock [testenv:py27] deps= setuptools coverage mock [testenv:py35] install_command= python3.5 -m pip install {opts} {packages} [testenv:clean] commands= coverage erase [testenv:stats] commands= coverage report --include=rwslib/* --omit=*test* coverage html
[tox] envlist = clean, py27, py35, py36, stats recreate = true [testenv] passenv = LANG commands= coverage run -a setup.py test deps= setuptools coverage mock [testenv:clean] commands= coverage erase [testenv:stats] commands= coverage report --include=rwslib/* --omit=*test* coverage html
Add python3.6 to test suite
Add python3.6 to test suite
INI
mit
mdsol/rwslib
ini
## Code Before: [tox] envlist = clean, py27, py35, stats recreate = true [testenv] passenv = LANG commands= coverage run -a setup.py test deps= setuptools coverage mock [testenv:py27] deps= setuptools coverage mock [testenv:py35] install_command= python3.5 -m pip install {opts} {packages} [testenv:clean] commands= coverage erase [testenv:stats] commands= coverage report --include=rwslib/* --omit=*test* coverage html ## Instruction: Add python3.6 to test suite ## Code After: [tox] envlist = clean, py27, py35, py36, stats recreate = true [testenv] passenv = LANG commands= coverage run -a setup.py test deps= setuptools coverage mock [testenv:clean] commands= coverage erase [testenv:stats] commands= coverage report --include=rwslib/* --omit=*test* coverage html
[tox] - envlist = clean, py27, py35, stats + envlist = clean, py27, py35, py36, stats ? ++++++ recreate = true [testenv] passenv = LANG commands= coverage run -a setup.py test deps= setuptools coverage mock - [testenv:py27] - deps= - setuptools - coverage - mock - - [testenv:py35] - install_command= - python3.5 -m pip install {opts} {packages} - [testenv:clean] commands= coverage erase [testenv:stats] commands= coverage report --include=rwslib/* --omit=*test* coverage html
12
0.352941
1
11
0d189ae47742b9eff266d423d65a0b07f7a5548a
theme/base-2016/partials/_footer.twig
theme/base-2016/partials/_footer.twig
<!-- Footer --> <footer class="row"> <hr /> <div class="large-6 columns"> <p>{{ __("This website is <a href='%url%' target='_blank' title='Sophisticated, lightweight & simple CMS'>Built with Bolt</a>.",{'%url%':'http://bolt.cm'}) }} </p> </div> <div class="large-6 columns"> {{ menu( identifier = 'main', template = 'partials/_sub_menu.twig', params = {'withsubmenus': false, 'class': 'inline-list align-right'} ) }} </div> {{ widgets('footer') }} </footer> {# Extensions and copypasta gleaned from other sources tend to cause multiple jQuery includes. We only include it here conditionally, if not done so already. #} <script>window.jQuery || document.write("<script src='{{ asset('js/jquery.min.js', 'theme') }}'><\/script>");</script> <script src="{{ asset('js/foundation.js', 'theme') }}"></script> <script src="{{ asset('js/app.js', 'theme') }}"></script>
<!-- Footer --> <footer class="row"> <hr /> <div class="large-6 columns"> <p>{{ __("This website is <a href='%url%' target='_blank' title='Sophisticated, lightweight & simple CMS'>Built with Bolt</a>.",{'%url%':'http://bolt.cm'}) }} </p> </div> <div class="large-6 columns"> {{ menu( identifier = 'main', template = 'partials/_sub_menu.twig', params = {'withsubmenus': false, 'class': 'inline-list align-right'} ) }} </div> {{ widgets('footer') }} </footer> <script src="{{ asset('js/jquery.min.js', 'theme') }}"></script> <script src="{{ asset('js/foundation.js', 'theme') }}"></script> <script src="{{ asset('js/app.js', 'theme') }}"></script>
Revert conditional loading of jQuery.
Revert conditional loading of jQuery.
Twig
mit
romulo1984/bolt,Intendit/bolt,electrolinux/bolt,GawainLynch/bolt,bolt/bolt,bolt/bolt,bolt/bolt,nikgo/bolt,Intendit/bolt,romulo1984/bolt,romulo1984/bolt,bolt/bolt,lenvanessen/bolt,electrolinux/bolt,lenvanessen/bolt,lenvanessen/bolt,nikgo/bolt,lenvanessen/bolt,GawainLynch/bolt,GawainLynch/bolt,GawainLynch/bolt,nikgo/bolt,Intendit/bolt,romulo1984/bolt,electrolinux/bolt,nikgo/bolt,electrolinux/bolt,Intendit/bolt
twig
## Code Before: <!-- Footer --> <footer class="row"> <hr /> <div class="large-6 columns"> <p>{{ __("This website is <a href='%url%' target='_blank' title='Sophisticated, lightweight & simple CMS'>Built with Bolt</a>.",{'%url%':'http://bolt.cm'}) }} </p> </div> <div class="large-6 columns"> {{ menu( identifier = 'main', template = 'partials/_sub_menu.twig', params = {'withsubmenus': false, 'class': 'inline-list align-right'} ) }} </div> {{ widgets('footer') }} </footer> {# Extensions and copypasta gleaned from other sources tend to cause multiple jQuery includes. We only include it here conditionally, if not done so already. #} <script>window.jQuery || document.write("<script src='{{ asset('js/jquery.min.js', 'theme') }}'><\/script>");</script> <script src="{{ asset('js/foundation.js', 'theme') }}"></script> <script src="{{ asset('js/app.js', 'theme') }}"></script> ## Instruction: Revert conditional loading of jQuery. ## Code After: <!-- Footer --> <footer class="row"> <hr /> <div class="large-6 columns"> <p>{{ __("This website is <a href='%url%' target='_blank' title='Sophisticated, lightweight & simple CMS'>Built with Bolt</a>.",{'%url%':'http://bolt.cm'}) }} </p> </div> <div class="large-6 columns"> {{ menu( identifier = 'main', template = 'partials/_sub_menu.twig', params = {'withsubmenus': false, 'class': 'inline-list align-right'} ) }} </div> {{ widgets('footer') }} </footer> <script src="{{ asset('js/jquery.min.js', 'theme') }}"></script> <script src="{{ asset('js/foundation.js', 'theme') }}"></script> <script src="{{ asset('js/app.js', 'theme') }}"></script>
<!-- Footer --> <footer class="row"> <hr /> <div class="large-6 columns"> <p>{{ __("This website is <a href='%url%' target='_blank' title='Sophisticated, lightweight & simple CMS'>Built with Bolt</a>.",{'%url%':'http://bolt.cm'}) }} </p> </div> <div class="large-6 columns"> {{ menu( identifier = 'main', template = 'partials/_sub_menu.twig', params = {'withsubmenus': false, 'class': 'inline-list align-right'} ) }} </div> {{ widgets('footer') }} </footer> + <script src="{{ asset('js/jquery.min.js', 'theme') }}"></script> - {# Extensions and copypasta gleaned from other sources tend to cause multiple jQuery - includes. We only include it here conditionally, if not done so already. #} - <script>window.jQuery || document.write("<script src='{{ asset('js/jquery.min.js', 'theme') }}'><\/script>");</script> <script src="{{ asset('js/foundation.js', 'theme') }}"></script> <script src="{{ asset('js/app.js', 'theme') }}"></script>
4
0.166667
1
3
153e6090d1bf63ca00f09708c4125a183c564017
jps-plugin/com/twitter/intellij/pants/jps/incremental/scala/PantsScalaChunkExclusionService.java
jps-plugin/com/twitter/intellij/pants/jps/incremental/scala/PantsScalaChunkExclusionService.java
// Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). // Licensed under the Apache License, Version 2.0 (see LICENSE). package com.twitter.intellij.pants.jps.incremental.scala; import com.twitter.intellij.pants.jps.incremental.model.JpsPantsProjectExtension; import com.twitter.intellij.pants.jps.incremental.serialization.PantsJpsProjectExtensionSerializer; import com.twitter.intellij.pants.jps.util.PantsJpsUtil; import org.jetbrains.jps.ModuleChunk; import org.jetbrains.jps.incremental.scala.ChunkExclusionService; import org.jetbrains.jps.model.module.JpsModule; import java.util.Set; public class PantsScalaChunkExclusionService extends ChunkExclusionService { @Override public boolean isExcluded(ModuleChunk chunk) { final Set<JpsModule> modules = chunk.getModules(); if (modules.isEmpty()) { return false; } final JpsPantsProjectExtension pantsProjectExtension = PantsJpsProjectExtensionSerializer.findPantsProjectExtension(modules.iterator().next().getProject()); if (pantsProjectExtension == null) { return false; } return PantsJpsUtil.containsPantsModules(modules); } }
// Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). // Licensed under the Apache License, Version 2.0 (see LICENSE). package com.twitter.intellij.pants.jps.incremental.scala; import org.jetbrains.jps.ModuleChunk; import org.jetbrains.jps.incremental.scala.ChunkExclusionService; public class PantsScalaChunkExclusionService extends ChunkExclusionService { @Override public boolean isExcluded(ModuleChunk chunk) { // All compilations are handled by Pants, thus excluded from scala plugin. return true; } }
Exclude all from scala plugin compilation
Exclude all from scala plugin compilation Some user hit the issue that after pants finishes, scala plugin compiler builder also started to build and cause error. Since all comiplation can/should be handled by pants, we should completely block scala plugin from compiling our code. Testing Done: https://travis-ci.org/wisechengyi/intellij-pants-plugin/builds/110483748 Reviewed at https://rbcommons.com/s/twitter/r/3483/
Java
apache-2.0
wisechengyi/intellij-pants-plugin,wisechengyi/intellij-pants-plugin,pantsbuild/intellij-pants-plugin,pantsbuild/intellij-pants-plugin,pantsbuild/intellij-pants-plugin,pantsbuild/intellij-pants-plugin,wisechengyi/intellij-pants-plugin,pantsbuild/intellij-pants-plugin,wisechengyi/intellij-pants-plugin
java
## Code Before: // Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). // Licensed under the Apache License, Version 2.0 (see LICENSE). package com.twitter.intellij.pants.jps.incremental.scala; import com.twitter.intellij.pants.jps.incremental.model.JpsPantsProjectExtension; import com.twitter.intellij.pants.jps.incremental.serialization.PantsJpsProjectExtensionSerializer; import com.twitter.intellij.pants.jps.util.PantsJpsUtil; import org.jetbrains.jps.ModuleChunk; import org.jetbrains.jps.incremental.scala.ChunkExclusionService; import org.jetbrains.jps.model.module.JpsModule; import java.util.Set; public class PantsScalaChunkExclusionService extends ChunkExclusionService { @Override public boolean isExcluded(ModuleChunk chunk) { final Set<JpsModule> modules = chunk.getModules(); if (modules.isEmpty()) { return false; } final JpsPantsProjectExtension pantsProjectExtension = PantsJpsProjectExtensionSerializer.findPantsProjectExtension(modules.iterator().next().getProject()); if (pantsProjectExtension == null) { return false; } return PantsJpsUtil.containsPantsModules(modules); } } ## Instruction: Exclude all from scala plugin compilation Some user hit the issue that after pants finishes, scala plugin compiler builder also started to build and cause error. Since all comiplation can/should be handled by pants, we should completely block scala plugin from compiling our code. Testing Done: https://travis-ci.org/wisechengyi/intellij-pants-plugin/builds/110483748 Reviewed at https://rbcommons.com/s/twitter/r/3483/ ## Code After: // Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). // Licensed under the Apache License, Version 2.0 (see LICENSE). package com.twitter.intellij.pants.jps.incremental.scala; import org.jetbrains.jps.ModuleChunk; import org.jetbrains.jps.incremental.scala.ChunkExclusionService; public class PantsScalaChunkExclusionService extends ChunkExclusionService { @Override public boolean isExcluded(ModuleChunk chunk) { // All compilations are handled by Pants, thus excluded from scala plugin. return true; } }
// Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). // Licensed under the Apache License, Version 2.0 (see LICENSE). package com.twitter.intellij.pants.jps.incremental.scala; - import com.twitter.intellij.pants.jps.incremental.model.JpsPantsProjectExtension; - import com.twitter.intellij.pants.jps.incremental.serialization.PantsJpsProjectExtensionSerializer; - import com.twitter.intellij.pants.jps.util.PantsJpsUtil; import org.jetbrains.jps.ModuleChunk; import org.jetbrains.jps.incremental.scala.ChunkExclusionService; - import org.jetbrains.jps.model.module.JpsModule; - - import java.util.Set; public class PantsScalaChunkExclusionService extends ChunkExclusionService { @Override public boolean isExcluded(ModuleChunk chunk) { + // All compilations are handled by Pants, thus excluded from scala plugin. + return true; - final Set<JpsModule> modules = chunk.getModules(); - if (modules.isEmpty()) { - return false; - } - - final JpsPantsProjectExtension pantsProjectExtension = - PantsJpsProjectExtensionSerializer.findPantsProjectExtension(modules.iterator().next().getProject()); - if (pantsProjectExtension == null) { - return false; - } - return PantsJpsUtil.containsPantsModules(modules); } }
19
0.633333
2
17
a3c7c11453a58625e8d3a46f4a5d96f6caf2aad4
spec/acceptance/puppetserver_spec.rb
spec/acceptance/puppetserver_spec.rb
require 'spec_helper_acceptance' describe 'puppetserver' do context 'with defaults' do it 'should idempotently run' do pp = <<-EOS class { 'puppetserver': } EOS apply_manifest(pp, :catch_failures => true) apply_manifest(pp, :catch_changes => true) end describe package('puppetserver') do it { should be_installed } end describe service('puppetserver') do it { should be_enabled } it { should be_running } end describe port(8140) do it { should be_listening } end end context 'when overriding ssl-port' do it 'should idempotently run' do pp = <<-EOS class { 'puppetserver': config => { 'webserver' => { 'ssl-port' => '18140', }, }, } EOS apply_manifest(pp, :catch_failures => true) apply_manifest(pp, :catch_changes => true) end describe package('puppetserver') do it { should be_installed } end describe service('puppetserver') do it { should be_enabled } it { should be_running } end describe port(18140) do it { should be_listening } end describe port(8140) do it { should_not be_listening } end end end
require 'spec_helper_acceptance' describe 'puppetserver' do context 'with defaults' do it 'should idempotently run' do pp = <<-EOS class { 'puppetserver': } EOS apply_manifest(pp, :catch_failures => true) apply_manifest(pp, :catch_changes => true) end describe package('puppetserver') do it { should be_installed } end describe service('puppetserver') do it do pending 'Fails on Debian8 (packaging issue?)' if fact('operatingsystem') == 'Debian' should be_enabled end it { should be_running } end describe port(8140) do it { should be_listening } end end context 'when overriding ssl-port' do it 'should idempotently run' do pp = <<-EOS class { 'puppetserver': config => { 'webserver' => { 'ssl-port' => '18140', }, }, } EOS apply_manifest(pp, :catch_failures => true) apply_manifest(pp, :catch_changes => true) end describe package('puppetserver') do it { should be_installed } end describe service('puppetserver') do it { should be_enabled } it { should be_running } end describe port(18140) do it { should be_listening } end describe port(8140) do it { should_not be_listening } end end end
Mark acceptance test as pending
Mark acceptance test as pending
Ruby
apache-2.0
olivierHa/puppet-puppetserver,roman-mueller/puppet-puppetserver,camptocamp/puppet-puppetserver,olivierHa/puppet-puppetserver,roman-mueller/puppet-puppetserver,camptocamp/puppet-puppetserver
ruby
## Code Before: require 'spec_helper_acceptance' describe 'puppetserver' do context 'with defaults' do it 'should idempotently run' do pp = <<-EOS class { 'puppetserver': } EOS apply_manifest(pp, :catch_failures => true) apply_manifest(pp, :catch_changes => true) end describe package('puppetserver') do it { should be_installed } end describe service('puppetserver') do it { should be_enabled } it { should be_running } end describe port(8140) do it { should be_listening } end end context 'when overriding ssl-port' do it 'should idempotently run' do pp = <<-EOS class { 'puppetserver': config => { 'webserver' => { 'ssl-port' => '18140', }, }, } EOS apply_manifest(pp, :catch_failures => true) apply_manifest(pp, :catch_changes => true) end describe package('puppetserver') do it { should be_installed } end describe service('puppetserver') do it { should be_enabled } it { should be_running } end describe port(18140) do it { should be_listening } end describe port(8140) do it { should_not be_listening } end end end ## Instruction: Mark acceptance test as pending ## Code After: require 'spec_helper_acceptance' describe 'puppetserver' do context 'with defaults' do it 'should idempotently run' do pp = <<-EOS class { 'puppetserver': } EOS apply_manifest(pp, :catch_failures => true) apply_manifest(pp, :catch_changes => true) end describe package('puppetserver') do it { should be_installed } end describe service('puppetserver') do it do pending 'Fails on Debian8 (packaging issue?)' if fact('operatingsystem') == 'Debian' should be_enabled end it { should be_running } end describe port(8140) do it { should be_listening } end end context 'when overriding ssl-port' do it 'should idempotently run' do pp = <<-EOS class { 'puppetserver': config => { 'webserver' => { 'ssl-port' => '18140', }, }, } EOS apply_manifest(pp, :catch_failures => true) apply_manifest(pp, :catch_changes => true) end describe package('puppetserver') do it { should be_installed } end describe service('puppetserver') do it { should be_enabled } it { should be_running } end describe port(18140) do it { should be_listening } end describe port(8140) do it { should_not be_listening } end end end
require 'spec_helper_acceptance' describe 'puppetserver' do context 'with defaults' do it 'should idempotently run' do pp = <<-EOS class { 'puppetserver': } EOS apply_manifest(pp, :catch_failures => true) apply_manifest(pp, :catch_changes => true) end describe package('puppetserver') do it { should be_installed } end describe service('puppetserver') do + it do + pending 'Fails on Debian8 (packaging issue?)' if fact('operatingsystem') == 'Debian' - it { should be_enabled } ? -- - -- + should be_enabled + end it { should be_running } end describe port(8140) do it { should be_listening } end end context 'when overriding ssl-port' do it 'should idempotently run' do pp = <<-EOS class { 'puppetserver': config => { 'webserver' => { 'ssl-port' => '18140', }, }, } EOS apply_manifest(pp, :catch_failures => true) apply_manifest(pp, :catch_changes => true) end describe package('puppetserver') do it { should be_installed } end describe service('puppetserver') do it { should be_enabled } it { should be_running } end describe port(18140) do it { should be_listening } end describe port(8140) do it { should_not be_listening } end end end
5
0.080645
4
1
4ffae0916ccace624a70be908484c1e550f82b47
travis_scripts/install_miniconda.sh
travis_scripts/install_miniconda.sh
TRAVIS_PYTHON_VERSION=$1 WITH_NETCDF=$2 if test ! -e /home/travis/miniconda; then wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh chmod +x miniconda.sh ./miniconda.sh -b export PATH=/home/travis/miniconda/bin:$PATH conda update --yes conda if test WITH_NETCDF = "yes"; then conda install --yes python=$TRAVIS_PYTHON_VERSION libnetcdf hdf5 h5py netCDF4 scipy matplotlib astropy else conda install --yes python=$TRAVIS_PYTHON_VERSION scipy matplotlib astropy fi fi
TRAVIS_PYTHON_VERSION=$1 WITH_NETCDF=$2 if test ! -e /home/travis/miniconda; then wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh chmod +x miniconda.sh ./miniconda.sh -b export PATH=/home/travis/miniconda/bin:$PATH conda update --yes conda if test WITH_NETCDF = "yes"; then conda install --yes python=$TRAVIS_PYTHON_VERSION libnetcdf hdf5 h5py netCDF4 scipy matplotlib astropy numpy else conda install --yes python=$TRAVIS_PYTHON_VERSION scipy matplotlib astropy numpy fi fi
Add numpy to conda install
Add numpy to conda install
Shell
bsd-3-clause
matteobachetti/MaLTPyNT
shell
## Code Before: TRAVIS_PYTHON_VERSION=$1 WITH_NETCDF=$2 if test ! -e /home/travis/miniconda; then wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh chmod +x miniconda.sh ./miniconda.sh -b export PATH=/home/travis/miniconda/bin:$PATH conda update --yes conda if test WITH_NETCDF = "yes"; then conda install --yes python=$TRAVIS_PYTHON_VERSION libnetcdf hdf5 h5py netCDF4 scipy matplotlib astropy else conda install --yes python=$TRAVIS_PYTHON_VERSION scipy matplotlib astropy fi fi ## Instruction: Add numpy to conda install ## Code After: TRAVIS_PYTHON_VERSION=$1 WITH_NETCDF=$2 if test ! -e /home/travis/miniconda; then wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh chmod +x miniconda.sh ./miniconda.sh -b export PATH=/home/travis/miniconda/bin:$PATH conda update --yes conda if test WITH_NETCDF = "yes"; then conda install --yes python=$TRAVIS_PYTHON_VERSION libnetcdf hdf5 h5py netCDF4 scipy matplotlib astropy numpy else conda install --yes python=$TRAVIS_PYTHON_VERSION scipy matplotlib astropy numpy fi fi
TRAVIS_PYTHON_VERSION=$1 WITH_NETCDF=$2 if test ! -e /home/travis/miniconda; then wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh chmod +x miniconda.sh ./miniconda.sh -b export PATH=/home/travis/miniconda/bin:$PATH conda update --yes conda if test WITH_NETCDF = "yes"; then - conda install --yes python=$TRAVIS_PYTHON_VERSION libnetcdf hdf5 h5py netCDF4 scipy matplotlib astropy + conda install --yes python=$TRAVIS_PYTHON_VERSION libnetcdf hdf5 h5py netCDF4 scipy matplotlib astropy numpy ? ++++++ else - conda install --yes python=$TRAVIS_PYTHON_VERSION scipy matplotlib astropy + conda install --yes python=$TRAVIS_PYTHON_VERSION scipy matplotlib astropy numpy ? ++++++ fi fi
4
0.266667
2
2
2c39fd0fc4e9a245bb3984bcfd38f333c6eaafc0
flag.go
flag.go
package main import ( "flag" "log" "strconv" "git.astuart.co/andrew/limio" ) var t = flag.String("t", "search", "the type of search to perform") var rl = flag.String("r", "", "the rate limit") var nc = flag.Bool("nocache", false, "skip cache") var clr = flag.Bool("clear", false, "clear cache") var downRate int func init() { flag.Parse() orig := *rl if len(*rl) > 0 { rl := []byte(*rl) unit := rl[len(rl)-1] rl = rl[:len(rl)-1] qty, err := strconv.Atoi(string(rl)) if err != nil { log.Printf("Bad quantity: %s\n", orig) } switch unit { case 'm': downRate = qty * limio.MB case 'k': downRate = qty * limio.KB } } }
package main import ( "flag" "log" "os" "strconv" "git.astuart.co/andrew/limio" ) var t = flag.String("t", "movie", "the type of search to perform") var rl = flag.String("r", "", "the rate limit") var nc = flag.Bool("nocache", false, "skip cache") var clr = flag.Bool("clear", false, "clear cache") var downRate int func init() { flag.Parse() if *t == "tv" { *t = "tvsearch" } if *rl == "" { *rl = os.Getenv("SAB_RATE") } orig := *rl if len(*rl) > 0 { rl := []byte(*rl) unit := rl[len(rl)-1] rl = rl[:len(rl)-1] qty, err := strconv.ParseFloat(string(rl), 64) if err != nil { log.Printf("Bad quantity: %s\n", orig) } switch unit { case 'm': downRate = int(qty * float64(limio.MB)) case 'k': downRate = int(qty * float64(limio.KB)) } } }
Allow shortening of "tvsearch" to "tv", "SAB_RATE" env, decimal rate arg
Allow shortening of "tvsearch" to "tv", "SAB_RATE" env, decimal rate arg
Go
mit
andrewstuart/dlite
go
## Code Before: package main import ( "flag" "log" "strconv" "git.astuart.co/andrew/limio" ) var t = flag.String("t", "search", "the type of search to perform") var rl = flag.String("r", "", "the rate limit") var nc = flag.Bool("nocache", false, "skip cache") var clr = flag.Bool("clear", false, "clear cache") var downRate int func init() { flag.Parse() orig := *rl if len(*rl) > 0 { rl := []byte(*rl) unit := rl[len(rl)-1] rl = rl[:len(rl)-1] qty, err := strconv.Atoi(string(rl)) if err != nil { log.Printf("Bad quantity: %s\n", orig) } switch unit { case 'm': downRate = qty * limio.MB case 'k': downRate = qty * limio.KB } } } ## Instruction: Allow shortening of "tvsearch" to "tv", "SAB_RATE" env, decimal rate arg ## Code After: package main import ( "flag" "log" "os" "strconv" "git.astuart.co/andrew/limio" ) var t = flag.String("t", "movie", "the type of search to perform") var rl = flag.String("r", "", "the rate limit") var nc = flag.Bool("nocache", false, "skip cache") var clr = flag.Bool("clear", false, "clear cache") var downRate int func init() { flag.Parse() if *t == "tv" { *t = "tvsearch" } if *rl == "" { *rl = os.Getenv("SAB_RATE") } orig := *rl if len(*rl) > 0 { rl := []byte(*rl) unit := rl[len(rl)-1] rl = rl[:len(rl)-1] qty, err := strconv.ParseFloat(string(rl), 64) if err != nil { log.Printf("Bad quantity: %s\n", orig) } switch unit { case 'm': downRate = int(qty * float64(limio.MB)) case 'k': downRate = int(qty * float64(limio.KB)) } } }
package main import ( "flag" "log" + "os" "strconv" "git.astuart.co/andrew/limio" ) - var t = flag.String("t", "search", "the type of search to perform") ? ^ ---- + var t = flag.String("t", "movie", "the type of search to perform") ? ^^^^ var rl = flag.String("r", "", "the rate limit") var nc = flag.Bool("nocache", false, "skip cache") var clr = flag.Bool("clear", false, "clear cache") var downRate int func init() { flag.Parse() + if *t == "tv" { + *t = "tvsearch" + } + + if *rl == "" { + *rl = os.Getenv("SAB_RATE") + } + orig := *rl if len(*rl) > 0 { rl := []byte(*rl) unit := rl[len(rl)-1] rl = rl[:len(rl)-1] + - qty, err := strconv.Atoi(string(rl)) ? ^ -- + qty, err := strconv.ParseFloat(string(rl), 64) ? ^^^^^^^^^ ++++ if err != nil { log.Printf("Bad quantity: %s\n", orig) } switch unit { case 'm': - downRate = qty * limio.MB + downRate = int(qty * float64(limio.MB)) ? ++++ ++++++++ ++ case 'k': - downRate = qty * limio.KB + downRate = int(qty * float64(limio.KB)) ? ++++ ++++++++ ++ } } }
18
0.461538
14
4
c132b914a87cd353a8022dec54fb468d6a9ee898
lib/thingfish/processor/sha256.rb
lib/thingfish/processor/sha256.rb
require 'digest/sha2' require 'thingfish' unless defined?( Thingfish ) require 'thingfish/processor' unless defined?( Thingfish::Processor ) # Calculate and store a sha256 checksum for a resource. class Thingfish::Processor::SHA256 < Thingfish::Processor extend Loggability # Loggability API -- log to the :thingfish logger log_to :thingfish # The list of handled types handled_types '*/*' ### Synchronous processor API -- generate a checksum during upload. def on_request( request ) digest = Digest::SHA256.file( request.body.path ).hexdigest request.add_metadata( :checksum => digest ) end end # class Thingfish::Processor::SHA256
require 'digest/sha2' require 'thingfish' unless defined?( Thingfish ) require 'thingfish/processor' unless defined?( Thingfish::Processor ) # Calculate and store a sha256 checksum for a resource. class Thingfish::Processor::SHA256 < Thingfish::Processor extend Loggability # The chunk size to read CHUNK_SIZE = 32 * 1024 # Loggability API -- log to the :thingfish logger log_to :thingfish # The list of handled types handled_types '*/*' ### Synchronous processor API -- generate a checksum during upload. def on_request( request ) digest = Digest::SHA256.new buf = '' while request.body.read( CHUNK_SIZE, buf ) digest.update( buf ) end request.body.rewind request.add_metadata( :checksum => digest.hexdigest ) end end # class Thingfish::Processor::SHA256
Fix the checksum processor for IOs without a path.
Fix the checksum processor for IOs without a path.
Ruby
bsd-3-clause
ged/thingfish,ged/thingfish,ged/thingfish
ruby
## Code Before: require 'digest/sha2' require 'thingfish' unless defined?( Thingfish ) require 'thingfish/processor' unless defined?( Thingfish::Processor ) # Calculate and store a sha256 checksum for a resource. class Thingfish::Processor::SHA256 < Thingfish::Processor extend Loggability # Loggability API -- log to the :thingfish logger log_to :thingfish # The list of handled types handled_types '*/*' ### Synchronous processor API -- generate a checksum during upload. def on_request( request ) digest = Digest::SHA256.file( request.body.path ).hexdigest request.add_metadata( :checksum => digest ) end end # class Thingfish::Processor::SHA256 ## Instruction: Fix the checksum processor for IOs without a path. ## Code After: require 'digest/sha2' require 'thingfish' unless defined?( Thingfish ) require 'thingfish/processor' unless defined?( Thingfish::Processor ) # Calculate and store a sha256 checksum for a resource. class Thingfish::Processor::SHA256 < Thingfish::Processor extend Loggability # The chunk size to read CHUNK_SIZE = 32 * 1024 # Loggability API -- log to the :thingfish logger log_to :thingfish # The list of handled types handled_types '*/*' ### Synchronous processor API -- generate a checksum during upload. def on_request( request ) digest = Digest::SHA256.new buf = '' while request.body.read( CHUNK_SIZE, buf ) digest.update( buf ) end request.body.rewind request.add_metadata( :checksum => digest.hexdigest ) end end # class Thingfish::Processor::SHA256
require 'digest/sha2' require 'thingfish' unless defined?( Thingfish ) require 'thingfish/processor' unless defined?( Thingfish::Processor ) # Calculate and store a sha256 checksum for a resource. class Thingfish::Processor::SHA256 < Thingfish::Processor extend Loggability + # The chunk size to read + CHUNK_SIZE = 32 * 1024 + # Loggability API -- log to the :thingfish logger log_to :thingfish # The list of handled types handled_types '*/*' ### Synchronous processor API -- generate a checksum during upload. def on_request( request ) - digest = Digest::SHA256.file( request.body.path ).hexdigest + digest = Digest::SHA256.new + buf = '' + + while request.body.read( CHUNK_SIZE, buf ) + digest.update( buf ) + end + + request.body.rewind - request.add_metadata( :checksum => digest ) + request.add_metadata( :checksum => digest.hexdigest ) ? ++++++++++ end end # class Thingfish::Processor::SHA256
14
0.538462
12
2
f15ca028596a9226fcff636138533a1a39f39ce5
Resources/doc/cookbook/suppress-server-errors.md
Resources/doc/cookbook/suppress-server-errors.md
Suppressing Server Errors ======================== By default, exceptions from the Elastica client library will propagate through the bundle's Client class. For instance, if the Elasticsearch server is offline, issuing a request will result in an `Elastica\Exception\Connection` being thrown. Depending on your needs, it may be desirable to suppress these exceptions and allow searches to fail silently. One way to achieve this is to override the `fos_elastica.client.class` service container parameter with a custom class. In the following example, we override the `Client::request()` method and return the equivalent of an empty search response if an exception occurred. ``` <?php namespace Acme\ElasticaBundle; use FOS\ElasticaBundle\Client as BaseClient; use Elastica\Exception\ExceptionInterface; use Elastica\Response; class Client extends BaseClient { public function request($path, $method, $data = array()) { try { return parent::request($path, $method, $data); } catch (ExceptionInterface $e) { return new Response('{"took":0,"timed_out":false,"hits":{"total":0,"max_score":0,"hits":[]}}'); } } } ```
Suppressing Server Errors ========================= By default, exceptions from the Elastica client library will propagate through the bundle's Client class. For instance, if the Elasticsearch server is offline, issuing a request will result in an `Elastica\Exception\Connection` being thrown. Depending on your needs, it may be desirable to suppress these exceptions and allow searches to fail silently. One way to achieve this is to override the `fos_elastica.client.class` service container parameter with a custom class. In the following example, we override the `Client::request()` method and return the equivalent of an empty search response if an exception occurred. Sample client code: ------------------- ```php <?php namespace Acme\ElasticaBundle; use Elastica\Exception\ExceptionInterface; use Elastica\Request; use Elastica\Response; use FOS\ElasticaBundle\Client as BaseClient; class Client extends BaseClient { public function request($path, $method = Request::GET, $data = array(), array $query = array()) { try { return parent::request($path, $method, $data, $query); } catch (ExceptionInterface $e) { return new Response('{"took":0,"timed_out":false,"hits":{"total":0,"max_score":0,"hits":[]}}'); } } } ``` Configuration change: --------------------- ```xml <?xml version="1.0"?> <container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> <parameters> <parameter key="fos_elastica.client.class">Acme\ElasticaBundle\Client</parameter> </parameters> </container>
Fix documentation for client overwriting.
Fix documentation for client overwriting.
Markdown
mit
ramuss/FazlandElasticaBundle,ramuss/FazlandElasticaBundle,fazland/FazlandElasticaBundle,alekitto/FazlandElasticaBundle,fazland/FazlandElasticaBundle,alekitto/FazlandElasticaBundle
markdown
## Code Before: Suppressing Server Errors ======================== By default, exceptions from the Elastica client library will propagate through the bundle's Client class. For instance, if the Elasticsearch server is offline, issuing a request will result in an `Elastica\Exception\Connection` being thrown. Depending on your needs, it may be desirable to suppress these exceptions and allow searches to fail silently. One way to achieve this is to override the `fos_elastica.client.class` service container parameter with a custom class. In the following example, we override the `Client::request()` method and return the equivalent of an empty search response if an exception occurred. ``` <?php namespace Acme\ElasticaBundle; use FOS\ElasticaBundle\Client as BaseClient; use Elastica\Exception\ExceptionInterface; use Elastica\Response; class Client extends BaseClient { public function request($path, $method, $data = array()) { try { return parent::request($path, $method, $data); } catch (ExceptionInterface $e) { return new Response('{"took":0,"timed_out":false,"hits":{"total":0,"max_score":0,"hits":[]}}'); } } } ``` ## Instruction: Fix documentation for client overwriting. ## Code After: Suppressing Server Errors ========================= By default, exceptions from the Elastica client library will propagate through the bundle's Client class. For instance, if the Elasticsearch server is offline, issuing a request will result in an `Elastica\Exception\Connection` being thrown. Depending on your needs, it may be desirable to suppress these exceptions and allow searches to fail silently. One way to achieve this is to override the `fos_elastica.client.class` service container parameter with a custom class. In the following example, we override the `Client::request()` method and return the equivalent of an empty search response if an exception occurred. Sample client code: ------------------- ```php <?php namespace Acme\ElasticaBundle; use Elastica\Exception\ExceptionInterface; use Elastica\Request; use Elastica\Response; use FOS\ElasticaBundle\Client as BaseClient; class Client extends BaseClient { public function request($path, $method = Request::GET, $data = array(), array $query = array()) { try { return parent::request($path, $method, $data, $query); } catch (ExceptionInterface $e) { return new Response('{"took":0,"timed_out":false,"hits":{"total":0,"max_score":0,"hits":[]}}'); } } } ``` Configuration change: --------------------- ```xml <?xml version="1.0"?> <container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> <parameters> <parameter key="fos_elastica.client.class">Acme\ElasticaBundle\Client</parameter> </parameters> </container>
Suppressing Server Errors - ======================== + ========================= ? + By default, exceptions from the Elastica client library will propagate through the bundle's Client class. For instance, if the Elasticsearch server is offline, issuing a request will result in an `Elastica\Exception\Connection` being thrown. Depending on your needs, it may be desirable to suppress these exceptions and allow searches to fail silently. One way to achieve this is to override the `fos_elastica.client.class` service container parameter with a custom class. In the following example, we override the `Client::request()` method and return the equivalent of an empty search response if an exception occurred. - ``` + Sample client code: + ------------------- + + ```php <?php namespace Acme\ElasticaBundle; + use Elastica\Exception\ExceptionInterface; + use Elastica\Request; + use Elastica\Response; use FOS\ElasticaBundle\Client as BaseClient; - - use Elastica\Exception\ExceptionInterface; - use Elastica\Response; class Client extends BaseClient { - public function request($path, $method, $data = array()) + public function request($path, $method = Request::GET, $data = array(), array $query = array()) ? +++++++++++++++ +++++++++++++++++++++++ + { try { - return parent::request($path, $method, $data); + return parent::request($path, $method, $data, $query); ? ++++++++ } catch (ExceptionInterface $e) { return new Response('{"took":0,"timed_out":false,"hits":{"total":0,"max_score":0,"hits":[]}}'); } } } ``` + + Configuration change: + --------------------- + + ```xml + <?xml version="1.0"?> + + <container xmlns="http://symfony.com/schema/dic/services" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> + + <parameters> + <parameter key="fos_elastica.client.class">Acme\ElasticaBundle\Client</parameter> + </parameters> + + </container>
33
0.916667
26
7
0d9a9149be3a7070c14555c6ff192372256907c9
app/controllers/v2/service_bindings_controller.rb
app/controllers/v2/service_bindings_controller.rb
class V2::ServiceBindingsController < V2::BaseController def update instance = ServiceInstance.find_by_guid(params.fetch(:service_instance_id)) binding = ServiceBinding.new(id: params.fetch(:id), service_instance: instance) binding.save render status: 201, json: binding end def destroy if binding = ServiceBinding.find_by_id(params.fetch(:id)) binding.destroy status = 200 else status = 410 end render status: status, json: {} end end
class V2::ServiceBindingsController < V2::BaseController def update instance = ServiceInstance.find_by_guid(params.fetch(:service_instance_id)) binding = ServiceBinding.new(id: params.fetch(:id), service_instance: instance) binding.save render status: 201, json: binding end def destroy binding = ServiceBinding.find_by_id(params.fetch(:id)) if binding binding.destroy status = 200 else status = 410 end render status: status, json: {} end end
Rewrite if statement for clarity
Rewrite if statement for clarity [#74272272]
Ruby
apache-2.0
SudarsananRengarajan/cf-mysql-broker,cloudfoundry/cf-mysql-broker,cloudfoundry/cf-mysql-broker,cloudfoundry/cf-mysql-broker,SudarsananRengarajan/cf-mysql-broker
ruby
## Code Before: class V2::ServiceBindingsController < V2::BaseController def update instance = ServiceInstance.find_by_guid(params.fetch(:service_instance_id)) binding = ServiceBinding.new(id: params.fetch(:id), service_instance: instance) binding.save render status: 201, json: binding end def destroy if binding = ServiceBinding.find_by_id(params.fetch(:id)) binding.destroy status = 200 else status = 410 end render status: status, json: {} end end ## Instruction: Rewrite if statement for clarity [#74272272] ## Code After: class V2::ServiceBindingsController < V2::BaseController def update instance = ServiceInstance.find_by_guid(params.fetch(:service_instance_id)) binding = ServiceBinding.new(id: params.fetch(:id), service_instance: instance) binding.save render status: 201, json: binding end def destroy binding = ServiceBinding.find_by_id(params.fetch(:id)) if binding binding.destroy status = 200 else status = 410 end render status: status, json: {} end end
class V2::ServiceBindingsController < V2::BaseController def update instance = ServiceInstance.find_by_guid(params.fetch(:service_instance_id)) binding = ServiceBinding.new(id: params.fetch(:id), service_instance: instance) binding.save render status: 201, json: binding end def destroy - if binding = ServiceBinding.find_by_id(params.fetch(:id)) ? --- + binding = ServiceBinding.find_by_id(params.fetch(:id)) + if binding binding.destroy status = 200 else status = 410 end render status: status, json: {} end end
3
0.15
2
1
dff1fcea84f560efdae7efdb2f3db3c2918b0605
.travis.yml
.travis.yml
language: node_js node_js: - "0.12" - "4" - "5" - "6" before_script: - npm link - npm install -g codeclimate-test-reporter addons: code_climate: repo_token: ccfbd3752b347fc937272cc69dabbdd88074847c0b03f54464027a7a8108e1d1 after_script: - codeclimate-test-reporter < ./coverage/lcov.info
language: node_js node_js: - "4" - "5" - "6" before_script: - npm link - npm install -g codeclimate-test-reporter addons: code_climate: repo_token: ccfbd3752b347fc937272cc69dabbdd88074847c0b03f54464027a7a8108e1d1 after_script: - codeclimate-test-reporter < ./coverage/lcov.info
Drop all support for legacy nodes
Drop all support for legacy nodes
YAML
mit
jay-depot/turnpike,jay-depot/turnpike
yaml
## Code Before: language: node_js node_js: - "0.12" - "4" - "5" - "6" before_script: - npm link - npm install -g codeclimate-test-reporter addons: code_climate: repo_token: ccfbd3752b347fc937272cc69dabbdd88074847c0b03f54464027a7a8108e1d1 after_script: - codeclimate-test-reporter < ./coverage/lcov.info ## Instruction: Drop all support for legacy nodes ## Code After: language: node_js node_js: - "4" - "5" - "6" before_script: - npm link - npm install -g codeclimate-test-reporter addons: code_climate: repo_token: ccfbd3752b347fc937272cc69dabbdd88074847c0b03f54464027a7a8108e1d1 after_script: - codeclimate-test-reporter < ./coverage/lcov.info
language: node_js node_js: - - "0.12" - "4" - "5" - "6" before_script: - npm link - npm install -g codeclimate-test-reporter addons: code_climate: repo_token: ccfbd3752b347fc937272cc69dabbdd88074847c0b03f54464027a7a8108e1d1 after_script: - codeclimate-test-reporter < ./coverage/lcov.info
1
0.055556
0
1
83b25550ade8fd4c7f3b42c2eedc309b85313ed2
setup-files/setup-key-chord.el
setup-files/setup-key-chord.el
;; Time-stamp: <2015-04-01 08:59:07 kmodi> ;; Key Chord Mode ;; http://www.emacswiki.org/emacs/key-chord.el (use-package key-chord :config (progn (key-chord-mode 1))) (provide 'setup-key-chord) ;; John Cook's post http://www.johndcook.com/blog/2015/02/01/rare-bigrams/ ;; provides a list of rare bi-grams that would work great for key-chords ;; bf bg bq bx bz ;; cj cv ;; dx dz ;; fb fj fq fv fz ;; gb gj gp gq gv gx gz ;; hj hq hv ;; jj jc jf jg jh jk jl jm jp jq js jt jv jw jx jy jz ;; kk kj kq kv kx kz ;; lj lq ;; mj mq mv mx mz ;; pg pj pq pv pz ;; qq qb qf qg qh qj qk ql qm qp qt qv qw qx qy qz ;; sj sx sz ;; tj tq ;; vv vc vf vg vh vj vk vm vp vq vw vz ;; ww wj wq wv wx wz ;; xb xd xg xj xk xm xq xs xw xz ;; yy yj yq ;; zb zd zf zg zj zk zm zp zq zs zv zw zx
;; Time-stamp: <2015-04-01 09:10:33 kmodi> ;; Key Chord Mode ;; http://www.emacswiki.org/emacs/key-chord.el (use-package key-chord :config (progn (key-chord-mode 1))) (provide 'setup-key-chord) ;; John Cook's post http://www.johndcook.com/blog/2015/02/01/rare-bigrams/ ;; provides a list of rare bi-grams that would work great for key-chords. ;; Below list is based off that after removing all the key-chord duplicates ;; like `xs' and `sx'. ;; fb ;; gb gp ;; jj jc jf jg jh jk jl jm jp jq js jt jv jw jx jy jz ;; kk ;; qq qb qf qg qh qk ql qm qp qt qv qw qx qy qz ;; vv vc vf vg vh vk vm vp vw vz ;; ww ;; xb xd xg xk xm xs xw ;; yy ;; zb zd zf zg zk zm zp zs zw zx
Remove key-chord duplicates from list
Minor: Remove key-chord duplicates from list
Emacs Lisp
mit
kaushalmodi/.emacs.d,kaushalmodi/.emacs.d
emacs-lisp
## Code Before: ;; Time-stamp: <2015-04-01 08:59:07 kmodi> ;; Key Chord Mode ;; http://www.emacswiki.org/emacs/key-chord.el (use-package key-chord :config (progn (key-chord-mode 1))) (provide 'setup-key-chord) ;; John Cook's post http://www.johndcook.com/blog/2015/02/01/rare-bigrams/ ;; provides a list of rare bi-grams that would work great for key-chords ;; bf bg bq bx bz ;; cj cv ;; dx dz ;; fb fj fq fv fz ;; gb gj gp gq gv gx gz ;; hj hq hv ;; jj jc jf jg jh jk jl jm jp jq js jt jv jw jx jy jz ;; kk kj kq kv kx kz ;; lj lq ;; mj mq mv mx mz ;; pg pj pq pv pz ;; qq qb qf qg qh qj qk ql qm qp qt qv qw qx qy qz ;; sj sx sz ;; tj tq ;; vv vc vf vg vh vj vk vm vp vq vw vz ;; ww wj wq wv wx wz ;; xb xd xg xj xk xm xq xs xw xz ;; yy yj yq ;; zb zd zf zg zj zk zm zp zq zs zv zw zx ## Instruction: Minor: Remove key-chord duplicates from list ## Code After: ;; Time-stamp: <2015-04-01 09:10:33 kmodi> ;; Key Chord Mode ;; http://www.emacswiki.org/emacs/key-chord.el (use-package key-chord :config (progn (key-chord-mode 1))) (provide 'setup-key-chord) ;; John Cook's post http://www.johndcook.com/blog/2015/02/01/rare-bigrams/ ;; provides a list of rare bi-grams that would work great for key-chords. ;; Below list is based off that after removing all the key-chord duplicates ;; like `xs' and `sx'. ;; fb ;; gb gp ;; jj jc jf jg jh jk jl jm jp jq js jt jv jw jx jy jz ;; kk ;; qq qb qf qg qh qk ql qm qp qt qv qw qx qy qz ;; vv vc vf vg vh vk vm vp vw vz ;; ww ;; xb xd xg xk xm xs xw ;; yy ;; zb zd zf zg zk zm zp zs zw zx
- ;; Time-stamp: <2015-04-01 08:59:07 kmodi> ? --- ^ + ;; Time-stamp: <2015-04-01 09:10:33 kmodi> ? + ^^^ ;; Key Chord Mode ;; http://www.emacswiki.org/emacs/key-chord.el (use-package key-chord :config (progn (key-chord-mode 1))) (provide 'setup-key-chord) ;; John Cook's post http://www.johndcook.com/blog/2015/02/01/rare-bigrams/ - ;; provides a list of rare bi-grams that would work great for key-chords + ;; provides a list of rare bi-grams that would work great for key-chords. ? + - ;; bf bg bq bx bz - ;; cj cv - ;; dx dz - ;; fb fj fq fv fz - ;; gb gj gp gq gv gx gz - ;; hj hq hv + + ;; Below list is based off that after removing all the key-chord duplicates + ;; like `xs' and `sx'. + + ;; fb + ;; gb gp ;; jj jc jf jg jh jk jl jm jp jq js jt jv jw jx jy jz + ;; kk - ;; kk kj kq kv kx kz - ;; lj lq - ;; mj mq mv mx mz - ;; pg pj pq pv pz - ;; qq qb qf qg qh qj qk ql qm qp qt qv qw qx qy qz ? --- + ;; qq qb qf qg qh qk ql qm qp qt qv qw qx qy qz - ;; sj sx sz - ;; tj tq - ;; vv vc vf vg vh vj vk vm vp vq vw vz ? --- --- + ;; vv vc vf vg vh vk vm vp vw vz - ;; ww wj wq wv wx wz + ;; ww - ;; xb xd xg xj xk xm xq xs xw xz ? --- --- --- + ;; xb xd xg xk xm xs xw - ;; yy yj yq + ;; yy - ;; zb zd zf zg zj zk zm zp zq zs zv zw zx ? --- --- --- + ;; zb zd zf zg zk zm zp zs zw zx
35
1.029412
15
20
bc7b47f1e6e43a57bc17d3309f184184d2f89be2
src/app/components/home.jsx
src/app/components/home.jsx
'use strict'; import React from 'react'; import { Link } from 'react-router' import Input from './input.jsx'; import { objectifyForm } from '../helpers/forms'; import { urlSafeString } from '../helpers/strings'; export default class Home extends React.Component { constructor(props) { super(props); this.handleSubmit = this.handleSubmit.bind(this); } handleSubmit (event) { event.preventDefault(); let data = objectifyForm(event.target); data.urlSafeName = urlSafeString(data.mapName); //pass to server //optimistic updates } render () { let lis = this.props.maps.map( (m) => { return ( <li key={m._id}> <Link to={'/maps/' + m.urlSafeName}>{m.mapName}</Link> </li> ); }); return ( <div> <ul> {lis} </ul> <form onSubmit={this.handleSubmit}> <Input name={'mapName'} label={'Map Name:'} /> <Input name={'imagePath'} label={'Image Path:'} /> <button type="submit">Submit</button> </form> </div> ); } } Home.propTypes = { maps: React.PropTypes.arrayOf( React.PropTypes.shape({}) ) };
'use strict'; import React from 'react'; import { Link } from 'react-router' import Input from './input.jsx'; import { objectifyForm } from '../helpers/forms'; import { urlSafeString } from '../helpers/strings'; import MapStore from '../../stores/map-store.jsx'; export default class Home extends React.Component { constructor(props) { super(props); this.handleSubmit = this.handleSubmit.bind(this); } handleSubmit (event) { event.preventDefault(); let map = objectifyForm(event.target); map.urlSafeName = urlSafeString(map.mapName); MapStore.addMap(map); } render () { let lis = this.props.maps.map( (m) => { return ( <li key={m._id}> <Link to={'/maps/' + m.urlSafeName}>{m.mapName}</Link> </li> ); }); return ( <div> <ul> {lis} </ul> <form onSubmit={this.handleSubmit}> <Input name={'mapName'} label={'Map Name:'} /> <Input name={'imagePath'} label={'Image Path:'} /> <button type="submit">Submit</button> </form> </div> ); } } Home.propTypes = { maps: React.PropTypes.arrayOf( React.PropTypes.shape({}) ) };
Add new map to mapstore
Add new map to mapstore
JSX
mit
jkrayer/poc-map-points,jkrayer/poc-map-points
jsx
## Code Before: 'use strict'; import React from 'react'; import { Link } from 'react-router' import Input from './input.jsx'; import { objectifyForm } from '../helpers/forms'; import { urlSafeString } from '../helpers/strings'; export default class Home extends React.Component { constructor(props) { super(props); this.handleSubmit = this.handleSubmit.bind(this); } handleSubmit (event) { event.preventDefault(); let data = objectifyForm(event.target); data.urlSafeName = urlSafeString(data.mapName); //pass to server //optimistic updates } render () { let lis = this.props.maps.map( (m) => { return ( <li key={m._id}> <Link to={'/maps/' + m.urlSafeName}>{m.mapName}</Link> </li> ); }); return ( <div> <ul> {lis} </ul> <form onSubmit={this.handleSubmit}> <Input name={'mapName'} label={'Map Name:'} /> <Input name={'imagePath'} label={'Image Path:'} /> <button type="submit">Submit</button> </form> </div> ); } } Home.propTypes = { maps: React.PropTypes.arrayOf( React.PropTypes.shape({}) ) }; ## Instruction: Add new map to mapstore ## Code After: 'use strict'; import React from 'react'; import { Link } from 'react-router' import Input from './input.jsx'; import { objectifyForm } from '../helpers/forms'; import { urlSafeString } from '../helpers/strings'; import MapStore from '../../stores/map-store.jsx'; export default class Home extends React.Component { constructor(props) { super(props); this.handleSubmit = this.handleSubmit.bind(this); } handleSubmit (event) { event.preventDefault(); let map = objectifyForm(event.target); map.urlSafeName = urlSafeString(map.mapName); MapStore.addMap(map); } render () { let lis = this.props.maps.map( (m) => { return ( <li key={m._id}> <Link to={'/maps/' + m.urlSafeName}>{m.mapName}</Link> </li> ); }); return ( <div> <ul> {lis} </ul> <form onSubmit={this.handleSubmit}> <Input name={'mapName'} label={'Map Name:'} /> <Input name={'imagePath'} label={'Image Path:'} /> <button type="submit">Submit</button> </form> </div> ); } } Home.propTypes = { maps: React.PropTypes.arrayOf( React.PropTypes.shape({}) ) };
'use strict'; import React from 'react'; import { Link } from 'react-router' import Input from './input.jsx'; import { objectifyForm } from '../helpers/forms'; import { urlSafeString } from '../helpers/strings'; + import MapStore from '../../stores/map-store.jsx'; export default class Home extends React.Component { constructor(props) { super(props); this.handleSubmit = this.handleSubmit.bind(this); } handleSubmit (event) { event.preventDefault(); - let data = objectifyForm(event.target); ? ^ ^^ + let map = objectifyForm(event.target); ? ^ ^ - data.urlSafeName = urlSafeString(data.mapName); ? ^ ^^ ^ ^^ + map.urlSafeName = urlSafeString(map.mapName); ? ^ ^ ^ ^ + MapStore.addMap(map); - //pass to server - //optimistic updates } render () { let lis = this.props.maps.map( (m) => { return ( <li key={m._id}> <Link to={'/maps/' + m.urlSafeName}>{m.mapName}</Link> </li> ); }); return ( <div> <ul> {lis} </ul> <form onSubmit={this.handleSubmit}> <Input name={'mapName'} label={'Map Name:'} /> <Input name={'imagePath'} label={'Image Path:'} /> <button type="submit">Submit</button> </form> </div> ); } } Home.propTypes = { maps: React.PropTypes.arrayOf( React.PropTypes.shape({}) ) };
8
0.163265
4
4
f8f865e7678c1cd52518300dd4d0d5a801d582bc
src/components/help/help.stories.js
src/components/help/help.stories.js
import React from 'react'; import { storiesOf } from '@storybook/react'; import { text, select } from '@storybook/addon-knobs'; import OptionsHelper from '../../utils/helpers/options-helper'; import notes from './notes.md'; import Help from './help'; storiesOf('Help', module) .add('default', () => { const children = text('children', 'This is help text'); const tooltipPosition = children ? select( 'tooltipPosition', OptionsHelper.positions, Help.defaultProps.tooltipPosition ) : undefined; const tooltipAlign = children ? select( 'tooltipAlign', OptionsHelper.alignAroundEdges, Help.defaultProps.tooltipAlign ) : undefined; const href = text('href', ''); return ( <Help tooltipPosition={ tooltipPosition } tooltipAlign={ tooltipAlign } href={ href } > {children} </Help> ); }, { notes: { markdown: notes } });
import React from 'react'; import { storiesOf } from '@storybook/react'; import { text, select } from '@storybook/addon-knobs'; import OptionsHelper from '../../utils/helpers/options-helper'; import notes from './notes.md'; import Help from './help'; storiesOf('Help', module) .add('default', () => { const children = text('children', 'This is help text'); const tooltipPosition = children ? select( 'tooltipPosition', OptionsHelper.positions, 'right' ) : undefined; const tooltipAlign = children ? select( 'tooltipAlign', OptionsHelper.alignAroundEdges, Help.defaultProps.tooltipAlign ) : undefined; const href = text('href', ''); return ( <Help tooltipPosition={ tooltipPosition } tooltipAlign={ tooltipAlign } href={ href } > {children} </Help> ); }, { notes: { markdown: notes } });
Update Help Props So Popup Remains On-Screen
Update Help Props So Popup Remains On-Screen
JavaScript
apache-2.0
Sage/carbon,Sage/carbon,Sage/carbon
javascript
## Code Before: import React from 'react'; import { storiesOf } from '@storybook/react'; import { text, select } from '@storybook/addon-knobs'; import OptionsHelper from '../../utils/helpers/options-helper'; import notes from './notes.md'; import Help from './help'; storiesOf('Help', module) .add('default', () => { const children = text('children', 'This is help text'); const tooltipPosition = children ? select( 'tooltipPosition', OptionsHelper.positions, Help.defaultProps.tooltipPosition ) : undefined; const tooltipAlign = children ? select( 'tooltipAlign', OptionsHelper.alignAroundEdges, Help.defaultProps.tooltipAlign ) : undefined; const href = text('href', ''); return ( <Help tooltipPosition={ tooltipPosition } tooltipAlign={ tooltipAlign } href={ href } > {children} </Help> ); }, { notes: { markdown: notes } }); ## Instruction: Update Help Props So Popup Remains On-Screen ## Code After: import React from 'react'; import { storiesOf } from '@storybook/react'; import { text, select } from '@storybook/addon-knobs'; import OptionsHelper from '../../utils/helpers/options-helper'; import notes from './notes.md'; import Help from './help'; storiesOf('Help', module) .add('default', () => { const children = text('children', 'This is help text'); const tooltipPosition = children ? select( 'tooltipPosition', OptionsHelper.positions, 'right' ) : undefined; const tooltipAlign = children ? select( 'tooltipAlign', OptionsHelper.alignAroundEdges, Help.defaultProps.tooltipAlign ) : undefined; const href = text('href', ''); return ( <Help tooltipPosition={ tooltipPosition } tooltipAlign={ tooltipAlign } href={ href } > {children} </Help> ); }, { notes: { markdown: notes } });
import React from 'react'; import { storiesOf } from '@storybook/react'; import { text, select } from '@storybook/addon-knobs'; import OptionsHelper from '../../utils/helpers/options-helper'; import notes from './notes.md'; import Help from './help'; storiesOf('Help', module) .add('default', () => { const children = text('children', 'This is help text'); const tooltipPosition = children ? select( 'tooltipPosition', OptionsHelper.positions, - Help.defaultProps.tooltipPosition + 'right' ) : undefined; const tooltipAlign = children ? select( 'tooltipAlign', OptionsHelper.alignAroundEdges, Help.defaultProps.tooltipAlign ) : undefined; const href = text('href', ''); return ( <Help tooltipPosition={ tooltipPosition } tooltipAlign={ tooltipAlign } href={ href } > {children} </Help> ); }, { notes: { markdown: notes } });
2
0.058824
1
1
2c58a153dc0c89839c137ae2f762d37e85c382a7
roles/aws/tasks/main.yml
roles/aws/tasks/main.yml
--- - name: Enable Tuned profile for low latency command: tuned-adm profile network-latency - sysctl: name: vm.swappiness value: 10 state: present
--- - name: Enable Tuned profile for low latency command: tuned-adm profile virtual-guest - sysctl: name: vm.swappiness value: 0 state: present
Improve tuning choices for AWS role
Improve tuning choices for AWS role
YAML
mit
DavideD/ci.hibernate.org,hibernate/ci.hibernate.org,DavideD/ci.hibernate.org,Sanne/ci.hibernate.org,hibernate/ci.hibernate.org,Sanne/ci.hibernate.org
yaml
## Code Before: --- - name: Enable Tuned profile for low latency command: tuned-adm profile network-latency - sysctl: name: vm.swappiness value: 10 state: present ## Instruction: Improve tuning choices for AWS role ## Code After: --- - name: Enable Tuned profile for low latency command: tuned-adm profile virtual-guest - sysctl: name: vm.swappiness value: 0 state: present
--- - name: Enable Tuned profile for low latency - command: tuned-adm profile network-latency + command: tuned-adm profile virtual-guest - sysctl: name: vm.swappiness - value: 10 ? - + value: 0 state: present
4
0.444444
2
2
1e81785588dff02a018eec3b86b0b1ad5cde521a
spec/features/course/admin/admin_spec.rb
spec/features/course/admin/admin_spec.rb
require 'rails_helper' RSpec.describe 'Course: Administration: Administration', type: :feature do subject { page } let(:instance) { create(:instance) } with_tenant(:instance) do let!(:user) { create(:administrator) } before { login_as(user, scope: :user) } describe 'index' do let!(:course) { create(:course) } before { visit course_admin_path(course) } context 'with valid information' do let(:new_title) { 'New Title' } let(:new_description) { 'New Description' } before do fill_in 'course_title', with: new_title fill_in 'course_description', with: new_description click_button I18n.t('helpers.submit.course.update') end it 'changes the attributes' do expect(course.reload.title).to eq(new_title) expect(course.reload.description).to eq(new_description) end end context 'with empty title' do before do fill_in 'course_title', with: '' click_button I18n.t('helpers.submit.course.update') end it 'does not change title' do expect(course.reload.title).not_to eq('') end it 'shows the error' do expect(page).to have_css('div.has-error') end end end end end
require 'rails_helper' RSpec.feature 'Course: Administration: Administration' do subject { page } let(:instance) { create(:instance) } with_tenant(:instance) do let!(:user) { create(:administrator) } before { login_as(user, scope: :user) } context 'As an administrator' do let(:course) { create(:course) } scenario 'I can change the course attributes' do visit course_admin_path(course) fill_in 'course_title', with: '' click_button I18n.t('helpers.submit.course.update') expect(course.reload.title).not_to eq('') expect(page).to have_selector('div.has-error') new_title = 'New Title' new_description = 'New Description' fill_in 'course_title', with: new_title fill_in 'course_description', with: new_description click_button I18n.t('helpers.submit.course.update') expect(page).to have_selector('div.alert.alert-success') expect(course.reload.title).to eq(new_title) expect(course.reload.description).to eq(new_description) end end end end
Rewrite the course settings specification to use the new user story style.
Rewrite the course settings specification to use the new user story style.
Ruby
mit
Coursemology/coursemology2,harryggg/coursemology2,Coursemology/coursemology2,BenMQ/coursemology2,harryggg/coursemology2,cysjonathan/coursemology2,xzhflying/coursemology2,xzhflying/coursemology2,Coursemology/coursemology2,Coursemology/coursemology2,Coursemology/coursemology2,BenMQ/coursemology2,xzhflying/coursemology2,Coursemology/coursemology2,cysjonathan/coursemology2,BenMQ/coursemology2,harryggg/coursemology2,cysjonathan/coursemology2,Coursemology/coursemology2
ruby
## Code Before: require 'rails_helper' RSpec.describe 'Course: Administration: Administration', type: :feature do subject { page } let(:instance) { create(:instance) } with_tenant(:instance) do let!(:user) { create(:administrator) } before { login_as(user, scope: :user) } describe 'index' do let!(:course) { create(:course) } before { visit course_admin_path(course) } context 'with valid information' do let(:new_title) { 'New Title' } let(:new_description) { 'New Description' } before do fill_in 'course_title', with: new_title fill_in 'course_description', with: new_description click_button I18n.t('helpers.submit.course.update') end it 'changes the attributes' do expect(course.reload.title).to eq(new_title) expect(course.reload.description).to eq(new_description) end end context 'with empty title' do before do fill_in 'course_title', with: '' click_button I18n.t('helpers.submit.course.update') end it 'does not change title' do expect(course.reload.title).not_to eq('') end it 'shows the error' do expect(page).to have_css('div.has-error') end end end end end ## Instruction: Rewrite the course settings specification to use the new user story style. ## Code After: require 'rails_helper' RSpec.feature 'Course: Administration: Administration' do subject { page } let(:instance) { create(:instance) } with_tenant(:instance) do let!(:user) { create(:administrator) } before { login_as(user, scope: :user) } context 'As an administrator' do let(:course) { create(:course) } scenario 'I can change the course attributes' do visit course_admin_path(course) fill_in 'course_title', with: '' click_button I18n.t('helpers.submit.course.update') expect(course.reload.title).not_to eq('') expect(page).to have_selector('div.has-error') new_title = 'New Title' new_description = 'New Description' fill_in 'course_title', with: new_title fill_in 'course_description', with: new_description click_button I18n.t('helpers.submit.course.update') expect(page).to have_selector('div.alert.alert-success') expect(course.reload.title).to eq(new_title) expect(course.reload.description).to eq(new_description) end end end end
require 'rails_helper' - RSpec.describe 'Course: Administration: Administration', type: :feature do ? ^ ^^ -- ---------------- + RSpec.feature 'Course: Administration: Administration' do ? ^ ^^^ subject { page } let(:instance) { create(:instance) } with_tenant(:instance) do let!(:user) { create(:administrator) } before { login_as(user, scope: :user) } - describe 'index' do + context 'As an administrator' do - let!(:course) { create(:course) } ? - + let(:course) { create(:course) } + scenario 'I can change the course attributes' do - before { visit course_admin_path(course) } ? ------ - -- + visit course_admin_path(course) - context 'with valid information' do - let(:new_title) { 'New Title' } - let(:new_description) { 'New Description' } + fill_in 'course_title', with: '' + click_button I18n.t('helpers.submit.course.update') + expect(course.reload.title).not_to eq('') + expect(page).to have_selector('div.has-error') - before do + new_title = 'New Title' + new_description = 'New Description' - fill_in 'course_title', with: new_title ? -- + fill_in 'course_title', with: new_title - fill_in 'course_description', with: new_description ? -- + fill_in 'course_description', with: new_description - click_button I18n.t('helpers.submit.course.update') ? -- + click_button I18n.t('helpers.submit.course.update') - end - it 'changes the attributes' do + expect(page).to have_selector('div.alert.alert-success') - expect(course.reload.title).to eq(new_title) ? -- + expect(course.reload.title).to eq(new_title) - expect(course.reload.description).to eq(new_description) ? -- + expect(course.reload.description).to eq(new_description) - end - end - - context 'with empty title' do - before do - fill_in 'course_title', with: '' - click_button I18n.t('helpers.submit.course.update') - end - - it 'does not change title' do - expect(course.reload.title).not_to eq('') - end - - it 'shows the error' do - expect(page).to have_css('div.has-error') - end end end end end
48
1
17
31
8c7c3274e781912c8e0214eaaa57f432dc6c111b
README.md
README.md
`RSpec::Support` provides common functionality to `RSpec::Core`, `RSpec::Expectations` and `RSpec::Mocks`. It is considered suitable for internal use only at this time. ## Installation / Usage Install one or more of the `RSpec` gems. ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request
`RSpec::Support` provides common functionality to `RSpec::Core`, `RSpec::Expectations` and `RSpec::Mocks`. It is considered suitable for internal use only at this time. ## Installation / Usage Install one or more of the `RSpec` gems. Want to run against the `master` branch? You'll need to include the dependent RSpec repos as well. Add the following to your `Gemfile`: ```ruby %w[rspec-core rspec-expectations rspec-mocks rspec-support].each do |lib| gem lib, :git => "git://github.com/rspec/#{lib}.git", :branch => 'master' end ``` ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request
Include details on how to run against `master`.
Include details on how to run against `master`. A very common issue is when a user attempts to run against the `master` branch. Simply pointing to `master` doesn't work. This adds the steps necessary to use `master`. We need all of the repos in order to also satisfy any other gems which may have a dependency on the `rspec` gem. [ci skip]
Markdown
mit
hackling/rspec-support,rspec/rspec-support,AEgan/rspec-support,rspec/rspec-support,hackling/rspec-support,AEgan/rspec-support
markdown
## Code Before: `RSpec::Support` provides common functionality to `RSpec::Core`, `RSpec::Expectations` and `RSpec::Mocks`. It is considered suitable for internal use only at this time. ## Installation / Usage Install one or more of the `RSpec` gems. ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request ## Instruction: Include details on how to run against `master`. A very common issue is when a user attempts to run against the `master` branch. Simply pointing to `master` doesn't work. This adds the steps necessary to use `master`. We need all of the repos in order to also satisfy any other gems which may have a dependency on the `rspec` gem. [ci skip] ## Code After: `RSpec::Support` provides common functionality to `RSpec::Core`, `RSpec::Expectations` and `RSpec::Mocks`. It is considered suitable for internal use only at this time. ## Installation / Usage Install one or more of the `RSpec` gems. Want to run against the `master` branch? You'll need to include the dependent RSpec repos as well. Add the following to your `Gemfile`: ```ruby %w[rspec-core rspec-expectations rspec-mocks rspec-support].each do |lib| gem lib, :git => "git://github.com/rspec/#{lib}.git", :branch => 'master' end ``` ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request
`RSpec::Support` provides common functionality to `RSpec::Core`, `RSpec::Expectations` and `RSpec::Mocks`. It is considered suitable for internal use only at this time. ## Installation / Usage Install one or more of the `RSpec` gems. + Want to run against the `master` branch? You'll need to include the dependent + RSpec repos as well. Add the following to your `Gemfile`: + + ```ruby + %w[rspec-core rspec-expectations rspec-mocks rspec-support].each do |lib| + gem lib, :git => "git://github.com/rspec/#{lib}.git", :branch => 'master' + end + ``` + ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request
9
0.5625
9
0
33b0c489a79e10d0ad382458899d59e7917a7671
tiki/templates/modules/mod-last_modif_pages.tpl
tiki/templates/modules/mod-last_modif_pages.tpl
{if $feature_wiki eq 'y'} <div class="box"> <div class="box-title"> {tr}Last changes{/tr} </div> <div class="box-data"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> {section name=ix loop=$modLastModif} <tr> <td width="5%" class="module" valign="top"> {$smarty.section.ix.index_next}) </td> <td class="module">&nbsp; <a class="linkmodule" href="tiki-index.php?page={$modLastModif[ix].pageName|escape:"url"}"> {$modLastModif[ix].pageName|truncate:$maxlen:"...":true} </a> </td> </tr> {/section} </table> </div> </div> {/if}{* $feature_wiki eq 'y' *}
{if $feature_wiki eq 'y'} <div class="box"> <div class="box-title"> {tr}Last changes{/tr} </div> <div class="box-data"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> {section name=ix loop=$modLastModif} <tr> <td width="5%" class="module" valign="top"> {$smarty.section.ix.index_next}) </td> <td class="module">&nbsp; <a class="linkmodule" href="tiki-index.php?page={$modLastModif[ix].pageName|escape:"url"}" {if strlen($modLastModif[ix].pageName) gt $maxlen}title="{$modLastModif[ix].pageName}"{/if}> {$modLastModif[ix].pageName|truncate:$maxlen:"...":true} </a> </td> </tr> {/section} </table> </div> </div> {/if}{* $feature_wiki eq 'y' *}
Add 'title' to stripped link
Add 'title' to stripped link git-svn-id: a7fabbc6a7c54ea5c67cbd16bd322330fd10cc35@844 b456876b-0849-0410-b77d-98878d47e9d5
Smarty
lgpl-2.1
changi67/tiki,oregional/tiki,changi67/tiki,oregional/tiki,tikiorg/tiki,changi67/tiki,changi67/tiki,oregional/tiki,tikiorg/tiki,tikiorg/tiki,oregional/tiki,changi67/tiki,tikiorg/tiki
smarty
## Code Before: {if $feature_wiki eq 'y'} <div class="box"> <div class="box-title"> {tr}Last changes{/tr} </div> <div class="box-data"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> {section name=ix loop=$modLastModif} <tr> <td width="5%" class="module" valign="top"> {$smarty.section.ix.index_next}) </td> <td class="module">&nbsp; <a class="linkmodule" href="tiki-index.php?page={$modLastModif[ix].pageName|escape:"url"}"> {$modLastModif[ix].pageName|truncate:$maxlen:"...":true} </a> </td> </tr> {/section} </table> </div> </div> {/if}{* $feature_wiki eq 'y' *} ## Instruction: Add 'title' to stripped link git-svn-id: a7fabbc6a7c54ea5c67cbd16bd322330fd10cc35@844 b456876b-0849-0410-b77d-98878d47e9d5 ## Code After: {if $feature_wiki eq 'y'} <div class="box"> <div class="box-title"> {tr}Last changes{/tr} </div> <div class="box-data"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> {section name=ix loop=$modLastModif} <tr> <td width="5%" class="module" valign="top"> {$smarty.section.ix.index_next}) </td> <td class="module">&nbsp; <a class="linkmodule" href="tiki-index.php?page={$modLastModif[ix].pageName|escape:"url"}" {if strlen($modLastModif[ix].pageName) gt $maxlen}title="{$modLastModif[ix].pageName}"{/if}> {$modLastModif[ix].pageName|truncate:$maxlen:"...":true} </a> </td> </tr> {/section} </table> </div> </div> {/if}{* $feature_wiki eq 'y' *}
{if $feature_wiki eq 'y'} <div class="box"> <div class="box-title"> {tr}Last changes{/tr} </div> <div class="box-data"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> {section name=ix loop=$modLastModif} <tr> <td width="5%" class="module" valign="top"> {$smarty.section.ix.index_next}) </td> <td class="module">&nbsp; - <a class="linkmodule" href="tiki-index.php?page={$modLastModif[ix].pageName|escape:"url"}"> ? - + <a class="linkmodule" href="tiki-index.php?page={$modLastModif[ix].pageName|escape:"url"}" + {if strlen($modLastModif[ix].pageName) gt $maxlen}title="{$modLastModif[ix].pageName}"{/if}> {$modLastModif[ix].pageName|truncate:$maxlen:"...":true} </a> </td> </tr> {/section} </table> </div> </div> {/if}{* $feature_wiki eq 'y' *}
3
0.130435
2
1
c4973cccc311cbfea22b8bc7f0d34881c9ad1d76
RuleDocumentation/AvoidUsingPlainTextForPassword.md
RuleDocumentation/AvoidUsingPlainTextForPassword.md
**Severity Level: Warning** ##Description Password parameters that take in plaintext will expose passwords and compromise the security of your system. ##How to Fix To fix a violation of this rule, please use SecureString as the type of password parameter. ##Example Wrong: ``` function Test-Script { [CmdletBinding()] [Alias()] [OutputType([int])] Param ( [string] $Password, [string] $Pass, [string[]] $Passwords, $Passphrases, $Passwordparam ) } ``` Correct: ``` function Test-Script { [CmdletBinding()] [Alias()] [OutputType([Int])] Param ( [SecureString] $Password, [System.Security.SecureString] $Pass, [SecureString[]] $Passwords, [SecureString] $Passphrases, [SecureString] $PasswordParam ) ... } ```
**Severity Level: Warning** ##Description Password parameters that take in plaintext will expose passwords and compromise the security of your system. ##How to Fix To fix a violation of this rule, please use SecureString as the type of password parameter. ##Example Wrong: ``` function Test-Script { [CmdletBinding()] [Alias()] [OutputType([int])] Param ( [string] $Password, [string] $Pass, [string[]] $Passwords, $Passphrases, $Passwordparam ) ... } ``` Correct: ``` function Test-Script { [CmdletBinding()] [Alias()] [OutputType([Int])] Param ( [SecureString] $Password, [System.Security.SecureString] $Pass, [SecureString[]] $Passwords, [SecureString] $Passphrases, [SecureString] $PasswordParam ) ... } ```
Add ellipsis to 'wrong' example.
Add ellipsis to 'wrong' example.
Markdown
mit
PowerShell/PSScriptAnalyzer,dlwyatt/PSScriptAnalyzer,juneb/PSScriptAnalyzer,daviwil/PSScriptAnalyzer
markdown
## Code Before: **Severity Level: Warning** ##Description Password parameters that take in plaintext will expose passwords and compromise the security of your system. ##How to Fix To fix a violation of this rule, please use SecureString as the type of password parameter. ##Example Wrong: ``` function Test-Script { [CmdletBinding()] [Alias()] [OutputType([int])] Param ( [string] $Password, [string] $Pass, [string[]] $Passwords, $Passphrases, $Passwordparam ) } ``` Correct: ``` function Test-Script { [CmdletBinding()] [Alias()] [OutputType([Int])] Param ( [SecureString] $Password, [System.Security.SecureString] $Pass, [SecureString[]] $Passwords, [SecureString] $Passphrases, [SecureString] $PasswordParam ) ... } ``` ## Instruction: Add ellipsis to 'wrong' example. ## Code After: **Severity Level: Warning** ##Description Password parameters that take in plaintext will expose passwords and compromise the security of your system. ##How to Fix To fix a violation of this rule, please use SecureString as the type of password parameter. ##Example Wrong: ``` function Test-Script { [CmdletBinding()] [Alias()] [OutputType([int])] Param ( [string] $Password, [string] $Pass, [string[]] $Passwords, $Passphrases, $Passwordparam ) ... } ``` Correct: ``` function Test-Script { [CmdletBinding()] [Alias()] [OutputType([Int])] Param ( [SecureString] $Password, [System.Security.SecureString] $Pass, [SecureString[]] $Passwords, [SecureString] $Passphrases, [SecureString] $PasswordParam ) ... } ```
**Severity Level: Warning** ##Description Password parameters that take in plaintext will expose passwords and compromise the security of your system. ##How to Fix To fix a violation of this rule, please use SecureString as the type of password parameter. ##Example Wrong: ``` function Test-Script { [CmdletBinding()] [Alias()] [OutputType([int])] Param ( [string] $Password, [string] $Pass, [string[]] $Passwords, $Passphrases, $Passwordparam ) + ... } ``` Correct: ``` function Test-Script { - [CmdletBinding()] ? ^^^^ + [CmdletBinding()] ? ^ - [Alias()] ? ^^^^ + [Alias()] ? ^ - [OutputType([Int])] ? ^^^^ + [OutputType([Int])] ? ^ - Param + Param ( [SecureString] $Password, [System.Security.SecureString] $Pass, [SecureString[]] $Passwords, [SecureString] $Passphrases, [SecureString] $PasswordParam ) ... } ```
9
0.152542
5
4
798cd9f9e57b84d0216610ddb353baf8d1c8ae67
app/Http/Controllers/Auth/AuthenticatedSessionController.php
app/Http/Controllers/Auth/AuthenticatedSessionController.php
<?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use App\Http\Requests\Auth\LoginRequest; use App\Providers\RouteServiceProvider; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class AuthenticatedSessionController extends Controller { /** * Display the login view. * * @return \Illuminate\View\View */ public function create() { return view('auth.login'); } /** * Handle an incoming authentication request. * * @param \App\Http\Requests\Auth\LoginRequest $request * @return \Illuminate\Http\RedirectResponse */ public function store(LoginRequest $request) { $request->authenticate(); $request->session()->regenerate(); return redirect()->intended(RouteServiceProvider::home()); } /** * Destroy an authenticated session. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\RedirectResponse */ public function destroy(Request $request) { Auth::guard('web')->logout(); $request->session()->invalidate(); $request->session()->regenerateToken(); return redirect(airoute( 'aimeos_home' )); } }
<?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use App\Http\Requests\Auth\LoginRequest; use App\Providers\RouteServiceProvider; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Response; class AuthenticatedSessionController extends Controller { /** * Display the login view. * * @return \Illuminate\View\View */ public function create() { return Response::view('auth.login')->header( 'Cache-Control', 'no-store, private' ); } /** * Handle an incoming authentication request. * * @param \App\Http\Requests\Auth\LoginRequest $request * @return \Illuminate\Http\RedirectResponse */ public function store(LoginRequest $request) { $request->authenticate(); $request->session()->regenerate(); return redirect()->intended(RouteServiceProvider::home()); } /** * Destroy an authenticated session. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\RedirectResponse */ public function destroy(Request $request) { Auth::guard('web')->logout(); $request->session()->invalidate(); $request->session()->regenerateToken(); return redirect(airoute( 'aimeos_home' )); } }
Enforce no caching of login page with CSRF token by browser
Enforce no caching of login page with CSRF token by browser
PHP
mit
aimeos/aimeos,aimeos/aimeos,aimeos/aimeos
php
## Code Before: <?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use App\Http\Requests\Auth\LoginRequest; use App\Providers\RouteServiceProvider; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class AuthenticatedSessionController extends Controller { /** * Display the login view. * * @return \Illuminate\View\View */ public function create() { return view('auth.login'); } /** * Handle an incoming authentication request. * * @param \App\Http\Requests\Auth\LoginRequest $request * @return \Illuminate\Http\RedirectResponse */ public function store(LoginRequest $request) { $request->authenticate(); $request->session()->regenerate(); return redirect()->intended(RouteServiceProvider::home()); } /** * Destroy an authenticated session. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\RedirectResponse */ public function destroy(Request $request) { Auth::guard('web')->logout(); $request->session()->invalidate(); $request->session()->regenerateToken(); return redirect(airoute( 'aimeos_home' )); } } ## Instruction: Enforce no caching of login page with CSRF token by browser ## Code After: <?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use App\Http\Requests\Auth\LoginRequest; use App\Providers\RouteServiceProvider; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Response; class AuthenticatedSessionController extends Controller { /** * Display the login view. * * @return \Illuminate\View\View */ public function create() { return Response::view('auth.login')->header( 'Cache-Control', 'no-store, private' ); } /** * Handle an incoming authentication request. * * @param \App\Http\Requests\Auth\LoginRequest $request * @return \Illuminate\Http\RedirectResponse */ public function store(LoginRequest $request) { $request->authenticate(); $request->session()->regenerate(); return redirect()->intended(RouteServiceProvider::home()); } /** * Destroy an authenticated session. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\RedirectResponse */ public function destroy(Request $request) { Auth::guard('web')->logout(); $request->session()->invalidate(); $request->session()->regenerateToken(); return redirect(airoute( 'aimeos_home' )); } }
<?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use App\Http\Requests\Auth\LoginRequest; use App\Providers\RouteServiceProvider; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; + use Illuminate\Support\Facades\Response; class AuthenticatedSessionController extends Controller { /** * Display the login view. * * @return \Illuminate\View\View */ public function create() { - return view('auth.login'); + return Response::view('auth.login')->header( 'Cache-Control', 'no-store, private' ); } /** * Handle an incoming authentication request. * * @param \App\Http\Requests\Auth\LoginRequest $request * @return \Illuminate\Http\RedirectResponse */ public function store(LoginRequest $request) { $request->authenticate(); $request->session()->regenerate(); return redirect()->intended(RouteServiceProvider::home()); } /** * Destroy an authenticated session. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\RedirectResponse */ public function destroy(Request $request) { Auth::guard('web')->logout(); $request->session()->invalidate(); $request->session()->regenerateToken(); return redirect(airoute( 'aimeos_home' )); } }
3
0.055556
2
1
0dbc0c5283d355bfbbea575f73b96d7223dbdcd7
src/Phapi/Contract/Middleware/Middleware.php
src/Phapi/Contract/Middleware/Middleware.php
<?php namespace Phapi\Contract\Middleware; use Phapi\Contract\Http\Request; use Phapi\Contract\Http\Response; /** * Interface Middleware * * Middleware accepts a request and a response and optionally a callback * ($next) that is called if the middleware allows further middleware to * process the request. * * If a middleware doesn't need or desire to allow further processing it * should not call the callback ($next) and should instead return a response. * * @category Phapi * @package Phapi\Contract * @author Peter Ahinko <peter@ahinko.se> * @license MIT (http://opensource.org/licenses/MIT) * @link https://github.com/phapi/contract */ interface Middleware { /** * Process an incoming request and/or response. * * Accepts a request and a response (PSR-7 compatible) instance and * does something with them. * * The middleware must pass a request and a response to the ($next) * callback and finally either return the response from the ($next) * callback or by modifying the response before returning it. * * Examples: * return $next(); * * OR * * $response = $next(); * // Modify response * ... * return $response; * * @param Request $request * @param Response $response * @param callable $next * @return Request */ public function __invoke(Request $request, Response $response, callable $next = null); }
<?php namespace Phapi\Contract\Middleware; use Psr\Http\Message\ServerRequestInterface as RequestInterface; use Psr\Http\Message\ResponseInterface; /** * Interface Middleware * * Middleware accepts a request and a response and optionally a callback * ($next) that is called if the middleware allows further middleware to * process the request. * * If a middleware doesn't need or desire to allow further processing it * should not call the callback ($next) and should instead return a response. * * @category Phapi * @package Phapi\Contract * @author Peter Ahinko <peter@ahinko.se> * @license MIT (http://opensource.org/licenses/MIT) * @link https://github.com/phapi/contract */ interface Middleware { /** * Process an incoming request and/or response. * * Accepts a request and a response (PSR-7 compatible) instance and * does something with them. * * The middleware must pass a request and a response to the ($next) * callback and finally either return the response from the ($next) * callback or by modifying the response before returning it. * * Examples: * return $next(); * * OR * * $response = $next(); * // Modify response * ... * return $response; * * @param RequestInterface $request * @param ResponseInterface $response * @param callable $next * @return ResponseInterface */ public function __invoke(RequestInterface $request, ResponseInterface $response, callable $next = null); }
Revert "Updated middleware contract to force use of Request and Response contracts."
Revert "Updated middleware contract to force use of Request and Response contracts." This reverts commit 47d2083f48b676d359c2b2eb3836b2ce2f85909d.
PHP
mit
phapi/contract
php
## Code Before: <?php namespace Phapi\Contract\Middleware; use Phapi\Contract\Http\Request; use Phapi\Contract\Http\Response; /** * Interface Middleware * * Middleware accepts a request and a response and optionally a callback * ($next) that is called if the middleware allows further middleware to * process the request. * * If a middleware doesn't need or desire to allow further processing it * should not call the callback ($next) and should instead return a response. * * @category Phapi * @package Phapi\Contract * @author Peter Ahinko <peter@ahinko.se> * @license MIT (http://opensource.org/licenses/MIT) * @link https://github.com/phapi/contract */ interface Middleware { /** * Process an incoming request and/or response. * * Accepts a request and a response (PSR-7 compatible) instance and * does something with them. * * The middleware must pass a request and a response to the ($next) * callback and finally either return the response from the ($next) * callback or by modifying the response before returning it. * * Examples: * return $next(); * * OR * * $response = $next(); * // Modify response * ... * return $response; * * @param Request $request * @param Response $response * @param callable $next * @return Request */ public function __invoke(Request $request, Response $response, callable $next = null); } ## Instruction: Revert "Updated middleware contract to force use of Request and Response contracts." This reverts commit 47d2083f48b676d359c2b2eb3836b2ce2f85909d. ## Code After: <?php namespace Phapi\Contract\Middleware; use Psr\Http\Message\ServerRequestInterface as RequestInterface; use Psr\Http\Message\ResponseInterface; /** * Interface Middleware * * Middleware accepts a request and a response and optionally a callback * ($next) that is called if the middleware allows further middleware to * process the request. * * If a middleware doesn't need or desire to allow further processing it * should not call the callback ($next) and should instead return a response. * * @category Phapi * @package Phapi\Contract * @author Peter Ahinko <peter@ahinko.se> * @license MIT (http://opensource.org/licenses/MIT) * @link https://github.com/phapi/contract */ interface Middleware { /** * Process an incoming request and/or response. * * Accepts a request and a response (PSR-7 compatible) instance and * does something with them. * * The middleware must pass a request and a response to the ($next) * callback and finally either return the response from the ($next) * callback or by modifying the response before returning it. * * Examples: * return $next(); * * OR * * $response = $next(); * // Modify response * ... * return $response; * * @param RequestInterface $request * @param ResponseInterface $response * @param callable $next * @return ResponseInterface */ public function __invoke(RequestInterface $request, ResponseInterface $response, callable $next = null); }
<?php namespace Phapi\Contract\Middleware; - use Phapi\Contract\Http\Request; - use Phapi\Contract\Http\Response; + use Psr\Http\Message\ServerRequestInterface as RequestInterface; + use Psr\Http\Message\ResponseInterface; /** * Interface Middleware * * Middleware accepts a request and a response and optionally a callback * ($next) that is called if the middleware allows further middleware to * process the request. * * If a middleware doesn't need or desire to allow further processing it * should not call the callback ($next) and should instead return a response. * * @category Phapi * @package Phapi\Contract * @author Peter Ahinko <peter@ahinko.se> * @license MIT (http://opensource.org/licenses/MIT) * @link https://github.com/phapi/contract */ interface Middleware { /** * Process an incoming request and/or response. * * Accepts a request and a response (PSR-7 compatible) instance and * does something with them. * * The middleware must pass a request and a response to the ($next) * callback and finally either return the response from the ($next) * callback or by modifying the response before returning it. * * Examples: * return $next(); * * OR * * $response = $next(); * // Modify response * ... * return $response; * - * @param Request $request + * @param RequestInterface $request ? +++++++++ - * @param Response $response + * @param ResponseInterface $response ? +++++++++ * @param callable $next - * @return Request + * @return ResponseInterface */ - public function __invoke(Request $request, Response $response, callable $next = null); + public function __invoke(RequestInterface $request, ResponseInterface $response, callable $next = null); ? +++++++++ +++++++++ }
12
0.226415
6
6
2d9df8362b75f2f6c7d39895d37cd14178eb040a
assets/javascripts/templates/followers.js.mustache.slim
assets/javascripts/templates/followers.js.mustache.slim
.row .span2 &nbsp; .span8 | {{#followers.length}} | {{#guest_authenticated}} h1.page-header Followers of <small><a href='{{domain_entity}}'>{{formatted.domain_entity}}</a></small> | {{/guest_authenticated}} | {{^guest_authenticated}} h1.page-header Your Followers | {{/guest_authenticated}} table.table.table-striped thead tr th Name th Entity th th tbody | {{#followers}} | {{> _follower}} | {{/followers}} | {{/followers.length}} | {{^followers.length}} h1.page-header You don't have any Followers yet | {{/followers.length}}
.row .span2 &nbsp; .span8 | {{#followers.length}} | {{#guest_authenticated}} h1.page-header Followers of <small><a href='{{domain_entity}}'>{{formatted.domain_entity}}</a></small> | {{/guest_authenticated}} | {{^guest_authenticated}} h1.page-header Your Followers | {{/guest_authenticated}} table.table.table-striped thead tr th Name th Entity th th tbody | {{#followers}} | {{> _follower}} | {{/followers}} | {{/followers.length}} | {{^followers.length}} | {{#guest_authenticated}} h1.page-header <small><a href='{{domain_entity}}'>{{formatted.domain_entity}}</a></small> doesn't have any followers yet | {{/guest_authenticated}} | {{^guest_authenticated}} h1.page-header You don't have any Followers yet | {{/guest_authenticated}} | {{/followers.length}}
Fix followers page when no followers
Fix followers page when no followers
Slim
bsd-3-clause
tent/tent-status,tent/tent-status
slim
## Code Before: .row .span2 &nbsp; .span8 | {{#followers.length}} | {{#guest_authenticated}} h1.page-header Followers of <small><a href='{{domain_entity}}'>{{formatted.domain_entity}}</a></small> | {{/guest_authenticated}} | {{^guest_authenticated}} h1.page-header Your Followers | {{/guest_authenticated}} table.table.table-striped thead tr th Name th Entity th th tbody | {{#followers}} | {{> _follower}} | {{/followers}} | {{/followers.length}} | {{^followers.length}} h1.page-header You don't have any Followers yet | {{/followers.length}} ## Instruction: Fix followers page when no followers ## Code After: .row .span2 &nbsp; .span8 | {{#followers.length}} | {{#guest_authenticated}} h1.page-header Followers of <small><a href='{{domain_entity}}'>{{formatted.domain_entity}}</a></small> | {{/guest_authenticated}} | {{^guest_authenticated}} h1.page-header Your Followers | {{/guest_authenticated}} table.table.table-striped thead tr th Name th Entity th th tbody | {{#followers}} | {{> _follower}} | {{/followers}} | {{/followers.length}} | {{^followers.length}} | {{#guest_authenticated}} h1.page-header <small><a href='{{domain_entity}}'>{{formatted.domain_entity}}</a></small> doesn't have any followers yet | {{/guest_authenticated}} | {{^guest_authenticated}} h1.page-header You don't have any Followers yet | {{/guest_authenticated}} | {{/followers.length}}
.row .span2 &nbsp; .span8 | {{#followers.length}} | {{#guest_authenticated}} h1.page-header Followers of <small><a href='{{domain_entity}}'>{{formatted.domain_entity}}</a></small> | {{/guest_authenticated}} | {{^guest_authenticated}} h1.page-header Your Followers | {{/guest_authenticated}} table.table.table-striped thead tr th Name th Entity th th tbody | {{#followers}} | {{> _follower}} | {{/followers}} | {{/followers.length}} | {{^followers.length}} + | {{#guest_authenticated}} + h1.page-header <small><a href='{{domain_entity}}'>{{formatted.domain_entity}}</a></small> doesn't have any followers yet + | {{/guest_authenticated}} + | {{^guest_authenticated}} h1.page-header You don't have any Followers yet + | {{/guest_authenticated}} | {{/followers.length}}
5
0.192308
5
0
681cab7adb625db09b6428d332ba1495ddb91693
src/lib/dts_instance.php
src/lib/dts_instance.php
<?php /** * Class definition for DTS_Instance. * * @package DTS * @author Eric Bollens * @copyright Copyright (c) 2012 UC Regents * @license BSD * @version 20120131 */ /** * A class that encapsulates the instance of DTS in js.php and passthru.php. * * @package DTS * @see /www/js.php * @see /www/passthru.php */ class DTS_Instance { public static function render() { $dts = new DTS(); $dts->add('capability.js'); $dts->add('browser.js'); $dts->add('useragent.js'); $dts->add('screen.js'); $dts->add('server.js'); $dts->add('server/screen.js'); $dts->add('server/useragent.js'); return $dts->render(); } }
<?php /** * Class definition for DTS_Instance. * * @package DTS * @author Eric Bollens * @copyright Copyright (c) 2012 UC Regents * @license BSD * @version 20120131 */ /** * A class that encapsulates the instance of DTS in js.php and passthru.php. * * @package DTS * @see /www/js.php * @see /www/passthru.php */ class DTS_Instance { public static function render() { $dts = new DTS(); $dts->add('capability.js'); $dts->add('classification.js'); $dts->add('browser.js'); $dts->add('useragent.js'); $dts->add('screen.js'); $dts->add('server.js'); $dts->add('server/screen.js'); $dts->add('server/useragent.js'); return $dts->render(); } }
Add classification to base instance object
Add classification to base instance object
PHP
bsd-2-clause
ebollens/dts,ebollens/dts
php
## Code Before: <?php /** * Class definition for DTS_Instance. * * @package DTS * @author Eric Bollens * @copyright Copyright (c) 2012 UC Regents * @license BSD * @version 20120131 */ /** * A class that encapsulates the instance of DTS in js.php and passthru.php. * * @package DTS * @see /www/js.php * @see /www/passthru.php */ class DTS_Instance { public static function render() { $dts = new DTS(); $dts->add('capability.js'); $dts->add('browser.js'); $dts->add('useragent.js'); $dts->add('screen.js'); $dts->add('server.js'); $dts->add('server/screen.js'); $dts->add('server/useragent.js'); return $dts->render(); } } ## Instruction: Add classification to base instance object ## Code After: <?php /** * Class definition for DTS_Instance. * * @package DTS * @author Eric Bollens * @copyright Copyright (c) 2012 UC Regents * @license BSD * @version 20120131 */ /** * A class that encapsulates the instance of DTS in js.php and passthru.php. * * @package DTS * @see /www/js.php * @see /www/passthru.php */ class DTS_Instance { public static function render() { $dts = new DTS(); $dts->add('capability.js'); $dts->add('classification.js'); $dts->add('browser.js'); $dts->add('useragent.js'); $dts->add('screen.js'); $dts->add('server.js'); $dts->add('server/screen.js'); $dts->add('server/useragent.js'); return $dts->render(); } }
<?php /** * Class definition for DTS_Instance. * * @package DTS * @author Eric Bollens * @copyright Copyright (c) 2012 UC Regents * @license BSD * @version 20120131 */ /** * A class that encapsulates the instance of DTS in js.php and passthru.php. * * @package DTS * @see /www/js.php * @see /www/passthru.php */ class DTS_Instance { public static function render() { $dts = new DTS(); $dts->add('capability.js'); + $dts->add('classification.js'); $dts->add('browser.js'); $dts->add('useragent.js'); $dts->add('screen.js'); $dts->add('server.js'); $dts->add('server/screen.js'); $dts->add('server/useragent.js'); return $dts->render(); } }
1
0.027778
1
0
3b00b0380b0cc5ec4b8e59ea99f9130ddd5b5266
app/views/dashboard/projects/_zero_authorized_projects.html.haml
app/views/dashboard/projects/_zero_authorized_projects.html.haml
- publicish_project_count = ProjectsFinder.new(current_user: current_user).execute.count .blank-state.blank-state-welcome %h2.blank-state-welcome-title Welcome to GitLab %p.blank-state-text Code, test, and deploy together - if current_user.can_create_group? .blank-state .blank-state-icon = custom_icon("group", size: 50) %h3.blank-state-title You can create a group for several dependent projects. %p.blank-state-text Groups are the best way to manage projects and members. = link_to new_group_path, class: "btn btn-new" do New group .blank-state .blank-state-icon = custom_icon("project", size: 50) %h3.blank-state-title You don't have access to any projects right now %p.blank-state-text - if current_user.can_create_project? You can create up to %strong= number_with_delimiter(current_user.projects_limit) = succeed "." do = "project".pluralize(current_user.projects_limit) - else If you are added to a project, it will be displayed here. - if current_user.can_create_project? = link_to new_project_path, class: "btn btn-new" do New project - if publicish_project_count > 0 .blank-state .blank-state-icon = icon("globe") %h3.blank-state-title There are = number_with_delimiter(publicish_project_count) public projects on this server. %p.blank-state-text Public projects are an easy way to allow everyone to have read-only access. = link_to trending_explore_projects_path, class: "btn btn-new" do Browse projects
.row.blank-state-parent-container .col-md-6.section-container .section-body.section-welcome .blank-state.blank-state-welcome %h2.blank-state-welcome-title Welcome to GitLab %p.blank-state-text Code, test, and deploy together - if current_user.admin? = render "blank_state_admin_welcome" - else = render "blank_state_welcome"
Move welcome pages to individual partials
Move welcome pages to individual partials
Haml
mit
jirutka/gitlabhq,stoplightio/gitlabhq,dreampet/gitlab,mmkassem/gitlabhq,t-zuehlsdorff/gitlabhq,jirutka/gitlabhq,axilleas/gitlabhq,axilleas/gitlabhq,t-zuehlsdorff/gitlabhq,iiet/iiet-git,stoplightio/gitlabhq,dplarson/gitlabhq,dplarson/gitlabhq,axilleas/gitlabhq,mmkassem/gitlabhq,t-zuehlsdorff/gitlabhq,dreampet/gitlab,stoplightio/gitlabhq,jirutka/gitlabhq,iiet/iiet-git,stoplightio/gitlabhq,iiet/iiet-git,jirutka/gitlabhq,dplarson/gitlabhq,axilleas/gitlabhq,iiet/iiet-git,mmkassem/gitlabhq,dplarson/gitlabhq,mmkassem/gitlabhq,dreampet/gitlab,dreampet/gitlab,t-zuehlsdorff/gitlabhq
haml
## Code Before: - publicish_project_count = ProjectsFinder.new(current_user: current_user).execute.count .blank-state.blank-state-welcome %h2.blank-state-welcome-title Welcome to GitLab %p.blank-state-text Code, test, and deploy together - if current_user.can_create_group? .blank-state .blank-state-icon = custom_icon("group", size: 50) %h3.blank-state-title You can create a group for several dependent projects. %p.blank-state-text Groups are the best way to manage projects and members. = link_to new_group_path, class: "btn btn-new" do New group .blank-state .blank-state-icon = custom_icon("project", size: 50) %h3.blank-state-title You don't have access to any projects right now %p.blank-state-text - if current_user.can_create_project? You can create up to %strong= number_with_delimiter(current_user.projects_limit) = succeed "." do = "project".pluralize(current_user.projects_limit) - else If you are added to a project, it will be displayed here. - if current_user.can_create_project? = link_to new_project_path, class: "btn btn-new" do New project - if publicish_project_count > 0 .blank-state .blank-state-icon = icon("globe") %h3.blank-state-title There are = number_with_delimiter(publicish_project_count) public projects on this server. %p.blank-state-text Public projects are an easy way to allow everyone to have read-only access. = link_to trending_explore_projects_path, class: "btn btn-new" do Browse projects ## Instruction: Move welcome pages to individual partials ## Code After: .row.blank-state-parent-container .col-md-6.section-container .section-body.section-welcome .blank-state.blank-state-welcome %h2.blank-state-welcome-title Welcome to GitLab %p.blank-state-text Code, test, and deploy together - if current_user.admin? = render "blank_state_admin_welcome" - else = render "blank_state_welcome"
- - publicish_project_count = ProjectsFinder.new(current_user: current_user).execute.count + .row.blank-state-parent-container + .col-md-6.section-container + .section-body.section-welcome - .blank-state.blank-state-welcome + .blank-state.blank-state-welcome ? ++++++ - %h2.blank-state-welcome-title + %h2.blank-state-welcome-title ? ++++++ - Welcome to GitLab + Welcome to GitLab ? ++++++ - %p.blank-state-text + %p.blank-state-text ? ++++++ - Code, test, and deploy together + Code, test, and deploy together ? ++++++ + - if current_user.admin? + = render "blank_state_admin_welcome" - - - if current_user.can_create_group? - .blank-state - .blank-state-icon - = custom_icon("group", size: 50) - %h3.blank-state-title - You can create a group for several dependent projects. - %p.blank-state-text - Groups are the best way to manage projects and members. - = link_to new_group_path, class: "btn btn-new" do - New group - - .blank-state - .blank-state-icon - = custom_icon("project", size: 50) - %h3.blank-state-title - You don't have access to any projects right now - %p.blank-state-text - - if current_user.can_create_project? - You can create up to - %strong= number_with_delimiter(current_user.projects_limit) - = succeed "." do - = "project".pluralize(current_user.projects_limit) - - else + - else ? ++ + = render "blank_state_welcome" - If you are added to a project, it will be displayed here. - - if current_user.can_create_project? - = link_to new_project_path, class: "btn btn-new" do - New project - - - if publicish_project_count > 0 - .blank-state - .blank-state-icon - = icon("globe") - %h3.blank-state-title - There are - = number_with_delimiter(publicish_project_count) - public projects on this server. - %p.blank-state-text - Public projects are an easy way to allow everyone to have read-only access. - = link_to trending_explore_projects_path, class: "btn btn-new" do - Browse projects
59
1.255319
12
47
0106d6e09d6847a255f6afd8f84cb30dce38b831
DEVELOPING.md
DEVELOPING.md
We use Yarn workspaces and Lerna to manage interdependencies between packages. To get set up, run this from the project root: ```bash yarn ``` # Deployment 1. Switch to `development` branch. 1. `yarn update-packages # Update package version numbers and adds tags and publish commit` 1. `git push --follow-tags # Push development and new tags` 1. Create a pull request to merge `development` into `master`. 1. Merge.
We use Yarn workspaces and Lerna to manage interdependencies between packages. To get set up, run this from the project root: ```bash yarn ``` # Testing ## Unit Tests Currently, to run Jest tests, run this from the project root: ```bash cd packages/storybook yarn test ``` ## Visual Regression Tests We use Gemini to ensure that changes do not break the visual presentation of components. We use Storybook to render an example of a component, then save a screenshot of the example to the repository. ```bash cd packages/storybook yarn gemini-update # Update snapshots yarn gemini # Check components against committed snapshots ``` # Deployment 1. Switch to `development` branch. 1. `yarn update-packages # Update package version numbers and adds tags and publish commit` 1. `git push --follow-tags # Push development and new tags` 1. Create a pull request to merge `development` into `master`. 1. Merge.
Add notes for how to run tests
docs: Add notes for how to run tests
Markdown
apache-2.0
Autodesk/hig,Autodesk/hig,Autodesk/hig
markdown
## Code Before: We use Yarn workspaces and Lerna to manage interdependencies between packages. To get set up, run this from the project root: ```bash yarn ``` # Deployment 1. Switch to `development` branch. 1. `yarn update-packages # Update package version numbers and adds tags and publish commit` 1. `git push --follow-tags # Push development and new tags` 1. Create a pull request to merge `development` into `master`. 1. Merge. ## Instruction: docs: Add notes for how to run tests ## Code After: We use Yarn workspaces and Lerna to manage interdependencies between packages. To get set up, run this from the project root: ```bash yarn ``` # Testing ## Unit Tests Currently, to run Jest tests, run this from the project root: ```bash cd packages/storybook yarn test ``` ## Visual Regression Tests We use Gemini to ensure that changes do not break the visual presentation of components. We use Storybook to render an example of a component, then save a screenshot of the example to the repository. ```bash cd packages/storybook yarn gemini-update # Update snapshots yarn gemini # Check components against committed snapshots ``` # Deployment 1. Switch to `development` branch. 1. `yarn update-packages # Update package version numbers and adds tags and publish commit` 1. `git push --follow-tags # Push development and new tags` 1. Create a pull request to merge `development` into `master`. 1. Merge.
We use Yarn workspaces and Lerna to manage interdependencies between packages. To get set up, run this from the project root: ```bash yarn + ``` + + # Testing + + ## Unit Tests + + Currently, to run Jest tests, run this from the project root: + + ```bash + cd packages/storybook + yarn test + ``` + + ## Visual Regression Tests + + We use Gemini to ensure that changes do not break the visual presentation of components. We use Storybook to render an example of a component, then save a screenshot of the example to the repository. + + ```bash + cd packages/storybook + yarn gemini-update # Update snapshots + yarn gemini # Check components against committed snapshots ``` # Deployment 1. Switch to `development` branch. 1. `yarn update-packages # Update package version numbers and adds tags and publish commit` 1. `git push --follow-tags # Push development and new tags` 1. Create a pull request to merge `development` into `master`. 1. Merge.
21
1.5
21
0
a4025d196b9f6c67039e09449325ec39e4ce79e5
app/models/carnival/query_form.rb
app/models/carnival/query_form.rb
module Carnival class QueryForm attr_accessor :scope, :search_term, :date_period_label, :date_period_from, :date_period_to, :sort_column, :sort_direction, :page, :advanced_search def initialize(params) @scope = params[:scope] @search_term = params[:search_term] @date_period_label = params[:date_period_label] @date_period_from = params[:date_period_from] @date_period_to = params[:date_period_to] @sort_column = params[:sort_column] @sort_direction = params[:sort_direction] @advanced_search = params[:advanced_search] || {} @page = (params[:page] || 1).to_i end def to_hash { 'scope' => scope, 'search_term' => search_term, 'date_period_label' => date_period_label, 'date_period_from' => date_period_from, 'date_period_to' => date_period_to, 'sort_column' => sort_column, 'sort_direction' => sort_direction, 'advanced_search' => advanced_search, 'page' => page } end end end
module Carnival class QueryForm attr_accessor :scope, :search_term, :date_period_label, :date_period_from, :date_period_to, :sort_column, :sort_direction, :page, :advanced_search def initialize(params) @scope = params[:scope] @search_term = params[:search_term] @date_period_label = params[:date_period_label] @date_period_from = params[:date_period_from] @date_period_to = params[:date_period_to] @sort_column = params[:sort_column] @sort_direction = params[:sort_direction] @advanced_search = params[:advanced_search].try(:to_unsafe_h) || params[:advanced_search].try(:to_h) || {} @page = (params[:page] || 1).to_i end def to_hash { 'scope' => scope, 'search_term' => search_term, 'date_period_label' => date_period_label, 'date_period_from' => date_period_from, 'date_period_to' => date_period_to, 'sort_column' => sort_column, 'sort_direction' => sort_direction, 'advanced_search' => advanced_search, 'page' => page } end end end
Fix csv download in rails 5
Fix csv download in rails 5
Ruby
mit
dsakuma/carnival,dsakuma/carnival,cartolari/carnival,cartolari/carnival,cartolari/carnival,dsakuma/carnival,cartolari/carnival,cartolari/carnival,dsakuma/carnival,dsakuma/carnival
ruby
## Code Before: module Carnival class QueryForm attr_accessor :scope, :search_term, :date_period_label, :date_period_from, :date_period_to, :sort_column, :sort_direction, :page, :advanced_search def initialize(params) @scope = params[:scope] @search_term = params[:search_term] @date_period_label = params[:date_period_label] @date_period_from = params[:date_period_from] @date_period_to = params[:date_period_to] @sort_column = params[:sort_column] @sort_direction = params[:sort_direction] @advanced_search = params[:advanced_search] || {} @page = (params[:page] || 1).to_i end def to_hash { 'scope' => scope, 'search_term' => search_term, 'date_period_label' => date_period_label, 'date_period_from' => date_period_from, 'date_period_to' => date_period_to, 'sort_column' => sort_column, 'sort_direction' => sort_direction, 'advanced_search' => advanced_search, 'page' => page } end end end ## Instruction: Fix csv download in rails 5 ## Code After: module Carnival class QueryForm attr_accessor :scope, :search_term, :date_period_label, :date_period_from, :date_period_to, :sort_column, :sort_direction, :page, :advanced_search def initialize(params) @scope = params[:scope] @search_term = params[:search_term] @date_period_label = params[:date_period_label] @date_period_from = params[:date_period_from] @date_period_to = params[:date_period_to] @sort_column = params[:sort_column] @sort_direction = params[:sort_direction] @advanced_search = params[:advanced_search].try(:to_unsafe_h) || params[:advanced_search].try(:to_h) || {} @page = (params[:page] || 1).to_i end def to_hash { 'scope' => scope, 'search_term' => search_term, 'date_period_label' => date_period_label, 'date_period_from' => date_period_from, 'date_period_to' => date_period_to, 'sort_column' => sort_column, 'sort_direction' => sort_direction, 'advanced_search' => advanced_search, 'page' => page } end end end
module Carnival class QueryForm attr_accessor :scope, :search_term, :date_period_label, :date_period_from, :date_period_to, :sort_column, :sort_direction, :page, :advanced_search def initialize(params) @scope = params[:scope] @search_term = params[:search_term] @date_period_label = params[:date_period_label] @date_period_from = params[:date_period_from] @date_period_to = params[:date_period_to] @sort_column = params[:sort_column] @sort_direction = params[:sort_direction] - @advanced_search = params[:advanced_search] || {} + @advanced_search = + params[:advanced_search].try(:to_unsafe_h) || + params[:advanced_search].try(:to_h) || + {} @page = (params[:page] || 1).to_i end def to_hash { 'scope' => scope, 'search_term' => search_term, 'date_period_label' => date_period_label, 'date_period_from' => date_period_from, 'date_period_to' => date_period_to, 'sort_column' => sort_column, 'sort_direction' => sort_direction, 'advanced_search' => advanced_search, 'page' => page } end end end
5
0.147059
4
1
a6ad0af08e408adbb4b25684b18feb8aee12cf3e
spec/functions/concat_spec.rb
spec/functions/concat_spec.rb
require 'spec_helper' describe "the concat function" do let(:scope) { PuppetlabsSpec::PuppetInternals.scope } it "should raise a ParseError if the client does not provide two arguments" do expect { scope.function_concat([]) }.to(raise_error(Puppet::ParseError)) end it "should raise a ParseError if the first parameter is not an array" do expect { scope.function_concat([1, []])}.to(raise_error(Puppet::ParseError)) end it "should be able to concat an array" do result = scope.function_concat([['1','2','3'],['4','5','6']]) expect(result).to(eq(['1','2','3','4','5','6'])) end it "should be able to concat a primitive to an array" do result = scope.function_concat([['1','2','3'],'4']) expect(result).to(eq(['1','2','3','4'])) end it "should not accidentally flatten nested arrays" do result = scope.function_concat([['1','2','3'],[['4','5'],'6']]) expect(result).to(eq(['1','2','3',['4','5'],'6'])) end end
require 'spec_helper' describe "the concat function" do let(:scope) { PuppetlabsSpec::PuppetInternals.scope } it "should raise a ParseError if the client does not provide two arguments" do expect { scope.function_concat([]) }.to(raise_error(Puppet::ParseError)) end it "should raise a ParseError if the first parameter is not an array" do expect { scope.function_concat([1, []])}.to(raise_error(Puppet::ParseError)) end it "should be able to concat an array" do result = scope.function_concat([['1','2','3'],['4','5','6']]) expect(result).to(eq(['1','2','3','4','5','6'])) end it "should be able to concat a primitive to an array" do result = scope.function_concat([['1','2','3'],'4']) expect(result).to(eq(['1','2','3','4'])) end it "should not accidentally flatten nested arrays" do result = scope.function_concat([['1','2','3'],[['4','5'],'6']]) expect(result).to(eq(['1','2','3',['4','5'],'6'])) end it "should leave the original array intact" do array_original = ['1','2','3'] result = scope.function_concat([array_original,['4','5','6']]) array_original.should(eq(['1','2','3'])) end end
Introduce test for array destruction
Introduce test for array destruction It was discovered that the concat array modifies the arrays passed to it as an argument as a side effect. This test will ensure that doesn't happen again.
Ruby
apache-2.0
fuel-infra/puppetlabs-stdlib,DavidS/puppetlabs-stdlib,puppetlabs/puppetlabs-stdlib,jbondpdx/puppetlabs-stdlib,yadavnikhil/puppetlabs-stdlib,HelenCampbell/puppetlabs-stdlib
ruby
## Code Before: require 'spec_helper' describe "the concat function" do let(:scope) { PuppetlabsSpec::PuppetInternals.scope } it "should raise a ParseError if the client does not provide two arguments" do expect { scope.function_concat([]) }.to(raise_error(Puppet::ParseError)) end it "should raise a ParseError if the first parameter is not an array" do expect { scope.function_concat([1, []])}.to(raise_error(Puppet::ParseError)) end it "should be able to concat an array" do result = scope.function_concat([['1','2','3'],['4','5','6']]) expect(result).to(eq(['1','2','3','4','5','6'])) end it "should be able to concat a primitive to an array" do result = scope.function_concat([['1','2','3'],'4']) expect(result).to(eq(['1','2','3','4'])) end it "should not accidentally flatten nested arrays" do result = scope.function_concat([['1','2','3'],[['4','5'],'6']]) expect(result).to(eq(['1','2','3',['4','5'],'6'])) end end ## Instruction: Introduce test for array destruction It was discovered that the concat array modifies the arrays passed to it as an argument as a side effect. This test will ensure that doesn't happen again. ## Code After: require 'spec_helper' describe "the concat function" do let(:scope) { PuppetlabsSpec::PuppetInternals.scope } it "should raise a ParseError if the client does not provide two arguments" do expect { scope.function_concat([]) }.to(raise_error(Puppet::ParseError)) end it "should raise a ParseError if the first parameter is not an array" do expect { scope.function_concat([1, []])}.to(raise_error(Puppet::ParseError)) end it "should be able to concat an array" do result = scope.function_concat([['1','2','3'],['4','5','6']]) expect(result).to(eq(['1','2','3','4','5','6'])) end it "should be able to concat a primitive to an array" do result = scope.function_concat([['1','2','3'],'4']) expect(result).to(eq(['1','2','3','4'])) end it "should not accidentally flatten nested arrays" do result = scope.function_concat([['1','2','3'],[['4','5'],'6']]) expect(result).to(eq(['1','2','3',['4','5'],'6'])) end it "should leave the original array intact" do array_original = ['1','2','3'] result = scope.function_concat([array_original,['4','5','6']]) array_original.should(eq(['1','2','3'])) end end
require 'spec_helper' describe "the concat function" do let(:scope) { PuppetlabsSpec::PuppetInternals.scope } it "should raise a ParseError if the client does not provide two arguments" do expect { scope.function_concat([]) }.to(raise_error(Puppet::ParseError)) end it "should raise a ParseError if the first parameter is not an array" do expect { scope.function_concat([1, []])}.to(raise_error(Puppet::ParseError)) end it "should be able to concat an array" do result = scope.function_concat([['1','2','3'],['4','5','6']]) expect(result).to(eq(['1','2','3','4','5','6'])) end it "should be able to concat a primitive to an array" do result = scope.function_concat([['1','2','3'],'4']) expect(result).to(eq(['1','2','3','4'])) end it "should not accidentally flatten nested arrays" do result = scope.function_concat([['1','2','3'],[['4','5'],'6']]) expect(result).to(eq(['1','2','3',['4','5'],'6'])) end + it "should leave the original array intact" do + array_original = ['1','2','3'] + result = scope.function_concat([array_original,['4','5','6']]) + array_original.should(eq(['1','2','3'])) + end end
5
0.172414
5
0
94172dc29d9ccbce1c2ac752ce09baefafbf8a6c
nbgrader/tests/apps/test_nbgrader.py
nbgrader/tests/apps/test_nbgrader.py
import os from .. import run_python_module, run_command from .base import BaseTestApp class TestNbGrader(BaseTestApp): def test_help(self): """Does the help display without error?""" run_python_module(["nbgrader", "--help-all"]) def test_no_subapp(self): """Is the help displayed when no subapp is given?""" run_python_module(["nbgrader"], retcode=1) def test_generate_config(self): """Is the config file properly generated?""" # it already exists, because we create it in conftest.py os.remove("nbgrader_config.py") # try recreating it run_python_module(["nbgrader", "--generate-config"]) assert os.path.isfile("nbgrader_config.py") # does it fail if it already exists? run_python_module(["nbgrader", "--generate-config"], retcode=1) def test_check_version(self): """Is the version the same regardless of how we run nbgrader?""" out1 = run_command(["nbgrader", "--version"]) out2 = run_python_module(["nbgrader", "--version"]) assert out1 == out2
import os import sys from .. import run_python_module, run_command from .base import BaseTestApp class TestNbGrader(BaseTestApp): def test_help(self): """Does the help display without error?""" run_python_module(["nbgrader", "--help-all"]) def test_no_subapp(self): """Is the help displayed when no subapp is given?""" run_python_module(["nbgrader"], retcode=1) def test_generate_config(self): """Is the config file properly generated?""" # it already exists, because we create it in conftest.py os.remove("nbgrader_config.py") # try recreating it run_python_module(["nbgrader", "--generate-config"]) assert os.path.isfile("nbgrader_config.py") # does it fail if it already exists? run_python_module(["nbgrader", "--generate-config"], retcode=1) def test_check_version(self): """Is the version the same regardless of how we run nbgrader?""" if sys.platform == 'win32': out1 = "\r\n".join(run_command(["nbgrader.cmd", "--version"]).split("\r\n")[2:]) else: out1 = run_command(["nbgrader", "--version"]) out2 = run_python_module(["nbgrader", "--version"]) assert out1 == out2
Fix issue with how nbgrader is called
Fix issue with how nbgrader is called
Python
bsd-3-clause
jhamrick/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,ellisonbg/nbgrader,EdwardJKim/nbgrader,jupyter/nbgrader,jupyter/nbgrader,EdwardJKim/nbgrader,ellisonbg/nbgrader,jhamrick/nbgrader,ellisonbg/nbgrader,jupyter/nbgrader,EdwardJKim/nbgrader,ellisonbg/nbgrader,jhamrick/nbgrader,EdwardJKim/nbgrader,jupyter/nbgrader
python
## Code Before: import os from .. import run_python_module, run_command from .base import BaseTestApp class TestNbGrader(BaseTestApp): def test_help(self): """Does the help display without error?""" run_python_module(["nbgrader", "--help-all"]) def test_no_subapp(self): """Is the help displayed when no subapp is given?""" run_python_module(["nbgrader"], retcode=1) def test_generate_config(self): """Is the config file properly generated?""" # it already exists, because we create it in conftest.py os.remove("nbgrader_config.py") # try recreating it run_python_module(["nbgrader", "--generate-config"]) assert os.path.isfile("nbgrader_config.py") # does it fail if it already exists? run_python_module(["nbgrader", "--generate-config"], retcode=1) def test_check_version(self): """Is the version the same regardless of how we run nbgrader?""" out1 = run_command(["nbgrader", "--version"]) out2 = run_python_module(["nbgrader", "--version"]) assert out1 == out2 ## Instruction: Fix issue with how nbgrader is called ## Code After: import os import sys from .. import run_python_module, run_command from .base import BaseTestApp class TestNbGrader(BaseTestApp): def test_help(self): """Does the help display without error?""" run_python_module(["nbgrader", "--help-all"]) def test_no_subapp(self): """Is the help displayed when no subapp is given?""" run_python_module(["nbgrader"], retcode=1) def test_generate_config(self): """Is the config file properly generated?""" # it already exists, because we create it in conftest.py os.remove("nbgrader_config.py") # try recreating it run_python_module(["nbgrader", "--generate-config"]) assert os.path.isfile("nbgrader_config.py") # does it fail if it already exists? run_python_module(["nbgrader", "--generate-config"], retcode=1) def test_check_version(self): """Is the version the same regardless of how we run nbgrader?""" if sys.platform == 'win32': out1 = "\r\n".join(run_command(["nbgrader.cmd", "--version"]).split("\r\n")[2:]) else: out1 = run_command(["nbgrader", "--version"]) out2 = run_python_module(["nbgrader", "--version"]) assert out1 == out2
import os + import sys from .. import run_python_module, run_command from .base import BaseTestApp class TestNbGrader(BaseTestApp): def test_help(self): """Does the help display without error?""" run_python_module(["nbgrader", "--help-all"]) def test_no_subapp(self): """Is the help displayed when no subapp is given?""" run_python_module(["nbgrader"], retcode=1) def test_generate_config(self): """Is the config file properly generated?""" # it already exists, because we create it in conftest.py os.remove("nbgrader_config.py") # try recreating it run_python_module(["nbgrader", "--generate-config"]) assert os.path.isfile("nbgrader_config.py") # does it fail if it already exists? run_python_module(["nbgrader", "--generate-config"], retcode=1) def test_check_version(self): """Is the version the same regardless of how we run nbgrader?""" + if sys.platform == 'win32': + out1 = "\r\n".join(run_command(["nbgrader.cmd", "--version"]).split("\r\n")[2:]) + else: - out1 = run_command(["nbgrader", "--version"]) + out1 = run_command(["nbgrader", "--version"]) ? ++++ out2 = run_python_module(["nbgrader", "--version"]) assert out1 == out2
6
0.176471
5
1
0a3fb4c0ac06e47df3800ace7822675c3bbf74da
bin/elementExplorerClient.js
bin/elementExplorerClient.js
var net = require('net'); var EventEmitter = require('events').EventEmitter; var q = require('q'); /** * * @constructor */ var ElementExplorerClient = function() { this.client_ = null; this.eventEmitter_ = new EventEmitter(); this.connect_(); }; ElementExplorerClient.prototype.connect_ = function() { var eventEmitter = this.eventEmitter_; var client = net.connect({port: 6969}, function() { //'connect' listener console.log('Connected to protractor'); }); client.on('data', function(data) { console.log('Got data from net', data.toString()); eventEmitter.emit('ptorResponse', data.toString()); }); client.on('end', function() { console.log('disconnected from server'); }); this.client_ = client; }; ElementExplorerClient.prototype.runCommand = function(cmd) { var deferred = q.defer(); this.eventEmitter_.once('ptorResponse', function(response) { console.log('Got response from event'); deferred.resolve(response); }); this.client_.write(cmd); return deferred.promise; }; ElementExplorerClient.prototype.getSuggestions = function() { }; module.exports = ElementExplorerClient;
var net = require('net'); var q = require('q'); var runCommand = function(cmd) { var deferred = q.defer(); // Terminate with ENTER. cmd= "browser.get('http://angular.github.io/protractor/#/');\r\n"; //cmd += '\r\n'; var client = net.connect({port: 6969}, function() { console.log('Connected. Sending command:', cmd); client.write(cmd); }); client.on('data', function(data) { //client.end(); deferred.resolve(data.toString()); }); return deferred.promise; }; var getSuggestions = function() { }; module.exports = { runCommand: runCommand };
Migrate from class to function
Migrate from class to function
JavaScript
mit
andresdominguez/elementor,andresdominguez/elementor
javascript
## Code Before: var net = require('net'); var EventEmitter = require('events').EventEmitter; var q = require('q'); /** * * @constructor */ var ElementExplorerClient = function() { this.client_ = null; this.eventEmitter_ = new EventEmitter(); this.connect_(); }; ElementExplorerClient.prototype.connect_ = function() { var eventEmitter = this.eventEmitter_; var client = net.connect({port: 6969}, function() { //'connect' listener console.log('Connected to protractor'); }); client.on('data', function(data) { console.log('Got data from net', data.toString()); eventEmitter.emit('ptorResponse', data.toString()); }); client.on('end', function() { console.log('disconnected from server'); }); this.client_ = client; }; ElementExplorerClient.prototype.runCommand = function(cmd) { var deferred = q.defer(); this.eventEmitter_.once('ptorResponse', function(response) { console.log('Got response from event'); deferred.resolve(response); }); this.client_.write(cmd); return deferred.promise; }; ElementExplorerClient.prototype.getSuggestions = function() { }; module.exports = ElementExplorerClient; ## Instruction: Migrate from class to function ## Code After: var net = require('net'); var q = require('q'); var runCommand = function(cmd) { var deferred = q.defer(); // Terminate with ENTER. cmd= "browser.get('http://angular.github.io/protractor/#/');\r\n"; //cmd += '\r\n'; var client = net.connect({port: 6969}, function() { console.log('Connected. Sending command:', cmd); client.write(cmd); }); client.on('data', function(data) { //client.end(); deferred.resolve(data.toString()); }); return deferred.promise; }; var getSuggestions = function() { }; module.exports = { runCommand: runCommand };
var net = require('net'); - var EventEmitter = require('events').EventEmitter; var q = require('q'); + var runCommand = function(cmd) { + var deferred = q.defer(); - /** - * - * @constructor - */ - var ElementExplorerClient = function() { - this.client_ = null; - this.eventEmitter_ = new EventEmitter(); - this.connect_(); - }; + // Terminate with ENTER. + cmd= "browser.get('http://angular.github.io/protractor/#/');\r\n"; + //cmd += '\r\n'; - ElementExplorerClient.prototype.connect_ = function() { - var eventEmitter = this.eventEmitter_; - var client = net.connect({port: 6969}, function() { //'connect' listener ? --------------------- + var client = net.connect({port: 6969}, function() { - console.log('Connected to protractor'); + console.log('Connected. Sending command:', cmd); + client.write(cmd); }); client.on('data', function(data) { - console.log('Got data from net', data.toString()); - eventEmitter.emit('ptorResponse', data.toString()); + //client.end(); + deferred.resolve(data.toString()); }); - client.on('end', function() { - console.log('disconnected from server'); - }); - - this.client_ = client; - }; - - ElementExplorerClient.prototype.runCommand = function(cmd) { - var deferred = q.defer(); - - this.eventEmitter_.once('ptorResponse', function(response) { - console.log('Got response from event'); - deferred.resolve(response); - }); - - this.client_.write(cmd); return deferred.promise; }; - ElementExplorerClient.prototype.getSuggestions = function() { + var getSuggestions = function() { }; - module.exports = ElementExplorerClient; + module.exports = { + runCommand: runCommand + };
48
0.96
14
34
6c376933137540938bd869be1dd27ac039108704
app/routes/movie.js
app/routes/movie.js
import Ember from 'ember'; export default Ember.Route.extend({ model(params) { return Ember.RSVP.hash({ movie: Ember.$.getJSON("https://api.themoviedb.org/3/movie/" + params.movie_id+ "?api_key=0910db5745f86638474ffefa5d3ba687"), userRating: this.get('firebaseUtil').findRecord(params.movie_id, 'users/8V63eXOsjJhe9oAscvaLw1avxFH3/ratings/' + params.movie_id).catch(error => { //error alert(error); }) }); } });
import Ember from 'ember'; export default Ember.Route.extend({ model(params) { return Ember.RSVP.hash({ movie: Ember.$.getJSON("https://api.themoviedb.org/3/movie/" + params.movie_id+ "?api_key=0910db5745f86638474ffefa5d3ba687"), userRating: this.get('firebaseUtil').findRecord(params.movie_id, 'users/' + this.get('session.currentUser.uid') + '/ratings/' + params.movie_id).catch(error => { //error alert(error); }) }); } });
Fix initial user rating display
Fix initial user rating display
JavaScript
mit
JaxonWright/CineR8,JaxonWright/CineR8
javascript
## Code Before: import Ember from 'ember'; export default Ember.Route.extend({ model(params) { return Ember.RSVP.hash({ movie: Ember.$.getJSON("https://api.themoviedb.org/3/movie/" + params.movie_id+ "?api_key=0910db5745f86638474ffefa5d3ba687"), userRating: this.get('firebaseUtil').findRecord(params.movie_id, 'users/8V63eXOsjJhe9oAscvaLw1avxFH3/ratings/' + params.movie_id).catch(error => { //error alert(error); }) }); } }); ## Instruction: Fix initial user rating display ## Code After: import Ember from 'ember'; export default Ember.Route.extend({ model(params) { return Ember.RSVP.hash({ movie: Ember.$.getJSON("https://api.themoviedb.org/3/movie/" + params.movie_id+ "?api_key=0910db5745f86638474ffefa5d3ba687"), userRating: this.get('firebaseUtil').findRecord(params.movie_id, 'users/' + this.get('session.currentUser.uid') + '/ratings/' + params.movie_id).catch(error => { //error alert(error); }) }); } });
import Ember from 'ember'; export default Ember.Route.extend({ model(params) { return Ember.RSVP.hash({ movie: Ember.$.getJSON("https://api.themoviedb.org/3/movie/" + params.movie_id+ "?api_key=0910db5745f86638474ffefa5d3ba687"), - userRating: this.get('firebaseUtil').findRecord(params.movie_id, 'users/8V63eXOsjJhe9oAscvaLw1avxFH3/ratings/' + params.movie_id).catch(error => { ? ^^^^ ^^ --- ^ ^ ^^^^^^^^^^^^ + userRating: this.get('firebaseUtil').findRecord(params.movie_id, 'users/' + this.get('session.currentUser.uid') + '/ratings/' + params.movie_id).catch(error => { ? ^^^^^^^^^^ ^^^ ^^^ ^^^^^^^^^^ ^^^^^^^^^^^^ //error alert(error); }) }); } });
2
0.153846
1
1
8ba698063641baeb888855d5babdee43492a5866
lib/travis/listener.rb
lib/travis/listener.rb
require 'travis/support' require 'travis/listener/config' require 'travis/listener/app' require 'logger' require 'metriks' require 'metriks/reporter/logger' $stdout.sync = true module Travis class << self def config @config ||= Config.new end end module Listener class << self def setup Travis::Amqp.config = Travis.config.amqp if ENV['RACK_ENV'] == "production" puts 'Starting reporter' $metriks_reporter = Metriks::Reporter::Logger.new(:logger => Logger.new($stdout)) end end def connect(amqp = false) Travis::Amqp.connect if amqp end def disconnect # empty for now end end end end
require 'travis/support' require 'travis/listener/config' require 'travis/listener/app' require 'logger' require 'metriks' require 'metriks/reporter/logger' $stdout.sync = true module Travis class << self def config @config ||= Config.new end end module Listener class << self def setup Travis::Amqp.config = Travis.config.amqp if ENV['RACK_ENV'] == "production" puts 'Starting reporter' formatter = lambda do |severity, date, progname, message| message end logger = Logger.new($stdout) logger.formatter = formatter $metriks_reporter = Metriks::Reporter::Logger.new(:logger => logger) end end def connect(amqp = false) Travis::Amqp.connect if amqp end def disconnect # empty for now end end end end
Add simple formatter for metrics logger.
Add simple formatter for metrics logger.
Ruby
mit
final-ci/travis-listener,travis-ci/travis-listener
ruby
## Code Before: require 'travis/support' require 'travis/listener/config' require 'travis/listener/app' require 'logger' require 'metriks' require 'metriks/reporter/logger' $stdout.sync = true module Travis class << self def config @config ||= Config.new end end module Listener class << self def setup Travis::Amqp.config = Travis.config.amqp if ENV['RACK_ENV'] == "production" puts 'Starting reporter' $metriks_reporter = Metriks::Reporter::Logger.new(:logger => Logger.new($stdout)) end end def connect(amqp = false) Travis::Amqp.connect if amqp end def disconnect # empty for now end end end end ## Instruction: Add simple formatter for metrics logger. ## Code After: require 'travis/support' require 'travis/listener/config' require 'travis/listener/app' require 'logger' require 'metriks' require 'metriks/reporter/logger' $stdout.sync = true module Travis class << self def config @config ||= Config.new end end module Listener class << self def setup Travis::Amqp.config = Travis.config.amqp if ENV['RACK_ENV'] == "production" puts 'Starting reporter' formatter = lambda do |severity, date, progname, message| message end logger = Logger.new($stdout) logger.formatter = formatter $metriks_reporter = Metriks::Reporter::Logger.new(:logger => logger) end end def connect(amqp = false) Travis::Amqp.connect if amqp end def disconnect # empty for now end end end end
require 'travis/support' require 'travis/listener/config' require 'travis/listener/app' require 'logger' require 'metriks' require 'metriks/reporter/logger' $stdout.sync = true module Travis class << self def config @config ||= Config.new end end module Listener class << self def setup Travis::Amqp.config = Travis.config.amqp if ENV['RACK_ENV'] == "production" puts 'Starting reporter' + formatter = lambda do |severity, date, progname, message| + message + end + logger = Logger.new($stdout) + logger.formatter = formatter - $metriks_reporter = Metriks::Reporter::Logger.new(:logger => Logger.new($stdout)) ? ^ ------------ - + $metriks_reporter = Metriks::Reporter::Logger.new(:logger => logger) ? ^ end end def connect(amqp = false) Travis::Amqp.connect if amqp end def disconnect # empty for now end end end end
7
0.189189
6
1
4f4e47a8da3a9ab564fe7d9c7e3e52234734eaed
src/App.js
src/App.js
'use strict'; import React, { AppRegistry, Component, StyleSheet, } from 'react-native'; import WeatherView from './WeatherView'; class ReactNativeWeather extends Component { render() { return ( <WeatherView /> ); } } const styles = StyleSheet.create({ container: { flex: 1, }, }); export default ReactNativeWeather;
'use strict'; import React, { AppRegistry, Component, StyleSheet, } from 'react-native'; import WeatherView from './WeatherView'; class ReactNativeWeather extends Component { render() { return ( <WeatherView /> ); } }; export default ReactNativeWeather;
Remove unnecessary styles in app.js
Remove unnecessary styles in app.js
JavaScript
mit
JakeLin/ReactNativeWeather,JakeLin/ReactNativeWeather,viruschidai/ReactNativeWeather,viruschidai/ReactNativeWeather,viruschidai/ReactNativeWeather
javascript
## Code Before: 'use strict'; import React, { AppRegistry, Component, StyleSheet, } from 'react-native'; import WeatherView from './WeatherView'; class ReactNativeWeather extends Component { render() { return ( <WeatherView /> ); } } const styles = StyleSheet.create({ container: { flex: 1, }, }); export default ReactNativeWeather; ## Instruction: Remove unnecessary styles in app.js ## Code After: 'use strict'; import React, { AppRegistry, Component, StyleSheet, } from 'react-native'; import WeatherView from './WeatherView'; class ReactNativeWeather extends Component { render() { return ( <WeatherView /> ); } }; export default ReactNativeWeather;
'use strict'; import React, { AppRegistry, Component, StyleSheet, } from 'react-native'; import WeatherView from './WeatherView'; class ReactNativeWeather extends Component { render() { return ( <WeatherView /> ); } - } - - const styles = StyleSheet.create({ - container: { - flex: 1, - }, - }); ? - + }; export default ReactNativeWeather;
8
0.32
1
7
da3f83c7c207cbfb181b4b855e424b64ce1ec94a
lib/pry/default_commands/input.rb
lib/pry/default_commands/input.rb
class Pry module DefaultCommands Input = Pry::CommandSet.new :input do command "!", "Clear the input buffer. Useful if the parsing process goes wrong and you get stuck in the read loop." do output.puts "Input buffer cleared!" opts[:eval_string].clear end command "hist", "Show and replay Readline history. Type `hist --help` for more info." do |*args| hist_array = Readline::HISTORY.to_a if args.empty? text = add_line_numbers(hist_array.join("\n"), 0) stagger_output(text) next end opts = Slop.parse(args) do |opt| opt.banner "Usage: hist [--replay START..END]\nView and replay history\ne.g hist --replay 2..8" opt.on :r, :replay, 'The line (or range of lines) to replay.', true, :as => Range opt.on :h, :help, 'Show this message.', :tail => true do output.puts opt.help end end next if opts.h? actions = Array(hist_array[opts[:replay]]).join("\n") + "\n" Pry.active_instance.input = StringIO.new(actions) end end end end
class Pry module DefaultCommands Input = Pry::CommandSet.new :input do command "!", "Clear the input buffer. Useful if the parsing process goes wrong and you get stuck in the read loop." do output.puts "Input buffer cleared!" opts[:eval_string].clear end command "hist", "Show and replay Readline history. Type `hist --help` for more info." do |*args| history = Readline::HISTORY.to_a if args.empty? text = add_line_numbers history.join("\n"), 0 stagger_output text next end Slop.parse(args) do |opt| opt.banner "Usage: hist [--replay START..END]\n" \ "View and replay history\n" \ "e.g hist --replay 2..8" opt.on :r, :replay, 'The line (or range of lines) to replay.', true, :as => Range do |range| actions = history[range].join("\n") + "\n" Pry.active_instance.input = StringIO.new(actions) end opt.on :h, :help, 'Show this message.', :tail => true do output.puts opt.help end end end end end end
Clean up the "hist" command.
Clean up the "hist" command.
Ruby
mit
nju520/pry,caporta/pry,jasnow/pry,shockone/pry,shockone/pry,tdg5/pry,ngpestelos/pry,jasonm23/pry,scalixte-mdsol/pry,jasnow/pry,caporta/pry,raeno/pry,icebreaker/pry,nju520/pry,bronzdoc/pry,pvdb/pry,85x14/pry,raeno/pry,sideci-sample/sideci-sample-pry,scalixte-mdsol/pry,jasonm23/pry,geoffreylitt/pry,ooohiroyukiooo/pry,richo/pry,josue804/debunker,deivid-rodriguez/pry,geoffreylitt/pry,85x14/pry,85x14/pry,jasonm23/pry,raeno/pry,jasnow/pry,caporta/pry,tdg5/pry,nju520/pry,printercu/pry,ooohiroyukiooo/pry,scalixte-mdsol/pry,shockone/pry,ngpestelos/pry,gfvcastro/pry,sferik/pry,printercu/pry,sferik/pry,josue804/debunker,ooohiroyukiooo/pry,bronzdoc/pry,pvdb/pry,icebreaker/pry,gfvcastro/pry,tdg5/pry
ruby
## Code Before: class Pry module DefaultCommands Input = Pry::CommandSet.new :input do command "!", "Clear the input buffer. Useful if the parsing process goes wrong and you get stuck in the read loop." do output.puts "Input buffer cleared!" opts[:eval_string].clear end command "hist", "Show and replay Readline history. Type `hist --help` for more info." do |*args| hist_array = Readline::HISTORY.to_a if args.empty? text = add_line_numbers(hist_array.join("\n"), 0) stagger_output(text) next end opts = Slop.parse(args) do |opt| opt.banner "Usage: hist [--replay START..END]\nView and replay history\ne.g hist --replay 2..8" opt.on :r, :replay, 'The line (or range of lines) to replay.', true, :as => Range opt.on :h, :help, 'Show this message.', :tail => true do output.puts opt.help end end next if opts.h? actions = Array(hist_array[opts[:replay]]).join("\n") + "\n" Pry.active_instance.input = StringIO.new(actions) end end end end ## Instruction: Clean up the "hist" command. ## Code After: class Pry module DefaultCommands Input = Pry::CommandSet.new :input do command "!", "Clear the input buffer. Useful if the parsing process goes wrong and you get stuck in the read loop." do output.puts "Input buffer cleared!" opts[:eval_string].clear end command "hist", "Show and replay Readline history. Type `hist --help` for more info." do |*args| history = Readline::HISTORY.to_a if args.empty? text = add_line_numbers history.join("\n"), 0 stagger_output text next end Slop.parse(args) do |opt| opt.banner "Usage: hist [--replay START..END]\n" \ "View and replay history\n" \ "e.g hist --replay 2..8" opt.on :r, :replay, 'The line (or range of lines) to replay.', true, :as => Range do |range| actions = history[range].join("\n") + "\n" Pry.active_instance.input = StringIO.new(actions) end opt.on :h, :help, 'Show this message.', :tail => true do output.puts opt.help end end end end end end
class Pry module DefaultCommands Input = Pry::CommandSet.new :input do command "!", "Clear the input buffer. Useful if the parsing process goes wrong and you get stuck in the read loop." do output.puts "Input buffer cleared!" opts[:eval_string].clear end command "hist", "Show and replay Readline history. Type `hist --help` for more info." do |*args| - hist_array = Readline::HISTORY.to_a ? ^^ -- + history = Readline::HISTORY.to_a ? ^ if args.empty? - text = add_line_numbers(hist_array.join("\n"), 0) ? ^ ^^ -- - + text = add_line_numbers history.join("\n"), 0 ? ^ ^ - stagger_output(text) ? ^ - + stagger_output text ? ^ next end - opts = Slop.parse(args) do |opt| ? ------- + Slop.parse(args) do |opt| - opt.banner "Usage: hist [--replay START..END]\nView and replay history\ne.g hist --replay 2..8" + opt.banner "Usage: hist [--replay START..END]\n" \ + "View and replay history\n" \ + "e.g hist --replay 2..8" + - opt.on :r, :replay, 'The line (or range of lines) to replay.', true, :as => Range + opt.on :r, :replay, 'The line (or range of lines) to replay.', true, :as => Range do |range| ? +++++++++++ + actions = history[range].join("\n") + "\n" + Pry.active_instance.input = StringIO.new(actions) + end + opt.on :h, :help, 'Show this message.', :tail => true do output.puts opt.help end end - - next if opts.h? - - actions = Array(hist_array[opts[:replay]]).join("\n") + "\n" - Pry.active_instance.input = StringIO.new(actions) end - end end end
25
0.657895
13
12
05f28f2d096cd3e53d336e80408665664cc59f52
_posts/2016-12-07-productivity-trick.md
_posts/2016-12-07-productivity-trick.md
--- published: true hidden: false title: My one weird trick to be more productive tags: productivity hack --- Sometimes, I have unproductive days, doing nothing except watching videos all day long. (My girlfriend can attest to that...) After one of those I always feel horrible for procrastinating and not getting anything done. During a particularly bad week, I noticed a tiny thing: **Not looking at my phone first thing in the morning gives me the ultimate headstart for a productive day.** It may sound ridiculously simple, and rightly so because it is. When I start off my day by checking Twitter my brain is all over the place and I'm not able to focus well. My girlfriend actually gifted me an ordinary alarm clock so that I wouldn't use my phone to wake me up. The only things this clock can do is show the time and ring a bell at a certain time; that's it! That way I don't even accidentally check my phone. As of now, I still have to force myself to start the day by reading a few pages of a book. ([goodreads](https://www.goodreads.com/mxstbr)) It's still a struggle every morning, but I'm getting better at it. What's a tiny lifehack that makes your day better? Let me know on [Twitter](https://twitter.com/mxstbr)!
--- published: true hidden: false title: My one weird trick to be more productive tags: productivity hack custom_excerpt: Sometimes, I have unproductive days, doing nothing except watching videos all day long. During a particularly bad week, I noticed a tiny thing that helps me stay on track. --- Sometimes, I have unproductive days, doing nothing except watching videos all day long. (My girlfriend can attest to that...) After one of those I always feel horrible for procrastinating and not getting anything done. During a particularly bad week, I noticed a tiny thing: **Not looking at my phone first thing in the morning gives me the ultimate headstart for a productive day.** It may sound ridiculously simple, and rightly so because it is. When I start off my day by checking Twitter my brain is all over the place and I'm not able to focus well. My girlfriend actually gifted me an ordinary alarm clock so that I wouldn't use my phone to wake me up. The only things this clock can do is show the time and ring a bell at a certain time; that's it! That way I don't even accidentally check my phone. As of now, I still have to force myself to start the day by reading a few pages of a book. ([goodreads](https://www.goodreads.com/mxstbr)) It's still a struggle every morning, but I'm getting better at it. What's a tiny lifehack that makes your day better? Let me know on [Twitter](https://twitter.com/mxstbr)!
Add custom excerpt to productivity post
Add custom excerpt to productivity post
Markdown
mit
mxstbr/mxstbr.github.io,mxstbr/mxstbr.github.io,mxstbr/mxstbr.github.io
markdown
## Code Before: --- published: true hidden: false title: My one weird trick to be more productive tags: productivity hack --- Sometimes, I have unproductive days, doing nothing except watching videos all day long. (My girlfriend can attest to that...) After one of those I always feel horrible for procrastinating and not getting anything done. During a particularly bad week, I noticed a tiny thing: **Not looking at my phone first thing in the morning gives me the ultimate headstart for a productive day.** It may sound ridiculously simple, and rightly so because it is. When I start off my day by checking Twitter my brain is all over the place and I'm not able to focus well. My girlfriend actually gifted me an ordinary alarm clock so that I wouldn't use my phone to wake me up. The only things this clock can do is show the time and ring a bell at a certain time; that's it! That way I don't even accidentally check my phone. As of now, I still have to force myself to start the day by reading a few pages of a book. ([goodreads](https://www.goodreads.com/mxstbr)) It's still a struggle every morning, but I'm getting better at it. What's a tiny lifehack that makes your day better? Let me know on [Twitter](https://twitter.com/mxstbr)! ## Instruction: Add custom excerpt to productivity post ## Code After: --- published: true hidden: false title: My one weird trick to be more productive tags: productivity hack custom_excerpt: Sometimes, I have unproductive days, doing nothing except watching videos all day long. During a particularly bad week, I noticed a tiny thing that helps me stay on track. --- Sometimes, I have unproductive days, doing nothing except watching videos all day long. (My girlfriend can attest to that...) After one of those I always feel horrible for procrastinating and not getting anything done. During a particularly bad week, I noticed a tiny thing: **Not looking at my phone first thing in the morning gives me the ultimate headstart for a productive day.** It may sound ridiculously simple, and rightly so because it is. When I start off my day by checking Twitter my brain is all over the place and I'm not able to focus well. My girlfriend actually gifted me an ordinary alarm clock so that I wouldn't use my phone to wake me up. The only things this clock can do is show the time and ring a bell at a certain time; that's it! That way I don't even accidentally check my phone. As of now, I still have to force myself to start the day by reading a few pages of a book. ([goodreads](https://www.goodreads.com/mxstbr)) It's still a struggle every morning, but I'm getting better at it. What's a tiny lifehack that makes your day better? Let me know on [Twitter](https://twitter.com/mxstbr)!
--- published: true hidden: false title: My one weird trick to be more productive tags: productivity hack + custom_excerpt: Sometimes, I have unproductive days, doing nothing except watching videos all day long. During a particularly bad week, I noticed a tiny thing that helps me stay on track. --- Sometimes, I have unproductive days, doing nothing except watching videos all day long. (My girlfriend can attest to that...) After one of those I always feel horrible for procrastinating and not getting anything done. During a particularly bad week, I noticed a tiny thing: **Not looking at my phone first thing in the morning gives me the ultimate headstart for a productive day.** It may sound ridiculously simple, and rightly so because it is. When I start off my day by checking Twitter my brain is all over the place and I'm not able to focus well. My girlfriend actually gifted me an ordinary alarm clock so that I wouldn't use my phone to wake me up. The only things this clock can do is show the time and ring a bell at a certain time; that's it! That way I don't even accidentally check my phone. As of now, I still have to force myself to start the day by reading a few pages of a book. ([goodreads](https://www.goodreads.com/mxstbr)) It's still a struggle every morning, but I'm getting better at it. What's a tiny lifehack that makes your day better? Let me know on [Twitter](https://twitter.com/mxstbr)!
1
0.05
1
0
b626f5c535c4a0ffb280d5b45d13bb84aa65e6a6
gulpfile.js
gulpfile.js
var gulp = require('gulp'); var path = require('path'); var runSequence = require('run-sequence'); var tslint = require('gulp-tslint'); var typescript = require('gulp-typescript'); var dirs = { build: path.join(__dirname, 'build'), src: path.join(__dirname, 'src'), test: path.join(__dirname, 'test'), typings: path.join(__dirname, 'typings') }; var files = { src: path.join(dirs.src, '**', '*.ts'), test: path.join(dirs.test, '**', '*.ts'), typings: path.join(dirs.typings, '**', '*.d.ts') }; var project = typescript.createProject({ removeComments: false, noImplicitAny: true, noLib: false, target: 'ES5', module: 'commonjs', declarationFiles: true, noExternalResolve: true }); gulp.task('lint', function() { return gulp.src([files.src, files.test]) .pipe(tslint()) .pipe(tslint.report('prose')); }); gulp.task('scripts', function() { var ts = gulp.src([files.src, files.test, files.typings]) .pipe(typescript(project)); return ts.js.pipe(gulp.dest(dirs.build)); }); gulp.task('test', function(callback) { return runSequence('lint', 'scripts', callback); });
var gulp = require('gulp'); var path = require('path'); var runSequence = require('run-sequence'); var tslint = require('gulp-tslint'); var typescript = require('gulp-typescript'); var dirs = { build: path.join(__dirname, 'build'), src: path.join(__dirname, 'src'), test: path.join(__dirname, 'test'), typings: path.join(__dirname, 'typings') }; var files = { src: path.join(dirs.src, '**', '*.ts'), test: path.join(dirs.test, '**', '*.ts'), typings: path.join(dirs.typings, '**', '*.d.ts'), ts: path.join(__dirname, '{src,test}', '**', '*.ts') }; var project = typescript.createProject({ removeComments: false, noImplicitAny: true, noLib: false, target: 'ES5', module: 'commonjs', declarationFiles: true, noExternalResolve: true }); gulp.task('lint', function() { return gulp.src([files.src, files.test]) .pipe(tslint()) .pipe(tslint.report('prose')); }); gulp.task('scripts', function() { var ts = gulp.src([files.ts, files.typings]) .pipe(typescript(project)); return ts.js.pipe(gulp.dest(dirs.build)); }); gulp.task('test', function(callback) { return runSequence('lint', 'scripts', callback); });
Make build separate src and test directories
Make build separate src and test directories
JavaScript
mit
Asana/typed-react,hnney/typed-react
javascript
## Code Before: var gulp = require('gulp'); var path = require('path'); var runSequence = require('run-sequence'); var tslint = require('gulp-tslint'); var typescript = require('gulp-typescript'); var dirs = { build: path.join(__dirname, 'build'), src: path.join(__dirname, 'src'), test: path.join(__dirname, 'test'), typings: path.join(__dirname, 'typings') }; var files = { src: path.join(dirs.src, '**', '*.ts'), test: path.join(dirs.test, '**', '*.ts'), typings: path.join(dirs.typings, '**', '*.d.ts') }; var project = typescript.createProject({ removeComments: false, noImplicitAny: true, noLib: false, target: 'ES5', module: 'commonjs', declarationFiles: true, noExternalResolve: true }); gulp.task('lint', function() { return gulp.src([files.src, files.test]) .pipe(tslint()) .pipe(tslint.report('prose')); }); gulp.task('scripts', function() { var ts = gulp.src([files.src, files.test, files.typings]) .pipe(typescript(project)); return ts.js.pipe(gulp.dest(dirs.build)); }); gulp.task('test', function(callback) { return runSequence('lint', 'scripts', callback); }); ## Instruction: Make build separate src and test directories ## Code After: var gulp = require('gulp'); var path = require('path'); var runSequence = require('run-sequence'); var tslint = require('gulp-tslint'); var typescript = require('gulp-typescript'); var dirs = { build: path.join(__dirname, 'build'), src: path.join(__dirname, 'src'), test: path.join(__dirname, 'test'), typings: path.join(__dirname, 'typings') }; var files = { src: path.join(dirs.src, '**', '*.ts'), test: path.join(dirs.test, '**', '*.ts'), typings: path.join(dirs.typings, '**', '*.d.ts'), ts: path.join(__dirname, '{src,test}', '**', '*.ts') }; var project = typescript.createProject({ removeComments: false, noImplicitAny: true, noLib: false, target: 'ES5', module: 'commonjs', declarationFiles: true, noExternalResolve: true }); gulp.task('lint', function() { return gulp.src([files.src, files.test]) .pipe(tslint()) .pipe(tslint.report('prose')); }); gulp.task('scripts', function() { var ts = gulp.src([files.ts, files.typings]) .pipe(typescript(project)); return ts.js.pipe(gulp.dest(dirs.build)); }); gulp.task('test', function(callback) { return runSequence('lint', 'scripts', callback); });
var gulp = require('gulp'); var path = require('path'); var runSequence = require('run-sequence'); var tslint = require('gulp-tslint'); var typescript = require('gulp-typescript'); var dirs = { build: path.join(__dirname, 'build'), src: path.join(__dirname, 'src'), test: path.join(__dirname, 'test'), typings: path.join(__dirname, 'typings') }; var files = { src: path.join(dirs.src, '**', '*.ts'), test: path.join(dirs.test, '**', '*.ts'), - typings: path.join(dirs.typings, '**', '*.d.ts') + typings: path.join(dirs.typings, '**', '*.d.ts'), ? + + ts: path.join(__dirname, '{src,test}', '**', '*.ts') }; var project = typescript.createProject({ removeComments: false, noImplicitAny: true, noLib: false, target: 'ES5', module: 'commonjs', declarationFiles: true, noExternalResolve: true }); gulp.task('lint', function() { return gulp.src([files.src, files.test]) .pipe(tslint()) .pipe(tslint.report('prose')); }); gulp.task('scripts', function() { - var ts = gulp.src([files.src, files.test, files.typings]) ? -------------- + var ts = gulp.src([files.ts, files.typings]) ? + .pipe(typescript(project)); return ts.js.pipe(gulp.dest(dirs.build)); }); gulp.task('test', function(callback) { return runSequence('lint', 'scripts', callback); });
5
0.113636
3
2
116b4f96c898f98f9ed44105bd0183b0e1843000
app/templates/views/dashboard/trial-mode-banner.html
app/templates/views/dashboard/trial-mode-banner.html
{% from "components/banner.html" import banner_wrapper %} {% from "components/big-number.html" import big_number %} {% call banner_wrapper(type="mode") %} <div class="grid-row"> <div class="column-one-half"> Your service is in trial mode </div> <div class="column-one-half"> <a href="{{ url_for(".trial_mode") }}" class="banner-mode-action">Find out more</a> </div> </div> {% endcall %}
{% from "components/banner.html" import banner_wrapper %} {% from "components/big-number.html" import big_number %} {% call banner_wrapper(type="mode") %} <div class="grid-row"> <div class="column-one-half"> Your service is in trial mode </div> <div class="column-one-half"> <a href="{{ url_for(".trial_mode") }}" class="banner-mode-action">Find out more<span class="visuallyhidden"> about trial mode</span></a> </div> </div> {% endcall %}
Add context to trial mode link for screen readers
Add context to trial mode link for screen readers Screen reader users have the option to navigate by jumping between anchor tags and reading out the content. "Find out more" does not provide a lot of context about what the link does. This commit adds some visually hidden text which screen readers will still read that makes the link work without the visual context.
HTML
mit
gov-cjwaszczuk/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin,gov-cjwaszczuk/notifications-admin,gov-cjwaszczuk/notifications-admin,alphagov/notifications-admin,gov-cjwaszczuk/notifications-admin
html
## Code Before: {% from "components/banner.html" import banner_wrapper %} {% from "components/big-number.html" import big_number %} {% call banner_wrapper(type="mode") %} <div class="grid-row"> <div class="column-one-half"> Your service is in trial mode </div> <div class="column-one-half"> <a href="{{ url_for(".trial_mode") }}" class="banner-mode-action">Find out more</a> </div> </div> {% endcall %} ## Instruction: Add context to trial mode link for screen readers Screen reader users have the option to navigate by jumping between anchor tags and reading out the content. "Find out more" does not provide a lot of context about what the link does. This commit adds some visually hidden text which screen readers will still read that makes the link work without the visual context. ## Code After: {% from "components/banner.html" import banner_wrapper %} {% from "components/big-number.html" import big_number %} {% call banner_wrapper(type="mode") %} <div class="grid-row"> <div class="column-one-half"> Your service is in trial mode </div> <div class="column-one-half"> <a href="{{ url_for(".trial_mode") }}" class="banner-mode-action">Find out more<span class="visuallyhidden"> about trial mode</span></a> </div> </div> {% endcall %}
{% from "components/banner.html" import banner_wrapper %} {% from "components/big-number.html" import big_number %} {% call banner_wrapper(type="mode") %} <div class="grid-row"> <div class="column-one-half"> Your service is in trial mode </div> <div class="column-one-half"> - <a href="{{ url_for(".trial_mode") }}" class="banner-mode-action">Find out more</a> + <a href="{{ url_for(".trial_mode") }}" class="banner-mode-action">Find out more<span class="visuallyhidden"> about trial mode</span></a> ? +++++++++++++++++++++++++++++++++++++++++++++++++++++ </div> </div> {% endcall %}
2
0.153846
1
1
71d92ce8a1e8cf6736e27d1ca5f49fa19fea97e5
src/Eulogix/Lib/Java/Bridge.php
src/Eulogix/Lib/Java/Bridge.php
<?php /* * This file is part of the Eulogix\Lib package. * * (c) Eulogix <http://www.eulogix.com/> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Eulogix\Lib\Java; /** * @author Pietro Baricco <pietro@eulogix.com> */ class Bridge { /** * @var string */ private $url = "", $dir = ""; /** * @param string $url */ public function __construct($url, $dir) { $this->url = $url; $this->dir = $dir; $javaInc = $dir.DIRECTORY_SEPARATOR."Java.inc"; if(!file_exists($javaInc)) { copy("$url/java/Java.inc", $javaInc); } require_once($javaInc); } /** * @param string $class * @return object */ public function instanceJavaClass($class) { return new \java($class); } }
<?php /* * This file is part of the Eulogix\Lib package. * * (c) Eulogix <http://www.eulogix.com/> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Eulogix\Lib\Java; /** * @author Pietro Baricco <pietro@eulogix.com> */ class Bridge { /** * @var string */ private $url = ""; /** * @param string $url */ public function __construct($url) { $this->url = $url; require_once("$url/java/Java.inc"); } /** * @param string $class * @return object */ public function instanceJavaClass($class) { return new \java($class); } }
Revert "Java.inc now included from a cache so that it is debuggable"
Revert "Java.inc now included from a cache so that it is debuggable" This reverts commit ad4c67b356187883ba050056aab430a4f83cd14c.
PHP
mit
eulogix/libs-misc,eulogix/libs-misc
php
## Code Before: <?php /* * This file is part of the Eulogix\Lib package. * * (c) Eulogix <http://www.eulogix.com/> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Eulogix\Lib\Java; /** * @author Pietro Baricco <pietro@eulogix.com> */ class Bridge { /** * @var string */ private $url = "", $dir = ""; /** * @param string $url */ public function __construct($url, $dir) { $this->url = $url; $this->dir = $dir; $javaInc = $dir.DIRECTORY_SEPARATOR."Java.inc"; if(!file_exists($javaInc)) { copy("$url/java/Java.inc", $javaInc); } require_once($javaInc); } /** * @param string $class * @return object */ public function instanceJavaClass($class) { return new \java($class); } } ## Instruction: Revert "Java.inc now included from a cache so that it is debuggable" This reverts commit ad4c67b356187883ba050056aab430a4f83cd14c. ## Code After: <?php /* * This file is part of the Eulogix\Lib package. * * (c) Eulogix <http://www.eulogix.com/> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Eulogix\Lib\Java; /** * @author Pietro Baricco <pietro@eulogix.com> */ class Bridge { /** * @var string */ private $url = ""; /** * @param string $url */ public function __construct($url) { $this->url = $url; require_once("$url/java/Java.inc"); } /** * @param string $class * @return object */ public function instanceJavaClass($class) { return new \java($class); } }
<?php /* * This file is part of the Eulogix\Lib package. * * (c) Eulogix <http://www.eulogix.com/> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Eulogix\Lib\Java; /** * @author Pietro Baricco <pietro@eulogix.com> */ class Bridge { /** * @var string */ - private $url = "", $dir = ""; ? ----------- + private $url = ""; /** * @param string $url */ - public function __construct($url, $dir) { ? ------ + public function __construct($url) { $this->url = $url; - $this->dir = $dir; - - $javaInc = $dir.DIRECTORY_SEPARATOR."Java.inc"; - if(!file_exists($javaInc)) { - copy("$url/java/Java.inc", $javaInc); - } - - require_once($javaInc); ? ^ + require_once("$url/java/Java.inc"); ? + ++++ ^^^^^^^ + } /** * @param string $class * @return object */ public function instanceJavaClass($class) { return new \java($class); } }
13
0.265306
3
10
8c094da6715feedfcd9b7d32e47daafa47ececab
TODO.md
TODO.md
* Spam protection in login process * Add automated tests to compare server-side typeable-detection with client-side typeable-to-DOM matching algorithm * Better anti-cheat * Add method to kick out inactive users ### Bugs * Error occurs after unjoining (playerCursor set to null, never set back?) * Docstrings are not classified seperately by highlight.js, thus not excluded * Certain keys don't work under Opera (for example, underscore is treated as '-') * When multiple players join around the same time, some may not get "ingame:join" updates * Foreign keyboard don't work (Mousetrap problem?) ### Possible future features * Learning mode? (collaborate with 'Learn X in Y' project?) * Profile page, where user can see stats, tweak settings * Names / passwords / invitation-only option for game rooms * Training mode? ("beat your own time") * Dynamic favicon update in lobby page, when people login / logout (know how many people are in lobby) * Badges / leaderboard?
* Spam protection in login process * Add automated tests to compare server-side typeable-detection with client-side typeable-to-DOM matching algorithm * Better anti-cheat * Add method to kick out inactive users * Allow single user to play multi-player, to allow multi-player to get started when few users are online. ### Bugs * Error occurs after unjoining (playerCursor set to null, never set back?) * Docstrings are not classified seperately by highlight.js, thus not excluded * Certain keys don't work under Opera (for example, underscore is treated as '-') * When multiple players join around the same time, some may not get "ingame:join" updates * Foreign keyboard don't work (Mousetrap problem?) ### Possible future features * Learning mode? (collaborate with 'Learn X in Y' project?) * Profile page, where user can see stats, tweak settings * Names / passwords / invitation-only option for game rooms * Training mode? ("beat your own time") * Dynamic favicon update in lobby page, when people login / logout (know how many people are in lobby) * Badges / leaderboard?
Add todo for single user to play in multi-player
Add todo for single user to play in multi-player
Markdown
mit
BarthV/swiftcode,voithos/swiftcode,BarthV/swiftcode,voithos/swiftcode
markdown
## Code Before: * Spam protection in login process * Add automated tests to compare server-side typeable-detection with client-side typeable-to-DOM matching algorithm * Better anti-cheat * Add method to kick out inactive users ### Bugs * Error occurs after unjoining (playerCursor set to null, never set back?) * Docstrings are not classified seperately by highlight.js, thus not excluded * Certain keys don't work under Opera (for example, underscore is treated as '-') * When multiple players join around the same time, some may not get "ingame:join" updates * Foreign keyboard don't work (Mousetrap problem?) ### Possible future features * Learning mode? (collaborate with 'Learn X in Y' project?) * Profile page, where user can see stats, tweak settings * Names / passwords / invitation-only option for game rooms * Training mode? ("beat your own time") * Dynamic favicon update in lobby page, when people login / logout (know how many people are in lobby) * Badges / leaderboard? ## Instruction: Add todo for single user to play in multi-player ## Code After: * Spam protection in login process * Add automated tests to compare server-side typeable-detection with client-side typeable-to-DOM matching algorithm * Better anti-cheat * Add method to kick out inactive users * Allow single user to play multi-player, to allow multi-player to get started when few users are online. ### Bugs * Error occurs after unjoining (playerCursor set to null, never set back?) * Docstrings are not classified seperately by highlight.js, thus not excluded * Certain keys don't work under Opera (for example, underscore is treated as '-') * When multiple players join around the same time, some may not get "ingame:join" updates * Foreign keyboard don't work (Mousetrap problem?) ### Possible future features * Learning mode? (collaborate with 'Learn X in Y' project?) * Profile page, where user can see stats, tweak settings * Names / passwords / invitation-only option for game rooms * Training mode? ("beat your own time") * Dynamic favicon update in lobby page, when people login / logout (know how many people are in lobby) * Badges / leaderboard?
* Spam protection in login process * Add automated tests to compare server-side typeable-detection with client-side typeable-to-DOM matching algorithm * Better anti-cheat * Add method to kick out inactive users + * Allow single user to play multi-player, to allow multi-player to get started when few users are online. ### Bugs * Error occurs after unjoining (playerCursor set to null, never set back?) * Docstrings are not classified seperately by highlight.js, thus not excluded * Certain keys don't work under Opera (for example, underscore is treated as '-') * When multiple players join around the same time, some may not get "ingame:join" updates * Foreign keyboard don't work (Mousetrap problem?) ### Possible future features * Learning mode? (collaborate with 'Learn X in Y' project?) * Profile page, where user can see stats, tweak settings * Names / passwords / invitation-only option for game rooms * Training mode? ("beat your own time") * Dynamic favicon update in lobby page, when people login / logout (know how many people are in lobby) * Badges / leaderboard?
1
0.052632
1
0
1c9390df887694a8defedd834be2e37d4c20b509
group_vars/all.yml
group_vars/all.yml
--- # The develop flag is used for development-specific tasks/roles and is set to true via --extra-vars # By default, these should not be run develop: false # To enable a minimal installation the following variable should be enabled: minimal_install: false timezone: Europe/Amsterdam maven_repo: https://build.openconext.org/repository/public/releases maven_snapshot_repo: https://build.openconext.org/repository/public/snapshots ssl_key_dir: /etc/httpd/keys env_name: "{{ env_lang }}-{{ env }}" apache_user: apache error_subject_prefix: "[{{ ansible_hostname }}] " # DH-params tls_dh_param_path: /etc/pki/tls tls_dh_param_file: "{{ tls_dh_param_path }}/dh_params.pem" tls_dh_param_keysize: 2048 # Some engineblock variables are shared between applications engine_api_domain: engine-api.{{ base_domain }} engine_api_janus_user: serviceregistry # Some deprovision variables are shared between applications authz_server_api_lifecycle_username: authz_server_api_lifecycle_user teams_api_lifecycle_username: teams_api_lifecycle_user attribute_aggregator_api_lifecycle_username: attribute_aggregator_api_lifecycle_user engine_api_deprovision_user: lifecycle
--- # The develop flag is used for development-specific tasks/roles and is set to true via --extra-vars # By default, these should not be run develop: false # To enable a minimal installation the following variable should be enabled: minimal_install: false timezone: Europe/Amsterdam maven_repo: https://build.openconext.org/repository/public/releases maven_snapshot_repo: https://build.openconext.org/repository/public/snapshots ssl_key_dir: /etc/httpd/keys env_name: "{{ env_lang }}-{{ env }}" apache_user: apache error_subject_prefix: "[{{ ansible_hostname }}] " # DH-params tls_dh_param_path: /etc/pki/tls tls_dh_param_file: "{{ tls_dh_param_path }}/dh_params.pem" tls_dh_param_keysize: 2048 # Some engineblock variables are shared between applications engine_api_domain: engine-api.{{ base_domain }} engine_api_janus_user: serviceregistry # Some deprovision variables are shared between applications authz_server_api_lifecycle_username: authz_server_api_lifecycle_user teams_api_lifecycle_username: teams_api_lifecycle_user attribute_aggregator_api_lifecycle_username: attribute_aggregator_api_lifecycle_user engine_api_deprovision_user: lifecycle influx_stats_db: log_logins
Add common variables needed for elk and stats
Add common variables needed for elk and stats
YAML
apache-2.0
OpenConext/OpenConext-deploy,OpenConext/OpenConext-deploy,OpenConext/OpenConext-deploy,OpenConext/OpenConext-deploy,OpenConext/OpenConext-deploy
yaml
## Code Before: --- # The develop flag is used for development-specific tasks/roles and is set to true via --extra-vars # By default, these should not be run develop: false # To enable a minimal installation the following variable should be enabled: minimal_install: false timezone: Europe/Amsterdam maven_repo: https://build.openconext.org/repository/public/releases maven_snapshot_repo: https://build.openconext.org/repository/public/snapshots ssl_key_dir: /etc/httpd/keys env_name: "{{ env_lang }}-{{ env }}" apache_user: apache error_subject_prefix: "[{{ ansible_hostname }}] " # DH-params tls_dh_param_path: /etc/pki/tls tls_dh_param_file: "{{ tls_dh_param_path }}/dh_params.pem" tls_dh_param_keysize: 2048 # Some engineblock variables are shared between applications engine_api_domain: engine-api.{{ base_domain }} engine_api_janus_user: serviceregistry # Some deprovision variables are shared between applications authz_server_api_lifecycle_username: authz_server_api_lifecycle_user teams_api_lifecycle_username: teams_api_lifecycle_user attribute_aggregator_api_lifecycle_username: attribute_aggregator_api_lifecycle_user engine_api_deprovision_user: lifecycle ## Instruction: Add common variables needed for elk and stats ## Code After: --- # The develop flag is used for development-specific tasks/roles and is set to true via --extra-vars # By default, these should not be run develop: false # To enable a minimal installation the following variable should be enabled: minimal_install: false timezone: Europe/Amsterdam maven_repo: https://build.openconext.org/repository/public/releases maven_snapshot_repo: https://build.openconext.org/repository/public/snapshots ssl_key_dir: /etc/httpd/keys env_name: "{{ env_lang }}-{{ env }}" apache_user: apache error_subject_prefix: "[{{ ansible_hostname }}] " # DH-params tls_dh_param_path: /etc/pki/tls tls_dh_param_file: "{{ tls_dh_param_path }}/dh_params.pem" tls_dh_param_keysize: 2048 # Some engineblock variables are shared between applications engine_api_domain: engine-api.{{ base_domain }} engine_api_janus_user: serviceregistry # Some deprovision variables are shared between applications authz_server_api_lifecycle_username: authz_server_api_lifecycle_user teams_api_lifecycle_username: teams_api_lifecycle_user attribute_aggregator_api_lifecycle_username: attribute_aggregator_api_lifecycle_user engine_api_deprovision_user: lifecycle influx_stats_db: log_logins
--- # The develop flag is used for development-specific tasks/roles and is set to true via --extra-vars # By default, these should not be run develop: false # To enable a minimal installation the following variable should be enabled: minimal_install: false timezone: Europe/Amsterdam maven_repo: https://build.openconext.org/repository/public/releases maven_snapshot_repo: https://build.openconext.org/repository/public/snapshots ssl_key_dir: /etc/httpd/keys env_name: "{{ env_lang }}-{{ env }}" apache_user: apache error_subject_prefix: "[{{ ansible_hostname }}] " # DH-params tls_dh_param_path: /etc/pki/tls tls_dh_param_file: "{{ tls_dh_param_path }}/dh_params.pem" tls_dh_param_keysize: 2048 # Some engineblock variables are shared between applications engine_api_domain: engine-api.{{ base_domain }} engine_api_janus_user: serviceregistry # Some deprovision variables are shared between applications authz_server_api_lifecycle_username: authz_server_api_lifecycle_user teams_api_lifecycle_username: teams_api_lifecycle_user attribute_aggregator_api_lifecycle_username: attribute_aggregator_api_lifecycle_user engine_api_deprovision_user: lifecycle + influx_stats_db: log_logins
1
0.029412
1
0
6cd213a6d70af30e166181879edd04eb8aab0da8
src/app/app.routes.js
src/app/app.routes.js
export default function(appModule) { appModule.config(function($stateProvider, $locationProvider) { 'ngInject'; $stateProvider .state({ name: 'stopwatch', url: '/stopwatch', component: 'atStopwatch' }) .state({ name: 'timer', url: '/timer', component: 'atTimer' }) .state({ name: 'about', url: '/about', component: 'atAbout' }); $locationProvider.html5Mode(true); }); }
export default function(appModule) { appModule.config(function( $stateProvider, $locationProvider, $urlRouterProvider ) { 'ngInject'; $stateProvider .state({ name: 'stopwatch', url: '/stopwatch', component: 'atStopwatch' }) .state({ name: 'timer', url: '/timer', component: 'atTimer' }) .state({ name: 'about', url: '/about', component: 'atAbout' }); $urlRouterProvider.otherwise('/stopwatch'); $locationProvider.html5Mode(true); }); }
Make stopwatch the default route
Make stopwatch the default route
JavaScript
mit
JavierPDev/AudioTime,JavierPDev/AudioTime
javascript
## Code Before: export default function(appModule) { appModule.config(function($stateProvider, $locationProvider) { 'ngInject'; $stateProvider .state({ name: 'stopwatch', url: '/stopwatch', component: 'atStopwatch' }) .state({ name: 'timer', url: '/timer', component: 'atTimer' }) .state({ name: 'about', url: '/about', component: 'atAbout' }); $locationProvider.html5Mode(true); }); } ## Instruction: Make stopwatch the default route ## Code After: export default function(appModule) { appModule.config(function( $stateProvider, $locationProvider, $urlRouterProvider ) { 'ngInject'; $stateProvider .state({ name: 'stopwatch', url: '/stopwatch', component: 'atStopwatch' }) .state({ name: 'timer', url: '/timer', component: 'atTimer' }) .state({ name: 'about', url: '/about', component: 'atAbout' }); $urlRouterProvider.otherwise('/stopwatch'); $locationProvider.html5Mode(true); }); }
export default function(appModule) { - appModule.config(function($stateProvider, $locationProvider) { + appModule.config(function( + $stateProvider, $locationProvider, $urlRouterProvider + ) { 'ngInject'; $stateProvider .state({ name: 'stopwatch', url: '/stopwatch', component: 'atStopwatch' }) .state({ name: 'timer', url: '/timer', component: 'atTimer' }) .state({ name: 'about', url: '/about', component: 'atAbout' }); + $urlRouterProvider.otherwise('/stopwatch'); $locationProvider.html5Mode(true); }); }
5
0.208333
4
1
fae7e4e3df75ef8cf3dc6d20d37fe1d6047c3a66
app/controllers/v1/talks_controller.rb
app/controllers/v1/talks_controller.rb
module V1 class TalksController < ApplicationController def index edition = if params.has_key?(:id) Edition.find_by(id: params[:id]) else Edition.get_current end @talks = Talk.where(edition: edition) end end end
module V1 class TalksController < ApplicationController def index edition = if params.has_key?(:edition) Edition.find_by(id: params[:edition]) else Edition.get_current end @talks = Talk.where(edition: edition) end end end
Revert "Filter editions by id param"
Revert "Filter editions by id param" This reverts commit d42dade99e64b4780b21df48a7075d3ea2c343f8.
Ruby
mit
infoeducatie/infoeducatie-api,BoldijarPaul/infoeducatie-api,palcu/infoeducatie-api,BoldijarPaul/infoeducatie-api,BoldijarPaul/infoeducatie-api,palcu/infoeducatie-api,infoeducatie/infoeducatie-api,palcu/infoeducatie-api,infoeducatie/infoeducatie-api
ruby
## Code Before: module V1 class TalksController < ApplicationController def index edition = if params.has_key?(:id) Edition.find_by(id: params[:id]) else Edition.get_current end @talks = Talk.where(edition: edition) end end end ## Instruction: Revert "Filter editions by id param" This reverts commit d42dade99e64b4780b21df48a7075d3ea2c343f8. ## Code After: module V1 class TalksController < ApplicationController def index edition = if params.has_key?(:edition) Edition.find_by(id: params[:edition]) else Edition.get_current end @talks = Talk.where(edition: edition) end end end
module V1 class TalksController < ApplicationController def index - edition = if params.has_key?(:id) ? ^ + edition = if params.has_key?(:edition) ? ++ ^^^^ - Edition.find_by(id: params[:id]) ? ^ + Edition.find_by(id: params[:edition]) ? ++ ^^^^ else Edition.get_current end @talks = Talk.where(edition: edition) end end end
4
0.266667
2
2
0f776ed8ec97282d27571563112b8069efcaf9a3
load_test_database.sh
load_test_database.sh
./script/run_with_carton.sh ./script/mediawords_psql_wrapper.pl --dump-env-commands --db-label test > /tmp/test_db_$$ echo /tmp/test_db_$$ pg_restore --clean -d $PGDATABASE data/db_dumps/cc_blogs_mc_db.dump MEDIAWORDS_FORCE_USING_TEST_DATABASE=1 ./script/run_with_carton.sh ./script/mediawords_import_solr_data.pl --delete
echo "setting up test database" ./script/run_with_carton.sh ./script/mediawords_psql_wrapper.pl --dump-env-commands --db-label test > /tmp/test_db_$$ source /tmp/test_db_$$ echo "running pg_restore" pg_restore --clean -d $PGDATABASE data/db_dumps/cc_blogs_mc_db.dump echo "testing for runnning solr" ps aux | grep java | grep -- '-Dsolr' | grep start.jar > /dev/null if [ $? -ne 0 ]; then echo "need to start solr" ./script/run_with_carton.sh ./solr/scripts/run_singleton_solr_server.pl > /dev/null& solr_pid=$! else echo "solr running" fi MEDIACLOUD_IGNORE_DB_SCHEMA_VERSION=1 MEDIAWORDS_FORCE_USING_TEST_DATABASE=1 ./script/run_with_carton.sh ./script/mediawords_import_solr_data.pl --delete MEDIACLOUD_IGNORE_DB_SCHEMA_VERSION=1 MEDIAWORDS_FORCE_USING_TEST_DATABASE=1 ./script/run_carton.sh exec prove -Ilib/ t/api_media.t if [ $solr_pid ]; then echo killing solr pid $solr_pid kill $solr_pid fi
Complete script to run a full time of the API.
Complete script to run a full time of the API.
Shell
agpl-3.0
AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,berkmancenter/mediacloud,AchyuthIIIT/mediacloud,berkmancenter/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,berkmancenter/mediacloud
shell
## Code Before: ./script/run_with_carton.sh ./script/mediawords_psql_wrapper.pl --dump-env-commands --db-label test > /tmp/test_db_$$ echo /tmp/test_db_$$ pg_restore --clean -d $PGDATABASE data/db_dumps/cc_blogs_mc_db.dump MEDIAWORDS_FORCE_USING_TEST_DATABASE=1 ./script/run_with_carton.sh ./script/mediawords_import_solr_data.pl --delete ## Instruction: Complete script to run a full time of the API. ## Code After: echo "setting up test database" ./script/run_with_carton.sh ./script/mediawords_psql_wrapper.pl --dump-env-commands --db-label test > /tmp/test_db_$$ source /tmp/test_db_$$ echo "running pg_restore" pg_restore --clean -d $PGDATABASE data/db_dumps/cc_blogs_mc_db.dump echo "testing for runnning solr" ps aux | grep java | grep -- '-Dsolr' | grep start.jar > /dev/null if [ $? -ne 0 ]; then echo "need to start solr" ./script/run_with_carton.sh ./solr/scripts/run_singleton_solr_server.pl > /dev/null& solr_pid=$! else echo "solr running" fi MEDIACLOUD_IGNORE_DB_SCHEMA_VERSION=1 MEDIAWORDS_FORCE_USING_TEST_DATABASE=1 ./script/run_with_carton.sh ./script/mediawords_import_solr_data.pl --delete MEDIACLOUD_IGNORE_DB_SCHEMA_VERSION=1 MEDIAWORDS_FORCE_USING_TEST_DATABASE=1 ./script/run_carton.sh exec prove -Ilib/ t/api_media.t if [ $solr_pid ]; then echo killing solr pid $solr_pid kill $solr_pid fi
+ echo "setting up test database" ./script/run_with_carton.sh ./script/mediawords_psql_wrapper.pl --dump-env-commands --db-label test > /tmp/test_db_$$ - echo /tmp/test_db_$$ ? ^^^ + source /tmp/test_db_$$ ? +++++ ^ + echo "running pg_restore" pg_restore --clean -d $PGDATABASE data/db_dumps/cc_blogs_mc_db.dump + + echo "testing for runnning solr" + + ps aux | grep java | grep -- '-Dsolr' | grep start.jar > /dev/null + + if [ $? -ne 0 ]; then + echo "need to start solr" + ./script/run_with_carton.sh ./solr/scripts/run_singleton_solr_server.pl > /dev/null& + solr_pid=$! + else + echo "solr running" + fi - MEDIAWORDS_FORCE_USING_TEST_DATABASE=1 ./script/run_with_carton.sh ./script/mediawords_import_solr_data.pl --delete + MEDIACLOUD_IGNORE_DB_SCHEMA_VERSION=1 MEDIAWORDS_FORCE_USING_TEST_DATABASE=1 ./script/run_with_carton.sh ./script/mediawords_import_solr_data.pl --delete ? ++++++++++++++++++++++++++++++++++++++ + MEDIACLOUD_IGNORE_DB_SCHEMA_VERSION=1 MEDIAWORDS_FORCE_USING_TEST_DATABASE=1 ./script/run_carton.sh exec prove -Ilib/ t/api_media.t + + if [ $solr_pid ]; then + echo killing solr pid $solr_pid + kill $solr_pid + fi +
25
5
23
2
3de0e6c97316eceb6f1a66188bbf52cfa489123f
test/test_helper.rb
test/test_helper.rb
ENV['RAILS_ENV'] ||= 'test' require File.expand_path(File.dirname(__FILE__) + "/application/config/environment") require 'test_help' # From this point forward, we can assume that we have booted a generic Rails environment plus # our (booted) plugin. load(File.dirname(__FILE__) + "/schema.rb") # Run the migrations (optional) # ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate") # Set Test::Unit options for optimal performance/fidelity. class Test::Unit::TestCase self.use_transactional_fixtures = true self.use_instantiated_fixtures = false self.fixture_path = "#{RAILS_ROOT}/../fixtures" def self.uses_mocha(description) require 'mocha' yield rescue LoadError $stderr.puts "Skipping #{description} tests. `gem install mocha` and try again." end def self.test(name, &block) # Shamelessly lifted from ActiveSupport test_name = "test_#{name.gsub(/\s+/,'_')}".to_sym defined = instance_method(test_name) rescue false raise "#{test_name} is already defined in #{self}" if defined if block_given? define_method(test_name, &block) else define_method(test_name) do flunk "No implementation provided for #{name}" end end end end
RAILS_GEM_VERSION="2.2.2" ENV['RAILS_ENV'] ||= 'test' require File.expand_path(File.dirname(__FILE__) + "/application/config/environment") require 'test_help' # From this point forward, we can assume that we have booted a generic Rails environment plus # our (booted) plugin. load(File.dirname(__FILE__) + "/schema.rb") # Run the migrations (optional) # ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate") # Set Test::Unit options for optimal performance/fidelity. class Test::Unit::TestCase self.use_transactional_fixtures = true self.use_instantiated_fixtures = false self.fixture_path = "#{RAILS_ROOT}/../fixtures" def self.uses_mocha(description) require 'mocha' yield rescue LoadError $stderr.puts "Skipping #{description} tests. `gem install mocha` and try again." end def self.test(name, &block) # Shamelessly lifted from ActiveSupport test_name = "test_#{name.gsub(/\s+/,'_')}".to_sym defined = instance_method(test_name) rescue false raise "#{test_name} is already defined in #{self}" if defined if block_given? define_method(test_name, &block) else define_method(test_name) do flunk "No implementation provided for #{name}" end end end end
Use Rails 2.2.2 gems by default for testing
Use Rails 2.2.2 gems by default for testing
Ruby
mit
cch1/authorize,cch1/authorize
ruby
## Code Before: ENV['RAILS_ENV'] ||= 'test' require File.expand_path(File.dirname(__FILE__) + "/application/config/environment") require 'test_help' # From this point forward, we can assume that we have booted a generic Rails environment plus # our (booted) plugin. load(File.dirname(__FILE__) + "/schema.rb") # Run the migrations (optional) # ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate") # Set Test::Unit options for optimal performance/fidelity. class Test::Unit::TestCase self.use_transactional_fixtures = true self.use_instantiated_fixtures = false self.fixture_path = "#{RAILS_ROOT}/../fixtures" def self.uses_mocha(description) require 'mocha' yield rescue LoadError $stderr.puts "Skipping #{description} tests. `gem install mocha` and try again." end def self.test(name, &block) # Shamelessly lifted from ActiveSupport test_name = "test_#{name.gsub(/\s+/,'_')}".to_sym defined = instance_method(test_name) rescue false raise "#{test_name} is already defined in #{self}" if defined if block_given? define_method(test_name, &block) else define_method(test_name) do flunk "No implementation provided for #{name}" end end end end ## Instruction: Use Rails 2.2.2 gems by default for testing ## Code After: RAILS_GEM_VERSION="2.2.2" ENV['RAILS_ENV'] ||= 'test' require File.expand_path(File.dirname(__FILE__) + "/application/config/environment") require 'test_help' # From this point forward, we can assume that we have booted a generic Rails environment plus # our (booted) plugin. load(File.dirname(__FILE__) + "/schema.rb") # Run the migrations (optional) # ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate") # Set Test::Unit options for optimal performance/fidelity. class Test::Unit::TestCase self.use_transactional_fixtures = true self.use_instantiated_fixtures = false self.fixture_path = "#{RAILS_ROOT}/../fixtures" def self.uses_mocha(description) require 'mocha' yield rescue LoadError $stderr.puts "Skipping #{description} tests. `gem install mocha` and try again." end def self.test(name, &block) # Shamelessly lifted from ActiveSupport test_name = "test_#{name.gsub(/\s+/,'_')}".to_sym defined = instance_method(test_name) rescue false raise "#{test_name} is already defined in #{self}" if defined if block_given? define_method(test_name, &block) else define_method(test_name) do flunk "No implementation provided for #{name}" end end end end
+ RAILS_GEM_VERSION="2.2.2" ENV['RAILS_ENV'] ||= 'test' require File.expand_path(File.dirname(__FILE__) + "/application/config/environment") require 'test_help' # From this point forward, we can assume that we have booted a generic Rails environment plus # our (booted) plugin. load(File.dirname(__FILE__) + "/schema.rb") # Run the migrations (optional) # ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate") # Set Test::Unit options for optimal performance/fidelity. class Test::Unit::TestCase self.use_transactional_fixtures = true self.use_instantiated_fixtures = false self.fixture_path = "#{RAILS_ROOT}/../fixtures" def self.uses_mocha(description) require 'mocha' yield rescue LoadError $stderr.puts "Skipping #{description} tests. `gem install mocha` and try again." end def self.test(name, &block) # Shamelessly lifted from ActiveSupport test_name = "test_#{name.gsub(/\s+/,'_')}".to_sym defined = instance_method(test_name) rescue false raise "#{test_name} is already defined in #{self}" if defined if block_given? define_method(test_name, &block) else define_method(test_name) do flunk "No implementation provided for #{name}" end end end end
1
0.027027
1
0
dbff79d72b12246316005a000b1d43edad6dccc6
resources/views/tickets/show/actions/assignedtopool.blade.php
resources/views/tickets/show/actions/assignedtopool.blade.php
@extends('helpdesk::tickets.show.action') @section('action-content') <strong>{{ $action->name }}</strong> <br> <em>Pool Name</em>: {{ $action->object->pool->name }} <br> <em>By</em>: {{ $action->object->agent->name or 'System Process' }} @overwrite @section('action-note') @overwrite
@extends('helpdesk::tickets.show.action') @section('action-content') <strong>Assigned To Team</strong> <br> <em>Team Name</em>: {{ $action->object->pool->name }} <br> <em>By</em>: {{ $action->object->agent->name or 'System Process' }} @overwrite @section('action-note') @overwrite
Change action name from pool to team
Change action name from pool to team
PHP
mit
danielsdeboer/Helpdesk
php
## Code Before: @extends('helpdesk::tickets.show.action') @section('action-content') <strong>{{ $action->name }}</strong> <br> <em>Pool Name</em>: {{ $action->object->pool->name }} <br> <em>By</em>: {{ $action->object->agent->name or 'System Process' }} @overwrite @section('action-note') @overwrite ## Instruction: Change action name from pool to team ## Code After: @extends('helpdesk::tickets.show.action') @section('action-content') <strong>Assigned To Team</strong> <br> <em>Team Name</em>: {{ $action->object->pool->name }} <br> <em>By</em>: {{ $action->object->agent->name or 'System Process' }} @overwrite @section('action-note') @overwrite
@extends('helpdesk::tickets.show.action') @section('action-content') - <strong>{{ $action->name }}</strong> + <strong>Assigned To Team</strong> <br> - <em>Pool Name</em>: {{ $action->object->pool->name }} ? ^^^^ + <em>Team Name</em>: {{ $action->object->pool->name }} ? ^^^^ <br> <em>By</em>: {{ $action->object->agent->name or 'System Process' }} @overwrite @section('action-note') @overwrite
4
0.333333
2
2
481930224e241101cdb9a0dd1577b85a2d2966a3
setup.cfg
setup.cfg
[metadata] name = ospurge author = Florent Flament author-email = florent.flament@cloudwatt.com home-page = https://github.com/stackforge/ospurge summary = OpenStack resources cleanup script description-file = README.md license = MIT classifier = keywords = openstack [entry_points] console_scripts = ospurge = ospurge.ospurge:main [files] packages = ospurge
[metadata] name = ospurge author = Florent Flament author-email = florent.flament@cloudwatt.com home-page = https://github.com/stackforge/ospurge summary = OpenStack resources cleanup script description-file = README.md license = MIT classifier = Development Status :: 5 - Production/Stable Environment :: Console Environment :: OpenStack Intended Audience :: Developers Intended Audience :: Information Technology Intended Audience :: System Administrators License :: OSI Approved :: MIT License Programming Language :: Python Programming Language :: Python :: 2.7 keywords = openstack [entry_points] console_scripts = ospurge = ospurge.ospurge:main [files] packages = ospurge
Add some classifiers to better describe the project
Add some classifiers to better describe the project Change-Id: Ic892958b25c6190e059c0ebd858634050daccd3b
INI
apache-2.0
tnahak/ospurge,stackforge/ospurge,openstack/ospurge,JonasPf/ospurge,openstack/ospurge,remoteur/ospurge,DigitalPacific/ospurge
ini
## Code Before: [metadata] name = ospurge author = Florent Flament author-email = florent.flament@cloudwatt.com home-page = https://github.com/stackforge/ospurge summary = OpenStack resources cleanup script description-file = README.md license = MIT classifier = keywords = openstack [entry_points] console_scripts = ospurge = ospurge.ospurge:main [files] packages = ospurge ## Instruction: Add some classifiers to better describe the project Change-Id: Ic892958b25c6190e059c0ebd858634050daccd3b ## Code After: [metadata] name = ospurge author = Florent Flament author-email = florent.flament@cloudwatt.com home-page = https://github.com/stackforge/ospurge summary = OpenStack resources cleanup script description-file = README.md license = MIT classifier = Development Status :: 5 - Production/Stable Environment :: Console Environment :: OpenStack Intended Audience :: Developers Intended Audience :: Information Technology Intended Audience :: System Administrators License :: OSI Approved :: MIT License Programming Language :: Python Programming Language :: Python :: 2.7 keywords = openstack [entry_points] console_scripts = ospurge = ospurge.ospurge:main [files] packages = ospurge
[metadata] name = ospurge author = Florent Flament author-email = florent.flament@cloudwatt.com home-page = https://github.com/stackforge/ospurge summary = OpenStack resources cleanup script description-file = README.md license = MIT classifier = + Development Status :: 5 - Production/Stable + Environment :: Console + Environment :: OpenStack + Intended Audience :: Developers + Intended Audience :: Information Technology + Intended Audience :: System Administrators + License :: OSI Approved :: MIT License + Programming Language :: Python + Programming Language :: Python :: 2.7 keywords = openstack [entry_points] console_scripts = ospurge = ospurge.ospurge:main [files] packages = ospurge
9
0.473684
9
0
e06fafc5e15705b03cb3f242d1b129b427ac6f96
examples/web-components/js/app.js
examples/web-components/js/app.js
var AppView = require('./views/app_view'); var AppModel = require('./models/app_model'); var template = window.template = require('../templates/app_view.mustache'); module.exports = window.view = new AppView({ el: '#appwrapper', template: template, model: new AppModel(window.data) });
var AppView = require('./views/app_view'); var AppModel = require('./models/app_model'); var template = window.template = require('../templates/app_view.mustache'); module.exports = window.view = new AppView({ el: document.getElementById('appwrapper'), template: template, model: new AppModel(window.data) });
Fix web components example init
Fix web components example init
JavaScript
apache-2.0
wayfair/tungstenjs,wayfair/tungstenjs
javascript
## Code Before: var AppView = require('./views/app_view'); var AppModel = require('./models/app_model'); var template = window.template = require('../templates/app_view.mustache'); module.exports = window.view = new AppView({ el: '#appwrapper', template: template, model: new AppModel(window.data) }); ## Instruction: Fix web components example init ## Code After: var AppView = require('./views/app_view'); var AppModel = require('./models/app_model'); var template = window.template = require('../templates/app_view.mustache'); module.exports = window.view = new AppView({ el: document.getElementById('appwrapper'), template: template, model: new AppModel(window.data) });
var AppView = require('./views/app_view'); var AppModel = require('./models/app_model'); var template = window.template = require('../templates/app_view.mustache'); module.exports = window.view = new AppView({ - el: '#appwrapper', + el: document.getElementById('appwrapper'), template: template, model: new AppModel(window.data) });
2
0.222222
1
1
24861839e4417eec319726ff3ac23a86db23eed0
src/views/controllers/pages/home.blade.php
src/views/controllers/pages/home.blade.php
@extends('laravelerator::layouts.master') @section('content') <div class="row"> <div class="col-md-12"> <div class="page-header"> <h1>Home</h1> </div> <ul class="list-group" style="font-size:larger;"> <li class="list-group-item"> <h3>alg:generate <small>Database code generation</small></h3> <ul> <li>Validate schema</li> <li> template and path are required args.<br> table, namespace, schema &amp; mock are options. </li> </ul> </li> <li class="list-group-item"> <h3>General</h3> <ul> <li> Explore the use of Facades </li> </ul> </li> </ul> </div> </div> @stop
@extends('laravelerator::layouts.master') @section('content') <div class="row"> <div class="col-md-12"> <div class="page-header"> <h1>Home</h1> </div> <ul class="list-group" style="font-size:larger;"> <li class="list-group-item"> <h3>alg:generate <small>Database code generation</small></h3> <ul> <li>Validate schema</li> <li> template and path are required args.<br> table, namespace, schema &amp; mock are options. </li> </ul> </li> <li class="list-group-item"> <h3>General</h3> <ul> <li> Explore the use of Facades </li> </ul> </li> </ul> </div> </div> @stop _ ___ ______ ___ _ _ _____ _ _____ ______ ___ _____ _____ ______ | | / _ \ | ___ \ / _ \ | | | || ___|| | | ___|| ___ \ / _ \|_ _|| _ || ___ \ | | / /_\ \| |_/ // /_\ \| | | || |__ | | | |__ | |_/ // /_\ \ | | | | | || |_/ / | | | _ || / | _ || | | || __| | | | __| | / | _ | | | | | | || / | |____| | | || |\ \ | | | |\ \_/ /| |___ | |____| |___ | |\ \ | | | | | | \ \_/ /| |\ \ \_____/\_| |_/\_| \_|\_| |_/ \___/ \____/ \_____/\____/ \_| \_|\_| |_/ \_/ \___/ \_| \_|
Add ascii art to home page.
Add ascii art to home page.
PHP
bsd-2-clause
paulboco/laravelerator
php
## Code Before: @extends('laravelerator::layouts.master') @section('content') <div class="row"> <div class="col-md-12"> <div class="page-header"> <h1>Home</h1> </div> <ul class="list-group" style="font-size:larger;"> <li class="list-group-item"> <h3>alg:generate <small>Database code generation</small></h3> <ul> <li>Validate schema</li> <li> template and path are required args.<br> table, namespace, schema &amp; mock are options. </li> </ul> </li> <li class="list-group-item"> <h3>General</h3> <ul> <li> Explore the use of Facades </li> </ul> </li> </ul> </div> </div> @stop ## Instruction: Add ascii art to home page. ## Code After: @extends('laravelerator::layouts.master') @section('content') <div class="row"> <div class="col-md-12"> <div class="page-header"> <h1>Home</h1> </div> <ul class="list-group" style="font-size:larger;"> <li class="list-group-item"> <h3>alg:generate <small>Database code generation</small></h3> <ul> <li>Validate schema</li> <li> template and path are required args.<br> table, namespace, schema &amp; mock are options. </li> </ul> </li> <li class="list-group-item"> <h3>General</h3> <ul> <li> Explore the use of Facades </li> </ul> </li> </ul> </div> </div> @stop _ ___ ______ ___ _ _ _____ _ _____ ______ ___ _____ _____ ______ | | / _ \ | ___ \ / _ \ | | | || ___|| | | ___|| ___ \ / _ \|_ _|| _ || ___ \ | | / /_\ \| |_/ // /_\ \| | | || |__ | | | |__ | |_/ // /_\ \ | | | | | || |_/ / | | | _ || / | _ || | | || __| | | | __| | / | _ | | | | | | || / | |____| | | || |\ \ | | | |\ \_/ /| |___ | |____| |___ | |\ \ | | | | | | \ \_/ /| |\ \ \_____/\_| |_/\_| \_|\_| |_/ \___/ \____/ \_____/\____/ \_| \_|\_| |_/ \_/ \___/ \_| \_|
@extends('laravelerator::layouts.master') @section('content') <div class="row"> <div class="col-md-12"> <div class="page-header"> <h1>Home</h1> </div> <ul class="list-group" style="font-size:larger;"> <li class="list-group-item"> <h3>alg:generate <small>Database code generation</small></h3> <ul> <li>Validate schema</li> <li> template and path are required args.<br> table, namespace, schema &amp; mock are options. </li> </ul> </li> <li class="list-group-item"> <h3>General</h3> <ul> <li> Explore the use of Facades </li> </ul> </li> </ul> </div> </div> @stop + + _ ___ ______ ___ _ _ _____ _ _____ ______ ___ _____ _____ ______ + | | / _ \ | ___ \ / _ \ | | | || ___|| | | ___|| ___ \ / _ \|_ _|| _ || ___ \ + | | / /_\ \| |_/ // /_\ \| | | || |__ | | | |__ | |_/ // /_\ \ | | | | | || |_/ / + | | | _ || / | _ || | | || __| | | | __| | / | _ | | | | | | || / + | |____| | | || |\ \ | | | |\ \_/ /| |___ | |____| |___ | |\ \ | | | | | | \ \_/ /| |\ \ + \_____/\_| |_/\_| \_|\_| |_/ \___/ \____/ \_____/\____/ \_| \_|\_| |_/ \_/ \___/ \_| \_| +
8
0.258065
8
0
233823b1c1ad60f3847ae05fb541387a99bdb4af
app/controllers/sessions_controller.rb
app/controllers/sessions_controller.rb
class SessionsController < ApplicationController def create auth_hash = request.env['omniauth.auth'] user = Registration.find_or_create_user_from_auth_hash! auth_hash self.current_user = user redirect_to :root end def destroy self.current_user = nil redirect_to :root end def failure render :text => "Failure!" end end
class SessionsController < ApplicationController def create auth_hash = request.env['omniauth.auth'] user = Registration.find_or_create_user_from_auth_hash! auth_hash self.current_user = user redirect_to :root end def destroy self.current_user = nil redirect_to :root end def failure render :text => "Oh noes! The magical Dropbox linky thing that we tried to do just didn't work out. We're sorry. http://dropbox-errors.nononono.co/" end end
Update dropbox oauth error message
Update dropbox oauth error message
Ruby
mit
desktoppr/giftoppr,desktoppr/giftoppr
ruby
## Code Before: class SessionsController < ApplicationController def create auth_hash = request.env['omniauth.auth'] user = Registration.find_or_create_user_from_auth_hash! auth_hash self.current_user = user redirect_to :root end def destroy self.current_user = nil redirect_to :root end def failure render :text => "Failure!" end end ## Instruction: Update dropbox oauth error message ## Code After: class SessionsController < ApplicationController def create auth_hash = request.env['omniauth.auth'] user = Registration.find_or_create_user_from_auth_hash! auth_hash self.current_user = user redirect_to :root end def destroy self.current_user = nil redirect_to :root end def failure render :text => "Oh noes! The magical Dropbox linky thing that we tried to do just didn't work out. We're sorry. http://dropbox-errors.nononono.co/" end end
class SessionsController < ApplicationController def create auth_hash = request.env['omniauth.auth'] user = Registration.find_or_create_user_from_auth_hash! auth_hash self.current_user = user redirect_to :root end def destroy self.current_user = nil redirect_to :root end def failure - render :text => "Failure!" + render :text => "Oh noes! The magical Dropbox linky thing that we tried to do just didn't work out. We're sorry. http://dropbox-errors.nononono.co/" end end
2
0.1
1
1
9adc745d5c0b9c894e6770f377c9a242b9f1ce86
bulbs/styles/static/styles/bulbs-styles/components/homepage-player.scss
bulbs/styles/static/styles/bulbs-styles/components/homepage-player.scss
////////////////////////////////////// // ******************************** // // Homepage Player // // ******************************** // ////////////////////////////////////// @import "../mixins/flex-grid"; @import "../mixins/flexbox"; @import "../mixins/ease"; @import "../mixins/figures"; @import "../variables/breakpoints"; $spacing: 20px; $light-shade: #f4f4f4; .homepage-player { background-color: #F5F7F7; padding-top: $spacing; } .homepage-player-nav { margin: 0 $spacing; } @media all and (min-width: $screen-md) { .homepage-player-nav { max-width: 200px; min-width: 200px; } .homepage-player bulbs-carousel-track { @include overflow-flexgrid( $columns: 5, $gutter: 20 ); } }
////////////////////////////////////// // ******************************** // // Homepage Player // // ******************************** // ////////////////////////////////////// @import "../mixins/flex-grid"; @import "../mixins/flexbox"; @import "../mixins/ease"; @import "../mixins/figures"; @import "../variables/breakpoints"; $spacing: 20px; $light-shade: #f4f4f4; .homepage-player { background-color: #F5F7F7; padding-top: $spacing; } .homepage-player-nav { margin: 0 $spacing; } @media all and (min-width: $screen-md) { .homepage-player-nav { max-width: 200px; min-width: 200px; } .homepage-player bulbs-carousel-track { @include overflow-flexgrid( $columns: 3, $gutter: 20 ); } } @media all and (min-width: $screen-xlg) { .homepage-player bulbs-carousel-track { @include overflow-flexgrid( $columns: 5, $gutter: 20 ); } }
Use 3 columns on tablet
Use 3 columns on tablet
SCSS
mit
theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs
scss
## Code Before: ////////////////////////////////////// // ******************************** // // Homepage Player // // ******************************** // ////////////////////////////////////// @import "../mixins/flex-grid"; @import "../mixins/flexbox"; @import "../mixins/ease"; @import "../mixins/figures"; @import "../variables/breakpoints"; $spacing: 20px; $light-shade: #f4f4f4; .homepage-player { background-color: #F5F7F7; padding-top: $spacing; } .homepage-player-nav { margin: 0 $spacing; } @media all and (min-width: $screen-md) { .homepage-player-nav { max-width: 200px; min-width: 200px; } .homepage-player bulbs-carousel-track { @include overflow-flexgrid( $columns: 5, $gutter: 20 ); } } ## Instruction: Use 3 columns on tablet ## Code After: ////////////////////////////////////// // ******************************** // // Homepage Player // // ******************************** // ////////////////////////////////////// @import "../mixins/flex-grid"; @import "../mixins/flexbox"; @import "../mixins/ease"; @import "../mixins/figures"; @import "../variables/breakpoints"; $spacing: 20px; $light-shade: #f4f4f4; .homepage-player { background-color: #F5F7F7; padding-top: $spacing; } .homepage-player-nav { margin: 0 $spacing; } @media all and (min-width: $screen-md) { .homepage-player-nav { max-width: 200px; min-width: 200px; } .homepage-player bulbs-carousel-track { @include overflow-flexgrid( $columns: 3, $gutter: 20 ); } } @media all and (min-width: $screen-xlg) { .homepage-player bulbs-carousel-track { @include overflow-flexgrid( $columns: 5, $gutter: 20 ); } }
////////////////////////////////////// // ******************************** // // Homepage Player // // ******************************** // ////////////////////////////////////// @import "../mixins/flex-grid"; @import "../mixins/flexbox"; @import "../mixins/ease"; @import "../mixins/figures"; @import "../variables/breakpoints"; $spacing: 20px; $light-shade: #f4f4f4; .homepage-player { background-color: #F5F7F7; padding-top: $spacing; } .homepage-player-nav { margin: 0 $spacing; } @media all and (min-width: $screen-md) { .homepage-player-nav { max-width: 200px; min-width: 200px; } .homepage-player bulbs-carousel-track { @include overflow-flexgrid( + $columns: 3, + $gutter: 20 + ); + } + } + + @media all and (min-width: $screen-xlg) { + .homepage-player bulbs-carousel-track { + @include overflow-flexgrid( $columns: 5, $gutter: 20 ); } }
9
0.243243
9
0
f6d7dc21583f2bfcc87c8a90d74d346a1528898e
lib/commands/place_command.rb
lib/commands/place_command.rb
class PlaceCommand def initialize(x, y, direction) @x = x @y = y @direction = direction end def valid?(_, board) (0..board.x_size).include?(@x.to_i) && (0..board.y_size).include?(@y.to_i) end def execute(robot) robot.place(@x, @y, @direction) end end
class PlaceCommand def initialize(x, y, direction) @x = x.to_i @y = y.to_i @direction = direction end def valid?(_, board) (0..board.x_size).include?(@x) && (0..board.y_size).include?(@y) end def execute(robot) robot.place(@x, @y, @direction) end end
Initialize PlaceCommand with an integer instead of string
Initialize PlaceCommand with an integer instead of string
Ruby
mit
krzyho/toy_robot_simulator,krzyho/toy_robot_simulator
ruby
## Code Before: class PlaceCommand def initialize(x, y, direction) @x = x @y = y @direction = direction end def valid?(_, board) (0..board.x_size).include?(@x.to_i) && (0..board.y_size).include?(@y.to_i) end def execute(robot) robot.place(@x, @y, @direction) end end ## Instruction: Initialize PlaceCommand with an integer instead of string ## Code After: class PlaceCommand def initialize(x, y, direction) @x = x.to_i @y = y.to_i @direction = direction end def valid?(_, board) (0..board.x_size).include?(@x) && (0..board.y_size).include?(@y) end def execute(robot) robot.place(@x, @y, @direction) end end
class PlaceCommand def initialize(x, y, direction) - @x = x + @x = x.to_i ? +++++ - @y = y + @y = y.to_i ? +++++ @direction = direction end def valid?(_, board) - (0..board.x_size).include?(@x.to_i) && (0..board.y_size).include?(@y.to_i) ? ----- ----- + (0..board.x_size).include?(@x) && (0..board.y_size).include?(@y) end def execute(robot) robot.place(@x, @y, @direction) end end
6
0.4
3
3
524370711c0856be8b3efb4aff543bb96da102ce
ui/component/common/wait-until-on-page.jsx
ui/component/common/wait-until-on-page.jsx
// @flow import React from 'react'; import debounce from 'util/debounce'; const DEBOUNCE_SCROLL_HANDLER_MS = 300; type Props = { children: any, lastUpdateDate?: any, skipWait?: boolean, placeholder?: any, }; export default function WaitUntilOnPage(props: Props) { const ref = React.useRef(); const [shouldRender, setShouldRender] = React.useState(false); React.useEffect(() => { setShouldRender(false); }, [props.lastUpdateDate]); React.useEffect(() => { const handleDisplayingRef = debounce((e) => { const element = ref && ref.current; if (element) { const bounding = element.getBoundingClientRect(); if ( bounding.bottom >= 0 && bounding.right >= 0 && // $FlowFixMe bounding.top <= (window.innerHeight || document.documentElement.clientHeight) && // $FlowFixMe bounding.left <= (window.innerWidth || document.documentElement.clientWidth) ) { setShouldRender(true); } } if (element && !shouldRender) { window.addEventListener('scroll', handleDisplayingRef); return () => window.removeEventListener('scroll', handleDisplayingRef); } }, DEBOUNCE_SCROLL_HANDLER_MS); if (ref) { handleDisplayingRef(); } }, [ref, setShouldRender, shouldRender]); const render = props.skipWait || shouldRender; return ( <div ref={ref}> {render && props.children} {!render && props.placeholder !== undefined && props.placeholder} </div> ); }
// @flow import React from 'react'; import debounce from 'util/debounce'; const DEBOUNCE_SCROLL_HANDLER_MS = 25; type Props = { children: any, skipWait?: boolean, placeholder?: any, }; export default function WaitUntilOnPage(props: Props) { const ref = React.useRef(); const [shouldRender, setShouldRender] = React.useState(false); React.useEffect(() => { const handleDisplayingRef = debounce((e) => { const element = ref && ref.current; if (element) { const bounding = element.getBoundingClientRect(); if ( bounding.bottom >= 0 && bounding.right >= 0 && // $FlowFixMe bounding.top <= (window.innerHeight || document.documentElement.clientHeight) && // $FlowFixMe bounding.left <= (window.innerWidth || document.documentElement.clientWidth) ) { setShouldRender(true); } } if (element && !shouldRender) { window.addEventListener('scroll', handleDisplayingRef); return () => window.removeEventListener('scroll', handleDisplayingRef); } }, DEBOUNCE_SCROLL_HANDLER_MS); if (ref) { handleDisplayingRef(); } }, [ref, setShouldRender, shouldRender]); const render = props.skipWait || shouldRender; return ( <div ref={ref}> {render && props.children} {!render && props.placeholder !== undefined && props.placeholder} </div> ); }
Reduce debounce ms; remove unused hack
WaitUntilOnPage: Reduce debounce ms; remove unused hack (1) Reduced the debouncing duration so that the final element can be rendered asap after visible. - If the user is scrolling non-stop, it would continue to debounce and the GUI ends up not showing the final element. - 25ms seems enough to prevent the initial false-positive that occurs in the scenario of "adjacent/upper elements resized late, so our element was briefly on screen when mounted". If not enough, we can make this a parameter. (2) Removed `lastUpdateDate` that was a quick hack for Recommended section. We don't use it on that element anymore, so remove the hack to keep the file clean.
JSX
mit
lbryio/lbry-app,lbryio/lbry-app
jsx
## Code Before: // @flow import React from 'react'; import debounce from 'util/debounce'; const DEBOUNCE_SCROLL_HANDLER_MS = 300; type Props = { children: any, lastUpdateDate?: any, skipWait?: boolean, placeholder?: any, }; export default function WaitUntilOnPage(props: Props) { const ref = React.useRef(); const [shouldRender, setShouldRender] = React.useState(false); React.useEffect(() => { setShouldRender(false); }, [props.lastUpdateDate]); React.useEffect(() => { const handleDisplayingRef = debounce((e) => { const element = ref && ref.current; if (element) { const bounding = element.getBoundingClientRect(); if ( bounding.bottom >= 0 && bounding.right >= 0 && // $FlowFixMe bounding.top <= (window.innerHeight || document.documentElement.clientHeight) && // $FlowFixMe bounding.left <= (window.innerWidth || document.documentElement.clientWidth) ) { setShouldRender(true); } } if (element && !shouldRender) { window.addEventListener('scroll', handleDisplayingRef); return () => window.removeEventListener('scroll', handleDisplayingRef); } }, DEBOUNCE_SCROLL_HANDLER_MS); if (ref) { handleDisplayingRef(); } }, [ref, setShouldRender, shouldRender]); const render = props.skipWait || shouldRender; return ( <div ref={ref}> {render && props.children} {!render && props.placeholder !== undefined && props.placeholder} </div> ); } ## Instruction: WaitUntilOnPage: Reduce debounce ms; remove unused hack (1) Reduced the debouncing duration so that the final element can be rendered asap after visible. - If the user is scrolling non-stop, it would continue to debounce and the GUI ends up not showing the final element. - 25ms seems enough to prevent the initial false-positive that occurs in the scenario of "adjacent/upper elements resized late, so our element was briefly on screen when mounted". If not enough, we can make this a parameter. (2) Removed `lastUpdateDate` that was a quick hack for Recommended section. We don't use it on that element anymore, so remove the hack to keep the file clean. ## Code After: // @flow import React from 'react'; import debounce from 'util/debounce'; const DEBOUNCE_SCROLL_HANDLER_MS = 25; type Props = { children: any, skipWait?: boolean, placeholder?: any, }; export default function WaitUntilOnPage(props: Props) { const ref = React.useRef(); const [shouldRender, setShouldRender] = React.useState(false); React.useEffect(() => { const handleDisplayingRef = debounce((e) => { const element = ref && ref.current; if (element) { const bounding = element.getBoundingClientRect(); if ( bounding.bottom >= 0 && bounding.right >= 0 && // $FlowFixMe bounding.top <= (window.innerHeight || document.documentElement.clientHeight) && // $FlowFixMe bounding.left <= (window.innerWidth || document.documentElement.clientWidth) ) { setShouldRender(true); } } if (element && !shouldRender) { window.addEventListener('scroll', handleDisplayingRef); return () => window.removeEventListener('scroll', handleDisplayingRef); } }, DEBOUNCE_SCROLL_HANDLER_MS); if (ref) { handleDisplayingRef(); } }, [ref, setShouldRender, shouldRender]); const render = props.skipWait || shouldRender; return ( <div ref={ref}> {render && props.children} {!render && props.placeholder !== undefined && props.placeholder} </div> ); }
// @flow import React from 'react'; import debounce from 'util/debounce'; - const DEBOUNCE_SCROLL_HANDLER_MS = 300; ? ^^^ + const DEBOUNCE_SCROLL_HANDLER_MS = 25; ? ^^ type Props = { children: any, - lastUpdateDate?: any, skipWait?: boolean, placeholder?: any, }; export default function WaitUntilOnPage(props: Props) { const ref = React.useRef(); const [shouldRender, setShouldRender] = React.useState(false); - - React.useEffect(() => { - setShouldRender(false); - }, [props.lastUpdateDate]); React.useEffect(() => { const handleDisplayingRef = debounce((e) => { const element = ref && ref.current; if (element) { const bounding = element.getBoundingClientRect(); if ( bounding.bottom >= 0 && bounding.right >= 0 && // $FlowFixMe bounding.top <= (window.innerHeight || document.documentElement.clientHeight) && // $FlowFixMe bounding.left <= (window.innerWidth || document.documentElement.clientWidth) ) { setShouldRender(true); } } if (element && !shouldRender) { window.addEventListener('scroll', handleDisplayingRef); return () => window.removeEventListener('scroll', handleDisplayingRef); } }, DEBOUNCE_SCROLL_HANDLER_MS); if (ref) { handleDisplayingRef(); } }, [ref, setShouldRender, shouldRender]); const render = props.skipWait || shouldRender; return ( <div ref={ref}> {render && props.children} {!render && props.placeholder !== undefined && props.placeholder} </div> ); }
7
0.12069
1
6
e600bdbac837de0d7da3dadb981f03400a1629fe
jenkins/jobs/diskimage-builder.yaml
jenkins/jobs/diskimage-builder.yaml
- job-template: name: 'gate-dib-dsvm-functests-{node}' node: '{node}' builders: - shell: | #!/bin/bash -eux cd ~ /usr/zuul-env/bin/zuul-cloner --cache-dir /opt/git \ git://git.openstack.org \ openstack/diskimage-builder \ openstack/dib-utils export PATH=$PATH:$(pwd)/openstack/dib-utils/bin export PATH=$PATH:$(pwd)/openstack/diskimage-builder/bin ./openstack/diskimage-builder/tests/install_test_deps.sh ./openstack/diskimage-builder/tests/run_functests.sh publishers: - console-log
- job-template: name: 'gate-dib-dsvm-functests-{node}' node: '{node}' wrappers: - build-timeout: timeout: 60 - timestamps builders: - shell: | #!/bin/bash -eux cd ~ /usr/zuul-env/bin/zuul-cloner --cache-dir /opt/git \ git://git.openstack.org \ openstack/diskimage-builder \ openstack/dib-utils export PATH=$PATH:$(pwd)/openstack/dib-utils/bin export PATH=$PATH:$(pwd)/openstack/diskimage-builder/bin ./openstack/diskimage-builder/tests/install_test_deps.sh ./openstack/diskimage-builder/tests/run_functests.sh publishers: - console-log
Extend the timeout for DIB tests
Extend the timeout for DIB tests When performing image boot tests we run up against the 30min default timeout. We are pretty far in the test run at this point, so extenting the timeout to 60min should be enough. Change-Id: I0254e08e2bee35f4db5ec9deb185e328e67a6d5a
YAML
apache-2.0
dongwenjuan/project-config,openstack-infra/project-config,noorul/os-project-config,Tesora/tesora-project-config,coolsvap/project-config,anbangr/osci-project-config,coolsvap/project-config,openstack-infra/project-config,dongwenjuan/project-config,noorul/os-project-config,Tesora/tesora-project-config,anbangr/osci-project-config
yaml
## Code Before: - job-template: name: 'gate-dib-dsvm-functests-{node}' node: '{node}' builders: - shell: | #!/bin/bash -eux cd ~ /usr/zuul-env/bin/zuul-cloner --cache-dir /opt/git \ git://git.openstack.org \ openstack/diskimage-builder \ openstack/dib-utils export PATH=$PATH:$(pwd)/openstack/dib-utils/bin export PATH=$PATH:$(pwd)/openstack/diskimage-builder/bin ./openstack/diskimage-builder/tests/install_test_deps.sh ./openstack/diskimage-builder/tests/run_functests.sh publishers: - console-log ## Instruction: Extend the timeout for DIB tests When performing image boot tests we run up against the 30min default timeout. We are pretty far in the test run at this point, so extenting the timeout to 60min should be enough. Change-Id: I0254e08e2bee35f4db5ec9deb185e328e67a6d5a ## Code After: - job-template: name: 'gate-dib-dsvm-functests-{node}' node: '{node}' wrappers: - build-timeout: timeout: 60 - timestamps builders: - shell: | #!/bin/bash -eux cd ~ /usr/zuul-env/bin/zuul-cloner --cache-dir /opt/git \ git://git.openstack.org \ openstack/diskimage-builder \ openstack/dib-utils export PATH=$PATH:$(pwd)/openstack/dib-utils/bin export PATH=$PATH:$(pwd)/openstack/diskimage-builder/bin ./openstack/diskimage-builder/tests/install_test_deps.sh ./openstack/diskimage-builder/tests/run_functests.sh publishers: - console-log
- job-template: name: 'gate-dib-dsvm-functests-{node}' node: '{node}' + + wrappers: + - build-timeout: + timeout: 60 + - timestamps builders: - shell: | #!/bin/bash -eux cd ~ /usr/zuul-env/bin/zuul-cloner --cache-dir /opt/git \ git://git.openstack.org \ openstack/diskimage-builder \ openstack/dib-utils export PATH=$PATH:$(pwd)/openstack/dib-utils/bin export PATH=$PATH:$(pwd)/openstack/diskimage-builder/bin ./openstack/diskimage-builder/tests/install_test_deps.sh ./openstack/diskimage-builder/tests/run_functests.sh publishers: - console-log
5
0.227273
5
0
1364119b0bd6f93451a35c3d647a7a689752426e
.pre-commit-config.yaml
.pre-commit-config.yaml
repos: - repo: https://github.com/ambv/black rev: 18.9b0 hooks: - id: black language_version: python3.6 - repo: https://github.com/pre-commit/pre-commit-hooks rev: v1.4.0 # Use the ref you want to point at hooks: - id: trailing-whitespace - id: check-ast - id: check-merge-conflict - id: flake8 language_version: python2.7 - repo: https://github.com/CanalTP/navitia-pre-commit rev: master hooks: - id: clang-format-6.0 verbose: true exclude: ^source/third_party/ files: \.(c|cc|cxx|cpp|h|hpp|hxx)$ args: [-i] - repo: https://github.com/pre-commit/mirrors-mypy rev: v0.670 hooks: - id: mypy args: [--ignore-missing-imports, --py2] files: source/jormungandr/jormungandr language_version: python3.6
repos: - repo: https://github.com/ambv/black rev: 18.9b0 hooks: - id: black language_version: python3.6 - repo: https://github.com/pre-commit/pre-commit-hooks rev: v1.4.0 # Use the ref you want to point at hooks: - id: trailing-whitespace - id: check-ast - id: check-merge-conflict - id: flake8 language_version: python2.7 - repo: https://github.com/CanalTP/navitia-pre-commit rev: master hooks: - id: clang-format-6.0 verbose: true exclude: ^source/third_party/ files: \.(c|cc|cxx|cpp|h|hpp|hxx)$ args: [-i] - repo: https://github.com/pre-commit/mirrors-mypy rev: v0.670 hooks: - id: mypy args: [--ignore-missing-imports, --py2] files: source language_version: python3 exclude: /monitor/|/third_party/|/tests/|/sql/|env\.py$|setup\.py$
Check all python files with Mypy
Check all python files with Mypy * Mypy check any python projects and not only Jormungandr * allow to use any version of Python3 for Mypy
YAML
agpl-3.0
xlqian/navitia,CanalTP/navitia,xlqian/navitia,Tisseo/navitia,Tisseo/navitia,kinnou02/navitia,Tisseo/navitia,kinnou02/navitia,kinnou02/navitia,CanalTP/navitia,kinnou02/navitia,CanalTP/navitia,CanalTP/navitia,xlqian/navitia,CanalTP/navitia,Tisseo/navitia,xlqian/navitia,xlqian/navitia,Tisseo/navitia
yaml
## Code Before: repos: - repo: https://github.com/ambv/black rev: 18.9b0 hooks: - id: black language_version: python3.6 - repo: https://github.com/pre-commit/pre-commit-hooks rev: v1.4.0 # Use the ref you want to point at hooks: - id: trailing-whitespace - id: check-ast - id: check-merge-conflict - id: flake8 language_version: python2.7 - repo: https://github.com/CanalTP/navitia-pre-commit rev: master hooks: - id: clang-format-6.0 verbose: true exclude: ^source/third_party/ files: \.(c|cc|cxx|cpp|h|hpp|hxx)$ args: [-i] - repo: https://github.com/pre-commit/mirrors-mypy rev: v0.670 hooks: - id: mypy args: [--ignore-missing-imports, --py2] files: source/jormungandr/jormungandr language_version: python3.6 ## Instruction: Check all python files with Mypy * Mypy check any python projects and not only Jormungandr * allow to use any version of Python3 for Mypy ## Code After: repos: - repo: https://github.com/ambv/black rev: 18.9b0 hooks: - id: black language_version: python3.6 - repo: https://github.com/pre-commit/pre-commit-hooks rev: v1.4.0 # Use the ref you want to point at hooks: - id: trailing-whitespace - id: check-ast - id: check-merge-conflict - id: flake8 language_version: python2.7 - repo: https://github.com/CanalTP/navitia-pre-commit rev: master hooks: - id: clang-format-6.0 verbose: true exclude: ^source/third_party/ files: \.(c|cc|cxx|cpp|h|hpp|hxx)$ args: [-i] - repo: https://github.com/pre-commit/mirrors-mypy rev: v0.670 hooks: - id: mypy args: [--ignore-missing-imports, --py2] files: source language_version: python3 exclude: /monitor/|/third_party/|/tests/|/sql/|env\.py$|setup\.py$
repos: - repo: https://github.com/ambv/black rev: 18.9b0 hooks: - id: black language_version: python3.6 - repo: https://github.com/pre-commit/pre-commit-hooks rev: v1.4.0 # Use the ref you want to point at hooks: - id: trailing-whitespace - id: check-ast - id: check-merge-conflict - id: flake8 language_version: python2.7 - repo: https://github.com/CanalTP/navitia-pre-commit rev: master hooks: - id: clang-format-6.0 verbose: true exclude: ^source/third_party/ files: \.(c|cc|cxx|cpp|h|hpp|hxx)$ args: [-i] - repo: https://github.com/pre-commit/mirrors-mypy rev: v0.670 hooks: - id: mypy args: [--ignore-missing-imports, --py2] - files: source/jormungandr/jormungandr + files: source - language_version: python3.6 ? -- + language_version: python3 + exclude: /monitor/|/third_party/|/tests/|/sql/|env\.py$|setup\.py$
5
0.172414
3
2
4614c56ad3e919260bc7def4a70285187c2364c5
src/main/java/com/capitalistlepton/model/Bacterium.java
src/main/java/com/capitalistlepton/model/Bacterium.java
package com.capitalistlepton.model; import java.util.Random; /** * Created by zanelittrell on 2/5/17. */ public class Bacterium { private static final Random rand = new Random(); private int x; private int y; private String genotype; public Bacterium(String parentGenotype, int x, int y) { float mutation = rand.nextFloat(); if (mutation > 0.99f) { genotype = "AABBCc"; } else { genotype = parentGenotype; } this.x = x; this.y = y; } public int getX() { return x; } public int getY() { return y; } public String getGenotype() { return genotype; } }
package com.capitalistlepton.model; import java.util.Random; /** * Created by zanelittrell on 2/5/17. */ public class Bacterium { private static final Random rand = new Random(); private static final float mutationRate = 0.99f; private int x; private int y; private String genotype; public Bacterium(String parentGenotype, int x, int y) { this.genotype = generateGenotype(parentGenotype); this.x = x; this.y = y; } public int getX() { return x; } public int getY() { return y; } public String getGenotype() { return genotype; } private static String generateGenotype(String parentGenotype) { StringBuilder gen = new StringBuilder(parentGenotype); for (int i = 0; i < parentGenotype.length(); i += 2) { if (rand.nextFloat() > mutationRate) { if (rand.nextFloat() > 0.75f) { gen.setCharAt(i, Character.toLowerCase(gen.charAt(i))); gen.setCharAt(i+1, Character.toLowerCase(gen.charAt(i+1))); } else if(rand.nextFloat() > 0.5f) { gen.setCharAt(i, Character.toTitleCase(gen.charAt(i))); gen.setCharAt(i+1, Character.toLowerCase(gen.charAt(i+1))); } else { gen.setCharAt(i, Character.toUpperCase(gen.charAt(i))); gen.setCharAt(i+1, Character.toUpperCase(gen.charAt(i+1))); } } } return gen.toString(); } }
Add random mutation method for when bacteria are created.
Add random mutation method for when bacteria are created.
Java
apache-2.0
CapitalistLepton/Plague
java
## Code Before: package com.capitalistlepton.model; import java.util.Random; /** * Created by zanelittrell on 2/5/17. */ public class Bacterium { private static final Random rand = new Random(); private int x; private int y; private String genotype; public Bacterium(String parentGenotype, int x, int y) { float mutation = rand.nextFloat(); if (mutation > 0.99f) { genotype = "AABBCc"; } else { genotype = parentGenotype; } this.x = x; this.y = y; } public int getX() { return x; } public int getY() { return y; } public String getGenotype() { return genotype; } } ## Instruction: Add random mutation method for when bacteria are created. ## Code After: package com.capitalistlepton.model; import java.util.Random; /** * Created by zanelittrell on 2/5/17. */ public class Bacterium { private static final Random rand = new Random(); private static final float mutationRate = 0.99f; private int x; private int y; private String genotype; public Bacterium(String parentGenotype, int x, int y) { this.genotype = generateGenotype(parentGenotype); this.x = x; this.y = y; } public int getX() { return x; } public int getY() { return y; } public String getGenotype() { return genotype; } private static String generateGenotype(String parentGenotype) { StringBuilder gen = new StringBuilder(parentGenotype); for (int i = 0; i < parentGenotype.length(); i += 2) { if (rand.nextFloat() > mutationRate) { if (rand.nextFloat() > 0.75f) { gen.setCharAt(i, Character.toLowerCase(gen.charAt(i))); gen.setCharAt(i+1, Character.toLowerCase(gen.charAt(i+1))); } else if(rand.nextFloat() > 0.5f) { gen.setCharAt(i, Character.toTitleCase(gen.charAt(i))); gen.setCharAt(i+1, Character.toLowerCase(gen.charAt(i+1))); } else { gen.setCharAt(i, Character.toUpperCase(gen.charAt(i))); gen.setCharAt(i+1, Character.toUpperCase(gen.charAt(i+1))); } } } return gen.toString(); } }
package com.capitalistlepton.model; import java.util.Random; /** * Created by zanelittrell on 2/5/17. */ public class Bacterium { private static final Random rand = new Random(); + private static final float mutationRate = 0.99f; private int x; private int y; private String genotype; public Bacterium(String parentGenotype, int x, int y) { + this.genotype = generateGenotype(parentGenotype); - float mutation = rand.nextFloat(); - if (mutation > 0.99f) { - genotype = "AABBCc"; - } else { - genotype = parentGenotype; - } this.x = x; this.y = y; } public int getX() { return x; } public int getY() { return y; } public String getGenotype() { return genotype; } + + private static String generateGenotype(String parentGenotype) { + StringBuilder gen = new StringBuilder(parentGenotype); + for (int i = 0; i < parentGenotype.length(); i += 2) { + if (rand.nextFloat() > mutationRate) { + if (rand.nextFloat() > 0.75f) { + gen.setCharAt(i, Character.toLowerCase(gen.charAt(i))); + gen.setCharAt(i+1, Character.toLowerCase(gen.charAt(i+1))); + } else if(rand.nextFloat() > 0.5f) { + gen.setCharAt(i, Character.toTitleCase(gen.charAt(i))); + gen.setCharAt(i+1, Character.toLowerCase(gen.charAt(i+1))); + } else { + gen.setCharAt(i, Character.toUpperCase(gen.charAt(i))); + gen.setCharAt(i+1, Character.toUpperCase(gen.charAt(i+1))); + } + } + } + return gen.toString(); + } }
27
0.9
21
6
87e875756947b383b9c851110ba012b477878f52
components/bt/test/CMakeLists.txt
components/bt/test/CMakeLists.txt
if(CONFIG_BT_ENABLED) set(COMPONENT_SRCDIRS ".") set(COMPONENT_ADD_INCLUDEDIRS ".") endif() set(COMPONENT_REQUIRES unity nvs_flash bt) register_component()
if(CONFIG_BT_ENABLED OR CMAKE_BUILD_EARLY_EXPANSION) set(COMPONENT_SRCDIRS ".") set(COMPONENT_ADD_INCLUDEDIRS ".") set(COMPONENT_REQUIRES unity nvs_flash bt) register_component() endif()
Fix unit tests build with CMake
bt: Fix unit tests build with CMake
Text
apache-2.0
espressif/esp-idf,espressif/esp-idf,espressif/esp-idf,espressif/esp-idf
text
## Code Before: if(CONFIG_BT_ENABLED) set(COMPONENT_SRCDIRS ".") set(COMPONENT_ADD_INCLUDEDIRS ".") endif() set(COMPONENT_REQUIRES unity nvs_flash bt) register_component() ## Instruction: bt: Fix unit tests build with CMake ## Code After: if(CONFIG_BT_ENABLED OR CMAKE_BUILD_EARLY_EXPANSION) set(COMPONENT_SRCDIRS ".") set(COMPONENT_ADD_INCLUDEDIRS ".") set(COMPONENT_REQUIRES unity nvs_flash bt) register_component() endif()
- if(CONFIG_BT_ENABLED) + if(CONFIG_BT_ENABLED OR CMAKE_BUILD_EARLY_EXPANSION) set(COMPONENT_SRCDIRS ".") set(COMPONENT_ADD_INCLUDEDIRS ".") + set(COMPONENT_REQUIRES unity nvs_flash bt) + + register_component() endif() - - set(COMPONENT_REQUIRES unity nvs_flash bt) - - register_component()
9
1.125
4
5
5a180797353a68e33f155517022f66fdba0a837a
lib/earth/industry/industry.rb
lib/earth/industry/industry.rb
class Industry < ActiveRecord::Base set_primary_key :naics_code has_many :merchant_category_industries, :foreign_key => 'naics_code' has_many :industry_product_lines, :foreign_key => 'naics_code' has_many :product_lines, :through => :industry_product_lines has_many :industry_sectors, :foreign_key => 'naics_code' has_many :sectors, :through => :industry_sectors col :naics_code col :description, :type => :text def trade_industry? prefix = naics_code.to_s[0,2] %w{42 44 45}.include?(prefix) end end
class Industry < ActiveRecord::Base set_primary_key :naics_code has_many :merchant_category_industries, :foreign_key => 'naics_code' has_many :industry_product_lines, :foreign_key => 'naics_code' has_many :product_lines, :through => :industry_product_lines has_many :industry_sectors, :foreign_key => 'naics_code' has_many :sectors, :through => :industry_sectors col :naics_code col :description, :type => :text data_miner do import "the U.S. Census 2002 NAICS code list", :url => 'http://www.census.gov/epcd/naics02/naicod02.txt', :skip => 4, :headers => false, :delimiter => ' ' do key 'naics_code', :field_number => 0 store 'description', :field_number => 1 end end def trade_industry? prefix = naics_code.to_s[0,2] %w{42 44 45}.include?(prefix) end end
Add NAICS import to Industry
Add NAICS import to Industry
Ruby
agpl-3.0
faradayio/earth
ruby
## Code Before: class Industry < ActiveRecord::Base set_primary_key :naics_code has_many :merchant_category_industries, :foreign_key => 'naics_code' has_many :industry_product_lines, :foreign_key => 'naics_code' has_many :product_lines, :through => :industry_product_lines has_many :industry_sectors, :foreign_key => 'naics_code' has_many :sectors, :through => :industry_sectors col :naics_code col :description, :type => :text def trade_industry? prefix = naics_code.to_s[0,2] %w{42 44 45}.include?(prefix) end end ## Instruction: Add NAICS import to Industry ## Code After: class Industry < ActiveRecord::Base set_primary_key :naics_code has_many :merchant_category_industries, :foreign_key => 'naics_code' has_many :industry_product_lines, :foreign_key => 'naics_code' has_many :product_lines, :through => :industry_product_lines has_many :industry_sectors, :foreign_key => 'naics_code' has_many :sectors, :through => :industry_sectors col :naics_code col :description, :type => :text data_miner do import "the U.S. Census 2002 NAICS code list", :url => 'http://www.census.gov/epcd/naics02/naicod02.txt', :skip => 4, :headers => false, :delimiter => ' ' do key 'naics_code', :field_number => 0 store 'description', :field_number => 1 end end def trade_industry? prefix = naics_code.to_s[0,2] %w{42 44 45}.include?(prefix) end end
class Industry < ActiveRecord::Base set_primary_key :naics_code has_many :merchant_category_industries, :foreign_key => 'naics_code' has_many :industry_product_lines, :foreign_key => 'naics_code' has_many :product_lines, :through => :industry_product_lines has_many :industry_sectors, :foreign_key => 'naics_code' has_many :sectors, :through => :industry_sectors col :naics_code col :description, :type => :text + + data_miner do + import "the U.S. Census 2002 NAICS code list", + :url => 'http://www.census.gov/epcd/naics02/naicod02.txt', + :skip => 4, + :headers => false, + :delimiter => ' ' do + key 'naics_code', :field_number => 0 + store 'description', :field_number => 1 + end + end def trade_industry? prefix = naics_code.to_s[0,2] %w{42 44 45}.include?(prefix) end end
11
0.578947
11
0
b89ba89cdc87f926030a52ed595609897e62aab5
Casks/ccmenu.rb
Casks/ccmenu.rb
class Ccmenu < Cask version '1.7' sha256 '974a2022dbc9494958334ee8f02e08df7ed184e1f421a53d623dfbeaadf08a2c' url 'https://downloads.sourceforge.net/project/ccmenu/CCMenu/1.7/ccmenu-1.7-b.dmg' appcast 'http://ccmenu.sourceforge.net/update-stable.xml' homepage 'http://ccmenu.sourceforge.net/' link 'CCMenu.app' end
class Ccmenu < Cask version '1.7' sha256 '974a2022dbc9494958334ee8f02e08df7ed184e1f421a53d623dfbeaadf08a2c' url "https://downloads.sourceforge.net/project/ccmenu/CCMenu/#{version}/ccmenu-#{version}-b.dmg" appcast 'http://ccmenu.sourceforge.net/update-stable.xml' homepage 'http://ccmenu.sourceforge.net/' link 'CCMenu.app' end
Update CCMenu: version number in url stanza
Update CCMenu: version number in url stanza Updated to [facilitate future updates][ref]. [ref]: https://github.com/caskroom/homebrew-cask/pull/4910
Ruby
bsd-2-clause
a-x-/homebrew-cask,mauricerkelly/homebrew-cask,BahtiyarB/homebrew-cask,onlynone/homebrew-cask,chrisfinazzo/homebrew-cask,tranc99/homebrew-cask,hakamadare/homebrew-cask,brianshumate/homebrew-cask,RickWong/homebrew-cask,norio-nomura/homebrew-cask,jonathanwiesel/homebrew-cask,dspeckhard/homebrew-cask,vin047/homebrew-cask,genewoo/homebrew-cask,sjackman/homebrew-cask,wastrachan/homebrew-cask,pinut/homebrew-cask,wmorin/homebrew-cask,gguillotte/homebrew-cask,ponychicken/homebrew-customcask,miguelfrde/homebrew-cask,yumitsu/homebrew-cask,yuhki50/homebrew-cask,kronicd/homebrew-cask,dieterdemeyer/homebrew-cask,kesara/homebrew-cask,lolgear/homebrew-cask,pgr0ss/homebrew-cask,JacopKane/homebrew-cask,diguage/homebrew-cask,MichaelPei/homebrew-cask,alloy/homebrew-cask,pablote/homebrew-cask,sachin21/homebrew-cask,bdhess/homebrew-cask,ohammersmith/homebrew-cask,freeslugs/homebrew-cask,xtian/homebrew-cask,lolgear/homebrew-cask,kamilboratynski/homebrew-cask,mahori/homebrew-cask,MisumiRize/homebrew-cask,shoichiaizawa/homebrew-cask,winkelsdorf/homebrew-cask,pacav69/homebrew-cask,malob/homebrew-cask,imgarylai/homebrew-cask,howie/homebrew-cask,colindunn/homebrew-cask,dictcp/homebrew-cask,yumitsu/homebrew-cask,rogeriopradoj/homebrew-cask,mAAdhaTTah/homebrew-cask,guylabs/homebrew-cask,stephenwade/homebrew-cask,ywfwj2008/homebrew-cask,royalwang/homebrew-cask,boecko/homebrew-cask,chrisfinazzo/homebrew-cask,SentinelWarren/homebrew-cask,jamesmlees/homebrew-cask,fly19890211/homebrew-cask,dvdoliveira/homebrew-cask,petmoo/homebrew-cask,helloIAmPau/homebrew-cask,barravi/homebrew-cask,cfillion/homebrew-cask,unasuke/homebrew-cask,boydj/homebrew-cask,FinalDes/homebrew-cask,amatos/homebrew-cask,xyb/homebrew-cask,afdnlw/homebrew-cask,joschi/homebrew-cask,tsparber/homebrew-cask,goxberry/homebrew-cask,slack4u/homebrew-cask,optikfluffel/homebrew-cask,mwean/homebrew-cask,fanquake/homebrew-cask,zorosteven/homebrew-cask,mattrobenolt/homebrew-cask,mwek/homebrew-cask,josa42/homebrew-cask,phpwutz/homebrew-cask,sebcode/homebrew-cask,scottsuch/homebrew-cask,valepert/homebrew-cask,mrmachine/homebrew-cask,BahtiyarB/homebrew-cask,dcondrey/homebrew-cask,bendoerr/homebrew-cask,nickpellant/homebrew-cask,rhendric/homebrew-cask,artdevjs/homebrew-cask,aktau/homebrew-cask,guerrero/homebrew-cask,epardee/homebrew-cask,rickychilcott/homebrew-cask,coeligena/homebrew-customized,lauantai/homebrew-cask,ericbn/homebrew-cask,johan/homebrew-cask,delphinus35/homebrew-cask,sjackman/homebrew-cask,jen20/homebrew-cask,mikem/homebrew-cask,nivanchikov/homebrew-cask,rickychilcott/homebrew-cask,yurikoles/homebrew-cask,englishm/homebrew-cask,janlugt/homebrew-cask,rajiv/homebrew-cask,lcasey001/homebrew-cask,dwihn0r/homebrew-cask,vitorgalvao/homebrew-cask,jedahan/homebrew-cask,gyndav/homebrew-cask,koenrh/homebrew-cask,tarwich/homebrew-cask,skyyuan/homebrew-cask,cprecioso/homebrew-cask,rubenerd/homebrew-cask,sanchezm/homebrew-cask,Ngrd/homebrew-cask,lantrix/homebrew-cask,hanxue/caskroom,miccal/homebrew-cask,singingwolfboy/homebrew-cask,jangalinski/homebrew-cask,tedski/homebrew-cask,hellosky806/homebrew-cask,ptb/homebrew-cask,ashishb/homebrew-cask,mishari/homebrew-cask,ch3n2k/homebrew-cask,pkq/homebrew-cask,fwiesel/homebrew-cask,yutarody/homebrew-cask,flaviocamilo/homebrew-cask,asins/homebrew-cask,patresi/homebrew-cask,mikem/homebrew-cask,kievechua/homebrew-cask,sgnh/homebrew-cask,cliffcotino/homebrew-cask,kevyau/homebrew-cask,samshadwell/homebrew-cask,leonmachadowilcox/homebrew-cask,githubutilities/homebrew-cask,reelsense/homebrew-cask,blogabe/homebrew-cask,lieuwex/homebrew-cask,kronicd/homebrew-cask,gyugyu/homebrew-cask,scottsuch/homebrew-cask,dunn/homebrew-cask,rubenerd/homebrew-cask,gwaldo/homebrew-cask,elnappo/homebrew-cask,fazo96/homebrew-cask,puffdad/homebrew-cask,johnste/homebrew-cask,adelinofaria/homebrew-cask,zeusdeux/homebrew-cask,ctrevino/homebrew-cask,miku/homebrew-cask,n0ts/homebrew-cask,Amorymeltzer/homebrew-cask,gyndav/homebrew-cask,RogerThiede/homebrew-cask,ianyh/homebrew-cask,neverfox/homebrew-cask,nathanielvarona/homebrew-cask,maxnordlund/homebrew-cask,miku/homebrew-cask,joschi/homebrew-cask,jangalinski/homebrew-cask,robertgzr/homebrew-cask,kpearson/homebrew-cask,sscotth/homebrew-cask,julionc/homebrew-cask,optikfluffel/homebrew-cask,jawshooah/homebrew-cask,gwaldo/homebrew-cask,johndbritton/homebrew-cask,imgarylai/homebrew-cask,stonehippo/homebrew-cask,jhowtan/homebrew-cask,nivanchikov/homebrew-cask,jrwesolo/homebrew-cask,nrlquaker/homebrew-cask,julionc/homebrew-cask,giannitm/homebrew-cask,ohammersmith/homebrew-cask,d/homebrew-cask,Ketouem/homebrew-cask,djakarta-trap/homebrew-myCask,andyli/homebrew-cask,qnm/homebrew-cask,robertgzr/homebrew-cask,xcezx/homebrew-cask,mwilmer/homebrew-cask,bgandon/homebrew-cask,kei-yamazaki/homebrew-cask,colindunn/homebrew-cask,MerelyAPseudonym/homebrew-cask,buo/homebrew-cask,danielbayley/homebrew-cask,andersonba/homebrew-cask,jpmat296/homebrew-cask,nickpellant/homebrew-cask,mhubig/homebrew-cask,CameronGarrett/homebrew-cask,shonjir/homebrew-cask,johnste/homebrew-cask,kolomiichenko/homebrew-cask,ldong/homebrew-cask,prime8/homebrew-cask,af/homebrew-cask,supriyantomaftuh/homebrew-cask,crzrcn/homebrew-cask,delphinus35/homebrew-cask,chuanxd/homebrew-cask,ericbn/homebrew-cask,hackhandslabs/homebrew-cask,thomanq/homebrew-cask,jiashuw/homebrew-cask,enriclluelles/homebrew-cask,farmerchris/homebrew-cask,wastrachan/homebrew-cask,taherio/homebrew-cask,jawshooah/homebrew-cask,bosr/homebrew-cask,MoOx/homebrew-cask,zerrot/homebrew-cask,retbrown/homebrew-cask,tangestani/homebrew-cask,CameronGarrett/homebrew-cask,skatsuta/homebrew-cask,LaurentFough/homebrew-cask,artdevjs/homebrew-cask,d/homebrew-cask,0xadada/homebrew-cask,Labutin/homebrew-cask,napaxton/homebrew-cask,mariusbutuc/homebrew-cask,mariusbutuc/homebrew-cask,dustinblackman/homebrew-cask,deizel/homebrew-cask,julionc/homebrew-cask,JikkuJose/homebrew-cask,corbt/homebrew-cask,cblecker/homebrew-cask,jalaziz/homebrew-cask,skyyuan/homebrew-cask,moimikey/homebrew-cask,janlugt/homebrew-cask,stevenmaguire/homebrew-cask,catap/homebrew-cask,colindean/homebrew-cask,nicolas-brousse/homebrew-cask,dcondrey/homebrew-cask,nanoxd/homebrew-cask,xcezx/homebrew-cask,jtriley/homebrew-cask,mattfelsen/homebrew-cask,chrisfinazzo/homebrew-cask,gerrymiller/homebrew-cask,yuhki50/homebrew-cask,devmynd/homebrew-cask,KosherBacon/homebrew-cask,gerrypower/homebrew-cask,astorije/homebrew-cask,taherio/homebrew-cask,puffdad/homebrew-cask,dlovitch/homebrew-cask,AndreTheHunter/homebrew-cask,kongslund/homebrew-cask,wuman/homebrew-cask,danielbayley/homebrew-cask,wmorin/homebrew-cask,AnastasiaSulyagina/homebrew-cask,hristozov/homebrew-cask,moogar0880/homebrew-cask,squid314/homebrew-cask,tan9/homebrew-cask,caskroom/homebrew-cask,imgarylai/homebrew-cask,josa42/homebrew-cask,Ibuprofen/homebrew-cask,retrography/homebrew-cask,xalep/homebrew-cask,paulbreslin/homebrew-cask,guylabs/homebrew-cask,linc01n/homebrew-cask,mjgardner/homebrew-cask,epmatsw/homebrew-cask,jalaziz/homebrew-cask,jbeagley52/homebrew-cask,kuno/homebrew-cask,alloy/homebrew-cask,ksato9700/homebrew-cask,adriweb/homebrew-cask,jacobbednarz/homebrew-cask,mAAdhaTTah/homebrew-cask,dlackty/homebrew-cask,zmwangx/homebrew-cask,johndbritton/homebrew-cask,segiddins/homebrew-cask,Nitecon/homebrew-cask,rogeriopradoj/homebrew-cask,iAmGhost/homebrew-cask,dspeckhard/homebrew-cask,ywfwj2008/homebrew-cask,wayou/homebrew-cask,rcuza/homebrew-cask,Ephemera/homebrew-cask,jasmas/homebrew-cask,feigaochn/homebrew-cask,mjdescy/homebrew-cask,kkdd/homebrew-cask,wuman/homebrew-cask,reitermarkus/homebrew-cask,leipert/homebrew-cask,nelsonjchen/homebrew-cask,tedbundyjr/homebrew-cask,jamesmlees/homebrew-cask,blainesch/homebrew-cask,tsparber/homebrew-cask,joshka/homebrew-cask,theoriginalgri/homebrew-cask,devmynd/homebrew-cask,mchlrmrz/homebrew-cask,kryhear/homebrew-cask,Ephemera/homebrew-cask,Hywan/homebrew-cask,mathbunnyru/homebrew-cask,theoriginalgri/homebrew-cask,jtriley/homebrew-cask,afdnlw/homebrew-cask,gregkare/homebrew-cask,uetchy/homebrew-cask,zmwangx/homebrew-cask,aki77/homebrew-cask,jeroenj/homebrew-cask,otaran/homebrew-cask,gustavoavellar/homebrew-cask,L2G/homebrew-cask,jacobdam/homebrew-cask,aktau/homebrew-cask,bric3/homebrew-cask,lumaxis/homebrew-cask,nrlquaker/homebrew-cask,chuanxd/homebrew-cask,sachin21/homebrew-cask,johnjelinek/homebrew-cask,gilesdring/homebrew-cask,ftiff/homebrew-cask,diogodamiani/homebrew-cask,wickles/homebrew-cask,gabrielizaias/homebrew-cask,hristozov/homebrew-cask,antogg/homebrew-cask,bric3/homebrew-cask,JosephViolago/homebrew-cask,mhubig/homebrew-cask,otzy007/homebrew-cask,okket/homebrew-cask,jellyfishcoder/homebrew-cask,alebcay/homebrew-cask,AdamCmiel/homebrew-cask,vuquoctuan/homebrew-cask,huanzhang/homebrew-cask,wesen/homebrew-cask,malford/homebrew-cask,segiddins/homebrew-cask,huanzhang/homebrew-cask,sscotth/homebrew-cask,neverfox/homebrew-cask,kryhear/homebrew-cask,ch3n2k/homebrew-cask,dunn/homebrew-cask,scottsuch/homebrew-cask,akiomik/homebrew-cask,muan/homebrew-cask,mingzhi22/homebrew-cask,lauantai/homebrew-cask,kongslund/homebrew-cask,jayshao/homebrew-cask,a1russell/homebrew-cask,opsdev-ws/homebrew-cask,gustavoavellar/homebrew-cask,tmoreira2020/homebrew,Bombenleger/homebrew-cask,julienlavergne/homebrew-cask,yutarody/homebrew-cask,antogg/homebrew-cask,tarwich/homebrew-cask,jpodlech/homebrew-cask,astorije/homebrew-cask,moimikey/homebrew-cask,sparrc/homebrew-cask,jasmas/homebrew-cask,riyad/homebrew-cask,stephenwade/homebrew-cask,carlmod/homebrew-cask,fharbe/homebrew-cask,dlovitch/homebrew-cask,gmkey/homebrew-cask,jeanregisser/homebrew-cask,giannitm/homebrew-cask,iAmGhost/homebrew-cask,Dremora/homebrew-cask,cliffcotino/homebrew-cask,JosephViolago/homebrew-cask,yurrriq/homebrew-cask,jppelteret/homebrew-cask,elyscape/homebrew-cask,sanchezm/homebrew-cask,morganestes/homebrew-cask,markthetech/homebrew-cask,kostasdizas/homebrew-cask,kolomiichenko/homebrew-cask,victorpopkov/homebrew-cask,leipert/homebrew-cask,mrmachine/homebrew-cask,yurrriq/homebrew-cask,13k/homebrew-cask,dwkns/homebrew-cask,kassi/homebrew-cask,Ibuprofen/homebrew-cask,MircoT/homebrew-cask,vuquoctuan/homebrew-cask,mgryszko/homebrew-cask,blogabe/homebrew-cask,RickWong/homebrew-cask,j13k/homebrew-cask,exherb/homebrew-cask,Bombenleger/homebrew-cask,nshemonsky/homebrew-cask,donbobka/homebrew-cask,thehunmonkgroup/homebrew-cask,cobyism/homebrew-cask,hanxue/caskroom,mishari/homebrew-cask,andrewdisley/homebrew-cask,santoshsahoo/homebrew-cask,singingwolfboy/homebrew-cask,exherb/homebrew-cask,FranklinChen/homebrew-cask,michelegera/homebrew-cask,wolflee/homebrew-cask,coneman/homebrew-cask,BenjaminHCCarr/homebrew-cask,thii/homebrew-cask,miccal/homebrew-cask,albertico/homebrew-cask,brianshumate/homebrew-cask,leonmachadowilcox/homebrew-cask,neil-ca-moore/homebrew-cask,sebcode/homebrew-cask,troyxmccall/homebrew-cask,Ngrd/homebrew-cask,haha1903/homebrew-cask,ldong/homebrew-cask,fwiesel/homebrew-cask,robbiethegeek/homebrew-cask,kostasdizas/homebrew-cask,deanmorin/homebrew-cask,deizel/homebrew-cask,christer155/homebrew-cask,bkono/homebrew-cask,flada-auxv/homebrew-cask,joschi/homebrew-cask,christophermanning/homebrew-cask,Dremora/homebrew-cask,djakarta-trap/homebrew-myCask,Gasol/homebrew-cask,thomanq/homebrew-cask,adriweb/homebrew-cask,kingthorin/homebrew-cask,xakraz/homebrew-cask,ftiff/homebrew-cask,seanorama/homebrew-cask,moonboots/homebrew-cask,KosherBacon/homebrew-cask,nathansgreen/homebrew-cask,kiliankoe/homebrew-cask,elseym/homebrew-cask,zhuzihhhh/homebrew-cask,chadcatlett/caskroom-homebrew-cask,pkq/homebrew-cask,ianyh/homebrew-cask,mkozjak/homebrew-cask,Ketouem/homebrew-cask,drostron/homebrew-cask,Keloran/homebrew-cask,JoelLarson/homebrew-cask,bsiddiqui/homebrew-cask,wayou/homebrew-cask,decrement/homebrew-cask,gurghet/homebrew-cask,usami-k/homebrew-cask,bric3/homebrew-cask,mauricerkelly/homebrew-cask,rcuza/homebrew-cask,RJHsiao/homebrew-cask,shonjir/homebrew-cask,uetchy/homebrew-cask,mchlrmrz/homebrew-cask,ahundt/homebrew-cask,casidiablo/homebrew-cask,reelsense/homebrew-cask,joaoponceleao/homebrew-cask,illusionfield/homebrew-cask,diguage/homebrew-cask,paour/homebrew-cask,elyscape/homebrew-cask,SamiHiltunen/homebrew-cask,SentinelWarren/homebrew-cask,AnastasiaSulyagina/homebrew-cask,jonathanwiesel/homebrew-cask,klane/homebrew-cask,malob/homebrew-cask,bcaceiro/homebrew-cask,mjdescy/homebrew-cask,wKovacs64/homebrew-cask,stigkj/homebrew-caskroom-cask,moonboots/homebrew-cask,jgarber623/homebrew-cask,psibre/homebrew-cask,lvicentesanchez/homebrew-cask,lvicentesanchez/homebrew-cask,otzy007/homebrew-cask,stonehippo/homebrew-cask,illusionfield/homebrew-cask,bosr/homebrew-cask,vitorgalvao/homebrew-cask,hyuna917/homebrew-cask,asbachb/homebrew-cask,pkq/homebrew-cask,mwean/homebrew-cask,jiashuw/homebrew-cask,wKovacs64/homebrew-cask,bkono/homebrew-cask,blogabe/homebrew-cask,corbt/homebrew-cask,tedbundyjr/homebrew-cask,a1russell/homebrew-cask,tangestani/homebrew-cask,djmonta/homebrew-cask,daften/homebrew-cask,axodys/homebrew-cask,renaudguerin/homebrew-cask,hyuna917/homebrew-cask,andersonba/homebrew-cask,kirikiriyamama/homebrew-cask,jconley/homebrew-cask,timsutton/homebrew-cask,otaran/homebrew-cask,underyx/homebrew-cask,sanyer/homebrew-cask,BenjaminHCCarr/homebrew-cask,lumaxis/homebrew-cask,kTitan/homebrew-cask,n8henrie/homebrew-cask,akiomik/homebrew-cask,codeurge/homebrew-cask,coeligena/homebrew-customized,faun/homebrew-cask,vmrob/homebrew-cask,tolbkni/homebrew-cask,zhuzihhhh/homebrew-cask,scw/homebrew-cask,MichaelPei/homebrew-cask,zchee/homebrew-cask,deiga/homebrew-cask,adrianchia/homebrew-cask,carlmod/homebrew-cask,ahvigil/homebrew-cask,samnung/homebrew-cask,tdsmith/homebrew-cask,arranubels/homebrew-cask,zorosteven/homebrew-cask,gerrymiller/homebrew-cask,joaoponceleao/homebrew-cask,lieuwex/homebrew-cask,af/homebrew-cask,mazehall/homebrew-cask,donbobka/homebrew-cask,paulombcosta/homebrew-cask,m3nu/homebrew-cask,helloIAmPau/homebrew-cask,FinalDes/homebrew-cask,bchatard/homebrew-cask,JacopKane/homebrew-cask,kevyau/homebrew-cask,Amorymeltzer/homebrew-cask,schneidmaster/homebrew-cask,vin047/homebrew-cask,sanyer/homebrew-cask,mahori/homebrew-cask,crmne/homebrew-cask,williamboman/homebrew-cask,mathbunnyru/homebrew-cask,cclauss/homebrew-cask,ericbn/homebrew-cask,lucasmezencio/homebrew-cask,mindriot101/homebrew-cask,deanmorin/homebrew-cask,dezon/homebrew-cask,esebastian/homebrew-cask,jellyfishcoder/homebrew-cask,supriyantomaftuh/homebrew-cask,troyxmccall/homebrew-cask,wickedsp1d3r/homebrew-cask,6uclz1/homebrew-cask,ddm/homebrew-cask,andyshinn/homebrew-cask,remko/homebrew-cask,sscotth/homebrew-cask,stevehedrick/homebrew-cask,thehunmonkgroup/homebrew-cask,moogar0880/homebrew-cask,Whoaa512/homebrew-cask,katoquro/homebrew-cask,prime8/homebrew-cask,crzrcn/homebrew-cask,timsutton/homebrew-cask,xight/homebrew-cask,SamiHiltunen/homebrew-cask,santoshsahoo/homebrew-cask,perfide/homebrew-cask,phpwutz/homebrew-cask,mwek/homebrew-cask,jayshao/homebrew-cask,psibre/homebrew-cask,aguynamedryan/homebrew-cask,mjgardner/homebrew-cask,nshemonsky/homebrew-cask,jmeridth/homebrew-cask,slnovak/homebrew-cask,y00rb/homebrew-cask,m3nu/homebrew-cask,thii/homebrew-cask,stonehippo/homebrew-cask,xyb/homebrew-cask,cedwardsmedia/homebrew-cask,enriclluelles/homebrew-cask,shorshe/homebrew-cask,syscrusher/homebrew-cask,hvisage/homebrew-cask,paulombcosta/homebrew-cask,claui/homebrew-cask,frapposelli/homebrew-cask,a-x-/homebrew-cask,yutarody/homebrew-cask,flaviocamilo/homebrew-cask,shonjir/homebrew-cask,garborg/homebrew-cask,n8henrie/homebrew-cask,bcaceiro/homebrew-cask,sohtsuka/homebrew-cask,ksylvan/homebrew-cask,cohei/homebrew-cask,michelegera/homebrew-cask,kteru/homebrew-cask,jaredsampson/homebrew-cask,zeusdeux/homebrew-cask,nathansgreen/homebrew-cask,atsuyim/homebrew-cask,norio-nomura/homebrew-cask,mfpierre/homebrew-cask,royalwang/homebrew-cask,ninjahoahong/homebrew-cask,linc01n/homebrew-cask,chrisRidgers/homebrew-cask,skatsuta/homebrew-cask,wolflee/homebrew-cask,mingzhi22/homebrew-cask,samdoran/homebrew-cask,ptb/homebrew-cask,gregkare/homebrew-cask,maxnordlund/homebrew-cask,lukeadams/homebrew-cask,lukasbestle/homebrew-cask,FredLackeyOfficial/homebrew-cask,gabrielizaias/homebrew-cask,nathancahill/homebrew-cask,jhowtan/homebrew-cask,kamilboratynski/homebrew-cask,inz/homebrew-cask,y00rb/homebrew-cask,AdamCmiel/homebrew-cask,mgryszko/homebrew-cask,valepert/homebrew-cask,0rax/homebrew-cask,mwilmer/homebrew-cask,andrewdisley/homebrew-cask,englishm/homebrew-cask,deiga/homebrew-cask,kirikiriyamama/homebrew-cask,singingwolfboy/homebrew-cask,sanyer/homebrew-cask,bdhess/homebrew-cask,frapposelli/homebrew-cask,nicolas-brousse/homebrew-cask,alexg0/homebrew-cask,pgr0ss/homebrew-cask,gyugyu/homebrew-cask,alexg0/homebrew-cask,tranc99/homebrew-cask,morsdyce/homebrew-cask,shanonvl/homebrew-cask,scribblemaniac/homebrew-cask,askl56/homebrew-cask,lalyos/homebrew-cask,jacobdam/homebrew-cask,williamboman/homebrew-cask,mokagio/homebrew-cask,mindriot101/homebrew-cask,FredLackeyOfficial/homebrew-cask,farmerchris/homebrew-cask,wesen/homebrew-cask,tjt263/homebrew-cask,mlocher/homebrew-cask,nightscape/homebrew-cask,rajiv/homebrew-cask,nanoxd/homebrew-cask,moimikey/homebrew-cask,wickedsp1d3r/homebrew-cask,mattfelsen/homebrew-cask,gibsjose/homebrew-cask,muan/homebrew-cask,mattrobenolt/homebrew-cask,arronmabrey/homebrew-cask,JoelLarson/homebrew-cask,adrianchia/homebrew-cask,toonetown/homebrew-cask,stephenwade/homebrew-cask,mfpierre/homebrew-cask,kingthorin/homebrew-cask,gerrypower/homebrew-cask,My2ndAngelic/homebrew-cask,seanzxx/homebrew-cask,renard/homebrew-cask,feigaochn/homebrew-cask,fharbe/homebrew-cask,codeurge/homebrew-cask,onlynone/homebrew-cask,ky0615/homebrew-cask-1,jalaziz/homebrew-cask,afh/homebrew-cask,coeligena/homebrew-customized,spruceb/homebrew-cask,qbmiller/homebrew-cask,jaredsampson/homebrew-cask,bendoerr/homebrew-cask,bchatard/homebrew-cask,FranklinChen/homebrew-cask,buo/homebrew-cask,zerrot/homebrew-cask,morsdyce/homebrew-cask,morganestes/homebrew-cask,6uclz1/homebrew-cask,neverfox/homebrew-cask,rajiv/homebrew-cask,tmoreira2020/homebrew,sysbot/homebrew-cask,stigkj/homebrew-caskroom-cask,malford/homebrew-cask,boecko/homebrew-cask,scribblemaniac/homebrew-cask,MicTech/homebrew-cask,doits/homebrew-cask,squid314/homebrew-cask,iamso/homebrew-cask,xiongchiamiov/homebrew-cask,miguelfrde/homebrew-cask,joshka/homebrew-cask,jedahan/homebrew-cask,catap/homebrew-cask,gyndav/homebrew-cask,Philosoft/homebrew-cask,syscrusher/homebrew-cask,larseggert/homebrew-cask,csmith-palantir/homebrew-cask,elnappo/homebrew-cask,chino/homebrew-cask,jpmat296/homebrew-cask,githubutilities/homebrew-cask,jpodlech/homebrew-cask,shishi/homebrew-cask,jspahrsummers/homebrew-cask,ayohrling/homebrew-cask,freeslugs/homebrew-cask,kteru/homebrew-cask,yurikoles/homebrew-cask,jppelteret/homebrew-cask,Fedalto/homebrew-cask,dlackty/homebrew-cask,forevergenin/homebrew-cask,asins/homebrew-cask,sosedoff/homebrew-cask,nysthee/homebrew-cask,djmonta/homebrew-cask,jen20/homebrew-cask,tedski/homebrew-cask,haha1903/homebrew-cask,perfide/homebrew-cask,sideci-sample/sideci-sample-homebrew-cask,gord1anknot/homebrew-cask,gguillotte/homebrew-cask,sparrc/homebrew-cask,tjnycum/homebrew-cask,MoOx/homebrew-cask,jspahrsummers/homebrew-cask,hovancik/homebrew-cask,jgarber623/homebrew-cask,kesara/homebrew-cask,garborg/homebrew-cask,BenjaminHCCarr/homebrew-cask,deiga/homebrew-cask,fkrone/homebrew-cask,tangestani/homebrew-cask,xalep/homebrew-cask,tolbkni/homebrew-cask,dvdoliveira/homebrew-cask,paulbreslin/homebrew-cask,xight/homebrew-cask,axodys/homebrew-cask,arronmabrey/homebrew-cask,danielbayley/homebrew-cask,sosedoff/homebrew-cask,ajbw/homebrew-cask,pablote/homebrew-cask,shoichiaizawa/homebrew-cask,neil-ca-moore/homebrew-cask,3van/homebrew-cask,kiliankoe/homebrew-cask,feniix/homebrew-cask,unasuke/homebrew-cask,seanorama/homebrew-cask,jbeagley52/homebrew-cask,elseym/homebrew-cask,slack4u/homebrew-cask,timsutton/homebrew-cask,ddm/homebrew-cask,stevenmaguire/homebrew-cask,antogg/homebrew-cask,kuno/homebrew-cask,My2ndAngelic/homebrew-cask,anbotero/homebrew-cask,katoquro/homebrew-cask,Philosoft/homebrew-cask,mchlrmrz/homebrew-cask,ninjahoahong/homebrew-cask,coneman/homebrew-cask,usami-k/homebrew-cask,inz/homebrew-cask,seanzxx/homebrew-cask,ctrevino/homebrew-cask,rhendric/homebrew-cask,scw/homebrew-cask,aguynamedryan/homebrew-cask,christophermanning/homebrew-cask,lalyos/homebrew-cask,hackhandslabs/homebrew-cask,MatzFan/homebrew-cask,doits/homebrew-cask,claui/homebrew-cask,andrewschleifer/homebrew-cask,jrwesolo/homebrew-cask,yurikoles/homebrew-cask,fly19890211/homebrew-cask,daften/homebrew-cask,johntrandall/homebrew-cask,miccal/homebrew-cask,toonetown/homebrew-cask,13k/homebrew-cask,nrlquaker/homebrew-cask,jeroenseegers/homebrew-cask,danielgomezrico/homebrew-cask,athrunsun/homebrew-cask,kTitan/homebrew-cask,cobyism/homebrew-cask,zchee/homebrew-cask,Whoaa512/homebrew-cask,retrography/homebrew-cask,andyli/homebrew-cask,decrement/homebrew-cask,sysbot/homebrew-cask,xiongchiamiov/homebrew-cask,afh/homebrew-cask,wizonesolutions/homebrew-cask,hvisage/homebrew-cask,fazo96/homebrew-cask,koenrh/homebrew-cask,dwihn0r/homebrew-cask,esebastian/homebrew-cask,Fedalto/homebrew-cask,drostron/homebrew-cask,joaocc/homebrew-cask,epmatsw/homebrew-cask,ingorichter/homebrew-cask,sgnh/homebrew-cask,MircoT/homebrew-cask,claui/homebrew-cask,hakamadare/homebrew-cask,j13k/homebrew-cask,winkelsdorf/homebrew-cask,jacobbednarz/homebrew-cask,andrewdisley/homebrew-cask,samdoran/homebrew-cask,shanonvl/homebrew-cask,0xadada/homebrew-cask,xight/homebrew-cask,ebraminio/homebrew-cask,retbrown/homebrew-cask,Saklad5/homebrew-cask,adrianchia/homebrew-cask,hovancik/homebrew-cask,3van/homebrew-cask,markthetech/homebrew-cask,inta/homebrew-cask,m3nu/homebrew-cask,patresi/homebrew-cask,Keloran/homebrew-cask,andrewschleifer/homebrew-cask,jmeridth/homebrew-cask,faun/homebrew-cask,Saklad5/homebrew-cask,flada-auxv/homebrew-cask,iamso/homebrew-cask,wickles/homebrew-cask,amatos/homebrew-cask,larseggert/homebrew-cask,gord1anknot/homebrew-cask,cblecker/homebrew-cask,sirodoht/homebrew-cask,okket/homebrew-cask,askl56/homebrew-cask,dustinblackman/homebrew-cask,josa42/homebrew-cask,gurghet/homebrew-cask,lifepillar/homebrew-cask,JikkuJose/homebrew-cask,ponychicken/homebrew-customcask,remko/homebrew-cask,samnung/homebrew-cask,fanquake/homebrew-cask,hellosky806/homebrew-cask,samshadwell/homebrew-cask,ahundt/homebrew-cask,ksylvan/homebrew-cask,nightscape/homebrew-cask,chadcatlett/caskroom-homebrew-cask,tyage/homebrew-cask,Amorymeltzer/homebrew-cask,nathancahill/homebrew-cask,n0ts/homebrew-cask,sohtsuka/homebrew-cask,MatzFan/homebrew-cask,ashishb/homebrew-cask,wmorin/homebrew-cask,christer155/homebrew-cask,napaxton/homebrew-cask,ky0615/homebrew-cask-1,nelsonjchen/homebrew-cask,tjt263/homebrew-cask,renard/homebrew-cask,mjgardner/homebrew-cask,0rax/homebrew-cask,csmith-palantir/homebrew-cask,markhuber/homebrew-cask,pacav69/homebrew-cask,JacopKane/homebrew-cask,qnm/homebrew-cask,bcomnes/homebrew-cask,franklouwers/homebrew-cask,greg5green/homebrew-cask,joaocc/homebrew-cask,julienlavergne/homebrew-cask,jeanregisser/homebrew-cask,mahori/homebrew-cask,shorshe/homebrew-cask,a1russell/homebrew-cask,xakraz/homebrew-cask,uetchy/homebrew-cask,jeroenj/homebrew-cask,bsiddiqui/homebrew-cask,boydj/homebrew-cask,casidiablo/homebrew-cask,dwkns/homebrew-cask,malob/homebrew-cask,mokagio/homebrew-cask,underyx/homebrew-cask,kesara/homebrew-cask,blainesch/homebrew-cask,victorpopkov/homebrew-cask,vigosan/homebrew-cask,andyshinn/homebrew-cask,inta/homebrew-cask,pinut/homebrew-cask,lifepillar/homebrew-cask,lcasey001/homebrew-cask,klane/homebrew-cask,reitermarkus/homebrew-cask,sideci-sample/sideci-sample-homebrew-cask,kingthorin/homebrew-cask,dictcp/homebrew-cask,esebastian/homebrew-cask,optikfluffel/homebrew-cask,mathbunnyru/homebrew-cask,athrunsun/homebrew-cask,Cottser/homebrew-cask,arranubels/homebrew-cask,Nitecon/homebrew-cask,kievechua/homebrew-cask,aki77/homebrew-cask,danielgomezrico/homebrew-cask,jgarber623/homebrew-cask,ebraminio/homebrew-cask,kei-yamazaki/homebrew-cask,colindean/homebrew-cask,forevergenin/homebrew-cask,reitermarkus/homebrew-cask,nysthee/homebrew-cask,alebcay/homebrew-cask,joshka/homebrew-cask,jconley/homebrew-cask,guerrero/homebrew-cask,paour/homebrew-cask,tan9/homebrew-cask,alexg0/homebrew-cask,tdsmith/homebrew-cask,petmoo/homebrew-cask,rkJun/homebrew-cask,Ephemera/homebrew-cask,Gasol/homebrew-cask,barravi/homebrew-cask,lukeadams/homebrew-cask,alebcay/homebrew-cask,slnovak/homebrew-cask,renaudguerin/homebrew-cask,epardee/homebrew-cask,howie/homebrew-cask,cclauss/homebrew-cask,mattrobenolt/homebrew-cask,asbachb/homebrew-cask,lucasmezencio/homebrew-cask,cblecker/homebrew-cask,kassi/homebrew-cask,nathanielvarona/homebrew-cask,AndreTheHunter/homebrew-cask,wizonesolutions/homebrew-cask,dieterdemeyer/homebrew-cask,ksato9700/homebrew-cask,schneidmaster/homebrew-cask,dezon/homebrew-cask,lukasbestle/homebrew-cask,cohei/homebrew-cask,greg5green/homebrew-cask,vigosan/homebrew-cask,RogerThiede/homebrew-cask,vmrob/homebrew-cask,crmne/homebrew-cask,kpearson/homebrew-cask,Cottser/homebrew-cask,mazehall/homebrew-cask,opsdev-ws/homebrew-cask,shishi/homebrew-cask,riyad/homebrew-cask,shoichiaizawa/homebrew-cask,adelinofaria/homebrew-cask,tjnycum/homebrew-cask,genewoo/homebrew-cask,paour/homebrew-cask,gibsjose/homebrew-cask,caskroom/homebrew-cask,xtian/homebrew-cask,winkelsdorf/homebrew-cask,feniix/homebrew-cask,MicTech/homebrew-cask,diogodamiani/homebrew-cask,anbotero/homebrew-cask,bgandon/homebrew-cask,ingorichter/homebrew-cask,mlocher/homebrew-cask,markhuber/homebrew-cask,robbiethegeek/homebrew-cask,mkozjak/homebrew-cask,ahvigil/homebrew-cask,JosephViolago/homebrew-cask,ayohrling/homebrew-cask,MisumiRize/homebrew-cask,gmkey/homebrew-cask,jeroenseegers/homebrew-cask,chrisRidgers/homebrew-cask,spruceb/homebrew-cask,qbmiller/homebrew-cask,fkrone/homebrew-cask,lantrix/homebrew-cask,tyage/homebrew-cask,cedwardsmedia/homebrew-cask,xyb/homebrew-cask,johan/homebrew-cask,goxberry/homebrew-cask,kkdd/homebrew-cask,rkJun/homebrew-cask,dictcp/homebrew-cask,albertico/homebrew-cask,franklouwers/homebrew-cask,cobyism/homebrew-cask,tjnycum/homebrew-cask,Labutin/homebrew-cask,gilesdring/homebrew-cask,Hywan/homebrew-cask,johnjelinek/homebrew-cask,scribblemaniac/homebrew-cask,chino/homebrew-cask,L2G/homebrew-cask,rogeriopradoj/homebrew-cask,RJHsiao/homebrew-cask,LaurentFough/homebrew-cask,hanxue/caskroom,nathanielvarona/homebrew-cask,johntrandall/homebrew-cask,sirodoht/homebrew-cask,atsuyim/homebrew-cask,MerelyAPseudonym/homebrew-cask,ajbw/homebrew-cask,cfillion/homebrew-cask,stevehedrick/homebrew-cask,cprecioso/homebrew-cask,bcomnes/homebrew-cask
ruby
## Code Before: class Ccmenu < Cask version '1.7' sha256 '974a2022dbc9494958334ee8f02e08df7ed184e1f421a53d623dfbeaadf08a2c' url 'https://downloads.sourceforge.net/project/ccmenu/CCMenu/1.7/ccmenu-1.7-b.dmg' appcast 'http://ccmenu.sourceforge.net/update-stable.xml' homepage 'http://ccmenu.sourceforge.net/' link 'CCMenu.app' end ## Instruction: Update CCMenu: version number in url stanza Updated to [facilitate future updates][ref]. [ref]: https://github.com/caskroom/homebrew-cask/pull/4910 ## Code After: class Ccmenu < Cask version '1.7' sha256 '974a2022dbc9494958334ee8f02e08df7ed184e1f421a53d623dfbeaadf08a2c' url "https://downloads.sourceforge.net/project/ccmenu/CCMenu/#{version}/ccmenu-#{version}-b.dmg" appcast 'http://ccmenu.sourceforge.net/update-stable.xml' homepage 'http://ccmenu.sourceforge.net/' link 'CCMenu.app' end
class Ccmenu < Cask version '1.7' sha256 '974a2022dbc9494958334ee8f02e08df7ed184e1f421a53d623dfbeaadf08a2c' - url 'https://downloads.sourceforge.net/project/ccmenu/CCMenu/1.7/ccmenu-1.7-b.dmg' ? ^ ^^^ ^^^ ^ + url "https://downloads.sourceforge.net/project/ccmenu/CCMenu/#{version}/ccmenu-#{version}-b.dmg" ? ^ ^^^^^^^^^^ ^^^^^^^^^^ ^ appcast 'http://ccmenu.sourceforge.net/update-stable.xml' homepage 'http://ccmenu.sourceforge.net/' link 'CCMenu.app' end
2
0.2
1
1
d370cb2ab3f3c1c01a03db921961b4dbbf080753
src/DeploymentCockpit.Server/app/deploymentPlans/deploymentPlanDetails.html
src/DeploymentCockpit.Server/app/deploymentPlans/deploymentPlanDetails.html
<div class="row"> <div class="col-md-10"> <h2>{{deploymentPlan.name}}</h2> <p class="text-muted">{{deploymentPlan.description}}</p> </div> <div class="col-md-2"> <div class="button-bar pull-right"> <a href="#/Project/Details/{{deploymentPlan.projectID}}"> Back to project </a> &nbsp; <div class="btn-group"> <a href="#/DeploymentPlan/Edit/{{deploymentPlan.deploymentPlanID}}" class="btn btn-default" title="Edit"> <span class="glyphicon glyphicon-pencil"></span> </a> </div> </div> </div> </div> <hr /> <div class="row"> <div class="col-md-12"> <div my-deployment-plan-steps deployment-plan-id="deploymentPlanID" project-id="deploymentPlan.projectID"></div> </div> </div> <div class="row"> <div class="col-md-3"> <div my-deployment-plan-parameters plan-id="deploymentPlanID"></div> </div> <div class="col-md-9"> <div my-variables scope-key="'DeploymentPlan'" scope-id="deploymentPlanID"></div> </div> </div>
<div class="row"> <div class="col-md-10"> <h2>{{deploymentPlan.name}}</h2> <p class="text-muted">{{deploymentPlan.description}}</p> </div> <div class="col-md-2"> <div class="button-bar pull-right"> <a href="#/Project/Details/{{deploymentPlan.projectID}}"> Back to project </a> &nbsp; <div class="btn-group"> <a href="#/DeploymentPlan/Edit/{{deploymentPlan.deploymentPlanID}}" class="btn btn-default" title="Edit"> <span class="glyphicon glyphicon-pencil"></span> </a> </div> </div> </div> </div> <hr /> <div class="row"> <div class="col-md-3"> <div my-deployment-plan-parameters plan-id="deploymentPlanID"></div> </div> <div class="col-md-9"> <div my-variables scope-key="'DeploymentPlan'" scope-id="deploymentPlanID"></div> </div> </div> <div class="row"> <div class="col-md-12"> <div my-deployment-plan-steps deployment-plan-id="deploymentPlanID" project-id="deploymentPlan.projectID"></div> </div> </div>
Reorder view elements for better visibility
Reorder view elements for better visibility
HTML
apache-2.0
anilmujagic/DeploymentCockpit,anilmujagic/DeploymentCockpit,anilmujagic/DeploymentCockpit
html
## Code Before: <div class="row"> <div class="col-md-10"> <h2>{{deploymentPlan.name}}</h2> <p class="text-muted">{{deploymentPlan.description}}</p> </div> <div class="col-md-2"> <div class="button-bar pull-right"> <a href="#/Project/Details/{{deploymentPlan.projectID}}"> Back to project </a> &nbsp; <div class="btn-group"> <a href="#/DeploymentPlan/Edit/{{deploymentPlan.deploymentPlanID}}" class="btn btn-default" title="Edit"> <span class="glyphicon glyphicon-pencil"></span> </a> </div> </div> </div> </div> <hr /> <div class="row"> <div class="col-md-12"> <div my-deployment-plan-steps deployment-plan-id="deploymentPlanID" project-id="deploymentPlan.projectID"></div> </div> </div> <div class="row"> <div class="col-md-3"> <div my-deployment-plan-parameters plan-id="deploymentPlanID"></div> </div> <div class="col-md-9"> <div my-variables scope-key="'DeploymentPlan'" scope-id="deploymentPlanID"></div> </div> </div> ## Instruction: Reorder view elements for better visibility ## Code After: <div class="row"> <div class="col-md-10"> <h2>{{deploymentPlan.name}}</h2> <p class="text-muted">{{deploymentPlan.description}}</p> </div> <div class="col-md-2"> <div class="button-bar pull-right"> <a href="#/Project/Details/{{deploymentPlan.projectID}}"> Back to project </a> &nbsp; <div class="btn-group"> <a href="#/DeploymentPlan/Edit/{{deploymentPlan.deploymentPlanID}}" class="btn btn-default" title="Edit"> <span class="glyphicon glyphicon-pencil"></span> </a> </div> </div> </div> </div> <hr /> <div class="row"> <div class="col-md-3"> <div my-deployment-plan-parameters plan-id="deploymentPlanID"></div> </div> <div class="col-md-9"> <div my-variables scope-key="'DeploymentPlan'" scope-id="deploymentPlanID"></div> </div> </div> <div class="row"> <div class="col-md-12"> <div my-deployment-plan-steps deployment-plan-id="deploymentPlanID" project-id="deploymentPlan.projectID"></div> </div> </div>
<div class="row"> <div class="col-md-10"> <h2>{{deploymentPlan.name}}</h2> <p class="text-muted">{{deploymentPlan.description}}</p> </div> <div class="col-md-2"> <div class="button-bar pull-right"> <a href="#/Project/Details/{{deploymentPlan.projectID}}"> Back to project </a> &nbsp; <div class="btn-group"> <a href="#/DeploymentPlan/Edit/{{deploymentPlan.deploymentPlanID}}" class="btn btn-default" title="Edit"> <span class="glyphicon glyphicon-pencil"></span> </a> </div> </div> </div> </div> <hr /> <div class="row"> - <div class="col-md-12"> - <div my-deployment-plan-steps deployment-plan-id="deploymentPlanID" project-id="deploymentPlan.projectID"></div> - </div> - </div> - <div class="row"> <div class="col-md-3"> <div my-deployment-plan-parameters plan-id="deploymentPlanID"></div> </div> <div class="col-md-9"> <div my-variables scope-key="'DeploymentPlan'" scope-id="deploymentPlanID"></div> </div> </div> + <div class="row"> + <div class="col-md-12"> + <div my-deployment-plan-steps deployment-plan-id="deploymentPlanID" project-id="deploymentPlan.projectID"></div> + </div> + </div>
10
0.30303
5
5
61214dbc643c1715e2006eeea23a2d24e66d37e9
config/locales/en/brexit_checker/account_signup.yml
config/locales/en/brexit_checker/account_signup.yml
en: brexit_checker: account_signup: title: Choose how you want to stay up to date heading: Choose how you want to stay up to date proposition: There are 2 different ways of signing up to updates. email_alerts: heading: Get email updates link: Subscribe to get email updates text: about Brexit transition changes that may affect you. create_account: heading: Create a GOV.UK account intro: Save your Brexit transition results and get email updates about changes that may affect you. text: GOV.UK accounts are a trial. In future, we plan to add more features so you can use your account with more services. aside: This is separate from other government accounts (for example your personal tax account or Government Gateway). outro: You’ll need an email address and a mobile phone to create an account. cta_button: Create a GOV.UK account migration_warning: You cannot create a GOV.UK account between 9am on 25th October and 5pm on 27th October. This is because we’re making changes to how the account works. or: If you’ve already saved your UK transition results, alternative_path_link_text: sign in to your account
en: brexit_checker: account_signup: title: Choose how you want to stay up to date heading: Choose how you want to stay up to date proposition: There are 2 different ways of signing up to updates. email_alerts: heading: Get email updates link: Subscribe to get email updates text: about Brexit transition changes that may affect you. create_account: heading: Create a GOV.UK account intro: Save your Brexit transition results and get email updates about changes that may affect you. text: GOV.UK accounts are a trial. In future, we plan to add more features so you can use your account with more services. aside: This is separate from other government accounts (for example your personal tax account or Government Gateway). outro: You’ll need an email address and a mobile phone to create an account. cta_button: Create a GOV.UK account migration_warning: You cannot create a GOV.UK account between 9am on 25 October and midday on 28 October. This is because we’re making changes to how the account works. or: If you’ve already saved your UK transition results, alternative_path_link_text: sign in to your account
Extend account migration time period
Extend account migration time period We need to extend the migration so DI have time to make some final changes
YAML
mit
alphagov/finder-frontend,alphagov/finder-frontend,alphagov/finder-frontend,alphagov/finder-frontend
yaml
## Code Before: en: brexit_checker: account_signup: title: Choose how you want to stay up to date heading: Choose how you want to stay up to date proposition: There are 2 different ways of signing up to updates. email_alerts: heading: Get email updates link: Subscribe to get email updates text: about Brexit transition changes that may affect you. create_account: heading: Create a GOV.UK account intro: Save your Brexit transition results and get email updates about changes that may affect you. text: GOV.UK accounts are a trial. In future, we plan to add more features so you can use your account with more services. aside: This is separate from other government accounts (for example your personal tax account or Government Gateway). outro: You’ll need an email address and a mobile phone to create an account. cta_button: Create a GOV.UK account migration_warning: You cannot create a GOV.UK account between 9am on 25th October and 5pm on 27th October. This is because we’re making changes to how the account works. or: If you’ve already saved your UK transition results, alternative_path_link_text: sign in to your account ## Instruction: Extend account migration time period We need to extend the migration so DI have time to make some final changes ## Code After: en: brexit_checker: account_signup: title: Choose how you want to stay up to date heading: Choose how you want to stay up to date proposition: There are 2 different ways of signing up to updates. email_alerts: heading: Get email updates link: Subscribe to get email updates text: about Brexit transition changes that may affect you. create_account: heading: Create a GOV.UK account intro: Save your Brexit transition results and get email updates about changes that may affect you. text: GOV.UK accounts are a trial. In future, we plan to add more features so you can use your account with more services. aside: This is separate from other government accounts (for example your personal tax account or Government Gateway). outro: You’ll need an email address and a mobile phone to create an account. cta_button: Create a GOV.UK account migration_warning: You cannot create a GOV.UK account between 9am on 25 October and midday on 28 October. This is because we’re making changes to how the account works. or: If you’ve already saved your UK transition results, alternative_path_link_text: sign in to your account
en: brexit_checker: account_signup: title: Choose how you want to stay up to date heading: Choose how you want to stay up to date proposition: There are 2 different ways of signing up to updates. email_alerts: heading: Get email updates link: Subscribe to get email updates text: about Brexit transition changes that may affect you. create_account: heading: Create a GOV.UK account intro: Save your Brexit transition results and get email updates about changes that may affect you. text: GOV.UK accounts are a trial. In future, we plan to add more features so you can use your account with more services. aside: This is separate from other government accounts (for example your personal tax account or Government Gateway). outro: You’ll need an email address and a mobile phone to create an account. cta_button: Create a GOV.UK account - migration_warning: You cannot create a GOV.UK account between 9am on 25th October and 5pm on 27th October. This is because we’re making changes to how the account works. ? -- -- ^^^ + migration_warning: You cannot create a GOV.UK account between 9am on 25 October and midday on 28 October. This is because we’re making changes to how the account works. ? +++++ ^ or: If you’ve already saved your UK transition results, alternative_path_link_text: sign in to your account
2
0.1
1
1
322f3b9133675dd693777092093936ff0e2cdf8c
pubspec.yaml
pubspec.yaml
name: swiper version: 0.0.1 author: Marco Jakob <majakob@gmx.ch> description: A touch (and mouse) slider for swiping through images and html. homepage: https://github.com/marcojakob/dart-swiper dependencies: browser: any logging: any dnd: path: ../dart-dnd dev_dependencies: bootstrap_for_pub: any
name: swiper version: 0.0.1 author: Marco Jakob <majakob@gmx.ch> description: A touch (and mouse) slider for swiping through images and html. homepage: https://github.com/marcojakob/dart-swiper dependencies: browser: any logging: any dnd: git: https://github.com/marcojakob/dart-dnd.git dev_dependencies: bootstrap_for_pub: any
Change local dependency to github dependency
Change local dependency to github dependency
YAML
mit
marcojakob/dart-swiper,marcojakob/dart-swiper,marcojakob/dart-swiper
yaml
## Code Before: name: swiper version: 0.0.1 author: Marco Jakob <majakob@gmx.ch> description: A touch (and mouse) slider for swiping through images and html. homepage: https://github.com/marcojakob/dart-swiper dependencies: browser: any logging: any dnd: path: ../dart-dnd dev_dependencies: bootstrap_for_pub: any ## Instruction: Change local dependency to github dependency ## Code After: name: swiper version: 0.0.1 author: Marco Jakob <majakob@gmx.ch> description: A touch (and mouse) slider for swiping through images and html. homepage: https://github.com/marcojakob/dart-swiper dependencies: browser: any logging: any dnd: git: https://github.com/marcojakob/dart-dnd.git dev_dependencies: bootstrap_for_pub: any
name: swiper version: 0.0.1 author: Marco Jakob <majakob@gmx.ch> description: A touch (and mouse) slider for swiping through images and html. homepage: https://github.com/marcojakob/dart-swiper dependencies: browser: any logging: any dnd: - path: ../dart-dnd + git: https://github.com/marcojakob/dart-dnd.git dev_dependencies: bootstrap_for_pub: any
2
0.166667
1
1
01f098dfd875b183c24f715ed926cc989fb836a6
app/src/main/res/menu/navdrawer_items.xml
app/src/main/res/menu/navdrawer_items.xml
<?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:checkableBehavior="single"> <item android:id="@+id/navigation_item_home" android:title="@string/title_activity_home" android:icon="@drawable/ic_home_black_24dp"/> </group> <group android:checkableBehavior="single"> <item android:id="@+id/navigation_item_assignments" android:title="@string/title_activity_assignments" android:icon="@drawable/ic_assignment_black_24dp"/> </group> <group android:checkableBehavior="single"> <item android:id="@+id/navigation_item_subjects" android:title="@string/title_activity_subjects" android:icon="@drawable/ic_list_black_24dp"/> </group> </menu>
<?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:id="@+id/navigation_group_1" android:checkableBehavior="single"> <item android:id="@+id/navigation_item_home" android:title="@string/title_activity_home" android:icon="@drawable/ic_home_black_24dp"/> </group> <group android:id="@+id/navigation_group_2" android:checkableBehavior="single"> <item android:id="@+id/navigation_item_assignments" android:title="@string/title_activity_assignments" android:icon="@drawable/ic_assignment_black_24dp"/> <item android:id="@+id/navigation_item_subjects" android:title="@string/title_activity_subjects" android:icon="@drawable/ic_list_black_24dp"/> </group> </menu>
Add ids to navigation groups to display the divider lines
Add ids to navigation groups to display the divider lines
XML
apache-2.0
FarbodSalamat-Zadeh/TimetableApp,FarbodSalamat-Zadeh/TimetableApp
xml
## Code Before: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:checkableBehavior="single"> <item android:id="@+id/navigation_item_home" android:title="@string/title_activity_home" android:icon="@drawable/ic_home_black_24dp"/> </group> <group android:checkableBehavior="single"> <item android:id="@+id/navigation_item_assignments" android:title="@string/title_activity_assignments" android:icon="@drawable/ic_assignment_black_24dp"/> </group> <group android:checkableBehavior="single"> <item android:id="@+id/navigation_item_subjects" android:title="@string/title_activity_subjects" android:icon="@drawable/ic_list_black_24dp"/> </group> </menu> ## Instruction: Add ids to navigation groups to display the divider lines ## Code After: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:id="@+id/navigation_group_1" android:checkableBehavior="single"> <item android:id="@+id/navigation_item_home" android:title="@string/title_activity_home" android:icon="@drawable/ic_home_black_24dp"/> </group> <group android:id="@+id/navigation_group_2" android:checkableBehavior="single"> <item android:id="@+id/navigation_item_assignments" android:title="@string/title_activity_assignments" android:icon="@drawable/ic_assignment_black_24dp"/> <item android:id="@+id/navigation_item_subjects" android:title="@string/title_activity_subjects" android:icon="@drawable/ic_list_black_24dp"/> </group> </menu>
<?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> - <group android:checkableBehavior="single"> + <group android:id="@+id/navigation_group_1" android:checkableBehavior="single"> <item android:id="@+id/navigation_item_home" android:title="@string/title_activity_home" android:icon="@drawable/ic_home_black_24dp"/> </group> - <group android:checkableBehavior="single"> + <group android:id="@+id/navigation_group_2" android:checkableBehavior="single"> <item android:id="@+id/navigation_item_assignments" android:title="@string/title_activity_assignments" android:icon="@drawable/ic_assignment_black_24dp"/> - </group> - - <group android:checkableBehavior="single"> <item android:id="@+id/navigation_item_subjects" android:title="@string/title_activity_subjects" android:icon="@drawable/ic_list_black_24dp"/> </group> </menu>
7
0.28
2
5
22df333384cf0bb4b658261121c76488c84a18a8
Sources/Roark/Dynamic.swift
Sources/Roark/Dynamic.swift
import ObjectiveC.runtime public protocol Dynamic { var OBJC_CLASS: NSObjectProtocol { get } var obj: NSObject { get } var `class`: AnyClass { get } } public extension Dynamic { public var `class`: AnyClass { return (OBJC_CLASS as? AnyClass) ?? undefined() } } public protocol Named: Dynamic { var name: String { get } } public extension Named { public var name: String { return (obj.valueForKey("name") as? String) ?? undefined() } }
import ObjectiveC.runtime func call(object: NSObjectProtocol, _ methodName: String, _ argument: NSObject? = nil) -> NSObject { let result: Unmanaged<AnyObject>! if let argument = argument { result = object.performSelector(Selector(methodName), withObject: argument) } else { result = object.performSelector(Selector(methodName)) } return (result.takeRetainedValue() as? NSObject) ?? undefined() } func getObjCClass(name: String) -> NSObjectProtocol { return (objc_getClass(name) as? NSObjectProtocol) ?? undefined("No such class: \(name)") } public protocol Dynamic { var OBJC_CLASS: NSObjectProtocol { get } var obj: NSObject { get } var `class`: AnyClass { get } } public extension Dynamic { public var `class`: AnyClass { return (OBJC_CLASS as? AnyClass) ?? undefined() } } public protocol Named: Dynamic { var name: String { get } } public extension Named { public var name: String { return (obj.valueForKey("name") as? String) ?? undefined() } }
Make calling ObjC things a little easier
Make calling ObjC things a little easier
Swift
mit
neonichu/Roark
swift
## Code Before: import ObjectiveC.runtime public protocol Dynamic { var OBJC_CLASS: NSObjectProtocol { get } var obj: NSObject { get } var `class`: AnyClass { get } } public extension Dynamic { public var `class`: AnyClass { return (OBJC_CLASS as? AnyClass) ?? undefined() } } public protocol Named: Dynamic { var name: String { get } } public extension Named { public var name: String { return (obj.valueForKey("name") as? String) ?? undefined() } } ## Instruction: Make calling ObjC things a little easier ## Code After: import ObjectiveC.runtime func call(object: NSObjectProtocol, _ methodName: String, _ argument: NSObject? = nil) -> NSObject { let result: Unmanaged<AnyObject>! if let argument = argument { result = object.performSelector(Selector(methodName), withObject: argument) } else { result = object.performSelector(Selector(methodName)) } return (result.takeRetainedValue() as? NSObject) ?? undefined() } func getObjCClass(name: String) -> NSObjectProtocol { return (objc_getClass(name) as? NSObjectProtocol) ?? undefined("No such class: \(name)") } public protocol Dynamic { var OBJC_CLASS: NSObjectProtocol { get } var obj: NSObject { get } var `class`: AnyClass { get } } public extension Dynamic { public var `class`: AnyClass { return (OBJC_CLASS as? AnyClass) ?? undefined() } } public protocol Named: Dynamic { var name: String { get } } public extension Named { public var name: String { return (obj.valueForKey("name") as? String) ?? undefined() } }
import ObjectiveC.runtime + + func call(object: NSObjectProtocol, _ methodName: String, _ argument: NSObject? = nil) -> NSObject { + let result: Unmanaged<AnyObject>! + + if let argument = argument { + result = object.performSelector(Selector(methodName), withObject: argument) + } else { + result = object.performSelector(Selector(methodName)) + } + + return (result.takeRetainedValue() as? NSObject) ?? undefined() + } + + func getObjCClass(name: String) -> NSObjectProtocol { + return (objc_getClass(name) as? NSObjectProtocol) ?? undefined("No such class: \(name)") + } public protocol Dynamic { var OBJC_CLASS: NSObjectProtocol { get } var obj: NSObject { get } var `class`: AnyClass { get } } public extension Dynamic { public var `class`: AnyClass { return (OBJC_CLASS as? AnyClass) ?? undefined() } } public protocol Named: Dynamic { var name: String { get } } public extension Named { public var name: String { return (obj.valueForKey("name") as? String) ?? undefined() } }
16
0.666667
16
0
a099733cbd81605cd034e597c3ad4f2f5e448a8b
openxc/src/main/java/com/openxc/remote/sources/JsonVehicleDataSource.java
openxc/src/main/java/com/openxc/remote/sources/JsonVehicleDataSource.java
package com.openxc.remote.sources; import org.json.JSONException; import org.json.JSONObject; import android.util.Log; public abstract class JsonVehicleDataSource extends AbstractVehicleDataSource { private static final String TAG = "JsonVehicleDataSource"; public JsonVehicleDataSource() { super(); } public JsonVehicleDataSource(VehicleDataSourceCallbackInterface callback) { super(callback); } protected void parseJson(String json) { final JSONObject message; try { message = new JSONObject(json); } catch(JSONException e) { Log.i(TAG, "Couldn't decode JSON from: " + json); return; } try { Log.d("FRING", message.toString()); handleMessage(message.getString("name"), message.getDouble("value")); return; } catch(JSONException e) { } try { handleMessage(message.getString("name"), message.getString("value")); } catch(JSONException e) { Log.w(TAG, "JSON value wasn't a double or string -- couldn't parse", e); } } }
package com.openxc.remote.sources; import org.json.JSONException; import org.json.JSONObject; import android.util.Log; public abstract class JsonVehicleDataSource extends AbstractVehicleDataSource { private static final String TAG = "JsonVehicleDataSource"; public JsonVehicleDataSource() { super(); } public JsonVehicleDataSource(VehicleDataSourceCallbackInterface callback) { super(callback); } protected void parseJson(String json) { final JSONObject message; try { message = new JSONObject(json); } catch(JSONException e) { Log.i(TAG, "Couldn't decode JSON from: " + json); return; } try { handleMessage(message.getString("name"), message.getDouble("value")); return; } catch(JSONException e) { } try { handleMessage(message.getString("name"), message.getString("value")); } catch(JSONException e) { Log.w(TAG, "JSON value wasn't a double or string -- couldn't parse", e); } } }
Remove stray debug log statement.
Remove stray debug log statement.
Java
bsd-3-clause
dhootha/openxc-android,petemaclellan/openxc-android,prateeknitish391/demo,openxc/openxc-android,ChernyshovYuriy/openxc-android,dhootha/openxc-android,prateeknitish391/demo,prateeknitish391/demo,msowka/openxc-android,mray19027/openxc-android,mray19027/openxc-android,msowka/openxc-android,petemaclellan/openxc-android,ChernyshovYuriy/openxc-android,openxc/openxc-android
java
## Code Before: package com.openxc.remote.sources; import org.json.JSONException; import org.json.JSONObject; import android.util.Log; public abstract class JsonVehicleDataSource extends AbstractVehicleDataSource { private static final String TAG = "JsonVehicleDataSource"; public JsonVehicleDataSource() { super(); } public JsonVehicleDataSource(VehicleDataSourceCallbackInterface callback) { super(callback); } protected void parseJson(String json) { final JSONObject message; try { message = new JSONObject(json); } catch(JSONException e) { Log.i(TAG, "Couldn't decode JSON from: " + json); return; } try { Log.d("FRING", message.toString()); handleMessage(message.getString("name"), message.getDouble("value")); return; } catch(JSONException e) { } try { handleMessage(message.getString("name"), message.getString("value")); } catch(JSONException e) { Log.w(TAG, "JSON value wasn't a double or string -- couldn't parse", e); } } } ## Instruction: Remove stray debug log statement. ## Code After: package com.openxc.remote.sources; import org.json.JSONException; import org.json.JSONObject; import android.util.Log; public abstract class JsonVehicleDataSource extends AbstractVehicleDataSource { private static final String TAG = "JsonVehicleDataSource"; public JsonVehicleDataSource() { super(); } public JsonVehicleDataSource(VehicleDataSourceCallbackInterface callback) { super(callback); } protected void parseJson(String json) { final JSONObject message; try { message = new JSONObject(json); } catch(JSONException e) { Log.i(TAG, "Couldn't decode JSON from: " + json); return; } try { handleMessage(message.getString("name"), message.getDouble("value")); return; } catch(JSONException e) { } try { handleMessage(message.getString("name"), message.getString("value")); } catch(JSONException e) { Log.w(TAG, "JSON value wasn't a double or string -- couldn't parse", e); } } }
package com.openxc.remote.sources; import org.json.JSONException; import org.json.JSONObject; import android.util.Log; public abstract class JsonVehicleDataSource extends AbstractVehicleDataSource { private static final String TAG = "JsonVehicleDataSource"; public JsonVehicleDataSource() { super(); } public JsonVehicleDataSource(VehicleDataSourceCallbackInterface callback) { super(callback); } protected void parseJson(String json) { final JSONObject message; try { message = new JSONObject(json); } catch(JSONException e) { Log.i(TAG, "Couldn't decode JSON from: " + json); return; } try { - Log.d("FRING", message.toString()); handleMessage(message.getString("name"), message.getDouble("value")); return; } catch(JSONException e) { } try { handleMessage(message.getString("name"), message.getString("value")); } catch(JSONException e) { Log.w(TAG, "JSON value wasn't a double or string -- couldn't parse", e); } } }
1
0.022222
0
1
8a52ac2110cbb706c7a2be398aa8395b954740a2
src/sct/templates/resources/cloudinit_bootstrap.sh
src/sct/templates/resources/cloudinit_bootstrap.sh
SECRET="@HMAC" CLODINITPAYLOAD="/etc/scape_cloud_init.payload" INSCT="/var/tmp/sct_in_content.raw" INSCTPAYLOAD="/var/tmp/sct_in_content.payload" SCTLOG="/var/log/sct_stage1.log" while [ ! -e "${CLODINITPAYLOAD}" ]; do nc -l 8080 >${INSCT} cat ${INSCT} | ( read PROVIDED_HMAC cat > ${INSCTPAYLOAD} COMPUTED_HMAC=$(cat ${INSCTPAYLOAD} | openssl sha1 -hmac "${SECRET}" | cut -d "=" -f 2 | tr -d " ") echo "Provided HMAC: " "${PROVIDED_HMAC}" >>${SCTLOG} echo "Computed HMAC: " "${COMPUTED_HMAC}" >>${SCTLOG} if [ "${PROVIDED_HMAC}" == "${COMPUTED_HMAC}" ]; then echo "HMAC matched" >>${SCTLOG} cp ${INSCTPAYLOAD} ${CLODINITPAYLOAD} else echo "HMAC does not match" >>${SCTLOG} fi ) done
SECRET="@HMAC" CLODINITPAYLOAD="/etc/scape_cloud_init.payload" INSCT="/var/tmp/sct_in_content.raw" INSCTPAYLOAD="/var/tmp/sct_in_content.payload" SCTLOG="/var/log/sct_stage1.log" echo "STARTING SCRIPT" while [ ! -e "${CLODINITPAYLOAD}" ]; do nc -l 8080 >${INSCT} cat ${INSCT} | ( read PROVIDED_HMAC cat > ${INSCTPAYLOAD} COMPUTED_HMAC=$(cat ${INSCTPAYLOAD} | openssl sha1 -hmac "${SECRET}" | cut -d "=" -f 2 | tr -d " ") echo "Provided HMAC: " "${PROVIDED_HMAC}" >>${SCTLOG} echo "Computed HMAC: " "${COMPUTED_HMAC}" >>${SCTLOG} if [ "${PROVIDED_HMAC}" == "${COMPUTED_HMAC}" ]; then echo "HMAC matched" >>${SCTLOG} cp ${INSCTPAYLOAD} ${CLODINITPAYLOAD} else echo "HMAC does not match" >>${SCTLOG} fi ) done echo "END SCRIPT"
Make deployment script more verbose
Make deployment script more verbose
Shell
apache-2.0
mneagul/scape-cloud-toolkit,mneagul/scape-cloud-toolkit,mneagul/scape-cloud-toolkit
shell
## Code Before: SECRET="@HMAC" CLODINITPAYLOAD="/etc/scape_cloud_init.payload" INSCT="/var/tmp/sct_in_content.raw" INSCTPAYLOAD="/var/tmp/sct_in_content.payload" SCTLOG="/var/log/sct_stage1.log" while [ ! -e "${CLODINITPAYLOAD}" ]; do nc -l 8080 >${INSCT} cat ${INSCT} | ( read PROVIDED_HMAC cat > ${INSCTPAYLOAD} COMPUTED_HMAC=$(cat ${INSCTPAYLOAD} | openssl sha1 -hmac "${SECRET}" | cut -d "=" -f 2 | tr -d " ") echo "Provided HMAC: " "${PROVIDED_HMAC}" >>${SCTLOG} echo "Computed HMAC: " "${COMPUTED_HMAC}" >>${SCTLOG} if [ "${PROVIDED_HMAC}" == "${COMPUTED_HMAC}" ]; then echo "HMAC matched" >>${SCTLOG} cp ${INSCTPAYLOAD} ${CLODINITPAYLOAD} else echo "HMAC does not match" >>${SCTLOG} fi ) done ## Instruction: Make deployment script more verbose ## Code After: SECRET="@HMAC" CLODINITPAYLOAD="/etc/scape_cloud_init.payload" INSCT="/var/tmp/sct_in_content.raw" INSCTPAYLOAD="/var/tmp/sct_in_content.payload" SCTLOG="/var/log/sct_stage1.log" echo "STARTING SCRIPT" while [ ! -e "${CLODINITPAYLOAD}" ]; do nc -l 8080 >${INSCT} cat ${INSCT} | ( read PROVIDED_HMAC cat > ${INSCTPAYLOAD} COMPUTED_HMAC=$(cat ${INSCTPAYLOAD} | openssl sha1 -hmac "${SECRET}" | cut -d "=" -f 2 | tr -d " ") echo "Provided HMAC: " "${PROVIDED_HMAC}" >>${SCTLOG} echo "Computed HMAC: " "${COMPUTED_HMAC}" >>${SCTLOG} if [ "${PROVIDED_HMAC}" == "${COMPUTED_HMAC}" ]; then echo "HMAC matched" >>${SCTLOG} cp ${INSCTPAYLOAD} ${CLODINITPAYLOAD} else echo "HMAC does not match" >>${SCTLOG} fi ) done echo "END SCRIPT"
SECRET="@HMAC" CLODINITPAYLOAD="/etc/scape_cloud_init.payload" INSCT="/var/tmp/sct_in_content.raw" INSCTPAYLOAD="/var/tmp/sct_in_content.payload" SCTLOG="/var/log/sct_stage1.log" + + + echo "STARTING SCRIPT" + while [ ! -e "${CLODINITPAYLOAD}" ]; do nc -l 8080 >${INSCT} cat ${INSCT} | ( read PROVIDED_HMAC cat > ${INSCTPAYLOAD} COMPUTED_HMAC=$(cat ${INSCTPAYLOAD} | openssl sha1 -hmac "${SECRET}" | cut -d "=" -f 2 | tr -d " ") echo "Provided HMAC: " "${PROVIDED_HMAC}" >>${SCTLOG} echo "Computed HMAC: " "${COMPUTED_HMAC}" >>${SCTLOG} if [ "${PROVIDED_HMAC}" == "${COMPUTED_HMAC}" ]; then echo "HMAC matched" >>${SCTLOG} cp ${INSCTPAYLOAD} ${CLODINITPAYLOAD} else echo "HMAC does not match" >>${SCTLOG} fi ) done + + echo "END SCRIPT"
6
0.24
6
0
e95bcb1a2688a9b5a0c09728cdd0082b643de943
pcbot/config.py
pcbot/config.py
import json from os.path import exists from os import mkdir class Config: config_path = "config/" def __init__(self, filename, data=None, load=True): self.filepath = "{}{}.json".format(self.config_path, filename) if not exists(self.config_path): mkdir(self.config_path) loaded_data = None if load: loaded_data = self.load() if data and not loaded_data: self.data = data elif loaded_data: self.data = loaded_data else: self.data = None if not self.data == loaded_data: self.save() def save(self): with open(self.filepath, "w") as f: json.dump(self.data, f) def load(self): if exists(self.filepath): with open(self.filepath, "r") as f: return json.load(f) return None
import json from os.path import exists from os import mkdir class Config: config_path = "config/" def __init__(self, filename, data=None, load=True): self.filepath = "{}{}.json".format(self.config_path, filename) if not exists(self.config_path): mkdir(self.config_path) loaded_data = None if load: loaded_data = self.load() if data is not None and not loaded_data: self.data = data elif loaded_data: self.data = loaded_data else: self.data = None if not self.data == loaded_data: self.save() def save(self): with open(self.filepath, "w") as f: json.dump(self.data, f) def load(self): if exists(self.filepath): with open(self.filepath, "r") as f: return json.load(f) return None
Check if data is not None instead of if data is true
Check if data is not None instead of if data is true
Python
mit
pckv/pcbot,PcBoy111/PC-BOT-V2,PcBoy111/PCBOT
python
## Code Before: import json from os.path import exists from os import mkdir class Config: config_path = "config/" def __init__(self, filename, data=None, load=True): self.filepath = "{}{}.json".format(self.config_path, filename) if not exists(self.config_path): mkdir(self.config_path) loaded_data = None if load: loaded_data = self.load() if data and not loaded_data: self.data = data elif loaded_data: self.data = loaded_data else: self.data = None if not self.data == loaded_data: self.save() def save(self): with open(self.filepath, "w") as f: json.dump(self.data, f) def load(self): if exists(self.filepath): with open(self.filepath, "r") as f: return json.load(f) return None ## Instruction: Check if data is not None instead of if data is true ## Code After: import json from os.path import exists from os import mkdir class Config: config_path = "config/" def __init__(self, filename, data=None, load=True): self.filepath = "{}{}.json".format(self.config_path, filename) if not exists(self.config_path): mkdir(self.config_path) loaded_data = None if load: loaded_data = self.load() if data is not None and not loaded_data: self.data = data elif loaded_data: self.data = loaded_data else: self.data = None if not self.data == loaded_data: self.save() def save(self): with open(self.filepath, "w") as f: json.dump(self.data, f) def load(self): if exists(self.filepath): with open(self.filepath, "r") as f: return json.load(f) return None
import json from os.path import exists from os import mkdir class Config: config_path = "config/" def __init__(self, filename, data=None, load=True): self.filepath = "{}{}.json".format(self.config_path, filename) if not exists(self.config_path): mkdir(self.config_path) loaded_data = None if load: loaded_data = self.load() - if data and not loaded_data: + if data is not None and not loaded_data: ? ++++++++++++ self.data = data elif loaded_data: self.data = loaded_data else: self.data = None if not self.data == loaded_data: self.save() def save(self): with open(self.filepath, "w") as f: json.dump(self.data, f) def load(self): if exists(self.filepath): with open(self.filepath, "r") as f: return json.load(f) return None
2
0.051282
1
1
46457674beb2923cea1efcf999e39bd832110cfc
journeys/transactions_explorer_journey.rb
journeys/transactions_explorer_journey.rb
class TransactionsExplorerJourney < BaseJourney def run() @browser.goto 'gov.uk/performance' sleep 5 moveToEl(@browser.link(:text => 'Transactions Explorer'), { :click => true }) sleep 10 moveToEl(@browser.link(:text => 'Services'), { :click => true }) sleep 4 bubble = @browser.element(:id => 'bubble') scrollToEl(bubble) sleep 2 pos = getPositionOnEl(bubble, { :horizontal => 0.45, :vertical => 0.55 }) moveToEl(bubble, { :horizontal => 0.45, :vertical => 0.55 }) sleep 4 showClick(pos[0], pos[1]) @browser.link(:text => 'HM Revenue and Customs').click sleep 10 bubble = @browser.element(:id => 'bubble') pos = getPositionOnEl(bubble, { :horizontal => 0.35, :vertical => 0.15 }) moveToEl(bubble, { :horizontal => 0.35, :vertical => 0.15 }) sleep 4 showClick(pos[0], pos[1]) @browser.link(:text => 'Pay As You Earn (PAYE)').click sleep 10 moveToEl(@browser.element(:text => 'High-volume services'), { :click => true }) sleep 10 moveToEl(@browser.element(:text => 'Stamp Duty Reserve Tax (SDRT)'), { :horizontal => 0.2, :click => true }) sleep 10 @browser.goto 'gov.uk/performance' end end
class TransactionsExplorerJourney < BaseJourney def run() @browser.goto 'gov.uk/performance' sleep 4 moveToEl(@browser.link(:text => 'Transactions Explorer'), { :click => true }) sleep 5 moveToEl(@browser.link(:text => 'High-volume services'), { :click => true }) sleep 8 moveToEl(@browser.link(:text => 'Pay As You Earn (PAYE)'), { :click => true }) sleep 6 scrollToEl(@browser.element(:text => 'Cost per transaction')) sleep 4 moveToEl(@browser.link(:text => 'All services'), { :click => true }) sleep 6 moveToEl(@browser.link(:id => 'proposition-name'), { :click => true }) end end
Change Transactions Explorer journey to GOV.UK
Change Transactions Explorer journey to GOV.UK
Ruby
mit
alphagov/showtime,alphagov/showtime,alphagov/showtime
ruby
## Code Before: class TransactionsExplorerJourney < BaseJourney def run() @browser.goto 'gov.uk/performance' sleep 5 moveToEl(@browser.link(:text => 'Transactions Explorer'), { :click => true }) sleep 10 moveToEl(@browser.link(:text => 'Services'), { :click => true }) sleep 4 bubble = @browser.element(:id => 'bubble') scrollToEl(bubble) sleep 2 pos = getPositionOnEl(bubble, { :horizontal => 0.45, :vertical => 0.55 }) moveToEl(bubble, { :horizontal => 0.45, :vertical => 0.55 }) sleep 4 showClick(pos[0], pos[1]) @browser.link(:text => 'HM Revenue and Customs').click sleep 10 bubble = @browser.element(:id => 'bubble') pos = getPositionOnEl(bubble, { :horizontal => 0.35, :vertical => 0.15 }) moveToEl(bubble, { :horizontal => 0.35, :vertical => 0.15 }) sleep 4 showClick(pos[0], pos[1]) @browser.link(:text => 'Pay As You Earn (PAYE)').click sleep 10 moveToEl(@browser.element(:text => 'High-volume services'), { :click => true }) sleep 10 moveToEl(@browser.element(:text => 'Stamp Duty Reserve Tax (SDRT)'), { :horizontal => 0.2, :click => true }) sleep 10 @browser.goto 'gov.uk/performance' end end ## Instruction: Change Transactions Explorer journey to GOV.UK ## Code After: class TransactionsExplorerJourney < BaseJourney def run() @browser.goto 'gov.uk/performance' sleep 4 moveToEl(@browser.link(:text => 'Transactions Explorer'), { :click => true }) sleep 5 moveToEl(@browser.link(:text => 'High-volume services'), { :click => true }) sleep 8 moveToEl(@browser.link(:text => 'Pay As You Earn (PAYE)'), { :click => true }) sleep 6 scrollToEl(@browser.element(:text => 'Cost per transaction')) sleep 4 moveToEl(@browser.link(:text => 'All services'), { :click => true }) sleep 6 moveToEl(@browser.link(:id => 'proposition-name'), { :click => true }) end end
class TransactionsExplorerJourney < BaseJourney def run() @browser.goto 'gov.uk/performance' + sleep 4 + + moveToEl(@browser.link(:text => 'Transactions Explorer'), { :click => true }) sleep 5 - moveToEl(@browser.link(:text => 'Transactions Explorer'), { :click => true }) ? ^^^^ -------------- + moveToEl(@browser.link(:text => 'High-volume services'), { :click => true }) ? ^^^^^^^^^^^^ +++++ - sleep 10 ? ^^ + sleep 8 ? ^ - moveToEl(@browser.link(:text => 'Services'), { :click => true }) ? ^^ ^^^^^ + moveToEl(@browser.link(:text => 'Pay As You Earn (PAYE)'), { :click => true }) ? ^^^^^^^^^^^^^ ^^^^^^^^ + sleep 6 + + scrollToEl(@browser.element(:text => 'Cost per transaction')) sleep 4 + moveToEl(@browser.link(:text => 'All services'), { :click => true }) - bubble = @browser.element(:id => 'bubble') - scrollToEl(bubble) - sleep 2 ? ^ + sleep 6 ? ^ + moveToEl(@browser.link(:id => 'proposition-name'), { :click => true }) - pos = getPositionOnEl(bubble, { :horizontal => 0.45, :vertical => 0.55 }) - moveToEl(bubble, { :horizontal => 0.45, :vertical => 0.55 }) - sleep 4 - showClick(pos[0], pos[1]) - @browser.link(:text => 'HM Revenue and Customs').click - sleep 10 - - bubble = @browser.element(:id => 'bubble') - pos = getPositionOnEl(bubble, { :horizontal => 0.35, :vertical => 0.15 }) - moveToEl(bubble, { :horizontal => 0.35, :vertical => 0.15 }) - sleep 4 - showClick(pos[0], pos[1]) - @browser.link(:text => 'Pay As You Earn (PAYE)').click - sleep 10 - - moveToEl(@browser.element(:text => 'High-volume services'), { :click => true }) - sleep 10 - - moveToEl(@browser.element(:text => 'Stamp Duty Reserve Tax (SDRT)'), { - :horizontal => 0.2, :click => true - }) - sleep 10 - - @browser.goto 'gov.uk/performance' end end
42
0.976744
12
30
c7e95c7df5322d9f9f8d31eacc8ea6cb36159323
README.md
README.md
This website was coded using only HTML, CSS, Bootstrap, and was hosted for free through GitHub Pages. ## Copyright and license Code and documentation copyright 2016 Stívali Serna. Code released under [the MIT license](http://choosealicense.com/licenses/mit/). Docs released under [Creative Commons](http://creativecommons.org/licenses/by-nc-sa/4.0/).
This website was coded using only HTML, CSS, Bootstrap, and was hosted for free through GitHub Pages. ## Copyright and license Code and documentation copyright 2016 Stívali Serna. Code released under [the MIT license](https://github.com/stivaliserna/stivaliserna.github.io/blob/master/License.md). Docs released under [Creative Commons](http://creativecommons.org/licenses/by-nc-sa/4.0/).
Change the link of the software license to License.md
Change the link of the software license to License.md
Markdown
mit
stivaliserna/stivaliserna.github.io,stivaliserna/stivaliserna.github.io
markdown
## Code Before: This website was coded using only HTML, CSS, Bootstrap, and was hosted for free through GitHub Pages. ## Copyright and license Code and documentation copyright 2016 Stívali Serna. Code released under [the MIT license](http://choosealicense.com/licenses/mit/). Docs released under [Creative Commons](http://creativecommons.org/licenses/by-nc-sa/4.0/). ## Instruction: Change the link of the software license to License.md ## Code After: This website was coded using only HTML, CSS, Bootstrap, and was hosted for free through GitHub Pages. ## Copyright and license Code and documentation copyright 2016 Stívali Serna. Code released under [the MIT license](https://github.com/stivaliserna/stivaliserna.github.io/blob/master/License.md). Docs released under [Creative Commons](http://creativecommons.org/licenses/by-nc-sa/4.0/).
This website was coded using only HTML, CSS, Bootstrap, and was hosted for free through GitHub Pages. ## Copyright and license - Code and documentation copyright 2016 Stívali Serna. Code released under [the MIT license](http://choosealicense.com/licenses/mit/). Docs released under [Creative Commons](http://creativecommons.org/licenses/by-nc-sa/4.0/). ? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + Code and documentation copyright 2016 Stívali Serna. Code released under [the MIT license](https://github.com/stivaliserna/stivaliserna.github.io/blob/master/License.md). Docs released under [Creative Commons](http://creativecommons.org/licenses/by-nc-sa/4.0/). ? + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2
0.285714
1
1
49ef3333febf0c79c33808389437f50327a12d69
static/js/tags.js
static/js/tags.js
$(document).ready(function() { var classview = new window.ClassesView(); var message_class = '#create-class-message'; var create_class_form = '.create-class-form'; var create_class_button = '#create-class'; var error_display = function(model, xhr, options){ $(create_class_form).removeClass("has-success").addClass("has-error"); $(message_class).html("This class name has been taken. Please try another."); $(create_class_button).attr('disabled', false); }; var success_display = function(model, response, options){ $(create_class_form).removeClass("has-error").addClass("has-success"); $(message_class).html("Class created! Click on the class name below to get started. You may need to reload the page to see it."); $("#refresh-sidebar").click(); classview.refresh(); $(create_class_button).attr('disabled', false); }; $(create_class_button).click( function(event){ event.preventDefault(); $(event.target).attr('disabled', true); var class_name = $("#inputClass1").val(); var classgroup = new Class({'name' : class_name}); classgroup.save(null,{success : success_display, error: error_display, async: false}); return false; }); });
$(document).ready(function() { var classview = new window.ClassesView(); var message_class = '#create-class-message'; var create_class_form = '.create-class-form'; var create_class_button = '#create-class'; var error_display = function(model, xhr, options){ $(create_class_form).removeClass("has-success").addClass("has-error"); $(message_class).html("This class name has been taken. Please try another."); $(create_class_button).attr('disabled', false); }; var success_display = function(model, response, options){ $(create_class_form).removeClass("has-error").addClass("has-success"); $(message_class).html("Class created! Click on the class name below to get started. You may need to reload the page to see it."); window.setTimeout( function(){ $("#refresh-sidebar").click(); classview.refresh(); $(create_class_button).attr('disabled', false); }, 1000 ); }; $(create_class_button).click( function(event){ event.preventDefault(); $(event.target).attr('disabled', true); var class_name = $("#inputClass1").val(); var classgroup = new Class({'name' : class_name}); classgroup.save(null,{success : success_display, error: error_display, async: false}); return false; }); });
Add in settimeout for class creation
Add in settimeout for class creation
JavaScript
agpl-3.0
VikParuchuri/movide,VikParuchuri/movide,VikParuchuri/movide
javascript
## Code Before: $(document).ready(function() { var classview = new window.ClassesView(); var message_class = '#create-class-message'; var create_class_form = '.create-class-form'; var create_class_button = '#create-class'; var error_display = function(model, xhr, options){ $(create_class_form).removeClass("has-success").addClass("has-error"); $(message_class).html("This class name has been taken. Please try another."); $(create_class_button).attr('disabled', false); }; var success_display = function(model, response, options){ $(create_class_form).removeClass("has-error").addClass("has-success"); $(message_class).html("Class created! Click on the class name below to get started. You may need to reload the page to see it."); $("#refresh-sidebar").click(); classview.refresh(); $(create_class_button).attr('disabled', false); }; $(create_class_button).click( function(event){ event.preventDefault(); $(event.target).attr('disabled', true); var class_name = $("#inputClass1").val(); var classgroup = new Class({'name' : class_name}); classgroup.save(null,{success : success_display, error: error_display, async: false}); return false; }); }); ## Instruction: Add in settimeout for class creation ## Code After: $(document).ready(function() { var classview = new window.ClassesView(); var message_class = '#create-class-message'; var create_class_form = '.create-class-form'; var create_class_button = '#create-class'; var error_display = function(model, xhr, options){ $(create_class_form).removeClass("has-success").addClass("has-error"); $(message_class).html("This class name has been taken. Please try another."); $(create_class_button).attr('disabled', false); }; var success_display = function(model, response, options){ $(create_class_form).removeClass("has-error").addClass("has-success"); $(message_class).html("Class created! Click on the class name below to get started. You may need to reload the page to see it."); window.setTimeout( function(){ $("#refresh-sidebar").click(); classview.refresh(); $(create_class_button).attr('disabled', false); }, 1000 ); }; $(create_class_button).click( function(event){ event.preventDefault(); $(event.target).attr('disabled', true); var class_name = $("#inputClass1").val(); var classgroup = new Class({'name' : class_name}); classgroup.save(null,{success : success_display, error: error_display, async: false}); return false; }); });
$(document).ready(function() { var classview = new window.ClassesView(); var message_class = '#create-class-message'; var create_class_form = '.create-class-form'; var create_class_button = '#create-class'; var error_display = function(model, xhr, options){ $(create_class_form).removeClass("has-success").addClass("has-error"); $(message_class).html("This class name has been taken. Please try another."); $(create_class_button).attr('disabled', false); }; var success_display = function(model, response, options){ $(create_class_form).removeClass("has-error").addClass("has-success"); $(message_class).html("Class created! Click on the class name below to get started. You may need to reload the page to see it."); + window.setTimeout( + function(){ - $("#refresh-sidebar").click(); + $("#refresh-sidebar").click(); ? ++++++++ - classview.refresh(); + classview.refresh(); ? ++++++++ - $(create_class_button).attr('disabled', false); + $(create_class_button).attr('disabled', false); ? ++++++++ + }, + 1000 + ); }; $(create_class_button).click( function(event){ event.preventDefault(); $(event.target).attr('disabled', true); var class_name = $("#inputClass1").val(); var classgroup = new Class({'name' : class_name}); classgroup.save(null,{success : success_display, error: error_display, async: false}); return false; }); });
11
0.392857
8
3
65c0a3967235bd31ce41724b56bd9b006e55dcb0
jni/Mapper/InstanceEventListener.java
jni/Mapper/InstanceEventListener.java
package Mapper; public class InstanceEventListener { /*! The set of possible actions on an instance, used to * register callbacks to inform them of what is happening. */ public final int IN_NEW = 0x01; public final int IN_UPSTREAM_RELEASE = 0x02; public final int IN_DOWNSTREAM_RELEASE = 0x04; public final int IN_OVERFLOW = 0x08; public final int IN_ALL = 0xFF; public void onEvent(Mapper.Device.Signal sig, Mapper.Db.Signal props, int instance_id, int event) {}; }
package Mapper; public class InstanceEventListener { /*! The set of possible actions on an instance, used to * register callbacks to inform them of what is happening. */ public static final int IN_NEW = 0x01; public static final int IN_UPSTREAM_RELEASE = 0x02; public static final int IN_DOWNSTREAM_RELEASE = 0x04; public static final int IN_OVERFLOW = 0x08; public static final int IN_ALL = 0xFF; public void onEvent(Mapper.Device.Signal sig, Mapper.Db.Signal props, int instance_id, int event) {}; }
Declare instance event type flags static.
JNI: Declare instance event type flags static.
Java
lgpl-2.1
libmapper/libmapper,malloch/libmapper,davidhernon/libmapper-admin2,malloch/libmapper,johnty/libmapper,libmapper/libmapper,radarsat1/libmapper,radarsat1/libmapper,davidhernon/libmapper-admin2,libmapper/libmapper,davidhernon/libmapper-admin2,malloch/libmapper,malloch/libmapper,johnty/libmapper,malloch/libmapper,davidhernon/libmapper,radarsat1/libmapper,johnty/libmapper,davidhernon/libmapper,davidhernon/libmapper,libmapper/libmapper,libmapper/libmapper,davidhernon/libmapper-admin2,johnty/libmapper,davidhernon/libmapper,davidhernon/libmapper,radarsat1/libmapper,radarsat1/libmapper,libmapper/libmapper,malloch/libmapper,davidhernon/libmapper-admin2,johnty/libmapper
java
## Code Before: package Mapper; public class InstanceEventListener { /*! The set of possible actions on an instance, used to * register callbacks to inform them of what is happening. */ public final int IN_NEW = 0x01; public final int IN_UPSTREAM_RELEASE = 0x02; public final int IN_DOWNSTREAM_RELEASE = 0x04; public final int IN_OVERFLOW = 0x08; public final int IN_ALL = 0xFF; public void onEvent(Mapper.Device.Signal sig, Mapper.Db.Signal props, int instance_id, int event) {}; } ## Instruction: JNI: Declare instance event type flags static. ## Code After: package Mapper; public class InstanceEventListener { /*! The set of possible actions on an instance, used to * register callbacks to inform them of what is happening. */ public static final int IN_NEW = 0x01; public static final int IN_UPSTREAM_RELEASE = 0x02; public static final int IN_DOWNSTREAM_RELEASE = 0x04; public static final int IN_OVERFLOW = 0x08; public static final int IN_ALL = 0xFF; public void onEvent(Mapper.Device.Signal sig, Mapper.Db.Signal props, int instance_id, int event) {}; }
package Mapper; public class InstanceEventListener { /*! The set of possible actions on an instance, used to * register callbacks to inform them of what is happening. */ - public final int IN_NEW = 0x01; + public static final int IN_NEW = 0x01; ? +++++++ - public final int IN_UPSTREAM_RELEASE = 0x02; + public static final int IN_UPSTREAM_RELEASE = 0x02; ? +++++++ - public final int IN_DOWNSTREAM_RELEASE = 0x04; + public static final int IN_DOWNSTREAM_RELEASE = 0x04; ? +++++++ - public final int IN_OVERFLOW = 0x08; + public static final int IN_OVERFLOW = 0x08; ? +++++++ - public final int IN_ALL = 0xFF; + public static final int IN_ALL = 0xFF; ? +++++++ public void onEvent(Mapper.Device.Signal sig, Mapper.Db.Signal props, int instance_id, int event) {}; }
10
0.588235
5
5
9080e9c967fa5e2af43c42a48de8b8ec3231a866
src/tests/behave/agent/features/steps/common.py
src/tests/behave/agent/features/steps/common.py
from collections import defaultdict from behave import given, then, when, step, use_step_matcher use_step_matcher("parse") @given('something with the agent') def step_something_with_the_agent(context): """ :type context: behave.runner.Context """ pass
from collections import defaultdict from behave import given, then, when, step, use_step_matcher use_step_matcher("parse") @given('an agent is running on {ip}') def step_an_agent_is_running_on_ip(context, ip): """ :type context: behave.runner.Context :type ip: str """ pass
Add ip argument to agent running step
Add ip argument to agent running step
Python
apache-2.0
jr0d/mercury,jr0d/mercury
python
## Code Before: from collections import defaultdict from behave import given, then, when, step, use_step_matcher use_step_matcher("parse") @given('something with the agent') def step_something_with_the_agent(context): """ :type context: behave.runner.Context """ pass ## Instruction: Add ip argument to agent running step ## Code After: from collections import defaultdict from behave import given, then, when, step, use_step_matcher use_step_matcher("parse") @given('an agent is running on {ip}') def step_an_agent_is_running_on_ip(context, ip): """ :type context: behave.runner.Context :type ip: str """ pass
from collections import defaultdict from behave import given, then, when, step, use_step_matcher use_step_matcher("parse") - @given('something with the agent') - def step_something_with_the_agent(context): + @given('an agent is running on {ip}') + def step_an_agent_is_running_on_ip(context, ip): """ :type context: behave.runner.Context + :type ip: str """ + pass
6
0.428571
4
2
d2b1e28f6966866c3c45ac3b03917431c19b4524
jumps.lisp
jumps.lisp
(in-package :lispkit) (defparameter *jumps* (make-hash-table :test #'equal)) (defun defjump (place prefix url) (setf (gethash prefix place) url)) (defjump *jumps* "g" "http://google.com/search?q=~a") (defun lookup-jump (s table) (gethash s table)) (defun extract-jump-str (s) (let ((splits (split-sequence #\Space s))) (list (first splits) (format nil "~{~a~^ ~}" (rest splits))))) (defmacro multiple-value-destructuring-bind (lambda-list value-list &body body) (let ((ignore (gensym))) `(destructuring-bind (,@lambda-list &rest ,ignore) (multiple-value-list ,value-list) (declare (ignore ,ignore)) ,@body))) (defun apply-jumps (s browser) (multiple-value-destructuring-bind ((jump args)) (extract-jump-str s) (let ((jump? (lookup-jump jump *jumps*))) (when jump? (load-url (format nil jump? args) browser) t))))
(in-package :lispkit) (defparameter *jumps* (make-hash-table :test #'equal)) (defun defjump (place prefix url) (setf (gethash prefix place) url)) (defjump *jumps* "g" "http://google.com/search?q=~a") (defjump *jumps* "gh" "https://github.com/search?&q=~a") (defun lookup-jump (s table) (gethash s table)) (defun extract-jump-str (s) (let ((splits (split-sequence #\Space s))) (list (first splits) (format nil "~{~a~^ ~}" (rest splits))))) (defmacro multiple-value-destructuring-bind (lambda-list value-list &body body) (let ((ignore (gensym))) `(destructuring-bind (,@lambda-list &rest ,ignore) (multiple-value-list ,value-list) (declare (ignore ,ignore)) ,@body))) (defun apply-jumps (s browser) (multiple-value-destructuring-bind ((jump args)) (extract-jump-str s) (let ((jump? (lookup-jump jump *jumps*))) (when jump? (load-url (format nil jump? args) browser) t))))
Add github to the jump table
Add github to the jump table
Common Lisp
bsd-2-clause
AeroNotix/lispkit,AeroNotix/lispkit
common-lisp
## Code Before: (in-package :lispkit) (defparameter *jumps* (make-hash-table :test #'equal)) (defun defjump (place prefix url) (setf (gethash prefix place) url)) (defjump *jumps* "g" "http://google.com/search?q=~a") (defun lookup-jump (s table) (gethash s table)) (defun extract-jump-str (s) (let ((splits (split-sequence #\Space s))) (list (first splits) (format nil "~{~a~^ ~}" (rest splits))))) (defmacro multiple-value-destructuring-bind (lambda-list value-list &body body) (let ((ignore (gensym))) `(destructuring-bind (,@lambda-list &rest ,ignore) (multiple-value-list ,value-list) (declare (ignore ,ignore)) ,@body))) (defun apply-jumps (s browser) (multiple-value-destructuring-bind ((jump args)) (extract-jump-str s) (let ((jump? (lookup-jump jump *jumps*))) (when jump? (load-url (format nil jump? args) browser) t)))) ## Instruction: Add github to the jump table ## Code After: (in-package :lispkit) (defparameter *jumps* (make-hash-table :test #'equal)) (defun defjump (place prefix url) (setf (gethash prefix place) url)) (defjump *jumps* "g" "http://google.com/search?q=~a") (defjump *jumps* "gh" "https://github.com/search?&q=~a") (defun lookup-jump (s table) (gethash s table)) (defun extract-jump-str (s) (let ((splits (split-sequence #\Space s))) (list (first splits) (format nil "~{~a~^ ~}" (rest splits))))) (defmacro multiple-value-destructuring-bind (lambda-list value-list &body body) (let ((ignore (gensym))) `(destructuring-bind (,@lambda-list &rest ,ignore) (multiple-value-list ,value-list) (declare (ignore ,ignore)) ,@body))) (defun apply-jumps (s browser) (multiple-value-destructuring-bind ((jump args)) (extract-jump-str s) (let ((jump? (lookup-jump jump *jumps*))) (when jump? (load-url (format nil jump? args) browser) t))))
(in-package :lispkit) (defparameter *jumps* (make-hash-table :test #'equal)) (defun defjump (place prefix url) (setf (gethash prefix place) url)) (defjump *jumps* "g" "http://google.com/search?q=~a") + (defjump *jumps* "gh" "https://github.com/search?&q=~a") (defun lookup-jump (s table) (gethash s table)) (defun extract-jump-str (s) (let ((splits (split-sequence #\Space s))) (list (first splits) (format nil "~{~a~^ ~}" (rest splits))))) (defmacro multiple-value-destructuring-bind (lambda-list value-list &body body) (let ((ignore (gensym))) `(destructuring-bind (,@lambda-list &rest ,ignore) (multiple-value-list ,value-list) (declare (ignore ,ignore)) ,@body))) (defun apply-jumps (s browser) (multiple-value-destructuring-bind ((jump args)) (extract-jump-str s) (let ((jump? (lookup-jump jump *jumps*))) (when jump? (load-url (format nil jump? args) browser) t))))
1
0.033333
1
0
ce80d04571160edca099da9cc62c54f76faae22f
spec/lib/mits/document_spec.rb
spec/lib/mits/document_spec.rb
require 'spec_helper' module MITS describe Document do subject { Document.new('./spec/fixtures/mits.xml', version: 4.1) } describe '#properties' do it 'will return the properties' do companies = subject.properties.reduce([]) { |arr, property| arr.push(property) } expect(companies.first).to be_a V4_1::Property expect(companies.size).to eq 2 end end describe '#companies' do it 'will return the companies' do companies = subject.companies.reduce([]) { |arr, company| arr.push(company) } expect(companies.first).to be_a V4_1::Company expect(companies.size).to eq 1 end end end end
require 'spec_helper' module MITS describe Document do subject { Document.new('./spec/fixtures/MITS_4.1_Sample.xml', version: 4.1) } describe '#properties' do it 'will return the properties' do companies = subject.properties.reduce([]) { |arr, property| arr.push(property) } expect(companies.first).to be_a V4_1::Property expect(companies.size).to eq 2 end end describe '#companies' do it 'will return the companies' do companies = subject.companies.reduce([]) { |arr, company| arr.push(company) } expect(companies.first).to be_a V4_1::Company expect(companies.size).to eq 1 end end end end
Update to use new fixture filename
Update to use new fixture filename
Ruby
mit
doomspork/mits
ruby
## Code Before: require 'spec_helper' module MITS describe Document do subject { Document.new('./spec/fixtures/mits.xml', version: 4.1) } describe '#properties' do it 'will return the properties' do companies = subject.properties.reduce([]) { |arr, property| arr.push(property) } expect(companies.first).to be_a V4_1::Property expect(companies.size).to eq 2 end end describe '#companies' do it 'will return the companies' do companies = subject.companies.reduce([]) { |arr, company| arr.push(company) } expect(companies.first).to be_a V4_1::Company expect(companies.size).to eq 1 end end end end ## Instruction: Update to use new fixture filename ## Code After: require 'spec_helper' module MITS describe Document do subject { Document.new('./spec/fixtures/MITS_4.1_Sample.xml', version: 4.1) } describe '#properties' do it 'will return the properties' do companies = subject.properties.reduce([]) { |arr, property| arr.push(property) } expect(companies.first).to be_a V4_1::Property expect(companies.size).to eq 2 end end describe '#companies' do it 'will return the companies' do companies = subject.companies.reduce([]) { |arr, company| arr.push(company) } expect(companies.first).to be_a V4_1::Company expect(companies.size).to eq 1 end end end end
require 'spec_helper' module MITS describe Document do - subject { Document.new('./spec/fixtures/mits.xml', version: 4.1) } ? ^^^ + subject { Document.new('./spec/fixtures/MITS_4.1_Sample.xml', version: 4.1) } ? +++++++++++ ^^^ describe '#properties' do it 'will return the properties' do companies = subject.properties.reduce([]) { |arr, property| arr.push(property) } expect(companies.first).to be_a V4_1::Property expect(companies.size).to eq 2 end end describe '#companies' do it 'will return the companies' do companies = subject.companies.reduce([]) { |arr, company| arr.push(company) } expect(companies.first).to be_a V4_1::Company expect(companies.size).to eq 1 end end end end
2
0.086957
1
1
486bd0f1b0c398f14a8cc59607b667c7522fd2a6
app/Helpers/BBCode/Processors/MarkdownTextProcessor.php
app/Helpers/BBCode/Processors/MarkdownTextProcessor.php
<?php namespace App\Helpers\BBCode\Processors; class MarkdownTextProcessor extends Processor { function Process($result, $text, $scope) { /* * Like everything else here, this isn't exactly markdown, but it's close. * _underline_ * /italics/ * *bold* * ~strikethrough~ * `code` * Very simple rules: no nesting, no newlines, must start/end on a word boundary */ // Bold $text = preg_replace('/\*([.,;\'"]*?\b[^<>\r\n]*?\b[.,;\'"]*?)\*/si', '<strong>$1</strong>', $text); // Italics $text = preg_replace('%/([.,;\'"]*?\b[^<>\r\n]*?\b[.,;\'"]*?)/%si', '<em>$1</em>', $text); // Underline $text = preg_replace('/\b_([^<>\r\n]*?)_\b/si', '<span class="underline">$1</span>', $text); // Strikethrough $text = preg_replace('/~([.,;\'"]*?\b[^<>\r\n]*?\b[.,;\'"]*?)~/si', '<span class="strikethrough">$1</span>', $text); // Code $text = preg_replace('/`([.,;\'"]*?\b[^<>]*?\b[.,;\'"]*?)`/si', '<code>$1</code>', $text); return $text; } }
<?php namespace App\Helpers\BBCode\Processors; class MarkdownTextProcessor extends Processor { function Process($result, $text, $scope) { /* * Like everything else here, this isn't exactly markdown, but it's close. * _underline_ * /italics/ * *bold* * ~strikethrough~ * `code` * Very simple rules: no nesting, no newlines, must start/end on a word boundary */ $pre = '%(?<=^|[\p{P}\s])'; $mid = '([^<>\r\n]*?)'; $post = '(?=[\p{P}\s]|$)%imu'; // Bold $text = preg_replace("{$pre}\*{$mid}\*{$post}", '<strong>$1</strong>', $text); // Italics $text = preg_replace("{$pre}/{$mid}/{$post}", '<em>$1</em>', $text); // Underline $text = preg_replace("{$pre}_{$mid}_{$post}", '<span class="underline">$1</span>', $text); // Strikethrough $text = preg_replace("{$pre}-{$mid}-{$post}", '<span class="strikethrough">$1</span>', $text); // Code $text = preg_replace("{$pre}`{$mid}`{$post}", '<code>$1</code>', $text); return $text; } }
Change the behaviour of the markdown text processor so it follows better whitespace boundary rules
Change the behaviour of the markdown text processor so it follows better whitespace boundary rules
PHP
mit
LogicAndTrick/twhl,LogicAndTrick/twhl,LogicAndTrick/twhl,LogicAndTrick/twhl
php
## Code Before: <?php namespace App\Helpers\BBCode\Processors; class MarkdownTextProcessor extends Processor { function Process($result, $text, $scope) { /* * Like everything else here, this isn't exactly markdown, but it's close. * _underline_ * /italics/ * *bold* * ~strikethrough~ * `code` * Very simple rules: no nesting, no newlines, must start/end on a word boundary */ // Bold $text = preg_replace('/\*([.,;\'"]*?\b[^<>\r\n]*?\b[.,;\'"]*?)\*/si', '<strong>$1</strong>', $text); // Italics $text = preg_replace('%/([.,;\'"]*?\b[^<>\r\n]*?\b[.,;\'"]*?)/%si', '<em>$1</em>', $text); // Underline $text = preg_replace('/\b_([^<>\r\n]*?)_\b/si', '<span class="underline">$1</span>', $text); // Strikethrough $text = preg_replace('/~([.,;\'"]*?\b[^<>\r\n]*?\b[.,;\'"]*?)~/si', '<span class="strikethrough">$1</span>', $text); // Code $text = preg_replace('/`([.,;\'"]*?\b[^<>]*?\b[.,;\'"]*?)`/si', '<code>$1</code>', $text); return $text; } } ## Instruction: Change the behaviour of the markdown text processor so it follows better whitespace boundary rules ## Code After: <?php namespace App\Helpers\BBCode\Processors; class MarkdownTextProcessor extends Processor { function Process($result, $text, $scope) { /* * Like everything else here, this isn't exactly markdown, but it's close. * _underline_ * /italics/ * *bold* * ~strikethrough~ * `code` * Very simple rules: no nesting, no newlines, must start/end on a word boundary */ $pre = '%(?<=^|[\p{P}\s])'; $mid = '([^<>\r\n]*?)'; $post = '(?=[\p{P}\s]|$)%imu'; // Bold $text = preg_replace("{$pre}\*{$mid}\*{$post}", '<strong>$1</strong>', $text); // Italics $text = preg_replace("{$pre}/{$mid}/{$post}", '<em>$1</em>', $text); // Underline $text = preg_replace("{$pre}_{$mid}_{$post}", '<span class="underline">$1</span>', $text); // Strikethrough $text = preg_replace("{$pre}-{$mid}-{$post}", '<span class="strikethrough">$1</span>', $text); // Code $text = preg_replace("{$pre}`{$mid}`{$post}", '<code>$1</code>', $text); return $text; } }
<?php namespace App\Helpers\BBCode\Processors; class MarkdownTextProcessor extends Processor { function Process($result, $text, $scope) { /* * Like everything else here, this isn't exactly markdown, but it's close. * _underline_ * /italics/ * *bold* * ~strikethrough~ * `code` * Very simple rules: no nesting, no newlines, must start/end on a word boundary */ + $pre = '%(?<=^|[\p{P}\s])'; + $mid = '([^<>\r\n]*?)'; + $post = '(?=[\p{P}\s]|$)%imu'; + // Bold - $text = preg_replace('/\*([.,;\'"]*?\b[^<>\r\n]*?\b[.,;\'"]*?)\*/si', '<strong>$1</strong>', $text); + $text = preg_replace("{$pre}\*{$mid}\*{$post}", '<strong>$1</strong>', $text); // Italics - $text = preg_replace('%/([.,;\'"]*?\b[^<>\r\n]*?\b[.,;\'"]*?)/%si', '<em>$1</em>', $text); + $text = preg_replace("{$pre}/{$mid}/{$post}", '<em>$1</em>', $text); // Underline - $text = preg_replace('/\b_([^<>\r\n]*?)_\b/si', '<span class="underline">$1</span>', $text); ? ^^^^ ^^^^^^^^^^^^^ ^^^ ^^ + $text = preg_replace("{$pre}_{$mid}_{$post}", '<span class="underline">$1</span>', $text); ? ^^^^^^^ ^^^^^^ ^^^^ ^^^ // Strikethrough - $text = preg_replace('/~([.,;\'"]*?\b[^<>\r\n]*?\b[.,;\'"]*?)~/si', '<span class="strikethrough">$1</span>', $text); + $text = preg_replace("{$pre}-{$mid}-{$post}", '<span class="strikethrough">$1</span>', $text); // Code - $text = preg_replace('/`([.,;\'"]*?\b[^<>]*?\b[.,;\'"]*?)`/si', '<code>$1</code>', $text); + $text = preg_replace("{$pre}`{$mid}`{$post}", '<code>$1</code>', $text); return $text; } }
14
0.378378
9
5
f51255c519d2ac3bff682877a263f4c23336688d
lib/fabricio/models/issue.rb
lib/fabricio/models/issue.rb
require 'fabricio/models/abstract_model' module Fabricio module Model # This model represents an application build class Issue < AbstractModel attr_reader :id, :displayId, :externalId, :title, :subtitle, :createdAt, :type, :state, :occurrenceCount, :impactedDevices # Returns a Build model object # # @param attributes [Hash] # @return [Fabricio::Model::Build] def initialize(attributes) @id = attributes['id'] @displayId = attributes['displayId'] @externalId = attributes['externalId'] @title = attributes['title'] @subtitle = attributes['subtitle'] @createdAt = attributes['createdAt'] @type = attributes['type'] @state = attributes['state'] @occurrenceCount = attributes['_occurrenceCount2I980d"'] @impactedDevices = attributes['_impactedDevices2oATOx'] @json = attributes end end end end
require 'fabricio/models/abstract_model' module Fabricio module Model # This model represents an application build class Issue < AbstractModel attr_reader :id, :displayId, :externalId, :title, :subtitle, :createdAt, :type, :state, :occurrenceCount, :impactedDevices # Returns a Build model object # # @param attributes [Hash] # @return [Fabricio::Model::Build] def initialize(attributes) @id = attributes['id'] @displayId = attributes['displayId'] @externalId = attributes['externalId'] @title = attributes['title'] @subtitle = attributes['subtitle'] @createdAt = attributes['createdAt'] @type = attributes['type'] @state = attributes['state'] @occurrenceCount = attributes['_occurrenceCount2I980d"'] || attributes['occurrenceCount'] @impactedDevices = attributes['_impactedDevices2oATOx'] || attributes['impactedDevices'] @json = attributes end end end end
Modify field name of topIssue API
Modify field name of topIssue API
Ruby
mit
strongself/fabricio,strongself/fabricio
ruby
## Code Before: require 'fabricio/models/abstract_model' module Fabricio module Model # This model represents an application build class Issue < AbstractModel attr_reader :id, :displayId, :externalId, :title, :subtitle, :createdAt, :type, :state, :occurrenceCount, :impactedDevices # Returns a Build model object # # @param attributes [Hash] # @return [Fabricio::Model::Build] def initialize(attributes) @id = attributes['id'] @displayId = attributes['displayId'] @externalId = attributes['externalId'] @title = attributes['title'] @subtitle = attributes['subtitle'] @createdAt = attributes['createdAt'] @type = attributes['type'] @state = attributes['state'] @occurrenceCount = attributes['_occurrenceCount2I980d"'] @impactedDevices = attributes['_impactedDevices2oATOx'] @json = attributes end end end end ## Instruction: Modify field name of topIssue API ## Code After: require 'fabricio/models/abstract_model' module Fabricio module Model # This model represents an application build class Issue < AbstractModel attr_reader :id, :displayId, :externalId, :title, :subtitle, :createdAt, :type, :state, :occurrenceCount, :impactedDevices # Returns a Build model object # # @param attributes [Hash] # @return [Fabricio::Model::Build] def initialize(attributes) @id = attributes['id'] @displayId = attributes['displayId'] @externalId = attributes['externalId'] @title = attributes['title'] @subtitle = attributes['subtitle'] @createdAt = attributes['createdAt'] @type = attributes['type'] @state = attributes['state'] @occurrenceCount = attributes['_occurrenceCount2I980d"'] || attributes['occurrenceCount'] @impactedDevices = attributes['_impactedDevices2oATOx'] || attributes['impactedDevices'] @json = attributes end end end end
require 'fabricio/models/abstract_model' module Fabricio module Model # This model represents an application build class Issue < AbstractModel attr_reader :id, :displayId, :externalId, :title, :subtitle, :createdAt, :type, :state, :occurrenceCount, :impactedDevices # Returns a Build model object # # @param attributes [Hash] # @return [Fabricio::Model::Build] def initialize(attributes) @id = attributes['id'] @displayId = attributes['displayId'] @externalId = attributes['externalId'] @title = attributes['title'] @subtitle = attributes['subtitle'] @createdAt = attributes['createdAt'] @type = attributes['type'] @state = attributes['state'] - @occurrenceCount = attributes['_occurrenceCount2I980d"'] + @occurrenceCount = attributes['_occurrenceCount2I980d"'] || attributes['occurrenceCount'] ? +++++++++++++++++++++++++++++++++ - @impactedDevices = attributes['_impactedDevices2oATOx'] + @impactedDevices = attributes['_impactedDevices2oATOx'] || attributes['impactedDevices'] ? +++++++++++++++++++++++++++++++++ @json = attributes end end end end
4
0.108108
2
2
435127d55b390f29d9ed34230ae27f7677616122
src/Console/Application.php
src/Console/Application.php
<?php namespace Cffie\Console; use Cffie\Command\QueryCommand; use Symfony\Component\Console\Application as BaseApplication; class Application extends BaseApplication { private $logo = ' ____ _____ _____ _ / ___| ___| ___(_) ___ | | | |_ | |_ | |/ _ \ | |___| _| | _| | | __/ \____|_| |_| |_|\___| '; public function __construct() { parent::__construct('CFFie', '0.1.1'); } protected function getDefaultCommands() { $commands = parent::getDefaultCommands(); $commands[] = new QueryCommand(); return $commands; } public function getHelp() { return $this->logo.parent::getHelp(); } }
<?php namespace Cffie\Console; use Cffie\Command\QueryCommand; use Symfony\Component\Console\Application as BaseApplication; class Application extends BaseApplication { private $logo = ' ____ _____ _____ _ / ___| ___| ___(_) ___ | | | |_ | |_ | |/ _ \ | |___| _| | _| | | __/ \____|_| |_| |_|\___| '; public function __construct() { parent::__construct('CFFie', '0.2.0'); } protected function getDefaultCommands() { $commands = parent::getDefaultCommands(); $commands[] = new QueryCommand(); return $commands; } public function getHelp() { return $this->logo.parent::getHelp(); } public function getLongVersion() { return parent::getLongVersion().' by <comment>Dany Maillard</comment>'; } }
Update version app to v0.2.0
Update version app to v0.2.0
PHP
mit
maidmaid/cffie
php
## Code Before: <?php namespace Cffie\Console; use Cffie\Command\QueryCommand; use Symfony\Component\Console\Application as BaseApplication; class Application extends BaseApplication { private $logo = ' ____ _____ _____ _ / ___| ___| ___(_) ___ | | | |_ | |_ | |/ _ \ | |___| _| | _| | | __/ \____|_| |_| |_|\___| '; public function __construct() { parent::__construct('CFFie', '0.1.1'); } protected function getDefaultCommands() { $commands = parent::getDefaultCommands(); $commands[] = new QueryCommand(); return $commands; } public function getHelp() { return $this->logo.parent::getHelp(); } } ## Instruction: Update version app to v0.2.0 ## Code After: <?php namespace Cffie\Console; use Cffie\Command\QueryCommand; use Symfony\Component\Console\Application as BaseApplication; class Application extends BaseApplication { private $logo = ' ____ _____ _____ _ / ___| ___| ___(_) ___ | | | |_ | |_ | |/ _ \ | |___| _| | _| | | __/ \____|_| |_| |_|\___| '; public function __construct() { parent::__construct('CFFie', '0.2.0'); } protected function getDefaultCommands() { $commands = parent::getDefaultCommands(); $commands[] = new QueryCommand(); return $commands; } public function getHelp() { return $this->logo.parent::getHelp(); } public function getLongVersion() { return parent::getLongVersion().' by <comment>Dany Maillard</comment>'; } }
<?php namespace Cffie\Console; use Cffie\Command\QueryCommand; use Symfony\Component\Console\Application as BaseApplication; class Application extends BaseApplication { private $logo = ' ____ _____ _____ _ / ___| ___| ___(_) ___ | | | |_ | |_ | |/ _ \ | |___| _| | _| | | __/ \____|_| |_| |_|\___| '; public function __construct() { - parent::__construct('CFFie', '0.1.1'); ? ^ ^ + parent::__construct('CFFie', '0.2.0'); ? ^ ^ } protected function getDefaultCommands() { $commands = parent::getDefaultCommands(); $commands[] = new QueryCommand(); return $commands; } public function getHelp() { return $this->logo.parent::getHelp(); } + + public function getLongVersion() + { + return parent::getLongVersion().' by <comment>Dany Maillard</comment>'; + } }
7
0.2
6
1
2d7c8c8806c038ef9f8784f5fb317558315f2f32
bower.json
bower.json
{ "name": "genesis-skeleton", "version": "0.0.1", "dependencies": { "angular": "~1.0.7", "angular-cookies": "~1.0.8", "angular-mocks": "~1.0.7", "angular-sanitize": "~1.0.8", "angular-scenario": "~1.0.7", "angular-strap": "~0.7.4", "bootstrap": "~2.3.2", "html5shiv-dist": "~3.6.2", "modernizr": "~2.6.2", "angular-resource": "~1.0.7", "angular-ui-tinymce": "https://github.com/angular-ui/ui-tinymce.git#4f1b63124c4d16580ce5c9b964ab79b8399661bd" } }
{ "name": "genesis-skeleton", "version": "0.0.1", "dependencies": { "angular": "~1.0.7", "angular-cookies": "~1.0.8", "angular-mocks": "~1.0.7", "angular-sanitize": "~1.0.8", "angular-scenario": "~1.0.7", "angular-strap": "~0.7.4", "bootstrap": "~2.3.2", "html5shiv-dist": "~3.6.2", "modernizr": "~2.6.2", "angular-resource": "~1.0.7", "angular-ui-tinymce": "https://github.com/angular-ui/ui-tinymce.git#4f1b63124c4d16580ce5c9b964ab79b8399661bd", "angular-sanitize" : "~1.0.7" } }
Add missing ngSanitize resource to json
Add missing ngSanitize resource to json
JSON
mit
brettshollenberger/rootstrikers,brettshollenberger/rootstrikers
json
## Code Before: { "name": "genesis-skeleton", "version": "0.0.1", "dependencies": { "angular": "~1.0.7", "angular-cookies": "~1.0.8", "angular-mocks": "~1.0.7", "angular-sanitize": "~1.0.8", "angular-scenario": "~1.0.7", "angular-strap": "~0.7.4", "bootstrap": "~2.3.2", "html5shiv-dist": "~3.6.2", "modernizr": "~2.6.2", "angular-resource": "~1.0.7", "angular-ui-tinymce": "https://github.com/angular-ui/ui-tinymce.git#4f1b63124c4d16580ce5c9b964ab79b8399661bd" } } ## Instruction: Add missing ngSanitize resource to json ## Code After: { "name": "genesis-skeleton", "version": "0.0.1", "dependencies": { "angular": "~1.0.7", "angular-cookies": "~1.0.8", "angular-mocks": "~1.0.7", "angular-sanitize": "~1.0.8", "angular-scenario": "~1.0.7", "angular-strap": "~0.7.4", "bootstrap": "~2.3.2", "html5shiv-dist": "~3.6.2", "modernizr": "~2.6.2", "angular-resource": "~1.0.7", "angular-ui-tinymce": "https://github.com/angular-ui/ui-tinymce.git#4f1b63124c4d16580ce5c9b964ab79b8399661bd", "angular-sanitize" : "~1.0.7" } }
{ "name": "genesis-skeleton", "version": "0.0.1", "dependencies": { "angular": "~1.0.7", "angular-cookies": "~1.0.8", "angular-mocks": "~1.0.7", "angular-sanitize": "~1.0.8", "angular-scenario": "~1.0.7", "angular-strap": "~0.7.4", "bootstrap": "~2.3.2", "html5shiv-dist": "~3.6.2", "modernizr": "~2.6.2", "angular-resource": "~1.0.7", - "angular-ui-tinymce": "https://github.com/angular-ui/ui-tinymce.git#4f1b63124c4d16580ce5c9b964ab79b8399661bd" + "angular-ui-tinymce": "https://github.com/angular-ui/ui-tinymce.git#4f1b63124c4d16580ce5c9b964ab79b8399661bd", ? + + "angular-sanitize" : "~1.0.7" } }
3
0.176471
2
1
eb0e4c9c44020354e1fafa5739fe84ef355d3cce
app/views/components/_phase_banner.html.erb
app/views/components/_phase_banner.html.erb
<div class="phase-banner"> <p> <strong class="phase-tag">BETA</strong> <span>This is a new service under development – your <a href="mailto:pensions-beta-feedback@digital.cabinet-office.gov.uk?Subject=Feedback%20for%20Pension%20Guidance%20Beta%20Service"> feedback</a> will help us to improve it. </span> </p> </div>
<div class="phase-banner"> <p> <strong class="phase-tag">BETA</strong> <span>This is a new service under development – your <a href="mailto:beta-feedback@pensionwise.gov.uk">feedback</a> will help us to improve it. </span> </p> </div>
Update feedback email address to use domain name
Update feedback email address to use domain name
HTML+ERB
mit
guidance-guarantee-programme/pension_guidance,guidance-guarantee-programme/pension_guidance,guidance-guarantee-programme/pension_guidance
html+erb
## Code Before: <div class="phase-banner"> <p> <strong class="phase-tag">BETA</strong> <span>This is a new service under development – your <a href="mailto:pensions-beta-feedback@digital.cabinet-office.gov.uk?Subject=Feedback%20for%20Pension%20Guidance%20Beta%20Service"> feedback</a> will help us to improve it. </span> </p> </div> ## Instruction: Update feedback email address to use domain name ## Code After: <div class="phase-banner"> <p> <strong class="phase-tag">BETA</strong> <span>This is a new service under development – your <a href="mailto:beta-feedback@pensionwise.gov.uk">feedback</a> will help us to improve it. </span> </p> </div>
<div class="phase-banner"> <p> <strong class="phase-tag">BETA</strong> - <span>This is a new service under development – your ? -- + <span>This is a new service under development – your + <a href="mailto:beta-feedback@pensionwise.gov.uk">feedback</a> will help us to improve it. - <a href="mailto:pensions-beta-feedback@digital.cabinet-office.gov.uk?Subject=Feedback%20for%20Pension%20Guidance%20Beta%20Service"> - feedback</a> will help us to improve it. - </span> ? -- + </span> </p> </div>
7
0.777778
3
4
387049ddf44d22c6b2ca8718bf1e03cf765ef5c6
lib/copian.rb
lib/copian.rb
require 'copian/version' require 'copian/collector/abstract_collector' require 'copian/collector/addresses_collector' require 'copian/collector/bandwidth_collector' require 'copian/collector/description_collector' require 'copian/collector/ports_collector' require 'copian/collector/port_stats_collector' require 'copian/collector/generic' require 'copian/collector/cisco' require 'copian/collector/dell' require 'copian/collector/hp' require 'snmp' # :stopdoc: class SNMP::Manager attr_reader :host, :community, :version end # :startdoc: module Copian # :nodoc: module Collector # :nodoc: end end
require 'snmp' require 'copian/version' require 'copian/collector/abstract_collector' require 'copian/collector/addresses_collector' require 'copian/collector/bandwidth_collector' require 'copian/collector/description_collector' require 'copian/collector/ports_collector' require 'copian/collector/port_stats_collector' require 'copian/collector/generic' require 'copian/collector/cisco' require 'copian/collector/dell' require 'copian/collector/hp' # :stopdoc: class SNMP::Manager attr_reader :host, :community, :version end # :startdoc: module Copian # :nodoc: module Collector # :nodoc: end end
Move snmp require so that it's available for other files.
Move snmp require so that it's available for other files.
Ruby
mit
m247/copian
ruby
## Code Before: require 'copian/version' require 'copian/collector/abstract_collector' require 'copian/collector/addresses_collector' require 'copian/collector/bandwidth_collector' require 'copian/collector/description_collector' require 'copian/collector/ports_collector' require 'copian/collector/port_stats_collector' require 'copian/collector/generic' require 'copian/collector/cisco' require 'copian/collector/dell' require 'copian/collector/hp' require 'snmp' # :stopdoc: class SNMP::Manager attr_reader :host, :community, :version end # :startdoc: module Copian # :nodoc: module Collector # :nodoc: end end ## Instruction: Move snmp require so that it's available for other files. ## Code After: require 'snmp' require 'copian/version' require 'copian/collector/abstract_collector' require 'copian/collector/addresses_collector' require 'copian/collector/bandwidth_collector' require 'copian/collector/description_collector' require 'copian/collector/ports_collector' require 'copian/collector/port_stats_collector' require 'copian/collector/generic' require 'copian/collector/cisco' require 'copian/collector/dell' require 'copian/collector/hp' # :stopdoc: class SNMP::Manager attr_reader :host, :community, :version end # :startdoc: module Copian # :nodoc: module Collector # :nodoc: end end
+ require 'snmp' + require 'copian/version' require 'copian/collector/abstract_collector' require 'copian/collector/addresses_collector' require 'copian/collector/bandwidth_collector' require 'copian/collector/description_collector' require 'copian/collector/ports_collector' require 'copian/collector/port_stats_collector' require 'copian/collector/generic' require 'copian/collector/cisco' require 'copian/collector/dell' require 'copian/collector/hp' - require 'snmp' - # :stopdoc: class SNMP::Manager attr_reader :host, :community, :version end # :startdoc: module Copian # :nodoc: module Collector # :nodoc: end end
4
0.166667
2
2
e6f9ec49d23572d3d8cfdbb5e1b5459e4ef86330
.github/workflows/update-merge.yml
.github/workflows/update-merge.yml
name: Merge Elastic updates on: workflow_run: workflows: [ CI ] types: - completed branches: - update/main - update/release-6.x jobs: merge: name: Merge pull request if: ${{ github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest steps: - name: Approve and merge uses: ridedott/merge-me-action@v2 with: GITHUB_LOGIN: docker-elk-updater GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: Merge Elastic updates on: workflow_run: workflows: [ CI ] types: - completed branches: - update/main - update/release-6.x jobs: merge: name: Merge pull request if: ${{ github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest steps: - name: Approve and merge uses: ridedott/merge-me-action@v2 with: GITHUB_LOGIN: docker-elk-updater GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Delete branch uses: actions/github-script@v5 with: script: | await github.request('DELETE /repos/{owner}/{repo}/git/refs/{ref}', { owner: '${{ github.event.workflow_run.repository.owner.login }}', repo: '${{ github.event.workflow_run.repository.name }}', ref: 'heads/${{ github.event.workflow_run.head_branch }}' })
Delete branch after successful Elastic update merge
ci: Delete branch after successful Elastic update merge
YAML
mit
deviantony/docker-elk,deviantony/docker-elk
yaml
## Code Before: name: Merge Elastic updates on: workflow_run: workflows: [ CI ] types: - completed branches: - update/main - update/release-6.x jobs: merge: name: Merge pull request if: ${{ github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest steps: - name: Approve and merge uses: ridedott/merge-me-action@v2 with: GITHUB_LOGIN: docker-elk-updater GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ## Instruction: ci: Delete branch after successful Elastic update merge ## Code After: name: Merge Elastic updates on: workflow_run: workflows: [ CI ] types: - completed branches: - update/main - update/release-6.x jobs: merge: name: Merge pull request if: ${{ github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest steps: - name: Approve and merge uses: ridedott/merge-me-action@v2 with: GITHUB_LOGIN: docker-elk-updater GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Delete branch uses: actions/github-script@v5 with: script: | await github.request('DELETE /repos/{owner}/{repo}/git/refs/{ref}', { owner: '${{ github.event.workflow_run.repository.owner.login }}', repo: '${{ github.event.workflow_run.repository.name }}', ref: 'heads/${{ github.event.workflow_run.head_branch }}' })
name: Merge Elastic updates on: workflow_run: workflows: [ CI ] types: - completed branches: - update/main - update/release-6.x jobs: merge: name: Merge pull request if: ${{ github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest steps: - name: Approve and merge uses: ridedott/merge-me-action@v2 with: GITHUB_LOGIN: docker-elk-updater GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Delete branch + uses: actions/github-script@v5 + with: + script: | + await github.request('DELETE /repos/{owner}/{repo}/git/refs/{ref}', { + owner: '${{ github.event.workflow_run.repository.owner.login }}', + repo: '${{ github.event.workflow_run.repository.name }}', + ref: 'heads/${{ github.event.workflow_run.head_branch }}' + })
10
0.416667
10
0
91f3e6cdbd82cc5ca7927fd1dd0380d7fc5efef4
src/components/GroupMembersView.js
src/components/GroupMembersView.js
import _ from 'lodash' import React from 'react' import {connect} from 'react-redux' import {compose, withHandlers, withProps, withState} from 'recompose' import GroupMembersList from './GroupMembersList' import {addMemberToGroup} from '../actions/groups' const mapStateToProps = ({groups}) => ({ groups }) const enhance = compose( connect(mapStateToProps), withProps(({match}) => ({ groupId: match.params.groupId })), withState('newMember', 'updateNewMember', ''), withHandlers({ onNewMemberChange: props => event => { props.updateNewMember(event.target.value) }, onNewGroupMemberSubmit: props => event => { event.preventDefault() props.dispatch(addMemberToGroup({ groupId: props.groupId, memberId: props.newMember, })) } }), ) const GroupMembersView = ({groups, groupId, onNewGroupMemberSubmit, onNewMemberChange, newMember}) => ( <div> <GroupMembersList groupId={groupId} memberIds={ Object.keys( _.get(groups, `${groupId}.members`, {}) ) } /> <form onSubmit={onNewGroupMemberSubmit}> <textarea placeholder='Add New Member' value={newMember} onChange={onNewMemberChange} /> <input type='submit' value='submit' /> </form> </div> ) export default enhance(GroupMembersView)
import _ from 'lodash' import React from 'react' import {connect} from 'react-redux' import {compose, withHandlers, withProps, withState} from 'recompose' import GroupMembersList from './GroupMembersList' import {addMemberToGroup} from '../actions/groups' const mapStateToProps = ({groups}) => ({ groups }) const enhance = compose( connect(mapStateToProps), withProps(({match}) => ({ groupId: match.params.groupId })), withState('newGroupMember', 'updateNewGroupMember', ''), withHandlers({ onNewGroupMemberChange: props => event => { props.updateNewGroupMember(event.target.value) }, onNewGroupMemberSubmit: props => event => { event.preventDefault() props.dispatch(addMemberToGroup({ groupId: props.groupId, memberId: props.newGroupMember, })) } }), ) const GroupMembersView = ({ groups, groupId, onNewGroupMemberSubmit, onNewGroupMemberChange, newGroupMember, }) => ( <div> <GroupMembersList groupId={groupId} memberIds={ Object.keys( _.get(groups, `${groupId}.members`, {}) ) } /> <form onSubmit={onNewGroupMemberSubmit}> <textarea placeholder='Add New Member' value={newGroupMember} onChange={onNewGroupMemberChange} /> <input type='submit' value='submit' /> </form> </div> ) export default enhance(GroupMembersView)
Update format for group members view
Update format for group members view
JavaScript
mit
mg4tv/mg4tv-web,mg4tv/mg4tv-web
javascript
## Code Before: import _ from 'lodash' import React from 'react' import {connect} from 'react-redux' import {compose, withHandlers, withProps, withState} from 'recompose' import GroupMembersList from './GroupMembersList' import {addMemberToGroup} from '../actions/groups' const mapStateToProps = ({groups}) => ({ groups }) const enhance = compose( connect(mapStateToProps), withProps(({match}) => ({ groupId: match.params.groupId })), withState('newMember', 'updateNewMember', ''), withHandlers({ onNewMemberChange: props => event => { props.updateNewMember(event.target.value) }, onNewGroupMemberSubmit: props => event => { event.preventDefault() props.dispatch(addMemberToGroup({ groupId: props.groupId, memberId: props.newMember, })) } }), ) const GroupMembersView = ({groups, groupId, onNewGroupMemberSubmit, onNewMemberChange, newMember}) => ( <div> <GroupMembersList groupId={groupId} memberIds={ Object.keys( _.get(groups, `${groupId}.members`, {}) ) } /> <form onSubmit={onNewGroupMemberSubmit}> <textarea placeholder='Add New Member' value={newMember} onChange={onNewMemberChange} /> <input type='submit' value='submit' /> </form> </div> ) export default enhance(GroupMembersView) ## Instruction: Update format for group members view ## Code After: import _ from 'lodash' import React from 'react' import {connect} from 'react-redux' import {compose, withHandlers, withProps, withState} from 'recompose' import GroupMembersList from './GroupMembersList' import {addMemberToGroup} from '../actions/groups' const mapStateToProps = ({groups}) => ({ groups }) const enhance = compose( connect(mapStateToProps), withProps(({match}) => ({ groupId: match.params.groupId })), withState('newGroupMember', 'updateNewGroupMember', ''), withHandlers({ onNewGroupMemberChange: props => event => { props.updateNewGroupMember(event.target.value) }, onNewGroupMemberSubmit: props => event => { event.preventDefault() props.dispatch(addMemberToGroup({ groupId: props.groupId, memberId: props.newGroupMember, })) } }), ) const GroupMembersView = ({ groups, groupId, onNewGroupMemberSubmit, onNewGroupMemberChange, newGroupMember, }) => ( <div> <GroupMembersList groupId={groupId} memberIds={ Object.keys( _.get(groups, `${groupId}.members`, {}) ) } /> <form onSubmit={onNewGroupMemberSubmit}> <textarea placeholder='Add New Member' value={newGroupMember} onChange={onNewGroupMemberChange} /> <input type='submit' value='submit' /> </form> </div> ) export default enhance(GroupMembersView)
import _ from 'lodash' import React from 'react' import {connect} from 'react-redux' import {compose, withHandlers, withProps, withState} from 'recompose' import GroupMembersList from './GroupMembersList' import {addMemberToGroup} from '../actions/groups' const mapStateToProps = ({groups}) => ({ groups }) const enhance = compose( connect(mapStateToProps), withProps(({match}) => ({ groupId: match.params.groupId })), - withState('newMember', 'updateNewMember', ''), + withState('newGroupMember', 'updateNewGroupMember', ''), ? +++++ +++++ withHandlers({ - onNewMemberChange: props => event => { + onNewGroupMemberChange: props => event => { ? +++++ - props.updateNewMember(event.target.value) + props.updateNewGroupMember(event.target.value) ? +++++ }, onNewGroupMemberSubmit: props => event => { event.preventDefault() props.dispatch(addMemberToGroup({ groupId: props.groupId, - memberId: props.newMember, + memberId: props.newGroupMember, ? +++++ })) } }), ) - const GroupMembersView = ({groups, groupId, onNewGroupMemberSubmit, onNewMemberChange, newMember}) => ( + const GroupMembersView = ({ + groups, + groupId, + onNewGroupMemberSubmit, + onNewGroupMemberChange, + newGroupMember, + }) => ( <div> <GroupMembersList groupId={groupId} memberIds={ Object.keys( _.get(groups, `${groupId}.members`, {}) ) } /> <form onSubmit={onNewGroupMemberSubmit}> <textarea placeholder='Add New Member' - value={newMember} + value={newGroupMember} ? +++++ - onChange={onNewMemberChange} + onChange={onNewGroupMemberChange} ? +++++ /> <input type='submit' value='submit' /> </form> </div> ) export default enhance(GroupMembersView)
20
0.350877
13
7
01d85ae5489d98d4b5be8dbcf884b783204680ad
routes/login.php
routes/login.php
<?php /* |-------------------------------------------------------------------------- | Login/ULS Routes |-------------------------------------------------------------------------- | */ Route::middleware(['login'])->group(function() { Route::get('/', 'SSOController@getIndex'); Route::get('/return', 'SSOController@getReturn'); }); Route::prefix("/uls")->middleware(['login'])->group(function () { Route::prefix("/v2")->group(function() { Route::get('login', 'ULSv2Controller@getLogin'); Route::get('redirect', 'ULSv2Controller@getRedirect'); Route::get('info', 'ULSv2Controller@getInfo'); }); });
<?php /* |-------------------------------------------------------------------------- | Login/ULS Routes |-------------------------------------------------------------------------- | */ Route::middleware(['login'])->group(function() { Route::get('/', 'SSOController@getIndex'); Route::get('/return', 'SSOController@getReturn'); }); Route::prefix("/uls")->middleware(['login'])->group(function () { Route::prefix("/v2")->group(function() { Route::get('/', 'SSOController@getIndex'); Route::get('/return', 'SSOController@getReturn'); Route::get('/login', 'ULSv2Controller@getLogin'); Route::get('/redirect', 'ULSv2Controller@getRedirect'); Route::get('/info', 'ULSv2Controller@getInfo'); }); });
Duplicate uls routes into versioned path
Duplicate uls routes into versioned path
PHP
mit
VATUSA/api,VATUSA/api,VATUSA/api
php
## Code Before: <?php /* |-------------------------------------------------------------------------- | Login/ULS Routes |-------------------------------------------------------------------------- | */ Route::middleware(['login'])->group(function() { Route::get('/', 'SSOController@getIndex'); Route::get('/return', 'SSOController@getReturn'); }); Route::prefix("/uls")->middleware(['login'])->group(function () { Route::prefix("/v2")->group(function() { Route::get('login', 'ULSv2Controller@getLogin'); Route::get('redirect', 'ULSv2Controller@getRedirect'); Route::get('info', 'ULSv2Controller@getInfo'); }); }); ## Instruction: Duplicate uls routes into versioned path ## Code After: <?php /* |-------------------------------------------------------------------------- | Login/ULS Routes |-------------------------------------------------------------------------- | */ Route::middleware(['login'])->group(function() { Route::get('/', 'SSOController@getIndex'); Route::get('/return', 'SSOController@getReturn'); }); Route::prefix("/uls")->middleware(['login'])->group(function () { Route::prefix("/v2")->group(function() { Route::get('/', 'SSOController@getIndex'); Route::get('/return', 'SSOController@getReturn'); Route::get('/login', 'ULSv2Controller@getLogin'); Route::get('/redirect', 'ULSv2Controller@getRedirect'); Route::get('/info', 'ULSv2Controller@getInfo'); }); });
<?php /* |-------------------------------------------------------------------------- | Login/ULS Routes |-------------------------------------------------------------------------- | */ Route::middleware(['login'])->group(function() { Route::get('/', 'SSOController@getIndex'); Route::get('/return', 'SSOController@getReturn'); }); Route::prefix("/uls")->middleware(['login'])->group(function () { Route::prefix("/v2")->group(function() { + Route::get('/', 'SSOController@getIndex'); + Route::get('/return', 'SSOController@getReturn'); - Route::get('login', 'ULSv2Controller@getLogin'); + Route::get('/login', 'ULSv2Controller@getLogin'); ? + + - Route::get('redirect', 'ULSv2Controller@getRedirect'); + Route::get('/redirect', 'ULSv2Controller@getRedirect'); ? + + - Route::get('info', 'ULSv2Controller@getInfo'); + Route::get('/info', 'ULSv2Controller@getInfo'); ? + + }); });
8
0.380952
5
3
d7699f359b7dd8e8eb2b3e9382218ce57fa38ab6
README.md
README.md
An API for manipulating Xcode project files. # Usage ## Adding Source Files to a Project Project* project = [[Project alloc] initWithFilePath:@"/tmp"]; Group* group = [project groupWithPath:@"Main"]; ClassDefinition* classDefinition = [[ClassDefinition alloc] initWithName:@"MyNewClass"]; [classDefinition setHeader:[NSString stringWithTestResource:@"ESA_Sales_Foobar_ViewController.header"]]; [classDefinition setSource:[NSString stringWithTestResource:@"ESA_Sales_Foobar_ViewController.impl"]]; [group addClass:classDefinition]; [project save]; ## Specifying Source File Belongs to Target FileResource* fileResource = [project projectFileWithPath:@"MyNewClass.m"]; Target* examples = [project targetWithName:@"Examples"]; [examples addMember:fileResource]; [project save]; # API Docs <link pending> # Authors Jasper Blues - jasper.blues@expanz.com
An API for manipulating Xcode project files. # Usage ## Adding Source Files to a Project ```objective-c Project* project = [[Project alloc] initWithFilePath:@"/tmp"]; Group* group = [project groupWithPath:@"Main"]; ClassDefinition* classDefinition = [[ClassDefinition alloc] initWithName:@"MyNewClass"]; [classDefinition setHeader:[NSString stringWithTestResource:@"ESA_Sales_Foobar_ViewController.header"]]; [classDefinition setSource:[NSString stringWithTestResource:@"ESA_Sales_Foobar_ViewController.impl"]]; [group addClass:classDefinition]; [project save]; ``` ## Specifying Source File Belongs to Target ```objective-c FileResource* fileResource = [project projectFileWithPath:@"MyNewClass.m"]; Target* examples = [project targetWithName:@"Examples"]; [examples addMember:fileResource]; [project save]; ``` # API Docs <link pending> # Authors Jasper Blues - jasper.blues@expanz.com
Add code highlighting to readme.
Add code highlighting to readme.
Markdown
apache-2.0
khanhtbh/XcodeEditor,service2media/XcodeEditor,JoelGerboreLaser/XcodeEditor,JoelGerboreLaser/XcodeEditor,khanhtbh/XcodeEditor,iosdevzone/XcodeEditor,appsquickly/XcodeEditor,cezheng/XcodeEditor,cezheng/XcodeEditor,andyvand/XcodeEditor,appsquickly/XcodeEditor,appsquickly/XcodeEditor
markdown
## Code Before: An API for manipulating Xcode project files. # Usage ## Adding Source Files to a Project Project* project = [[Project alloc] initWithFilePath:@"/tmp"]; Group* group = [project groupWithPath:@"Main"]; ClassDefinition* classDefinition = [[ClassDefinition alloc] initWithName:@"MyNewClass"]; [classDefinition setHeader:[NSString stringWithTestResource:@"ESA_Sales_Foobar_ViewController.header"]]; [classDefinition setSource:[NSString stringWithTestResource:@"ESA_Sales_Foobar_ViewController.impl"]]; [group addClass:classDefinition]; [project save]; ## Specifying Source File Belongs to Target FileResource* fileResource = [project projectFileWithPath:@"MyNewClass.m"]; Target* examples = [project targetWithName:@"Examples"]; [examples addMember:fileResource]; [project save]; # API Docs <link pending> # Authors Jasper Blues - jasper.blues@expanz.com ## Instruction: Add code highlighting to readme. ## Code After: An API for manipulating Xcode project files. # Usage ## Adding Source Files to a Project ```objective-c Project* project = [[Project alloc] initWithFilePath:@"/tmp"]; Group* group = [project groupWithPath:@"Main"]; ClassDefinition* classDefinition = [[ClassDefinition alloc] initWithName:@"MyNewClass"]; [classDefinition setHeader:[NSString stringWithTestResource:@"ESA_Sales_Foobar_ViewController.header"]]; [classDefinition setSource:[NSString stringWithTestResource:@"ESA_Sales_Foobar_ViewController.impl"]]; [group addClass:classDefinition]; [project save]; ``` ## Specifying Source File Belongs to Target ```objective-c FileResource* fileResource = [project projectFileWithPath:@"MyNewClass.m"]; Target* examples = [project targetWithName:@"Examples"]; [examples addMember:fileResource]; [project save]; ``` # API Docs <link pending> # Authors Jasper Blues - jasper.blues@expanz.com
An API for manipulating Xcode project files. # Usage ## Adding Source Files to a Project + ```objective-c Project* project = [[Project alloc] initWithFilePath:@"/tmp"]; Group* group = [project groupWithPath:@"Main"]; ClassDefinition* classDefinition = [[ClassDefinition alloc] initWithName:@"MyNewClass"]; [classDefinition setHeader:[NSString stringWithTestResource:@"ESA_Sales_Foobar_ViewController.header"]]; [classDefinition setSource:[NSString stringWithTestResource:@"ESA_Sales_Foobar_ViewController.impl"]]; [group addClass:classDefinition]; [project save]; - + ``` ## Specifying Source File Belongs to Target + ```objective-c FileResource* fileResource = [project projectFileWithPath:@"MyNewClass.m"]; Target* examples = [project targetWithName:@"Examples"]; [examples addMember:fileResource]; [project save]; + ``` # API Docs <link pending> # Authors Jasper Blues - jasper.blues@expanz.com
5
0.147059
4
1
2980b40b2a62c1cd760f9e87ef1fe0be3730dec7
af_4chan/init.php
af_4chan/init.php
<?php class Af_4chan extends Plugin { function about() { return array(0.1, "Fetch full size image from 4chan /b/ feed", "Markus Wiik"); } function init($host) { $host->add_hook($host::HOOK_ARTICLE_FILTER, $this); } function hook_article_filter($article) { $owner_uid = $article["owner_uid"]; if (preg_match('/4chan.org\/b\//', $article['link'])) { if (strpos($article["plugin_data"], "4chan,$owner_uid:") === FALSE) { $doc = new DOMDocument(); $doc->loadHTML($article['content']); if ($doc) { $xpath = new DOMXPath($doc); $imgurl = $xpath->query('//a')->item(0)->getAttribute('href'); if (is_null($imgurl)) { return $article; } $xpath->query('//img')->item(0)->setAttribute('src', $imgurl); $article["content"] = $doc->saveHTML(); $article["plugin_data"] = "4chan,$owner_uid:" . $article["plugin_data"]; } } else if (isset($article["stored"]["content"])) { $article["content"] = $article["stored"]["content"]; } } return $article; } } ?>
<?php class Af_4chan extends Plugin { function about() { return array(0.1, "Fetch full size image from 4chan /b/ feed", "Markus Wiik"); } function init($host) { $host->add_hook($host::HOOK_ARTICLE_FILTER, $this); } function hook_article_filter($article) { $owner_uid = $article["owner_uid"]; if (preg_match('/4chan.org\/b\//', $article['link'])) { if (strpos($article["plugin_data"], "4chan,$owner_uid:") === FALSE) { $doc = new DOMDocument(); $doc->loadHTML($article['content']); if ($doc) { $xpath = new DOMXPath($doc); $imgurl = $xpath->query('//a')->item(0)->getAttribute('href'); if (is_null($imgurl)) { return $article; } $xpath->query('//img')->item(0)->setAttribute('src', $imgurl); $article["content"] = $doc->saveHTML(); $article["plugin_data"] = "4chan,$owner_uid:" . $article["plugin_data"]; } } else if (isset($article["stored"]["content"])) { $article["content"] = $article["stored"]["content"]; } } return $article; } function api_version() { return 2; } } ?>
Update 4chan plugin for 1.7.9 compatibility
Update 4chan plugin for 1.7.9 compatibility
PHP
mit
Vassius/TinyTinyRSS-plugins
php
## Code Before: <?php class Af_4chan extends Plugin { function about() { return array(0.1, "Fetch full size image from 4chan /b/ feed", "Markus Wiik"); } function init($host) { $host->add_hook($host::HOOK_ARTICLE_FILTER, $this); } function hook_article_filter($article) { $owner_uid = $article["owner_uid"]; if (preg_match('/4chan.org\/b\//', $article['link'])) { if (strpos($article["plugin_data"], "4chan,$owner_uid:") === FALSE) { $doc = new DOMDocument(); $doc->loadHTML($article['content']); if ($doc) { $xpath = new DOMXPath($doc); $imgurl = $xpath->query('//a')->item(0)->getAttribute('href'); if (is_null($imgurl)) { return $article; } $xpath->query('//img')->item(0)->setAttribute('src', $imgurl); $article["content"] = $doc->saveHTML(); $article["plugin_data"] = "4chan,$owner_uid:" . $article["plugin_data"]; } } else if (isset($article["stored"]["content"])) { $article["content"] = $article["stored"]["content"]; } } return $article; } } ?> ## Instruction: Update 4chan plugin for 1.7.9 compatibility ## Code After: <?php class Af_4chan extends Plugin { function about() { return array(0.1, "Fetch full size image from 4chan /b/ feed", "Markus Wiik"); } function init($host) { $host->add_hook($host::HOOK_ARTICLE_FILTER, $this); } function hook_article_filter($article) { $owner_uid = $article["owner_uid"]; if (preg_match('/4chan.org\/b\//', $article['link'])) { if (strpos($article["plugin_data"], "4chan,$owner_uid:") === FALSE) { $doc = new DOMDocument(); $doc->loadHTML($article['content']); if ($doc) { $xpath = new DOMXPath($doc); $imgurl = $xpath->query('//a')->item(0)->getAttribute('href'); if (is_null($imgurl)) { return $article; } $xpath->query('//img')->item(0)->setAttribute('src', $imgurl); $article["content"] = $doc->saveHTML(); $article["plugin_data"] = "4chan,$owner_uid:" . $article["plugin_data"]; } } else if (isset($article["stored"]["content"])) { $article["content"] = $article["stored"]["content"]; } } return $article; } function api_version() { return 2; } } ?>
<?php class Af_4chan extends Plugin { function about() { return array(0.1, "Fetch full size image from 4chan /b/ feed", "Markus Wiik"); } function init($host) { $host->add_hook($host::HOOK_ARTICLE_FILTER, $this); } function hook_article_filter($article) { $owner_uid = $article["owner_uid"]; if (preg_match('/4chan.org\/b\//', $article['link'])) { if (strpos($article["plugin_data"], "4chan,$owner_uid:") === FALSE) { $doc = new DOMDocument(); $doc->loadHTML($article['content']); if ($doc) { $xpath = new DOMXPath($doc); $imgurl = $xpath->query('//a')->item(0)->getAttribute('href'); if (is_null($imgurl)) { return $article; } $xpath->query('//img')->item(0)->setAttribute('src', $imgurl); $article["content"] = $doc->saveHTML(); $article["plugin_data"] = "4chan,$owner_uid:" . $article["plugin_data"]; } } else if (isset($article["stored"]["content"])) { $article["content"] = $article["stored"]["content"]; } } return $article; } + + function api_version() { + return 2; + } } ?>
4
0.102564
4
0
f84df81f060746567b611a2071ff1a161fcf3206
generic_links/models.py
generic_links/models.py
from django import VERSION from django.conf import settings from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.translation import ugettext_lazy as _ def get_user_model_fk_ref(): """Get user model depending on Django version.""" ver = VERSION if ver[0] >= 1 and ver[1] >= 5: return settings.AUTH_USER_MODEL else: return 'auth.User' class GenericLink(models.Model): """ Relates an object with an url and its data """ content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE) object_id = models.PositiveIntegerField(db_index=True) content_object = GenericForeignKey() url = models.URLField() title = models.CharField(max_length=200) description = models.TextField(max_length=1000, null=True, blank=True) user = models.ForeignKey(get_user_model_fk_ref(), null=True, blank=True, on_delete=models.SET_NULL) created_at = models.DateTimeField(auto_now_add=True, db_index=True) is_external = models.BooleanField(default=True, db_index=True) class Meta: ordering = ("-created_at", ) verbose_name = _("Generic Link") verbose_name_plural = _("Generic Links") def __unicode__(self): return self.url
from django.contrib.auth import get_user_model from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.translation import ugettext_lazy as _ class GenericLink(models.Model): """ Relates an object with an url and its data """ content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE) object_id = models.PositiveIntegerField(db_index=True) content_object = GenericForeignKey() url = models.URLField() title = models.CharField(max_length=200) description = models.TextField(max_length=1000, null=True, blank=True) user = models.ForeignKey(get_user_model(), null=True, blank=True, on_delete=models.SET_NULL) created_at = models.DateTimeField(auto_now_add=True, db_index=True) is_external = models.BooleanField(default=True, db_index=True) class Meta: ordering = ("-created_at", ) verbose_name = _("Generic Link") verbose_name_plural = _("Generic Links") def __unicode__(self): return self.url
Make User model compatible with Django 2.x
Make User model compatible with Django 2.x
Python
bsd-3-clause
matagus/django-generic-links,matagus/django-generic-links
python
## Code Before: from django import VERSION from django.conf import settings from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.translation import ugettext_lazy as _ def get_user_model_fk_ref(): """Get user model depending on Django version.""" ver = VERSION if ver[0] >= 1 and ver[1] >= 5: return settings.AUTH_USER_MODEL else: return 'auth.User' class GenericLink(models.Model): """ Relates an object with an url and its data """ content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE) object_id = models.PositiveIntegerField(db_index=True) content_object = GenericForeignKey() url = models.URLField() title = models.CharField(max_length=200) description = models.TextField(max_length=1000, null=True, blank=True) user = models.ForeignKey(get_user_model_fk_ref(), null=True, blank=True, on_delete=models.SET_NULL) created_at = models.DateTimeField(auto_now_add=True, db_index=True) is_external = models.BooleanField(default=True, db_index=True) class Meta: ordering = ("-created_at", ) verbose_name = _("Generic Link") verbose_name_plural = _("Generic Links") def __unicode__(self): return self.url ## Instruction: Make User model compatible with Django 2.x ## Code After: from django.contrib.auth import get_user_model from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.translation import ugettext_lazy as _ class GenericLink(models.Model): """ Relates an object with an url and its data """ content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE) object_id = models.PositiveIntegerField(db_index=True) content_object = GenericForeignKey() url = models.URLField() title = models.CharField(max_length=200) description = models.TextField(max_length=1000, null=True, blank=True) user = models.ForeignKey(get_user_model(), null=True, blank=True, on_delete=models.SET_NULL) created_at = models.DateTimeField(auto_now_add=True, db_index=True) is_external = models.BooleanField(default=True, db_index=True) class Meta: ordering = ("-created_at", ) verbose_name = _("Generic Link") verbose_name_plural = _("Generic Links") def __unicode__(self): return self.url
+ from django.contrib.auth import get_user_model - from django import VERSION - from django.conf import settings from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.translation import ugettext_lazy as _ - - - def get_user_model_fk_ref(): - """Get user model depending on Django version.""" - ver = VERSION - - if ver[0] >= 1 and ver[1] >= 5: - return settings.AUTH_USER_MODEL - else: - return 'auth.User' class GenericLink(models.Model): """ Relates an object with an url and its data """ content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE) object_id = models.PositiveIntegerField(db_index=True) content_object = GenericForeignKey() url = models.URLField() title = models.CharField(max_length=200) description = models.TextField(max_length=1000, null=True, blank=True) - user = models.ForeignKey(get_user_model_fk_ref(), null=True, blank=True, ? ------- + user = models.ForeignKey(get_user_model(), null=True, blank=True, on_delete=models.SET_NULL) created_at = models.DateTimeField(auto_now_add=True, db_index=True) is_external = models.BooleanField(default=True, db_index=True) class Meta: ordering = ("-created_at", ) verbose_name = _("Generic Link") verbose_name_plural = _("Generic Links") def __unicode__(self): return self.url
15
0.340909
2
13
f240e2b31abc873e124330e12112f21a34ea6e09
python_deps.txt
python_deps.txt
Flask==0.10.1 itsdangerous==0.24 Jinja2==2.8 MarkupSafe==0.23 pyhs2==0.6.0 pymongo==3.1 sasl==0.1.3 thrift==0.9.3 Werkzeug==0.10.4 wheel==0.24.0
Flask==0.10.1 Flask-Login==0.3.2 itsdangerous==0.24 Jinja2==2.8 MarkupSafe==0.23 pyhs2==0.6.0 pymongo==3.1 sasl==0.1.3 thrift==0.9.3 Werkzeug==0.10.4 wheel==0.24.0
Update python dependecies for login feature
Update python dependecies for login feature
Text
mit
davidottogonzalez/Audience-Studio-Query-Builder,davidottogonzalez/ATP,davidottogonzalez/Audience-Studio-Query-Builder,davidottogonzalez/ATP,davidottogonzalez/Audience-Studio-Query-Builder,davidottogonzalez/ATP,davidottogonzalez/Audience-Studio-Query-Builder,davidottogonzalez/ATP
text
## Code Before: Flask==0.10.1 itsdangerous==0.24 Jinja2==2.8 MarkupSafe==0.23 pyhs2==0.6.0 pymongo==3.1 sasl==0.1.3 thrift==0.9.3 Werkzeug==0.10.4 wheel==0.24.0 ## Instruction: Update python dependecies for login feature ## Code After: Flask==0.10.1 Flask-Login==0.3.2 itsdangerous==0.24 Jinja2==2.8 MarkupSafe==0.23 pyhs2==0.6.0 pymongo==3.1 sasl==0.1.3 thrift==0.9.3 Werkzeug==0.10.4 wheel==0.24.0
Flask==0.10.1 + Flask-Login==0.3.2 itsdangerous==0.24 Jinja2==2.8 MarkupSafe==0.23 pyhs2==0.6.0 pymongo==3.1 sasl==0.1.3 thrift==0.9.3 Werkzeug==0.10.4 wheel==0.24.0
1
0.1
1
0
fd3022abe76603989a5edaf73b2dbd9984696522
deploy/vagrant/provision/start_tachyon_on_local.yml
deploy/vagrant/provision/start_tachyon_on_local.yml
- hosts: TachyonMaster tasks: - include: roles/zookeeper/tasks/main.yml when: tachyon_masters > 1 - hosts: TachyonMaster* tasks: - name: set master address to own hostname shell: sed -i "s/export TACHYON_MASTER_ADDRESS=.*/export TACHYON_MASTER_ADDRESS=$(hostname -A | cut -d' ' -f1)/g" /tachyon/conf/tachyon-env.sh - include: roles/tachyon/tasks/start_master.yml - hosts: all tasks: - include: roles/tachyon/tasks/start_worker.yml
- hosts: TachyonMaster tasks: - include: roles/zookeeper/tasks/main.yml when: tachyon_masters > 1 - hosts: TachyonMaster* tasks: - name: set master address to own hostname shell: sed -i "s/export TACHYON_MASTER_ADDRESS=.*/export TACHYON_MASTER_ADDRESS=$(hostname -A | cut -d' ' -f1)/g" /tachyon/conf/tachyon-env.sh - name: set journal folder as a shared undered folder in underfs shell: echo 'tachyon.master.journal.folder=${tachyon.underfs.address}/tachyon/journal/' >> /tachyon/conf/tachyon-site.properties - include: roles/tachyon/tasks/start_master.yml - hosts: all tasks: - include: roles/tachyon/tasks/start_worker.yml
Set journal folder as a shared folder in ufs
Set journal folder as a shared folder in ufs
YAML
apache-2.0
wwjiang007/alluxio,WilliamZapata/alluxio,jsimsa/alluxio,wwjiang007/alluxio,wwjiang007/alluxio,maboelhassan/alluxio,EvilMcJerkface/alluxio,ChangerYoung/alluxio,calvinjia/tachyon,madanadit/alluxio,jsimsa/alluxio,ChangerYoung/alluxio,madanadit/alluxio,WilliamZapata/alluxio,WilliamZapata/alluxio,bf8086/alluxio,jswudi/alluxio,ChangerYoung/alluxio,EvilMcJerkface/alluxio,uronce-cc/alluxio,Alluxio/alluxio,jswudi/alluxio,aaudiber/alluxio,Alluxio/alluxio,maboelhassan/alluxio,Reidddddd/mo-alluxio,riversand963/alluxio,uronce-cc/alluxio,apc999/alluxio,wwjiang007/alluxio,aaudiber/alluxio,Alluxio/alluxio,Reidddddd/alluxio,maobaolong/alluxio,ShailShah/alluxio,madanadit/alluxio,wwjiang007/alluxio,jsimsa/alluxio,Alluxio/alluxio,uronce-cc/alluxio,maobaolong/alluxio,ShailShah/alluxio,jswudi/alluxio,aaudiber/alluxio,bf8086/alluxio,Reidddddd/alluxio,apc999/alluxio,maobaolong/alluxio,Reidddddd/mo-alluxio,bf8086/alluxio,Alluxio/alluxio,jsimsa/alluxio,madanadit/alluxio,jswudi/alluxio,WilliamZapata/alluxio,wwjiang007/alluxio,calvinjia/tachyon,Reidddddd/alluxio,wwjiang007/alluxio,PasaLab/tachyon,jsimsa/alluxio,Reidddddd/mo-alluxio,yuluo-ding/alluxio,yuluo-ding/alluxio,riversand963/alluxio,yuluo-ding/alluxio,Reidddddd/alluxio,maobaolong/alluxio,ShailShah/alluxio,apc999/alluxio,maboelhassan/alluxio,Reidddddd/alluxio,PasaLab/tachyon,wwjiang007/alluxio,madanadit/alluxio,aaudiber/alluxio,ChangerYoung/alluxio,apc999/alluxio,PasaLab/tachyon,bf8086/alluxio,EvilMcJerkface/alluxio,aaudiber/alluxio,yuluo-ding/alluxio,madanadit/alluxio,PasaLab/tachyon,jswudi/alluxio,PasaLab/tachyon,WilliamZapata/alluxio,PasaLab/tachyon,ShailShah/alluxio,PasaLab/tachyon,ChangerYoung/alluxio,ShailShah/alluxio,Reidddddd/mo-alluxio,Alluxio/alluxio,madanadit/alluxio,uronce-cc/alluxio,bf8086/alluxio,maobaolong/alluxio,riversand963/alluxio,wwjiang007/alluxio,Alluxio/alluxio,wwjiang007/alluxio,uronce-cc/alluxio,madanadit/alluxio,apc999/alluxio,Reidddddd/mo-alluxio,maobaolong/alluxio,calvinjia/tachyon,bf8086/alluxio,riversand963/alluxio,maobaolong/alluxio,calvinjia/tachyon,jswudi/alluxio,apc999/alluxio,calvinjia/tachyon,calvinjia/tachyon,EvilMcJerkface/alluxio,riversand963/alluxio,yuluo-ding/alluxio,EvilMcJerkface/alluxio,calvinjia/tachyon,maboelhassan/alluxio,uronce-cc/alluxio,EvilMcJerkface/alluxio,Reidddddd/mo-alluxio,Reidddddd/alluxio,maboelhassan/alluxio,EvilMcJerkface/alluxio,EvilMcJerkface/alluxio,Alluxio/alluxio,WilliamZapata/alluxio,maobaolong/alluxio,Alluxio/alluxio,bf8086/alluxio,Alluxio/alluxio,Reidddddd/alluxio,maboelhassan/alluxio,riversand963/alluxio,ChangerYoung/alluxio,aaudiber/alluxio,jsimsa/alluxio,aaudiber/alluxio,maobaolong/alluxio,apc999/alluxio,bf8086/alluxio,maboelhassan/alluxio,ShailShah/alluxio,yuluo-ding/alluxio,calvinjia/tachyon,maobaolong/alluxio
yaml
## Code Before: - hosts: TachyonMaster tasks: - include: roles/zookeeper/tasks/main.yml when: tachyon_masters > 1 - hosts: TachyonMaster* tasks: - name: set master address to own hostname shell: sed -i "s/export TACHYON_MASTER_ADDRESS=.*/export TACHYON_MASTER_ADDRESS=$(hostname -A | cut -d' ' -f1)/g" /tachyon/conf/tachyon-env.sh - include: roles/tachyon/tasks/start_master.yml - hosts: all tasks: - include: roles/tachyon/tasks/start_worker.yml ## Instruction: Set journal folder as a shared folder in ufs ## Code After: - hosts: TachyonMaster tasks: - include: roles/zookeeper/tasks/main.yml when: tachyon_masters > 1 - hosts: TachyonMaster* tasks: - name: set master address to own hostname shell: sed -i "s/export TACHYON_MASTER_ADDRESS=.*/export TACHYON_MASTER_ADDRESS=$(hostname -A | cut -d' ' -f1)/g" /tachyon/conf/tachyon-env.sh - name: set journal folder as a shared undered folder in underfs shell: echo 'tachyon.master.journal.folder=${tachyon.underfs.address}/tachyon/journal/' >> /tachyon/conf/tachyon-site.properties - include: roles/tachyon/tasks/start_master.yml - hosts: all tasks: - include: roles/tachyon/tasks/start_worker.yml
- hosts: TachyonMaster tasks: - include: roles/zookeeper/tasks/main.yml when: tachyon_masters > 1 - hosts: TachyonMaster* tasks: - name: set master address to own hostname shell: sed -i "s/export TACHYON_MASTER_ADDRESS=.*/export TACHYON_MASTER_ADDRESS=$(hostname -A | cut -d' ' -f1)/g" /tachyon/conf/tachyon-env.sh + - name: set journal folder as a shared undered folder in underfs + shell: echo 'tachyon.master.journal.folder=${tachyon.underfs.address}/tachyon/journal/' >> /tachyon/conf/tachyon-site.properties + - include: roles/tachyon/tasks/start_master.yml - hosts: all tasks: - include: roles/tachyon/tasks/start_worker.yml
3
0.2
3
0
cbd952c3286b6bd74508b03f9317e9a17a20cbf4
db/migrate/20141105192836_migrate_joined_activity_to_accepted.rb
db/migrate/20141105192836_migrate_joined_activity_to_accepted.rb
class MigrateJoinedActivityToAccepted < ActiveRecord::Migration def up RecentActivity.where(:key => 'space.join').each do |act| puts "Converting :join activity to :accept id: #{act.id}" act.update_attributes :key => 'space.accept' end end def down RecentActivity.where(:key => 'space.accept').each do |act| puts "Converting :accept activity to :join id: #{act.id}" act.update_attributes :key => 'space.join' end end end
class MigrateJoinedActivityToAccepted < ActiveRecord::Migration def up connection = ActiveRecord::Base.connection() sql = "UPDATE `activities` SET `key` = 'space.accept' WHERE `key` = 'space.join';" connection.execute sql end def down connection = ActiveRecord::Base.connection() sql = "UPDATE `activities` SET `key` = 'space.join' WHERE `key` = 'space.accept';" connection.execute sql end end
Use SQL in the migration from da55f0a90
Use SQL in the migration from da55f0a90 refs #1402
Ruby
agpl-3.0
mconf-rnp/mconf-web,akratech/Akraconference,becueb/MconfWeb,akratech/Akraconference,becueb/MconfWeb,mconf/mconf-web,mconftec/mconf-web-ufpe,fbottin/mconf-web,fbottin/mconf-web,mconf-ufrgs/mconf-web,amreis/mconf-web,mconf-ufrgs/mconf-web,becueb/MconfWeb,mconftec/mconf-web-uergs,akratech/Akraconference,mconftec/mconf-web-mytruecloud,amreis/mconf-web,mconftec/mconf-web-mytruecloud,lfzawacki/mconf-web,mconftec/mconf-web-ufpe,amreis/mconf-web,fbottin/mconf-web,mconftec/mconf-web-santacasa,mconf/mconf-web,mconftec/mconf-web-ufpe,amreis/mconf-web,mconftec/mconf-web-uergs,lfzawacki/mconf-web,fbottin/mconf-web,mconftec/mconf-web-uergs,mconftec/mconf-web-ufpe,mconf/mconf-web,lfzawacki/mconf-web,lfzawacki/mconf-web,mconftec/mconf-web-santacasa,mconf-rnp/mconf-web,mconf-rnp/mconf-web,mconftec/mconf-web-santacasa,akratech/Akraconference,mconf-ufrgs/mconf-web,mconftec/mconf-web-uergs,mconftec/mconf-web-mytruecloud,mconf/mconf-web,mconftec/mconf-web-mytruecloud,mconftec/mconf-web-santacasa,becueb/MconfWeb,mconf-ufrgs/mconf-web,mconf-rnp/mconf-web
ruby
## Code Before: class MigrateJoinedActivityToAccepted < ActiveRecord::Migration def up RecentActivity.where(:key => 'space.join').each do |act| puts "Converting :join activity to :accept id: #{act.id}" act.update_attributes :key => 'space.accept' end end def down RecentActivity.where(:key => 'space.accept').each do |act| puts "Converting :accept activity to :join id: #{act.id}" act.update_attributes :key => 'space.join' end end end ## Instruction: Use SQL in the migration from da55f0a90 refs #1402 ## Code After: class MigrateJoinedActivityToAccepted < ActiveRecord::Migration def up connection = ActiveRecord::Base.connection() sql = "UPDATE `activities` SET `key` = 'space.accept' WHERE `key` = 'space.join';" connection.execute sql end def down connection = ActiveRecord::Base.connection() sql = "UPDATE `activities` SET `key` = 'space.join' WHERE `key` = 'space.accept';" connection.execute sql end end
class MigrateJoinedActivityToAccepted < ActiveRecord::Migration def up + connection = ActiveRecord::Base.connection() + sql = "UPDATE `activities` SET `key` = 'space.accept' WHERE `key` = 'space.join';" + connection.execute sql - RecentActivity.where(:key => 'space.join').each do |act| - puts "Converting :join activity to :accept id: #{act.id}" - act.update_attributes :key => 'space.accept' - end end def down + connection = ActiveRecord::Base.connection() + sql = "UPDATE `activities` SET `key` = 'space.join' WHERE `key` = 'space.accept';" + connection.execute sql - RecentActivity.where(:key => 'space.accept').each do |act| - puts "Converting :accept activity to :join id: #{act.id}" - act.update_attributes :key => 'space.join' - end end end
14
0.933333
6
8
0e82920ed81c001f0464d9372ee0463f21f87030
opencog/nlp/scm/nlp.scm
opencog/nlp/scm/nlp.scm
(define-module (opencog nlp)) (use-modules (opencog) (opencog atom-types)) ; User-modifiable config paramters. (define-public relex-server-host "127.0.0.1") (define-public relex-server-port 4444) ; Load various parts.... (load "nlp/nlp-utils.scm") (load "nlp/disjunct-list.scm") (load "nlp/processing-utils.scm")
(define-module (opencog nlp)) (use-modules (opencog) (opencog atom-types)) ; User-modifiable config paramters. (define-public relex-server-host "127.0.0.1") (define-public relex-server-port 4444) ; Load various parts.... (load "nlp/nlp-utils.scm") (load "nlp/disjunct-list.scm") (load "nlp/processing-utils.scm") ; Weird ... MUST say `(export)` or no define-publics are visible! (export)
Fix crazy guile module bug.
Fix crazy guile module bug.
Scheme
agpl-3.0
inflector/opencog,ruiting/opencog,misgeatgit/opencog,inflector/opencog,yantrabuddhi/opencog,misgeatgit/opencog,shujingke/opencog,andre-senna/opencog,shujingke/opencog,AmeBel/opencog,ruiting/opencog,misgeatgit/opencog,inflector/opencog,shujingke/opencog,ruiting/opencog,ruiting/opencog,inflector/opencog,misgeatgit/opencog,andre-senna/opencog,andre-senna/opencog,AmeBel/opencog,shujingke/opencog,andre-senna/opencog,yantrabuddhi/opencog,misgeatgit/opencog,inflector/opencog,yantrabuddhi/opencog,misgeatgit/opencog,inflector/opencog,yantrabuddhi/opencog,shujingke/opencog,AmeBel/opencog,ruiting/opencog,misgeatgit/opencog,andre-senna/opencog,shujingke/opencog,andre-senna/opencog,AmeBel/opencog,yantrabuddhi/opencog,AmeBel/opencog,shujingke/opencog,misgeatgit/opencog,AmeBel/opencog,misgeatgit/opencog,inflector/opencog,yantrabuddhi/opencog,inflector/opencog,ruiting/opencog,andre-senna/opencog,yantrabuddhi/opencog,ruiting/opencog,AmeBel/opencog
scheme
## Code Before: (define-module (opencog nlp)) (use-modules (opencog) (opencog atom-types)) ; User-modifiable config paramters. (define-public relex-server-host "127.0.0.1") (define-public relex-server-port 4444) ; Load various parts.... (load "nlp/nlp-utils.scm") (load "nlp/disjunct-list.scm") (load "nlp/processing-utils.scm") ## Instruction: Fix crazy guile module bug. ## Code After: (define-module (opencog nlp)) (use-modules (opencog) (opencog atom-types)) ; User-modifiable config paramters. (define-public relex-server-host "127.0.0.1") (define-public relex-server-port 4444) ; Load various parts.... (load "nlp/nlp-utils.scm") (load "nlp/disjunct-list.scm") (load "nlp/processing-utils.scm") ; Weird ... MUST say `(export)` or no define-publics are visible! (export)
(define-module (opencog nlp)) (use-modules (opencog) (opencog atom-types)) ; User-modifiable config paramters. (define-public relex-server-host "127.0.0.1") (define-public relex-server-port 4444) ; Load various parts.... (load "nlp/nlp-utils.scm") (load "nlp/disjunct-list.scm") (load "nlp/processing-utils.scm") + + ; Weird ... MUST say `(export)` or no define-publics are visible! + (export)
3
0.230769
3
0
3f1f0fda94bb751e332dc9ad5cd9d7b74a75744a
Handler/Home.hs
Handler/Home.hs
module Handler.Home where import Import import qualified Prelude import qualified Util.Formatting as F import qualified Util.Meetup as M getHomeR :: Handler Html getHomeR = do app <- getYesod let meetupApiKey = appMeetupApiKey $ appSettings app event <- liftIO $ do events <- M.fetchEvents meetupApiKey return $ Prelude.head events defaultLayout $ do setTitle "SeaHUG" $(widgetFile "home") getAboutR :: Handler Html getAboutR = do app <- getYesod let gitHubUrl = appGitHubUrl $ appSettings app defaultLayout $ do setTitle "SeaHUG - about" $(widgetFile "about") getContactR :: Handler Html getContactR = do defaultLayout $ do setTitle "SeaHUG - contact" $(widgetFile "contact") getPcphR :: Handler Html getPcphR = do defaultLayout $ do setTitle "SeaHUG - Parallel and concurrent programming in Haskell" $(widgetFile "pcph")
module Handler.Home where import Import import qualified Prelude import qualified Util.Formatting as F import qualified Util.Meetup as M getHomeR :: Handler Html getHomeR = do app <- getYesod let meetupApiKey = appMeetupApiKey $ appSettings app event <- liftIO $ do events <- M.fetchEvents meetupApiKey return $ Prelude.head events defaultLayout $ do setTitle "SeaHUG" $(widgetFile "home") getAboutR :: Handler Html getAboutR = do app <- getYesod let gitHubUrl = appGitHubUrl $ appSettings app defaultLayout $ do setTitle "SeaHUG - about" $(widgetFile "about") getContactR :: Handler Html getContactR = do defaultLayout $ do setTitle "SeaHUG - contact" $(widgetFile "contact") getPcphR :: Handler Html getPcphR = do defaultLayout $ do setTitle "SeaHUG - Parallel and concurrent programming in Haskell" $(widgetFile "pcph")
Fix indentation to two spaces
Fix indentation to two spaces
Haskell
mit
rcook/seattlehaskell-org,seahug/seattlehaskell-org,seahug/seattlehaskell-org,rcook/seattlehaskell-org
haskell
## Code Before: module Handler.Home where import Import import qualified Prelude import qualified Util.Formatting as F import qualified Util.Meetup as M getHomeR :: Handler Html getHomeR = do app <- getYesod let meetupApiKey = appMeetupApiKey $ appSettings app event <- liftIO $ do events <- M.fetchEvents meetupApiKey return $ Prelude.head events defaultLayout $ do setTitle "SeaHUG" $(widgetFile "home") getAboutR :: Handler Html getAboutR = do app <- getYesod let gitHubUrl = appGitHubUrl $ appSettings app defaultLayout $ do setTitle "SeaHUG - about" $(widgetFile "about") getContactR :: Handler Html getContactR = do defaultLayout $ do setTitle "SeaHUG - contact" $(widgetFile "contact") getPcphR :: Handler Html getPcphR = do defaultLayout $ do setTitle "SeaHUG - Parallel and concurrent programming in Haskell" $(widgetFile "pcph") ## Instruction: Fix indentation to two spaces ## Code After: module Handler.Home where import Import import qualified Prelude import qualified Util.Formatting as F import qualified Util.Meetup as M getHomeR :: Handler Html getHomeR = do app <- getYesod let meetupApiKey = appMeetupApiKey $ appSettings app event <- liftIO $ do events <- M.fetchEvents meetupApiKey return $ Prelude.head events defaultLayout $ do setTitle "SeaHUG" $(widgetFile "home") getAboutR :: Handler Html getAboutR = do app <- getYesod let gitHubUrl = appGitHubUrl $ appSettings app defaultLayout $ do setTitle "SeaHUG - about" $(widgetFile "about") getContactR :: Handler Html getContactR = do defaultLayout $ do setTitle "SeaHUG - contact" $(widgetFile "contact") getPcphR :: Handler Html getPcphR = do defaultLayout $ do setTitle "SeaHUG - Parallel and concurrent programming in Haskell" $(widgetFile "pcph")
module Handler.Home where import Import import qualified Prelude import qualified Util.Formatting as F import qualified Util.Meetup as M getHomeR :: Handler Html getHomeR = do - app <- getYesod ? -- + app <- getYesod - let meetupApiKey = appMeetupApiKey $ appSettings app ? -- + let meetupApiKey = appMeetupApiKey $ appSettings app - event <- liftIO $ do ? -- + event <- liftIO $ do - events <- M.fetchEvents meetupApiKey ? ---- + events <- M.fetchEvents meetupApiKey - return $ Prelude.head events ? ---- + return $ Prelude.head events - defaultLayout $ do ? -- + defaultLayout $ do - setTitle "SeaHUG" ? ---- + setTitle "SeaHUG" - $(widgetFile "home") ? ---- + $(widgetFile "home") getAboutR :: Handler Html getAboutR = do - app <- getYesod ? -- + app <- getYesod - let gitHubUrl = appGitHubUrl $ appSettings app ? -- + let gitHubUrl = appGitHubUrl $ appSettings app - defaultLayout $ do ? -- + defaultLayout $ do - setTitle "SeaHUG - about" ? ---- + setTitle "SeaHUG - about" - $(widgetFile "about") ? ---- + $(widgetFile "about") getContactR :: Handler Html getContactR = do - defaultLayout $ do ? -- + defaultLayout $ do - setTitle "SeaHUG - contact" ? ---- + setTitle "SeaHUG - contact" - $(widgetFile "contact") ? ---- + $(widgetFile "contact") getPcphR :: Handler Html getPcphR = do - defaultLayout $ do ? -- + defaultLayout $ do - setTitle "SeaHUG - Parallel and concurrent programming in Haskell" ? ---- + setTitle "SeaHUG - Parallel and concurrent programming in Haskell" - $(widgetFile "pcph") ? ---- + $(widgetFile "pcph")
38
1
19
19
b46bfc142bcc1032fec5526a1c43a266d38ea4a2
README.md
README.md
Fetch ip information from the database at http://ip.taobao.com # Usage usage: main.py [-h] [-o OUTPUT] iprange positional arguments: iprange The string of IP range, such as: "192.168.1.0-192.168.1.255" : beginning-end "192.168.1.0/24" : CIDR "192.168.1.*" : wildcard optional arguments: -h, --help show this help message and exit -o OUTPUT, --output OUTPUT The output destination of result, default is stdout ![Image text](https://github.com/Ghostist/taobaoip/blob/master/screenshot/screenshot1.png) ![Image text](https://github.com/Ghostist/taobaoip/blob/master/screenshot/screenshot2.png) # Note The progressbar.py is included by package: progressbar2, which you can install through pip: pip install progressbar2 I just put it here for convenience.
Fetch ip information from the database at http://ip.taobao.com # Usage usage: main.py [-h] [-o OUTPUT] iprange positional arguments: iprange The string of IP range, such as: "192.168.1.0-192.168.1.255" : beginning-end "192.168.1.0/24" : CIDR "192.168.1.*" : wildcard optional arguments: -h, --help show this help message and exit -o OUTPUT, --output OUTPUT The output destination of result, default is stdout ## Database surrport Change main.py to fit your own database configuration. ```python db_host = "localhost" db_username = "root" db_password = "" db_name = "geoip" db_table = "geoip" ``` ![Image text](https://github.com/Ghostist/taobaoip/blob/master/screenshot/screenshot1.png) ![Image text](https://github.com/Ghostist/taobaoip/blob/master/screenshot/screenshot2.png) # Note The progressbar.py is included by package: progressbar2, which you can install through pip: pip install progressbar2 I just put it here for convenience.
Add database description in readme.md
Add database description in readme.md
Markdown
mit
Ghostist/taobaoip
markdown
## Code Before: Fetch ip information from the database at http://ip.taobao.com # Usage usage: main.py [-h] [-o OUTPUT] iprange positional arguments: iprange The string of IP range, such as: "192.168.1.0-192.168.1.255" : beginning-end "192.168.1.0/24" : CIDR "192.168.1.*" : wildcard optional arguments: -h, --help show this help message and exit -o OUTPUT, --output OUTPUT The output destination of result, default is stdout ![Image text](https://github.com/Ghostist/taobaoip/blob/master/screenshot/screenshot1.png) ![Image text](https://github.com/Ghostist/taobaoip/blob/master/screenshot/screenshot2.png) # Note The progressbar.py is included by package: progressbar2, which you can install through pip: pip install progressbar2 I just put it here for convenience. ## Instruction: Add database description in readme.md ## Code After: Fetch ip information from the database at http://ip.taobao.com # Usage usage: main.py [-h] [-o OUTPUT] iprange positional arguments: iprange The string of IP range, such as: "192.168.1.0-192.168.1.255" : beginning-end "192.168.1.0/24" : CIDR "192.168.1.*" : wildcard optional arguments: -h, --help show this help message and exit -o OUTPUT, --output OUTPUT The output destination of result, default is stdout ## Database surrport Change main.py to fit your own database configuration. ```python db_host = "localhost" db_username = "root" db_password = "" db_name = "geoip" db_table = "geoip" ``` ![Image text](https://github.com/Ghostist/taobaoip/blob/master/screenshot/screenshot1.png) ![Image text](https://github.com/Ghostist/taobaoip/blob/master/screenshot/screenshot2.png) # Note The progressbar.py is included by package: progressbar2, which you can install through pip: pip install progressbar2 I just put it here for convenience.
Fetch ip information from the database at http://ip.taobao.com # Usage usage: main.py [-h] [-o OUTPUT] iprange positional arguments: iprange The string of IP range, such as: "192.168.1.0-192.168.1.255" : beginning-end "192.168.1.0/24" : CIDR "192.168.1.*" : wildcard optional arguments: -h, --help show this help message and exit -o OUTPUT, --output OUTPUT The output destination of result, default is stdout + ## Database surrport + Change main.py to fit your own database configuration. + ```python + db_host = "localhost" + db_username = "root" + db_password = "" + db_name = "geoip" + db_table = "geoip" + ``` ![Image text](https://github.com/Ghostist/taobaoip/blob/master/screenshot/screenshot1.png) ![Image text](https://github.com/Ghostist/taobaoip/blob/master/screenshot/screenshot2.png) # Note The progressbar.py is included by package: progressbar2, which you can install through pip: pip install progressbar2 I just put it here for convenience.
9
0.391304
9
0
c34ebf0da60e1c4542fd69870202f49fe085dd67
BigStash/decorators.py
BigStash/decorators.py
from requests.exceptions import RequestException from .error import BigStashError from wrapt import decorator @decorator def json_response(wrapped, instance, args, kwargs): try: r = wrapped(*args, **kwargs) r.raise_for_status() return r.json() except RequestException: raise BigStashError except ValueError: raise BigStashError
from requests.exceptions import RequestException from .error import BigStashError from wrapt import decorator @decorator def json_response(wrapped, instance, args, kwargs): try: r = wrapped(*args, **kwargs) r.raise_for_status() return r.json() except RequestException as e: raise BigStashError(e) except ValueError as e: raise BigStashError(e) @decorator def no_content_response(wrapped, instance, args, kwargs): try: r = wrapped(*args, **kwargs) r.raise_for_status() except RequestException as e: raise BigStashError(e)
Add decorator for empty responses and show error messages
Add decorator for empty responses and show error messages - Add decorator for responses with no content, like delete requests. - Show original error messages for now
Python
apache-2.0
longaccess/bigstash-python,longaccess/bigstash-python
python
## Code Before: from requests.exceptions import RequestException from .error import BigStashError from wrapt import decorator @decorator def json_response(wrapped, instance, args, kwargs): try: r = wrapped(*args, **kwargs) r.raise_for_status() return r.json() except RequestException: raise BigStashError except ValueError: raise BigStashError ## Instruction: Add decorator for empty responses and show error messages - Add decorator for responses with no content, like delete requests. - Show original error messages for now ## Code After: from requests.exceptions import RequestException from .error import BigStashError from wrapt import decorator @decorator def json_response(wrapped, instance, args, kwargs): try: r = wrapped(*args, **kwargs) r.raise_for_status() return r.json() except RequestException as e: raise BigStashError(e) except ValueError as e: raise BigStashError(e) @decorator def no_content_response(wrapped, instance, args, kwargs): try: r = wrapped(*args, **kwargs) r.raise_for_status() except RequestException as e: raise BigStashError(e)
from requests.exceptions import RequestException from .error import BigStashError from wrapt import decorator @decorator def json_response(wrapped, instance, args, kwargs): try: r = wrapped(*args, **kwargs) r.raise_for_status() return r.json() - except RequestException: + except RequestException as e: ? +++++ - raise BigStashError + raise BigStashError(e) ? +++ - except ValueError: + except ValueError as e: ? +++++ - raise BigStashError + raise BigStashError(e) ? +++ + + + @decorator + def no_content_response(wrapped, instance, args, kwargs): + try: + r = wrapped(*args, **kwargs) + r.raise_for_status() + except RequestException as e: + raise BigStashError(e)
17
1.133333
13
4
c2f402e1a0befc7fcf6207f0595df0dff7ecf168
lib/biased/client.rb
lib/biased/client.rb
require "httparty" require "wikipedia" module Biased # @author Justin Harrison # @since 0.0.1 # @attr_reader [String] parent The potentially biased website's parent # organization. class Client attr_reader(:parent) # @param [String] domain The potentially biased website's domain. def initialize(domain) @domain = domain @parent = gather_from_wikipedia end # Gathers the parent organization of any website from wikipedia # if possible. # @since 0.0.1 # @return [String, nil] The parent organization or nil. def gather_from_wikipedia parent = nil content = Wikipedia.find(@domain).content # Wikipedia has multiple fields for a parent organization, # so we need to try each one %w(parent owner).each do |field| # This Regex should be cleaned up. match = /(#{field}\s*=\s\[\[)(.*\w+)/.match(content) if match parent = match[2] break end end parent end end end
require "httparty" require "wikipedia" module Biased # The main class that a end user will use to interact with the application. # @author Justin Harrison # @since 0.0.1 # @attr_reader [String] parent The potentially biased website's parent # organization. # Biased::Client.new("huffingtonpost.com") class Client attr_reader(:parent) # @param [String] domain The potentially biased website's domain. def initialize(domain) @domain = domain @parent = gather_from_wikipedia end # Gathers the parent organization of any website from wikipedia # if possible. # @since 0.0.1 # @return [String, nil] The parent organization or nil. def gather_from_wikipedia parent = nil content = Wikipedia.find(@domain).content # Wikipedia has multiple fields for a parent organization, # so we need to try each one %w(parent owner).each do |field| # This Regex should be cleaned up. match = /(#{field}\s*=\s\[\[)(.*\w+)/.match(content) if match parent = match[2] break end end parent end end end
Include more documentation for Biased::Client
Include more documentation for Biased::Client
Ruby
mit
matthin/biased
ruby
## Code Before: require "httparty" require "wikipedia" module Biased # @author Justin Harrison # @since 0.0.1 # @attr_reader [String] parent The potentially biased website's parent # organization. class Client attr_reader(:parent) # @param [String] domain The potentially biased website's domain. def initialize(domain) @domain = domain @parent = gather_from_wikipedia end # Gathers the parent organization of any website from wikipedia # if possible. # @since 0.0.1 # @return [String, nil] The parent organization or nil. def gather_from_wikipedia parent = nil content = Wikipedia.find(@domain).content # Wikipedia has multiple fields for a parent organization, # so we need to try each one %w(parent owner).each do |field| # This Regex should be cleaned up. match = /(#{field}\s*=\s\[\[)(.*\w+)/.match(content) if match parent = match[2] break end end parent end end end ## Instruction: Include more documentation for Biased::Client ## Code After: require "httparty" require "wikipedia" module Biased # The main class that a end user will use to interact with the application. # @author Justin Harrison # @since 0.0.1 # @attr_reader [String] parent The potentially biased website's parent # organization. # Biased::Client.new("huffingtonpost.com") class Client attr_reader(:parent) # @param [String] domain The potentially biased website's domain. def initialize(domain) @domain = domain @parent = gather_from_wikipedia end # Gathers the parent organization of any website from wikipedia # if possible. # @since 0.0.1 # @return [String, nil] The parent organization or nil. def gather_from_wikipedia parent = nil content = Wikipedia.find(@domain).content # Wikipedia has multiple fields for a parent organization, # so we need to try each one %w(parent owner).each do |field| # This Regex should be cleaned up. match = /(#{field}\s*=\s\[\[)(.*\w+)/.match(content) if match parent = match[2] break end end parent end end end
require "httparty" require "wikipedia" module Biased + # The main class that a end user will use to interact with the application. # @author Justin Harrison # @since 0.0.1 # @attr_reader [String] parent The potentially biased website's parent # organization. + # Biased::Client.new("huffingtonpost.com") class Client attr_reader(:parent) # @param [String] domain The potentially biased website's domain. def initialize(domain) @domain = domain @parent = gather_from_wikipedia end # Gathers the parent organization of any website from wikipedia # if possible. # @since 0.0.1 # @return [String, nil] The parent organization or nil. def gather_from_wikipedia parent = nil content = Wikipedia.find(@domain).content # Wikipedia has multiple fields for a parent organization, # so we need to try each one %w(parent owner).each do |field| # This Regex should be cleaned up. match = /(#{field}\s*=\s\[\[)(.*\w+)/.match(content) if match parent = match[2] break end end parent end end end
2
0.05
2
0