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
2569ca89d308a23be218ba6e7a890e11de201b1b
app/assets/javascripts/messaging.js
app/assets/javascripts/messaging.js
;(function(){ var app = angular.module('Communicant', []); app.controller('ListOfMessagesController', ['$scope', '$http', function($scope, $http){ $http.get("/messages.json") .then(function(response){ $scope.messages = response.data; }) }]); // END ListOfMessagesController app.controller('SendMessageController', ['$scope', '$http', function($scope, $http){ // console.log("Hello?"); $scope.newMessage = { }; $scope.submit = function(){ $http.post("/messages.json", $scope.newMessage); }; $http.get("/messages.json") .then(function(response){ $scope.messages = response.data; }) }]); // END SendMessageController })(); // END IIFE
;(function(){ var app = angular.module('Communicant', []); app.controller('ListOfMessagesController', ['$scope', '$http', function($scope, $http){ $http.get("/messages.json") .then(function(response){ $scope.messages = response.data; }) }]); // END ListOfMessagesController app.controller('SendMessageController', ['$scope', '$http', function($scope, $http){ // console.log("Hello?"); $scope.newMessage = { }; $scope.submit = function(){ $http.post("/messages.json", $scope.newMessage); }; $http.get("/messages.json") .then(function(response){ $scope.messages = response.data; }) }]); // END SendMessageController // $timeout([fn], [2000], [invokeApply], [Pass]); })(); // END IIFE
Add code commented note about setTimeout
Add code commented note about setTimeout
JavaScript
mit
Communicant/app,Communicant/app,Communicant/app
javascript
## Code Before: ;(function(){ var app = angular.module('Communicant', []); app.controller('ListOfMessagesController', ['$scope', '$http', function($scope, $http){ $http.get("/messages.json") .then(function(response){ $scope.messages = response.data; }) }]); // END ListOfMessagesController app.controller('SendMessageController', ['$scope', '$http', function($scope, $http){ // console.log("Hello?"); $scope.newMessage = { }; $scope.submit = function(){ $http.post("/messages.json", $scope.newMessage); }; $http.get("/messages.json") .then(function(response){ $scope.messages = response.data; }) }]); // END SendMessageController })(); // END IIFE ## Instruction: Add code commented note about setTimeout ## Code After: ;(function(){ var app = angular.module('Communicant', []); app.controller('ListOfMessagesController', ['$scope', '$http', function($scope, $http){ $http.get("/messages.json") .then(function(response){ $scope.messages = response.data; }) }]); // END ListOfMessagesController app.controller('SendMessageController', ['$scope', '$http', function($scope, $http){ // console.log("Hello?"); $scope.newMessage = { }; $scope.submit = function(){ $http.post("/messages.json", $scope.newMessage); }; $http.get("/messages.json") .then(function(response){ $scope.messages = response.data; }) }]); // END SendMessageController // $timeout([fn], [2000], [invokeApply], [Pass]); })(); // END IIFE
;(function(){ var app = angular.module('Communicant', []); app.controller('ListOfMessagesController', ['$scope', '$http', function($scope, $http){ $http.get("/messages.json") .then(function(response){ $scope.messages = response.data; }) }]); // END ListOfMessagesController app.controller('SendMessageController', ['$scope', '$http', function($scope, $http){ // console.log("Hello?"); $scope.newMessage = { }; $scope.submit = function(){ $http.post("/messages.json", $scope.newMessage); }; + $http.get("/messages.json") .then(function(response){ $scope.messages = response.data; }) }]); // END SendMessageController - + // $timeout([fn], [2000], [invokeApply], [Pass]); })(); // END IIFE
3
0.115385
2
1
b19ffb9dc73a359ad938bcca4adde1f8207295cc
src/HostsFile/Parser.php
src/HostsFile/Parser.php
<?php declare(strict_types=1); namespace DaveRandom\LibDNS\HostsFile; final class Parser { public function parseString(string $data): HostsFile { $ctx = new ParsingContext(); $ctx->addData($data); return $ctx->getResult(); } /** * @param resource $stream */ public function parseStream($stream, int $chunkSize = 1024): HostsFile { if (!\is_resource($stream) || \get_resource_type($stream) !== 'stream') { throw new \InvalidArgumentException("Supplied argument is not a valid stream resource"); } $ctx = new ParsingContext(); while (false !== $chunk = \fread($stream, $chunkSize)) { $ctx->addData($chunk); } return $ctx->getResult(); } public function parseFile(string $filePath): HostsFile { if (!$fp = \fopen($filePath, 'r')) { throw new \InvalidArgumentException("Failed to open {$filePath} for reading"); } return $this->parseStream($fp); } public function beginParseString(string $initialData = ''): ParsingContext { $ctx = new ParsingContext(); $ctx->addData($initialData); return $ctx; } }
<?php declare(strict_types=1); namespace DaveRandom\LibDNS\HostsFile; final class Parser { public function parseString(string $data): HostsFile { $ctx = new ParsingContext(); $ctx->addData($data); return $ctx->getResult(); } /** * @param resource $stream */ public function parseStream($stream, int $chunkSize = 1024): HostsFile { if (!\is_resource($stream) || \get_resource_type($stream) !== 'stream') { throw new \InvalidArgumentException("Supplied argument is not a valid stream resource"); } $ctx = new ParsingContext(); while ('' !== (string)$chunk = \fread($stream, $chunkSize)) { $ctx->addData($chunk); } return $ctx->getResult(); } public function parseFile(string $filePath): HostsFile { if (!$fp = \fopen($filePath, 'r')) { throw new \InvalidArgumentException("Failed to open {$filePath} for reading"); } return $this->parseStream($fp); } public function beginParseString(string $initialData = ''): ParsingContext { $ctx = new ParsingContext(); $ctx->addData($initialData); return $ctx; } }
Fix file read loop logic in hosts file parser
Fix file read loop logic in hosts file parser
PHP
mit
DaveRandom/LibDNS
php
## Code Before: <?php declare(strict_types=1); namespace DaveRandom\LibDNS\HostsFile; final class Parser { public function parseString(string $data): HostsFile { $ctx = new ParsingContext(); $ctx->addData($data); return $ctx->getResult(); } /** * @param resource $stream */ public function parseStream($stream, int $chunkSize = 1024): HostsFile { if (!\is_resource($stream) || \get_resource_type($stream) !== 'stream') { throw new \InvalidArgumentException("Supplied argument is not a valid stream resource"); } $ctx = new ParsingContext(); while (false !== $chunk = \fread($stream, $chunkSize)) { $ctx->addData($chunk); } return $ctx->getResult(); } public function parseFile(string $filePath): HostsFile { if (!$fp = \fopen($filePath, 'r')) { throw new \InvalidArgumentException("Failed to open {$filePath} for reading"); } return $this->parseStream($fp); } public function beginParseString(string $initialData = ''): ParsingContext { $ctx = new ParsingContext(); $ctx->addData($initialData); return $ctx; } } ## Instruction: Fix file read loop logic in hosts file parser ## Code After: <?php declare(strict_types=1); namespace DaveRandom\LibDNS\HostsFile; final class Parser { public function parseString(string $data): HostsFile { $ctx = new ParsingContext(); $ctx->addData($data); return $ctx->getResult(); } /** * @param resource $stream */ public function parseStream($stream, int $chunkSize = 1024): HostsFile { if (!\is_resource($stream) || \get_resource_type($stream) !== 'stream') { throw new \InvalidArgumentException("Supplied argument is not a valid stream resource"); } $ctx = new ParsingContext(); while ('' !== (string)$chunk = \fread($stream, $chunkSize)) { $ctx->addData($chunk); } return $ctx->getResult(); } public function parseFile(string $filePath): HostsFile { if (!$fp = \fopen($filePath, 'r')) { throw new \InvalidArgumentException("Failed to open {$filePath} for reading"); } return $this->parseStream($fp); } public function beginParseString(string $initialData = ''): ParsingContext { $ctx = new ParsingContext(); $ctx->addData($initialData); return $ctx; } }
<?php declare(strict_types=1); namespace DaveRandom\LibDNS\HostsFile; final class Parser { public function parseString(string $data): HostsFile { $ctx = new ParsingContext(); $ctx->addData($data); return $ctx->getResult(); } /** * @param resource $stream */ public function parseStream($stream, int $chunkSize = 1024): HostsFile { if (!\is_resource($stream) || \get_resource_type($stream) !== 'stream') { throw new \InvalidArgumentException("Supplied argument is not a valid stream resource"); } $ctx = new ParsingContext(); - while (false !== $chunk = \fread($stream, $chunkSize)) { ? ^^^^^ + while ('' !== (string)$chunk = \fread($stream, $chunkSize)) { ? ^^ ++++++++ $ctx->addData($chunk); } return $ctx->getResult(); } public function parseFile(string $filePath): HostsFile { if (!$fp = \fopen($filePath, 'r')) { throw new \InvalidArgumentException("Failed to open {$filePath} for reading"); } return $this->parseStream($fp); } public function beginParseString(string $initialData = ''): ParsingContext { $ctx = new ParsingContext(); $ctx->addData($initialData); return $ctx; } }
2
0.040816
1
1
3c2a7157b0c6072d82d238683418c52ee557fa44
skel/app/main.php
skel/app/main.php
<?php $start_ts = microtime(true); include getenv('KISS_CORE'); App::start(); $Response = Response::create(200); $View = App::process(Request::create(), $Response) ->prepend('_head') ->append('_foot') ; $Response ->header('X-Frame-Options', 'DENY') ->header('X-XSS-Protection', '1; mode=block') ->header('Content-Security-Policy', "frame-ancestors 'none'") ->header('X-Response-Time', bcmul(microtime(true) - $start_ts, 1000, 0)) ->send((string) $View->render()) ; App::stop();
<?php $start_ts = microtime(true); include getenv('KISS_CORE'); App::start(); $Response = Response::create(200); $View = App::process(Request::create(), $Response) ->prepend('_head') ->append('_foot') ; $Response ->header('X-Frame-Options', 'DENY') ->header('X-XSS-Protection', '1; mode=block') ->header('X-Content-Type-Options', 'nosniff') ->header('Content-Security-Policy', "frame-ancestors 'none'") ->header('X-Response-Time', bcmul(microtime(true) - $start_ts, 1000, 0)) ->send((string) $View->render()) ; App::stop();
Add header to prevent sniff
Add header to prevent sniff
PHP
mit
dmitrykuzmenkov/kisscore,dmitrykuzmenkov/kisscore,dmitrykuzmenkov/kisscore,dmitrykuzmenkov/kisscore
php
## Code Before: <?php $start_ts = microtime(true); include getenv('KISS_CORE'); App::start(); $Response = Response::create(200); $View = App::process(Request::create(), $Response) ->prepend('_head') ->append('_foot') ; $Response ->header('X-Frame-Options', 'DENY') ->header('X-XSS-Protection', '1; mode=block') ->header('Content-Security-Policy', "frame-ancestors 'none'") ->header('X-Response-Time', bcmul(microtime(true) - $start_ts, 1000, 0)) ->send((string) $View->render()) ; App::stop(); ## Instruction: Add header to prevent sniff ## Code After: <?php $start_ts = microtime(true); include getenv('KISS_CORE'); App::start(); $Response = Response::create(200); $View = App::process(Request::create(), $Response) ->prepend('_head') ->append('_foot') ; $Response ->header('X-Frame-Options', 'DENY') ->header('X-XSS-Protection', '1; mode=block') ->header('X-Content-Type-Options', 'nosniff') ->header('Content-Security-Policy', "frame-ancestors 'none'") ->header('X-Response-Time', bcmul(microtime(true) - $start_ts, 1000, 0)) ->send((string) $View->render()) ; App::stop();
<?php $start_ts = microtime(true); include getenv('KISS_CORE'); App::start(); $Response = Response::create(200); $View = App::process(Request::create(), $Response) ->prepend('_head') ->append('_foot') ; $Response ->header('X-Frame-Options', 'DENY') ->header('X-XSS-Protection', '1; mode=block') + ->header('X-Content-Type-Options', 'nosniff') ->header('Content-Security-Policy', "frame-ancestors 'none'") ->header('X-Response-Time', bcmul(microtime(true) - $start_ts, 1000, 0)) ->send((string) $View->render()) ; App::stop();
1
0.058824
1
0
735615e162a4ac287b9dd5b2d26b96791dacd1be
gradle/wrapper/gradle-wrapper.properties
gradle/wrapper/gradle-wrapper.properties
distributionBase=/opt/TeamCity distributionPath=wrapper/dists zipStoreBase=/opt/TeamCity zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip
distributionBase=PROJECT distributionPath=/opt/TeamCity/wrapper/dists zipStoreBase=PROJECT zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip
Move wrapper dist to project dir
Move wrapper dist to project dir
INI
apache-2.0
adrianbk/bare-bones
ini
## Code Before: distributionBase=/opt/TeamCity distributionPath=wrapper/dists zipStoreBase=/opt/TeamCity zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip ## Instruction: Move wrapper dist to project dir ## Code After: distributionBase=PROJECT distributionPath=/opt/TeamCity/wrapper/dists zipStoreBase=PROJECT zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip
- distributionBase=/opt/TeamCity + distributionBase=PROJECT - distributionPath=wrapper/dists + distributionPath=/opt/TeamCity/wrapper/dists ? ++++++++++++++ - zipStoreBase=/opt/TeamCity + zipStoreBase=PROJECT zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip
6
1.2
3
3
4f0bd1524977abc95319ffb8e0dd85a3a6277fa5
app/views/assets/show.html.haml
app/views/assets/show.html.haml
:css .panel-body-fixed { height: 300px; overflow: scroll; } .component_subform { width: 94%; } .subheader-label %h2 #{@asset.asset_type.name.singularize} Profile = render 'subheader' .row .col-sm-12 .panel.panel-default .panel-heading .row .col-sm-10 %h3.panel-title Highlights .col-sm-2 = render 'actions' .panel-body.panel-body-fixed = render 'details' .row .col-sm-12.col-md-2 .panel.panel-default .panel-heading %h3.panel-title Asset Summary .panel-body = render :partial => 'summary', :locals => {:asset => @asset} .col-sm-12.col-md-10#profile .panel.panel-default .panel-heading %h3.panel-title Profile .panel-body = render 'profile' .modal.fade#form-modal{:tabindex => -1, :role => 'dialog', :aria => {:hidden => true}} =render 'show_scripts'
:css .panel-body-fixed { height: 300px; overflow: scroll; } .component_subform { width: 94%; } .subheader-label { border-bottom: 1px solid #e5e5e5; } .subheader-label %h2 #{@asset.fta_asset_category.name.singularize} Profile = render 'subheader' .row .col-sm-12 .panel.panel-default .panel-heading .row .col-sm-10 %h3.panel-title Highlights .col-sm-2 = render 'actions' .panel-body.panel-body-fixed = render 'details' .row .col-sm-12.col-md-2 .panel.panel-default .panel-heading %h3.panel-title Asset Summary .panel-body = render :partial => 'summary', :locals => {:asset => @asset} .col-sm-12.col-md-10#profile .panel.panel-default .panel-heading %h3.panel-title Profile .panel-body = render 'profile' .modal.fade#form-modal{:tabindex => -1, :role => 'dialog', :aria => {:hidden => true}} =render 'show_scripts'
Change primary headers in asset tables and profile pages.
[TTPLAT-591] Change primary headers in asset tables and profile pages.
Haml
mit
camsys/transam_core,camsys/transam_core,camsys/transam_core,camsys/transam_core
haml
## Code Before: :css .panel-body-fixed { height: 300px; overflow: scroll; } .component_subform { width: 94%; } .subheader-label %h2 #{@asset.asset_type.name.singularize} Profile = render 'subheader' .row .col-sm-12 .panel.panel-default .panel-heading .row .col-sm-10 %h3.panel-title Highlights .col-sm-2 = render 'actions' .panel-body.panel-body-fixed = render 'details' .row .col-sm-12.col-md-2 .panel.panel-default .panel-heading %h3.panel-title Asset Summary .panel-body = render :partial => 'summary', :locals => {:asset => @asset} .col-sm-12.col-md-10#profile .panel.panel-default .panel-heading %h3.panel-title Profile .panel-body = render 'profile' .modal.fade#form-modal{:tabindex => -1, :role => 'dialog', :aria => {:hidden => true}} =render 'show_scripts' ## Instruction: [TTPLAT-591] Change primary headers in asset tables and profile pages. ## Code After: :css .panel-body-fixed { height: 300px; overflow: scroll; } .component_subform { width: 94%; } .subheader-label { border-bottom: 1px solid #e5e5e5; } .subheader-label %h2 #{@asset.fta_asset_category.name.singularize} Profile = render 'subheader' .row .col-sm-12 .panel.panel-default .panel-heading .row .col-sm-10 %h3.panel-title Highlights .col-sm-2 = render 'actions' .panel-body.panel-body-fixed = render 'details' .row .col-sm-12.col-md-2 .panel.panel-default .panel-heading %h3.panel-title Asset Summary .panel-body = render :partial => 'summary', :locals => {:asset => @asset} .col-sm-12.col-md-10#profile .panel.panel-default .panel-heading %h3.panel-title Profile .panel-body = render 'profile' .modal.fade#form-modal{:tabindex => -1, :role => 'dialog', :aria => {:hidden => true}} =render 'show_scripts'
:css .panel-body-fixed { height: 300px; overflow: scroll; } .component_subform { width: 94%; } + .subheader-label { + border-bottom: 1px solid #e5e5e5; + } + .subheader-label - %h2 #{@asset.asset_type.name.singularize} Profile ? -- + %h2 #{@asset.fta_asset_category.name.singularize} Profile ? ++++ ++ ++++ = render 'subheader' .row .col-sm-12 .panel.panel-default .panel-heading .row .col-sm-10 %h3.panel-title Highlights .col-sm-2 = render 'actions' .panel-body.panel-body-fixed = render 'details' .row .col-sm-12.col-md-2 .panel.panel-default .panel-heading %h3.panel-title Asset Summary .panel-body = render :partial => 'summary', :locals => {:asset => @asset} .col-sm-12.col-md-10#profile .panel.panel-default .panel-heading %h3.panel-title Profile .panel-body = render 'profile' .modal.fade#form-modal{:tabindex => -1, :role => 'dialog', :aria => {:hidden => true}} =render 'show_scripts'
6
0.133333
5
1
dee3c4a94bdb725229b1fac14bc5dca6896402d3
README.md
README.md
Turbocharged.Beanstalk ====================== A .NET library for using [Beanstalk][beanstalk]. There are other libraries, but they seem to have been abandoned: * [libBeanstalk.NET][libbeanstalk] * [Beanstalk-Sharp][beanstalk-sharp] Goals ----- * Simple API * Lots of `async` happiness License ------- The MIT License. See `LICENSE.md`. [beanstalk]: http://kr.github.io/beanstalkd/ [libbeanstalk]: https://github.com/sdether/libBeanstalk.NET [beanstalk-sharp]: https://github.com/jtdowney/beanstalk-sharp
Turbocharged.Beanstalk ====================== A .NET library for using [Beanstalk][beanstalk]. There are other libraries, but they seem to have been abandoned: * [libBeanstalk.NET][libbeanstalk] * [Beanstalk-Sharp][beanstalk-sharp] Goals ----- * Simple API * Lots of `async` happiness Usage ----- var connection = new BeanstalkConnection("localhost", 11300); var producer = connection.GetProducer(); await producer.PutAsync(new [] {}, priority: 5, delay: 0, timeToRun: 60); var consumer = connection.GetConsumer(); var job = await consumer.ReserveAsync(); // ...work work work... await consumer.DeleteAsync(job.Id); License ------- The MIT License. See `LICENSE.md`. [beanstalk]: http://kr.github.io/beanstalkd/ [libbeanstalk]: https://github.com/sdether/libBeanstalk.NET [beanstalk-sharp]: https://github.com/jtdowney/beanstalk-sharp
Add usage example to readme
Add usage example to readme
Markdown
mit
jennings/Turbocharged.Beanstalk
markdown
## Code Before: Turbocharged.Beanstalk ====================== A .NET library for using [Beanstalk][beanstalk]. There are other libraries, but they seem to have been abandoned: * [libBeanstalk.NET][libbeanstalk] * [Beanstalk-Sharp][beanstalk-sharp] Goals ----- * Simple API * Lots of `async` happiness License ------- The MIT License. See `LICENSE.md`. [beanstalk]: http://kr.github.io/beanstalkd/ [libbeanstalk]: https://github.com/sdether/libBeanstalk.NET [beanstalk-sharp]: https://github.com/jtdowney/beanstalk-sharp ## Instruction: Add usage example to readme ## Code After: Turbocharged.Beanstalk ====================== A .NET library for using [Beanstalk][beanstalk]. There are other libraries, but they seem to have been abandoned: * [libBeanstalk.NET][libbeanstalk] * [Beanstalk-Sharp][beanstalk-sharp] Goals ----- * Simple API * Lots of `async` happiness Usage ----- var connection = new BeanstalkConnection("localhost", 11300); var producer = connection.GetProducer(); await producer.PutAsync(new [] {}, priority: 5, delay: 0, timeToRun: 60); var consumer = connection.GetConsumer(); var job = await consumer.ReserveAsync(); // ...work work work... await consumer.DeleteAsync(job.Id); License ------- The MIT License. See `LICENSE.md`. [beanstalk]: http://kr.github.io/beanstalkd/ [libbeanstalk]: https://github.com/sdether/libBeanstalk.NET [beanstalk-sharp]: https://github.com/jtdowney/beanstalk-sharp
Turbocharged.Beanstalk ====================== A .NET library for using [Beanstalk][beanstalk]. There are other libraries, but they seem to have been abandoned: * [libBeanstalk.NET][libbeanstalk] * [Beanstalk-Sharp][beanstalk-sharp] Goals ----- * Simple API * Lots of `async` happiness + Usage + ----- + + var connection = new BeanstalkConnection("localhost", 11300); + + var producer = connection.GetProducer(); + await producer.PutAsync(new [] {}, priority: 5, delay: 0, timeToRun: 60); + + var consumer = connection.GetConsumer(); + var job = await consumer.ReserveAsync(); + + // ...work work work... + + await consumer.DeleteAsync(job.Id); + + License ------- The MIT License. See `LICENSE.md`. [beanstalk]: http://kr.github.io/beanstalkd/ [libbeanstalk]: https://github.com/sdether/libBeanstalk.NET [beanstalk-sharp]: https://github.com/jtdowney/beanstalk-sharp
16
0.592593
16
0
0ef745fb407376a381b9e09e73e188a2034d3ad9
src/dsmcc-compress.h
src/dsmcc-compress.h
bool dsmcc_inflate_file(const char *filename); #else static inline bool dsmcc_inflate_file(const char *filename) { DSMCC_ERROR("Compression support is disabled in this build"); return false; } #endif #endif /* DSMCC_COMPRESS_H */
bool dsmcc_inflate_file(const char *filename); #else static inline bool dsmcc_inflate_file(const char *filename) { (void) filename; DSMCC_ERROR("Compression support is disabled in this build"); return false; } #endif #endif /* DSMCC_COMPRESS_H */
Fix compilation error when disabling zlib support
Fix compilation error when disabling zlib support
C
lgpl-2.1
frogbywyplay/media_libdsmcc,frogbywyplay/media_libdsmcc
c
## Code Before: bool dsmcc_inflate_file(const char *filename); #else static inline bool dsmcc_inflate_file(const char *filename) { DSMCC_ERROR("Compression support is disabled in this build"); return false; } #endif #endif /* DSMCC_COMPRESS_H */ ## Instruction: Fix compilation error when disabling zlib support ## Code After: bool dsmcc_inflate_file(const char *filename); #else static inline bool dsmcc_inflate_file(const char *filename) { (void) filename; DSMCC_ERROR("Compression support is disabled in this build"); return false; } #endif #endif /* DSMCC_COMPRESS_H */
bool dsmcc_inflate_file(const char *filename); #else static inline bool dsmcc_inflate_file(const char *filename) { + (void) filename; DSMCC_ERROR("Compression support is disabled in this build"); return false; } #endif #endif /* DSMCC_COMPRESS_H */
1
0.1
1
0
657f72c2aae5bd83efff3520fa642d66ad172822
tests/test_commands.py
tests/test_commands.py
import django from django.core.management import call_command from django.test import TestCase from bananas.management.commands import show_urls class CommandTests(TestCase): def test_show_urls(self): urls = show_urls.collect_urls() if django.VERSION < (1, 9): n_urls = 23 + 8 elif django.VERSION < (2, 0): n_urls = 25 + 8 else: n_urls = 27 + 8 self.assertEqual(len(urls), n_urls) class FakeSys: class stdout: lines = [] @classmethod def write(cls, line): cls.lines.append(line) show_urls.sys = FakeSys show_urls.show_urls() self.assertEqual(len(FakeSys.stdout.lines), n_urls) call_command('show_urls')
import django from django.core.management import call_command from django.test import TestCase from bananas.management.commands import show_urls class CommandTests(TestCase): def test_show_urls(self): urls = show_urls.collect_urls() admin_api_url_count = 0 if django.VERSION >= (1, 10): admin_api_url_count = 8 if django.VERSION < (1, 9): n_urls = 23 + admin_api_url_count elif django.VERSION < (2, 0): n_urls = 25 + admin_api_url_count else: n_urls = 27 + admin_api_url_count self.assertEqual(len(urls), n_urls) class FakeSys: class stdout: lines = [] @classmethod def write(cls, line): cls.lines.append(line) show_urls.sys = FakeSys show_urls.show_urls() self.assertEqual(len(FakeSys.stdout.lines), n_urls) call_command('show_urls')
Fix test_show_urls without admin api urls
Fix test_show_urls without admin api urls
Python
mit
5monkeys/django-bananas,5monkeys/django-bananas,5monkeys/django-bananas
python
## Code Before: import django from django.core.management import call_command from django.test import TestCase from bananas.management.commands import show_urls class CommandTests(TestCase): def test_show_urls(self): urls = show_urls.collect_urls() if django.VERSION < (1, 9): n_urls = 23 + 8 elif django.VERSION < (2, 0): n_urls = 25 + 8 else: n_urls = 27 + 8 self.assertEqual(len(urls), n_urls) class FakeSys: class stdout: lines = [] @classmethod def write(cls, line): cls.lines.append(line) show_urls.sys = FakeSys show_urls.show_urls() self.assertEqual(len(FakeSys.stdout.lines), n_urls) call_command('show_urls') ## Instruction: Fix test_show_urls without admin api urls ## Code After: import django from django.core.management import call_command from django.test import TestCase from bananas.management.commands import show_urls class CommandTests(TestCase): def test_show_urls(self): urls = show_urls.collect_urls() admin_api_url_count = 0 if django.VERSION >= (1, 10): admin_api_url_count = 8 if django.VERSION < (1, 9): n_urls = 23 + admin_api_url_count elif django.VERSION < (2, 0): n_urls = 25 + admin_api_url_count else: n_urls = 27 + admin_api_url_count self.assertEqual(len(urls), n_urls) class FakeSys: class stdout: lines = [] @classmethod def write(cls, line): cls.lines.append(line) show_urls.sys = FakeSys show_urls.show_urls() self.assertEqual(len(FakeSys.stdout.lines), n_urls) call_command('show_urls')
import django from django.core.management import call_command from django.test import TestCase from bananas.management.commands import show_urls class CommandTests(TestCase): def test_show_urls(self): urls = show_urls.collect_urls() + admin_api_url_count = 0 + if django.VERSION >= (1, 10): + admin_api_url_count = 8 + if django.VERSION < (1, 9): - n_urls = 23 + 8 + n_urls = 23 + admin_api_url_count elif django.VERSION < (2, 0): - n_urls = 25 + 8 + n_urls = 25 + admin_api_url_count else: - n_urls = 27 + 8 + n_urls = 27 + admin_api_url_count self.assertEqual(len(urls), n_urls) class FakeSys: class stdout: lines = [] @classmethod def write(cls, line): cls.lines.append(line) show_urls.sys = FakeSys show_urls.show_urls() self.assertEqual(len(FakeSys.stdout.lines), n_urls) call_command('show_urls')
10
0.294118
7
3
a37cf665a1cfb97b2c3a9798a4b6ae2915dbc016
src/main/java/at/porscheinformatik/seleniumcomponents/LocaleUtils.java
src/main/java/at/porscheinformatik/seleniumcomponents/LocaleUtils.java
/** * */ package at.porscheinformatik.seleniumcomponents; import java.util.Locale; /** * @author Daniel Furtlehner */ public final class LocaleUtils { private LocaleUtils() { super(); } /** * Parses the locale from the specified string. Expects the locale in the form of: language [SEPARATOR country * [SEPARATOR variant]]. The SEPARATOR may be '-' or '_'. If the string is empty or null it returns null. * * @param value the string * @return the locale */ public static Locale toLocale(String value) { if (value == null || value.isBlank()) { return Locale.ROOT; } String[] values = value.split("[_-]"); if (values.length >= 3) { return new Locale(values[0], values[1], values[2]); } if (values.length == 2) { return new Locale(values[0], values[1]); } return new Locale(values[0]); } }
/** * */ package at.porscheinformatik.seleniumcomponents; import java.util.Locale; /** * @author Daniel Furtlehner */ public final class LocaleUtils { private LocaleUtils() { super(); } /** * Parses the locale from the specified string. Expects the locale in the form of: language [SEPARATOR country * [SEPARATOR variant]]. The SEPARATOR may be '-' or '_'. If the string is empty or null it returns null. * * @param value the string * @return the locale */ public static Locale toLocale(String value) { if (value == null || value.trim().length() == 0) { return Locale.ROOT; } String[] values = value.split("[_-]"); if (values.length >= 3) { return new Locale(values[0], values[1], values[2]); } if (values.length == 2) { return new Locale(values[0], values[1]); } return new Locale(values[0]); } }
Fix usage of java 11 API
Fix usage of java 11 API
Java
mit
porscheinformatik/selenium-components
java
## Code Before: /** * */ package at.porscheinformatik.seleniumcomponents; import java.util.Locale; /** * @author Daniel Furtlehner */ public final class LocaleUtils { private LocaleUtils() { super(); } /** * Parses the locale from the specified string. Expects the locale in the form of: language [SEPARATOR country * [SEPARATOR variant]]. The SEPARATOR may be '-' or '_'. If the string is empty or null it returns null. * * @param value the string * @return the locale */ public static Locale toLocale(String value) { if (value == null || value.isBlank()) { return Locale.ROOT; } String[] values = value.split("[_-]"); if (values.length >= 3) { return new Locale(values[0], values[1], values[2]); } if (values.length == 2) { return new Locale(values[0], values[1]); } return new Locale(values[0]); } } ## Instruction: Fix usage of java 11 API ## Code After: /** * */ package at.porscheinformatik.seleniumcomponents; import java.util.Locale; /** * @author Daniel Furtlehner */ public final class LocaleUtils { private LocaleUtils() { super(); } /** * Parses the locale from the specified string. Expects the locale in the form of: language [SEPARATOR country * [SEPARATOR variant]]. The SEPARATOR may be '-' or '_'. If the string is empty or null it returns null. * * @param value the string * @return the locale */ public static Locale toLocale(String value) { if (value == null || value.trim().length() == 0) { return Locale.ROOT; } String[] values = value.split("[_-]"); if (values.length >= 3) { return new Locale(values[0], values[1], values[2]); } if (values.length == 2) { return new Locale(values[0], values[1]); } return new Locale(values[0]); } }
/** * */ package at.porscheinformatik.seleniumcomponents; import java.util.Locale; /** * @author Daniel Furtlehner */ public final class LocaleUtils { private LocaleUtils() { super(); } /** * Parses the locale from the specified string. Expects the locale in the form of: language [SEPARATOR country * [SEPARATOR variant]]. The SEPARATOR may be '-' or '_'. If the string is empty or null it returns null. * * @param value the string * @return the locale */ public static Locale toLocale(String value) { - if (value == null || value.isBlank()) ? ^^^^^^ + if (value == null || value.trim().length() == 0) ? ++ ^ ++++++++ ++++++ { return Locale.ROOT; } String[] values = value.split("[_-]"); if (values.length >= 3) { return new Locale(values[0], values[1], values[2]); } if (values.length == 2) { return new Locale(values[0], values[1]); } return new Locale(values[0]); } }
2
0.042553
1
1
c36667692cb04a2430463661e537636eb1b68b94
CHANGELOG.markdown
CHANGELOG.markdown
- :boom: active_support dependency - Updated testing matrix for more rubies 💎💎💎 - Support named args [#6](https://github.com/JustinAiken/active_scheduler/pull/6) (Thanks @jdguzman) # 0.2.0 - Deprecate `arguments` in favor of `args` [#5](https://github.com/JustinAiken/active_scheduler/pull/5) (Thanks @ximus) # 0.1.0 - Only wrap jobs that are descendants of `ActiveJob::Base` [#3](https://github.com/JustinAiken/active_scheduler/pull/3) (Thanks @ximus) # 0.0.3 - Use schedule name as class name if unspecified [#1](https://github.com/JustinAiken/active_scheduler/pull/1) (Thanks @jeremycrosbie)
- Remove explicit active_support dependency (it's pulled in by activejob) - Updated testing matrix for more rubies 💎💎💎 - Support named args [#6](https://github.com/JustinAiken/active_scheduler/pull/6) (Thanks @jdguzman) # 0.2.0 - Deprecate `arguments` in favor of `args` [#5](https://github.com/JustinAiken/active_scheduler/pull/5) (Thanks @ximus) # 0.1.0 - Only wrap jobs that are descendants of `ActiveJob::Base` [#3](https://github.com/JustinAiken/active_scheduler/pull/3) (Thanks @ximus) # 0.0.3 - Use schedule name as class name if unspecified [#1](https://github.com/JustinAiken/active_scheduler/pull/1) (Thanks @jeremycrosbie)
Add clarifying note about as
Add clarifying note about as
Markdown
mit
JustinAiken/active_scheduler
markdown
## Code Before: - :boom: active_support dependency - Updated testing matrix for more rubies 💎💎💎 - Support named args [#6](https://github.com/JustinAiken/active_scheduler/pull/6) (Thanks @jdguzman) # 0.2.0 - Deprecate `arguments` in favor of `args` [#5](https://github.com/JustinAiken/active_scheduler/pull/5) (Thanks @ximus) # 0.1.0 - Only wrap jobs that are descendants of `ActiveJob::Base` [#3](https://github.com/JustinAiken/active_scheduler/pull/3) (Thanks @ximus) # 0.0.3 - Use schedule name as class name if unspecified [#1](https://github.com/JustinAiken/active_scheduler/pull/1) (Thanks @jeremycrosbie) ## Instruction: Add clarifying note about as ## Code After: - Remove explicit active_support dependency (it's pulled in by activejob) - Updated testing matrix for more rubies 💎💎💎 - Support named args [#6](https://github.com/JustinAiken/active_scheduler/pull/6) (Thanks @jdguzman) # 0.2.0 - Deprecate `arguments` in favor of `args` [#5](https://github.com/JustinAiken/active_scheduler/pull/5) (Thanks @ximus) # 0.1.0 - Only wrap jobs that are descendants of `ActiveJob::Base` [#3](https://github.com/JustinAiken/active_scheduler/pull/3) (Thanks @ximus) # 0.0.3 - Use schedule name as class name if unspecified [#1](https://github.com/JustinAiken/active_scheduler/pull/1) (Thanks @jeremycrosbie)
- - :boom: active_support dependency + - Remove explicit active_support dependency (it's pulled in by activejob) - Updated testing matrix for more rubies 💎💎💎 - Support named args [#6](https://github.com/JustinAiken/active_scheduler/pull/6) (Thanks @jdguzman) # 0.2.0 - Deprecate `arguments` in favor of `args` [#5](https://github.com/JustinAiken/active_scheduler/pull/5) (Thanks @ximus) # 0.1.0 - Only wrap jobs that are descendants of `ActiveJob::Base` [#3](https://github.com/JustinAiken/active_scheduler/pull/3) (Thanks @ximus) # 0.0.3 - Use schedule name as class name if unspecified [#1](https://github.com/JustinAiken/active_scheduler/pull/1) (Thanks @jeremycrosbie)
2
0.125
1
1
51783bf228c4c3750ccb4e4ed826f89712487364
deployment/puppet/l23network/lib/puppet/parser/functions/get_nic_passthrough_whitelist.rb
deployment/puppet/l23network/lib/puppet/parser/functions/get_nic_passthrough_whitelist.rb
require 'puppetx/l23_network_scheme' Puppet::Parser::Functions::newfunction(:get_nic_passthrough_whitelist, :type => :rvalue, :arity => 1, :doc => <<-EOS This function gets pci_passthrough_whitelist mapping from transformations Returns NIL if no transformations with this provider found or list ex: pci_passthrough_whitelist('sriov') EOS ) do |argv| provider = argv[0].to_s.upcase cfg = L23network::Scheme.get_config(lookupvar('l3_fqdn_hostname')) transformations = cfg[:transformations] rv = [] transformations.each do |transform| if transform[:provider].to_s.upcase == provider and\ transform[:action] == "add-port" and\ transform[:vendor_specific][:physnet] rv.push({"devname" => transform[:name], "physical_network" => transform[:vendor_specific][:physnet]}) end end rv unless rv.empty? end # vim: set ts=2 sw=2 et :
begin require 'puppetx/l23_network_scheme' rescue LoadError => e rb_file = File.join(File.dirname(__FILE__),'..','..','..','puppetx','l23_network_scheme.rb') load rb_file if File.exists?(rb_file) or raise e end # Puppet::Parser::Functions::newfunction(:get_nic_passthrough_whitelist, :type => :rvalue, :arity => 1, :doc => <<-EOS This function gets pci_passthrough_whitelist mapping from transformations Returns NIL if no transformations with this provider found or list ex: pci_passthrough_whitelist('sriov') EOS ) do |argv| provider = argv[0].to_s.upcase cfg = L23network::Scheme.get_config(lookupvar('l3_fqdn_hostname')) transformations = cfg[:transformations] rv = [] transformations.each do |transform| if transform[:provider].to_s.upcase == provider and\ transform[:action] == "add-port" and\ transform[:vendor_specific][:physnet] rv.push({"devname" => transform[:name], "physical_network" => transform[:vendor_specific][:physnet]}) end end rv unless rv.empty? end # vim: set ts=2 sw=2 et :
Add workaround for import puppetx::* from parser functions
Add workaround for import puppetx::* from parser functions in the Puppet-master mode. Change-Id: Id5dac8fbf71c96a6705a735e711eb5032319896f Closes-Bug: #1544040
Ruby
apache-2.0
stackforge/fuel-library,stackforge/fuel-library,stackforge/fuel-library,stackforge/fuel-library
ruby
## Code Before: require 'puppetx/l23_network_scheme' Puppet::Parser::Functions::newfunction(:get_nic_passthrough_whitelist, :type => :rvalue, :arity => 1, :doc => <<-EOS This function gets pci_passthrough_whitelist mapping from transformations Returns NIL if no transformations with this provider found or list ex: pci_passthrough_whitelist('sriov') EOS ) do |argv| provider = argv[0].to_s.upcase cfg = L23network::Scheme.get_config(lookupvar('l3_fqdn_hostname')) transformations = cfg[:transformations] rv = [] transformations.each do |transform| if transform[:provider].to_s.upcase == provider and\ transform[:action] == "add-port" and\ transform[:vendor_specific][:physnet] rv.push({"devname" => transform[:name], "physical_network" => transform[:vendor_specific][:physnet]}) end end rv unless rv.empty? end # vim: set ts=2 sw=2 et : ## Instruction: Add workaround for import puppetx::* from parser functions in the Puppet-master mode. Change-Id: Id5dac8fbf71c96a6705a735e711eb5032319896f Closes-Bug: #1544040 ## Code After: begin require 'puppetx/l23_network_scheme' rescue LoadError => e rb_file = File.join(File.dirname(__FILE__),'..','..','..','puppetx','l23_network_scheme.rb') load rb_file if File.exists?(rb_file) or raise e end # Puppet::Parser::Functions::newfunction(:get_nic_passthrough_whitelist, :type => :rvalue, :arity => 1, :doc => <<-EOS This function gets pci_passthrough_whitelist mapping from transformations Returns NIL if no transformations with this provider found or list ex: pci_passthrough_whitelist('sriov') EOS ) do |argv| provider = argv[0].to_s.upcase cfg = L23network::Scheme.get_config(lookupvar('l3_fqdn_hostname')) transformations = cfg[:transformations] rv = [] transformations.each do |transform| if transform[:provider].to_s.upcase == provider and\ transform[:action] == "add-port" and\ transform[:vendor_specific][:physnet] rv.push({"devname" => transform[:name], "physical_network" => transform[:vendor_specific][:physnet]}) end end rv unless rv.empty? end # vim: set ts=2 sw=2 et :
+ begin - require 'puppetx/l23_network_scheme' + require 'puppetx/l23_network_scheme' ? ++ - + rescue LoadError => e + rb_file = File.join(File.dirname(__FILE__),'..','..','..','puppetx','l23_network_scheme.rb') + load rb_file if File.exists?(rb_file) or raise e + end + # Puppet::Parser::Functions::newfunction(:get_nic_passthrough_whitelist, :type => :rvalue, :arity => 1, :doc => <<-EOS This function gets pci_passthrough_whitelist mapping from transformations Returns NIL if no transformations with this provider found or list ex: pci_passthrough_whitelist('sriov') EOS ) do |argv| provider = argv[0].to_s.upcase cfg = L23network::Scheme.get_config(lookupvar('l3_fqdn_hostname')) transformations = cfg[:transformations] rv = [] transformations.each do |transform| if transform[:provider].to_s.upcase == provider and\ transform[:action] == "add-port" and\ transform[:vendor_specific][:physnet] rv.push({"devname" => transform[:name], "physical_network" => transform[:vendor_specific][:physnet]}) end end rv unless rv.empty? end # vim: set ts=2 sw=2 et :
9
0.346154
7
2
a7ebeffbc334bbb0fa27312045f5a7f4dbd65d7e
release_checklist.txt
release_checklist.txt
Use this checklist to track the things to check before a release. 1. Push a branch with all the code ready for release. Check that the the automated teats and build did run OK on all the OS/Python combos supported by the various CI (Appveyor, Travis and Github Actions). 2. Run these extra tests on Linux. You will need valgring and gcovr installed first. action python3 --------------------------------------- make test [ ] ./runtest.sh unit [ ] ./runtest.sh unpickle [ ] ./runtest.sh valgrind [ ] ./runtest.sh mallocfaults [ ] ./runtest.sh reallocfaults [ ] ./runtest.sh pycallfaults [ ] ./runtest.sh coverage [ ] Once you ran the coverage, copy and commit the coverage/report to etc/coverage 3. marge and tag the release once everything is a-OK 4. Finally: - collect the built wheels and sdist from the CI run for the tag run (artifact.zip) - extract the zip - run a clamscan and a twine check on these - publish on PyPI with twine upload.
Use this checklist to track the things to check before a release. 1. Push a branch with all the code ready for release. Check that the the automated teats and build did run OK on all the OS/Python combos supported by the various CI (Appveyor, Travis and Github Actions). 2. Run these extra tests on Linux. You will need valgring and gcovr installed first. action python3 --------------------------------------- make test [ ] pip install pytest [ ] pytest -vvs [ ] ./runtest.sh unit [ ] ./runtest.sh unpickle [ ] ./runtest.sh valgrind [ ] ./runtest.sh mallocfaults [ ] ./runtest.sh reallocfaults [ ] ./runtest.sh pycallfaults [ ] ./runtest.sh coverage [ ] Once you ran the coverage, copy and commit the coverage/report to etc/coverage 3. marge and tag the release once everything is a-OK 4. Finally: - collect the built wheels and sdist from the CI run for the tag run (artifact.zip) - extract the zip - run a clamscan and a twine check on these - publish on PyPI with twine upload.
Update release checklist with new tests
Update release checklist with new tests Signed-off-by: Philippe Ombredanne <ca95c4a6a4931f366cbdaf5878c5016609417d37@nexb.com>
Text
bsd-3-clause
WojciechMula/pyahocorasick,WojciechMula/pyahocorasick,WojciechMula/pyahocorasick,WojciechMula/pyahocorasick
text
## Code Before: Use this checklist to track the things to check before a release. 1. Push a branch with all the code ready for release. Check that the the automated teats and build did run OK on all the OS/Python combos supported by the various CI (Appveyor, Travis and Github Actions). 2. Run these extra tests on Linux. You will need valgring and gcovr installed first. action python3 --------------------------------------- make test [ ] ./runtest.sh unit [ ] ./runtest.sh unpickle [ ] ./runtest.sh valgrind [ ] ./runtest.sh mallocfaults [ ] ./runtest.sh reallocfaults [ ] ./runtest.sh pycallfaults [ ] ./runtest.sh coverage [ ] Once you ran the coverage, copy and commit the coverage/report to etc/coverage 3. marge and tag the release once everything is a-OK 4. Finally: - collect the built wheels and sdist from the CI run for the tag run (artifact.zip) - extract the zip - run a clamscan and a twine check on these - publish on PyPI with twine upload. ## Instruction: Update release checklist with new tests Signed-off-by: Philippe Ombredanne <ca95c4a6a4931f366cbdaf5878c5016609417d37@nexb.com> ## Code After: Use this checklist to track the things to check before a release. 1. Push a branch with all the code ready for release. Check that the the automated teats and build did run OK on all the OS/Python combos supported by the various CI (Appveyor, Travis and Github Actions). 2. Run these extra tests on Linux. You will need valgring and gcovr installed first. action python3 --------------------------------------- make test [ ] pip install pytest [ ] pytest -vvs [ ] ./runtest.sh unit [ ] ./runtest.sh unpickle [ ] ./runtest.sh valgrind [ ] ./runtest.sh mallocfaults [ ] ./runtest.sh reallocfaults [ ] ./runtest.sh pycallfaults [ ] ./runtest.sh coverage [ ] Once you ran the coverage, copy and commit the coverage/report to etc/coverage 3. marge and tag the release once everything is a-OK 4. Finally: - collect the built wheels and sdist from the CI run for the tag run (artifact.zip) - extract the zip - run a clamscan and a twine check on these - publish on PyPI with twine upload.
Use this checklist to track the things to check before a release. 1. Push a branch with all the code ready for release. Check that the the automated teats and build did run OK on all the OS/Python combos supported by the various CI (Appveyor, Travis and Github Actions). 2. Run these extra tests on Linux. You will need valgring and gcovr installed first. action python3 --------------------------------------- make test [ ] + pip install pytest [ ] + pytest -vvs [ ] ./runtest.sh unit [ ] ./runtest.sh unpickle [ ] ./runtest.sh valgrind [ ] ./runtest.sh mallocfaults [ ] ./runtest.sh reallocfaults [ ] ./runtest.sh pycallfaults [ ] ./runtest.sh coverage [ ] Once you ran the coverage, copy and commit the coverage/report to etc/coverage 3. marge and tag the release once everything is a-OK 4. Finally: - collect the built wheels and sdist from the CI run for the tag run (artifact.zip) - extract the zip - run a clamscan and a twine check on these - publish on PyPI with twine upload.
2
0.060606
2
0
1031fef261f12b60bd91f59970e44f96d9ea3467
src/datemo/arb.clj
src/datemo/arb.clj
(ns datemo.arb (:require [clojure.pprint :refer [pprint]]) (:use hickory.core)) (defn html->hiccup [html] (as-hiccup (parse html))) (defn hiccup->arb [hiccup] (if (string? (first hiccup)) (first hiccup) (let [[tag attrs & rest] (first hiccup) rest-count (count rest)] (if (or (= 0 rest-count) (and (= 1 rest-count) (string? (first rest)))) [:arb {:original-tag tag} (first rest)] (loop [arb [:arb {:original-tag tag}] forms rest] (if (= 1 (count forms)) (conj arb (hiccup->arb forms)) (recur (conj arb (hiccup->arb (list (first forms)))) (next forms)))))))) (defn html->arb [html] (hiccup->arb (html->hiccup html)))
(ns datemo.arb (:require [clojure.pprint :refer [pprint]]) (:use hickory.core)) (defn html->hiccup ([html] (as-hiccup (parse html))) ([html as-fragment] (if (false? as-fragment) (html->hiccup html) (map as-hiccup (parse-fragment html))))) (defn hiccup->arb [hiccup] (if (string? (first hiccup)) (first hiccup) (let [[tag attrs & rest] (first hiccup) rest-count (count rest)] (if (or (= 0 rest-count) (and (= 1 rest-count) (string? (first rest)))) [:arb {:original-tag tag} (first rest)] (loop [arb [:arb {:original-tag tag}] forms rest] (if (= 1 (count forms)) (conj arb (hiccup->arb forms)) (recur (conj arb (hiccup->arb (list (first forms)))) (next forms)))))))) (defn html->arb ([html] (html->arb html false)) ([html as-fragment] (if (false? as-fragment) (hiccup->arb (html->hiccup html))) (hiccup->arb (html->hiccup html as-fragment)))) (defn arb->tx [arb] arb)
Add multiple varities to handle html fragments
Add multiple varities to handle html fragments
Clojure
epl-1.0
ezmiller/datemo
clojure
## Code Before: (ns datemo.arb (:require [clojure.pprint :refer [pprint]]) (:use hickory.core)) (defn html->hiccup [html] (as-hiccup (parse html))) (defn hiccup->arb [hiccup] (if (string? (first hiccup)) (first hiccup) (let [[tag attrs & rest] (first hiccup) rest-count (count rest)] (if (or (= 0 rest-count) (and (= 1 rest-count) (string? (first rest)))) [:arb {:original-tag tag} (first rest)] (loop [arb [:arb {:original-tag tag}] forms rest] (if (= 1 (count forms)) (conj arb (hiccup->arb forms)) (recur (conj arb (hiccup->arb (list (first forms)))) (next forms)))))))) (defn html->arb [html] (hiccup->arb (html->hiccup html))) ## Instruction: Add multiple varities to handle html fragments ## Code After: (ns datemo.arb (:require [clojure.pprint :refer [pprint]]) (:use hickory.core)) (defn html->hiccup ([html] (as-hiccup (parse html))) ([html as-fragment] (if (false? as-fragment) (html->hiccup html) (map as-hiccup (parse-fragment html))))) (defn hiccup->arb [hiccup] (if (string? (first hiccup)) (first hiccup) (let [[tag attrs & rest] (first hiccup) rest-count (count rest)] (if (or (= 0 rest-count) (and (= 1 rest-count) (string? (first rest)))) [:arb {:original-tag tag} (first rest)] (loop [arb [:arb {:original-tag tag}] forms rest] (if (= 1 (count forms)) (conj arb (hiccup->arb forms)) (recur (conj arb (hiccup->arb (list (first forms)))) (next forms)))))))) (defn html->arb ([html] (html->arb html false)) ([html as-fragment] (if (false? as-fragment) (hiccup->arb (html->hiccup html))) (hiccup->arb (html->hiccup html as-fragment)))) (defn arb->tx [arb] arb)
(ns datemo.arb (:require [clojure.pprint :refer [pprint]]) (:use hickory.core)) - (defn html->hiccup [html] ? ------- + (defn html->hiccup - (as-hiccup (parse html))) + ([html] (as-hiccup (parse html))) ? ++++++++ + ([html as-fragment] + (if (false? as-fragment) + (html->hiccup html) + (map as-hiccup (parse-fragment html))))) (defn hiccup->arb [hiccup] (if (string? (first hiccup)) (first hiccup) (let [[tag attrs & rest] (first hiccup) rest-count (count rest)] (if (or (= 0 rest-count) (and (= 1 rest-count) (string? (first rest)))) [:arb {:original-tag tag} (first rest)] (loop [arb [:arb {:original-tag tag}] forms rest] (if (= 1 (count forms)) (conj arb (hiccup->arb forms)) (recur (conj arb (hiccup->arb (list (first forms)))) (next forms)))))))) - (defn html->arb [html] ? ------- + (defn html->arb + ([html] (html->arb html false)) + ([html as-fragment] + (if (false? as-fragment) - (hiccup->arb (html->hiccup html))) + (hiccup->arb (html->hiccup html))) ? ++ + (hiccup->arb (html->hiccup html as-fragment)))) + + (defn arb->tx [arb] + arb)
19
0.826087
15
4
daf0c3c194d0439caf96f260e23319b2ad8c7e0d
README.md
README.md
> 此repo为自己投食。 * Add AutoGetSS 自动获取SS配置文件(原网站已经挂了,不再维护) * dropsWooyun 爬取乌云知识库(原网站已经挂了,不再维护) * nexus 新知识sample2 [sample_typing.py](blob/master/nexus/sample_typing.py): Python3.6.4 中typing模块示例
> 此repo为自己投食。 * Add AutoGetSS 自动获取SS配置文件(原网站已经挂了,不再维护) * dropsWooyun 爬取乌云知识库(原网站已经挂了,不再维护) * nexus 新知识sample2 [sample_typing.py](nexus/sample_typing.py): Python3.6.4 中typing模块示例
Add Some Code About Everything dll
Add Some Code About Everything dll
Markdown
apache-2.0
Xarrow/PyCharmWorkSpace
markdown
## Code Before: > 此repo为自己投食。 * Add AutoGetSS 自动获取SS配置文件(原网站已经挂了,不再维护) * dropsWooyun 爬取乌云知识库(原网站已经挂了,不再维护) * nexus 新知识sample2 [sample_typing.py](blob/master/nexus/sample_typing.py): Python3.6.4 中typing模块示例 ## Instruction: Add Some Code About Everything dll ## Code After: > 此repo为自己投食。 * Add AutoGetSS 自动获取SS配置文件(原网站已经挂了,不再维护) * dropsWooyun 爬取乌云知识库(原网站已经挂了,不再维护) * nexus 新知识sample2 [sample_typing.py](nexus/sample_typing.py): Python3.6.4 中typing模块示例
> 此repo为自己投食。 * Add AutoGetSS 自动获取SS配置文件(原网站已经挂了,不再维护) * dropsWooyun 爬取乌云知识库(原网站已经挂了,不再维护) * nexus 新知识sample2 - [sample_typing.py](blob/master/nexus/sample_typing.py): Python3.6.4 中typing模块示例 ? ------------ + [sample_typing.py](nexus/sample_typing.py): Python3.6.4 中typing模块示例
2
0.285714
1
1
41e416669497b6925e7c808f5c2649866b7cd24d
backend/app/views/comable/admin/orders/_google_map.slim
backend/app/views/comable/admin/orders/_google_map.slim
javascript: comable_google_map_element_id = "#{id}"; comable_google_map_address = "#{address.full_address}"; coffee: window.initialize_google_map_api = -> return if google? script = document.createElement('script') script.type = 'text/javascript' script.src = '//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&callback=initialize_google_map' script.async = true document.body.appendChild(script) window.initialize_google_map = -> google_map = new google.maps.Map(document.getElementById(comable_google_map_element_id), { zoom: 15 }) google_geo = new google.maps.Geocoder() google_geo.geocode({ address: comable_google_map_address }, (result, status) => return if status != google.maps.GeocoderStatus.OK location = result[0].geometry.location google_map.setCenter(location) new google.maps.Marker({ map: google_map, position: location }) ) $(document).ready(-> initialize_google_map_api() ) .comable-map .comable-google-map id="#{id}" | Loading map...
javascript: comable_google_map_element_id = "#{id}"; comable_google_map_address = "#{address.full_address}"; coffee: window.can_google_map = -> return false unless comable_google_map_element_id? return false unless comable_google_map_address? return false unless $('#' + comable_google_map_element_id).length true window.initialize_google_map_api = -> script = document.createElement('script') script.type = 'text/javascript' script.src = '//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&callback=initialize_google_map' script.async = true document.body.appendChild(script) window.initialize_google_map = -> return unless can_google_map() google_map = new google.maps.Map(document.getElementById(comable_google_map_element_id), { zoom: 15 }) google_geo = new google.maps.Geocoder() google_geo.geocode({ address: comable_google_map_address }, (result, status) => return if status != google.maps.GeocoderStatus.OK location = result[0].geometry.location google_map.setCenter(location) new google.maps.Marker({ map: google_map, position: location }) ) $(document).ready(-> if google? initialize_google_map() else initialize_google_map_api() ) .comable-map .comable-google-map id="#{id}" | Loading map...
Fix a problem for Google Map
Fix a problem for Google Map The problem is that do not work in the second access.
Slim
mit
appirits/comable,hyoshida/comable,appirits/comable,hyoshida/comable,appirits/comable,hyoshida/comable
slim
## Code Before: javascript: comable_google_map_element_id = "#{id}"; comable_google_map_address = "#{address.full_address}"; coffee: window.initialize_google_map_api = -> return if google? script = document.createElement('script') script.type = 'text/javascript' script.src = '//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&callback=initialize_google_map' script.async = true document.body.appendChild(script) window.initialize_google_map = -> google_map = new google.maps.Map(document.getElementById(comable_google_map_element_id), { zoom: 15 }) google_geo = new google.maps.Geocoder() google_geo.geocode({ address: comable_google_map_address }, (result, status) => return if status != google.maps.GeocoderStatus.OK location = result[0].geometry.location google_map.setCenter(location) new google.maps.Marker({ map: google_map, position: location }) ) $(document).ready(-> initialize_google_map_api() ) .comable-map .comable-google-map id="#{id}" | Loading map... ## Instruction: Fix a problem for Google Map The problem is that do not work in the second access. ## Code After: javascript: comable_google_map_element_id = "#{id}"; comable_google_map_address = "#{address.full_address}"; coffee: window.can_google_map = -> return false unless comable_google_map_element_id? return false unless comable_google_map_address? return false unless $('#' + comable_google_map_element_id).length true window.initialize_google_map_api = -> script = document.createElement('script') script.type = 'text/javascript' script.src = '//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&callback=initialize_google_map' script.async = true document.body.appendChild(script) window.initialize_google_map = -> return unless can_google_map() google_map = new google.maps.Map(document.getElementById(comable_google_map_element_id), { zoom: 15 }) google_geo = new google.maps.Geocoder() google_geo.geocode({ address: comable_google_map_address }, (result, status) => return if status != google.maps.GeocoderStatus.OK location = result[0].geometry.location google_map.setCenter(location) new google.maps.Marker({ map: google_map, position: location }) ) $(document).ready(-> if google? initialize_google_map() else initialize_google_map_api() ) .comable-map .comable-google-map id="#{id}" | Loading map...
javascript: comable_google_map_element_id = "#{id}"; comable_google_map_address = "#{address.full_address}"; coffee: + window.can_google_map = -> + return false unless comable_google_map_element_id? + return false unless comable_google_map_address? + return false unless $('#' + comable_google_map_element_id).length + true + window.initialize_google_map_api = -> - return if google? script = document.createElement('script') script.type = 'text/javascript' script.src = '//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&callback=initialize_google_map' script.async = true document.body.appendChild(script) window.initialize_google_map = -> + return unless can_google_map() google_map = new google.maps.Map(document.getElementById(comable_google_map_element_id), { zoom: 15 }) google_geo = new google.maps.Geocoder() google_geo.geocode({ address: comable_google_map_address }, (result, status) => return if status != google.maps.GeocoderStatus.OK location = result[0].geometry.location google_map.setCenter(location) new google.maps.Marker({ map: google_map, position: location }) ) $(document).ready(-> + if google? + initialize_google_map() + else - initialize_google_map_api() + initialize_google_map_api() ? ++ ) .comable-map .comable-google-map id="#{id}" | Loading map...
13
0.433333
11
2
237b66c8b9cef714b64a75b1f20a79a4357c71b5
apps/continiousauth/serializers.py
apps/continiousauth/serializers.py
from rest_framework import serializers from .models import AuthenticationSession class AuthenticationSessionSerializer(serializers.ModelSerializer): class Meta: model = AuthenticationSession fields = ('application', 'external_session_id', 'session_photo_bytes', 'flag', 'start_time', 'end_time')
from rest_framework import serializers from .models import AuthenticationSession class AuthenticationSessionSerializer(serializers.ModelSerializer): class Meta: model = AuthenticationSession fields = ('application', 'external_session_id', 'session_photo_bytes', 'flag')
Change serializer to omit dates
Change serializer to omit dates
Python
mit
larserikgk/mobiauth-server,larserikgk/mobiauth-server,larserikgk/mobiauth-server
python
## Code Before: from rest_framework import serializers from .models import AuthenticationSession class AuthenticationSessionSerializer(serializers.ModelSerializer): class Meta: model = AuthenticationSession fields = ('application', 'external_session_id', 'session_photo_bytes', 'flag', 'start_time', 'end_time') ## Instruction: Change serializer to omit dates ## Code After: from rest_framework import serializers from .models import AuthenticationSession class AuthenticationSessionSerializer(serializers.ModelSerializer): class Meta: model = AuthenticationSession fields = ('application', 'external_session_id', 'session_photo_bytes', 'flag')
from rest_framework import serializers from .models import AuthenticationSession class AuthenticationSessionSerializer(serializers.ModelSerializer): class Meta: model = AuthenticationSession - fields = ('application', 'external_session_id', 'session_photo_bytes', 'flag', 'start_time', 'end_time') ? -------------------------- + fields = ('application', 'external_session_id', 'session_photo_bytes', 'flag')
2
0.222222
1
1
1461e187c094374b10bf61d2f99dca193291a639
metadata/com.xvzan.simplemoneytracker.yml
metadata/com.xvzan.simplemoneytracker.yml
Categories: - Money License: MIT AuthorName: xvzan AuthorEmail: xvzan0@gmail.com SourceCode: https://github.com/xvzan/SimpleMoneyTracker IssueTracker: https://github.com/xvzan/SimpleMoneyTracker/issues AutoName: Simple Money Tracker RepoType: git Repo: https://github.com/xvzan/SimpleMoneyTracker Builds: - versionName: 0.8.8 versionCode: 20200630 commit: v0.8.8 subdir: app gradle: - yes AutoUpdateMode: Version v%v UpdateCheckMode: Tags CurrentVersion: 0.8.8 CurrentVersionCode: 20200630
Categories: - Money License: MIT AuthorName: xvzan AuthorEmail: xvzan0@gmail.com SourceCode: https://github.com/xvzan/SimpleMoneyTracker IssueTracker: https://github.com/xvzan/SimpleMoneyTracker/issues AutoName: Simple Money Tracker RepoType: git Repo: https://github.com/xvzan/SimpleMoneyTracker Builds: - versionName: 0.8.8 versionCode: 20200630 commit: v0.8.8 subdir: app gradle: - yes - versionName: 0.8.9 versionCode: 20200725 commit: v0.8.9 subdir: app gradle: - yes AutoUpdateMode: Version v%v UpdateCheckMode: Tags CurrentVersion: 0.8.9 CurrentVersionCode: 20200725
Update Simple Money Tracker to 0.8.9 (20200725)
Update Simple Money Tracker to 0.8.9 (20200725)
YAML
agpl-3.0
f-droid/fdroiddata,f-droid/fdroiddata
yaml
## Code Before: Categories: - Money License: MIT AuthorName: xvzan AuthorEmail: xvzan0@gmail.com SourceCode: https://github.com/xvzan/SimpleMoneyTracker IssueTracker: https://github.com/xvzan/SimpleMoneyTracker/issues AutoName: Simple Money Tracker RepoType: git Repo: https://github.com/xvzan/SimpleMoneyTracker Builds: - versionName: 0.8.8 versionCode: 20200630 commit: v0.8.8 subdir: app gradle: - yes AutoUpdateMode: Version v%v UpdateCheckMode: Tags CurrentVersion: 0.8.8 CurrentVersionCode: 20200630 ## Instruction: Update Simple Money Tracker to 0.8.9 (20200725) ## Code After: Categories: - Money License: MIT AuthorName: xvzan AuthorEmail: xvzan0@gmail.com SourceCode: https://github.com/xvzan/SimpleMoneyTracker IssueTracker: https://github.com/xvzan/SimpleMoneyTracker/issues AutoName: Simple Money Tracker RepoType: git Repo: https://github.com/xvzan/SimpleMoneyTracker Builds: - versionName: 0.8.8 versionCode: 20200630 commit: v0.8.8 subdir: app gradle: - yes - versionName: 0.8.9 versionCode: 20200725 commit: v0.8.9 subdir: app gradle: - yes AutoUpdateMode: Version v%v UpdateCheckMode: Tags CurrentVersion: 0.8.9 CurrentVersionCode: 20200725
Categories: - Money License: MIT AuthorName: xvzan AuthorEmail: xvzan0@gmail.com SourceCode: https://github.com/xvzan/SimpleMoneyTracker IssueTracker: https://github.com/xvzan/SimpleMoneyTracker/issues AutoName: Simple Money Tracker RepoType: git Repo: https://github.com/xvzan/SimpleMoneyTracker Builds: - versionName: 0.8.8 versionCode: 20200630 commit: v0.8.8 subdir: app gradle: - yes + - versionName: 0.8.9 + versionCode: 20200725 + commit: v0.8.9 + subdir: app + gradle: + - yes + AutoUpdateMode: Version v%v UpdateCheckMode: Tags - CurrentVersion: 0.8.8 ? ^ + CurrentVersion: 0.8.9 ? ^ - CurrentVersionCode: 20200630 ? ^^^ + CurrentVersionCode: 20200725 ? ^^^
11
0.44
9
2
adcde8e91ebc744364d175840412ee32561c2d7e
.travis.yml
.travis.yml
language: python python: - "2.7" env: - DATABASE_USER="postgres" DATABASE_PASSWORD="" install: - pip install pip setuptools --upgrade - pip install . - pip install -r requirements.txt - pip install coveralls before_script: - psql -c 'create extension hstore;' -U postgres -d template1 - psql -c 'create database pgallery;' -U postgres script: make coverage after_success: - coveralls
language: python python: - "2.7" env: - DATABASE_USER="postgres" DATABASE_PASSWORD="" install: - pip install pip setuptools --upgrade - pip install . - pip install -r requirements.txt - pip install coveralls before_script: - psql -c 'create extension hstore;' -U postgres -d template1 - psql -c 'create database pgallery;' -U postgres script: - export PYTHONPATH=$PYTHONPATH:`pwd` - make coverage after_success: - coveralls
Add current directory to PYTHONPATH.
Add current directory to PYTHONPATH.
YAML
mit
zsiciarz/django-pgallery,zsiciarz/django-pgallery
yaml
## Code Before: language: python python: - "2.7" env: - DATABASE_USER="postgres" DATABASE_PASSWORD="" install: - pip install pip setuptools --upgrade - pip install . - pip install -r requirements.txt - pip install coveralls before_script: - psql -c 'create extension hstore;' -U postgres -d template1 - psql -c 'create database pgallery;' -U postgres script: make coverage after_success: - coveralls ## Instruction: Add current directory to PYTHONPATH. ## Code After: language: python python: - "2.7" env: - DATABASE_USER="postgres" DATABASE_PASSWORD="" install: - pip install pip setuptools --upgrade - pip install . - pip install -r requirements.txt - pip install coveralls before_script: - psql -c 'create extension hstore;' -U postgres -d template1 - psql -c 'create database pgallery;' -U postgres script: - export PYTHONPATH=$PYTHONPATH:`pwd` - make coverage after_success: - coveralls
language: python python: - "2.7" env: - DATABASE_USER="postgres" DATABASE_PASSWORD="" install: - pip install pip setuptools --upgrade - pip install . - pip install -r requirements.txt - pip install coveralls before_script: - psql -c 'create extension hstore;' -U postgres -d template1 - psql -c 'create database pgallery;' -U postgres - script: make coverage + script: + - export PYTHONPATH=$PYTHONPATH:`pwd` + - make coverage after_success: - coveralls
4
0.25
3
1
26ce5a64dc6070d866f09537c573c125ba2330b9
inst/R/create-pft-data.r
inst/R/create-pft-data.r
options(stringsAsFactors = FALSE) library(plyr) library(reshape2) source("inst/R/sclerodata-path.r") pft.csv <- file.path(sclerodata.path, "tPFT.csv") pft.rdata <- file.path("data", "pft.rdata") pft.raw <- read.csv(pft.csv) keep.columns <- c( "PtID", "Date", "Height", "Weight", "age", "FVC.Pre", "perc.FVC.of.predicted", "DLCO", "perc.DLCO.of.predicted" ) pft.raw <- pft.raw[, keep.columns] new.names <- c( "patient.id", "date", "height", "weight", "age", "fvc", "perc.fvc", "dlco", "perc.dlco" ) names(pft.raw) <- new.names pft <- melt(pft.raw, measure.vars = c("fvc", "dlco"), variable.name = "test.type", value.name = "test.result") pft <- transform(pft, perc.of.predicted = ifelse(test.type == "fvc", perc.fvc, perc.dlco)) pft <- subset(pft, select = -c(perc.fvc, perc.dlco)) save(pft, file = pft.rdata)
options(stringsAsFactors = FALSE) library(plyr) library(reshape2) source("inst/R/sclerodata-path.r") pft.csv <- file.path(sclerodata.path, "tPFT.csv") pft.rdata <- file.path("data", "pft.rdata") pft.raw <- read.csv(pft.csv) keep.columns <- c( "PtID", "Date", "Height", "Weight", "age", "FVC.Pre", "perc.FVC.of.predicted", "DLCO", "perc.DLCO.of.predicted" ) pft.raw <- pft.raw[, keep.columns] new.names <- c( "patient.id", "date", "height", "weight", "age", "fvc", "perc.fvc", "dlco", "perc.dlco" ) names(pft.raw) <- new.names pft <- melt(pft.raw, measure.vars = c("fvc", "dlco"), variable.name = "test.type", value.name = "test.result") pft <- transform(pft, perc.of.predicted = ifelse(test.type == "fvc", perc.fvc, perc.dlco)) pft <- subset(pft, select = -c(perc.fvc, perc.dlco)) pft <- arrange(pft, patient.id, date, test.type) save(pft, file = pft.rdata)
Arrange pft data by patient, date, and test type.
Arrange pft data by patient, date, and test type.
R
mit
pschulam-attic/sclero
r
## Code Before: options(stringsAsFactors = FALSE) library(plyr) library(reshape2) source("inst/R/sclerodata-path.r") pft.csv <- file.path(sclerodata.path, "tPFT.csv") pft.rdata <- file.path("data", "pft.rdata") pft.raw <- read.csv(pft.csv) keep.columns <- c( "PtID", "Date", "Height", "Weight", "age", "FVC.Pre", "perc.FVC.of.predicted", "DLCO", "perc.DLCO.of.predicted" ) pft.raw <- pft.raw[, keep.columns] new.names <- c( "patient.id", "date", "height", "weight", "age", "fvc", "perc.fvc", "dlco", "perc.dlco" ) names(pft.raw) <- new.names pft <- melt(pft.raw, measure.vars = c("fvc", "dlco"), variable.name = "test.type", value.name = "test.result") pft <- transform(pft, perc.of.predicted = ifelse(test.type == "fvc", perc.fvc, perc.dlco)) pft <- subset(pft, select = -c(perc.fvc, perc.dlco)) save(pft, file = pft.rdata) ## Instruction: Arrange pft data by patient, date, and test type. ## Code After: options(stringsAsFactors = FALSE) library(plyr) library(reshape2) source("inst/R/sclerodata-path.r") pft.csv <- file.path(sclerodata.path, "tPFT.csv") pft.rdata <- file.path("data", "pft.rdata") pft.raw <- read.csv(pft.csv) keep.columns <- c( "PtID", "Date", "Height", "Weight", "age", "FVC.Pre", "perc.FVC.of.predicted", "DLCO", "perc.DLCO.of.predicted" ) pft.raw <- pft.raw[, keep.columns] new.names <- c( "patient.id", "date", "height", "weight", "age", "fvc", "perc.fvc", "dlco", "perc.dlco" ) names(pft.raw) <- new.names pft <- melt(pft.raw, measure.vars = c("fvc", "dlco"), variable.name = "test.type", value.name = "test.result") pft <- transform(pft, perc.of.predicted = ifelse(test.type == "fvc", perc.fvc, perc.dlco)) pft <- subset(pft, select = -c(perc.fvc, perc.dlco)) pft <- arrange(pft, patient.id, date, test.type) save(pft, file = pft.rdata)
options(stringsAsFactors = FALSE) library(plyr) library(reshape2) source("inst/R/sclerodata-path.r") pft.csv <- file.path(sclerodata.path, "tPFT.csv") pft.rdata <- file.path("data", "pft.rdata") pft.raw <- read.csv(pft.csv) keep.columns <- c( "PtID", "Date", "Height", "Weight", "age", "FVC.Pre", "perc.FVC.of.predicted", "DLCO", "perc.DLCO.of.predicted" ) pft.raw <- pft.raw[, keep.columns] new.names <- c( "patient.id", "date", "height", "weight", "age", "fvc", "perc.fvc", "dlco", "perc.dlco" ) names(pft.raw) <- new.names pft <- melt(pft.raw, measure.vars = c("fvc", "dlco"), variable.name = "test.type", value.name = "test.result") pft <- transform(pft, perc.of.predicted = ifelse(test.type == "fvc", perc.fvc, perc.dlco)) pft <- subset(pft, select = -c(perc.fvc, perc.dlco)) + pft <- arrange(pft, patient.id, date, test.type) + save(pft, file = pft.rdata)
2
0.057143
2
0
1406b2dc258aaefe86bd81664d17689da5562856
README.md
README.md
Make sense of deep neural networks using TensorBoard
Repo: [github.com/PythonWorkshop/tensorboard_demos](https://github.com/PythonWorkshop/tensorboard_demos) Fetch it: ```bash git clone git@github.com:PythonWorkshop/tensorboard_demos ``` Install dependencies (NumPy, matplotlib, scikit-learn, TensorFlow): ```bash pip install -r requirements.txt ``` Run notebook: ```bash jupyter notebook tensorboard_basics.ipynb ``` -- OR -- [_coming soon_] Go to the [repo](https://github.com/PythonWorkshop/tensorboard_demos) and hit the **launch binder** badge to run! _**Note**: This notebook is written in Python 3._
Add getting started instructions to readme
Add getting started instructions to readme
Markdown
apache-2.0
PythonWorkshop/tensorboard_demos
markdown
## Code Before: Make sense of deep neural networks using TensorBoard ## Instruction: Add getting started instructions to readme ## Code After: Repo: [github.com/PythonWorkshop/tensorboard_demos](https://github.com/PythonWorkshop/tensorboard_demos) Fetch it: ```bash git clone git@github.com:PythonWorkshop/tensorboard_demos ``` Install dependencies (NumPy, matplotlib, scikit-learn, TensorFlow): ```bash pip install -r requirements.txt ``` Run notebook: ```bash jupyter notebook tensorboard_basics.ipynb ``` -- OR -- [_coming soon_] Go to the [repo](https://github.com/PythonWorkshop/tensorboard_demos) and hit the **launch binder** badge to run! _**Note**: This notebook is written in Python 3._
- Make sense of deep neural networks using TensorBoard + + Repo: [github.com/PythonWorkshop/tensorboard_demos](https://github.com/PythonWorkshop/tensorboard_demos) + + Fetch it: + + ```bash + git clone git@github.com:PythonWorkshop/tensorboard_demos + ``` + + Install dependencies (NumPy, matplotlib, scikit-learn, TensorFlow): + + ```bash + pip install -r requirements.txt + ``` + + Run notebook: + + ```bash + jupyter notebook tensorboard_basics.ipynb + ``` + + -- OR -- + + [_coming soon_] Go to the [repo](https://github.com/PythonWorkshop/tensorboard_demos) and hit the **launch binder** badge to run! + + _**Note**: This notebook is written in Python 3._
27
27
26
1
475e45a2653d749a72bf8a092363099e08ca54f7
cookielaw/static/cookielaw/css/cookielaw.css
cookielaw/static/cookielaw/css/cookielaw.css
background: #F2F2F2; padding: 15px 0; } #CookielawBanner .container { width: 960px; margin: 0 auto; position: relative; } #CookielawBanner #CookielawCross { background: url('../img/close.png') no-repeat 0 0; cursor: pointer; display: block; position: absolute; top: 0; right: 0; width: 15px; height: 15px; } #CookielawBanner p { color: #767676; } #CookielawBanner h6 { color: #E9028C; font-size: 125%; margin: 0 0 15px; }
background: #fff; padding: 15px 0; } #CookielawBanner .container { position: relative; } #CookielawBanner #CookielawCross { background: url('../img/close.png') no-repeat 0 0; cursor: pointer; display: block; position: absolute; top: 0; right: 0; width: 15px; height: 15px; }
Simplify css, making it highly TB compliant
Simplify css, making it highly TB compliant
CSS
bsd-2-clause
barseghyanartur/django-cookie-law,APSL/django-cookie-law,juan-cb/django-cookie-law,TyMaszWeb/django-cookie-law,TyMaszWeb/django-cookie-law,barseghyanartur/django-cookie-law,Maplecroft/django-cookie-law,APSL/django-cookie-law,Maplecroft/django-cookie-law,douwevandermeij/django-cookie-law,TyMaszWeb/django-cookie-law,douwevandermeij/django-cookie-law,douwevandermeij/django-cookie-law,juan-cb/django-cookie-law,Maplecroft/django-cookie-law,juan-cb/django-cookie-law,barseghyanartur/django-cookie-law,APSL/django-cookie-law
css
## Code Before: background: #F2F2F2; padding: 15px 0; } #CookielawBanner .container { width: 960px; margin: 0 auto; position: relative; } #CookielawBanner #CookielawCross { background: url('../img/close.png') no-repeat 0 0; cursor: pointer; display: block; position: absolute; top: 0; right: 0; width: 15px; height: 15px; } #CookielawBanner p { color: #767676; } #CookielawBanner h6 { color: #E9028C; font-size: 125%; margin: 0 0 15px; } ## Instruction: Simplify css, making it highly TB compliant ## Code After: background: #fff; padding: 15px 0; } #CookielawBanner .container { position: relative; } #CookielawBanner #CookielawCross { background: url('../img/close.png') no-repeat 0 0; cursor: pointer; display: block; position: absolute; top: 0; right: 0; width: 15px; height: 15px; }
- background: #F2F2F2; ? ^^^^^^ + background: #fff; ? ^^^ padding: 15px 0; } #CookielawBanner .container { - width: 960px; - margin: 0 auto; position: relative; } #CookielawBanner #CookielawCross { background: url('../img/close.png') no-repeat 0 0; cursor: pointer; display: block; position: absolute; top: 0; right: 0; width: 15px; height: 15px; } - - #CookielawBanner p { - color: #767676; - } - - #CookielawBanner h6 { - color: #E9028C; - font-size: 125%; - margin: 0 0 15px; - }
14
0.466667
1
13
42586c1648797ed99ec3e860ab3a5ef10bec104e
amalgam/Amalgam/src/main/java/com/amalgam/view/ViewUtils.java
amalgam/Amalgam/src/main/java/com/amalgam/view/ViewUtils.java
package com.amalgam.view; import android.content.res.Resources; import android.util.DisplayMetrics; import android.view.WindowManager; public final class ViewUtils { private ViewUtils() {} /** * Convert the dips to pixels, based on density scale * * @param resources application resources * @param dip to be converted value * @return converted value(px) */ public static int dipToPixel(Resources resources, int dip) { final float scale = resources.getDisplayMetrics().density; // add 0.5f to round the figure up to the nearest whole number return (int) (dip * scale + 0.5f); } /** * Convert the pixels to dips, based on density scale * @param windowManager the window manager of the display to use the scale density of * @param pixel * @return converted value(dip) */ public static float pixelToDip(WindowManager windowManager, int pixel) { float dip = 0; DisplayMetrics metrics = new DisplayMetrics(); windowManager.getDefaultDisplay().getMetrics(metrics); dip = metrics.scaledDensity * pixel; return dip; } }
package com.amalgam.view; import android.content.Context; import android.content.res.Resources; import android.hardware.display.DisplayManager; import android.util.DisplayMetrics; import android.view.WindowManager; import com.amalgam.content.ContextUtils; public final class ViewUtils { private ViewUtils() {} public static int dipToPixel(Context context, int dip) { return dipToPixel(context.getResources(), dip); } /** * Convert the dips to pixels, based on density scale * * @param resources application resources * @param dip to be converted value * @return converted value(px) */ public static int dipToPixel(Resources resources, int dip) { final float scale = resources.getDisplayMetrics().density; // add 0.5f to round the figure up to the nearest whole number return (int) (dip * scale + 0.5f); } public static float pixelToDip(Context context, int pixel) { return pixelToDip(ContextUtils.getWindowManager(context), pixel); } /** * Convert the pixels to dips, based on density scale * @param windowManager the window manager of the display to use the scale density of * @param pixel * @return converted value(dip) */ public static float pixelToDip(WindowManager windowManager, int pixel) { DisplayMetrics metrics = new DisplayMetrics(); windowManager.getDefaultDisplay().getMetrics(metrics); return metrics.scaledDensity * pixel; } public static float sipToPixel(Context context, float sip) { return sipToPixel(context.getResources(), sip); } public static float sipToPixel(Resources resources, float sip) { float density = resources.getDisplayMetrics().scaledDensity; return sip * density; } public static float pixelToSip(Context context, float pixels) { DisplayMetrics metrics = new DisplayMetrics(); float scaledDensity = metrics.scaledDensity; if (pixels == 0 || scaledDensity == 0) { return 1; } return pixels/scaledDensity; } }
Add sip to pixel conversion
Add sip to pixel conversion
Java
apache-2.0
nohana/Amalgam,KeithYokoma/Amalgam
java
## Code Before: package com.amalgam.view; import android.content.res.Resources; import android.util.DisplayMetrics; import android.view.WindowManager; public final class ViewUtils { private ViewUtils() {} /** * Convert the dips to pixels, based on density scale * * @param resources application resources * @param dip to be converted value * @return converted value(px) */ public static int dipToPixel(Resources resources, int dip) { final float scale = resources.getDisplayMetrics().density; // add 0.5f to round the figure up to the nearest whole number return (int) (dip * scale + 0.5f); } /** * Convert the pixels to dips, based on density scale * @param windowManager the window manager of the display to use the scale density of * @param pixel * @return converted value(dip) */ public static float pixelToDip(WindowManager windowManager, int pixel) { float dip = 0; DisplayMetrics metrics = new DisplayMetrics(); windowManager.getDefaultDisplay().getMetrics(metrics); dip = metrics.scaledDensity * pixel; return dip; } } ## Instruction: Add sip to pixel conversion ## Code After: package com.amalgam.view; import android.content.Context; import android.content.res.Resources; import android.hardware.display.DisplayManager; import android.util.DisplayMetrics; import android.view.WindowManager; import com.amalgam.content.ContextUtils; public final class ViewUtils { private ViewUtils() {} public static int dipToPixel(Context context, int dip) { return dipToPixel(context.getResources(), dip); } /** * Convert the dips to pixels, based on density scale * * @param resources application resources * @param dip to be converted value * @return converted value(px) */ public static int dipToPixel(Resources resources, int dip) { final float scale = resources.getDisplayMetrics().density; // add 0.5f to round the figure up to the nearest whole number return (int) (dip * scale + 0.5f); } public static float pixelToDip(Context context, int pixel) { return pixelToDip(ContextUtils.getWindowManager(context), pixel); } /** * Convert the pixels to dips, based on density scale * @param windowManager the window manager of the display to use the scale density of * @param pixel * @return converted value(dip) */ public static float pixelToDip(WindowManager windowManager, int pixel) { DisplayMetrics metrics = new DisplayMetrics(); windowManager.getDefaultDisplay().getMetrics(metrics); return metrics.scaledDensity * pixel; } public static float sipToPixel(Context context, float sip) { return sipToPixel(context.getResources(), sip); } public static float sipToPixel(Resources resources, float sip) { float density = resources.getDisplayMetrics().scaledDensity; return sip * density; } public static float pixelToSip(Context context, float pixels) { DisplayMetrics metrics = new DisplayMetrics(); float scaledDensity = metrics.scaledDensity; if (pixels == 0 || scaledDensity == 0) { return 1; } return pixels/scaledDensity; } }
package com.amalgam.view; + import android.content.Context; import android.content.res.Resources; + import android.hardware.display.DisplayManager; import android.util.DisplayMetrics; import android.view.WindowManager; + import com.amalgam.content.ContextUtils; + public final class ViewUtils { private ViewUtils() {} + + public static int dipToPixel(Context context, int dip) { + return dipToPixel(context.getResources(), dip); + } /** * Convert the dips to pixels, based on density scale * * @param resources application resources * @param dip to be converted value * @return converted value(px) */ public static int dipToPixel(Resources resources, int dip) { final float scale = resources.getDisplayMetrics().density; // add 0.5f to round the figure up to the nearest whole number return (int) (dip * scale + 0.5f); } + public static float pixelToDip(Context context, int pixel) { + return pixelToDip(ContextUtils.getWindowManager(context), pixel); + } + /** * Convert the pixels to dips, based on density scale * @param windowManager the window manager of the display to use the scale density of * @param pixel * @return converted value(dip) */ public static float pixelToDip(WindowManager windowManager, int pixel) { - float dip = 0; DisplayMetrics metrics = new DisplayMetrics(); windowManager.getDefaultDisplay().getMetrics(metrics); - dip = metrics.scaledDensity * pixel; ? ^^^^^ + return metrics.scaledDensity * pixel; ? ^^^^^^ + } + + public static float sipToPixel(Context context, float sip) { + return sipToPixel(context.getResources(), sip); + } + + public static float sipToPixel(Resources resources, float sip) { + float density = resources.getDisplayMetrics().scaledDensity; + return sip * density; + } + + public static float pixelToSip(Context context, float pixels) { + DisplayMetrics metrics = new DisplayMetrics(); + float scaledDensity = metrics.scaledDensity; + if (pixels == 0 || scaledDensity == 0) { - return dip; ? ^^^ + return 1; ? ++++ ^ + } + return pixels/scaledDensity; } }
34
0.944444
31
3
444f4f458aea9d009684a05ecc26f145e8cb4eec
recipes/numpy/meta.yaml
recipes/numpy/meta.yaml
{% set name = "numpy" %} {% set version = "1.13.0" %} package: name: {{ name }} version: {{ version }} source: fn: {{ name }}-{{ version }}.zip url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.zip sha256: dcff367b725586830ff0e20b805c7654c876c2d4585c0834a6049502b9d6cf7e build: number: 0 requirements: build: - cython - python - setuptools - openblas 0.2.19 run: - python - openblas 0.2.19 test: requires: - nose commands: - f2py -h imports: - numpy - numpy.linalg.lapack_lite about: home: http://numpy.scipy.org/ license: BSD 3-Clause license_file: LICENSE.txt summary: array processing for numbers, strings, records, and objects.
{% set name = "numpy" %} {% set version = "1.13.1" %} package: name: {{ name }} version: {{ version }} source: fn: {{ name }}-{{ version }}.zip url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.zip sha256: c9b0283776085cb2804efff73e9955ca279ba4edafd58d3ead70b61d209c4fbb build: number: 0 requirements: build: - cython - python - setuptools - openblas 0.2.19 run: - python - openblas 0.2.19 test: requires: - nose commands: - f2py -h imports: - numpy - numpy.linalg.lapack_lite about: home: http://numpy.scipy.org/ license: BSD 3-Clause license_file: LICENSE.txt summary: array processing for numbers, strings, records, and objects.
Update numpy recipe to version 1.13.1
Update numpy recipe to version 1.13.1
YAML
bsd-3-clause
jjhelmus/berryconda,jjhelmus/berryconda,jjhelmus/berryconda,jjhelmus/berryconda,jjhelmus/berryconda
yaml
## Code Before: {% set name = "numpy" %} {% set version = "1.13.0" %} package: name: {{ name }} version: {{ version }} source: fn: {{ name }}-{{ version }}.zip url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.zip sha256: dcff367b725586830ff0e20b805c7654c876c2d4585c0834a6049502b9d6cf7e build: number: 0 requirements: build: - cython - python - setuptools - openblas 0.2.19 run: - python - openblas 0.2.19 test: requires: - nose commands: - f2py -h imports: - numpy - numpy.linalg.lapack_lite about: home: http://numpy.scipy.org/ license: BSD 3-Clause license_file: LICENSE.txt summary: array processing for numbers, strings, records, and objects. ## Instruction: Update numpy recipe to version 1.13.1 ## Code After: {% set name = "numpy" %} {% set version = "1.13.1" %} package: name: {{ name }} version: {{ version }} source: fn: {{ name }}-{{ version }}.zip url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.zip sha256: c9b0283776085cb2804efff73e9955ca279ba4edafd58d3ead70b61d209c4fbb build: number: 0 requirements: build: - cython - python - setuptools - openblas 0.2.19 run: - python - openblas 0.2.19 test: requires: - nose commands: - f2py -h imports: - numpy - numpy.linalg.lapack_lite about: home: http://numpy.scipy.org/ license: BSD 3-Clause license_file: LICENSE.txt summary: array processing for numbers, strings, records, and objects.
{% set name = "numpy" %} - {% set version = "1.13.0" %} ? ^ + {% set version = "1.13.1" %} ? ^ package: name: {{ name }} version: {{ version }} source: fn: {{ name }}-{{ version }}.zip url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.zip - sha256: dcff367b725586830ff0e20b805c7654c876c2d4585c0834a6049502b9d6cf7e + sha256: c9b0283776085cb2804efff73e9955ca279ba4edafd58d3ead70b61d209c4fbb build: number: 0 requirements: build: - cython - python - setuptools - openblas 0.2.19 run: - python - openblas 0.2.19 test: requires: - nose commands: - f2py -h imports: - numpy - numpy.linalg.lapack_lite about: home: http://numpy.scipy.org/ license: BSD 3-Clause license_file: LICENSE.txt summary: array processing for numbers, strings, records, and objects.
4
0.102564
2
2
b424ad9d0e388477385b9827592e1bb2c08a95bc
tests/ThrottlingMiddlewareTest.php
tests/ThrottlingMiddlewareTest.php
<?php /* * This file is part of Alt Three Throttle. * * (c) Alt Three Services Limited * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace AltThree\Tests\Throttle; use AltThree\Throttle\ThrottlingMiddleware; use GrahamCampbell\TestBench\AbstractPackageTestCase; /** * This is the throttling middleware test class. * * @author Graham Campbell <graham@alt-three.com> */ class ThrottlingMiddlewareTest extends AbstractPackageTestCase { /** * @before */ public function setUpDummyRoute() { $this->app->router->get('/dummy', ['middleware' => ThrottlingMiddleware::class, function () { return 'success'; }]); } public function testIsInjectable() { $this->assertIsInjectable(ThrottlingMiddleware::class); } public function testHandleSuccess() { for ($i = 1; $i <= 60; $i++) { $response = $this->call('GET', '/dummy'); $this->assertSame(200, $response->status()); } } /** * @expectedException \Symfony\Component\HttpKernel\Exception\TooManyRequestsHttpException * @expectedExceptionMessage Rate limit exceeded. */ public function testTooManyRequestsHttpException() { for ($i = 1; $i <= 61; $i++) { $this->call('GET', '/dummy'); } } }
<?php /* * This file is part of Alt Three Throttle. * * (c) Alt Three Services Limited * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace AltThree\Tests\Throttle; use AltThree\Throttle\ThrottlingMiddleware; use GrahamCampbell\TestBench\AbstractPackageTestCase; /** * This is the throttling middleware test class. * * @author Graham Campbell <graham@alt-three.com> */ class ThrottlingMiddlewareTest extends AbstractPackageTestCase { /** * @before */ public function setUpDummyRoute() { $this->app->router->get('/dummy', ['middleware' => ThrottlingMiddleware::class, function () { return 'success'; }]); } public function testIsInjectable() { $this->assertIsInjectable(ThrottlingMiddleware::class); } public function testHandleSuccess() { for ($i = 59; $i >= 1; $i--) { $response = $this->call('GET', '/dummy'); $this->assertSame(200, $response->status()); $this->assertSame(60, $response->headers->get('x-ratelimit-limit')); $this->assertSame($i, $response->headers->get('x-ratelimit-remaining')); } } /** * @expectedException \Symfony\Component\HttpKernel\Exception\TooManyRequestsHttpException * @expectedExceptionMessage Rate limit exceeded. */ public function testTooManyRequestsHttpException() { for ($i = 1; $i <= 61; $i++) { $this->call('GET', '/dummy'); } } }
Add test for specifics headers presence
Add test for specifics headers presence
PHP
mit
AltThree/Throttle
php
## Code Before: <?php /* * This file is part of Alt Three Throttle. * * (c) Alt Three Services Limited * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace AltThree\Tests\Throttle; use AltThree\Throttle\ThrottlingMiddleware; use GrahamCampbell\TestBench\AbstractPackageTestCase; /** * This is the throttling middleware test class. * * @author Graham Campbell <graham@alt-three.com> */ class ThrottlingMiddlewareTest extends AbstractPackageTestCase { /** * @before */ public function setUpDummyRoute() { $this->app->router->get('/dummy', ['middleware' => ThrottlingMiddleware::class, function () { return 'success'; }]); } public function testIsInjectable() { $this->assertIsInjectable(ThrottlingMiddleware::class); } public function testHandleSuccess() { for ($i = 1; $i <= 60; $i++) { $response = $this->call('GET', '/dummy'); $this->assertSame(200, $response->status()); } } /** * @expectedException \Symfony\Component\HttpKernel\Exception\TooManyRequestsHttpException * @expectedExceptionMessage Rate limit exceeded. */ public function testTooManyRequestsHttpException() { for ($i = 1; $i <= 61; $i++) { $this->call('GET', '/dummy'); } } } ## Instruction: Add test for specifics headers presence ## Code After: <?php /* * This file is part of Alt Three Throttle. * * (c) Alt Three Services Limited * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace AltThree\Tests\Throttle; use AltThree\Throttle\ThrottlingMiddleware; use GrahamCampbell\TestBench\AbstractPackageTestCase; /** * This is the throttling middleware test class. * * @author Graham Campbell <graham@alt-three.com> */ class ThrottlingMiddlewareTest extends AbstractPackageTestCase { /** * @before */ public function setUpDummyRoute() { $this->app->router->get('/dummy', ['middleware' => ThrottlingMiddleware::class, function () { return 'success'; }]); } public function testIsInjectable() { $this->assertIsInjectable(ThrottlingMiddleware::class); } public function testHandleSuccess() { for ($i = 59; $i >= 1; $i--) { $response = $this->call('GET', '/dummy'); $this->assertSame(200, $response->status()); $this->assertSame(60, $response->headers->get('x-ratelimit-limit')); $this->assertSame($i, $response->headers->get('x-ratelimit-remaining')); } } /** * @expectedException \Symfony\Component\HttpKernel\Exception\TooManyRequestsHttpException * @expectedExceptionMessage Rate limit exceeded. */ public function testTooManyRequestsHttpException() { for ($i = 1; $i <= 61; $i++) { $this->call('GET', '/dummy'); } } }
<?php /* * This file is part of Alt Three Throttle. * * (c) Alt Three Services Limited * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace AltThree\Tests\Throttle; use AltThree\Throttle\ThrottlingMiddleware; use GrahamCampbell\TestBench\AbstractPackageTestCase; /** * This is the throttling middleware test class. * * @author Graham Campbell <graham@alt-three.com> */ class ThrottlingMiddlewareTest extends AbstractPackageTestCase { /** * @before */ public function setUpDummyRoute() { $this->app->router->get('/dummy', ['middleware' => ThrottlingMiddleware::class, function () { return 'success'; }]); } public function testIsInjectable() { $this->assertIsInjectable(ThrottlingMiddleware::class); } public function testHandleSuccess() { - for ($i = 1; $i <= 60; $i++) { + for ($i = 59; $i >= 1; $i--) { $response = $this->call('GET', '/dummy'); $this->assertSame(200, $response->status()); + $this->assertSame(60, $response->headers->get('x-ratelimit-limit')); + $this->assertSame($i, $response->headers->get('x-ratelimit-remaining')); } } /** * @expectedException \Symfony\Component\HttpKernel\Exception\TooManyRequestsHttpException * @expectedExceptionMessage Rate limit exceeded. */ public function testTooManyRequestsHttpException() { for ($i = 1; $i <= 61; $i++) { $this->call('GET', '/dummy'); } } }
4
0.070175
3
1
c8b28cc0afc45c2e7b7ca83a41bc67804c7e9506
src/samples/showvideo.py
src/samples/showvideo.py
from libavg import avg, app import sys class VideoPlayer(app.MainDiv): def init(self): self.videoNode = avg.VideoNode( href=sys.argv[1], parent=self) self.videoNode.play() app.App().run(VideoPlayer(), app_resolution='1920x1080', app_window_size='720x450')
from libavg import avg, app import sys class VideoPlayer(app.MainDiv): def onArgvParserCreated(self, parser): parser.set_usage("%prog <video>") def onArgvParsed(self, options, args, parser): if len(args) != 1: parser.print_help() sys.exit(1) self.__dir=args[0] def onInit(self): self.videoNode = avg.VideoNode( href=self.__dir, size=(500, 500), parent=self) self.videoNode.play() app.App().run(VideoPlayer(), app_resolution='1920x1080', app_window_size='720x450')
Add checks for script parameters and correct onInit name
Add checks for script parameters and correct onInit name
Python
lgpl-2.1
libavg/libavg,libavg/libavg,libavg/libavg,libavg/libavg
python
## Code Before: from libavg import avg, app import sys class VideoPlayer(app.MainDiv): def init(self): self.videoNode = avg.VideoNode( href=sys.argv[1], parent=self) self.videoNode.play() app.App().run(VideoPlayer(), app_resolution='1920x1080', app_window_size='720x450') ## Instruction: Add checks for script parameters and correct onInit name ## Code After: from libavg import avg, app import sys class VideoPlayer(app.MainDiv): def onArgvParserCreated(self, parser): parser.set_usage("%prog <video>") def onArgvParsed(self, options, args, parser): if len(args) != 1: parser.print_help() sys.exit(1) self.__dir=args[0] def onInit(self): self.videoNode = avg.VideoNode( href=self.__dir, size=(500, 500), parent=self) self.videoNode.play() app.App().run(VideoPlayer(), app_resolution='1920x1080', app_window_size='720x450')
from libavg import avg, app import sys class VideoPlayer(app.MainDiv): + + def onArgvParserCreated(self, parser): + parser.set_usage("%prog <video>") + + def onArgvParsed(self, options, args, parser): + if len(args) != 1: + parser.print_help() + sys.exit(1) + + self.__dir=args[0] + - def init(self): ? ^ + def onInit(self): ? ^^^ self.videoNode = avg.VideoNode( - href=sys.argv[1], ? ^^ ^ ----- + href=self.__dir, ? ^^^ ^^^^ + size=(500, 500), parent=self) self.videoNode.play() app.App().run(VideoPlayer(), app_resolution='1920x1080', app_window_size='720x450')
16
1.333333
14
2
b53e3f9e6681e7f3eaade48f86c34d0e54c222c0
layouts/post/single.html
layouts/post/single.html
{{ partial "header.html" . }} <div class="header"> <h1>{{ .Title }}</h1> <h2>{{ .Description }}</h2> </div> <div class="content"> {{ partial "post_meta.html" . }} {{ .Content }} <div class="pagination pure-g"> <div class="pure-u-1 pure-u-md-1-2"> <nav> {{ if .Prev }} <a href="{{ .Prev.Permalink }}"><i class="fa fa-arrow-circle-left fa-fw fa-lg"></i>&nbsp;{{ .Prev.Title }}</a> {{ end }} </nav> </div> <div class="pure-u-1 pure-u-md-1-2"> <nav> {{ if .Next }} <a href="{{ .Next.Permalink }}">{{ .Next.Title }}&nbsp;<i class="fa fa-arrow-circle-right fa-fw fa-lg"></i></a> {{ end }} </nav> </div> </div> {{ partial "disqus.html" . }} </div> {{ partial "footer.html" . }}
{{ partial "header.html" . }} <div class="header"> <h1>{{ .Title }}</h1> <h2>{{ .Description }}</h2> </div> <div class="content"> {{ partial "post_meta.html" . }} {{ .Content }} <div class="pagination pure-g"> <div class="pure-u-1 pure-u-md-1-2"> <nav> {{ if and .Prev (eq .Prev.Type "post") }} <a href="{{ .Prev.Permalink }}"><i class="fa fa-arrow-circle-left fa-fw fa-lg"></i>&nbsp;{{ .Prev.Title }}</a> {{ end }} </nav> </div> <div class="pure-u-1 pure-u-md-1-2"> <nav> {{ if and .Next (eq .Next.Type "post") }} <a href="{{ .Next.Permalink }}">{{ .Next.Title }}&nbsp;<i class="fa fa-arrow-circle-right fa-fw fa-lg"></i></a> {{ end }} </nav> </div> </div> {{ partial "disqus.html" . }} </div> {{ partial "footer.html" . }}
Check prev/next's post type also
Check prev/next's post type also
HTML
mit
lzkill/blackburn,lzkill/blackburn,sunprinceS/blackburn,cathalgarvey/blackburn-mod,yoshiharuyamashita/blackburn,yoshiharuyamashita/blackburn,sunprinceS/blackburn,cathalgarvey/blackburn-mod,xusiwei/blackburn,xusiwei/blackburn
html
## Code Before: {{ partial "header.html" . }} <div class="header"> <h1>{{ .Title }}</h1> <h2>{{ .Description }}</h2> </div> <div class="content"> {{ partial "post_meta.html" . }} {{ .Content }} <div class="pagination pure-g"> <div class="pure-u-1 pure-u-md-1-2"> <nav> {{ if .Prev }} <a href="{{ .Prev.Permalink }}"><i class="fa fa-arrow-circle-left fa-fw fa-lg"></i>&nbsp;{{ .Prev.Title }}</a> {{ end }} </nav> </div> <div class="pure-u-1 pure-u-md-1-2"> <nav> {{ if .Next }} <a href="{{ .Next.Permalink }}">{{ .Next.Title }}&nbsp;<i class="fa fa-arrow-circle-right fa-fw fa-lg"></i></a> {{ end }} </nav> </div> </div> {{ partial "disqus.html" . }} </div> {{ partial "footer.html" . }} ## Instruction: Check prev/next's post type also ## Code After: {{ partial "header.html" . }} <div class="header"> <h1>{{ .Title }}</h1> <h2>{{ .Description }}</h2> </div> <div class="content"> {{ partial "post_meta.html" . }} {{ .Content }} <div class="pagination pure-g"> <div class="pure-u-1 pure-u-md-1-2"> <nav> {{ if and .Prev (eq .Prev.Type "post") }} <a href="{{ .Prev.Permalink }}"><i class="fa fa-arrow-circle-left fa-fw fa-lg"></i>&nbsp;{{ .Prev.Title }}</a> {{ end }} </nav> </div> <div class="pure-u-1 pure-u-md-1-2"> <nav> {{ if and .Next (eq .Next.Type "post") }} <a href="{{ .Next.Permalink }}">{{ .Next.Title }}&nbsp;<i class="fa fa-arrow-circle-right fa-fw fa-lg"></i></a> {{ end }} </nav> </div> </div> {{ partial "disqus.html" . }} </div> {{ partial "footer.html" . }}
{{ partial "header.html" . }} <div class="header"> <h1>{{ .Title }}</h1> <h2>{{ .Description }}</h2> </div> <div class="content"> {{ partial "post_meta.html" . }} {{ .Content }} <div class="pagination pure-g"> <div class="pure-u-1 pure-u-md-1-2"> <nav> - {{ if .Prev }} + {{ if and .Prev (eq .Prev.Type "post") }} <a href="{{ .Prev.Permalink }}"><i class="fa fa-arrow-circle-left fa-fw fa-lg"></i>&nbsp;{{ .Prev.Title }}</a> {{ end }} </nav> </div> <div class="pure-u-1 pure-u-md-1-2"> <nav> - {{ if .Next }} + {{ if and .Next (eq .Next.Type "post") }} <a href="{{ .Next.Permalink }}">{{ .Next.Title }}&nbsp;<i class="fa fa-arrow-circle-right fa-fw fa-lg"></i></a> {{ end }} </nav> </div> </div> {{ partial "disqus.html" . }} </div> {{ partial "footer.html" . }}
4
0.117647
2
2
1a089ec6f34ebf81b4437b6f541ee2b9f4b85966
osf/migrations/0145_pagecounter_data.py
osf/migrations/0145_pagecounter_data.py
from __future__ import unicode_literals from django.db import migrations, connection def reverse_func(state, schema): with connection.cursor() as cursor: cursor.execute( """ UPDATE osf_pagecounter SET (action, guid_id, file_id, version) = ('download', NULL, NULL, NULL); """ ) def separate_pagecounter_id(state, schema): """ Splits the data in pagecounter _id field of form action:guid_id:file_id:version into four new columns: action(char), guid(fk), file(fk), version(int) """ with connection.cursor() as cursor: cursor.execute( """ UPDATE osf_pagecounter PC SET (action, guid_id, file_id, version) = (split_part(PC._id, ':', 1), G.id, F.id, NULLIF(split_part(PC._id, ':', 4), '')::int) FROM osf_guid G, osf_basefilenode F WHERE PC._id LIKE '%' || G._id || '%' AND PC._id LIKE '%' || F._id || '%'; """ ) class Migration(migrations.Migration): dependencies = [ ('osf', '0144_pagecounter_index'), ] operations = [ migrations.RunPython( separate_pagecounter_id, reverse_func ), ]
from __future__ import unicode_literals from django.db import migrations reverse_func = [ """ UPDATE osf_pagecounter SET (action, guid_id, file_id, version) = ('download', NULL, NULL, NULL); """ ] # Splits the data in pagecounter _id field of form action:guid_id:file_id:version into # four new columns: action(char), guid(fk), file(fk), version(int) separate_pagecounter_id = [ """ UPDATE osf_pagecounter PC SET (action, guid_id, file_id, version) = (split_part(PC._id, ':', 1), G.id, F.id, NULLIF(split_part(PC._id, ':', 4), '')::int) FROM osf_guid G, osf_basefilenode F WHERE PC._id LIKE '%' || G._id || '%' AND PC._id LIKE '%' || F._id || '%'; """ ] class Migration(migrations.Migration): dependencies = [ ('osf', '0144_pagecounter_index'), ] operations = [ migrations.RunSQL( separate_pagecounter_id, reverse_func ), ]
Call RunSQL instead of RunPython in pagecounter data migration.
Call RunSQL instead of RunPython in pagecounter data migration.
Python
apache-2.0
cslzchen/osf.io,cslzchen/osf.io,Johnetordoff/osf.io,saradbowman/osf.io,felliott/osf.io,baylee-d/osf.io,mattclark/osf.io,mfraezz/osf.io,aaxelb/osf.io,felliott/osf.io,mfraezz/osf.io,brianjgeiger/osf.io,cslzchen/osf.io,CenterForOpenScience/osf.io,aaxelb/osf.io,mattclark/osf.io,adlius/osf.io,saradbowman/osf.io,adlius/osf.io,mfraezz/osf.io,aaxelb/osf.io,baylee-d/osf.io,adlius/osf.io,brianjgeiger/osf.io,mfraezz/osf.io,Johnetordoff/osf.io,Johnetordoff/osf.io,CenterForOpenScience/osf.io,aaxelb/osf.io,CenterForOpenScience/osf.io,Johnetordoff/osf.io,CenterForOpenScience/osf.io,cslzchen/osf.io,brianjgeiger/osf.io,brianjgeiger/osf.io,felliott/osf.io,felliott/osf.io,mattclark/osf.io,baylee-d/osf.io,adlius/osf.io
python
## Code Before: from __future__ import unicode_literals from django.db import migrations, connection def reverse_func(state, schema): with connection.cursor() as cursor: cursor.execute( """ UPDATE osf_pagecounter SET (action, guid_id, file_id, version) = ('download', NULL, NULL, NULL); """ ) def separate_pagecounter_id(state, schema): """ Splits the data in pagecounter _id field of form action:guid_id:file_id:version into four new columns: action(char), guid(fk), file(fk), version(int) """ with connection.cursor() as cursor: cursor.execute( """ UPDATE osf_pagecounter PC SET (action, guid_id, file_id, version) = (split_part(PC._id, ':', 1), G.id, F.id, NULLIF(split_part(PC._id, ':', 4), '')::int) FROM osf_guid G, osf_basefilenode F WHERE PC._id LIKE '%' || G._id || '%' AND PC._id LIKE '%' || F._id || '%'; """ ) class Migration(migrations.Migration): dependencies = [ ('osf', '0144_pagecounter_index'), ] operations = [ migrations.RunPython( separate_pagecounter_id, reverse_func ), ] ## Instruction: Call RunSQL instead of RunPython in pagecounter data migration. ## Code After: from __future__ import unicode_literals from django.db import migrations reverse_func = [ """ UPDATE osf_pagecounter SET (action, guid_id, file_id, version) = ('download', NULL, NULL, NULL); """ ] # Splits the data in pagecounter _id field of form action:guid_id:file_id:version into # four new columns: action(char), guid(fk), file(fk), version(int) separate_pagecounter_id = [ """ UPDATE osf_pagecounter PC SET (action, guid_id, file_id, version) = (split_part(PC._id, ':', 1), G.id, F.id, NULLIF(split_part(PC._id, ':', 4), '')::int) FROM osf_guid G, osf_basefilenode F WHERE PC._id LIKE '%' || G._id || '%' AND PC._id LIKE '%' || F._id || '%'; """ ] class Migration(migrations.Migration): dependencies = [ ('osf', '0144_pagecounter_index'), ] operations = [ migrations.RunSQL( separate_pagecounter_id, reverse_func ), ]
from __future__ import unicode_literals - - from django.db import migrations, connection ? ------------ + from django.db import migrations + reverse_func = [ + """ - def reverse_func(state, schema): - with connection.cursor() as cursor: - cursor.execute( - """ - UPDATE osf_pagecounter ? -------- + UPDATE osf_pagecounter - SET (action, guid_id, file_id, version) = ('download', NULL, NULL, NULL); ? -------- + SET (action, guid_id, file_id, version) = ('download', NULL, NULL, NULL); - """ - ) + """ + ] - def separate_pagecounter_id(state, schema): + # Splits the data in pagecounter _id field of form action:guid_id:file_id:version into + # four new columns: action(char), guid(fk), file(fk), version(int) + separate_pagecounter_id = [ """ - Splits the data in pagecounter _id field of form action:guid_id:file_id:version into - four new columns: action(char), guid(fk), file(fk), version(int) + UPDATE osf_pagecounter PC + SET (action, guid_id, file_id, version) = (split_part(PC._id, ':', 1), G.id, F.id, NULLIF(split_part(PC._id, ':', 4), '')::int) + FROM osf_guid G, osf_basefilenode F + WHERE PC._id LIKE '%' || G._id || '%' + AND PC._id LIKE '%' || F._id || '%'; """ + ] + - with connection.cursor() as cursor: - cursor.execute( - """ - UPDATE osf_pagecounter PC - SET (action, guid_id, file_id, version) = (split_part(PC._id, ':', 1), G.id, F.id, NULLIF(split_part(PC._id, ':', 4), '')::int) - FROM osf_guid G, osf_basefilenode F - WHERE PC._id LIKE '%' || G._id || '%' - AND PC._id LIKE '%' || F._id || '%'; - """ - ) class Migration(migrations.Migration): dependencies = [ ('osf', '0144_pagecounter_index'), ] operations = [ - migrations.RunPython( ? ^^^^^^ + migrations.RunSQL( ? ^^^ separate_pagecounter_id, reverse_func ), ]
42
1.02439
18
24
d152f714764f69b9579f928994244442b41c2f0d
test/PrimTypeTests.hs
test/PrimTypeTests.hs
{-# LANGUAGE ScopedTypeVariables, FlexibleContexts #-} module PrimTypeTests (primTypeTests) where import TestHelpers import Control.Parallel.MPI.Storable import C2HS primTypeTests :: Rank -> [(String,TestRunnerTest)] primTypeTests rank = [ mpiTestCase rank "intMaxBound" (sendRecvSingleValTest (maxBound :: Int)) , mpiTestCase rank "intMinBound" (sendRecvSingleValTest (minBound :: Int)) ] sendRecvSingleValTest :: forall a . (RecvInto (Ptr a), Repr a, SendFrom a, Storable a, Eq a, Show a) => a -> Rank -> IO () sendRecvSingleValTest val rank = if rank == 0 then send commWorld 1 unitTag (val :: a) else do (result :: a, _status) <- intoNewVal $ recv commWorld 0 unitTag result == val @? "result: " ++ show result ++ " not equal to sent val: " ++ show (val :: a)
{-# LANGUAGE ScopedTypeVariables, FlexibleContexts #-} module PrimTypeTests (primTypeTests) where import TestHelpers import Control.Parallel.MPI.Storable import C2HS primTypeTests :: Rank -> [(String,TestRunnerTest)] primTypeTests rank = [ mpiTestCase rank "intMaxBound" (sendRecvSingleValTest (maxBound :: Int)) , mpiTestCase rank "intMinBound" (sendRecvSingleValTest (minBound :: Int)) , mpiTestCase rank "checking sizes of Haskell types vs MPI representations" reprSizeTest ] sendRecvSingleValTest :: forall a . (RecvInto (Ptr a), Repr a, SendFrom a, Storable a, Eq a, Show a) => a -> Rank -> IO () sendRecvSingleValTest val rank | rank == 0 = send commWorld 1 unitTag (val :: a) | rank == 1 = do (result :: a, _status) <- intoNewVal $ recv commWorld 0 unitTag result == val @? "result: " ++ show result ++ " not equal to sent val: " ++ show (val :: a) | otherwise = return () reprSizeTest _ = do sizeOf (undefined :: Int) == (typeSize int) @? "Size of Int differs from size of MPI_INT"
Fix minBound/maxBound test to work with arbitrary number of testing processes
Fix minBound/maxBound test to work with arbitrary number of testing processes
Haskell
bsd-3-clause
bjpop/haskell-mpi,bjpop/haskell-mpi,bjpop/haskell-mpi
haskell
## Code Before: {-# LANGUAGE ScopedTypeVariables, FlexibleContexts #-} module PrimTypeTests (primTypeTests) where import TestHelpers import Control.Parallel.MPI.Storable import C2HS primTypeTests :: Rank -> [(String,TestRunnerTest)] primTypeTests rank = [ mpiTestCase rank "intMaxBound" (sendRecvSingleValTest (maxBound :: Int)) , mpiTestCase rank "intMinBound" (sendRecvSingleValTest (minBound :: Int)) ] sendRecvSingleValTest :: forall a . (RecvInto (Ptr a), Repr a, SendFrom a, Storable a, Eq a, Show a) => a -> Rank -> IO () sendRecvSingleValTest val rank = if rank == 0 then send commWorld 1 unitTag (val :: a) else do (result :: a, _status) <- intoNewVal $ recv commWorld 0 unitTag result == val @? "result: " ++ show result ++ " not equal to sent val: " ++ show (val :: a) ## Instruction: Fix minBound/maxBound test to work with arbitrary number of testing processes ## Code After: {-# LANGUAGE ScopedTypeVariables, FlexibleContexts #-} module PrimTypeTests (primTypeTests) where import TestHelpers import Control.Parallel.MPI.Storable import C2HS primTypeTests :: Rank -> [(String,TestRunnerTest)] primTypeTests rank = [ mpiTestCase rank "intMaxBound" (sendRecvSingleValTest (maxBound :: Int)) , mpiTestCase rank "intMinBound" (sendRecvSingleValTest (minBound :: Int)) , mpiTestCase rank "checking sizes of Haskell types vs MPI representations" reprSizeTest ] sendRecvSingleValTest :: forall a . (RecvInto (Ptr a), Repr a, SendFrom a, Storable a, Eq a, Show a) => a -> Rank -> IO () sendRecvSingleValTest val rank | rank == 0 = send commWorld 1 unitTag (val :: a) | rank == 1 = do (result :: a, _status) <- intoNewVal $ recv commWorld 0 unitTag result == val @? "result: " ++ show result ++ " not equal to sent val: " ++ show (val :: a) | otherwise = return () reprSizeTest _ = do sizeOf (undefined :: Int) == (typeSize int) @? "Size of Int differs from size of MPI_INT"
{-# LANGUAGE ScopedTypeVariables, FlexibleContexts #-} module PrimTypeTests (primTypeTests) where import TestHelpers import Control.Parallel.MPI.Storable import C2HS primTypeTests :: Rank -> [(String,TestRunnerTest)] primTypeTests rank = [ mpiTestCase rank "intMaxBound" (sendRecvSingleValTest (maxBound :: Int)) , mpiTestCase rank "intMinBound" (sendRecvSingleValTest (minBound :: Int)) + , mpiTestCase rank "checking sizes of Haskell types vs MPI representations" reprSizeTest ] sendRecvSingleValTest :: forall a . (RecvInto (Ptr a), Repr a, SendFrom a, Storable a, Eq a, Show a) => a -> Rank -> IO () - sendRecvSingleValTest val rank = ? - + sendRecvSingleValTest val rank - if rank == 0 - then send commWorld 1 unitTag (val :: a) ? ^^^^ + | rank == 0 = send commWorld 1 unitTag (val :: a) ? + ++++ ++ + ^ - else do + | rank == 1 = do - (result :: a, _status) <- intoNewVal $ recv commWorld 0 unitTag ? ----- + (result :: a, _status) <- intoNewVal $ recv commWorld 0 unitTag - result == val @? "result: " ++ show result ++ " not equal to sent val: " ++ show (val :: a) ? ----- + result == val @? "result: " ++ show result ++ " not equal to sent val: " ++ show (val :: a) + | otherwise = return () + + reprSizeTest _ = do + sizeOf (undefined :: Int) == (typeSize int) @? "Size of Int differs from size of MPI_INT"
16
0.761905
10
6
114452de0e2e9693a4a21e7dec82601550b90b01
app/helpers/georgia/internationalization_helper.rb
app/helpers/georgia/internationalization_helper.rb
module Georgia module InternationalizationHelper LOCALES_HASH = {en: "English", fr: "Français"} def locale_name(locale) return "" unless locale LOCALES_HASH[locale.to_sym] end def french? current_locale? :fr end def english? current_locale? :en end def current_locale I18n.locale.to_s end def link_to_locale options={}, html_options={} if options[:symbolized] options[:text] = english? ? 'FR' : 'EN' else options[:text] = english? ? LOCALES_HASH[:fr] : LOCALES_HASH[:en] end options[:text] = options[:text].parameterize.humanize if options[:normalized] options[:locale] ||= english? ? :fr : :en html_options[:hreflang] ||= english? ? :fr : :en link_to(options[:text], {locale: options[:locale]}, html_options) end private def current_locale?(locale) I18n.locale == locale.to_sym end end end
module Georgia module InternationalizationHelper LOCALES_HASH = {en: "English", fr: "Français"} def locale_name(locale) return "" unless locale LOCALES_HASH[locale.to_sym] end def french? current_locale? :fr end def english? current_locale? :en end def current_locale I18n.locale.to_s end def link_to_locale options={}, html_options={} if options[:symbolized] options[:text] = english? ? 'FR' : 'EN' else options[:text] = english? ? LOCALES_HASH[:fr] : LOCALES_HASH[:en] end options[:text] = options[:text].parameterize.humanize if options[:normalized] options[:locale] ||= english? ? :fr : :en html_options[:hreflang] ||= english? ? :fr : :en if page = options[:page] url = page.url(locale: options[:locale]) else url = url_for(params.merge(locale: options[:locale])) end link_to(options[:text], url, html_options) end private def current_locale?(locale) I18n.locale == locale.to_sym end end end
Use decorated page to find localized url with link_to_locale
Use decorated page to find localized url with link_to_locale
Ruby
mit
georgia-cms/georgia,georgia-cms/georgia,georgia-cms/georgia
ruby
## Code Before: module Georgia module InternationalizationHelper LOCALES_HASH = {en: "English", fr: "Français"} def locale_name(locale) return "" unless locale LOCALES_HASH[locale.to_sym] end def french? current_locale? :fr end def english? current_locale? :en end def current_locale I18n.locale.to_s end def link_to_locale options={}, html_options={} if options[:symbolized] options[:text] = english? ? 'FR' : 'EN' else options[:text] = english? ? LOCALES_HASH[:fr] : LOCALES_HASH[:en] end options[:text] = options[:text].parameterize.humanize if options[:normalized] options[:locale] ||= english? ? :fr : :en html_options[:hreflang] ||= english? ? :fr : :en link_to(options[:text], {locale: options[:locale]}, html_options) end private def current_locale?(locale) I18n.locale == locale.to_sym end end end ## Instruction: Use decorated page to find localized url with link_to_locale ## Code After: module Georgia module InternationalizationHelper LOCALES_HASH = {en: "English", fr: "Français"} def locale_name(locale) return "" unless locale LOCALES_HASH[locale.to_sym] end def french? current_locale? :fr end def english? current_locale? :en end def current_locale I18n.locale.to_s end def link_to_locale options={}, html_options={} if options[:symbolized] options[:text] = english? ? 'FR' : 'EN' else options[:text] = english? ? LOCALES_HASH[:fr] : LOCALES_HASH[:en] end options[:text] = options[:text].parameterize.humanize if options[:normalized] options[:locale] ||= english? ? :fr : :en html_options[:hreflang] ||= english? ? :fr : :en if page = options[:page] url = page.url(locale: options[:locale]) else url = url_for(params.merge(locale: options[:locale])) end link_to(options[:text], url, html_options) end private def current_locale?(locale) I18n.locale == locale.to_sym end end end
module Georgia module InternationalizationHelper LOCALES_HASH = {en: "English", fr: "Français"} def locale_name(locale) return "" unless locale LOCALES_HASH[locale.to_sym] end def french? current_locale? :fr end def english? current_locale? :en end def current_locale I18n.locale.to_s end def link_to_locale options={}, html_options={} if options[:symbolized] options[:text] = english? ? 'FR' : 'EN' else options[:text] = english? ? LOCALES_HASH[:fr] : LOCALES_HASH[:en] end options[:text] = options[:text].parameterize.humanize if options[:normalized] options[:locale] ||= english? ? :fr : :en html_options[:hreflang] ||= english? ? :fr : :en + if page = options[:page] + url = page.url(locale: options[:locale]) + else + url = url_for(params.merge(locale: options[:locale])) + end + - link_to(options[:text], {locale: options[:locale]}, html_options) ? ^ ------------------------ + link_to(options[:text], url, html_options) ? ^^ end private def current_locale?(locale) I18n.locale == locale.to_sym end end end
8
0.186047
7
1
9ad290c8fa14984388eded8f9f5cbd69b8821ee9
cookbooks/apache/templates/default/ssl.erb
cookbooks/apache/templates/default/ssl.erb
SSLHonorCipherOrder On SSLCipherSuite aRSA+HIGH:+kEDH:+kRSA:!kSRP:!kPSK:+3DES:!MD5 SSLCertificateFile /etc/ssl/certs/<%= @certificate %>.pem SSLCertificateKeyFile /etc/ssl/private/<%= @certificate %>.key SSLCertificateChainFile /etc/ssl/certs/rapidssl.pem
SSLHonorCipherOrder On SSLCipherSuite aRSA+HIGH:+kEDH:+kRSA:!kSRP:!kPSK:+3DES:!MD5 SSLCertificateFile /etc/ssl/certs/<%= @certificate %>.pem SSLCertificateKeyFile /etc/ssl/private/<%= @certificate %>.key SSLCertificateChainFile /etc/ssl/certs/rapidssl.pem <% if node[:lsb][:release].to_f >= 14.04 -%> SSLUseStapling On SSLStaplingCache shmcb:${APACHE_RUN_DIR}/ssl_ocspcache(512000) <% end -%>
Enable OCSP stapling on 14.04 machines
Enable OCSP stapling on 14.04 machines
HTML+ERB
apache-2.0
zerebubuth/openstreetmap-chef,Firefishy/chef,gravitystorm/chef,openstreetmap/chef,Firefishy/chef,zerebubuth/openstreetmap-chef,zerebubuth/openstreetmap-chef,tomhughes/openstreetmap-chef,Firefishy/chef,openstreetmap/chef,tomhughes/openstreetmap-chef,tomhughes/openstreetmap-chef,gravitystorm/chef,tomhughes/openstreetmap-chef,openstreetmap/chef,gravitystorm/chef,openstreetmap/chef,gravitystorm/chef,Firefishy/chef,zerebubuth/openstreetmap-chef,openstreetmap/chef,openstreetmap/chef,openstreetmap/chef,openstreetmap/chef,gravitystorm/chef,gravitystorm/chef,tomhughes/openstreetmap-chef,zerebubuth/openstreetmap-chef,Firefishy/chef,Firefishy/chef,Firefishy/chef,gravitystorm/chef,zerebubuth/openstreetmap-chef,tomhughes/openstreetmap-chef,tomhughes/openstreetmap-chef,zerebubuth/openstreetmap-chef,Firefishy/chef,tomhughes/openstreetmap-chef,gravitystorm/chef,zerebubuth/openstreetmap-chef
html+erb
## Code Before: SSLHonorCipherOrder On SSLCipherSuite aRSA+HIGH:+kEDH:+kRSA:!kSRP:!kPSK:+3DES:!MD5 SSLCertificateFile /etc/ssl/certs/<%= @certificate %>.pem SSLCertificateKeyFile /etc/ssl/private/<%= @certificate %>.key SSLCertificateChainFile /etc/ssl/certs/rapidssl.pem ## Instruction: Enable OCSP stapling on 14.04 machines ## Code After: SSLHonorCipherOrder On SSLCipherSuite aRSA+HIGH:+kEDH:+kRSA:!kSRP:!kPSK:+3DES:!MD5 SSLCertificateFile /etc/ssl/certs/<%= @certificate %>.pem SSLCertificateKeyFile /etc/ssl/private/<%= @certificate %>.key SSLCertificateChainFile /etc/ssl/certs/rapidssl.pem <% if node[:lsb][:release].to_f >= 14.04 -%> SSLUseStapling On SSLStaplingCache shmcb:${APACHE_RUN_DIR}/ssl_ocspcache(512000) <% end -%>
SSLHonorCipherOrder On SSLCipherSuite aRSA+HIGH:+kEDH:+kRSA:!kSRP:!kPSK:+3DES:!MD5 SSLCertificateFile /etc/ssl/certs/<%= @certificate %>.pem SSLCertificateKeyFile /etc/ssl/private/<%= @certificate %>.key SSLCertificateChainFile /etc/ssl/certs/rapidssl.pem + <% if node[:lsb][:release].to_f >= 14.04 -%> + + SSLUseStapling On + SSLStaplingCache shmcb:${APACHE_RUN_DIR}/ssl_ocspcache(512000) + <% end -%>
5
0.714286
5
0
fb56c8a40fc811e544ecc23564dfde58230db152
src/Core/Bundle/SystemBundle/Resources/views/Record/record_role.html.twig
src/Core/Bundle/SystemBundle/Resources/views/Record/record_role.html.twig
{{ kula_field({ field: 'Constituent.Constituent.LastName', db_row_id: kula_core_record.getSelectedRecord.ROLE_ID, value: kula_core_record.getSelectedRecord.LAST_NAME, label: true, attributes_html: { 'size' : 30 } }) }} {{ kula_field({ field: 'Constituent.Constituent.FirstName', db_row_id: kula_core_record.getSelectedRecord.ROLE_ID, value: kula_core_record.getSelectedRecord.FIRST_NAME, label: true, attributes_html: { 'size' : 30 } }) }} {{ kula_field({ field: 'Constituent.Constituent.MiddleName', db_row_id: kula_core_record.getSelectedRecord.ROLE_ID, value: kula_core_record.getSelectedRecord.MIDDLE_NAME, label: true, attributes_html: { 'size' : 30 } }) }} {{ kula_field({ field: 'Core.Usergroup.Name', db_row_id: kula_core_record.getSelectedRecord.ROLE_ID, value: kula_core_record.getSelectedRecord.USERGROUP_NAME, label: true, attributes_html: { 'size' : 30 } }) }} {{ kula_field({ field: 'Core.Usergroup.Portal', db_row_id: kula_core_record.getSelectedRecord.USER_ID, value: kula_core_record.getSelectedRecord.PORTAL, label: true }) }}
{{ kula_field({ field: 'Core.Constituent.LastName', db_row_id: kula_core_record.getSelectedRecord.CONSTITUENT_ID, value: kula_core_record.getSelectedRecord.LAST_NAME, label: true }) }} {{ kula_field({ field: 'Core.Constituent.FirstName', db_row_id: kula_core_record.getSelectedRecord.CONSTITUENT_ID, value: kula_core_record.getSelectedRecord.FIRST_NAME, label: true }) }} {{ kula_field({ field: 'Core.Constituent.MiddleName', db_row_id: kula_core_record.getSelectedRecord.CONSTITUENT_ID, value: kula_core_record.getSelectedRecord.MIDDLE_NAME, label: true }) }} {{ kula_field({ field: 'Core.Usergroup.Name', db_row_id: kula_core_record.getSelectedRecord.ROLE_ID, value: kula_core_record.getSelectedRecord.USERGROUP_NAME, label: true, attributes_html: { 'size' : 30 } }) }} {{ kula_field({ field: 'Core.Usergroup.Portal', db_row_id: kula_core_record.getSelectedRecord.USER_ID, value: kula_core_record.getSelectedRecord.PORTAL, label: true }) }}
Fix role editing for security.
Fix role editing for security.
Twig
mit
kulasis/kulasis,kulasis/kulasis,kulasis/kulasis
twig
## Code Before: {{ kula_field({ field: 'Constituent.Constituent.LastName', db_row_id: kula_core_record.getSelectedRecord.ROLE_ID, value: kula_core_record.getSelectedRecord.LAST_NAME, label: true, attributes_html: { 'size' : 30 } }) }} {{ kula_field({ field: 'Constituent.Constituent.FirstName', db_row_id: kula_core_record.getSelectedRecord.ROLE_ID, value: kula_core_record.getSelectedRecord.FIRST_NAME, label: true, attributes_html: { 'size' : 30 } }) }} {{ kula_field({ field: 'Constituent.Constituent.MiddleName', db_row_id: kula_core_record.getSelectedRecord.ROLE_ID, value: kula_core_record.getSelectedRecord.MIDDLE_NAME, label: true, attributes_html: { 'size' : 30 } }) }} {{ kula_field({ field: 'Core.Usergroup.Name', db_row_id: kula_core_record.getSelectedRecord.ROLE_ID, value: kula_core_record.getSelectedRecord.USERGROUP_NAME, label: true, attributes_html: { 'size' : 30 } }) }} {{ kula_field({ field: 'Core.Usergroup.Portal', db_row_id: kula_core_record.getSelectedRecord.USER_ID, value: kula_core_record.getSelectedRecord.PORTAL, label: true }) }} ## Instruction: Fix role editing for security. ## Code After: {{ kula_field({ field: 'Core.Constituent.LastName', db_row_id: kula_core_record.getSelectedRecord.CONSTITUENT_ID, value: kula_core_record.getSelectedRecord.LAST_NAME, label: true }) }} {{ kula_field({ field: 'Core.Constituent.FirstName', db_row_id: kula_core_record.getSelectedRecord.CONSTITUENT_ID, value: kula_core_record.getSelectedRecord.FIRST_NAME, label: true }) }} {{ kula_field({ field: 'Core.Constituent.MiddleName', db_row_id: kula_core_record.getSelectedRecord.CONSTITUENT_ID, value: kula_core_record.getSelectedRecord.MIDDLE_NAME, label: true }) }} {{ kula_field({ field: 'Core.Usergroup.Name', db_row_id: kula_core_record.getSelectedRecord.ROLE_ID, value: kula_core_record.getSelectedRecord.USERGROUP_NAME, label: true, attributes_html: { 'size' : 30 } }) }} {{ kula_field({ field: 'Core.Usergroup.Portal', db_row_id: kula_core_record.getSelectedRecord.USER_ID, value: kula_core_record.getSelectedRecord.PORTAL, label: true }) }}
- {{ kula_field({ field: 'Constituent.Constituent.LastName', db_row_id: kula_core_record.getSelectedRecord.ROLE_ID, value: kula_core_record.getSelectedRecord.LAST_NAME, label: true, attributes_html: { 'size' : 30 } }) }} ? ^^^^^^ -- ^ ^ ---------------------------------- + {{ kula_field({ field: 'Core.Constituent.LastName', db_row_id: kula_core_record.getSelectedRecord.CONSTITUENT_ID, value: kula_core_record.getSelectedRecord.LAST_NAME, label: true }) }} ? ^ ^ ^^^^^^ ++ - {{ kula_field({ field: 'Constituent.Constituent.FirstName', db_row_id: kula_core_record.getSelectedRecord.ROLE_ID, value: kula_core_record.getSelectedRecord.FIRST_NAME, label: true, attributes_html: { 'size' : 30 } }) }} ? ^^^^^^ -- ^ ^ - -------------------------------- + {{ kula_field({ field: 'Core.Constituent.FirstName', db_row_id: kula_core_record.getSelectedRecord.CONSTITUENT_ID, value: kula_core_record.getSelectedRecord.FIRST_NAME, label: true }) }} ? ^ ^ ^^^^^^ ++ - {{ kula_field({ field: 'Constituent.Constituent.MiddleName', db_row_id: kula_core_record.getSelectedRecord.ROLE_ID, value: kula_core_record.getSelectedRecord.MIDDLE_NAME, label: true, attributes_html: { 'size' : 30 } }) }} ? ^^^^^^ -- ^ ^ - -------------------------------- + {{ kula_field({ field: 'Core.Constituent.MiddleName', db_row_id: kula_core_record.getSelectedRecord.CONSTITUENT_ID, value: kula_core_record.getSelectedRecord.MIDDLE_NAME, label: true }) }} ? ^ ^ ^^^^^^ ++ {{ kula_field({ field: 'Core.Usergroup.Name', db_row_id: kula_core_record.getSelectedRecord.ROLE_ID, value: kula_core_record.getSelectedRecord.USERGROUP_NAME, label: true, attributes_html: { 'size' : 30 } }) }} {{ kula_field({ field: 'Core.Usergroup.Portal', db_row_id: kula_core_record.getSelectedRecord.USER_ID, value: kula_core_record.getSelectedRecord.PORTAL, label: true }) }}
6
1.2
3
3
099aebd5cc4e177cb774fb6a35c16f376bcce28f
hieradata/common/roles/master.yaml
hieradata/common/roles/master.yaml
--- include: default: - profile::messaging::rabbitmq - profile::openstack::compute::api - profile::openstack::compute::scheduler - profile::openstack::compute::conductor - profile::openstack::compute::consoleauth - profile::openstack::compute::consoleproxy - profile::openstack::dashboard - profile::openstack::database::sql - profile::openstack::identity - profile::openstack::image::api - profile::openstack::image::registry - profile::openstack::volume - profile::openstack::volume::api - profile::openstack::volume::scheduler - cinder::db::mysql - profile::openstack::network::controller - profile::openstack::network::dhcp - profile::openstack::network::l3 - profile::openstack::network::metadata openstack_extras::repo::redhat::redhat::manage_rdo: true profile::base::common::manage_lvm: false lvm::logical_volume: lv_var: volume_group: vg_root fs_type: xfs mountpath: /var/lib/ekstradisk sudo::purge: false apache::default_mods: false apache::default_vhost: false apache::default_confd_files: false
--- include: default: - profile::messaging::rabbitmq - profile::openstack::compute::api - profile::openstack::compute::scheduler - profile::openstack::compute::conductor - profile::openstack::compute::consoleauth - profile::openstack::compute::consoleproxy - profile::openstack::dashboard - profile::openstack::database::sql - profile::openstack::identity - profile::openstack::image::api - profile::openstack::image::registry - profile::openstack::volume - profile::openstack::volume::api - profile::openstack::volume::scheduler - profile::openstack::network::controller - profile::openstack::network::dhcp - profile::openstack::network::l3 - profile::openstack::network::metadata openstack_extras::repo::redhat::redhat::manage_rdo: true profile::openstack::database::sql::cinder_enabled: true profile::base::common::manage_lvm: false lvm::logical_volume: lv_var: volume_group: vg_root fs_type: xfs mountpath: /var/lib/ekstradisk sudo::purge: false apache::default_mods: false apache::default_vhost: false apache::default_confd_files: false
Move activation of cinder db to openstack profile
Move activation of cinder db to openstack profile
YAML
apache-2.0
mikaeld66/himlar,tanzr/himlar,erlendbm/himlar,eckhart/himlar,norcams/himlar,mikaeld66/himlar,eckhart/himlar,eckhart/himlar,tanzr/himlar,TorLdre/himlar,norcams/himlar,tanzr/himlar,TorLdre/himlar,erlendbm/himlar,eckhart/himlar,raykrist/himlar,TorLdre/himlar,TorLdre/himlar,raykrist/himlar,raykrist/himlar,tanzr/himlar,norcams/himlar,tanzr/himlar,norcams/himlar,TorLdre/himlar,mikaeld66/himlar,raykrist/himlar,raykrist/himlar,mikaeld66/himlar,norcams/himlar,mikaeld66/himlar
yaml
## Code Before: --- include: default: - profile::messaging::rabbitmq - profile::openstack::compute::api - profile::openstack::compute::scheduler - profile::openstack::compute::conductor - profile::openstack::compute::consoleauth - profile::openstack::compute::consoleproxy - profile::openstack::dashboard - profile::openstack::database::sql - profile::openstack::identity - profile::openstack::image::api - profile::openstack::image::registry - profile::openstack::volume - profile::openstack::volume::api - profile::openstack::volume::scheduler - cinder::db::mysql - profile::openstack::network::controller - profile::openstack::network::dhcp - profile::openstack::network::l3 - profile::openstack::network::metadata openstack_extras::repo::redhat::redhat::manage_rdo: true profile::base::common::manage_lvm: false lvm::logical_volume: lv_var: volume_group: vg_root fs_type: xfs mountpath: /var/lib/ekstradisk sudo::purge: false apache::default_mods: false apache::default_vhost: false apache::default_confd_files: false ## Instruction: Move activation of cinder db to openstack profile ## Code After: --- include: default: - profile::messaging::rabbitmq - profile::openstack::compute::api - profile::openstack::compute::scheduler - profile::openstack::compute::conductor - profile::openstack::compute::consoleauth - profile::openstack::compute::consoleproxy - profile::openstack::dashboard - profile::openstack::database::sql - profile::openstack::identity - profile::openstack::image::api - profile::openstack::image::registry - profile::openstack::volume - profile::openstack::volume::api - profile::openstack::volume::scheduler - profile::openstack::network::controller - profile::openstack::network::dhcp - profile::openstack::network::l3 - profile::openstack::network::metadata openstack_extras::repo::redhat::redhat::manage_rdo: true profile::openstack::database::sql::cinder_enabled: true profile::base::common::manage_lvm: false lvm::logical_volume: lv_var: volume_group: vg_root fs_type: xfs mountpath: /var/lib/ekstradisk sudo::purge: false apache::default_mods: false apache::default_vhost: false apache::default_confd_files: false
--- include: default: - profile::messaging::rabbitmq - profile::openstack::compute::api - profile::openstack::compute::scheduler - profile::openstack::compute::conductor - profile::openstack::compute::consoleauth - profile::openstack::compute::consoleproxy - profile::openstack::dashboard - profile::openstack::database::sql - profile::openstack::identity - profile::openstack::image::api - profile::openstack::image::registry - profile::openstack::volume - profile::openstack::volume::api - profile::openstack::volume::scheduler - - cinder::db::mysql - profile::openstack::network::controller - profile::openstack::network::dhcp - profile::openstack::network::l3 - profile::openstack::network::metadata openstack_extras::repo::redhat::redhat::manage_rdo: true + profile::openstack::database::sql::cinder_enabled: true profile::base::common::manage_lvm: false lvm::logical_volume: lv_var: volume_group: vg_root fs_type: xfs mountpath: /var/lib/ekstradisk sudo::purge: false apache::default_mods: false apache::default_vhost: false apache::default_confd_files: false
2
0.051282
1
1
18925af2a74c20e86867bce9c480b5cd710b6b32
openbudgets/apps/sheets/utilities.py
openbudgets/apps/sheets/utilities.py
from django.conf import settings def is_comparable(): """Sets the value of TemplateNode.comparable to True or False.""" value = settings.OPENBUDGETS_COMPARABLE_TEMPLATENODE_DEFAULT return value
from django.conf import settings def is_node_comparable(instance): """Sets the value of TemplateNode.comparable to True or False. Relies on the non-abstract TemplateNode implementation where nodes can belong to many templates. """ value = settings.OPENBUDGETS_COMPARABLE_TEMPLATENODE if all([t.is_blueprint for t in instance.templates.all()]): value = settings.OPENBUDGETS_COMPARABLE_TEMPLATENODE_IN_BLUEPRINT else: value = settings.OPENBUDGETS_COMPARABLE_TEMPLATENODE_NOT_IN_BLUEPRINT return value
Set comparable state of node.
Set comparable state of node.
Python
bsd-3-clause
openbudgets/openbudgets,openbudgets/openbudgets,pwalsh/openbudgets,pwalsh/openbudgets,openbudgets/openbudgets,pwalsh/openbudgets
python
## Code Before: from django.conf import settings def is_comparable(): """Sets the value of TemplateNode.comparable to True or False.""" value = settings.OPENBUDGETS_COMPARABLE_TEMPLATENODE_DEFAULT return value ## Instruction: Set comparable state of node. ## Code After: from django.conf import settings def is_node_comparable(instance): """Sets the value of TemplateNode.comparable to True or False. Relies on the non-abstract TemplateNode implementation where nodes can belong to many templates. """ value = settings.OPENBUDGETS_COMPARABLE_TEMPLATENODE if all([t.is_blueprint for t in instance.templates.all()]): value = settings.OPENBUDGETS_COMPARABLE_TEMPLATENODE_IN_BLUEPRINT else: value = settings.OPENBUDGETS_COMPARABLE_TEMPLATENODE_NOT_IN_BLUEPRINT return value
from django.conf import settings - def is_comparable(): + def is_node_comparable(instance): ? +++++ ++++++++ - """Sets the value of TemplateNode.comparable to True or False.""" ? --- + """Sets the value of TemplateNode.comparable to True or False. + Relies on the non-abstract TemplateNode implementation where nodes + can belong to many templates. + + """ + - value = settings.OPENBUDGETS_COMPARABLE_TEMPLATENODE_DEFAULT ? -------- + value = settings.OPENBUDGETS_COMPARABLE_TEMPLATENODE + + if all([t.is_blueprint for t in instance.templates.all()]): + value = settings.OPENBUDGETS_COMPARABLE_TEMPLATENODE_IN_BLUEPRINT + else: + value = settings.OPENBUDGETS_COMPARABLE_TEMPLATENODE_NOT_IN_BLUEPRINT + return value
17
1.888889
14
3
d5b8e39f3563082bed4dd2d59234a58705ddb255
flymine/webapp/project.properties
flymine/webapp/project.properties
compile.dependencies = intermine/webapp/main,\ flymine/dbmodel,\ intermine/webtasks/main,\ bio/core/main,\ bio/webapp,\ flymine/sitemap,\ bio/network/webapp # The products and their immediate library dependencies of these projects # will be included in the webapp # This property says which projects have got dist jar files # which are needed in the webapp deploy.dependencies = flymine/dbmodel, bio/network/webapp objectstore.name = os.production userprofile.objectstorewriter.name = osw.userprofile-production userprofile.objectstore.name = os.userprofile-production userprofile.db.name = db.userprofile-production userprofile.model.name = userprofile # the project that will make the webapp we will add to base.webapp.path = bio/webapp/dist/bio-webapp.war # choose the intermine.properties file from $HOME: intermine.properties.file = flymine.properties default.intermine.properties.file = ../default.intermine.webapp.properties # the core projects sometimes need a model to compile, but there is a # different model in each Mine so we need to tell the dependency # system (see Dependencies.java) to add this model project to the # dependency list of all projects that we depend on extra.project.dependencies = flymine/dbmodel
compile.dependencies = intermine/webapp/main,\ flymine/dbmodel,\ intermine/webtasks/main,\ bio/core/main,\ bio/webapp,\ flymine/sitemap,\ bio/network/webapp # The products and their immediate library dependencies of these projects # will be included in the webapp # This property says which projects have got dist jar files # which are needed in the webapp deploy.dependencies = flymine/dbmodel, bio/network/webapp, bio/network/main objectstore.name = os.production userprofile.objectstorewriter.name = osw.userprofile-production userprofile.objectstore.name = os.userprofile-production userprofile.db.name = db.userprofile-production userprofile.model.name = userprofile # the project that will make the webapp we will add to base.webapp.path = bio/webapp/dist/bio-webapp.war # choose the intermine.properties file from $HOME: intermine.properties.file = flymine.properties default.intermine.properties.file = ../default.intermine.webapp.properties # the core projects sometimes need a model to compile, but there is a # different model in each Mine so we need to tell the dependency # system (see Dependencies.java) to add this model project to the # dependency list of all projects that we depend on extra.project.dependencies = flymine/dbmodel
Include classes needed for protein interaction image in webapp jar.
Include classes needed for protein interaction image in webapp jar.
INI
lgpl-2.1
drhee/toxoMine,justincc/intermine,tomck/intermine,joshkh/intermine,JoeCarlson/intermine,kimrutherford/intermine,elsiklab/intermine,drhee/toxoMine,zebrafishmine/intermine,Arabidopsis-Information-Portal/intermine,kimrutherford/intermine,justincc/intermine,joshkh/intermine,tomck/intermine,JoeCarlson/intermine,elsiklab/intermine,JoeCarlson/intermine,tomck/intermine,JoeCarlson/intermine,elsiklab/intermine,drhee/toxoMine,joshkh/intermine,elsiklab/intermine,elsiklab/intermine,kimrutherford/intermine,Arabidopsis-Information-Portal/intermine,JoeCarlson/intermine,JoeCarlson/intermine,JoeCarlson/intermine,Arabidopsis-Information-Portal/intermine,zebrafishmine/intermine,drhee/toxoMine,zebrafishmine/intermine,elsiklab/intermine,JoeCarlson/intermine,zebrafishmine/intermine,zebrafishmine/intermine,joshkh/intermine,justincc/intermine,kimrutherford/intermine,Arabidopsis-Information-Portal/intermine,justincc/intermine,kimrutherford/intermine,kimrutherford/intermine,Arabidopsis-Information-Portal/intermine,justincc/intermine,tomck/intermine,justincc/intermine,tomck/intermine,drhee/toxoMine,zebrafishmine/intermine,zebrafishmine/intermine,Arabidopsis-Information-Portal/intermine,kimrutherford/intermine,tomck/intermine,kimrutherford/intermine,elsiklab/intermine,drhee/toxoMine,joshkh/intermine,justincc/intermine,Arabidopsis-Information-Portal/intermine,tomck/intermine,zebrafishmine/intermine,Arabidopsis-Information-Portal/intermine,drhee/toxoMine,drhee/toxoMine,joshkh/intermine,kimrutherford/intermine,joshkh/intermine,elsiklab/intermine,zebrafishmine/intermine,tomck/intermine,tomck/intermine,Arabidopsis-Information-Portal/intermine,joshkh/intermine,elsiklab/intermine,justincc/intermine,justincc/intermine,joshkh/intermine,JoeCarlson/intermine,drhee/toxoMine
ini
## Code Before: compile.dependencies = intermine/webapp/main,\ flymine/dbmodel,\ intermine/webtasks/main,\ bio/core/main,\ bio/webapp,\ flymine/sitemap,\ bio/network/webapp # The products and their immediate library dependencies of these projects # will be included in the webapp # This property says which projects have got dist jar files # which are needed in the webapp deploy.dependencies = flymine/dbmodel, bio/network/webapp objectstore.name = os.production userprofile.objectstorewriter.name = osw.userprofile-production userprofile.objectstore.name = os.userprofile-production userprofile.db.name = db.userprofile-production userprofile.model.name = userprofile # the project that will make the webapp we will add to base.webapp.path = bio/webapp/dist/bio-webapp.war # choose the intermine.properties file from $HOME: intermine.properties.file = flymine.properties default.intermine.properties.file = ../default.intermine.webapp.properties # the core projects sometimes need a model to compile, but there is a # different model in each Mine so we need to tell the dependency # system (see Dependencies.java) to add this model project to the # dependency list of all projects that we depend on extra.project.dependencies = flymine/dbmodel ## Instruction: Include classes needed for protein interaction image in webapp jar. ## Code After: compile.dependencies = intermine/webapp/main,\ flymine/dbmodel,\ intermine/webtasks/main,\ bio/core/main,\ bio/webapp,\ flymine/sitemap,\ bio/network/webapp # The products and their immediate library dependencies of these projects # will be included in the webapp # This property says which projects have got dist jar files # which are needed in the webapp deploy.dependencies = flymine/dbmodel, bio/network/webapp, bio/network/main objectstore.name = os.production userprofile.objectstorewriter.name = osw.userprofile-production userprofile.objectstore.name = os.userprofile-production userprofile.db.name = db.userprofile-production userprofile.model.name = userprofile # the project that will make the webapp we will add to base.webapp.path = bio/webapp/dist/bio-webapp.war # choose the intermine.properties file from $HOME: intermine.properties.file = flymine.properties default.intermine.properties.file = ../default.intermine.webapp.properties # the core projects sometimes need a model to compile, but there is a # different model in each Mine so we need to tell the dependency # system (see Dependencies.java) to add this model project to the # dependency list of all projects that we depend on extra.project.dependencies = flymine/dbmodel
compile.dependencies = intermine/webapp/main,\ flymine/dbmodel,\ intermine/webtasks/main,\ bio/core/main,\ bio/webapp,\ flymine/sitemap,\ bio/network/webapp # The products and their immediate library dependencies of these projects # will be included in the webapp # This property says which projects have got dist jar files # which are needed in the webapp - deploy.dependencies = flymine/dbmodel, bio/network/webapp + deploy.dependencies = flymine/dbmodel, bio/network/webapp, bio/network/main ? ++++++++++++++++++ objectstore.name = os.production userprofile.objectstorewriter.name = osw.userprofile-production userprofile.objectstore.name = os.userprofile-production userprofile.db.name = db.userprofile-production userprofile.model.name = userprofile # the project that will make the webapp we will add to base.webapp.path = bio/webapp/dist/bio-webapp.war # choose the intermine.properties file from $HOME: intermine.properties.file = flymine.properties default.intermine.properties.file = ../default.intermine.webapp.properties # the core projects sometimes need a model to compile, but there is a # different model in each Mine so we need to tell the dependency # system (see Dependencies.java) to add this model project to the # dependency list of all projects that we depend on extra.project.dependencies = flymine/dbmodel
2
0.057143
1
1
9f32525cdf0ab9d1ebafe788a0c5968a71fa2e47
src/main/kotlin/me/mrkirby153/KirBot/command/args/elements/NumberElement.kt
src/main/kotlin/me/mrkirby153/KirBot/command/args/elements/NumberElement.kt
package me.mrkirby153.KirBot.command.args.elements import me.mrkirby153.KirBot.command.args.ArgumentList import me.mrkirby153.KirBot.command.args.ArgumentParseException import me.mrkirby153.KirBot.command.args.CommandElement class NumberElement(private val min: Double, private val max: Double) : CommandElement<Double> { override fun parse(list: ArgumentList): Double { val num = list.popFirst() try { val number = num.toDouble() if (number < min) { throw ArgumentParseException(String.format("The number you specified (%.2f) must be greater than %.2f", number, min)) } if (number > max) { throw ArgumentParseException(String.format("The number you specified (%.2f) must be less than %.2f", number, max)) } return number } catch (e: Exception) { throw ArgumentParseException("$num is not a number!") } } }
package me.mrkirby153.KirBot.command.args.elements import me.mrkirby153.KirBot.command.args.ArgumentList import me.mrkirby153.KirBot.command.args.ArgumentParseException import me.mrkirby153.KirBot.command.args.CommandElement class NumberElement(private val min: Double, private val max: Double) : CommandElement<Double> { override fun parse(list: ArgumentList): Double { val num = list.popFirst() try { val number = num.toDouble() if (number < min) { throw ArgumentParseException(String.format("The number you specified (%.2f) must be greater than %.1f", number, min)) } if (number > max) { throw ArgumentParseException(String.format("The number you specified (%.2f) must be less than %.1f", number, max)) } return number } catch (e: NumberFormatException) { throw ArgumentParseException("$num is not a number!") } } }
Fix try/catch block when parsing numbers
Fix try/catch block when parsing numbers
Kotlin
mit
mrkirby153/KirBot
kotlin
## Code Before: package me.mrkirby153.KirBot.command.args.elements import me.mrkirby153.KirBot.command.args.ArgumentList import me.mrkirby153.KirBot.command.args.ArgumentParseException import me.mrkirby153.KirBot.command.args.CommandElement class NumberElement(private val min: Double, private val max: Double) : CommandElement<Double> { override fun parse(list: ArgumentList): Double { val num = list.popFirst() try { val number = num.toDouble() if (number < min) { throw ArgumentParseException(String.format("The number you specified (%.2f) must be greater than %.2f", number, min)) } if (number > max) { throw ArgumentParseException(String.format("The number you specified (%.2f) must be less than %.2f", number, max)) } return number } catch (e: Exception) { throw ArgumentParseException("$num is not a number!") } } } ## Instruction: Fix try/catch block when parsing numbers ## Code After: package me.mrkirby153.KirBot.command.args.elements import me.mrkirby153.KirBot.command.args.ArgumentList import me.mrkirby153.KirBot.command.args.ArgumentParseException import me.mrkirby153.KirBot.command.args.CommandElement class NumberElement(private val min: Double, private val max: Double) : CommandElement<Double> { override fun parse(list: ArgumentList): Double { val num = list.popFirst() try { val number = num.toDouble() if (number < min) { throw ArgumentParseException(String.format("The number you specified (%.2f) must be greater than %.1f", number, min)) } if (number > max) { throw ArgumentParseException(String.format("The number you specified (%.2f) must be less than %.1f", number, max)) } return number } catch (e: NumberFormatException) { throw ArgumentParseException("$num is not a number!") } } }
package me.mrkirby153.KirBot.command.args.elements import me.mrkirby153.KirBot.command.args.ArgumentList import me.mrkirby153.KirBot.command.args.ArgumentParseException import me.mrkirby153.KirBot.command.args.CommandElement class NumberElement(private val min: Double, private val max: Double) : CommandElement<Double> { override fun parse(list: ArgumentList): Double { val num = list.popFirst() try { val number = num.toDouble() if (number < min) { - throw ArgumentParseException(String.format("The number you specified (%.2f) must be greater than %.2f", number, min)) ? ^ + throw ArgumentParseException(String.format("The number you specified (%.2f) must be greater than %.1f", number, min)) ? ^ } if (number > max) { - throw ArgumentParseException(String.format("The number you specified (%.2f) must be less than %.2f", number, max)) ? ^ + throw ArgumentParseException(String.format("The number you specified (%.2f) must be less than %.1f", number, max)) ? ^ } return number - } catch (e: Exception) { + } catch (e: NumberFormatException) { ? ++++++++++++ throw ArgumentParseException("$num is not a number!") } } }
6
0.24
3
3
520e24ad096de305087f30e9298166d25d613040
tests/tst_button.qml
tests/tst_button.qml
import QtQuick 2.0 import QtTest 1.2 import UC 1.0 TestCase { name: "Test the Button" property bool buttonPressed : false Button { id : button text : "foo" onClicked : { buttonPressed = true } } function test_Button() { compare(button.text, "foo") compare(button.pressed, false) button.clicked() compare(buttonPressed, true) } }
import QtQuick 2.0 import QtTest 1.1 import UC 1.0 TestCase { name: "Test the Button" Button { id : button text : "foo" onClicked : { console.log("foo") } } function test_Button() { compare(button.text, "foo") compare(button.pressed, false) // check the onClicked property exists verify(button.onClicked) } }
Adjust unit tests for Silica testing
Adjust unit tests for Silica testing Sailfish OS has only qmlstest >=1.1 and the Silica Button does not have a built-in clicked signal that can be directly triggered, so just verify() the property instead.
QML
bsd-3-clause
M4rtinK/universal-components,M4rtinK/universal-components
qml
## Code Before: import QtQuick 2.0 import QtTest 1.2 import UC 1.0 TestCase { name: "Test the Button" property bool buttonPressed : false Button { id : button text : "foo" onClicked : { buttonPressed = true } } function test_Button() { compare(button.text, "foo") compare(button.pressed, false) button.clicked() compare(buttonPressed, true) } } ## Instruction: Adjust unit tests for Silica testing Sailfish OS has only qmlstest >=1.1 and the Silica Button does not have a built-in clicked signal that can be directly triggered, so just verify() the property instead. ## Code After: import QtQuick 2.0 import QtTest 1.1 import UC 1.0 TestCase { name: "Test the Button" Button { id : button text : "foo" onClicked : { console.log("foo") } } function test_Button() { compare(button.text, "foo") compare(button.pressed, false) // check the onClicked property exists verify(button.onClicked) } }
import QtQuick 2.0 - import QtTest 1.2 ? ^ + import QtTest 1.1 ? ^ import UC 1.0 TestCase { name: "Test the Button" - property bool buttonPressed : false - Button { id : button text : "foo" onClicked : { - buttonPressed = true + console.log("foo") } } function test_Button() { compare(button.text, "foo") compare(button.pressed, false) + // check the onClicked property exists - button.clicked() ? ^ - + verify(button.onClicked) ? +++++++ ^^^ - compare(buttonPressed, true) } }
10
0.416667
4
6
405cc83e1532f5277d180964907e964ded5f5da7
routeros_api/api_communicator/async_decorator.py
routeros_api/api_communicator/async_decorator.py
class AsyncApiCommunicator(object): def __init__(self, inner): self.inner = inner def call(self, *args, **kwargs): tag = self.inner.send(*args, **kwargs) return ResponsePromise(self.inner, tag) class ResponsePromise(object): def __init__(self, receiver, tag): self.receiver = receiver self.tag = tag def get(self): return self.receiver.receive(self.tag)
class AsyncApiCommunicator(object): def __init__(self, inner): self.inner = inner def call(self, *args, **kwargs): tag = self.inner.send(*args, **kwargs) return ResponsePromise(self.inner, tag) class ResponsePromise(object): def __init__(self, receiver, tag): self.receiver = receiver self.tag = tag self.response = None def get(self): if self.response is None: self.response = self.receiver.receive(self.tag) return self.response
Allow to run get on promise multiple times.
Allow to run get on promise multiple times.
Python
mit
kramarz/RouterOS-api,pozytywnie/RouterOS-api,socialwifi/RouterOS-api
python
## Code Before: class AsyncApiCommunicator(object): def __init__(self, inner): self.inner = inner def call(self, *args, **kwargs): tag = self.inner.send(*args, **kwargs) return ResponsePromise(self.inner, tag) class ResponsePromise(object): def __init__(self, receiver, tag): self.receiver = receiver self.tag = tag def get(self): return self.receiver.receive(self.tag) ## Instruction: Allow to run get on promise multiple times. ## Code After: class AsyncApiCommunicator(object): def __init__(self, inner): self.inner = inner def call(self, *args, **kwargs): tag = self.inner.send(*args, **kwargs) return ResponsePromise(self.inner, tag) class ResponsePromise(object): def __init__(self, receiver, tag): self.receiver = receiver self.tag = tag self.response = None def get(self): if self.response is None: self.response = self.receiver.receive(self.tag) return self.response
class AsyncApiCommunicator(object): def __init__(self, inner): self.inner = inner def call(self, *args, **kwargs): tag = self.inner.send(*args, **kwargs) return ResponsePromise(self.inner, tag) class ResponsePromise(object): def __init__(self, receiver, tag): self.receiver = receiver self.tag = tag + self.response = None def get(self): + if self.response is None: - return self.receiver.receive(self.tag) ? ^^^ + self.response = self.receiver.receive(self.tag) ? +++++++++ ^^^ ++++ + return self.response
5
0.333333
4
1
a8829a4294195278896943cfdb94a9ace3440db8
README.md
README.md
[![Build Status](https://travis-ci.org/Behat/Symfony2Extension.svg?branch=master)](https://travis-ci.org/Behat/Symfony2Extension) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Behat/Symfony2Extension/badges/quality-score.png?s=b49d2ecf9c3e9de8cc33df444d248154ac11db44)](https://scrutinizer-ci.com/g/Behat/Symfony2Extension/) Symfony2Extension is an integration layer between Behat 3.0+ and Symfony2+ and it provides: * Complete integration into Symfony2 bundle structure - you can run an isolated bundle suite by bundle shortname, classname or even full path * `KernelAwareContext`, which provides an initialized and booted kernel instance for your contexts * Additional `symfony2` driver for Mink (if `MinkExtension` is installed) older 1.1.x version for Behat 2.5: [![Build Status](https://travis-ci.org/Behat/Symfony2Extension.svg?branch=1.1.x)](https://travis-ci.org/Behat/Symfony2Extension) ## Documentation [Official documentation](doc/index.rst). ## Copyright Copyright (c) 2012-2014 Konstantin Kudryashov (ever.zet). See LICENSE for details. ## Contributors * Konstantin Kudryashov [everzet](http://github.com/everzet) [lead developer] * Other [awesome developers](https://github.com/Behat/Symfony2Extension/graphs/contributors)
[![Build Status](https://travis-ci.org/Behat/Symfony2Extension.svg?branch=master)](https://travis-ci.org/Behat/Symfony2Extension) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Behat/Symfony2Extension/badges/quality-score.png?s=b49d2ecf9c3e9de8cc33df444d248154ac11db44)](https://scrutinizer-ci.com/g/Behat/Symfony2Extension/) Symfony2Extension is an integration layer between Behat 3.0+ and Symfony2+ and it provides: * Complete integration into Symfony2 bundle structure - you can run an isolated bundle suite by bundle shortname, classname or even full path * `KernelAwareContext`, which provides an initialized and booted kernel instance for your contexts * Additional `symfony2` driver for Mink (if `MinkExtension` is installed) ## Documentation [Official documentation](doc/index.rst). ## Copyright Copyright (c) 2012-2014 Konstantin Kudryashov (ever.zet). See LICENSE for details. ## Contributors * Konstantin Kudryashov [everzet](http://github.com/everzet) [lead developer] * Other [awesome developers](https://github.com/Behat/Symfony2Extension/graphs/contributors)
Remove mention of the 1.1.x branch
Remove mention of the 1.1.x branch
Markdown
mit
Behat/Symfony2Extension
markdown
## Code Before: [![Build Status](https://travis-ci.org/Behat/Symfony2Extension.svg?branch=master)](https://travis-ci.org/Behat/Symfony2Extension) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Behat/Symfony2Extension/badges/quality-score.png?s=b49d2ecf9c3e9de8cc33df444d248154ac11db44)](https://scrutinizer-ci.com/g/Behat/Symfony2Extension/) Symfony2Extension is an integration layer between Behat 3.0+ and Symfony2+ and it provides: * Complete integration into Symfony2 bundle structure - you can run an isolated bundle suite by bundle shortname, classname or even full path * `KernelAwareContext`, which provides an initialized and booted kernel instance for your contexts * Additional `symfony2` driver for Mink (if `MinkExtension` is installed) older 1.1.x version for Behat 2.5: [![Build Status](https://travis-ci.org/Behat/Symfony2Extension.svg?branch=1.1.x)](https://travis-ci.org/Behat/Symfony2Extension) ## Documentation [Official documentation](doc/index.rst). ## Copyright Copyright (c) 2012-2014 Konstantin Kudryashov (ever.zet). See LICENSE for details. ## Contributors * Konstantin Kudryashov [everzet](http://github.com/everzet) [lead developer] * Other [awesome developers](https://github.com/Behat/Symfony2Extension/graphs/contributors) ## Instruction: Remove mention of the 1.1.x branch ## Code After: [![Build Status](https://travis-ci.org/Behat/Symfony2Extension.svg?branch=master)](https://travis-ci.org/Behat/Symfony2Extension) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Behat/Symfony2Extension/badges/quality-score.png?s=b49d2ecf9c3e9de8cc33df444d248154ac11db44)](https://scrutinizer-ci.com/g/Behat/Symfony2Extension/) Symfony2Extension is an integration layer between Behat 3.0+ and Symfony2+ and it provides: * Complete integration into Symfony2 bundle structure - you can run an isolated bundle suite by bundle shortname, classname or even full path * `KernelAwareContext`, which provides an initialized and booted kernel instance for your contexts * Additional `symfony2` driver for Mink (if `MinkExtension` is installed) ## Documentation [Official documentation](doc/index.rst). ## Copyright Copyright (c) 2012-2014 Konstantin Kudryashov (ever.zet). See LICENSE for details. ## Contributors * Konstantin Kudryashov [everzet](http://github.com/everzet) [lead developer] * Other [awesome developers](https://github.com/Behat/Symfony2Extension/graphs/contributors)
[![Build Status](https://travis-ci.org/Behat/Symfony2Extension.svg?branch=master)](https://travis-ci.org/Behat/Symfony2Extension) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Behat/Symfony2Extension/badges/quality-score.png?s=b49d2ecf9c3e9de8cc33df444d248154ac11db44)](https://scrutinizer-ci.com/g/Behat/Symfony2Extension/) Symfony2Extension is an integration layer between Behat 3.0+ and Symfony2+ and it provides: * Complete integration into Symfony2 bundle structure - you can run an isolated bundle suite by bundle shortname, classname or even full path * `KernelAwareContext`, which provides an initialized and booted kernel instance for your contexts * Additional `symfony2` driver for Mink (if `MinkExtension` is installed) - older 1.1.x version for Behat 2.5: - [![Build Status](https://travis-ci.org/Behat/Symfony2Extension.svg?branch=1.1.x)](https://travis-ci.org/Behat/Symfony2Extension) ## Documentation [Official documentation](doc/index.rst). ## Copyright Copyright (c) 2012-2014 Konstantin Kudryashov (ever.zet). See LICENSE for details. ## Contributors * Konstantin Kudryashov [everzet](http://github.com/everzet) [lead developer] * Other [awesome developers](https://github.com/Behat/Symfony2Extension/graphs/contributors)
2
0.08
0
2
0a247a11645dc9a2f1b7bfb03e243e82acacad85
lib/public/ConPA/js/portfolioCharts.js
lib/public/ConPA/js/portfolioCharts.js
/*global jQuery, google */ (function ($, g) { 'use strict'; g.load('visualization', '1', { packages: ['corechart'], callback: function () { var options = { backgroundColor: '#eee', hAxis: {title: 'Risk %'}, legend: 'none', title: 'Graph based on the latest 100 portfolios', vAxis: {title: 'Return %'} }, chart = new g.visualization.ScatterChart( $('#efficient-frontier').get()[0]); chart.setAction({ id: "portfolioDetails", text: "", action: function () { console.log(chart.getSelection()); } }); function percentageFormatter(number) { return (number * 100).toFixed(2) * 1; } function handleRender(e, data) { var dataArray = [ ['Risk', 'Return'] ]; data.rows.forEach(function (ptf) { dataArray.push([ percentageFormatter(parseFloat(ptf.value.risk)), percentageFormatter(parseFloat(ptf.value.ret)) ]); }); chart.draw(g.visualization.arrayToDataTable(dataArray), options); } $.subscribe('render.latestptfschart.conpa', handleRender); } }); }(jQuery, google));
/*global jQuery, google */ (function ($, g) { 'use strict'; g.load('visualization', '1', { packages: ['corechart'], callback: function () { function percentageFormatter(number) { return (number * 100).toFixed(2) * 1; } function handleRender(e, data) { var options = { backgroundColor: '#eee', title: 'Graph based on the latest 100 portfolios', hAxis: {title: 'Risk %'}, vAxis: {title: 'Return %'}, legend: 'none' }, dataArray = [], dataTable = new google.visualization.DataTable(), chart = new g.visualization.ScatterChart( $('#efficient-frontier').get()[0]); dataTable.addColumn('number', 'Risk'); dataTable.addColumn('number', 'Return'); dataTable.addColumn({type: 'string', role: 'tooltip'}); data.rows.forEach(function (ptf) { var risk = percentageFormatter(parseFloat(ptf.value.risk)), ret = percentageFormatter(parseFloat(ptf.value.ret)), perf = percentageFormatter(parseFloat(ptf.value.perf)); dataArray.push([risk, ret, "Risk: " + risk + "%\n" + "Return: " + ret + "%\n" + "Performance: " + perf + "%" ]); }); dataTable.addRows(dataArray); chart.draw(dataTable, options); } $.subscribe('render.latestptfschart.conpa', handleRender); } }); }(jQuery, google));
Add tooltip to the latest ptf chart.
Add tooltip to the latest ptf chart.
JavaScript
mit
albertosantini/node-conpa,albertosantini/node-conpa
javascript
## Code Before: /*global jQuery, google */ (function ($, g) { 'use strict'; g.load('visualization', '1', { packages: ['corechart'], callback: function () { var options = { backgroundColor: '#eee', hAxis: {title: 'Risk %'}, legend: 'none', title: 'Graph based on the latest 100 portfolios', vAxis: {title: 'Return %'} }, chart = new g.visualization.ScatterChart( $('#efficient-frontier').get()[0]); chart.setAction({ id: "portfolioDetails", text: "", action: function () { console.log(chart.getSelection()); } }); function percentageFormatter(number) { return (number * 100).toFixed(2) * 1; } function handleRender(e, data) { var dataArray = [ ['Risk', 'Return'] ]; data.rows.forEach(function (ptf) { dataArray.push([ percentageFormatter(parseFloat(ptf.value.risk)), percentageFormatter(parseFloat(ptf.value.ret)) ]); }); chart.draw(g.visualization.arrayToDataTable(dataArray), options); } $.subscribe('render.latestptfschart.conpa', handleRender); } }); }(jQuery, google)); ## Instruction: Add tooltip to the latest ptf chart. ## Code After: /*global jQuery, google */ (function ($, g) { 'use strict'; g.load('visualization', '1', { packages: ['corechart'], callback: function () { function percentageFormatter(number) { return (number * 100).toFixed(2) * 1; } function handleRender(e, data) { var options = { backgroundColor: '#eee', title: 'Graph based on the latest 100 portfolios', hAxis: {title: 'Risk %'}, vAxis: {title: 'Return %'}, legend: 'none' }, dataArray = [], dataTable = new google.visualization.DataTable(), chart = new g.visualization.ScatterChart( $('#efficient-frontier').get()[0]); dataTable.addColumn('number', 'Risk'); dataTable.addColumn('number', 'Return'); dataTable.addColumn({type: 'string', role: 'tooltip'}); data.rows.forEach(function (ptf) { var risk = percentageFormatter(parseFloat(ptf.value.risk)), ret = percentageFormatter(parseFloat(ptf.value.ret)), perf = percentageFormatter(parseFloat(ptf.value.perf)); dataArray.push([risk, ret, "Risk: " + risk + "%\n" + "Return: " + ret + "%\n" + "Performance: " + perf + "%" ]); }); dataTable.addRows(dataArray); chart.draw(dataTable, options); } $.subscribe('render.latestptfschart.conpa', handleRender); } }); }(jQuery, google));
/*global jQuery, google */ (function ($, g) { 'use strict'; g.load('visualization', '1', { packages: ['corechart'], callback: function () { - var options = { - backgroundColor: '#eee', - hAxis: {title: 'Risk %'}, - legend: 'none', - title: 'Graph based on the latest 100 portfolios', - vAxis: {title: 'Return %'} - }, - chart = new g.visualization.ScatterChart( - $('#efficient-frontier').get()[0]); - - chart.setAction({ - id: "portfolioDetails", - text: "", - action: function () { - console.log(chart.getSelection()); - } - }); - function percentageFormatter(number) { return (number * 100).toFixed(2) * 1; } function handleRender(e, data) { + var options = { + backgroundColor: '#eee', + title: 'Graph based on the latest 100 portfolios', + hAxis: {title: 'Risk %'}, + vAxis: {title: 'Return %'}, + legend: 'none' + }, - var dataArray = [ ? ^^^ + dataArray = [], ? ^^^ ++ - ['Risk', 'Return'] - ]; + dataTable = new google.visualization.DataTable(), + chart = new g.visualization.ScatterChart( + $('#efficient-frontier').get()[0]); + + dataTable.addColumn('number', 'Risk'); + dataTable.addColumn('number', 'Return'); + dataTable.addColumn({type: 'string', role: 'tooltip'}); data.rows.forEach(function (ptf) { - dataArray.push([ - percentageFormatter(parseFloat(ptf.value.risk)), ? ^ + var risk = percentageFormatter(parseFloat(ptf.value.risk)), ? +++ ++++ ^ - percentageFormatter(parseFloat(ptf.value.ret)) + ret = percentageFormatter(parseFloat(ptf.value.ret)), ? ++++++ + + perf = percentageFormatter(parseFloat(ptf.value.perf)); + + dataArray.push([risk, ret, + "Risk: " + risk + "%\n" + + "Return: " + ret + "%\n" + + "Performance: " + perf + "%" ]); }); + dataTable.addRows(dataArray); + chart.draw(dataTable, options); - chart.draw(g.visualization.arrayToDataTable(dataArray), - options); } $.subscribe('render.latestptfschart.conpa', handleRender); - } }); }(jQuery, google));
52
1
25
27
d81289bdc0a32305fb339c78bc0e191edd86bfcb
workshop/www/js/recipe.js
workshop/www/js/recipe.js
var Recipe = function(data){ this.title = data.Title; this.stars = data.StarRating; this.imageUrl = data.ImageURL } function BigOvenRecipeSearchJson(query) { var allRecipes = []; var noImageLink = "http://redirect.bigoven.com/pics/recipe-no-image.jpg" var apiKey = APIKEY; var titleKeyword = query; var url = "https://api.bigoven.com/recipes?pg=1&rpp=25&title_kw=" + titleKeyword + "&api_key="+apiKey; $.ajax({ type: "GET", dataType: 'json', cache: false, url: url }).then(function(data){ for(i = 0; i < data.Results.length; i ++) { allRecipes.push(new Recipe(data.Results[i])); }; return allRecipes }).then(function(recipes){ // render allRecipes here }) }; $(document).ready(function(){ var bigOvenSearch = BigOvenRecipeSearchJson('cookies'); });
var Recipe = function(data){ this.title = data.Title; this.stars = data.StarRating; this.imageUrl = data.ImageURL } function BigOvenRecipeSearchJson(query) { var allRecipes = []; var noImageLink = "http://redirect.bigoven.com/pics/recipe-no-image.jpg" var apiKey = "dvx7zJ0x53M8X5U4nOh6CMGpB3d0PEhH"; var titleKeyword = query; var url = "https://api.bigoven.com/recipes?pg=1&rpp=25&title_kw=" + titleKeyword + "&api_key="+apiKey; $.ajax({ type: "GET", dataType: 'json', cache: false, url: url }).then(function(data){ for(i = 0; i < data.Results.length; i ++) { allRecipes.push(new Recipe(data.Results[i])); }; return allRecipes }).then(function(recipes){ var template = $('#search-results').html(); var output = Mustache.render(template, {recipes: recipes}); $('#results').append(output); }) }; $(document).ready(function(){ BigOvenRecipeSearchJson('cookies'); });
Add then callback to render search-results template
Add then callback to render search-results template
JavaScript
mit
danasselin/line-cook,nyc-rock-doves-2015/line-cook,danasselin/line-cook,nyc-rock-doves-2015/line-cook,danasselin/line-cook,danasselin/line-cook,nyc-rock-doves-2015/line-cook,nyc-rock-doves-2015/line-cook,nyc-rock-doves-2015/line-cook,nyc-rock-doves-2015/line-cook,nyc-rock-doves-2015/line-cook,danasselin/line-cook,danasselin/line-cook,nyc-rock-doves-2015/line-cook,danasselin/line-cook,danasselin/line-cook
javascript
## Code Before: var Recipe = function(data){ this.title = data.Title; this.stars = data.StarRating; this.imageUrl = data.ImageURL } function BigOvenRecipeSearchJson(query) { var allRecipes = []; var noImageLink = "http://redirect.bigoven.com/pics/recipe-no-image.jpg" var apiKey = APIKEY; var titleKeyword = query; var url = "https://api.bigoven.com/recipes?pg=1&rpp=25&title_kw=" + titleKeyword + "&api_key="+apiKey; $.ajax({ type: "GET", dataType: 'json', cache: false, url: url }).then(function(data){ for(i = 0; i < data.Results.length; i ++) { allRecipes.push(new Recipe(data.Results[i])); }; return allRecipes }).then(function(recipes){ // render allRecipes here }) }; $(document).ready(function(){ var bigOvenSearch = BigOvenRecipeSearchJson('cookies'); }); ## Instruction: Add then callback to render search-results template ## Code After: var Recipe = function(data){ this.title = data.Title; this.stars = data.StarRating; this.imageUrl = data.ImageURL } function BigOvenRecipeSearchJson(query) { var allRecipes = []; var noImageLink = "http://redirect.bigoven.com/pics/recipe-no-image.jpg" var apiKey = "dvx7zJ0x53M8X5U4nOh6CMGpB3d0PEhH"; var titleKeyword = query; var url = "https://api.bigoven.com/recipes?pg=1&rpp=25&title_kw=" + titleKeyword + "&api_key="+apiKey; $.ajax({ type: "GET", dataType: 'json', cache: false, url: url }).then(function(data){ for(i = 0; i < data.Results.length; i ++) { allRecipes.push(new Recipe(data.Results[i])); }; return allRecipes }).then(function(recipes){ var template = $('#search-results').html(); var output = Mustache.render(template, {recipes: recipes}); $('#results').append(output); }) }; $(document).ready(function(){ BigOvenRecipeSearchJson('cookies'); });
var Recipe = function(data){ this.title = data.Title; this.stars = data.StarRating; this.imageUrl = data.ImageURL } function BigOvenRecipeSearchJson(query) { var allRecipes = []; var noImageLink = "http://redirect.bigoven.com/pics/recipe-no-image.jpg" - var apiKey = APIKEY; + var apiKey = "dvx7zJ0x53M8X5U4nOh6CMGpB3d0PEhH"; var titleKeyword = query; var url = "https://api.bigoven.com/recipes?pg=1&rpp=25&title_kw=" + titleKeyword + "&api_key="+apiKey; $.ajax({ type: "GET", dataType: 'json', cache: false, url: url }).then(function(data){ for(i = 0; i < data.Results.length; i ++) { allRecipes.push(new Recipe(data.Results[i])); }; return allRecipes }).then(function(recipes){ - // render allRecipes here + var template = $('#search-results').html(); + var output = Mustache.render(template, {recipes: recipes}); + $('#results').append(output); }) }; $(document).ready(function(){ - var bigOvenSearch = BigOvenRecipeSearchJson('cookies'); ? -------------------- + BigOvenRecipeSearchJson('cookies'); });
8
0.222222
5
3
89fb590968caa4e17817d82217cdd375fba52b40
src/pkg/runtime/sys_akaros_amd64.s
src/pkg/runtime/sys_akaros_amd64.s
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // // System calls and other sys stuff for Akaros amd64 // // set tls base to DI TEXT runtime·settls(SB),7,$32 SUBQ $12, SP MOVL $0, 0(SP) // vcore 0 MOVQ DI, 4(SP) // the new fs base CALL runtime∕parlib·Set_tls_desc(SB) RET
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // // System calls and other sys stuff for Akaros amd64 // // Do nothing for now TEXT runtime·settls(SB), 7, $0 RET
Remove contents of amd64 settls since e never call it
Remove contents of amd64 settls since e never call it
GAS
bsd-3-clause
klueska/go-akaros,klueska/go-akaros,klueska/go-akaros,klueska/go-akaros,klueska/go-akaros,klueska/go-akaros,klueska/go-akaros,klueska/go-akaros
gas
## Code Before: // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // // System calls and other sys stuff for Akaros amd64 // // set tls base to DI TEXT runtime·settls(SB),7,$32 SUBQ $12, SP MOVL $0, 0(SP) // vcore 0 MOVQ DI, 4(SP) // the new fs base CALL runtime∕parlib·Set_tls_desc(SB) RET ## Instruction: Remove contents of amd64 settls since e never call it ## Code After: // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // // System calls and other sys stuff for Akaros amd64 // // Do nothing for now TEXT runtime·settls(SB), 7, $0 RET
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // // System calls and other sys stuff for Akaros amd64 // - // set tls base to DI + // Do nothing for now - TEXT runtime·settls(SB),7,$32 ? ^^ + TEXT runtime·settls(SB), 7, $0 ? + + ^ - SUBQ $12, SP - MOVL $0, 0(SP) // vcore 0 - MOVQ DI, 4(SP) // the new fs base - CALL runtime∕parlib·Set_tls_desc(SB) RET
8
0.5
2
6
d0bc71a09b45332c1feacf6907314aecc255e997
tests/CreatesApplication.php
tests/CreatesApplication.php
<?php namespace Tests; use Illuminate\Contracts\Console\Kernel; trait CreatesApplication { /** * Creates the application. * * @return \Illuminate\Foundation\Application */ public function createApplication() { $app = require __DIR__.'/../bootstrap/app.php'; $app->make(Kernel::class)->bootstrap(); return $app; } }
<?php namespace Tests; use Illuminate\Contracts\Console\Kernel; trait CreatesApplication { /** * Creates the application. * * @return \Illuminate\Foundation\Application */ public function createApplication() { $app = require __DIR__.'/../bootstrap/app.php'; //Configuration for database to display the custome pages(eg.Admin,Catalog etc) $app['config']->set('database.dafult', 'dusk_testing'); $app->make(Kernel::class)->bootstrap(); return $app; } }
Update CreateApplication.php under tests folder
Update CreateApplication.php under tests folder To make the database config into picture.
PHP
mit
mage2/laravel-ecommerce,mage2/laravel-ecommerce,mage2/laravel-ecommerce
php
## Code Before: <?php namespace Tests; use Illuminate\Contracts\Console\Kernel; trait CreatesApplication { /** * Creates the application. * * @return \Illuminate\Foundation\Application */ public function createApplication() { $app = require __DIR__.'/../bootstrap/app.php'; $app->make(Kernel::class)->bootstrap(); return $app; } } ## Instruction: Update CreateApplication.php under tests folder To make the database config into picture. ## Code After: <?php namespace Tests; use Illuminate\Contracts\Console\Kernel; trait CreatesApplication { /** * Creates the application. * * @return \Illuminate\Foundation\Application */ public function createApplication() { $app = require __DIR__.'/../bootstrap/app.php'; //Configuration for database to display the custome pages(eg.Admin,Catalog etc) $app['config']->set('database.dafult', 'dusk_testing'); $app->make(Kernel::class)->bootstrap(); return $app; } }
<?php namespace Tests; use Illuminate\Contracts\Console\Kernel; trait CreatesApplication { /** * Creates the application. * * @return \Illuminate\Foundation\Application */ public function createApplication() { $app = require __DIR__.'/../bootstrap/app.php'; - + //Configuration for database to display the custome pages(eg.Admin,Catalog etc) + $app['config']->set('database.dafult', 'dusk_testing'); $app->make(Kernel::class)->bootstrap(); return $app; } }
3
0.136364
2
1
e73660141006711854d9bd575316b319626c8ce3
README.md
README.md
<img src="cassidae.png" style="width: 25%; float: left;"> # Cassid: a fake CAS login shell Cassid is a fake CAS login service for development and testing -- no passwords or pre-registered user-ids are needed. Rather then struggle with CAS's official Java servlet, just drop Cassid on any webserver with PHP, or use the [public Cassid service](https://cassid.habilis.net/). Cassid can be run via Apache or directly with PHP's build-in web server. For example, to run on [locahost](http://localhost:9000): ``` git checkout https://github.com/chuckhoupt/Cassid.git cd Cassid php -S localhost:8000 cassid.php ``` Cassid is named after the [Cassidae](https://en.wikipedia.org/wiki/Cassidae), sea snails with helmet shaped shell, as well as being a play on "CAS Identity".
<img src="cassidae.png" width="139.5"> # Cassid: a fake CAS login shell Cassid is a fake CAS login service for development and testing -- no passwords or pre-registered user-ids are needed. Rather then struggle with CAS's official Java servlet, just drop Cassid on any webserver with PHP, or use the [public Cassid service](https://cassid.habilis.net/). Cassid can be run via Apache or directly with PHP's build-in web server. For example, to run on [locahost](http://localhost:9000): ``` git checkout https://github.com/chuckhoupt/Cassid.git cd Cassid php -S localhost:8000 cassid.php ``` Cassid is named after the [Cassidae](https://en.wikipedia.org/wiki/Cassidae), sea snails with helmet shaped shell, as well as being a play on "CAS Identity".
Remove shell image styling and set width
Remove shell image styling and set width
Markdown
apache-2.0
chuckhoupt/Cassid
markdown
## Code Before: <img src="cassidae.png" style="width: 25%; float: left;"> # Cassid: a fake CAS login shell Cassid is a fake CAS login service for development and testing -- no passwords or pre-registered user-ids are needed. Rather then struggle with CAS's official Java servlet, just drop Cassid on any webserver with PHP, or use the [public Cassid service](https://cassid.habilis.net/). Cassid can be run via Apache or directly with PHP's build-in web server. For example, to run on [locahost](http://localhost:9000): ``` git checkout https://github.com/chuckhoupt/Cassid.git cd Cassid php -S localhost:8000 cassid.php ``` Cassid is named after the [Cassidae](https://en.wikipedia.org/wiki/Cassidae), sea snails with helmet shaped shell, as well as being a play on "CAS Identity". ## Instruction: Remove shell image styling and set width ## Code After: <img src="cassidae.png" width="139.5"> # Cassid: a fake CAS login shell Cassid is a fake CAS login service for development and testing -- no passwords or pre-registered user-ids are needed. Rather then struggle with CAS's official Java servlet, just drop Cassid on any webserver with PHP, or use the [public Cassid service](https://cassid.habilis.net/). Cassid can be run via Apache or directly with PHP's build-in web server. For example, to run on [locahost](http://localhost:9000): ``` git checkout https://github.com/chuckhoupt/Cassid.git cd Cassid php -S localhost:8000 cassid.php ``` Cassid is named after the [Cassidae](https://en.wikipedia.org/wiki/Cassidae), sea snails with helmet shaped shell, as well as being a play on "CAS Identity".
- <img src="cassidae.png" style="width: 25%; float: left;"> + <img src="cassidae.png" width="139.5"> # Cassid: a fake CAS login shell Cassid is a fake CAS login service for development and testing -- no passwords or pre-registered user-ids are needed. Rather then struggle with CAS's official Java servlet, just drop Cassid on any webserver with PHP, or use the [public Cassid service](https://cassid.habilis.net/). Cassid can be run via Apache or directly with PHP's build-in web server. For example, to run on [locahost](http://localhost:9000): ``` git checkout https://github.com/chuckhoupt/Cassid.git cd Cassid php -S localhost:8000 cassid.php ``` Cassid is named after the [Cassidae](https://en.wikipedia.org/wiki/Cassidae), sea snails with helmet shaped shell, as well as being a play on "CAS Identity".
2
0.1
1
1
db4d073bf9fb6dc08dc242c3437ce38db550b764
greenlab/tasks/packages.yml
greenlab/tasks/packages.yml
--- - name: install the latest versions of software yum: name=* state=latest - name: install additional packages yum: pkg={{ item }} state=present with_items: - tuned - policycoreutils-python - python2-pip - name: install katello-agent when: inventory_hostname == "satellite.atgreen.org" copy: src=zabbix.repo dest=/etc/yum.repos.d/zabbix.repo - name: install katello-agent yum: pkg=katello-agent state=present - name: install additional satellite packages when: inventory_hostname == "satellite.atgreen.org" yum: pkg={{ item }} state=present with_items: - puppet-foreman_scap_client - name: pip install zabbix-api pip: name=zabbix-api
--- - name: install the latest versions of software yum: name=* update_cache=yes state=latest - name: install additional packages yum: pkg={{ item }} state=present with_items: - tuned - policycoreutils-python - python2-pip - name: install katello-agent when: inventory_hostname == "satellite.atgreen.org" copy: src=zabbix.repo dest=/etc/yum.repos.d/zabbix.repo - name: install katello-agent yum: pkg=katello-agent state=present - name: install additional satellite packages when: inventory_hostname == "satellite.atgreen.org" yum: pkg={{ item }} state=present with_items: - puppet-foreman_scap_client - name: pip install zabbix-api pip: name=zabbix-api
Update yum cache before anything
Update yum cache before anything
YAML
apache-2.0
atgreen/GreenLab-Maintenance
yaml
## Code Before: --- - name: install the latest versions of software yum: name=* state=latest - name: install additional packages yum: pkg={{ item }} state=present with_items: - tuned - policycoreutils-python - python2-pip - name: install katello-agent when: inventory_hostname == "satellite.atgreen.org" copy: src=zabbix.repo dest=/etc/yum.repos.d/zabbix.repo - name: install katello-agent yum: pkg=katello-agent state=present - name: install additional satellite packages when: inventory_hostname == "satellite.atgreen.org" yum: pkg={{ item }} state=present with_items: - puppet-foreman_scap_client - name: pip install zabbix-api pip: name=zabbix-api ## Instruction: Update yum cache before anything ## Code After: --- - name: install the latest versions of software yum: name=* update_cache=yes state=latest - name: install additional packages yum: pkg={{ item }} state=present with_items: - tuned - policycoreutils-python - python2-pip - name: install katello-agent when: inventory_hostname == "satellite.atgreen.org" copy: src=zabbix.repo dest=/etc/yum.repos.d/zabbix.repo - name: install katello-agent yum: pkg=katello-agent state=present - name: install additional satellite packages when: inventory_hostname == "satellite.atgreen.org" yum: pkg={{ item }} state=present with_items: - puppet-foreman_scap_client - name: pip install zabbix-api pip: name=zabbix-api
--- - name: install the latest versions of software - yum: name=* state=latest + yum: name=* update_cache=yes state=latest ? +++++++++++++++++ - name: install additional packages yum: pkg={{ item }} state=present with_items: - tuned - policycoreutils-python - python2-pip - name: install katello-agent when: inventory_hostname == "satellite.atgreen.org" copy: src=zabbix.repo dest=/etc/yum.repos.d/zabbix.repo - name: install katello-agent yum: pkg=katello-agent state=present - name: install additional satellite packages when: inventory_hostname == "satellite.atgreen.org" yum: pkg={{ item }} state=present with_items: - puppet-foreman_scap_client - name: pip install zabbix-api pip: name=zabbix-api
2
0.068966
1
1
b738db48eade5d03e8f5bbc36132ac8b5dbfef13
README.md
README.md
Hello, and welcome to the Grabble git repository! Grabble is a small personal project of mine to create an implementation of a graph in ruby. My initial motivation for doing this was to store a large quantity of words and be able to easily query for words that are similar (e.g. off by n letters). Please note that this is not the most performant code at the moment, and everything is stored in memory (which is why I named the main class `Cache`) I'll write up more detailed instructions after a little bit more development. #Todo list: - Tests - Docs - Cleanup
[![Build Status](https://travis-ci.org/matt-clement/grabble.svg?branch=master)](https://travis-ci.org/matt-clement/grabble) Hello, and welcome to the Grabble git repository! Grabble is a small personal project of mine to create an implementation of a graph in ruby. My initial motivation for doing this was to store a large quantity of words and be able to easily query for words that are similar (e.g. off by n letters). Please note that this is not the most performant code at the moment, and everything is stored in memory (which is why I named the main class `Cache`) I'll write up more detailed instructions after a little bit more development. #Todo list: - Tests - Docs - Cleanup
Add build info to readme.
Add build info to readme.
Markdown
mit
matt-clement/grabble
markdown
## Code Before: Hello, and welcome to the Grabble git repository! Grabble is a small personal project of mine to create an implementation of a graph in ruby. My initial motivation for doing this was to store a large quantity of words and be able to easily query for words that are similar (e.g. off by n letters). Please note that this is not the most performant code at the moment, and everything is stored in memory (which is why I named the main class `Cache`) I'll write up more detailed instructions after a little bit more development. #Todo list: - Tests - Docs - Cleanup ## Instruction: Add build info to readme. ## Code After: [![Build Status](https://travis-ci.org/matt-clement/grabble.svg?branch=master)](https://travis-ci.org/matt-clement/grabble) Hello, and welcome to the Grabble git repository! Grabble is a small personal project of mine to create an implementation of a graph in ruby. My initial motivation for doing this was to store a large quantity of words and be able to easily query for words that are similar (e.g. off by n letters). Please note that this is not the most performant code at the moment, and everything is stored in memory (which is why I named the main class `Cache`) I'll write up more detailed instructions after a little bit more development. #Todo list: - Tests - Docs - Cleanup
+ [![Build Status](https://travis-ci.org/matt-clement/grabble.svg?branch=master)](https://travis-ci.org/matt-clement/grabble) + Hello, and welcome to the Grabble git repository! Grabble is a small personal project of mine to create an implementation of a graph in ruby. My initial motivation for doing this was to store a large quantity of words and be able to easily query for words that are similar (e.g. off by n letters). Please note that this is not the most performant code at the moment, and everything is stored in memory (which is why I named the main class `Cache`) I'll write up more detailed instructions after a little bit more development. #Todo list: - Tests - Docs - Cleanup
2
0.166667
2
0
84edc6edeca2d5534c12a87df90cd684dfe9918d
src/common/species_dialog.cc
src/common/species_dialog.cc
namespace fish_detector { SpeciesDialog::SpeciesDialog(QWidget *parent) : QDialog(parent) , ui_(new Ui::SpeciesDialog) { ui_->setupUi(this); } void SpeciesDialog::on_ok_clicked() { } void SpeciesDialog::on_cancel_clicked() { } void SpeciesDialog::on_removeSubspecies_clicked() { } void SpeciesDialog::on_addSubspecies_clicked() { } Species SpeciesDialog::getSpecies() { Species species; return species; } #include "../../include/fish_detector/common/moc_species_dialog.cpp" } // namespace fish_detector
namespace fish_detector { SpeciesDialog::SpeciesDialog(QWidget *parent) : QDialog(parent) , ui_(new Ui::SpeciesDialog) { ui_->setupUi(this); } void SpeciesDialog::on_ok_clicked() { accept(); } void SpeciesDialog::on_cancel_clicked() { reject(); } void SpeciesDialog::on_removeSubspecies_clicked() { QListWidgetItem *current = ui_->subspeciesList->currentItem(); if(current != nullptr) { delete current; } } void SpeciesDialog::on_addSubspecies_clicked() { QListWidgetItem *item = new QListWidgetItem("New subspecies"); item->setFlags(item->flags() | Qt::ItemIsEditable); ui_->subspeciesList->addItem(item); ui_->subspeciesList->editItem(item); } Species SpeciesDialog::getSpecies() { Species species; return species; } #include "../../include/fish_detector/common/moc_species_dialog.cpp" } // namespace fish_detector
Add implementation for adding/removing subspecies functions
Add implementation for adding/removing subspecies functions
C++
mit
BGWoodward/FishDetector
c++
## Code Before: namespace fish_detector { SpeciesDialog::SpeciesDialog(QWidget *parent) : QDialog(parent) , ui_(new Ui::SpeciesDialog) { ui_->setupUi(this); } void SpeciesDialog::on_ok_clicked() { } void SpeciesDialog::on_cancel_clicked() { } void SpeciesDialog::on_removeSubspecies_clicked() { } void SpeciesDialog::on_addSubspecies_clicked() { } Species SpeciesDialog::getSpecies() { Species species; return species; } #include "../../include/fish_detector/common/moc_species_dialog.cpp" } // namespace fish_detector ## Instruction: Add implementation for adding/removing subspecies functions ## Code After: namespace fish_detector { SpeciesDialog::SpeciesDialog(QWidget *parent) : QDialog(parent) , ui_(new Ui::SpeciesDialog) { ui_->setupUi(this); } void SpeciesDialog::on_ok_clicked() { accept(); } void SpeciesDialog::on_cancel_clicked() { reject(); } void SpeciesDialog::on_removeSubspecies_clicked() { QListWidgetItem *current = ui_->subspeciesList->currentItem(); if(current != nullptr) { delete current; } } void SpeciesDialog::on_addSubspecies_clicked() { QListWidgetItem *item = new QListWidgetItem("New subspecies"); item->setFlags(item->flags() | Qt::ItemIsEditable); ui_->subspeciesList->addItem(item); ui_->subspeciesList->editItem(item); } Species SpeciesDialog::getSpecies() { Species species; return species; } #include "../../include/fish_detector/common/moc_species_dialog.cpp" } // namespace fish_detector
namespace fish_detector { SpeciesDialog::SpeciesDialog(QWidget *parent) : QDialog(parent) , ui_(new Ui::SpeciesDialog) { ui_->setupUi(this); } void SpeciesDialog::on_ok_clicked() { + accept(); } void SpeciesDialog::on_cancel_clicked() { + reject(); } void SpeciesDialog::on_removeSubspecies_clicked() { + QListWidgetItem *current = ui_->subspeciesList->currentItem(); + if(current != nullptr) { + delete current; + } } void SpeciesDialog::on_addSubspecies_clicked() { + QListWidgetItem *item = new QListWidgetItem("New subspecies"); + item->setFlags(item->flags() | Qt::ItemIsEditable); + ui_->subspeciesList->addItem(item); + ui_->subspeciesList->editItem(item); } Species SpeciesDialog::getSpecies() { Species species; return species; } #include "../../include/fish_detector/common/moc_species_dialog.cpp" } // namespace fish_detector
10
0.344828
10
0
b8a79d0b4f1549ec1c34896e2923b43ca1e792c8
modules/django.rb
modules/django.rb
set :python, "python" set :django_project_subdirectory, "project" depend :remote, :command, "#{python}" def django_manage(cmd, path="#{latest_release}") run "cd #{path}/#{django_project_subdirectory}; #{python} manage.py #{cmd}" end namespace :django do desc "Run manage.py syncdb in latest release." task :syncdb do django_manage "syncdb" end desc "Run custom Django management command in latest release." task :manage do set_from_env_or_ask :command, "Enter management command" django_manage "#{command}" end end after "deploy:update", "django:syncdb"
set :python, "python" set :django_project_subdirectory, "project" depend :remote, :command, "#{python}" def django_manage(cmd, path="#{latest_release}") run "cd #{path}/#{django_project_subdirectory}; #{python} manage.py #{cmd}" end namespace :django do desc "Run manage.py syncdb in latest release." task :syncdb do django_manage "syncdb" end desc "Run custom Django management command in latest release." task :manage do set_from_env_or_ask :command, "Enter management command" django_manage "#{command}" end end after "deploy:update", "django:syncdb" # depend :remote, :python_module, "module_name" # runs #{python} and tries to import module_name. class Capistrano::Deploy::RemoteDependency def python_module(module_name, options={}) @message ||= "Cannot import `#{module_name}'" python = configuration.fetch(:python, "python") try("#{python} -c 'import #{module_name}'", options) self end end
Support for `depend :remote, :python_module, "module_name"' statement.
Support for `depend :remote, :python_module, "module_name"' statement.
Ruby
bsd-3-clause
pomeo/capistrano-offroad,mpasternacki/capistrano-offroad
ruby
## Code Before: set :python, "python" set :django_project_subdirectory, "project" depend :remote, :command, "#{python}" def django_manage(cmd, path="#{latest_release}") run "cd #{path}/#{django_project_subdirectory}; #{python} manage.py #{cmd}" end namespace :django do desc "Run manage.py syncdb in latest release." task :syncdb do django_manage "syncdb" end desc "Run custom Django management command in latest release." task :manage do set_from_env_or_ask :command, "Enter management command" django_manage "#{command}" end end after "deploy:update", "django:syncdb" ## Instruction: Support for `depend :remote, :python_module, "module_name"' statement. ## Code After: set :python, "python" set :django_project_subdirectory, "project" depend :remote, :command, "#{python}" def django_manage(cmd, path="#{latest_release}") run "cd #{path}/#{django_project_subdirectory}; #{python} manage.py #{cmd}" end namespace :django do desc "Run manage.py syncdb in latest release." task :syncdb do django_manage "syncdb" end desc "Run custom Django management command in latest release." task :manage do set_from_env_or_ask :command, "Enter management command" django_manage "#{command}" end end after "deploy:update", "django:syncdb" # depend :remote, :python_module, "module_name" # runs #{python} and tries to import module_name. class Capistrano::Deploy::RemoteDependency def python_module(module_name, options={}) @message ||= "Cannot import `#{module_name}'" python = configuration.fetch(:python, "python") try("#{python} -c 'import #{module_name}'", options) self end end
set :python, "python" set :django_project_subdirectory, "project" depend :remote, :command, "#{python}" def django_manage(cmd, path="#{latest_release}") run "cd #{path}/#{django_project_subdirectory}; #{python} manage.py #{cmd}" end namespace :django do desc "Run manage.py syncdb in latest release." task :syncdb do django_manage "syncdb" end desc "Run custom Django management command in latest release." task :manage do set_from_env_or_ask :command, "Enter management command" django_manage "#{command}" end end after "deploy:update", "django:syncdb" + + # depend :remote, :python_module, "module_name" + # runs #{python} and tries to import module_name. + class Capistrano::Deploy::RemoteDependency + def python_module(module_name, options={}) + @message ||= "Cannot import `#{module_name}'" + python = configuration.fetch(:python, "python") + try("#{python} -c 'import #{module_name}'", options) + self + end + end
11
0.44
11
0
c34c77c764491460449a6bef06b2149c3ab82f2d
src/test/debuginfo/function-arguments-naked.rs
src/test/debuginfo/function-arguments-naked.rs
// min-lldb-version: 310 // We have to ignore android because of this issue: // https://github.com/rust-lang/rust/issues/74847 // ignore-android // // We need to use inline assembly, so just use one platform // only-x86_64 // compile-flags:-g // === GDB TESTS =================================================================================== // gdb-command:run // gdb-command:info args // gdb-check:No arguments. // gdb-command:continue // === LLDB TESTS ================================================================================== // lldb-command:run // lldb-command:frame variable // lldbg-check:(unsigned long) = 111 (unsigned long) = 222 // lldbr-check:(unsigned long) = 111 (unsigned long) = 222 // lldb-command:continue #![feature(asm)] #![feature(naked_functions)] #![feature(omit_gdb_pretty_printer_section)] #![omit_gdb_pretty_printer_section] fn main() { naked(111, 222); } #[naked] fn naked(x: usize, y: usize) { unsafe { asm!("ret"); } // #break }
// min-lldb-version: 310 // We have to ignore android because of this issue: // https://github.com/rust-lang/rust/issues/74847 // ignore-android // // We need to use inline assembly, so just use one platform // only-x86_64 // compile-flags:-g // === GDB TESTS =================================================================================== // gdb-command:run // gdb-command:info args // gdb-check:No arguments. // gdb-command:continue // === LLDB TESTS ================================================================================== // lldb-command:run // lldb-command:frame variable // lldbg-check:(unsigned long) = 111 (unsigned long) = 222 // lldbr-check:(unsigned long) = 111 (unsigned long) = 222 // lldb-command:continue #![feature(asm)] #![feature(naked_functions)] #![feature(omit_gdb_pretty_printer_section)] #![omit_gdb_pretty_printer_section] fn main() { naked(111, 222); } #[naked] extern "C" fn naked(x: usize, y: usize) { unsafe { asm!("ret"); } // #break }
Apply `extern "C"` calling convention
Apply `extern "C"` calling convention Co-authored-by: Amanieu d'Antras <92db609b8007e8ad5e633f1530d9df21d90665f4@gmail.com>
Rust
apache-2.0
aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust
rust
## Code Before: // min-lldb-version: 310 // We have to ignore android because of this issue: // https://github.com/rust-lang/rust/issues/74847 // ignore-android // // We need to use inline assembly, so just use one platform // only-x86_64 // compile-flags:-g // === GDB TESTS =================================================================================== // gdb-command:run // gdb-command:info args // gdb-check:No arguments. // gdb-command:continue // === LLDB TESTS ================================================================================== // lldb-command:run // lldb-command:frame variable // lldbg-check:(unsigned long) = 111 (unsigned long) = 222 // lldbr-check:(unsigned long) = 111 (unsigned long) = 222 // lldb-command:continue #![feature(asm)] #![feature(naked_functions)] #![feature(omit_gdb_pretty_printer_section)] #![omit_gdb_pretty_printer_section] fn main() { naked(111, 222); } #[naked] fn naked(x: usize, y: usize) { unsafe { asm!("ret"); } // #break } ## Instruction: Apply `extern "C"` calling convention Co-authored-by: Amanieu d'Antras <92db609b8007e8ad5e633f1530d9df21d90665f4@gmail.com> ## Code After: // min-lldb-version: 310 // We have to ignore android because of this issue: // https://github.com/rust-lang/rust/issues/74847 // ignore-android // // We need to use inline assembly, so just use one platform // only-x86_64 // compile-flags:-g // === GDB TESTS =================================================================================== // gdb-command:run // gdb-command:info args // gdb-check:No arguments. // gdb-command:continue // === LLDB TESTS ================================================================================== // lldb-command:run // lldb-command:frame variable // lldbg-check:(unsigned long) = 111 (unsigned long) = 222 // lldbr-check:(unsigned long) = 111 (unsigned long) = 222 // lldb-command:continue #![feature(asm)] #![feature(naked_functions)] #![feature(omit_gdb_pretty_printer_section)] #![omit_gdb_pretty_printer_section] fn main() { naked(111, 222); } #[naked] extern "C" fn naked(x: usize, y: usize) { unsafe { asm!("ret"); } // #break }
// min-lldb-version: 310 // We have to ignore android because of this issue: // https://github.com/rust-lang/rust/issues/74847 // ignore-android // // We need to use inline assembly, so just use one platform // only-x86_64 // compile-flags:-g // === GDB TESTS =================================================================================== // gdb-command:run // gdb-command:info args // gdb-check:No arguments. // gdb-command:continue // === LLDB TESTS ================================================================================== // lldb-command:run // lldb-command:frame variable // lldbg-check:(unsigned long) = 111 (unsigned long) = 222 // lldbr-check:(unsigned long) = 111 (unsigned long) = 222 // lldb-command:continue #![feature(asm)] #![feature(naked_functions)] #![feature(omit_gdb_pretty_printer_section)] #![omit_gdb_pretty_printer_section] fn main() { naked(111, 222); } #[naked] - fn naked(x: usize, y: usize) { + extern "C" fn naked(x: usize, y: usize) { ? +++++++++++ unsafe { asm!("ret"); } // #break }
2
0.047619
1
1
fadf8a1556be8e4b2a7f004a808e45f84bbb03b3
indexing/transformations/latitude-longitude.js
indexing/transformations/latitude-longitude.js
'use strict'; module.exports = metadata => { var coordinates; if (metadata.google_maps_coordinates) { coordinates = metadata.google_maps_coordinates; metadata.location_is_approximate = false; } else if (metadata.google_maps_coordinates_crowd) { coordinates = metadata.google_maps_coordinates_crowd; metadata.location_is_approximate = false; } else if (metadata.google_maps_coordinates_approximate) { coordinates = metadata.google_maps_coordinates_approximate; metadata.location_is_approximate = true; } if (coordinates) { coordinates = coordinates.split(',').map(parseFloat); if (coordinates.length >= 2) { metadata.latitude = coordinates[0]; metadata.longitude = coordinates[1]; } else { throw new Error('Encountered unexpected coordinate format.'); } } return metadata; };
'use strict'; module.exports = metadata => { var coordinates; if (metadata.google_maps_coordinates) { coordinates = metadata.google_maps_coordinates; metadata.location_is_approximate = false; } else if (metadata.google_maps_coordinates_crowd) { coordinates = metadata.google_maps_coordinates_crowd; metadata.location_is_approximate = false; } else if (metadata.google_maps_coordinates_approximate) { coordinates = metadata.google_maps_coordinates_approximate; metadata.location_is_approximate = true; } if (coordinates) { coordinates = coordinates.split(',').map(parseFloat); if (coordinates.length >= 2) { metadata.latitude = coordinates[0]; metadata.longitude = coordinates[1]; } else { throw new Error('Encountered unexpected coordinate format.'); } } // Index into if (metadata.latitude && metadata.longitude) { metadata.location = { "lat": metadata.latitude, "lon": metadata.longitude } } return metadata; };
Index location into a geopoint
Index location into a geopoint The geopoint is a geolocation type which amongst other things supports geohashing. KB-351
JavaScript
mit
CopenhagenCityArchives/kbh-billeder,CopenhagenCityArchives/kbh-billeder,CopenhagenCityArchives/kbh-billeder
javascript
## Code Before: 'use strict'; module.exports = metadata => { var coordinates; if (metadata.google_maps_coordinates) { coordinates = metadata.google_maps_coordinates; metadata.location_is_approximate = false; } else if (metadata.google_maps_coordinates_crowd) { coordinates = metadata.google_maps_coordinates_crowd; metadata.location_is_approximate = false; } else if (metadata.google_maps_coordinates_approximate) { coordinates = metadata.google_maps_coordinates_approximate; metadata.location_is_approximate = true; } if (coordinates) { coordinates = coordinates.split(',').map(parseFloat); if (coordinates.length >= 2) { metadata.latitude = coordinates[0]; metadata.longitude = coordinates[1]; } else { throw new Error('Encountered unexpected coordinate format.'); } } return metadata; }; ## Instruction: Index location into a geopoint The geopoint is a geolocation type which amongst other things supports geohashing. KB-351 ## Code After: 'use strict'; module.exports = metadata => { var coordinates; if (metadata.google_maps_coordinates) { coordinates = metadata.google_maps_coordinates; metadata.location_is_approximate = false; } else if (metadata.google_maps_coordinates_crowd) { coordinates = metadata.google_maps_coordinates_crowd; metadata.location_is_approximate = false; } else if (metadata.google_maps_coordinates_approximate) { coordinates = metadata.google_maps_coordinates_approximate; metadata.location_is_approximate = true; } if (coordinates) { coordinates = coordinates.split(',').map(parseFloat); if (coordinates.length >= 2) { metadata.latitude = coordinates[0]; metadata.longitude = coordinates[1]; } else { throw new Error('Encountered unexpected coordinate format.'); } } // Index into if (metadata.latitude && metadata.longitude) { metadata.location = { "lat": metadata.latitude, "lon": metadata.longitude } } return metadata; };
'use strict'; module.exports = metadata => { var coordinates; if (metadata.google_maps_coordinates) { coordinates = metadata.google_maps_coordinates; metadata.location_is_approximate = false; } else if (metadata.google_maps_coordinates_crowd) { coordinates = metadata.google_maps_coordinates_crowd; metadata.location_is_approximate = false; } else if (metadata.google_maps_coordinates_approximate) { coordinates = metadata.google_maps_coordinates_approximate; metadata.location_is_approximate = true; } if (coordinates) { coordinates = coordinates.split(',').map(parseFloat); if (coordinates.length >= 2) { metadata.latitude = coordinates[0]; metadata.longitude = coordinates[1]; } else { throw new Error('Encountered unexpected coordinate format.'); } } + // Index into + if (metadata.latitude && metadata.longitude) { + metadata.location = { + "lat": metadata.latitude, + "lon": metadata.longitude + } + } + return metadata; };
8
0.307692
8
0
053fe71ada3d02f737ea289f1399ff3c05783332
app/assets/javascripts/pageflow/editor/models/mixins/delayed_destroying.js
app/assets/javascripts/pageflow/editor/models/mixins/delayed_destroying.js
pageflow.delayedDestroying = { initialize: function() { this._destroying = false; }, destroyWithDelay: function() { var model = this; this.trigger('destroying', this); this._destroying = true; return Backbone.Model.prototype.destroy.call(this, { wait: true, success: function() { model._destroying = false; }, error: function() { model._destroying = false; } }); }, isDestroying: function() { return this._destroying; } };
pageflow.delayedDestroying = { initialize: function() { this._destroying = false; }, destroyWithDelay: function() { var model = this; this._destroying = true; this.trigger('destroying', this); return Backbone.Model.prototype.destroy.call(this, { wait: true, success: function() { model._destroying = false; }, error: function() { model._destroying = false; } }); }, isDestroying: function() { return this._destroying; } };
Set isDestroying before triggering destroying Event
Set isDestroying before triggering destroying Event
JavaScript
mit
tilsammans/pageflow,tf/pageflow,schoetty/pageflow,tilsammans/pageflow,grgr/pageflow,BenHeubl/pageflow,tf/pageflow-dependabot-test,tf/pageflow,tilsammans/pageflow,grgr/pageflow,Modularfield/pageflow,Modularfield/pageflow,tf/pageflow-dependabot-test,luatdolphin/pageflow,Modularfield/pageflow,YoussefChafai/pageflow,YoussefChafai/pageflow,codevise/pageflow,YoussefChafai/pageflow,BenHeubl/pageflow,grgr/pageflow,tf/pageflow,schoetty/pageflow,codevise/pageflow,tilsammans/pageflow,tf/pageflow-dependabot-test,tf/pageflow-dependabot-test,Modularfield/pageflow,luatdolphin/pageflow,tf/pageflow,schoetty/pageflow,BenHeubl/pageflow,codevise/pageflow,codevise/pageflow,luatdolphin/pageflow
javascript
## Code Before: pageflow.delayedDestroying = { initialize: function() { this._destroying = false; }, destroyWithDelay: function() { var model = this; this.trigger('destroying', this); this._destroying = true; return Backbone.Model.prototype.destroy.call(this, { wait: true, success: function() { model._destroying = false; }, error: function() { model._destroying = false; } }); }, isDestroying: function() { return this._destroying; } }; ## Instruction: Set isDestroying before triggering destroying Event ## Code After: pageflow.delayedDestroying = { initialize: function() { this._destroying = false; }, destroyWithDelay: function() { var model = this; this._destroying = true; this.trigger('destroying', this); return Backbone.Model.prototype.destroy.call(this, { wait: true, success: function() { model._destroying = false; }, error: function() { model._destroying = false; } }); }, isDestroying: function() { return this._destroying; } };
pageflow.delayedDestroying = { initialize: function() { this._destroying = false; }, destroyWithDelay: function() { var model = this; + this._destroying = true; this.trigger('destroying', this); - this._destroying = true; return Backbone.Model.prototype.destroy.call(this, { wait: true, success: function() { model._destroying = false; }, error: function() { model._destroying = false; } }); }, isDestroying: function() { return this._destroying; } };
2
0.076923
1
1
eef52291e236e0bb5bf52101e3d125948811a7d7
composer.json
composer.json
{ "name": "davedevelopment/phpmig", "type": "library", "description": "Simple migrations system for php", "keywords": ["migrations", "database migrations"], "homepage": "http://github.com/davedevelopment/phpmig", "license": "MIT", "authors": [{ "name": "Dave Marshall", "email": "dave.marshall@atstsolutions.co.uk", "homepage": "http://davedevelopment.co.uk" }, { "name": "David Nielsen", "email": "david@panmedia.co.nz" }], "require": { "php": ">=5.3.2", "symfony/console": "2.*", "symfony/yaml": "2.*", "symfony/config": "2.*", "symfony/class-loader": "2.*" }, "require-dev": { "phpunit/phpunit": "3.*", "mockery/mockery": "*@dev" }, "suggest": { "pimple/pimple": "Pimple allows to bootstrap phpmig really easily." }, "autoload": { "psr-0": { "Phpmig": "src/" } }, "bin": ["bin/phpmig"], "extra": { "branch-alias": { "dev-master": "1.2.x-dev" } } }
{ "name": "davedevelopment/phpmig", "type": "library", "description": "Simple migrations system for php", "keywords": ["migrations", "database migrations"], "homepage": "http://github.com/davedevelopment/phpmig", "license": "MIT", "authors": [{ "name": "Dave Marshall", "email": "dave.marshall@atstsolutions.co.uk", "homepage": "http://davedevelopment.co.uk" }, { "name": "David Nielsen", "email": "david@panmedia.co.nz" }], "require": { "php": ">=5.3.2", "symfony/console": "^2||^3", "symfony/yaml": "^2||^3", "symfony/config": "^2||^3", "symfony/class-loader": "^2||^3" }, "require-dev": { "phpunit/phpunit": "3.*", "mockery/mockery": "*@dev" }, "suggest": { "pimple/pimple": "Pimple allows to bootstrap phpmig really easily." }, "autoload": { "psr-0": { "Phpmig": "src/" } }, "bin": ["bin/phpmig"], "extra": { "branch-alias": { "dev-master": "1.2.x-dev" } } }
Add symfony v3 and up to dependency ranges
Add symfony v3 and up to dependency ranges Trying to do composer require doesn't work when I am already depending on symfony ^3. Hope this is an ok fix.
JSON
mit
kuwa72/phpmig
json
## Code Before: { "name": "davedevelopment/phpmig", "type": "library", "description": "Simple migrations system for php", "keywords": ["migrations", "database migrations"], "homepage": "http://github.com/davedevelopment/phpmig", "license": "MIT", "authors": [{ "name": "Dave Marshall", "email": "dave.marshall@atstsolutions.co.uk", "homepage": "http://davedevelopment.co.uk" }, { "name": "David Nielsen", "email": "david@panmedia.co.nz" }], "require": { "php": ">=5.3.2", "symfony/console": "2.*", "symfony/yaml": "2.*", "symfony/config": "2.*", "symfony/class-loader": "2.*" }, "require-dev": { "phpunit/phpunit": "3.*", "mockery/mockery": "*@dev" }, "suggest": { "pimple/pimple": "Pimple allows to bootstrap phpmig really easily." }, "autoload": { "psr-0": { "Phpmig": "src/" } }, "bin": ["bin/phpmig"], "extra": { "branch-alias": { "dev-master": "1.2.x-dev" } } } ## Instruction: Add symfony v3 and up to dependency ranges Trying to do composer require doesn't work when I am already depending on symfony ^3. Hope this is an ok fix. ## Code After: { "name": "davedevelopment/phpmig", "type": "library", "description": "Simple migrations system for php", "keywords": ["migrations", "database migrations"], "homepage": "http://github.com/davedevelopment/phpmig", "license": "MIT", "authors": [{ "name": "Dave Marshall", "email": "dave.marshall@atstsolutions.co.uk", "homepage": "http://davedevelopment.co.uk" }, { "name": "David Nielsen", "email": "david@panmedia.co.nz" }], "require": { "php": ">=5.3.2", "symfony/console": "^2||^3", "symfony/yaml": "^2||^3", "symfony/config": "^2||^3", "symfony/class-loader": "^2||^3" }, "require-dev": { "phpunit/phpunit": "3.*", "mockery/mockery": "*@dev" }, "suggest": { "pimple/pimple": "Pimple allows to bootstrap phpmig really easily." }, "autoload": { "psr-0": { "Phpmig": "src/" } }, "bin": ["bin/phpmig"], "extra": { "branch-alias": { "dev-master": "1.2.x-dev" } } }
{ "name": "davedevelopment/phpmig", "type": "library", "description": "Simple migrations system for php", "keywords": ["migrations", "database migrations"], "homepage": "http://github.com/davedevelopment/phpmig", "license": "MIT", "authors": [{ "name": "Dave Marshall", "email": "dave.marshall@atstsolutions.co.uk", "homepage": "http://davedevelopment.co.uk" }, { "name": "David Nielsen", "email": "david@panmedia.co.nz" }], "require": { "php": ">=5.3.2", - "symfony/console": "2.*", ? ^^ + "symfony/console": "^2||^3", ? + ^^^^ - "symfony/yaml": "2.*", ? ^^ + "symfony/yaml": "^2||^3", ? + ^^^^ - "symfony/config": "2.*", ? ^^ + "symfony/config": "^2||^3", ? + ^^^^ - "symfony/class-loader": "2.*" ? ^^ + "symfony/class-loader": "^2||^3" ? + ^^^^ }, "require-dev": { "phpunit/phpunit": "3.*", "mockery/mockery": "*@dev" }, "suggest": { "pimple/pimple": "Pimple allows to bootstrap phpmig really easily." }, "autoload": { "psr-0": { "Phpmig": "src/" } }, "bin": ["bin/phpmig"], "extra": { "branch-alias": { "dev-master": "1.2.x-dev" } } }
8
0.190476
4
4
e7ac4ebe5b23fbb3d80c3119c50297acb71feae4
lib/init.php
lib/init.php
<?php /** * Shoestrap initial setup and constants */ function shoestrap_setup() { // Make theme available for translation load_theme_textdomain( 'shoestrap', get_template_directory() . '/lang' ); // Register wp_nav_menu() menus ( http://codex.wordpress.org/Function_Reference/register_nav_menus ) register_nav_menus( array( 'primary_navigation' => __( 'Primary Navigation', 'shoestrap' ), 'secondary_navigation' => __( 'Secondary Navigation', 'shoestrap' ), ) ); // Add post thumbnails ( http://codex.wordpress.org/Post_Thumbnails ) add_theme_support( 'post-thumbnails' ); // Add post formats ( http://codex.wordpress.org/Post_Formats ) add_theme_support( 'post-formats', array( 'aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat' ) ); add_theme_support( 'automatic-feed-links' ); // Tell the TinyMCE editor to use a custom stylesheet add_editor_style( '/assets/css/editor-style.css' ); } add_action( 'after_setup_theme', 'shoestrap_setup' );
<?php /** * Shoestrap initial setup and constants */ function shoestrap_setup() { // Make theme available for translation load_theme_textdomain( 'shoestrap', get_template_directory() . '/lang' ); // Register wp_nav_menu() menus ( http://codex.wordpress.org/Function_Reference/register_nav_menus ) register_nav_menus( array( 'primary_navigation' => __( 'Primary Navigation', 'shoestrap' ), 'secondary_navigation' => __( 'Secondary Navigation', 'shoestrap' ), ) ); // Add post thumbnails ( http://codex.wordpress.org/Post_Thumbnails ) add_theme_support( 'post-thumbnails' ); // Add post formats ( http://codex.wordpress.org/Post_Formats ) add_theme_support( 'post-formats', array( 'aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat' ) ); add_theme_support( 'automatic-feed-links' ); add_theme_support( 'html5', array( 'gallery', 'caption' ) ); // Tell the TinyMCE editor to use a custom stylesheet add_editor_style( '/assets/css/editor-style.css' ); } add_action( 'after_setup_theme', 'shoestrap_setup' );
Add suport for HTML5 Galleries & Captions
Add suport for HTML5 Galleries & Captions See http://make.wordpress.org/core/2014/04/15/html5-galleries-captions- in-wordpress-3-9/ for mor details
PHP
mit
cadr-sa/shoestrap-3,theportlandcompany/shoestrap-3,shoestrap/shoestrap-3,theportlandcompany/shoestrap-3,shoestrap/shoestrap-3,cadr-sa/shoestrap-3
php
## Code Before: <?php /** * Shoestrap initial setup and constants */ function shoestrap_setup() { // Make theme available for translation load_theme_textdomain( 'shoestrap', get_template_directory() . '/lang' ); // Register wp_nav_menu() menus ( http://codex.wordpress.org/Function_Reference/register_nav_menus ) register_nav_menus( array( 'primary_navigation' => __( 'Primary Navigation', 'shoestrap' ), 'secondary_navigation' => __( 'Secondary Navigation', 'shoestrap' ), ) ); // Add post thumbnails ( http://codex.wordpress.org/Post_Thumbnails ) add_theme_support( 'post-thumbnails' ); // Add post formats ( http://codex.wordpress.org/Post_Formats ) add_theme_support( 'post-formats', array( 'aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat' ) ); add_theme_support( 'automatic-feed-links' ); // Tell the TinyMCE editor to use a custom stylesheet add_editor_style( '/assets/css/editor-style.css' ); } add_action( 'after_setup_theme', 'shoestrap_setup' ); ## Instruction: Add suport for HTML5 Galleries & Captions See http://make.wordpress.org/core/2014/04/15/html5-galleries-captions- in-wordpress-3-9/ for mor details ## Code After: <?php /** * Shoestrap initial setup and constants */ function shoestrap_setup() { // Make theme available for translation load_theme_textdomain( 'shoestrap', get_template_directory() . '/lang' ); // Register wp_nav_menu() menus ( http://codex.wordpress.org/Function_Reference/register_nav_menus ) register_nav_menus( array( 'primary_navigation' => __( 'Primary Navigation', 'shoestrap' ), 'secondary_navigation' => __( 'Secondary Navigation', 'shoestrap' ), ) ); // Add post thumbnails ( http://codex.wordpress.org/Post_Thumbnails ) add_theme_support( 'post-thumbnails' ); // Add post formats ( http://codex.wordpress.org/Post_Formats ) add_theme_support( 'post-formats', array( 'aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat' ) ); add_theme_support( 'automatic-feed-links' ); add_theme_support( 'html5', array( 'gallery', 'caption' ) ); // Tell the TinyMCE editor to use a custom stylesheet add_editor_style( '/assets/css/editor-style.css' ); } add_action( 'after_setup_theme', 'shoestrap_setup' );
<?php /** * Shoestrap initial setup and constants */ function shoestrap_setup() { // Make theme available for translation load_theme_textdomain( 'shoestrap', get_template_directory() . '/lang' ); // Register wp_nav_menu() menus ( http://codex.wordpress.org/Function_Reference/register_nav_menus ) - register_nav_menus( array( ? - + register_nav_menus( array( 'primary_navigation' => __( 'Primary Navigation', 'shoestrap' ), 'secondary_navigation' => __( 'Secondary Navigation', 'shoestrap' ), ) ); // Add post thumbnails ( http://codex.wordpress.org/Post_Thumbnails ) add_theme_support( 'post-thumbnails' ); // Add post formats ( http://codex.wordpress.org/Post_Formats ) add_theme_support( 'post-formats', array( 'aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat' ) ); add_theme_support( 'automatic-feed-links' ); + add_theme_support( 'html5', array( 'gallery', 'caption' ) ); + // Tell the TinyMCE editor to use a custom stylesheet add_editor_style( '/assets/css/editor-style.css' ); } add_action( 'after_setup_theme', 'shoestrap_setup' );
4
0.153846
3
1
0599961b1509d7b8e0bec310b40a62f11a55cc8f
src/tagversion/entrypoints.py
src/tagversion/entrypoints.py
import logging import sys from tagversion.argparse import ArgumentParser from tagversion.git import GitVersion from tagversion.write import WriteFile def main(): logging.basicConfig(level=logging.WARNING) parser = ArgumentParser() subcommand = parser.add_subparsers(dest='subcommand') GitVersion.setup_subparser(subcommand) WriteFile.setup_subparser(subcommand) args = parser.parse_args(default_subparser='version') command = args.cls(args) sys.exit(command.run())
import logging import os import sys from tagversion.argparse import ArgumentParser from tagversion.git import GitVersion from tagversion.write import WriteFile LOG_LEVEL = os.environ.get('LOG_LEVEL', 'warning') def main(): logging.basicConfig(level=getattr(logging, LOG_LEVEL.upper())) parser = ArgumentParser() subcommand = parser.add_subparsers(dest='subcommand') GitVersion.setup_subparser(subcommand) WriteFile.setup_subparser(subcommand) args = parser.parse_args(default_subparser='version') command = args.cls(args) sys.exit(command.run())
Allow log level to be changed via environment variable
Allow log level to be changed via environment variable
Python
bsd-2-clause
rca/tag-version,rca/tag-version
python
## Code Before: import logging import sys from tagversion.argparse import ArgumentParser from tagversion.git import GitVersion from tagversion.write import WriteFile def main(): logging.basicConfig(level=logging.WARNING) parser = ArgumentParser() subcommand = parser.add_subparsers(dest='subcommand') GitVersion.setup_subparser(subcommand) WriteFile.setup_subparser(subcommand) args = parser.parse_args(default_subparser='version') command = args.cls(args) sys.exit(command.run()) ## Instruction: Allow log level to be changed via environment variable ## Code After: import logging import os import sys from tagversion.argparse import ArgumentParser from tagversion.git import GitVersion from tagversion.write import WriteFile LOG_LEVEL = os.environ.get('LOG_LEVEL', 'warning') def main(): logging.basicConfig(level=getattr(logging, LOG_LEVEL.upper())) parser = ArgumentParser() subcommand = parser.add_subparsers(dest='subcommand') GitVersion.setup_subparser(subcommand) WriteFile.setup_subparser(subcommand) args = parser.parse_args(default_subparser='version') command = args.cls(args) sys.exit(command.run())
import logging + import os import sys from tagversion.argparse import ArgumentParser from tagversion.git import GitVersion from tagversion.write import WriteFile + LOG_LEVEL = os.environ.get('LOG_LEVEL', 'warning') + def main(): - logging.basicConfig(level=logging.WARNING) + logging.basicConfig(level=getattr(logging, LOG_LEVEL.upper())) parser = ArgumentParser() subcommand = parser.add_subparsers(dest='subcommand') GitVersion.setup_subparser(subcommand) WriteFile.setup_subparser(subcommand) args = parser.parse_args(default_subparser='version') command = args.cls(args) sys.exit(command.run())
5
0.238095
4
1
9bf795e93f0373627f4aa7524e8904b9e45913c8
_layouts/posts.html
_layouts/posts.html
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us"> {% include head.html %} <body class="pure-g"> <div class="pure-u-1-5"> {% include side-pane.html %} </div> <div class="pure-u-4-5"> {{ content }} </div> </body> </html>
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us"> {% include head.html %} <body class="pure-g"> <div class="pure-u-1-5"> {% include side-pane.html %} </div> <div class="pure-u-4-5"> <div id="content"> <h1> {{ post.date || date_to_string }} <//h1> {{ content }} </div> </div> </body> </html>
Add post date a meeting minute title
Add post date a meeting minute title
HTML
mit
acm-ndsu/acm-ndsu.github.io,acm-ndsu/acm-ndsu.github.io,acm-ndsu/NDSU-ACM-Website,acm-ndsu/NDSU-ACM-Website,acm-ndsu/acm-ndsu.github.io,acm-ndsu/NDSU-ACM-Website
html
## Code Before: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us"> {% include head.html %} <body class="pure-g"> <div class="pure-u-1-5"> {% include side-pane.html %} </div> <div class="pure-u-4-5"> {{ content }} </div> </body> </html> ## Instruction: Add post date a meeting minute title ## Code After: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us"> {% include head.html %} <body class="pure-g"> <div class="pure-u-1-5"> {% include side-pane.html %} </div> <div class="pure-u-4-5"> <div id="content"> <h1> {{ post.date || date_to_string }} <//h1> {{ content }} </div> </div> </body> </html>
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us"> {% include head.html %} <body class="pure-g"> <div class="pure-u-1-5"> {% include side-pane.html %} </div> <div class="pure-u-4-5"> + <div id="content"> + <h1> + {{ post.date || date_to_string }} + <//h1> - {{ content }} + {{ content }} ? ++++ + </div> </div> </body> </html>
7
0.5
6
1
83e8d43369df0834ca1826704a9066192b4d7d1a
.travis.yml
.travis.yml
language: python dist: trusty python: - "2.7" install: - pip install requests configargparse bcrypt - pip install coverage nose script: - nosetests --with-coverage --cover-xml --cover-package=xclib after_success: - bash <(curl -s https://codecov.io/bash)
language: python dist: trusty sudo: required python: - "3.5" install: - sudo apt install libdb5.3-dev - pip install requests configargparse bcrypt bsddb3 - pip install coverage nose rednose script: - nosetests --with-coverage --cover-xml --cover-package=xclib after_success: - bash <(curl -s https://codecov.io/bash)
Switch Travis to Python 3
Switch Travis to Python 3
YAML
mit
jsxc/xmpp-cloud-auth,jsxc/xmpp-cloud-auth,jsxc/xmpp-cloud-auth,jsxc/xmpp-cloud-auth
yaml
## Code Before: language: python dist: trusty python: - "2.7" install: - pip install requests configargparse bcrypt - pip install coverage nose script: - nosetests --with-coverage --cover-xml --cover-package=xclib after_success: - bash <(curl -s https://codecov.io/bash) ## Instruction: Switch Travis to Python 3 ## Code After: language: python dist: trusty sudo: required python: - "3.5" install: - sudo apt install libdb5.3-dev - pip install requests configargparse bcrypt bsddb3 - pip install coverage nose rednose script: - nosetests --with-coverage --cover-xml --cover-package=xclib after_success: - bash <(curl -s https://codecov.io/bash)
language: python dist: trusty + sudo: required python: - - "2.7" ? ^ ^ + - "3.5" ? ^ ^ install: + - sudo apt install libdb5.3-dev - - pip install requests configargparse bcrypt + - pip install requests configargparse bcrypt bsddb3 ? +++++++ - - pip install coverage nose + - pip install coverage nose rednose ? ++++++++ script: - nosetests --with-coverage --cover-xml --cover-package=xclib after_success: - - bash <(curl -s https://codecov.io/bash) ? -- + - bash <(curl -s https://codecov.io/bash)
10
0.625
6
4
4e80dc0844b18598822fedd2ce9edafd40ec1a3a
.travis.yml
.travis.yml
language: python python: - "3.3" - "3.4" install: - pip install 'django-oscar>=0.7' - pip install -r requirements.txt env: - PYTHONPATH=.:$PYTHONPATH script: py.test tests
language: python python: - "3.3" - "3.4" env: global: - PYTHONPATH=.:$PYTHONPATH matrix: - DJANGO=Django==1.7.8 OSCAR=django-oscar==1.0.2 - DJANGO=Django==1.7.8 OSCAR=django-oscar==1.1 - DJANGO=Django==1.8.2 OSCAR=django-oscar==1.1 install: - pip install $DJANGO $OSCAR - pip install -r requirements.txt script: py.test tests
Test against multiple versions of Oscar and Django
Test against multiple versions of Oscar and Django To anticipate migrating to Oscar 1.1 and Django 1.8, let's run the tests on Travis already.
YAML
bsd-3-clause
django-oscar/django-oscar-adyen,oscaro/django-oscar-adyen
yaml
## Code Before: language: python python: - "3.3" - "3.4" install: - pip install 'django-oscar>=0.7' - pip install -r requirements.txt env: - PYTHONPATH=.:$PYTHONPATH script: py.test tests ## Instruction: Test against multiple versions of Oscar and Django To anticipate migrating to Oscar 1.1 and Django 1.8, let's run the tests on Travis already. ## Code After: language: python python: - "3.3" - "3.4" env: global: - PYTHONPATH=.:$PYTHONPATH matrix: - DJANGO=Django==1.7.8 OSCAR=django-oscar==1.0.2 - DJANGO=Django==1.7.8 OSCAR=django-oscar==1.1 - DJANGO=Django==1.8.2 OSCAR=django-oscar==1.1 install: - pip install $DJANGO $OSCAR - pip install -r requirements.txt script: py.test tests
language: python python: - "3.3" - "3.4" + env: + global: + - PYTHONPATH=.:$PYTHONPATH + matrix: + - DJANGO=Django==1.7.8 OSCAR=django-oscar==1.0.2 + - DJANGO=Django==1.7.8 OSCAR=django-oscar==1.1 + - DJANGO=Django==1.8.2 OSCAR=django-oscar==1.1 + install: - - pip install 'django-oscar>=0.7' + - pip install $DJANGO $OSCAR - pip install -r requirements.txt - env: - - PYTHONPATH=.:$PYTHONPATH - script: py.test tests
13
0.928571
9
4
d972f243de0a5c935128922a7f736ea409490943
situational/apps/sectors/templates/sectors/job_descriptions.html
situational/apps/sectors/templates/sectors/job_descriptions.html
{% extends "base.html" %} {% block title %}Understand what sort of jobs you could do{% endblock title %} {% block content %} <style> .result-item { border-top: 1px solid #DFDFDF; margin-top: 0.5rem; padding-top: 0.5rem; } .result-item h4 input { margin-bottom: 0; vertical-align: middle; } </style> <div class="row"> <div class="columns"> <h1>Select jobs you'd like to know more about</h1> </div> </div> <form id="results" method=post> {{ form.errors }} {% csrf_token %} {{ wizard.management_form }} {% for field in form %} <div class="row"> <div class="columns medium-10 large-9 result-item"> <label> <h4>{{ field }} {{ field.label }}</h4> <p>{{ field.help_text }}</p> </label> </div> </div> {% empty %} <div class="row"> <div class="columns"> <p>Sorry, we couldn't find any results for those job roles</p> </div> </div> {% endfor %} <div class="row"> <div class="columns"> <button type=submit class=button>Next</button> </div> </div> </form> {% endblock content %}
{% extends "base.html" %} {% block title %}Understand what sort of jobs you could do{% endblock title %} {% block content %} <style> .result-item { border-top: 1px solid #DFDFDF; margin-top: 0.5rem; padding-top: 0.5rem; } .result-item h4 input { margin-bottom: 0; vertical-align: middle; } </style> <div class="row"> <div class="columns"> <h1>Select jobs you'd like to know more about</h1> </div> </div> <form id="results" method=post> {{ form.errors }} {% csrf_token %} {{ wizard.management_form }} {% for field in form %} <div class="row"> <div class="columns medium-10 large-9 result-item"> <label> <h4>{{ field }} {{ field.label }}</h4> <p>{{ field.help_text }}</p> </label> </div> </div> {% empty %} <div class="row"> <div class="columns"> <p>Sorry, we couldn't find any results for those job roles</p> </div> </div> {% endfor %} <div class="row"> <div class="columns"> <a href="{% url 'sectors:wizard_step' step='sector_form' %}" class="button">Back</a> <button type=submit class=button>Next</button> </div> </div> </form> {% endblock content %}
Add back button to sectors tool step two
Add back button to sectors tool step two
HTML
bsd-3-clause
lm-tools/situational,lm-tools/sectors,lm-tools/sectors,lm-tools/situational,lm-tools/situational,lm-tools/situational,lm-tools/sectors,lm-tools/sectors,lm-tools/situational
html
## Code Before: {% extends "base.html" %} {% block title %}Understand what sort of jobs you could do{% endblock title %} {% block content %} <style> .result-item { border-top: 1px solid #DFDFDF; margin-top: 0.5rem; padding-top: 0.5rem; } .result-item h4 input { margin-bottom: 0; vertical-align: middle; } </style> <div class="row"> <div class="columns"> <h1>Select jobs you'd like to know more about</h1> </div> </div> <form id="results" method=post> {{ form.errors }} {% csrf_token %} {{ wizard.management_form }} {% for field in form %} <div class="row"> <div class="columns medium-10 large-9 result-item"> <label> <h4>{{ field }} {{ field.label }}</h4> <p>{{ field.help_text }}</p> </label> </div> </div> {% empty %} <div class="row"> <div class="columns"> <p>Sorry, we couldn't find any results for those job roles</p> </div> </div> {% endfor %} <div class="row"> <div class="columns"> <button type=submit class=button>Next</button> </div> </div> </form> {% endblock content %} ## Instruction: Add back button to sectors tool step two ## Code After: {% extends "base.html" %} {% block title %}Understand what sort of jobs you could do{% endblock title %} {% block content %} <style> .result-item { border-top: 1px solid #DFDFDF; margin-top: 0.5rem; padding-top: 0.5rem; } .result-item h4 input { margin-bottom: 0; vertical-align: middle; } </style> <div class="row"> <div class="columns"> <h1>Select jobs you'd like to know more about</h1> </div> </div> <form id="results" method=post> {{ form.errors }} {% csrf_token %} {{ wizard.management_form }} {% for field in form %} <div class="row"> <div class="columns medium-10 large-9 result-item"> <label> <h4>{{ field }} {{ field.label }}</h4> <p>{{ field.help_text }}</p> </label> </div> </div> {% empty %} <div class="row"> <div class="columns"> <p>Sorry, we couldn't find any results for those job roles</p> </div> </div> {% endfor %} <div class="row"> <div class="columns"> <a href="{% url 'sectors:wizard_step' step='sector_form' %}" class="button">Back</a> <button type=submit class=button>Next</button> </div> </div> </form> {% endblock content %}
{% extends "base.html" %} {% block title %}Understand what sort of jobs you could do{% endblock title %} {% block content %} <style> .result-item { border-top: 1px solid #DFDFDF; margin-top: 0.5rem; padding-top: 0.5rem; } .result-item h4 input { margin-bottom: 0; vertical-align: middle; } </style> <div class="row"> <div class="columns"> <h1>Select jobs you'd like to know more about</h1> </div> </div> <form id="results" method=post> {{ form.errors }} {% csrf_token %} {{ wizard.management_form }} {% for field in form %} <div class="row"> <div class="columns medium-10 large-9 result-item"> <label> <h4>{{ field }} {{ field.label }}</h4> <p>{{ field.help_text }}</p> </label> </div> </div> {% empty %} <div class="row"> <div class="columns"> <p>Sorry, we couldn't find any results for those job roles</p> </div> </div> {% endfor %} <div class="row"> <div class="columns"> + <a href="{% url 'sectors:wizard_step' step='sector_form' %}" class="button">Back</a> <button type=submit class=button>Next</button> </div> </div> </form> {% endblock content %}
1
0.019608
1
0
0f2e72668d1a07c71988c8e20f4f90f356de70c8
.travis.yml
.travis.yml
sudo: false language: java jdk: - openjdk6 - openjdk7 - oraclejdk7 os: - linux - osx script: - ./autogen.sh && ./configure && make -j2 - cd java && mvn test && cd .. - cd javanano && mvn test && cd .. - cd python && python setup.py build && python setup.py google_test - LD_LIBRARY_PATH=../src/.libs cd python && python setup.py build --cpp_implementation && python setup.py google_test --cpp_implementation - make distcheck -j2 notifications: email: false
sudo: false language: java jdk: - openjdk6 - openjdk7 - oraclejdk7 os: - linux - osx script: - ./autogen.sh && ./configure && make -j2 - cd java && mvn test && cd .. - cd javanano && mvn test && cd .. - cd python && python setup.py build && python setup.py google_test && cd .. - LD_LIBRARY_PATH=../src/.libs cd python && python setup.py build --cpp_implementation && python setup.py google_test --cpp_implementation && cd .. - make distcheck -j2 notifications: email: false
Fix for current directory in Travis tests.
Fix for current directory in Travis tests.
YAML
bsd-3-clause
google/protobuf,google/protobuf,google/protobuf,Livefyre/protobuf,google/protobuf,google/protobuf,google/protobuf,google/protobuf,Livefyre/protobuf,google/protobuf,Livefyre/protobuf,Livefyre/protobuf,google/protobuf,google/protobuf,Livefyre/protobuf,google/protobuf
yaml
## Code Before: sudo: false language: java jdk: - openjdk6 - openjdk7 - oraclejdk7 os: - linux - osx script: - ./autogen.sh && ./configure && make -j2 - cd java && mvn test && cd .. - cd javanano && mvn test && cd .. - cd python && python setup.py build && python setup.py google_test - LD_LIBRARY_PATH=../src/.libs cd python && python setup.py build --cpp_implementation && python setup.py google_test --cpp_implementation - make distcheck -j2 notifications: email: false ## Instruction: Fix for current directory in Travis tests. ## Code After: sudo: false language: java jdk: - openjdk6 - openjdk7 - oraclejdk7 os: - linux - osx script: - ./autogen.sh && ./configure && make -j2 - cd java && mvn test && cd .. - cd javanano && mvn test && cd .. - cd python && python setup.py build && python setup.py google_test && cd .. - LD_LIBRARY_PATH=../src/.libs cd python && python setup.py build --cpp_implementation && python setup.py google_test --cpp_implementation && cd .. - make distcheck -j2 notifications: email: false
sudo: false language: java jdk: - openjdk6 - openjdk7 - oraclejdk7 os: - linux - osx script: - ./autogen.sh && ./configure && make -j2 - cd java && mvn test && cd .. - cd javanano && mvn test && cd .. - - cd python && python setup.py build && python setup.py google_test + - cd python && python setup.py build && python setup.py google_test && cd .. ? +++++++++ - - LD_LIBRARY_PATH=../src/.libs cd python && python setup.py build --cpp_implementation && python setup.py google_test --cpp_implementation + - LD_LIBRARY_PATH=../src/.libs cd python && python setup.py build --cpp_implementation && python setup.py google_test --cpp_implementation && cd .. ? +++++++++ - make distcheck -j2 notifications: email: false
4
0.222222
2
2
fb79f8140963263e8434343526c104da8d1c43f2
circle.yml
circle.yml
test: override: - npm run build deployment: production: branch: master commands: - git config --global user.email onevasari@gmail.com - git config --global user.name 1vasari - git status # Use '|| true' to stop the build erroring out when there were no changes. - git add songs.json && git commit -m "[CircleCI][ci skip] build songs.json" || true - git push origin master
test: override: - npm run build deployment: production: branch: master commands: - git config --global user.email onevasari@gmail.com - git config --global user.name 1vasari - git status # Use '|| true' to stop the build erroring out when there were no changes. - git add songs.json && git commit -m "[CircleCI][ci skip] build songs.json" || true - git push origin master machine: node: version: 5.0.0
Update node version for Circle CI
Update node version for Circle CI
YAML
mit
1vasari/songdown-songs
yaml
## Code Before: test: override: - npm run build deployment: production: branch: master commands: - git config --global user.email onevasari@gmail.com - git config --global user.name 1vasari - git status # Use '|| true' to stop the build erroring out when there were no changes. - git add songs.json && git commit -m "[CircleCI][ci skip] build songs.json" || true - git push origin master ## Instruction: Update node version for Circle CI ## Code After: test: override: - npm run build deployment: production: branch: master commands: - git config --global user.email onevasari@gmail.com - git config --global user.name 1vasari - git status # Use '|| true' to stop the build erroring out when there were no changes. - git add songs.json && git commit -m "[CircleCI][ci skip] build songs.json" || true - git push origin master machine: node: version: 5.0.0
test: override: - npm run build deployment: production: branch: master commands: - git config --global user.email onevasari@gmail.com - git config --global user.name 1vasari - git status # Use '|| true' to stop the build erroring out when there were no changes. - git add songs.json && git commit -m "[CircleCI][ci skip] build songs.json" || true - git push origin master + + machine: + node: + version: 5.0.0
4
0.285714
4
0
1ad97f7004164150ca6349337f549274857bb4b8
.travis.yml
.travis.yml
language: node_js node_js: - "6.*" - "4.*" services: - mysql before_script: - mysql -e 'create database momy;' after_success: - bash <(curl -s https://codecov.io/bash) env: - CXX=g++-4.8 addons: apt: sources: - ubuntu-toolchain-r-test packages: - g++-4.8
language: node_js node_js: - "6.*" - "4.*" services: - mysql before_script: - mysql -e 'create database momy;' after_success: - bash <(curl -s https://codecov.io/bash)
Revert "Adds gcc to Travis manually"
Revert "Adds gcc to Travis manually" This reverts commit 47b577941b9c0870a680601fbcba5f8d305f46e9.
YAML
mit
cognitom/momy,cognitom/momy
yaml
## Code Before: language: node_js node_js: - "6.*" - "4.*" services: - mysql before_script: - mysql -e 'create database momy;' after_success: - bash <(curl -s https://codecov.io/bash) env: - CXX=g++-4.8 addons: apt: sources: - ubuntu-toolchain-r-test packages: - g++-4.8 ## Instruction: Revert "Adds gcc to Travis manually" This reverts commit 47b577941b9c0870a680601fbcba5f8d305f46e9. ## Code After: language: node_js node_js: - "6.*" - "4.*" services: - mysql before_script: - mysql -e 'create database momy;' after_success: - bash <(curl -s https://codecov.io/bash)
language: node_js node_js: - "6.*" - "4.*" services: - mysql before_script: - mysql -e 'create database momy;' after_success: - bash <(curl -s https://codecov.io/bash) - env: - - CXX=g++-4.8 - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-4.8
8
0.444444
0
8
769fb1402fb4a36509d772e6c46463927f0295cb
projects/fixtures/test_fixtures.json
projects/fixtures/test_fixtures.json
[ { "pk": 1, "model": "projects.ocrproject", "fields": { "description": "", "tags": "", "created_on": "2010-08-16 12:06:55", "user": 1, "defaults": 1, "name": "Test form" } } , { "pk": 1, "model": "projects.ocrprojectdefaults", "fields": { "recognizer": null, "psegmenter": 1, "binarizer": 1, "cmodel": 1, "lmodel": 2 } } ]
[ { "pk": 1, "model": "projects.ocrproject", "fields": { "description": "", "tags": "", "created_on": "2010-08-16 12:06:55", "user": 1, "defaults": 1, "name": "Test Project 2", "slug": "test-project-2" } } , { "pk": 1, "model": "projects.ocrprojectdefaults", "fields": { "recognizer": null, "psegmenter": 1, "binarizer": 1, "cmodel": 1, "lmodel": 2 } } ]
Update project fixture with new slug field
Update project fixture with new slug field
JSON
apache-2.0
vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium
json
## Code Before: [ { "pk": 1, "model": "projects.ocrproject", "fields": { "description": "", "tags": "", "created_on": "2010-08-16 12:06:55", "user": 1, "defaults": 1, "name": "Test form" } } , { "pk": 1, "model": "projects.ocrprojectdefaults", "fields": { "recognizer": null, "psegmenter": 1, "binarizer": 1, "cmodel": 1, "lmodel": 2 } } ] ## Instruction: Update project fixture with new slug field ## Code After: [ { "pk": 1, "model": "projects.ocrproject", "fields": { "description": "", "tags": "", "created_on": "2010-08-16 12:06:55", "user": 1, "defaults": 1, "name": "Test Project 2", "slug": "test-project-2" } } , { "pk": 1, "model": "projects.ocrprojectdefaults", "fields": { "recognizer": null, "psegmenter": 1, "binarizer": 1, "cmodel": 1, "lmodel": 2 } } ]
[ { "pk": 1, "model": "projects.ocrproject", "fields": { "description": "", "tags": "", "created_on": "2010-08-16 12:06:55", "user": 1, "defaults": 1, - "name": "Test form" ? ^ ^^ + "name": "Test Project 2", ? ^^ ^^^^^^ + + "slug": "test-project-2" } } , { "pk": 1, "model": "projects.ocrprojectdefaults", "fields": { "recognizer": null, "psegmenter": 1, "binarizer": 1, "cmodel": 1, "lmodel": 2 } } ]
3
0.111111
2
1
111f156c79813f66648854cd2c6275f3dd79a10c
scripts/git_check_for_updates.sh
scripts/git_check_for_updates.sh
function changes_in_git_repo { latestlocal=`git rev-parse HEAD`; echo $latestlocal gitrepourl=`git remote -v | grep fetch | awk '{print $2}'`; echo $gitrepourl; latestremote=`git ls-remote --heads $gitrepourl master| awk '{print $1}'`; echo $latestremote; if [ $latestlocal != $latestremote ] then echo "Changes since last build!"; `git pull && /etc/init.d/gutsy restart` else echo "No changes since last build"; fi } changes_in_git_repo;
cd /data/gutsy latestlocal=`git rev-parse HEAD`; echo $latestlocal gitrepourl=`git remote -v | grep fetch | awk '{print $2}'`; echo $gitrepourl; latestremote=`git ls-remote --heads $gitrepourl master| awk '{print $1}'`; echo $latestremote; if [ $latestlocal != $latestremote ] then echo "Changes since last build!"; git pull && /etc/init.d/gutsy restart chown -R gutsy: . else echo "No changes since last build"; fi
Tweak this script so it works.
Tweak this script so it works.
Shell
apache-2.0
racker/gutsy,racker/gutsy
shell
## Code Before: function changes_in_git_repo { latestlocal=`git rev-parse HEAD`; echo $latestlocal gitrepourl=`git remote -v | grep fetch | awk '{print $2}'`; echo $gitrepourl; latestremote=`git ls-remote --heads $gitrepourl master| awk '{print $1}'`; echo $latestremote; if [ $latestlocal != $latestremote ] then echo "Changes since last build!"; `git pull && /etc/init.d/gutsy restart` else echo "No changes since last build"; fi } changes_in_git_repo; ## Instruction: Tweak this script so it works. ## Code After: cd /data/gutsy latestlocal=`git rev-parse HEAD`; echo $latestlocal gitrepourl=`git remote -v | grep fetch | awk '{print $2}'`; echo $gitrepourl; latestremote=`git ls-remote --heads $gitrepourl master| awk '{print $1}'`; echo $latestremote; if [ $latestlocal != $latestremote ] then echo "Changes since last build!"; git pull && /etc/init.d/gutsy restart chown -R gutsy: . else echo "No changes since last build"; fi
- function changes_in_git_repo { - latestlocal=`git rev-parse HEAD`; - echo $latestlocal - gitrepourl=`git remote -v | grep fetch | awk '{print $2}'`; - echo $gitrepourl; + cd /data/gutsy - latestremote=`git ls-remote --heads $gitrepourl master| awk '{print $1}'`; - echo $latestremote; + latestlocal=`git rev-parse HEAD`; + echo $latestlocal + gitrepourl=`git remote -v | grep fetch | awk '{print $2}'`; + echo $gitrepourl; + + latestremote=`git ls-remote --heads $gitrepourl master| awk '{print $1}'`; + echo $latestremote; + - if [ $latestlocal != $latestremote ] ? -- + if [ $latestlocal != $latestremote ] - then ? -- + then echo "Changes since last build!"; - `git pull && /etc/init.d/gutsy restart` ? - - + git pull && /etc/init.d/gutsy restart + chown -R gutsy: . - else ? -- + else echo "No changes since last build"; + fi - fi - } - changes_in_git_repo;
29
1.611111
15
14
5e2f77caab5c0388e7e56f5fe947978c0aed0168
lib/paml.rb
lib/paml.rb
require "paml/version" require "paml/stream" require "paml/node" require "paml/tag" module Paml HAML_PATTERN = / # In HAML, the whitespace between the beginning of a line and an # element definition determines the element's depth in the tree # generated from the haml source. ^(?<whitespace>\s*) # A tag can be specified (?:%(?<tag>\w+))? # (?:\#(?<id>\w+))? # The class of the element (?:\.(?<class>\w+))? # The element attributes (?:\{(?<attributes>.*?)\})? # The type of content (?<content_type>-|=)? # The content (?<content>.*?)$ /x end
require "paml/version" require "paml/line" require "paml/stream" require "paml/node" require "paml/tag" module Paml PATTERN = / # In Paml, the whitespace between the beginning of a line and an # element definition determines the element's depth in the tree # generated from the haml source. ^(?<whitespace>\t*) # A tag can be named by prepending the name with a percent sign (%). (?:%(?<tag>\w+))? # Paml provides a shortcut for specifying an element's ID. (?:\#(?<id>\w+))? # Paml also provides a shortcut for specifying an element's class. (?:\.(?<class>\w+))? # Arbitrary attributes can be given in a ruby-like fashion; simply separate # keys and values with a colon (:), seperate key-value pairs with a comma # (,), and wrap the whole thing in curly braces ({}). (?:\{(?<attributes>.*?)\})? # Content can be added to the end of a line, but if a tag name, id, or # class has been given you must specify the KIND of content at the end of # the line. If you give a dash (-) or equal-sign (=) then Paml will treat # your content as PHP code; the only difference is that anything after an # equal-sign will be echoed. (?<content_type>-|=)? # The content. (?<content>.*?)$ /x end
Add some documentation to the PATTERN
Add some documentation to the PATTERN The PATTERN is a regex that is supposed to parse HAML.
Ruby
mit
kpullen/paml
ruby
## Code Before: require "paml/version" require "paml/stream" require "paml/node" require "paml/tag" module Paml HAML_PATTERN = / # In HAML, the whitespace between the beginning of a line and an # element definition determines the element's depth in the tree # generated from the haml source. ^(?<whitespace>\s*) # A tag can be specified (?:%(?<tag>\w+))? # (?:\#(?<id>\w+))? # The class of the element (?:\.(?<class>\w+))? # The element attributes (?:\{(?<attributes>.*?)\})? # The type of content (?<content_type>-|=)? # The content (?<content>.*?)$ /x end ## Instruction: Add some documentation to the PATTERN The PATTERN is a regex that is supposed to parse HAML. ## Code After: require "paml/version" require "paml/line" require "paml/stream" require "paml/node" require "paml/tag" module Paml PATTERN = / # In Paml, the whitespace between the beginning of a line and an # element definition determines the element's depth in the tree # generated from the haml source. ^(?<whitespace>\t*) # A tag can be named by prepending the name with a percent sign (%). (?:%(?<tag>\w+))? # Paml provides a shortcut for specifying an element's ID. (?:\#(?<id>\w+))? # Paml also provides a shortcut for specifying an element's class. (?:\.(?<class>\w+))? # Arbitrary attributes can be given in a ruby-like fashion; simply separate # keys and values with a colon (:), seperate key-value pairs with a comma # (,), and wrap the whole thing in curly braces ({}). (?:\{(?<attributes>.*?)\})? # Content can be added to the end of a line, but if a tag name, id, or # class has been given you must specify the KIND of content at the end of # the line. If you give a dash (-) or equal-sign (=) then Paml will treat # your content as PHP code; the only difference is that anything after an # equal-sign will be echoed. (?<content_type>-|=)? # The content. (?<content>.*?)$ /x end
require "paml/version" + require "paml/line" require "paml/stream" require "paml/node" require "paml/tag" module Paml - HAML_PATTERN = / ? ----- + PATTERN = / - # In HAML, the whitespace between the beginning of a line and an ? ^^^^ + # In Paml, the whitespace between the beginning of a line and an ? ^^^^ # element definition determines the element's depth in the tree # generated from the haml source. - ^(?<whitespace>\s*) ? ^ + ^(?<whitespace>\t*) ? ^ - # A tag can be specified + # A tag can be named by prepending the name with a percent sign (%). (?:%(?<tag>\w+))? - # + # Paml provides a shortcut for specifying an element's ID. (?:\#(?<id>\w+))? - # The class of the element + # Paml also provides a shortcut for specifying an element's class. (?:\.(?<class>\w+))? - # The element attributes + # Arbitrary attributes can be given in a ruby-like fashion; simply separate + # keys and values with a colon (:), seperate key-value pairs with a comma + # (,), and wrap the whole thing in curly braces ({}). (?:\{(?<attributes>.*?)\})? - # The type of content + # Content can be added to the end of a line, but if a tag name, id, or + # class has been given you must specify the KIND of content at the end of + # the line. If you give a dash (-) or equal-sign (=) then Paml will treat + # your content as PHP code; the only difference is that anything after an + # equal-sign will be echoed. (?<content_type>-|=)? - # The content + # The content. ? + (?<content>.*?)$ /x end
25
1
16
9
4f6f2e7f2263c5974809c8d9a87e6175f3d08cf1
README.md
README.md
OWASP Enterprise Security API for Java ========== <img src="https://raw.githubusercontent.com/ESAPI/esapi-java/master/static/ESAPI%20Logo.png" width="100" height="100" /> Welcome to the Home of ESAPI 3.x News ========== 2 Sept 2014 - We are gearing up to get some great stuff done at AppSecUSA in Denver this month. We'll be announcing our schedule and where we'll be at the conference soon! Stay tuned! For more information on ESAPI or information on ESAPI 2.x please visit our wiki page at https://www.owasp.org/index.php/Category:OWASP_Enterprise_Security_API
OWASP Enterprise Security API for Java ========== <img src="https://raw.githubusercontent.com/ESAPI/esapi-java/master/static/ESAPI%20Logo.png" width="100" height="100" /> Welcome to the Home of ESAPI 3.x News ========== The development of ESAPI 3 is still within the _very early_ planning stages. The code that is currently in this GitHub repo (as of 2020-07-17) is likely to be completely rewritten, possibly several times. If you wish to participate, please sign up for the Google Group "[esapi-project-dev](mailto:esapi-project-dev@owasp.org)", and feel free to start a new discussion thread. Note you MUST subscribe to the Google Group list before you may POST to it. [Subscribe to ESAPI Developers list](https://groups.google.com/a/owasp.org/forum/#!forum/esapi-project-dev/join). Notes ========== For more information on ESAPI or information on ESAPI 2.x please visit our wiki page at https://owasp.org/www-project-enterprise-security-api/ and before you start using ESAPI, do yourself a favor and be sure to read the "[Should I use ESAPI?](https://owasp.org/www-project-enterprise-security-api/#div-shouldiuseesapi)" tab there.
Rewrite this as it hadn't been touched for 6+ years.
Rewrite this as it hadn't been touched for 6+ years.
Markdown
bsd-3-clause
ESAPI/esapi-java
markdown
## Code Before: OWASP Enterprise Security API for Java ========== <img src="https://raw.githubusercontent.com/ESAPI/esapi-java/master/static/ESAPI%20Logo.png" width="100" height="100" /> Welcome to the Home of ESAPI 3.x News ========== 2 Sept 2014 - We are gearing up to get some great stuff done at AppSecUSA in Denver this month. We'll be announcing our schedule and where we'll be at the conference soon! Stay tuned! For more information on ESAPI or information on ESAPI 2.x please visit our wiki page at https://www.owasp.org/index.php/Category:OWASP_Enterprise_Security_API ## Instruction: Rewrite this as it hadn't been touched for 6+ years. ## Code After: OWASP Enterprise Security API for Java ========== <img src="https://raw.githubusercontent.com/ESAPI/esapi-java/master/static/ESAPI%20Logo.png" width="100" height="100" /> Welcome to the Home of ESAPI 3.x News ========== The development of ESAPI 3 is still within the _very early_ planning stages. The code that is currently in this GitHub repo (as of 2020-07-17) is likely to be completely rewritten, possibly several times. If you wish to participate, please sign up for the Google Group "[esapi-project-dev](mailto:esapi-project-dev@owasp.org)", and feel free to start a new discussion thread. Note you MUST subscribe to the Google Group list before you may POST to it. [Subscribe to ESAPI Developers list](https://groups.google.com/a/owasp.org/forum/#!forum/esapi-project-dev/join). Notes ========== For more information on ESAPI or information on ESAPI 2.x please visit our wiki page at https://owasp.org/www-project-enterprise-security-api/ and before you start using ESAPI, do yourself a favor and be sure to read the "[Should I use ESAPI?](https://owasp.org/www-project-enterprise-security-api/#div-shouldiuseesapi)" tab there.
OWASP Enterprise Security API for Java ========== <img src="https://raw.githubusercontent.com/ESAPI/esapi-java/master/static/ESAPI%20Logo.png" width="100" height="100" /> Welcome to the Home of ESAPI 3.x News ========== - 2 Sept 2014 - We are gearing up to get some great stuff done at AppSecUSA in Denver this month. We'll be announcing our schedule and where we'll be at the conference soon! Stay tuned! + The development of ESAPI 3 is still within the _very early_ planning stages. The code that is currently in this GitHub repo (as of 2020-07-17) is likely to be completely rewritten, possibly several times. If you wish to participate, please sign up for the Google Group "[esapi-project-dev](mailto:esapi-project-dev@owasp.org)", and feel free to start a new discussion thread. Note you MUST subscribe to the Google Group list before you may POST to it. [Subscribe to ESAPI Developers list](https://groups.google.com/a/owasp.org/forum/#!forum/esapi-project-dev/join). - - For more information on ESAPI or information on ESAPI 2.x please visit our wiki page at https://www.owasp.org/index.php/Category:OWASP_Enterprise_Security_API + Notes + ========== + For more information on ESAPI or information on ESAPI 2.x please visit our wiki page at https://owasp.org/www-project-enterprise-security-api/ and before you start using ESAPI, do yourself a favor and be sure to read the "[Should I use ESAPI?](https://owasp.org/www-project-enterprise-security-api/#div-shouldiuseesapi)" tab there.
7
0.538462
4
3
480d7ce80ad5393075f11ee29e6ccecfee20d9d2
ATZ.MVVM.xml
ATZ.MVVM.xml
<?xml version="1.0" encoding="utf-8" ?> <project name="ATZ.MVVM" default="help"> <description>Build file for ATZ.MVVM library.</description> <property name="project.name" value="MVVM" /> <include buildfile="../NAnt/ATZ.Build.xml" /> </project>
<?xml version="1.0" encoding="utf-8" ?> <project name="ATZ.MVVM" default="help"> <description>Build file for ATZ.MVVM library.</description> <property name="project.name" value="MVVM" /> <property name="build.targetframeworks" value="NET45,NET452" /> <include buildfile="../NAnt/ATZ.Build.xml" /> </project>
Build instruction for targeting .NET 4.5 and 4.5.2 framework versions.
Build instruction for targeting .NET 4.5 and 4.5.2 framework versions.
XML
mit
atzimler/MVVM
xml
## Code Before: <?xml version="1.0" encoding="utf-8" ?> <project name="ATZ.MVVM" default="help"> <description>Build file for ATZ.MVVM library.</description> <property name="project.name" value="MVVM" /> <include buildfile="../NAnt/ATZ.Build.xml" /> </project> ## Instruction: Build instruction for targeting .NET 4.5 and 4.5.2 framework versions. ## Code After: <?xml version="1.0" encoding="utf-8" ?> <project name="ATZ.MVVM" default="help"> <description>Build file for ATZ.MVVM library.</description> <property name="project.name" value="MVVM" /> <property name="build.targetframeworks" value="NET45,NET452" /> <include buildfile="../NAnt/ATZ.Build.xml" /> </project>
<?xml version="1.0" encoding="utf-8" ?> <project name="ATZ.MVVM" default="help"> <description>Build file for ATZ.MVVM library.</description> <property name="project.name" value="MVVM" /> + <property name="build.targetframeworks" value="NET45,NET452" /> <include buildfile="../NAnt/ATZ.Build.xml" /> </project>
1
0.142857
1
0
1212d33d849155f8c1cdc6a610e893318937e7c5
silk/webdoc/html/v5.py
silk/webdoc/html/v5.py
from .common import * del ACRONYM del APPLET del BASEFONT del BIG del CENTER del DIR del FONT del FRAME del FRAMESET del NOFRAMES del STRIKE del TT del U
from .common import ( # flake8: noqa A, ABBR, # ACRONYM, ADDRESS, # APPLET, AREA, B, BASE, # BASEFONT, BDO, # BIG, BLOCKQUOTE, BODY, BR, BUTTON, Body, CAPTION, CAT, # CENTER, CITE, CODE, COL, COLGROUP, COMMENT, CONDITIONAL_COMMENT, DD, DEL, DFN, # DIR, DIV, DL, DT, EM, FIELDSET, # FONT, FORM, # FRAME, # FRAMESET, Form, H1, H2, H3, H4, H5, H6, HEAD, HR, HTML, HTMLDoc, Hyper, I, IFRAME, IMG, INPUT, INS, Image, Javascript, KBD, LABEL, LEGEND, LI, LINK, MAP, MENU, META, NBSP, # NOFRAMES, NOSCRIPT, OBJECT, OL, OPTGROUP, OPTION, P, PARAM, PRE, Q, S, SAMP, SCRIPT, SELECT, SMALL, SPAN, # STRIKE, STRONG, STYLE, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TITLE, TR, # TT, # U, UL, VAR, XML, XMLEntity, XMLNode, XMP, xmlescape, xmlunescape )
Replace import * with explicit names
Replace import * with explicit names
Python
bsd-3-clause
orbnauticus/silk
python
## Code Before: from .common import * del ACRONYM del APPLET del BASEFONT del BIG del CENTER del DIR del FONT del FRAME del FRAMESET del NOFRAMES del STRIKE del TT del U ## Instruction: Replace import * with explicit names ## Code After: from .common import ( # flake8: noqa A, ABBR, # ACRONYM, ADDRESS, # APPLET, AREA, B, BASE, # BASEFONT, BDO, # BIG, BLOCKQUOTE, BODY, BR, BUTTON, Body, CAPTION, CAT, # CENTER, CITE, CODE, COL, COLGROUP, COMMENT, CONDITIONAL_COMMENT, DD, DEL, DFN, # DIR, DIV, DL, DT, EM, FIELDSET, # FONT, FORM, # FRAME, # FRAMESET, Form, H1, H2, H3, H4, H5, H6, HEAD, HR, HTML, HTMLDoc, Hyper, I, IFRAME, IMG, INPUT, INS, Image, Javascript, KBD, LABEL, LEGEND, LI, LINK, MAP, MENU, META, NBSP, # NOFRAMES, NOSCRIPT, OBJECT, OL, OPTGROUP, OPTION, P, PARAM, PRE, Q, S, SAMP, SCRIPT, SELECT, SMALL, SPAN, # STRIKE, STRONG, STYLE, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TITLE, TR, # TT, # U, UL, VAR, XML, XMLEntity, XMLNode, XMP, xmlescape, xmlunescape )
- from .common import * - - del ACRONYM - del APPLET - del BASEFONT - del BIG - del CENTER - del DIR - del FONT - del FRAME - del FRAMESET - del NOFRAMES - del STRIKE - del TT - del U + from .common import ( # flake8: noqa + A, + ABBR, + # ACRONYM, + ADDRESS, + # APPLET, + AREA, + B, + BASE, + # BASEFONT, + BDO, + # BIG, + BLOCKQUOTE, + BODY, + BR, + BUTTON, + Body, + CAPTION, + CAT, + # CENTER, + CITE, + CODE, + COL, + COLGROUP, + COMMENT, + CONDITIONAL_COMMENT, + DD, + DEL, + DFN, + # DIR, + DIV, + DL, + DT, + EM, + FIELDSET, + # FONT, + FORM, + # FRAME, + # FRAMESET, + Form, + H1, + H2, + H3, + H4, + H5, + H6, + HEAD, + HR, + HTML, + HTMLDoc, + Hyper, + I, + IFRAME, + IMG, + INPUT, + INS, + Image, + Javascript, + KBD, + LABEL, + LEGEND, + LI, + LINK, + MAP, + MENU, + META, + NBSP, + # NOFRAMES, + NOSCRIPT, + OBJECT, + OL, + OPTGROUP, + OPTION, + P, + PARAM, + PRE, + Q, + S, + SAMP, + SCRIPT, + SELECT, + SMALL, + SPAN, + # STRIKE, + STRONG, + STYLE, + SUB, + SUP, + TABLE, + TBODY, + TD, + TEXTAREA, + TFOOT, + TH, + THEAD, + TITLE, + TR, + # TT, + # U, + UL, + VAR, + XML, + XMLEntity, + XMLNode, + XMP, + xmlescape, + xmlunescape + )
123
7.6875
108
15
d407924d2428748d5b77598a28385204e09934e2
controllers/FAQs.php
controllers/FAQs.php
<?php namespace BuzzwordCompliant\FAQs\Controllers; use Backend\Facades\BackendMenu; use Illuminate\Http\Request; class FAQs extends Controller { public function __construct() { parent::__construct(); BackendMenu::setContext('BuzzwordCompliant.FAQs', 'faqs'); } public $implement = [ 'Backend.Behaviors.ListController', 'Backend.Behaviors.FormController', 'Backend.Behaviors.RelationController', 'Backend.Behaviors.ReorderController', ]; public $listConfig = 'config_list.yaml'; public $formConfig = 'config_form.yaml'; public $relationConfig = 'config_relation.yaml'; public $reorderConfig = 'config_reorder.yaml'; public function reorderExtendQuery($query) { $query->where('faq_id', $this->params[0]); } }
<?php namespace BuzzwordCompliant\FAQs\Controllers; use Backend\Classes\Controller; use Backend\Facades\BackendMenu; use Illuminate\Http\Request; class FAQs extends Controller { public function __construct() { parent::__construct(); BackendMenu::setContext('BuzzwordCompliant.FAQs', 'faqs'); } public $implement = [ 'Backend.Behaviors.ListController', 'Backend.Behaviors.FormController', 'Backend.Behaviors.RelationController', 'Backend.Behaviors.ReorderController', ]; public $listConfig = 'config_list.yaml'; public $formConfig = 'config_form.yaml'; public $relationConfig = 'config_relation.yaml'; public $reorderConfig = 'config_reorder.yaml'; public function reorderExtendQuery($query) { $query->where('faq_id', $this->params[0]); } }
Fix Controller class not found
Fix Controller class not found
PHP
mit
piersroberts/october-faqs,piersroberts/october-faqs
php
## Code Before: <?php namespace BuzzwordCompliant\FAQs\Controllers; use Backend\Facades\BackendMenu; use Illuminate\Http\Request; class FAQs extends Controller { public function __construct() { parent::__construct(); BackendMenu::setContext('BuzzwordCompliant.FAQs', 'faqs'); } public $implement = [ 'Backend.Behaviors.ListController', 'Backend.Behaviors.FormController', 'Backend.Behaviors.RelationController', 'Backend.Behaviors.ReorderController', ]; public $listConfig = 'config_list.yaml'; public $formConfig = 'config_form.yaml'; public $relationConfig = 'config_relation.yaml'; public $reorderConfig = 'config_reorder.yaml'; public function reorderExtendQuery($query) { $query->where('faq_id', $this->params[0]); } } ## Instruction: Fix Controller class not found ## Code After: <?php namespace BuzzwordCompliant\FAQs\Controllers; use Backend\Classes\Controller; use Backend\Facades\BackendMenu; use Illuminate\Http\Request; class FAQs extends Controller { public function __construct() { parent::__construct(); BackendMenu::setContext('BuzzwordCompliant.FAQs', 'faqs'); } public $implement = [ 'Backend.Behaviors.ListController', 'Backend.Behaviors.FormController', 'Backend.Behaviors.RelationController', 'Backend.Behaviors.ReorderController', ]; public $listConfig = 'config_list.yaml'; public $formConfig = 'config_form.yaml'; public $relationConfig = 'config_relation.yaml'; public $reorderConfig = 'config_reorder.yaml'; public function reorderExtendQuery($query) { $query->where('faq_id', $this->params[0]); } }
<?php namespace BuzzwordCompliant\FAQs\Controllers; + use Backend\Classes\Controller; use Backend\Facades\BackendMenu; use Illuminate\Http\Request; class FAQs extends Controller { public function __construct() { parent::__construct(); BackendMenu::setContext('BuzzwordCompliant.FAQs', 'faqs'); } public $implement = [ 'Backend.Behaviors.ListController', 'Backend.Behaviors.FormController', 'Backend.Behaviors.RelationController', 'Backend.Behaviors.ReorderController', ]; public $listConfig = 'config_list.yaml'; public $formConfig = 'config_form.yaml'; public $relationConfig = 'config_relation.yaml'; public $reorderConfig = 'config_reorder.yaml'; public function reorderExtendQuery($query) { $query->where('faq_id', $this->params[0]); } }
1
0.032258
1
0
73e26f71af18b8fb02b972b21659b148bcf20814
python/path.zsh
python/path.zsh
export PATH=$PATH:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/Current/bin alias python="python3" alias pip="pip3"
export PATH=$PATH:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/Current/bin
Remove python3 aliases - do it the old fashioned way
Remove python3 aliases - do it the old fashioned way
Shell
mit
mattdodge/dotfiles,mattdodge/dotfiles
shell
## Code Before: export PATH=$PATH:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/Current/bin alias python="python3" alias pip="pip3" ## Instruction: Remove python3 aliases - do it the old fashioned way ## Code After: export PATH=$PATH:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/Current/bin
export PATH=$PATH:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/Current/bin - - alias python="python3" - alias pip="pip3"
3
0.75
0
3
36f663a0b21e1955f610d9cce05c921509705941
.github/workflows/auto-update-gh-pages.yml
.github/workflows/auto-update-gh-pages.yml
name: Doxygen & Github Pages Action # Activate on pushes and pull requests into devel on: push: branches: [ devel ] pull_request: branches: [ devel ] workflow_dispatch: jobs: build: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 # Generate Doxygen output files in ./docs directory using Doxyfile in base directory - name: Doxygen Action uses: mattnotmitt/doxygen-action@v1 with: working-directory: . # Merge Doxygen output files in ./docs into gh-pages branch base directory - name: GitHub Pages action uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./docs commit_message: ${{ github.event.head_commit.message }}
name: Doxygen & Github Pages Action # Activate on pushes and pull requests into devel on: push: branches: [ devel ] workflow_dispatch: jobs: build: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 # Generate Doxygen output files in ./docs directory using Doxyfile in base directory - name: Doxygen Action uses: mattnotmitt/doxygen-action@v1 with: working-directory: . # Merge Doxygen output files in ./docs into gh-pages branch base directory - name: GitHub Pages action uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./docs commit_message: ${{ github.event.head_commit.message }}
Disable Doxygen/Github Pages action trigger on pull requests
Disable Doxygen/Github Pages action trigger on pull requests
YAML
lgpl-2.1
arfc/moltres,arfc/moltres,lindsayad/moltres,lindsayad/moltres,lindsayad/moltres,arfc/moltres,arfc/moltres,lindsayad/moltres
yaml
## Code Before: name: Doxygen & Github Pages Action # Activate on pushes and pull requests into devel on: push: branches: [ devel ] pull_request: branches: [ devel ] workflow_dispatch: jobs: build: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 # Generate Doxygen output files in ./docs directory using Doxyfile in base directory - name: Doxygen Action uses: mattnotmitt/doxygen-action@v1 with: working-directory: . # Merge Doxygen output files in ./docs into gh-pages branch base directory - name: GitHub Pages action uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./docs commit_message: ${{ github.event.head_commit.message }} ## Instruction: Disable Doxygen/Github Pages action trigger on pull requests ## Code After: name: Doxygen & Github Pages Action # Activate on pushes and pull requests into devel on: push: branches: [ devel ] workflow_dispatch: jobs: build: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 # Generate Doxygen output files in ./docs directory using Doxyfile in base directory - name: Doxygen Action uses: mattnotmitt/doxygen-action@v1 with: working-directory: . # Merge Doxygen output files in ./docs into gh-pages branch base directory - name: GitHub Pages action uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./docs commit_message: ${{ github.event.head_commit.message }}
name: Doxygen & Github Pages Action # Activate on pushes and pull requests into devel on: push: - branches: [ devel ] - pull_request: branches: [ devel ] workflow_dispatch: jobs: build: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 # Generate Doxygen output files in ./docs directory using Doxyfile in base directory - name: Doxygen Action uses: mattnotmitt/doxygen-action@v1 with: working-directory: . # Merge Doxygen output files in ./docs into gh-pages branch base directory - name: GitHub Pages action uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./docs commit_message: ${{ github.event.head_commit.message }}
2
0.0625
0
2
376c9c0ef16ef2ac7d08c05e95806781f5081b18
src/org/mtransit/android/commons/TaskUtils.java
src/org/mtransit/android/commons/TaskUtils.java
package org.mtransit.android.commons; import java.util.concurrent.Executor; import org.mtransit.android.commons.MTLog; import org.mtransit.android.commons.task.MTAsyncTask; public final class TaskUtils implements MTLog.Loggable { private static final String TAG = TaskUtils.class.getSimpleName(); @Override public String getLogTag() { return TAG; } public static final Executor THREAD_POOL_EXECUTOR = MTAsyncTask.THREAD_POOL_EXECUTOR; @SuppressWarnings("unchecked") public static <Params, Progress, Result> void execute(MTAsyncTask<Params, Progress, Result> asyncTask, Params... params) { if (asyncTask == null) { return; } asyncTask.executeOnExecutor(THREAD_POOL_EXECUTOR, params); } }
package org.mtransit.android.commons; import java.util.concurrent.Executor; import org.mtransit.android.commons.MTLog; import org.mtransit.android.commons.task.MTAsyncTask; public final class TaskUtils implements MTLog.Loggable { private static final String TAG = TaskUtils.class.getSimpleName(); @Override public String getLogTag() { return TAG; } public static final Executor THREAD_POOL_EXECUTOR = MTAsyncTask.THREAD_POOL_EXECUTOR; @SuppressWarnings("unchecked") public static <Params, Progress, Result> void execute(MTAsyncTask<Params, Progress, Result> asyncTask, Params... params) { if (asyncTask == null) { return; } asyncTask.executeOnExecutor(THREAD_POOL_EXECUTOR, params); } public static <Params, Progress, Result> boolean cancelQuietly(MTAsyncTask<Params, Progress, Result> asyncTask, boolean mayInterruptIfRunning) { try { if (asyncTask == null) { return false; } return asyncTask.cancel(mayInterruptIfRunning); } catch (Exception e) { MTLog.w(TAG, e, "Error while cancelling task!"); return false; } } }
Add utility method to cancel AsyncTasks quietly.
Add utility method to cancel AsyncTasks quietly.
Java
apache-2.0
mtransitapps/commons-android,mtransitapps/commons-android,mtransitapps/commons-android
java
## Code Before: package org.mtransit.android.commons; import java.util.concurrent.Executor; import org.mtransit.android.commons.MTLog; import org.mtransit.android.commons.task.MTAsyncTask; public final class TaskUtils implements MTLog.Loggable { private static final String TAG = TaskUtils.class.getSimpleName(); @Override public String getLogTag() { return TAG; } public static final Executor THREAD_POOL_EXECUTOR = MTAsyncTask.THREAD_POOL_EXECUTOR; @SuppressWarnings("unchecked") public static <Params, Progress, Result> void execute(MTAsyncTask<Params, Progress, Result> asyncTask, Params... params) { if (asyncTask == null) { return; } asyncTask.executeOnExecutor(THREAD_POOL_EXECUTOR, params); } } ## Instruction: Add utility method to cancel AsyncTasks quietly. ## Code After: package org.mtransit.android.commons; import java.util.concurrent.Executor; import org.mtransit.android.commons.MTLog; import org.mtransit.android.commons.task.MTAsyncTask; public final class TaskUtils implements MTLog.Loggable { private static final String TAG = TaskUtils.class.getSimpleName(); @Override public String getLogTag() { return TAG; } public static final Executor THREAD_POOL_EXECUTOR = MTAsyncTask.THREAD_POOL_EXECUTOR; @SuppressWarnings("unchecked") public static <Params, Progress, Result> void execute(MTAsyncTask<Params, Progress, Result> asyncTask, Params... params) { if (asyncTask == null) { return; } asyncTask.executeOnExecutor(THREAD_POOL_EXECUTOR, params); } public static <Params, Progress, Result> boolean cancelQuietly(MTAsyncTask<Params, Progress, Result> asyncTask, boolean mayInterruptIfRunning) { try { if (asyncTask == null) { return false; } return asyncTask.cancel(mayInterruptIfRunning); } catch (Exception e) { MTLog.w(TAG, e, "Error while cancelling task!"); return false; } } }
package org.mtransit.android.commons; import java.util.concurrent.Executor; import org.mtransit.android.commons.MTLog; import org.mtransit.android.commons.task.MTAsyncTask; public final class TaskUtils implements MTLog.Loggable { private static final String TAG = TaskUtils.class.getSimpleName(); @Override public String getLogTag() { return TAG; } public static final Executor THREAD_POOL_EXECUTOR = MTAsyncTask.THREAD_POOL_EXECUTOR; @SuppressWarnings("unchecked") public static <Params, Progress, Result> void execute(MTAsyncTask<Params, Progress, Result> asyncTask, Params... params) { if (asyncTask == null) { return; } asyncTask.executeOnExecutor(THREAD_POOL_EXECUTOR, params); } + + public static <Params, Progress, Result> boolean cancelQuietly(MTAsyncTask<Params, Progress, Result> asyncTask, boolean mayInterruptIfRunning) { + try { + if (asyncTask == null) { + return false; + } + return asyncTask.cancel(mayInterruptIfRunning); + } catch (Exception e) { + MTLog.w(TAG, e, "Error while cancelling task!"); + return false; + } + } }
12
0.461538
12
0
a6b5303966988c71ba04a0523c45786fc8acdd95
app/assets/stylesheets/modules/_faq.scss
app/assets/stylesheets/modules/_faq.scss
// --------------------------------------------------------------- // // FAQ Statement module // // --------------------------------------------------------------- .FAQ_subtitles { margin-bottom: 0.2em; } .FAQ_question { @extend %roboto_bold; margin-bottom: 0; cursor: pointer; text-decoration: underline; font-weight: 700; } .FAQ_paragraph { display: none; margin-bottom: 0.5em; ul { padding-left: 2em; } } .section-question-group__headline { @extend %roboto_bold; @extend %clarat_rounding_start; position: relative; margin-bottom: 0; padding: 0 1em; height: 40px; background: $brand_blue; color: $brand_white; line-height: 40px; .section-start--how & { background: $brand_blue; } .section-start--why & { background: #C3BFB4; } } .section-question-group__body { @extend %clarat_rounding_end; padding: 0.6em 1em 0.8em; background: $brand_beige; margin-bottom: 2em; }
// --------------------------------------------------------------- // // FAQ Statement module // // --------------------------------------------------------------- .FAQ_subtitles { margin-bottom: 0.2em; } .FAQ_question { @extend %roboto_bold; margin-bottom: 0; cursor: pointer; text-decoration: underline; font-weight: 700; } .FAQ_paragraph { display: none; margin-bottom: 0.5em; ul { padding-left: 2em; body.ar & { padding-left: 0; padding-right: 2em; } } } .section-question-group__headline { @extend %roboto_bold; @extend %clarat_rounding_start; position: relative; margin-bottom: 0; padding: 0 1em; height: 40px; background: $brand_blue; color: $brand_white; line-height: 40px; .section-start--how & { background: $brand_blue; } .section-start--why & { background: #C3BFB4; } } .section-question-group__body { @extend %clarat_rounding_end; padding: 0.6em 1em 0.8em; background: $brand_beige; margin-bottom: 2em; }
Fix list bullets of FAQ lists
Fix list bullets of FAQ lists
SCSS
mit
clarat-org/clarat,clarat-org/clarat,clarat-org/clarat,clarat-org/clarat
scss
## Code Before: // --------------------------------------------------------------- // // FAQ Statement module // // --------------------------------------------------------------- .FAQ_subtitles { margin-bottom: 0.2em; } .FAQ_question { @extend %roboto_bold; margin-bottom: 0; cursor: pointer; text-decoration: underline; font-weight: 700; } .FAQ_paragraph { display: none; margin-bottom: 0.5em; ul { padding-left: 2em; } } .section-question-group__headline { @extend %roboto_bold; @extend %clarat_rounding_start; position: relative; margin-bottom: 0; padding: 0 1em; height: 40px; background: $brand_blue; color: $brand_white; line-height: 40px; .section-start--how & { background: $brand_blue; } .section-start--why & { background: #C3BFB4; } } .section-question-group__body { @extend %clarat_rounding_end; padding: 0.6em 1em 0.8em; background: $brand_beige; margin-bottom: 2em; } ## Instruction: Fix list bullets of FAQ lists ## Code After: // --------------------------------------------------------------- // // FAQ Statement module // // --------------------------------------------------------------- .FAQ_subtitles { margin-bottom: 0.2em; } .FAQ_question { @extend %roboto_bold; margin-bottom: 0; cursor: pointer; text-decoration: underline; font-weight: 700; } .FAQ_paragraph { display: none; margin-bottom: 0.5em; ul { padding-left: 2em; body.ar & { padding-left: 0; padding-right: 2em; } } } .section-question-group__headline { @extend %roboto_bold; @extend %clarat_rounding_start; position: relative; margin-bottom: 0; padding: 0 1em; height: 40px; background: $brand_blue; color: $brand_white; line-height: 40px; .section-start--how & { background: $brand_blue; } .section-start--why & { background: #C3BFB4; } } .section-question-group__body { @extend %clarat_rounding_end; padding: 0.6em 1em 0.8em; background: $brand_beige; margin-bottom: 2em; }
// --------------------------------------------------------------- // // FAQ Statement module // // --------------------------------------------------------------- .FAQ_subtitles { margin-bottom: 0.2em; } .FAQ_question { @extend %roboto_bold; margin-bottom: 0; cursor: pointer; text-decoration: underline; font-weight: 700; } .FAQ_paragraph { display: none; margin-bottom: 0.5em; ul { padding-left: 2em; + + body.ar & { + padding-left: 0; + padding-right: 2em; + } } } .section-question-group__headline { @extend %roboto_bold; @extend %clarat_rounding_start; position: relative; margin-bottom: 0; padding: 0 1em; height: 40px; background: $brand_blue; color: $brand_white; line-height: 40px; .section-start--how & { background: $brand_blue; } .section-start--why & { background: #C3BFB4; } } .section-question-group__body { @extend %clarat_rounding_end; padding: 0.6em 1em 0.8em; background: $brand_beige; margin-bottom: 2em; }
5
0.092593
5
0
c121560cd6000f9e7f1c26c5abd987a0511a9b95
atom/styles.less
atom/styles.less
/* * Your Stylesheet */ @import 'ui-variables'; // Ensure that workspace is distinguishable from tab bar and status bar // (when no tabs are open) atom-workspace { background-color: @base-background-color; } atom-text-editor:not([mini]) { &::shadow { // De-italicize all syntax components which Monokai italicizes .storage.type, .entity.other.inherited-class, .variable.parameter, .support.type, .support.class { font-style: normal; } // Make selected line more prominent .line.cursor-line { background-color: rgba(255, 255, 255, 0.05); } } } .status-bar linter-bottom-status.inline-block { // Move Linter Status to the left of Encoding and Language in status bar // Only looks good if Position setting is "left" float: right; // Also reduce margin to converve space margin-right: 0; } linter-bottom-tab { // Hide Linter file tabs to conserve space in status bar display: none; // Decrease font size of file tabs to vertically center them // (in case I ever decide to show them again) font-size: 10px; } // Hide obtrusive overlay icon that displays when Find And Replace wraps around .find-wrap-icon { display: none !important; }
/* * Your Stylesheet */ @import 'ui-variables'; // Ensure that workspace is distinguishable from tab bar and status bar // (when no tabs are open) atom-workspace { background-color: @base-background-color; } atom-text-editor:not([mini]) { &::shadow { // De-italicize all syntax components which Monokai italicizes .storage.type, .entity.other.inherited-class, .variable.parameter, .support.type, .support.class { font-style: normal; } // Make selected line more prominent .line.cursor-line { background-color: rgba(255, 255, 255, 0.05); } // Make the underline under matched brackets solid rather than dotted .bracket-matcher .region { border-bottom-style: solid; } } } .status-bar linter-bottom-status.inline-block { // Move Linter Status to the left of Encoding and Language in status bar // Only looks good if Position setting is "left" float: right; // Also reduce margin to converve space margin-right: 0; } linter-bottom-tab { // Hide Linter file tabs to conserve space in status bar display: none; // Decrease font size of file tabs to vertically center them // (in case I ever decide to show them again) font-size: 10px; } // Hide obtrusive overlay icon that displays when Find And Replace wraps around .find-wrap-icon { display: none !important; }
Make bracket matcher underline solid
Make bracket matcher underline solid
Less
mit
caleb531/dotfiles,caleb531/dotfiles,caleb531/dotfiles,caleb531/dotfiles
less
## Code Before: /* * Your Stylesheet */ @import 'ui-variables'; // Ensure that workspace is distinguishable from tab bar and status bar // (when no tabs are open) atom-workspace { background-color: @base-background-color; } atom-text-editor:not([mini]) { &::shadow { // De-italicize all syntax components which Monokai italicizes .storage.type, .entity.other.inherited-class, .variable.parameter, .support.type, .support.class { font-style: normal; } // Make selected line more prominent .line.cursor-line { background-color: rgba(255, 255, 255, 0.05); } } } .status-bar linter-bottom-status.inline-block { // Move Linter Status to the left of Encoding and Language in status bar // Only looks good if Position setting is "left" float: right; // Also reduce margin to converve space margin-right: 0; } linter-bottom-tab { // Hide Linter file tabs to conserve space in status bar display: none; // Decrease font size of file tabs to vertically center them // (in case I ever decide to show them again) font-size: 10px; } // Hide obtrusive overlay icon that displays when Find And Replace wraps around .find-wrap-icon { display: none !important; } ## Instruction: Make bracket matcher underline solid ## Code After: /* * Your Stylesheet */ @import 'ui-variables'; // Ensure that workspace is distinguishable from tab bar and status bar // (when no tabs are open) atom-workspace { background-color: @base-background-color; } atom-text-editor:not([mini]) { &::shadow { // De-italicize all syntax components which Monokai italicizes .storage.type, .entity.other.inherited-class, .variable.parameter, .support.type, .support.class { font-style: normal; } // Make selected line more prominent .line.cursor-line { background-color: rgba(255, 255, 255, 0.05); } // Make the underline under matched brackets solid rather than dotted .bracket-matcher .region { border-bottom-style: solid; } } } .status-bar linter-bottom-status.inline-block { // Move Linter Status to the left of Encoding and Language in status bar // Only looks good if Position setting is "left" float: right; // Also reduce margin to converve space margin-right: 0; } linter-bottom-tab { // Hide Linter file tabs to conserve space in status bar display: none; // Decrease font size of file tabs to vertically center them // (in case I ever decide to show them again) font-size: 10px; } // Hide obtrusive overlay icon that displays when Find And Replace wraps around .find-wrap-icon { display: none !important; }
/* * Your Stylesheet */ @import 'ui-variables'; // Ensure that workspace is distinguishable from tab bar and status bar // (when no tabs are open) atom-workspace { background-color: @base-background-color; } atom-text-editor:not([mini]) { &::shadow { // De-italicize all syntax components which Monokai italicizes .storage.type, .entity.other.inherited-class, .variable.parameter, .support.type, .support.class { font-style: normal; } // Make selected line more prominent .line.cursor-line { background-color: rgba(255, 255, 255, 0.05); } + // Make the underline under matched brackets solid rather than dotted + .bracket-matcher .region { + border-bottom-style: solid; + } } } .status-bar linter-bottom-status.inline-block { // Move Linter Status to the left of Encoding and Language in status bar // Only looks good if Position setting is "left" float: right; // Also reduce margin to converve space margin-right: 0; } linter-bottom-tab { // Hide Linter file tabs to conserve space in status bar display: none; // Decrease font size of file tabs to vertically center them // (in case I ever decide to show them again) font-size: 10px; } // Hide obtrusive overlay icon that displays when Find And Replace wraps around .find-wrap-icon { display: none !important; }
4
0.081633
4
0
b3fa14e85182d1b0efa47452de51d93a66c63503
tests/test_unstow.py
tests/test_unstow.py
import os import steeve def test_unstow(runner, stowed_foo_package): """Must remove all previously linked files.""" result = runner.invoke(steeve.cli, ['unstow', 'foo']) assert result.exit_code == 0 assert not os.path.exists(os.path.join('bin', 'foo')) def test_strict(runner): """Must fail when trying to unstow nonstowed package.""" result = runner.invoke(steeve.cli, ['unstow', 'nonstowed']) assert result.exit_code == 1 assert 'not stowed' in result.output
import os import steeve def test_no_current(runner, foo_package): """Must fail when unstowing a package with no 'current' symlink.""" result = runner.invoke(steeve.cli, ['unstow', 'foo']) assert result.exit_code == 1 assert 'not stowed' in result.output def test_unstow(runner, stowed_foo_package): """Must remove all previously linked files.""" result = runner.invoke(steeve.cli, ['unstow', 'foo']) assert result.exit_code == 0 assert not os.path.exists(os.path.join('bin', 'foo')) def test_strict(runner): """Must fail when trying to unstow nonstowed package.""" result = runner.invoke(steeve.cli, ['unstow', 'nonstowed']) assert result.exit_code == 1 assert 'not stowed' in result.output
Test unstowing a package with no 'current' symlink
Test unstowing a package with no 'current' symlink
Python
bsd-3-clause
Perlence/steeve,Perlence/steeve
python
## Code Before: import os import steeve def test_unstow(runner, stowed_foo_package): """Must remove all previously linked files.""" result = runner.invoke(steeve.cli, ['unstow', 'foo']) assert result.exit_code == 0 assert not os.path.exists(os.path.join('bin', 'foo')) def test_strict(runner): """Must fail when trying to unstow nonstowed package.""" result = runner.invoke(steeve.cli, ['unstow', 'nonstowed']) assert result.exit_code == 1 assert 'not stowed' in result.output ## Instruction: Test unstowing a package with no 'current' symlink ## Code After: import os import steeve def test_no_current(runner, foo_package): """Must fail when unstowing a package with no 'current' symlink.""" result = runner.invoke(steeve.cli, ['unstow', 'foo']) assert result.exit_code == 1 assert 'not stowed' in result.output def test_unstow(runner, stowed_foo_package): """Must remove all previously linked files.""" result = runner.invoke(steeve.cli, ['unstow', 'foo']) assert result.exit_code == 0 assert not os.path.exists(os.path.join('bin', 'foo')) def test_strict(runner): """Must fail when trying to unstow nonstowed package.""" result = runner.invoke(steeve.cli, ['unstow', 'nonstowed']) assert result.exit_code == 1 assert 'not stowed' in result.output
import os import steeve + + + def test_no_current(runner, foo_package): + """Must fail when unstowing a package with no 'current' symlink.""" + result = runner.invoke(steeve.cli, ['unstow', 'foo']) + assert result.exit_code == 1 + assert 'not stowed' in result.output def test_unstow(runner, stowed_foo_package): """Must remove all previously linked files.""" result = runner.invoke(steeve.cli, ['unstow', 'foo']) assert result.exit_code == 0 assert not os.path.exists(os.path.join('bin', 'foo')) def test_strict(runner): """Must fail when trying to unstow nonstowed package.""" result = runner.invoke(steeve.cli, ['unstow', 'nonstowed']) assert result.exit_code == 1 assert 'not stowed' in result.output
7
0.411765
7
0
794eb4c586065c15896eb59e9a5fe6ce4568be31
README.md
README.md
Conan package for Qt -------------------------------------------- [![Build Status](https://travis-ci.org/osechet/conan-qt.svg?branch=master)](https://travis-ci.org/osechet/conan-qt) [![Build status](https://ci.appveyor.com/api/projects/status/gboj3x82d42eoasw/branch/master?svg=true)](https://ci.appveyor.com/project/osechet/conan-qt/branch/master) Still in development...
Conan package for Qt -------------------------------------------- [![Build Status](https://travis-ci.org/osechet/conan-qt.svg?branch=master)](https://travis-ci.org/osechet/conan-qt) [![Build status](https://ci.appveyor.com/api/projects/status/gboj3x82d42eoasw?svg=true)](https://ci.appveyor.com/project/osechet/conan-qt) Still in development...
Change source of appveyor badge
Change source of appveyor badge
Markdown
mit
osechet/conan-qt,cpace6/conan-qt,osechet/conan-qt,cpace6/conan-qt,osechet/conan-qt,cpace6/conan-qt
markdown
## Code Before: Conan package for Qt -------------------------------------------- [![Build Status](https://travis-ci.org/osechet/conan-qt.svg?branch=master)](https://travis-ci.org/osechet/conan-qt) [![Build status](https://ci.appveyor.com/api/projects/status/gboj3x82d42eoasw/branch/master?svg=true)](https://ci.appveyor.com/project/osechet/conan-qt/branch/master) Still in development... ## Instruction: Change source of appveyor badge ## Code After: Conan package for Qt -------------------------------------------- [![Build Status](https://travis-ci.org/osechet/conan-qt.svg?branch=master)](https://travis-ci.org/osechet/conan-qt) [![Build status](https://ci.appveyor.com/api/projects/status/gboj3x82d42eoasw?svg=true)](https://ci.appveyor.com/project/osechet/conan-qt) Still in development...
Conan package for Qt -------------------------------------------- [![Build Status](https://travis-ci.org/osechet/conan-qt.svg?branch=master)](https://travis-ci.org/osechet/conan-qt) - [![Build status](https://ci.appveyor.com/api/projects/status/gboj3x82d42eoasw/branch/master?svg=true)](https://ci.appveyor.com/project/osechet/conan-qt/branch/master) ? -------------- -------------- + [![Build status](https://ci.appveyor.com/api/projects/status/gboj3x82d42eoasw?svg=true)](https://ci.appveyor.com/project/osechet/conan-qt) Still in development...
2
0.25
1
1
738561f3e9ea0a680eac02890beaf701be9e1d99
.github/workflows/gem-publish.yml
.github/workflows/gem-publish.yml
name: Ruby Gem Publish on: push: tags: - '*' jobs: release: runs-on: ubuntu-latest env: GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }} steps: - uses: actions/checkout@v3 with: fetch-depth: 0 # need all the commits - uses: ruby/setup-ruby@v1 with: ruby-version: '2.6' bundler-cache: false - uses: actions/setup-node@v2 - name: Clean run: | rm -f *.gem git checkout lib/smartystreets_ruby_sdk/version.rb - name: Dependencies run: | gem install minitest - name: Test run: | rake test - name: Set Environment Variable run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - name: Grab Version run: | echo "VERSION = \"${{ env.RELEASE_VERSION }}\"" >> version.rb \ && gem build *.gemspec \ && git checkout smartystreets_ruby_sdk/version.rb - name: Push to rubygems.org run: | chmod 0600 /root/.gem/credentials gem push *.gem
name: Ruby Gem Publish on: push: tags: - '*' jobs: publish: runs-on: ubuntu-latest env: GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }} steps: - uses: actions/checkout@v3 with: fetch-depth: 0 # need all the commits - uses: ruby/setup-ruby@v1 with: ruby-version: '2.6' bundler-cache: false - uses: actions/setup-node@v2 - name: Clean run: | rm -f *.gem git checkout lib/smartystreets_ruby_sdk/version.rb - name: Dependencies run: | gem install minitest - name: Test run: | rake test - name: Set Environment Variable run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - name: Grab Version run: | echo "VERSION = \"${{ env.RELEASE_VERSION }}\"" >> version.rb \ && cat version.rb \ && gem build *.gemspec \ && git checkout version.rb - name: Push to rubygems.org run: | chmod 0600 /root/.gem/credentials gem push *.gem
Change subtitle of action; Added some debugging features
Change subtitle of action; Added some debugging features
YAML
apache-2.0
smartystreets/smartystreets-ruby-sdk,smartystreets/smartystreets-ruby-sdk
yaml
## Code Before: name: Ruby Gem Publish on: push: tags: - '*' jobs: release: runs-on: ubuntu-latest env: GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }} steps: - uses: actions/checkout@v3 with: fetch-depth: 0 # need all the commits - uses: ruby/setup-ruby@v1 with: ruby-version: '2.6' bundler-cache: false - uses: actions/setup-node@v2 - name: Clean run: | rm -f *.gem git checkout lib/smartystreets_ruby_sdk/version.rb - name: Dependencies run: | gem install minitest - name: Test run: | rake test - name: Set Environment Variable run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - name: Grab Version run: | echo "VERSION = \"${{ env.RELEASE_VERSION }}\"" >> version.rb \ && gem build *.gemspec \ && git checkout smartystreets_ruby_sdk/version.rb - name: Push to rubygems.org run: | chmod 0600 /root/.gem/credentials gem push *.gem ## Instruction: Change subtitle of action; Added some debugging features ## Code After: name: Ruby Gem Publish on: push: tags: - '*' jobs: publish: runs-on: ubuntu-latest env: GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }} steps: - uses: actions/checkout@v3 with: fetch-depth: 0 # need all the commits - uses: ruby/setup-ruby@v1 with: ruby-version: '2.6' bundler-cache: false - uses: actions/setup-node@v2 - name: Clean run: | rm -f *.gem git checkout lib/smartystreets_ruby_sdk/version.rb - name: Dependencies run: | gem install minitest - name: Test run: | rake test - name: Set Environment Variable run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - name: Grab Version run: | echo "VERSION = \"${{ env.RELEASE_VERSION }}\"" >> version.rb \ && cat version.rb \ && gem build *.gemspec \ && git checkout version.rb - name: Push to rubygems.org run: | chmod 0600 /root/.gem/credentials gem push *.gem
name: Ruby Gem Publish on: push: tags: - '*' jobs: - release: + publish: runs-on: ubuntu-latest env: GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }} steps: - uses: actions/checkout@v3 with: fetch-depth: 0 # need all the commits - uses: ruby/setup-ruby@v1 with: ruby-version: '2.6' bundler-cache: false - uses: actions/setup-node@v2 - name: Clean run: | rm -f *.gem git checkout lib/smartystreets_ruby_sdk/version.rb - name: Dependencies run: | gem install minitest - name: Test run: | rake test - name: Set Environment Variable run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - name: Grab Version run: | echo "VERSION = \"${{ env.RELEASE_VERSION }}\"" >> version.rb \ + && cat version.rb \ && gem build *.gemspec \ - && git checkout smartystreets_ruby_sdk/version.rb ? ----------------------- + && git checkout version.rb - name: Push to rubygems.org run: | chmod 0600 /root/.gem/credentials gem push *.gem
5
0.1
3
2
cbe9f9e914b10e46e6100def17b92555c0d84b34
readme.md
readme.md
This little project was inspired by Paul Schou's [TRANSLATOR, BINARY xlate](http://home.paulschou.net/tools/xlate/). I used xlate used often, but it lacked some features. So I created this project and added a few features, such as XML and JSON beautifier. Checkout out the [demo](http://manly-malinda.gopagoda.com/). ## Installation Clone repository, install submodules. ``` > git clone https://github.com/r15ch13/toolbox.git > cd toolbox > git submodule init > git submodule update ``` Install dependencies using [Composer](http://getcomposer.org/). ``` > php composer.phar install ``` Now follow the [Laravel installation](http://laravel.com/docs/installation) instructions. Generate application key: ``` > chmod -R 777 app/storage > php artisan key:generate ``` Change application settings: ``` > nano app/config/app.php ``` Change database settings: ``` > nano app/config/database.php ``` Migrate database: ``` > php artisan migrate ``` Done!
This little project was inspired by Paul Schou's [TRANSLATOR, BINARY xlate](http://home.paulschou.net/tools/xlate/). I used xlate used often, but it lacked some features. So I created this project and added a few features, such as XML and JSON beautifier. Checkout out the [demo1](http://manly-malinda.gopagoda.com/)/[demo2](https://r15.ch/). ## Installation Clone repository, install submodules. ``` > git clone https://github.com/r15ch13/toolbox.git > cd toolbox > git submodule init > git submodule update ``` Install dependencies using [Composer](http://getcomposer.org/). ``` > php composer.phar install ``` Now follow the [Laravel installation](http://laravel.com/docs/installation) instructions. Generate application key: ``` > chmod -R 777 app/storage > php artisan key:generate ``` Change application settings: ``` > nano app/config/app.php ``` Change database settings: ``` > nano app/config/database.php ``` Migrate database: ``` > php artisan migrate ``` Done!
Add r15.ch as additional Demopage
Add r15.ch as additional Demopage
Markdown
mit
r15ch13/toolbox,r15ch13/toolbox,r15ch13/toolbox
markdown
## Code Before: This little project was inspired by Paul Schou's [TRANSLATOR, BINARY xlate](http://home.paulschou.net/tools/xlate/). I used xlate used often, but it lacked some features. So I created this project and added a few features, such as XML and JSON beautifier. Checkout out the [demo](http://manly-malinda.gopagoda.com/). ## Installation Clone repository, install submodules. ``` > git clone https://github.com/r15ch13/toolbox.git > cd toolbox > git submodule init > git submodule update ``` Install dependencies using [Composer](http://getcomposer.org/). ``` > php composer.phar install ``` Now follow the [Laravel installation](http://laravel.com/docs/installation) instructions. Generate application key: ``` > chmod -R 777 app/storage > php artisan key:generate ``` Change application settings: ``` > nano app/config/app.php ``` Change database settings: ``` > nano app/config/database.php ``` Migrate database: ``` > php artisan migrate ``` Done! ## Instruction: Add r15.ch as additional Demopage ## Code After: This little project was inspired by Paul Schou's [TRANSLATOR, BINARY xlate](http://home.paulschou.net/tools/xlate/). I used xlate used often, but it lacked some features. So I created this project and added a few features, such as XML and JSON beautifier. Checkout out the [demo1](http://manly-malinda.gopagoda.com/)/[demo2](https://r15.ch/). ## Installation Clone repository, install submodules. ``` > git clone https://github.com/r15ch13/toolbox.git > cd toolbox > git submodule init > git submodule update ``` Install dependencies using [Composer](http://getcomposer.org/). ``` > php composer.phar install ``` Now follow the [Laravel installation](http://laravel.com/docs/installation) instructions. Generate application key: ``` > chmod -R 777 app/storage > php artisan key:generate ``` Change application settings: ``` > nano app/config/app.php ``` Change database settings: ``` > nano app/config/database.php ``` Migrate database: ``` > php artisan migrate ``` Done!
This little project was inspired by Paul Schou's [TRANSLATOR, BINARY xlate](http://home.paulschou.net/tools/xlate/). - I used xlate used often, but it lacked some features. So I created this project and added a few features, such as XML and JSON beautifier. Checkout out the [demo](http://manly-malinda.gopagoda.com/). ? ^ + I used xlate used often, but it lacked some features. So I created this project and added a few features, such as XML and JSON beautifier. Checkout out the [demo1](http://manly-malinda.gopagoda.com/)/[demo2](https://r15.ch/). ? + ^^^^^^^^^^^^^^^^^^^^^^^^^^ ## Installation Clone repository, install submodules. ``` > git clone https://github.com/r15ch13/toolbox.git > cd toolbox > git submodule init > git submodule update ``` Install dependencies using [Composer](http://getcomposer.org/). ``` > php composer.phar install ``` Now follow the [Laravel installation](http://laravel.com/docs/installation) instructions. Generate application key: ``` > chmod -R 777 app/storage > php artisan key:generate ``` Change application settings: ``` > nano app/config/app.php ``` Change database settings: ``` > nano app/config/database.php ``` Migrate database: ``` > php artisan migrate ``` Done!
2
0.051282
1
1
b22e4b1565d5ba6cf189206291734c833b800bb7
lightsd.rb
lightsd.rb
class Etl < Formula desc "Daemon to control your LIFX wifi smart bulbs" homepage "https://github.com/lopter/lightsd/" url "https://api.github.com/repos/lopter/lightsd/tarball/0.9.1" sha256 "ef4f8056bf39c8f2c440e442f047cafce1c102e565bb007791a27f77588157c2" depends_on "cmake" => :build depends_on "libbsd" => :recommended depends_on "libevent" => :build depends_on "python" => :optional def install args = %W[ -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=#{prefix} ] system "cmake", *args system "make", "install" end head do url "https://github.com/lopter/lightsd.git" end test do Dir.mktmpdir("lightsd-test") do |dir| args = %W[ -l ::1:0 -l 127.0.0.1:0 -c #{dir}/lightsd.cmd -h ] system "#{bin}/lightsd", *args end end end
require "formula" class Lightsd < Formula desc "Daemon to control your LIFX wifi smart bulbs" homepage "https://github.com/lopter/lightsd/" url "https://api.github.com/repos/lopter/lightsd/tarball/0.9.1" sha256 "ef4f8056bf39c8f2c440e442f047cafce1c102e565bb007791a27f77588157c2" depends_on "cmake" => :build depends_on "libbsd" => :optional depends_on "libevent" => :build depends_on "python" => :optional def install args = %W[ -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=#{prefix} ] system "cmake", *args system "make", "install" end head do url "https://github.com/lopter/lightsd.git" end test do Dir.mktmpdir("lightsd-test") do |dir| args = %W[ -l ::1:0 -l 127.0.0.1:0 -c #{dir}/lightsd.cmd -h ] system "#{bin}/lightsd", *args end end end
Fix formula name and make libbsd optional to avoid warnings
Fix formula name and make libbsd optional to avoid warnings
Ruby
bsd-3-clause
lopter/homebrew-lightsd
ruby
## Code Before: class Etl < Formula desc "Daemon to control your LIFX wifi smart bulbs" homepage "https://github.com/lopter/lightsd/" url "https://api.github.com/repos/lopter/lightsd/tarball/0.9.1" sha256 "ef4f8056bf39c8f2c440e442f047cafce1c102e565bb007791a27f77588157c2" depends_on "cmake" => :build depends_on "libbsd" => :recommended depends_on "libevent" => :build depends_on "python" => :optional def install args = %W[ -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=#{prefix} ] system "cmake", *args system "make", "install" end head do url "https://github.com/lopter/lightsd.git" end test do Dir.mktmpdir("lightsd-test") do |dir| args = %W[ -l ::1:0 -l 127.0.0.1:0 -c #{dir}/lightsd.cmd -h ] system "#{bin}/lightsd", *args end end end ## Instruction: Fix formula name and make libbsd optional to avoid warnings ## Code After: require "formula" class Lightsd < Formula desc "Daemon to control your LIFX wifi smart bulbs" homepage "https://github.com/lopter/lightsd/" url "https://api.github.com/repos/lopter/lightsd/tarball/0.9.1" sha256 "ef4f8056bf39c8f2c440e442f047cafce1c102e565bb007791a27f77588157c2" depends_on "cmake" => :build depends_on "libbsd" => :optional depends_on "libevent" => :build depends_on "python" => :optional def install args = %W[ -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=#{prefix} ] system "cmake", *args system "make", "install" end head do url "https://github.com/lopter/lightsd.git" end test do Dir.mktmpdir("lightsd-test") do |dir| args = %W[ -l ::1:0 -l 127.0.0.1:0 -c #{dir}/lightsd.cmd -h ] system "#{bin}/lightsd", *args end end end
+ require "formula" + - class Etl < Formula ? ^ ^ + class Lightsd < Formula ? ^^^^ ^^ desc "Daemon to control your LIFX wifi smart bulbs" homepage "https://github.com/lopter/lightsd/" url "https://api.github.com/repos/lopter/lightsd/tarball/0.9.1" sha256 "ef4f8056bf39c8f2c440e442f047cafce1c102e565bb007791a27f77588157c2" depends_on "cmake" => :build - depends_on "libbsd" => :recommended ? --- ^^^ ^^^ + depends_on "libbsd" => :optional ? ^^^^ ^^ depends_on "libevent" => :build depends_on "python" => :optional def install args = %W[ -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=#{prefix} ] system "cmake", *args system "make", "install" end head do url "https://github.com/lopter/lightsd.git" end test do Dir.mktmpdir("lightsd-test") do |dir| args = %W[ -l ::1:0 -l 127.0.0.1:0 -c #{dir}/lightsd.cmd -h ] system "#{bin}/lightsd", *args end end end
6
0.153846
4
2
8dd26758c74467471e13a1ff494cb571c10e4953
src/html/templates/slides/sometime-after-the-beginning.html
src/html/templates/slides/sometime-after-the-beginning.html
<section> <h1>Sometime after the beginning</h1> <h2 class="fragment">there was</h2> <h1 class="fragment">JavaScript</h1> <p class="fragment font-size-sm">oh thank you, the timeline is so much more clear now</p> </section>
<section> <h1>Sometime after the beginning</h1> <h2 class="fragment">there was</h2> <h1 class="fragment">JavaScript</h1> </section> <section> <h2>JavaScript</h2> <ul> <li> Initially developed in 10 days in 1995 by Brendan Eich at Netscape </li> <li> Very little relation to Java <ul> <li> The confusing name was a marketing ploy by Netscape to give their new language more cachet </li> </ul> </li> <li>Standardized under the name ECMAScript</li> <li> Supported in all major browsers without plugins </li> <li>Makes the staic web more dynamic and interactive</li> </ul> <ul class="unstyled margin-top-md"> <li> <a href="https://en.wikipedia.org/wiki/JavaScript" target="_blank">Wikipedia - JavaScript</a> </li> </ul> </section>
Add some background on JavaScript
Add some background on JavaScript
HTML
mit
tdg5/js4pm,tdg5/front-end-skills-for-pms,tdg5/js4pm,tdg5/front-end-skills-for-pms
html
## Code Before: <section> <h1>Sometime after the beginning</h1> <h2 class="fragment">there was</h2> <h1 class="fragment">JavaScript</h1> <p class="fragment font-size-sm">oh thank you, the timeline is so much more clear now</p> </section> ## Instruction: Add some background on JavaScript ## Code After: <section> <h1>Sometime after the beginning</h1> <h2 class="fragment">there was</h2> <h1 class="fragment">JavaScript</h1> </section> <section> <h2>JavaScript</h2> <ul> <li> Initially developed in 10 days in 1995 by Brendan Eich at Netscape </li> <li> Very little relation to Java <ul> <li> The confusing name was a marketing ploy by Netscape to give their new language more cachet </li> </ul> </li> <li>Standardized under the name ECMAScript</li> <li> Supported in all major browsers without plugins </li> <li>Makes the staic web more dynamic and interactive</li> </ul> <ul class="unstyled margin-top-md"> <li> <a href="https://en.wikipedia.org/wiki/JavaScript" target="_blank">Wikipedia - JavaScript</a> </li> </ul> </section>
<section> <h1>Sometime after the beginning</h1> <h2 class="fragment">there was</h2> <h1 class="fragment">JavaScript</h1> - <p class="fragment font-size-sm">oh thank you, the timeline is so much more clear now</p> </section> + <section> + <h2>JavaScript</h2> + <ul> + <li> + Initially developed in 10 days in 1995 by Brendan Eich at Netscape + </li> + <li> + Very little relation to Java + <ul> + <li> + The confusing name was a marketing ploy by Netscape to give their + new language more cachet + </li> + </ul> + </li> + <li>Standardized under the name ECMAScript</li> + <li> + Supported in all major browsers without plugins + </li> + <li>Makes the staic web more dynamic and interactive</li> + </ul> + <ul class="unstyled margin-top-md"> + <li> + <a href="https://en.wikipedia.org/wiki/JavaScript" target="_blank">Wikipedia - JavaScript</a> + </li> + </ul> + </section>
28
4.666667
27
1
a1863068e2ff93796d0b764a302299f34d5747ea
app/flows/inherits_someone_dies_without_will_flow/outcomes/outcome_4.erb
app/flows/inherits_someone_dies_without_will_flow/outcomes/outcome_4.erb
<% text_for :title do %> The estate is shared equally between the brothers or sisters. <% end %> <% govspeak_for :body do %> If a brother or sister has already died, their children (nieces and nephews of the deceased) inherit in their place. <% end %> <% govspeak_for :next_steps do %> <%= render partial: 'next_step_links', locals: { next_steps: calculator.next_steps } %> <% end %>
<% text_for :title do %> The estate is shared equally between the brothers or sisters. <% end %> <% govspeak_for :body do %> If a brother or sister has died before the deceased died, their children (nieces and nephews of the deceased) inherit in their place. <% end %> <% govspeak_for :next_steps do %> <%= render partial: 'next_step_links', locals: { next_steps: calculator.next_steps } %> <% end %>
Update to inheritance sentence - outcome 4
Update to inheritance sentence - outcome 4
HTML+ERB
mit
alphagov/smart-answers,alphagov/smart-answers,alphagov/smart-answers,alphagov/smart-answers
html+erb
## Code Before: <% text_for :title do %> The estate is shared equally between the brothers or sisters. <% end %> <% govspeak_for :body do %> If a brother or sister has already died, their children (nieces and nephews of the deceased) inherit in their place. <% end %> <% govspeak_for :next_steps do %> <%= render partial: 'next_step_links', locals: { next_steps: calculator.next_steps } %> <% end %> ## Instruction: Update to inheritance sentence - outcome 4 ## Code After: <% text_for :title do %> The estate is shared equally between the brothers or sisters. <% end %> <% govspeak_for :body do %> If a brother or sister has died before the deceased died, their children (nieces and nephews of the deceased) inherit in their place. <% end %> <% govspeak_for :next_steps do %> <%= render partial: 'next_step_links', locals: { next_steps: calculator.next_steps } %> <% end %>
<% text_for :title do %> The estate is shared equally between the brothers or sisters. <% end %> <% govspeak_for :body do %> - If a brother or sister has already died, their children (nieces and nephews of the deceased) inherit in their place. ? ^^ - + If a brother or sister has died before the deceased died, their children (nieces and nephews of the deceased) inherit in their place. ? ^^^^^^^^^ +++++++++ ++ <% end %> <% govspeak_for :next_steps do %> <%= render partial: 'next_step_links', locals: { next_steps: calculator.next_steps } %> <% end %>
2
0.181818
1
1
6b9eeb524f43bce110add5c20c850691b7c226f5
lib/kamikakushi.rb
lib/kamikakushi.rb
module Kamikakushi extend ActiveSupport::Concern included do default_scope { without_deleted } alias_method_chain :destroy, :kamikakushi alias_method_chain :destroyed?, :kamikakushi scope :with_deleted, -> { unscope(where: :deleted_at) } scope :without_deleted, -> { where(deleted_at: nil) } scope :only_deleted, -> { with_deleted.where.not(deleted_at: nil) } end def destroy_with_kamikakushi run_callbacks(:destroy) do update_column(:deleted_at, Time.current) end end def destroyed_with_kamikakushi? self.deleted_at? || destroyed_without_kamikakushi? end def restore update_column(:deleted_at, self.deleted_at = nil) end def purge destroy_without_kamikakushi end end
module Kamikakushi extend ActiveSupport::Concern included do default_scope { without_deleted } alias_method_chain :destroy, :kamikakushi alias_method_chain :destroyed?, :kamikakushi scope :with_deleted, -> { unscope(where: :deleted_at) } scope :without_deleted, -> { where(deleted_at: nil) } scope :only_deleted, -> { with_deleted.where.not(deleted_at: nil) } end def destroy_with_kamikakushi run_callbacks(:destroy) do touch(:deleted_at) end end def destroyed_with_kamikakushi? self.deleted_at? || destroyed_without_kamikakushi? end def restore update_column(:deleted_at, self.deleted_at = nil) end def purge destroy_without_kamikakushi end end
Use touch instead of update_column
Use touch instead of update_column
Ruby
mit
ppworks/kamikakushi
ruby
## Code Before: module Kamikakushi extend ActiveSupport::Concern included do default_scope { without_deleted } alias_method_chain :destroy, :kamikakushi alias_method_chain :destroyed?, :kamikakushi scope :with_deleted, -> { unscope(where: :deleted_at) } scope :without_deleted, -> { where(deleted_at: nil) } scope :only_deleted, -> { with_deleted.where.not(deleted_at: nil) } end def destroy_with_kamikakushi run_callbacks(:destroy) do update_column(:deleted_at, Time.current) end end def destroyed_with_kamikakushi? self.deleted_at? || destroyed_without_kamikakushi? end def restore update_column(:deleted_at, self.deleted_at = nil) end def purge destroy_without_kamikakushi end end ## Instruction: Use touch instead of update_column ## Code After: module Kamikakushi extend ActiveSupport::Concern included do default_scope { without_deleted } alias_method_chain :destroy, :kamikakushi alias_method_chain :destroyed?, :kamikakushi scope :with_deleted, -> { unscope(where: :deleted_at) } scope :without_deleted, -> { where(deleted_at: nil) } scope :only_deleted, -> { with_deleted.where.not(deleted_at: nil) } end def destroy_with_kamikakushi run_callbacks(:destroy) do touch(:deleted_at) end end def destroyed_with_kamikakushi? self.deleted_at? || destroyed_without_kamikakushi? end def restore update_column(:deleted_at, self.deleted_at = nil) end def purge destroy_without_kamikakushi end end
module Kamikakushi extend ActiveSupport::Concern included do default_scope { without_deleted } alias_method_chain :destroy, :kamikakushi alias_method_chain :destroyed?, :kamikakushi scope :with_deleted, -> { unscope(where: :deleted_at) } scope :without_deleted, -> { where(deleted_at: nil) } scope :only_deleted, -> { with_deleted.where.not(deleted_at: nil) } end def destroy_with_kamikakushi run_callbacks(:destroy) do - update_column(:deleted_at, Time.current) + touch(:deleted_at) end end def destroyed_with_kamikakushi? self.deleted_at? || destroyed_without_kamikakushi? end def restore update_column(:deleted_at, self.deleted_at = nil) end def purge destroy_without_kamikakushi end end
2
0.051282
1
1
33dc25d864ab2cfefa377877b333b6f053144c24
qtcontacts-tracker.pri
qtcontacts-tracker.pri
message("qtcontacts-tracker.pri") !contains(DEFINES, QTCONTACTS-TRACKER_PRI) { message(" ^ including") DEFINES += QTCONTACTS-TRACKER_PRI INCLUDEPATH += /usr/include/qt4/QtContacts INCLUDEPATH += $$PWD LIBS += -lqttracker LIBS += -lQtContacts HEADERS += qcontacttrackerbackend_p.h \ qtrackercontactasyncrequest.h \ trackerchangelistener.h SOURCES += qcontacttrackerbackend.cpp \ qtrackercontactasyncrequest.cpp \ trackerchangelistener.cpp }
message("qtcontacts-tracker.pri") !contains(DEFINES, QTCONTACTS-TRACKER_PRI) { message(" ^ including") DEFINES += QTCONTACTS-TRACKER_PRI INCLUDEPATH += /usr/include/qt4/QtContacts LIBS += -lqttracker LIBS += -lQtContacts HEADERS += $$PWD/qcontacttrackerbackend_p.h \ $$PWD/qtrackercontactasyncrequest.h \ $$PWD/trackerchangelistener.h SOURCES += $$PWD/qcontacttrackerbackend.cpp \ $$PWD/qtrackercontactasyncrequest.cpp \ $$PWD/trackerchangelistener.cpp }
Fix source and header paths.
Fix source and header paths.
QMake
lgpl-2.1
qtproject/qt-mobility,enthought/qt-mobility,tmcguire/qt-mobility,KDE/android-qt-mobility,tmcguire/qt-mobility,enthought/qt-mobility,enthought/qt-mobility,KDE/android-qt-mobility,kaltsi/qt-mobility,tmcguire/qt-mobility,KDE/android-qt-mobility,kaltsi/qt-mobility,qtproject/qt-mobility,qtproject/qt-mobility,tmcguire/qt-mobility,enthought/qt-mobility,KDE/android-qt-mobility,enthought/qt-mobility,qtproject/qt-mobility,kaltsi/qt-mobility,enthought/qt-mobility,tmcguire/qt-mobility,kaltsi/qt-mobility,kaltsi/qt-mobility,qtproject/qt-mobility,qtproject/qt-mobility,kaltsi/qt-mobility
qmake
## Code Before: message("qtcontacts-tracker.pri") !contains(DEFINES, QTCONTACTS-TRACKER_PRI) { message(" ^ including") DEFINES += QTCONTACTS-TRACKER_PRI INCLUDEPATH += /usr/include/qt4/QtContacts INCLUDEPATH += $$PWD LIBS += -lqttracker LIBS += -lQtContacts HEADERS += qcontacttrackerbackend_p.h \ qtrackercontactasyncrequest.h \ trackerchangelistener.h SOURCES += qcontacttrackerbackend.cpp \ qtrackercontactasyncrequest.cpp \ trackerchangelistener.cpp } ## Instruction: Fix source and header paths. ## Code After: message("qtcontacts-tracker.pri") !contains(DEFINES, QTCONTACTS-TRACKER_PRI) { message(" ^ including") DEFINES += QTCONTACTS-TRACKER_PRI INCLUDEPATH += /usr/include/qt4/QtContacts LIBS += -lqttracker LIBS += -lQtContacts HEADERS += $$PWD/qcontacttrackerbackend_p.h \ $$PWD/qtrackercontactasyncrequest.h \ $$PWD/trackerchangelistener.h SOURCES += $$PWD/qcontacttrackerbackend.cpp \ $$PWD/qtrackercontactasyncrequest.cpp \ $$PWD/trackerchangelistener.cpp }
message("qtcontacts-tracker.pri") !contains(DEFINES, QTCONTACTS-TRACKER_PRI) { message(" ^ including") DEFINES += QTCONTACTS-TRACKER_PRI INCLUDEPATH += /usr/include/qt4/QtContacts - INCLUDEPATH += $$PWD LIBS += -lqttracker LIBS += -lQtContacts - HEADERS += qcontacttrackerbackend_p.h \ + HEADERS += $$PWD/qcontacttrackerbackend_p.h \ ? ++++++ - qtrackercontactasyncrequest.h \ + $$PWD/qtrackercontactasyncrequest.h \ ? ++++++ - trackerchangelistener.h + $$PWD/trackerchangelistener.h ? ++++++ - SOURCES += qcontacttrackerbackend.cpp \ + SOURCES += $$PWD/qcontacttrackerbackend.cpp \ ? ++++++ - qtrackercontactasyncrequest.cpp \ + $$PWD/qtrackercontactasyncrequest.cpp \ ? ++++++ - trackerchangelistener.cpp + $$PWD/trackerchangelistener.cpp ? ++++++ }
13
0.619048
6
7
a8eabb2ec9b1cc1c453e97f6a701db7e121e77d0
arc/arc/Model/FileSystem.h
arc/arc/Model/FileSystem.h
// // FileSystem.h // arc // // Created by Jerome Cheng on 19/3/13. // Copyright (c) 2013 nus.cs3217. All rights reserved. // #import <Foundation/Foundation.h> #import "Folder.h" @interface FileSystem : NSObject { Folder *_rootFolder; // The root folder. } // Returns the root folder of the entire file system. - (Folder*)getRootFolder; // Returns the single FileSystem instance. + (FileSystem*)getInstance; @end
// // FileSystem.h // arc // // Created by Jerome Cheng on 19/3/13. // Copyright (c) 2013 nus.cs3217. All rights reserved. // #import <Foundation/Foundation.h> #import "Folder.h" @interface FileSystem : NSObject { @private Folder *_rootFolder; // The root folder. } // Returns the root folder of the entire file system. - (Folder*)getRootFolder; // Returns the single FileSystem instance. + (FileSystem*)getInstance; @end
Add @private indicator to instance variable.
Add @private indicator to instance variable.
C
mit
BenTobias/arc,BenTobias/arc,BenTobias/arc,BenTobias/arc,BenTobias/arc,BenTobias/arc
c
## Code Before: // // FileSystem.h // arc // // Created by Jerome Cheng on 19/3/13. // Copyright (c) 2013 nus.cs3217. All rights reserved. // #import <Foundation/Foundation.h> #import "Folder.h" @interface FileSystem : NSObject { Folder *_rootFolder; // The root folder. } // Returns the root folder of the entire file system. - (Folder*)getRootFolder; // Returns the single FileSystem instance. + (FileSystem*)getInstance; @end ## Instruction: Add @private indicator to instance variable. ## Code After: // // FileSystem.h // arc // // Created by Jerome Cheng on 19/3/13. // Copyright (c) 2013 nus.cs3217. All rights reserved. // #import <Foundation/Foundation.h> #import "Folder.h" @interface FileSystem : NSObject { @private Folder *_rootFolder; // The root folder. } // Returns the root folder of the entire file system. - (Folder*)getRootFolder; // Returns the single FileSystem instance. + (FileSystem*)getInstance; @end
// // FileSystem.h // arc // // Created by Jerome Cheng on 19/3/13. // Copyright (c) 2013 nus.cs3217. All rights reserved. // #import <Foundation/Foundation.h> #import "Folder.h" @interface FileSystem : NSObject { + @private Folder *_rootFolder; // The root folder. } // Returns the root folder of the entire file system. - (Folder*)getRootFolder; // Returns the single FileSystem instance. + (FileSystem*)getInstance; @end
1
0.045455
1
0
055467f48024a31ef0e41b891531ce58d011982e
.travis.yml
.travis.yml
language: c install: - wget https://raw.githubusercontent.com/csdms/wmt-exe/master/scripts/install - python ./install $(pwd)
language: c install: - gcc -dumpversion - g++ -dumpversion - which gcc - which g++ - which ruby - which java - wget https://raw.githubusercontent.com/csdms/wmt-exe/master/scripts/install - python ./install $(pwd)
Print compiler versions and paths.
Print compiler versions and paths.
YAML
mit
mcflugen/bmi-tutorial
yaml
## Code Before: language: c install: - wget https://raw.githubusercontent.com/csdms/wmt-exe/master/scripts/install - python ./install $(pwd) ## Instruction: Print compiler versions and paths. ## Code After: language: c install: - gcc -dumpversion - g++ -dumpversion - which gcc - which g++ - which ruby - which java - wget https://raw.githubusercontent.com/csdms/wmt-exe/master/scripts/install - python ./install $(pwd)
language: c install: + - gcc -dumpversion + - g++ -dumpversion + - which gcc + - which g++ + - which ruby + - which java - wget https://raw.githubusercontent.com/csdms/wmt-exe/master/scripts/install - python ./install $(pwd)
6
1.2
6
0
3e6dd3d2929d924de461f5bf470547713eefcac9
index.html
index.html
<!DOCTYPE html> <html> <body> <select> <option>djay.png</option> <option>djay-indexed.png</option> <option>laptop.png</option> <option>trees.png</option> <option>chompy.png</option> <option>spinfox.png</option> <option>ball.png</option> <option>loading.png</option> </select><br><br> <canvas></canvas> <script src="zlib.js"></script> <script src="png.js"></script> <script> var canvas = document.getElementsByTagName('canvas')[0]; PNG.load('images/djay.png', canvas); var select = document.getElementsByTagName('select')[0]; select.onchange = function() { canvas.width = canvas.height = 0; PNG.load('images/' + select.options[select.selectedIndex].value, canvas); } </script> </body> </html>
<!DOCTYPE html> <html> <body> <a href="http://github.com/devongovett/png.js"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://a248.e.akamai.net/assets.github.com/img/e6bef7a091f5f3138b8cd40bc3e114258dd68ddf/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub"></a> <select> <option>djay.png</option> <option>djay-indexed.png</option> <option>laptop.png</option> <option>trees.png</option> <option>chompy.png</option> <option>spinfox.png</option> <option>ball.png</option> <option>loading.png</option> </select><br><br> <canvas></canvas> <script src="zlib.js"></script> <script src="png.js"></script> <script> var canvas = document.getElementsByTagName('canvas')[0]; PNG.load('images/djay.png', canvas); var select = document.getElementsByTagName('select')[0]; select.onchange = function() { canvas.width = canvas.height = 0; PNG.load('images/' + select.options[select.selectedIndex].value, canvas); } </script> </body> </html>
Add github badge to demo page
Add github badge to demo page
HTML
mit
devongovett/png.js,devongovett/png.js
html
## Code Before: <!DOCTYPE html> <html> <body> <select> <option>djay.png</option> <option>djay-indexed.png</option> <option>laptop.png</option> <option>trees.png</option> <option>chompy.png</option> <option>spinfox.png</option> <option>ball.png</option> <option>loading.png</option> </select><br><br> <canvas></canvas> <script src="zlib.js"></script> <script src="png.js"></script> <script> var canvas = document.getElementsByTagName('canvas')[0]; PNG.load('images/djay.png', canvas); var select = document.getElementsByTagName('select')[0]; select.onchange = function() { canvas.width = canvas.height = 0; PNG.load('images/' + select.options[select.selectedIndex].value, canvas); } </script> </body> </html> ## Instruction: Add github badge to demo page ## Code After: <!DOCTYPE html> <html> <body> <a href="http://github.com/devongovett/png.js"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://a248.e.akamai.net/assets.github.com/img/e6bef7a091f5f3138b8cd40bc3e114258dd68ddf/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub"></a> <select> <option>djay.png</option> <option>djay-indexed.png</option> <option>laptop.png</option> <option>trees.png</option> <option>chompy.png</option> <option>spinfox.png</option> <option>ball.png</option> <option>loading.png</option> </select><br><br> <canvas></canvas> <script src="zlib.js"></script> <script src="png.js"></script> <script> var canvas = document.getElementsByTagName('canvas')[0]; PNG.load('images/djay.png', canvas); var select = document.getElementsByTagName('select')[0]; select.onchange = function() { canvas.width = canvas.height = 0; PNG.load('images/' + select.options[select.selectedIndex].value, canvas); } </script> </body> </html>
<!DOCTYPE html> <html> <body> + <a href="http://github.com/devongovett/png.js"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://a248.e.akamai.net/assets.github.com/img/e6bef7a091f5f3138b8cd40bc3e114258dd68ddf/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub"></a> <select> <option>djay.png</option> <option>djay-indexed.png</option> <option>laptop.png</option> <option>trees.png</option> <option>chompy.png</option> <option>spinfox.png</option> <option>ball.png</option> <option>loading.png</option> </select><br><br> <canvas></canvas> <script src="zlib.js"></script> <script src="png.js"></script> <script> var canvas = document.getElementsByTagName('canvas')[0]; PNG.load('images/djay.png', canvas); var select = document.getElementsByTagName('select')[0]; select.onchange = function() { canvas.width = canvas.height = 0; PNG.load('images/' + select.options[select.selectedIndex].value, canvas); } </script> </body> </html>
1
0.034483
1
0
5c1fa9ba4e012a25aea47d5f08302bce4a28d473
tests/dummy/app/controllers/application.js
tests/dummy/app/controllers/application.js
import Ember from 'ember'; export default Ember.Controller.extend({ toggleModal: false, actions: { testing() { window.swal("Hello World", "success"); }, toggle() { this.set('toggleModal', true); } } });
import Ember from 'ember'; export default Ember.Controller.extend({ toggleModal: false, actions: { testing() { window.swal({ title: 'Submit email to run ajax request', input: 'email', showCancelButton: true, confirmButtonText: 'Submit', preConfirm: function() { return new Ember.RSVP.Promise(function(resolve) { window.swal.enableLoading(); setTimeout(function() { resolve(); }, 2000); }); }, allowOutsideClick: false }).then(function(email) { if (email) { window.swal({ type: 'success', title: 'Ajax request finished!', html: 'Submitted email: ' + email }); } }); }, toggle() { this.set('toggleModal', true); } } });
Make a bit more complex dummy
Make a bit more complex dummy
JavaScript
mit
Tonkpils/ember-sweetalert,Tonkpils/ember-sweetalert
javascript
## Code Before: import Ember from 'ember'; export default Ember.Controller.extend({ toggleModal: false, actions: { testing() { window.swal("Hello World", "success"); }, toggle() { this.set('toggleModal', true); } } }); ## Instruction: Make a bit more complex dummy ## Code After: import Ember from 'ember'; export default Ember.Controller.extend({ toggleModal: false, actions: { testing() { window.swal({ title: 'Submit email to run ajax request', input: 'email', showCancelButton: true, confirmButtonText: 'Submit', preConfirm: function() { return new Ember.RSVP.Promise(function(resolve) { window.swal.enableLoading(); setTimeout(function() { resolve(); }, 2000); }); }, allowOutsideClick: false }).then(function(email) { if (email) { window.swal({ type: 'success', title: 'Ajax request finished!', html: 'Submitted email: ' + email }); } }); }, toggle() { this.set('toggleModal', true); } } });
import Ember from 'ember'; export default Ember.Controller.extend({ toggleModal: false, actions: { testing() { - window.swal("Hello World", "success"); + window.swal({ + title: 'Submit email to run ajax request', + input: 'email', + showCancelButton: true, + confirmButtonText: 'Submit', + preConfirm: function() { + return new Ember.RSVP.Promise(function(resolve) { + window.swal.enableLoading(); + setTimeout(function() { + resolve(); + }, 2000); + }); + }, + allowOutsideClick: false + }).then(function(email) { + if (email) { + window.swal({ + type: 'success', + title: 'Ajax request finished!', + html: 'Submitted email: ' + email + }); + } + }); }, toggle() { this.set('toggleModal', true); } } });
24
1.714286
23
1
350f7e8dd912c4da556f932a2aeb4c2f03290474
app/helpers/application_helper/toolbar/basic.rb
app/helpers/application_helper/toolbar/basic.rb
class ApplicationHelper::Toolbar::Basic include Singleton class << self extend Forwardable delegate [:model, :register, :buttons, :definition, :button_group] => :instance end attr_reader :definition private def register(name) end def model(_class) end def button_group(name, buttons) @definition[name] = buttons end def initialize @definition = {} end end
class ApplicationHelper::Toolbar::Basic include Singleton class << self extend Forwardable delegate %i(button select twostate separator definition button_group) => :instance end attr_reader :definition private def button_group(name, buttons) @definition[name] = buttons end def initialize @definition = {} end def button(id, icon, title, text, keys = {}) generic_button(:button, id, icon, title, text, keys) end def select(id, icon, title, text, keys = {}) generic_button(:buttonSelect, id, icon, title, text, keys) end def twostate(id, icon, title, text, keys = {}) generic_button(:buttonTwoState, id, icon, title, text, keys) end def generic_button(type, id, icon, title, text, keys) { type => id.to_s, :icon => icon, :title => title, :text => text }.merge(keys) end def separator {:separator => true} end end
Implement a simple toolbar definition DSL.
Implement a simple toolbar definition DSL.
Ruby
apache-2.0
jrafanie/manageiq,aufi/manageiq,d-m-u/manageiq,hstastna/manageiq,yaacov/manageiq,branic/manageiq,tzumainn/manageiq,kbrock/manageiq,mresti/manageiq,fbladilo/manageiq,NickLaMuro/manageiq,mfeifer/manageiq,pkomanek/manageiq,jntullo/manageiq,NaNi-Z/manageiq,jameswnl/manageiq,branic/manageiq,jvlcek/manageiq,KevinLoiseau/manageiq,maas-ufcg/manageiq,josejulio/manageiq,tinaafitz/manageiq,romanblanco/manageiq,yaacov/manageiq,hstastna/manageiq,billfitzgerald0120/manageiq,agrare/manageiq,NaNi-Z/manageiq,agrare/manageiq,hstastna/manageiq,NickLaMuro/manageiq,pkomanek/manageiq,fbladilo/manageiq,fbladilo/manageiq,jvlcek/manageiq,durandom/manageiq,pkomanek/manageiq,durandom/manageiq,KevinLoiseau/manageiq,mfeifer/manageiq,juliancheal/manageiq,tinaafitz/manageiq,gerikis/manageiq,d-m-u/manageiq,israel-hdez/manageiq,mkanoor/manageiq,syncrou/manageiq,pkomanek/manageiq,mresti/manageiq,ilackarms/manageiq,ailisp/manageiq,yaacov/manageiq,lpichler/manageiq,lpichler/manageiq,jntullo/manageiq,romaintb/manageiq,jntullo/manageiq,juliancheal/manageiq,ailisp/manageiq,NickLaMuro/manageiq,josejulio/manageiq,maas-ufcg/manageiq,durandom/manageiq,skateman/manageiq,kbrock/manageiq,jrafanie/manageiq,gmcculloug/manageiq,gerikis/manageiq,agrare/manageiq,djberg96/manageiq,maas-ufcg/manageiq,NaNi-Z/manageiq,mresti/manageiq,KevinLoiseau/manageiq,billfitzgerald0120/manageiq,ailisp/manageiq,KevinLoiseau/manageiq,durandom/manageiq,jameswnl/manageiq,romaintb/manageiq,chessbyte/manageiq,syncrou/manageiq,josejulio/manageiq,mzazrivec/manageiq,borod108/manageiq,gerikis/manageiq,jameswnl/manageiq,tzumainn/manageiq,borod108/manageiq,billfitzgerald0120/manageiq,tinaafitz/manageiq,tzumainn/manageiq,maas-ufcg/manageiq,syncrou/manageiq,romaintb/manageiq,mresti/manageiq,gmcculloug/manageiq,djberg96/manageiq,chessbyte/manageiq,romaintb/manageiq,gmcculloug/manageiq,matobet/manageiq,djberg96/manageiq,romanblanco/manageiq,d-m-u/manageiq,fbladilo/manageiq,gmcculloug/manageiq,mfeifer/manageiq,aufi/manageiq,lpichler/manageiq,maas-ufcg/manageiq,djberg96/manageiq,andyvesel/manageiq,branic/manageiq,KevinLoiseau/manageiq,tinaafitz/manageiq,mzazrivec/manageiq,maas-ufcg/manageiq,ilackarms/manageiq,andyvesel/manageiq,skateman/manageiq,yaacov/manageiq,ManageIQ/manageiq,ManageIQ/manageiq,jrafanie/manageiq,gerikis/manageiq,ManageIQ/manageiq,tzumainn/manageiq,ailisp/manageiq,romanblanco/manageiq,andyvesel/manageiq,billfitzgerald0120/manageiq,ilackarms/manageiq,mzazrivec/manageiq,israel-hdez/manageiq,romaintb/manageiq,aufi/manageiq,jvlcek/manageiq,jvlcek/manageiq,lpichler/manageiq,d-m-u/manageiq,jrafanie/manageiq,mzazrivec/manageiq,israel-hdez/manageiq,NaNi-Z/manageiq,kbrock/manageiq,matobet/manageiq,mfeifer/manageiq,chessbyte/manageiq,kbrock/manageiq,romaintb/manageiq,agrare/manageiq,mkanoor/manageiq,josejulio/manageiq,matobet/manageiq,romanblanco/manageiq,aufi/manageiq,KevinLoiseau/manageiq,jntullo/manageiq,branic/manageiq,juliancheal/manageiq,chessbyte/manageiq,skateman/manageiq,mkanoor/manageiq,ManageIQ/manageiq,syncrou/manageiq,juliancheal/manageiq,andyvesel/manageiq,NickLaMuro/manageiq,hstastna/manageiq,borod108/manageiq,jameswnl/manageiq,borod108/manageiq,matobet/manageiq,ilackarms/manageiq,mkanoor/manageiq,israel-hdez/manageiq,skateman/manageiq
ruby
## Code Before: class ApplicationHelper::Toolbar::Basic include Singleton class << self extend Forwardable delegate [:model, :register, :buttons, :definition, :button_group] => :instance end attr_reader :definition private def register(name) end def model(_class) end def button_group(name, buttons) @definition[name] = buttons end def initialize @definition = {} end end ## Instruction: Implement a simple toolbar definition DSL. ## Code After: class ApplicationHelper::Toolbar::Basic include Singleton class << self extend Forwardable delegate %i(button select twostate separator definition button_group) => :instance end attr_reader :definition private def button_group(name, buttons) @definition[name] = buttons end def initialize @definition = {} end def button(id, icon, title, text, keys = {}) generic_button(:button, id, icon, title, text, keys) end def select(id, icon, title, text, keys = {}) generic_button(:buttonSelect, id, icon, title, text, keys) end def twostate(id, icon, title, text, keys = {}) generic_button(:buttonTwoState, id, icon, title, text, keys) end def generic_button(type, id, icon, title, text, keys) { type => id.to_s, :icon => icon, :title => title, :text => text }.merge(keys) end def separator {:separator => true} end end
class ApplicationHelper::Toolbar::Basic include Singleton - + class << self extend Forwardable - delegate [:model, :register, :buttons, :definition, :button_group] => :instance + delegate %i(button select twostate separator definition button_group) => :instance end attr_reader :definition private - def register(name) - end - - def model(_class) - end def button_group(name, buttons) @definition[name] = buttons end def initialize @definition = {} end + + def button(id, icon, title, text, keys = {}) + generic_button(:button, id, icon, title, text, keys) + end + + def select(id, icon, title, text, keys = {}) + generic_button(:buttonSelect, id, icon, title, text, keys) + end + + def twostate(id, icon, title, text, keys = {}) + generic_button(:buttonTwoState, id, icon, title, text, keys) + end + + def generic_button(type, id, icon, title, text, keys) + { + type => id.to_s, + :icon => icon, + :title => title, + :text => text + }.merge(keys) + end + + def separator + {:separator => true} + end end
34
1.36
27
7
6bfb61556a51ea8c35dc341786dc44d2fadf7867
client/views/pages/partials/paragraphs_edit/paragraphs_edit.js
client/views/pages/partials/paragraphs_edit/paragraphs_edit.js
/*****************************************************************************/ /* ParagraphsEdit: Event Handlers and Helpersss .js*/ /*****************************************************************************/ Template.ParagraphsEdit.events({ /* * Example: * 'click .selector': function (e, tmpl) { * * } */ 'click #cancel-edit-paragraph': function (e) { e.preventDefault(); Session.set('editParagraph', null); } }); Template.ParagraphsEdit.helpers({ /* * Example: * items: function () { * return Items.find(); * } */ }); /*****************************************************************************/ /* ParagraphsEdit: Lifecycle Hooks */ /*****************************************************************************/ Template.ParagraphsEdit.created = function () { }; Template.ParagraphsEdit.rendered = function () { }; Template.ParagraphsEdit.destroyed = function () { };
/*****************************************************************************/ /* ParagraphsEdit: Event Handlers and Helpersss .js*/ /*****************************************************************************/ Template.ParagraphsEdit.events({ /* * Example: * 'click .selector': function (e, tmpl) { * * } */ 'submit #edit-paragraph-form': function (e, tmpl) { e.preventDefault(); var content = tmpl.find('#editParagraph').value; Paragraphs.update({ _id: this._id }, { $set: { content: content } } ); Session.set('editParagraph', null); }, 'click #cancel-edit-paragraph': function (e) { e.preventDefault(); Session.set('editParagraph', null); } }); Template.ParagraphsEdit.helpers({ /* * Example: * items: function () { * return Items.find(); * } */ }); /*****************************************************************************/ /* ParagraphsEdit: Lifecycle Hooks */ /*****************************************************************************/ Template.ParagraphsEdit.created = function () { }; Template.ParagraphsEdit.rendered = function () { }; Template.ParagraphsEdit.destroyed = function () { };
Update edited paragraph into the database
Update edited paragraph into the database
JavaScript
mit
bojicas/letterhead,bojicas/letterhead
javascript
## Code Before: /*****************************************************************************/ /* ParagraphsEdit: Event Handlers and Helpersss .js*/ /*****************************************************************************/ Template.ParagraphsEdit.events({ /* * Example: * 'click .selector': function (e, tmpl) { * * } */ 'click #cancel-edit-paragraph': function (e) { e.preventDefault(); Session.set('editParagraph', null); } }); Template.ParagraphsEdit.helpers({ /* * Example: * items: function () { * return Items.find(); * } */ }); /*****************************************************************************/ /* ParagraphsEdit: Lifecycle Hooks */ /*****************************************************************************/ Template.ParagraphsEdit.created = function () { }; Template.ParagraphsEdit.rendered = function () { }; Template.ParagraphsEdit.destroyed = function () { }; ## Instruction: Update edited paragraph into the database ## Code After: /*****************************************************************************/ /* ParagraphsEdit: Event Handlers and Helpersss .js*/ /*****************************************************************************/ Template.ParagraphsEdit.events({ /* * Example: * 'click .selector': function (e, tmpl) { * * } */ 'submit #edit-paragraph-form': function (e, tmpl) { e.preventDefault(); var content = tmpl.find('#editParagraph').value; Paragraphs.update({ _id: this._id }, { $set: { content: content } } ); Session.set('editParagraph', null); }, 'click #cancel-edit-paragraph': function (e) { e.preventDefault(); Session.set('editParagraph', null); } }); Template.ParagraphsEdit.helpers({ /* * Example: * items: function () { * return Items.find(); * } */ }); /*****************************************************************************/ /* ParagraphsEdit: Lifecycle Hooks */ /*****************************************************************************/ Template.ParagraphsEdit.created = function () { }; Template.ParagraphsEdit.rendered = function () { }; Template.ParagraphsEdit.destroyed = function () { };
/*****************************************************************************/ /* ParagraphsEdit: Event Handlers and Helpersss .js*/ /*****************************************************************************/ Template.ParagraphsEdit.events({ /* * Example: * 'click .selector': function (e, tmpl) { * * } */ + 'submit #edit-paragraph-form': function (e, tmpl) { + e.preventDefault(); + + var content = tmpl.find('#editParagraph').value; + + Paragraphs.update({ _id: this._id }, + { $set: { content: content } } + ); + + Session.set('editParagraph', null); + }, + 'click #cancel-edit-paragraph': function (e) { e.preventDefault(); Session.set('editParagraph', null); } }); Template.ParagraphsEdit.helpers({ /* * Example: * items: function () { * return Items.find(); * } */ }); /*****************************************************************************/ /* ParagraphsEdit: Lifecycle Hooks */ /*****************************************************************************/ Template.ParagraphsEdit.created = function () { }; Template.ParagraphsEdit.rendered = function () { }; Template.ParagraphsEdit.destroyed = function () { };
12
0.324324
12
0
aaaa20be61e96daf61e397fdf54dfaf6bec461e8
falcom/api/worldcat/data.py
falcom/api/worldcat/data.py
from ..common import ReadOnlyDataStructure class WorldcatData (ReadOnlyDataStructure): @property def title (self): return self.get("title") def __iter__ (self): return iter(self.get("libraries", ()))
from ..common import ReadOnlyDataStructure class WorldcatData (ReadOnlyDataStructure): auto_properties = ("title",) def __iter__ (self): return iter(self.get("libraries", ()))
Use new property format for WorldcatData
Use new property format for WorldcatData
Python
bsd-3-clause
mlibrary/image-conversion-and-validation,mlibrary/image-conversion-and-validation
python
## Code Before: from ..common import ReadOnlyDataStructure class WorldcatData (ReadOnlyDataStructure): @property def title (self): return self.get("title") def __iter__ (self): return iter(self.get("libraries", ())) ## Instruction: Use new property format for WorldcatData ## Code After: from ..common import ReadOnlyDataStructure class WorldcatData (ReadOnlyDataStructure): auto_properties = ("title",) def __iter__ (self): return iter(self.get("libraries", ()))
from ..common import ReadOnlyDataStructure class WorldcatData (ReadOnlyDataStructure): + auto_properties = ("title",) - @property - def title (self): - return self.get("title") def __iter__ (self): return iter(self.get("libraries", ()))
4
0.363636
1
3
4f2c4973cb6f5074881bb056e01e2fa8c12e937c
Handler/Feed.hs
Handler/Feed.hs
module Handler.Feed where import Import import Model.UserComment import Prelude (head) import Control.Monad (when) import Text.Blaze.Html (toMarkup) import Yesod.RssFeed getFeedR :: Handler RepRss getFeedR = do comments <- runDB findRecentUserComments when (null comments) notFound feedFromComments comments feedFromComments :: [UserComment] -> Handler RepRss feedFromComments comments = do entries <- mapM commentToRssEntry comments render <- getUrlRender rssFeedText Feed { feedAuthor = "thoughtbot" , feedTitle = "Carnival Comments" , feedDescription = "Recent comments on Carnival" , feedLanguage = "en-us" , feedLinkSelf = render FeedR , feedLinkHome = "http://robots.thoughtbot.com" , feedUpdated = getCommentCreated $ head comments , feedEntries = entries } where getCommentCreated :: UserComment -> UTCTime getCommentCreated (UserComment (Entity _ c) _) = commentCreated c commentToRssEntry :: UserComment -> Handler (FeedEntry Text) commentToRssEntry (UserComment (Entity _ c) (Entity _ u)) = return FeedEntry { feedEntryLink = "http://robots.thoughtbot.com/" <> commentArticleURL c , feedEntryUpdated = commentCreated c , feedEntryTitle = "New comment from " <> userName u <> " on " <> commentArticleTitle c , feedEntryContent = toMarkup $ commentBody c }
module Handler.Feed where import Import import Model.UserComment import Prelude (head) import Control.Monad (when) import Text.Blaze.Html (toMarkup) import Yesod.RssFeed getFeedR :: Handler RepRss getFeedR = do comments <- runDB findRecentUserComments when (null comments) notFound feedFromComments comments feedFromComments :: [UserComment] -> Handler RepRss feedFromComments comments = do entries <- mapM commentToRssEntry comments render <- getUrlRender rssFeedText Feed { feedAuthor = "thoughtbot" , feedTitle = "Carnival Comments" , feedDescription = "Recent comments on Carnival" , feedLanguage = "en-us" , feedLinkSelf = render FeedR , feedLinkHome = "http://robots.thoughtbot.com" , feedUpdated = getCommentCreated $ head comments , feedEntries = entries } where getCommentCreated :: UserComment -> UTCTime getCommentCreated (UserComment (Entity _ c) _) = commentCreated c commentToRssEntry :: UserComment -> Handler (FeedEntry Text) commentToRssEntry (UserComment (Entity _ c) (Entity _ u)) = return FeedEntry { feedEntryLink = "http://robots.thoughtbot.com/" <> commentArticleURL c , feedEntryUpdated = commentCreated c , feedEntryTitle = "New comment from " <> userName u <> " on " <> commentArticleTitle c <> " by " <> commentArticleAuthor c , feedEntryContent = toMarkup $ commentBody c }
Include author in RSS feed item
Include author in RSS feed item Note: will show blank values for existing comments
Haskell
mit
thoughtbot/carnival,vaporware/carnival,peterwang/carnival
haskell
## Code Before: module Handler.Feed where import Import import Model.UserComment import Prelude (head) import Control.Monad (when) import Text.Blaze.Html (toMarkup) import Yesod.RssFeed getFeedR :: Handler RepRss getFeedR = do comments <- runDB findRecentUserComments when (null comments) notFound feedFromComments comments feedFromComments :: [UserComment] -> Handler RepRss feedFromComments comments = do entries <- mapM commentToRssEntry comments render <- getUrlRender rssFeedText Feed { feedAuthor = "thoughtbot" , feedTitle = "Carnival Comments" , feedDescription = "Recent comments on Carnival" , feedLanguage = "en-us" , feedLinkSelf = render FeedR , feedLinkHome = "http://robots.thoughtbot.com" , feedUpdated = getCommentCreated $ head comments , feedEntries = entries } where getCommentCreated :: UserComment -> UTCTime getCommentCreated (UserComment (Entity _ c) _) = commentCreated c commentToRssEntry :: UserComment -> Handler (FeedEntry Text) commentToRssEntry (UserComment (Entity _ c) (Entity _ u)) = return FeedEntry { feedEntryLink = "http://robots.thoughtbot.com/" <> commentArticleURL c , feedEntryUpdated = commentCreated c , feedEntryTitle = "New comment from " <> userName u <> " on " <> commentArticleTitle c , feedEntryContent = toMarkup $ commentBody c } ## Instruction: Include author in RSS feed item Note: will show blank values for existing comments ## Code After: module Handler.Feed where import Import import Model.UserComment import Prelude (head) import Control.Monad (when) import Text.Blaze.Html (toMarkup) import Yesod.RssFeed getFeedR :: Handler RepRss getFeedR = do comments <- runDB findRecentUserComments when (null comments) notFound feedFromComments comments feedFromComments :: [UserComment] -> Handler RepRss feedFromComments comments = do entries <- mapM commentToRssEntry comments render <- getUrlRender rssFeedText Feed { feedAuthor = "thoughtbot" , feedTitle = "Carnival Comments" , feedDescription = "Recent comments on Carnival" , feedLanguage = "en-us" , feedLinkSelf = render FeedR , feedLinkHome = "http://robots.thoughtbot.com" , feedUpdated = getCommentCreated $ head comments , feedEntries = entries } where getCommentCreated :: UserComment -> UTCTime getCommentCreated (UserComment (Entity _ c) _) = commentCreated c commentToRssEntry :: UserComment -> Handler (FeedEntry Text) commentToRssEntry (UserComment (Entity _ c) (Entity _ u)) = return FeedEntry { feedEntryLink = "http://robots.thoughtbot.com/" <> commentArticleURL c , feedEntryUpdated = commentCreated c , feedEntryTitle = "New comment from " <> userName u <> " on " <> commentArticleTitle c <> " by " <> commentArticleAuthor c , feedEntryContent = toMarkup $ commentBody c }
module Handler.Feed where import Import import Model.UserComment import Prelude (head) import Control.Monad (when) import Text.Blaze.Html (toMarkup) import Yesod.RssFeed getFeedR :: Handler RepRss getFeedR = do comments <- runDB findRecentUserComments when (null comments) notFound feedFromComments comments feedFromComments :: [UserComment] -> Handler RepRss feedFromComments comments = do entries <- mapM commentToRssEntry comments render <- getUrlRender rssFeedText Feed { feedAuthor = "thoughtbot" , feedTitle = "Carnival Comments" , feedDescription = "Recent comments on Carnival" , feedLanguage = "en-us" , feedLinkSelf = render FeedR , feedLinkHome = "http://robots.thoughtbot.com" , feedUpdated = getCommentCreated $ head comments , feedEntries = entries } where getCommentCreated :: UserComment -> UTCTime getCommentCreated (UserComment (Entity _ c) _) = commentCreated c commentToRssEntry :: UserComment -> Handler (FeedEntry Text) commentToRssEntry (UserComment (Entity _ c) (Entity _ u)) = return FeedEntry { feedEntryLink = "http://robots.thoughtbot.com/" <> commentArticleURL c , feedEntryUpdated = commentCreated c - , feedEntryTitle = - "New comment from " <> userName u <> " on " <> commentArticleTitle c + , feedEntryTitle = "New comment from " + <> userName u + <> " on " <> commentArticleTitle c + <> " by " <> commentArticleAuthor c , feedEntryContent = toMarkup $ commentBody c }
6
0.122449
4
2
df4d4f2972d8d1a91ce4353343c6279580985e3c
index.py
index.py
from __future__ import division import urllib.request as request, json, os.path import json, time if os.path.exists('config/config.json'): config_file = open('config/config.json') config = json.load(config_file) else: print('Please copy the config.json file to config-local.json and fill in the file.') exit() print(time.strftime("%x") + ": Eagle woke up") total_volume = 0 symbols = ','.join(config['currencies']) url = "http://api.coinlayer.com/api/live?access_key=" + config['coinlayer'] + "&target=EUR&symbols=" + symbols with request.urlopen(url) as response: rates = json.loads(response.read().decode('utf-8'))['rates'] for currency in config['currencies'].keys(): if currency not in rates: print("Cryptocurrency", currency, "does not exist.") continue total_volume += rates[currency] * config['currencies'][currency]['balance'] print("Total euro : " + str(total_volume) + " eur")
from __future__ import division import urllib.request as request, json, os.path import json, time if os.path.exists('config/config.json'): config_file = open('config/config.json') config = json.load(config_file) else: print('Please copy the config.json.template file to config.json and fill in the file.') exit() print(time.strftime("%x") + ": Eagle woke up") total_volume = 0 symbols = ','.join(config['currencies']) url = "http://api.coinlayer.com/api/live?access_key=" + config['coinlayer'] + "&target=EUR&symbols=" + symbols with request.urlopen(url) as response: rates = json.loads(response.read().decode('utf-8'))['rates'] for currency in config['currencies'].keys(): if currency not in rates: print("Cryptocurrency", currency, "does not exist.") continue total_volume += rates[currency] * config['currencies'][currency]['balance'] print("Total euro : " + str(total_volume) + " eur")
Change print statement about config
Change print statement about config
Python
mit
pkakelas/eagle
python
## Code Before: from __future__ import division import urllib.request as request, json, os.path import json, time if os.path.exists('config/config.json'): config_file = open('config/config.json') config = json.load(config_file) else: print('Please copy the config.json file to config-local.json and fill in the file.') exit() print(time.strftime("%x") + ": Eagle woke up") total_volume = 0 symbols = ','.join(config['currencies']) url = "http://api.coinlayer.com/api/live?access_key=" + config['coinlayer'] + "&target=EUR&symbols=" + symbols with request.urlopen(url) as response: rates = json.loads(response.read().decode('utf-8'))['rates'] for currency in config['currencies'].keys(): if currency not in rates: print("Cryptocurrency", currency, "does not exist.") continue total_volume += rates[currency] * config['currencies'][currency]['balance'] print("Total euro : " + str(total_volume) + " eur") ## Instruction: Change print statement about config ## Code After: from __future__ import division import urllib.request as request, json, os.path import json, time if os.path.exists('config/config.json'): config_file = open('config/config.json') config = json.load(config_file) else: print('Please copy the config.json.template file to config.json and fill in the file.') exit() print(time.strftime("%x") + ": Eagle woke up") total_volume = 0 symbols = ','.join(config['currencies']) url = "http://api.coinlayer.com/api/live?access_key=" + config['coinlayer'] + "&target=EUR&symbols=" + symbols with request.urlopen(url) as response: rates = json.loads(response.read().decode('utf-8'))['rates'] for currency in config['currencies'].keys(): if currency not in rates: print("Cryptocurrency", currency, "does not exist.") continue total_volume += rates[currency] * config['currencies'][currency]['balance'] print("Total euro : " + str(total_volume) + " eur")
from __future__ import division import urllib.request as request, json, os.path import json, time if os.path.exists('config/config.json'): config_file = open('config/config.json') config = json.load(config_file) else: - print('Please copy the config.json file to config-local.json and fill in the file.') ? ------ + print('Please copy the config.json.template file to config.json and fill in the file.') ? +++++++++ exit() print(time.strftime("%x") + ": Eagle woke up") total_volume = 0 symbols = ','.join(config['currencies']) url = "http://api.coinlayer.com/api/live?access_key=" + config['coinlayer'] + "&target=EUR&symbols=" + symbols with request.urlopen(url) as response: rates = json.loads(response.read().decode('utf-8'))['rates'] for currency in config['currencies'].keys(): if currency not in rates: print("Cryptocurrency", currency, "does not exist.") continue total_volume += rates[currency] * config['currencies'][currency]['balance'] print("Total euro : " + str(total_volume) + " eur")
2
0.068966
1
1
346957974753f0904e5286290a197da9449936c1
vim/config/plugins/deoplete.vim
vim/config/plugins/deoplete.vim
"disable completion (default: 0) if !exists("g:disablecompletion") let g:disablecompletion = 0 endif if !g:disablecompletion && g:python_neovim let g:deoplete#enable_at_startup = 1 let deoplete#tag#cache_limit_size = 5000000 endif
"disable completion (default: 0) if !exists("g:disablecompletion") let g:disablecompletion = 0 endif if !g:disablecompletion && g:python_neovim let g:deoplete#enable_at_startup = 1 endif
Remove the deoplate cache_limit variable as this is no longer used by the plugin
Remove the deoplate cache_limit variable as this is no longer used by the plugin
VimL
mit
prurigro/darkcloud-vimconfig
viml
## Code Before: "disable completion (default: 0) if !exists("g:disablecompletion") let g:disablecompletion = 0 endif if !g:disablecompletion && g:python_neovim let g:deoplete#enable_at_startup = 1 let deoplete#tag#cache_limit_size = 5000000 endif ## Instruction: Remove the deoplate cache_limit variable as this is no longer used by the plugin ## Code After: "disable completion (default: 0) if !exists("g:disablecompletion") let g:disablecompletion = 0 endif if !g:disablecompletion && g:python_neovim let g:deoplete#enable_at_startup = 1 endif
"disable completion (default: 0) if !exists("g:disablecompletion") let g:disablecompletion = 0 endif if !g:disablecompletion && g:python_neovim let g:deoplete#enable_at_startup = 1 - let deoplete#tag#cache_limit_size = 5000000 endif
1
0.111111
0
1
acbbd6a15919cf2b81e44502e5f5eea9b564b805
lib/did_you_mean/spell_checkers/method_name_checker.rb
lib/did_you_mean/spell_checkers/method_name_checker.rb
module DidYouMean class MethodNameChecker include SpellCheckable attr_reader :method_name, :receiver def initialize(exception) @method_name = exception.name @receiver = exception.receiver end def candidates { method_name => method_names } end def method_names method_names = receiver.methods + receiver.singleton_methods + receiver.private_methods method_names.delete(method_name) method_names.uniq! method_names end end end
module DidYouMean class MethodNameChecker include SpellCheckable attr_reader :method_name, :receiver def initialize(exception) @method_name = exception.name @receiver = exception.receiver @has_args = !exception.args&.empty? end def candidates { method_name => method_names } end def method_names method_names = receiver.methods + receiver.singleton_methods method_names += receiver.private_methods if @has_args method_names.delete(method_name) method_names.uniq! method_names end end end
Use private method names only when args are provided
Use private method names only when args are provided
Ruby
mit
yuki24/did_you_mean
ruby
## Code Before: module DidYouMean class MethodNameChecker include SpellCheckable attr_reader :method_name, :receiver def initialize(exception) @method_name = exception.name @receiver = exception.receiver end def candidates { method_name => method_names } end def method_names method_names = receiver.methods + receiver.singleton_methods + receiver.private_methods method_names.delete(method_name) method_names.uniq! method_names end end end ## Instruction: Use private method names only when args are provided ## Code After: module DidYouMean class MethodNameChecker include SpellCheckable attr_reader :method_name, :receiver def initialize(exception) @method_name = exception.name @receiver = exception.receiver @has_args = !exception.args&.empty? end def candidates { method_name => method_names } end def method_names method_names = receiver.methods + receiver.singleton_methods method_names += receiver.private_methods if @has_args method_names.delete(method_name) method_names.uniq! method_names end end end
module DidYouMean class MethodNameChecker include SpellCheckable attr_reader :method_name, :receiver def initialize(exception) @method_name = exception.name @receiver = exception.receiver + @has_args = !exception.args&.empty? end def candidates { method_name => method_names } end def method_names - method_names = receiver.methods + receiver.singleton_methods + receiver.private_methods ? --------------------------- + method_names = receiver.methods + receiver.singleton_methods + method_names += receiver.private_methods if @has_args method_names.delete(method_name) method_names.uniq! method_names end end end
4
0.181818
3
1
f2ea241e9bb6e5e927a90c56438bf7883ae3744f
siemstress/__init__.py
siemstress/__init__.py
__version__ = '0.2' __author__ = 'Dan Persons <dpersonsdev@gmail.com>' __license__ = 'MIT License' __github__ = 'https://github.com/dogoncouch/siemstress' __all__ = ['core', 'querycore', 'query'] import siemstress.query
__version__ = '0.2' __author__ = 'Dan Persons <dpersonsdev@gmail.com>' __license__ = 'MIT License' __github__ = 'https://github.com/dogoncouch/siemstress' __all__ = ['core', 'querycore', 'query'] import siemstress.query import siemstress.trigger
Add trigger to module import
Add trigger to module import
Python
mit
dogoncouch/siemstress
python
## Code Before: __version__ = '0.2' __author__ = 'Dan Persons <dpersonsdev@gmail.com>' __license__ = 'MIT License' __github__ = 'https://github.com/dogoncouch/siemstress' __all__ = ['core', 'querycore', 'query'] import siemstress.query ## Instruction: Add trigger to module import ## Code After: __version__ = '0.2' __author__ = 'Dan Persons <dpersonsdev@gmail.com>' __license__ = 'MIT License' __github__ = 'https://github.com/dogoncouch/siemstress' __all__ = ['core', 'querycore', 'query'] import siemstress.query import siemstress.trigger
__version__ = '0.2' __author__ = 'Dan Persons <dpersonsdev@gmail.com>' __license__ = 'MIT License' __github__ = 'https://github.com/dogoncouch/siemstress' __all__ = ['core', 'querycore', 'query'] import siemstress.query + import siemstress.trigger
1
0.142857
1
0
63637f8b5248f32ab835646868eaed4247496368
dev-requirements.txt
dev-requirements.txt
coverage # Allows us to measure code coverage doc8 # Style check documentation flake8 # Code analysis tool with linting PyEnchant # Dictionary interaction for spellchecking Sphinx # Build documentation sphinxcontrib-httpdomain # Describe RESTful HTTP APIs in Sphinx sphinxcontrib-spelling # Check spelling in the documentation
coverage # Allows us to measure code coverage doc8 # Style check documentation flake8 # Code analysis tool with linting future # Use Python 3 interfaces in Python 2 PyEnchant # Dictionary interaction for spellchecking Sphinx # Build documentation sphinxcontrib-httpdomain # Describe RESTful HTTP APIs in Sphinx sphinxcontrib-spelling # Check spelling in the documentation
Add "future" as a dev requirement
Add "future" as a dev requirement
Text
mit
jenca-cloud/jenca-authentication
text
## Code Before: coverage # Allows us to measure code coverage doc8 # Style check documentation flake8 # Code analysis tool with linting PyEnchant # Dictionary interaction for spellchecking Sphinx # Build documentation sphinxcontrib-httpdomain # Describe RESTful HTTP APIs in Sphinx sphinxcontrib-spelling # Check spelling in the documentation ## Instruction: Add "future" as a dev requirement ## Code After: coverage # Allows us to measure code coverage doc8 # Style check documentation flake8 # Code analysis tool with linting future # Use Python 3 interfaces in Python 2 PyEnchant # Dictionary interaction for spellchecking Sphinx # Build documentation sphinxcontrib-httpdomain # Describe RESTful HTTP APIs in Sphinx sphinxcontrib-spelling # Check spelling in the documentation
coverage # Allows us to measure code coverage doc8 # Style check documentation flake8 # Code analysis tool with linting + future # Use Python 3 interfaces in Python 2 PyEnchant # Dictionary interaction for spellchecking Sphinx # Build documentation sphinxcontrib-httpdomain # Describe RESTful HTTP APIs in Sphinx sphinxcontrib-spelling # Check spelling in the documentation
1
0.142857
1
0
96e5d80a914e3a480c7c7cd957658c601d0ced10
.travis.yml
.travis.yml
after_success: npm run coveralls language: node_js node_js: - "4.0" - "4" - "5" sudo: false
after_success: npm run coveralls language: node_js node_js: - "4" - "6" sudo: false
Add support for Node v6
Add support for Node v6
YAML
bsd-3-clause
ruiquelhas/lafayette
yaml
## Code Before: after_success: npm run coveralls language: node_js node_js: - "4.0" - "4" - "5" sudo: false ## Instruction: Add support for Node v6 ## Code After: after_success: npm run coveralls language: node_js node_js: - "4" - "6" sudo: false
after_success: npm run coveralls language: node_js node_js: - - "4.0" - "4" - - "5" ? ^ + - "6" ? ^ sudo: false
3
0.3
1
2
32a5bec78cfffc8e001ac6cd50de3db50b628326
Module.sql
Module.sql
-- Module for all code for the logger utility. CREATE OR REPLACE MODULE LOGGER; -- Public functions and procedures. -- Procedure to write logs. ALTER MODULE LOGGER PUBLISH PROCEDURE LOG ( IN LOGGERID ANCHOR LOGGER.CONF_LOGGERS.LOGGER_ID, IN LEVELID ANCHOR LOGGER.LEVELS.LEVEL_ID, IN MESSAGE ANCHOR LOGGER.LOGS.MESSAGE ); -- Function to register the logger. ALTER MODULE LOGGER PUBLISH FUNCTION GET_LOGGER ( IN NAME VARCHAR(64) ) RETURNS ANCHOR LOGGER.CONF_LOGGERS.LOGGER_ID; -- Array to store the hierarhy of a logger. ALTER MODULE LOGGER ADD TYPE HIERARCHY_ARRAY AS VARCHAR(32) ARRAY[16];
-- Drops the module if exist. DROP MODULE LOGGER.LOGGER; -- Module for all code for the logger utility. CREATE OR REPLACE MODULE LOGGER; -- Public functions and procedures. -- Procedure to write logs. ALTER MODULE LOGGER PUBLISH PROCEDURE LOG ( IN LOGGERID ANCHOR LOGGER.CONF_LOGGERS.LOGGER_ID, IN LEVELID ANCHOR LOGGER.LEVELS.LEVEL_ID, IN MESSAGE ANCHOR LOGGER.LOGS.MESSAGE ); -- Function to register the logger. ALTER MODULE LOGGER PUBLISH FUNCTION GET_LOGGER ( IN NAME VARCHAR(64) ) RETURNS ANCHOR LOGGER.CONF_LOGGERS.LOGGER_ID; -- Array to store the hierarhy of a logger. --ALTER MODULE LOGGER ADD -- TYPE HIERARCHY_ARRAY AS VARCHAR(32) ARRAY[16];
Drop module and no array
Drop module and no array
SQL
bsd-2-clause
angoca/log4db2
sql
## Code Before: -- Module for all code for the logger utility. CREATE OR REPLACE MODULE LOGGER; -- Public functions and procedures. -- Procedure to write logs. ALTER MODULE LOGGER PUBLISH PROCEDURE LOG ( IN LOGGERID ANCHOR LOGGER.CONF_LOGGERS.LOGGER_ID, IN LEVELID ANCHOR LOGGER.LEVELS.LEVEL_ID, IN MESSAGE ANCHOR LOGGER.LOGS.MESSAGE ); -- Function to register the logger. ALTER MODULE LOGGER PUBLISH FUNCTION GET_LOGGER ( IN NAME VARCHAR(64) ) RETURNS ANCHOR LOGGER.CONF_LOGGERS.LOGGER_ID; -- Array to store the hierarhy of a logger. ALTER MODULE LOGGER ADD TYPE HIERARCHY_ARRAY AS VARCHAR(32) ARRAY[16]; ## Instruction: Drop module and no array ## Code After: -- Drops the module if exist. DROP MODULE LOGGER.LOGGER; -- Module for all code for the logger utility. CREATE OR REPLACE MODULE LOGGER; -- Public functions and procedures. -- Procedure to write logs. ALTER MODULE LOGGER PUBLISH PROCEDURE LOG ( IN LOGGERID ANCHOR LOGGER.CONF_LOGGERS.LOGGER_ID, IN LEVELID ANCHOR LOGGER.LEVELS.LEVEL_ID, IN MESSAGE ANCHOR LOGGER.LOGS.MESSAGE ); -- Function to register the logger. ALTER MODULE LOGGER PUBLISH FUNCTION GET_LOGGER ( IN NAME VARCHAR(64) ) RETURNS ANCHOR LOGGER.CONF_LOGGERS.LOGGER_ID; -- Array to store the hierarhy of a logger. --ALTER MODULE LOGGER ADD -- TYPE HIERARCHY_ARRAY AS VARCHAR(32) ARRAY[16];
+ -- Drops the module if exist. + DROP MODULE LOGGER.LOGGER; + -- Module for all code for the logger utility. CREATE OR REPLACE MODULE LOGGER; -- Public functions and procedures. -- Procedure to write logs. ALTER MODULE LOGGER PUBLISH PROCEDURE LOG ( IN LOGGERID ANCHOR LOGGER.CONF_LOGGERS.LOGGER_ID, IN LEVELID ANCHOR LOGGER.LEVELS.LEVEL_ID, IN MESSAGE ANCHOR LOGGER.LOGS.MESSAGE ); -- Function to register the logger. ALTER MODULE LOGGER PUBLISH FUNCTION GET_LOGGER ( IN NAME VARCHAR(64) ) RETURNS ANCHOR LOGGER.CONF_LOGGERS.LOGGER_ID; -- Array to store the hierarhy of a logger. - ALTER MODULE LOGGER ADD + --ALTER MODULE LOGGER ADD ? ++ - TYPE HIERARCHY_ARRAY AS VARCHAR(32) ARRAY[16]; + -- TYPE HIERARCHY_ARRAY AS VARCHAR(32) ARRAY[16]; ? ++
7
0.333333
5
2
dbed2fec6cf08ea6e239ee1ed38a6ae2cc73c49e
.travis.yml
.travis.yml
language: csharp dist: trusty sudo: required env: - MONO_THREADS_PER_CPU=2000 mono: - 4.0.5 os: - linux addons: apt: packages: - gettext - libcurl4-openssl-dev - libicu-dev - libssl-dev - libunwind8 - zlib1g notifications: email: false branches: only: - master before_install: - chmod +x build.sh install: - sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list' - sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893 - sudo apt-get update - sudo apt-get install -y dotnet-dev-1.0.0-preview2-003121 script: - ./build.sh
language: csharp sudo: required dist: trusty addons: apt: packages: - gettext - libunwind8 - libicu52 - dbus notifications: email: false branches: only: - master before_install: - chmod +x build.sh install: - sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list' - sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893 - sudo apt-get update - sudo apt-get install -y dotnet-dev-1.0.0-preview2-003121 script: - ./build.sh
Remove Mono from Travis build
Remove Mono from Travis build
YAML
mit
k94ll13nn3/Strinken
yaml
## Code Before: language: csharp dist: trusty sudo: required env: - MONO_THREADS_PER_CPU=2000 mono: - 4.0.5 os: - linux addons: apt: packages: - gettext - libcurl4-openssl-dev - libicu-dev - libssl-dev - libunwind8 - zlib1g notifications: email: false branches: only: - master before_install: - chmod +x build.sh install: - sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list' - sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893 - sudo apt-get update - sudo apt-get install -y dotnet-dev-1.0.0-preview2-003121 script: - ./build.sh ## Instruction: Remove Mono from Travis build ## Code After: language: csharp sudo: required dist: trusty addons: apt: packages: - gettext - libunwind8 - libicu52 - dbus notifications: email: false branches: only: - master before_install: - chmod +x build.sh install: - sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list' - sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893 - sudo apt-get update - sudo apt-get install -y dotnet-dev-1.0.0-preview2-003121 script: - ./build.sh
language: csharp + + sudo: required dist: trusty + - sudo: required - env: - - MONO_THREADS_PER_CPU=2000 - mono: - - 4.0.5 - os: - - linux addons: apt: packages: - gettext - - libcurl4-openssl-dev - - libicu-dev - - libssl-dev - libunwind8 - - zlib1g + - libicu52 + - dbus + notifications: email: false + branches: only: - master + before_install: - chmod +x build.sh + install: - sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list' - sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893 - sudo apt-get update - sudo apt-get install -y dotnet-dev-1.0.0-preview2-003121 + script: - ./build.sh
21
0.65625
10
11
fe8543e4c99e5d09203946cb9fa050c7b82e21e8
ansible/tasks/timezone.yml
ansible/tasks/timezone.yml
--- - name: Set Timezone copy: content: '{{ timezone | default("Etc/UTC") }}\n' dest: /etc/timezone owner: root group: root mode: 0644 sudo: yes notify: Update Timezone - name: Check Localtime command: diff /etc/localtime /usr/share/zoneinfo/{{ timezone | default("Etc/UTC") }} register: localtime_diff changed_when: localtime_diff.stdout != "" - name: Set Local Time command: mv /usr/share/zoneinfo/{{ timezone | default("Etc/UTC") }} /etc/localtime sudo: yes notify: Update Timezone when: localtime_diff.stdout != ""
--- - name: Set Timezone copy: content: '{{ timezone | default("Etc/UTC") }}\n' dest: /etc/timezone owner: root group: root mode: 0644 sudo: yes notify: Update Timezone - name: Check Localtime command: diff /etc/localtime /usr/share/zoneinfo/{{ timezone | default("Etc/UTC") }} register: localtime_diff changed_when: localtime_diff.stdout != "" failed_when: > localtime_diff.rc == 2 and localtime_diff.stdout != "Binary files /etc/localtime and /usr/share/zoneinfo/{{ timezone | default("Etc/UTC") }} differ" - name: Set Local Time command: mv /usr/share/zoneinfo/{{ timezone | default("Etc/UTC") }} /etc/localtime sudo: yes notify: Update Timezone when: localtime_diff.stdout != ""
Fix error when there actually IS a diff in times. Duh.
Fix error when there actually IS a diff in times. Duh.
YAML
mit
gocodeup/Codeup-Vagrant-Setup,ZeshanNSegal/High_Low,ZeshanNSegal/High_Low,gocodeup/Codeup-Vagrant-Setup,bbatsche/Vagrant-Setup,gocodeup/Codeup-Vagrant-Setup,ZeshanNSegal/High_Low,gocodeup/Codeup-Vagrant-Setup,ZeshanNSegal/High_Low
yaml
## Code Before: --- - name: Set Timezone copy: content: '{{ timezone | default("Etc/UTC") }}\n' dest: /etc/timezone owner: root group: root mode: 0644 sudo: yes notify: Update Timezone - name: Check Localtime command: diff /etc/localtime /usr/share/zoneinfo/{{ timezone | default("Etc/UTC") }} register: localtime_diff changed_when: localtime_diff.stdout != "" - name: Set Local Time command: mv /usr/share/zoneinfo/{{ timezone | default("Etc/UTC") }} /etc/localtime sudo: yes notify: Update Timezone when: localtime_diff.stdout != "" ## Instruction: Fix error when there actually IS a diff in times. Duh. ## Code After: --- - name: Set Timezone copy: content: '{{ timezone | default("Etc/UTC") }}\n' dest: /etc/timezone owner: root group: root mode: 0644 sudo: yes notify: Update Timezone - name: Check Localtime command: diff /etc/localtime /usr/share/zoneinfo/{{ timezone | default("Etc/UTC") }} register: localtime_diff changed_when: localtime_diff.stdout != "" failed_when: > localtime_diff.rc == 2 and localtime_diff.stdout != "Binary files /etc/localtime and /usr/share/zoneinfo/{{ timezone | default("Etc/UTC") }} differ" - name: Set Local Time command: mv /usr/share/zoneinfo/{{ timezone | default("Etc/UTC") }} /etc/localtime sudo: yes notify: Update Timezone when: localtime_diff.stdout != ""
--- - name: Set Timezone copy: content: '{{ timezone | default("Etc/UTC") }}\n' dest: /etc/timezone owner: root group: root mode: 0644 sudo: yes notify: Update Timezone - name: Check Localtime command: diff /etc/localtime /usr/share/zoneinfo/{{ timezone | default("Etc/UTC") }} register: localtime_diff changed_when: localtime_diff.stdout != "" + failed_when: > + localtime_diff.rc == 2 and + localtime_diff.stdout != "Binary files /etc/localtime and /usr/share/zoneinfo/{{ timezone | default("Etc/UTC") }} differ" - name: Set Local Time command: mv /usr/share/zoneinfo/{{ timezone | default("Etc/UTC") }} /etc/localtime sudo: yes notify: Update Timezone when: localtime_diff.stdout != ""
3
0.142857
3
0
4f182d1b298df3071542c01172f2b8c5896fde7a
.gitlab-ci.yml
.gitlab-ci.yml
image: adaskit/libsgm:0.1 variables: GIT_SUBMODULE_STRATEGY: recursive stages: - build - test .build_template: &build_definition stage: build tags: - docker script: - cmake . -DENABLE_SAMPLES=${build_samples} -DLIBSGM_SHARED=${build_shared} -DENABLE_TESTS=${build_tests} - make build:samples_on:shared: variables: build_samples: "ON" build_shared: "ON" build_tests: "OFF" <<: *build_definition build:samples_on:static: variables: build_samples: "ON" build_shared: "OFF" build_tests: "OFF" <<: *build_definition build:samples_off:shared: variables: build_samples: "OFF" build_shared: "ON" build_tests: "OFF" <<: *build_definition build:samples_off:static: variables: build_samples: "OFF" build_shared: "OFF" build_tests: "OFF" <<: *build_definition build:test: variables: build_samples: "OFF" build_shared: "OFF" build_tests: "ON" artifacts: paths: - ./test/sgm-test expire_in: 1d <<: *build_definition test: stage: test tags: - nvidia-docker script: - ./test/sgm-test dependencies: - build:test
image: adaskit/libsgm:0.1 variables: GIT_SUBMODULE_STRATEGY: recursive stages: - build - test .build_template: &build_definition stage: build tags: - docker script: - cmake . -DWITH_OPENCV="ON" -DENABLE_SAMPLES=${build_samples} -DLIBSGM_SHARED=${build_shared} -DENABLE_TESTS=${build_tests} - make build:samples_on:shared: variables: build_samples: "ON" build_shared: "ON" build_tests: "OFF" <<: *build_definition build:samples_on:static: variables: build_samples: "ON" build_shared: "OFF" build_tests: "OFF" <<: *build_definition build:samples_off:shared: variables: build_samples: "OFF" build_shared: "ON" build_tests: "OFF" <<: *build_definition build:samples_off:static: variables: build_samples: "OFF" build_shared: "OFF" build_tests: "OFF" <<: *build_definition build:test: variables: build_samples: "OFF" build_shared: "OFF" build_tests: "ON" artifacts: paths: - ./test/sgm-test expire_in: 1d <<: *build_definition test: stage: test tags: - nvidia-docker script: - ./test/sgm-test dependencies: - build:test
Update GitLab CI for WITH_OPENCV option
Update GitLab CI for WITH_OPENCV option
YAML
apache-2.0
fixstars/libSGM,fixstars-jp/libSGM
yaml
## Code Before: image: adaskit/libsgm:0.1 variables: GIT_SUBMODULE_STRATEGY: recursive stages: - build - test .build_template: &build_definition stage: build tags: - docker script: - cmake . -DENABLE_SAMPLES=${build_samples} -DLIBSGM_SHARED=${build_shared} -DENABLE_TESTS=${build_tests} - make build:samples_on:shared: variables: build_samples: "ON" build_shared: "ON" build_tests: "OFF" <<: *build_definition build:samples_on:static: variables: build_samples: "ON" build_shared: "OFF" build_tests: "OFF" <<: *build_definition build:samples_off:shared: variables: build_samples: "OFF" build_shared: "ON" build_tests: "OFF" <<: *build_definition build:samples_off:static: variables: build_samples: "OFF" build_shared: "OFF" build_tests: "OFF" <<: *build_definition build:test: variables: build_samples: "OFF" build_shared: "OFF" build_tests: "ON" artifacts: paths: - ./test/sgm-test expire_in: 1d <<: *build_definition test: stage: test tags: - nvidia-docker script: - ./test/sgm-test dependencies: - build:test ## Instruction: Update GitLab CI for WITH_OPENCV option ## Code After: image: adaskit/libsgm:0.1 variables: GIT_SUBMODULE_STRATEGY: recursive stages: - build - test .build_template: &build_definition stage: build tags: - docker script: - cmake . -DWITH_OPENCV="ON" -DENABLE_SAMPLES=${build_samples} -DLIBSGM_SHARED=${build_shared} -DENABLE_TESTS=${build_tests} - make build:samples_on:shared: variables: build_samples: "ON" build_shared: "ON" build_tests: "OFF" <<: *build_definition build:samples_on:static: variables: build_samples: "ON" build_shared: "OFF" build_tests: "OFF" <<: *build_definition build:samples_off:shared: variables: build_samples: "OFF" build_shared: "ON" build_tests: "OFF" <<: *build_definition build:samples_off:static: variables: build_samples: "OFF" build_shared: "OFF" build_tests: "OFF" <<: *build_definition build:test: variables: build_samples: "OFF" build_shared: "OFF" build_tests: "ON" artifacts: paths: - ./test/sgm-test expire_in: 1d <<: *build_definition test: stage: test tags: - nvidia-docker script: - ./test/sgm-test dependencies: - build:test
image: adaskit/libsgm:0.1 variables: GIT_SUBMODULE_STRATEGY: recursive stages: - build - test .build_template: &build_definition stage: build tags: - docker script: - - cmake . -DENABLE_SAMPLES=${build_samples} -DLIBSGM_SHARED=${build_shared} -DENABLE_TESTS=${build_tests} + - cmake . -DWITH_OPENCV="ON" -DENABLE_SAMPLES=${build_samples} -DLIBSGM_SHARED=${build_shared} -DENABLE_TESTS=${build_tests} ? +++++++++++++++++++ - make build:samples_on:shared: variables: build_samples: "ON" build_shared: "ON" build_tests: "OFF" <<: *build_definition build:samples_on:static: variables: build_samples: "ON" build_shared: "OFF" build_tests: "OFF" <<: *build_definition build:samples_off:shared: variables: build_samples: "OFF" build_shared: "ON" build_tests: "OFF" <<: *build_definition build:samples_off:static: variables: build_samples: "OFF" build_shared: "OFF" build_tests: "OFF" <<: *build_definition build:test: variables: build_samples: "OFF" build_shared: "OFF" build_tests: "ON" artifacts: paths: - ./test/sgm-test expire_in: 1d <<: *build_definition test: stage: test tags: - nvidia-docker script: - ./test/sgm-test dependencies: - build:test
2
0.03125
1
1
3fcacad3124fd5eca3b08b4635e4814a6c44a2e0
assertions/titleContains.js
assertions/titleContains.js
/** * Checks if the page title contains the given value. * * ``` * this.demoTest = function (client) { * browser.assert.titleContains("Nightwatch"); * }; * ``` * * @method title * @param {string} expected The expected page title substring. * @param {string} [message] Optional log message to display in the output. If missing, one is displayed by default. * @api assertions */ var util = require('util'); exports.assertion = function(expected, msg) { this.message = msg || util.format('Testing if the page title contains "%s".', expected); this.expected = expected; this.pass = function(value) { return value.indexOf(this.expected) > -1; }; this.value = function(result) { return result.value; }; this.command = function(callback) { this.api.title(callback); return this; }; };
/** * Checks if the page title contains the given value. * * ``` * this.demoTest = function (client) { * browser.assert.titleContains("Nightwatch"); * }; * ``` * * @method title * @param {string} expected The expected page title substring. * @param {string} [message] Optional log message to display in the output. If missing, one is displayed by default. * @api assertions */ var util = require('util'); exports.assertion = function(expected, msg) { /** * The message which will be used in the test output and * inside the XML reports * @type {string} */ this.message = msg || util.format('Testing if the page title contains "%s".', expected); /** * A value to perform the assertion on. If a function is * defined, its result will be used. * @type {function|*} */ this.expected = expected; /** * The method which performs the actual assertion. It is * called with the result of the value method as the argument. * @type {function} */ this.pass = function(value) { return value.indexOf(this.expected) > -1; }; /** * The method which returns the value to be used on the * assertion. It is called with the result of the command's * callback as argument. * @type {function} */ this.value = function(result) { return result.value; }; /** * Performs a protocol command/action and its result is * passed to the value method via the callback argument. * @type {function} */ this.command = function(callback) { this.api.title(callback); return this; }; };
Add JSDoc comments to explain what's going on
Add JSDoc comments to explain what's going on
JavaScript
isc
TobiasKjrsgaard/nightwatch-demo
javascript
## Code Before: /** * Checks if the page title contains the given value. * * ``` * this.demoTest = function (client) { * browser.assert.titleContains("Nightwatch"); * }; * ``` * * @method title * @param {string} expected The expected page title substring. * @param {string} [message] Optional log message to display in the output. If missing, one is displayed by default. * @api assertions */ var util = require('util'); exports.assertion = function(expected, msg) { this.message = msg || util.format('Testing if the page title contains "%s".', expected); this.expected = expected; this.pass = function(value) { return value.indexOf(this.expected) > -1; }; this.value = function(result) { return result.value; }; this.command = function(callback) { this.api.title(callback); return this; }; }; ## Instruction: Add JSDoc comments to explain what's going on ## Code After: /** * Checks if the page title contains the given value. * * ``` * this.demoTest = function (client) { * browser.assert.titleContains("Nightwatch"); * }; * ``` * * @method title * @param {string} expected The expected page title substring. * @param {string} [message] Optional log message to display in the output. If missing, one is displayed by default. * @api assertions */ var util = require('util'); exports.assertion = function(expected, msg) { /** * The message which will be used in the test output and * inside the XML reports * @type {string} */ this.message = msg || util.format('Testing if the page title contains "%s".', expected); /** * A value to perform the assertion on. If a function is * defined, its result will be used. * @type {function|*} */ this.expected = expected; /** * The method which performs the actual assertion. It is * called with the result of the value method as the argument. * @type {function} */ this.pass = function(value) { return value.indexOf(this.expected) > -1; }; /** * The method which returns the value to be used on the * assertion. It is called with the result of the command's * callback as argument. * @type {function} */ this.value = function(result) { return result.value; }; /** * Performs a protocol command/action and its result is * passed to the value method via the callback argument. * @type {function} */ this.command = function(callback) { this.api.title(callback); return this; }; };
/** * Checks if the page title contains the given value. * * ``` * this.demoTest = function (client) { * browser.assert.titleContains("Nightwatch"); * }; * ``` * * @method title * @param {string} expected The expected page title substring. * @param {string} [message] Optional log message to display in the output. If missing, one is displayed by default. * @api assertions */ var util = require('util'); exports.assertion = function(expected, msg) { + /** + * The message which will be used in the test output and + * inside the XML reports + * @type {string} + */ this.message = msg || util.format('Testing if the page title contains "%s".', expected); + + /** + * A value to perform the assertion on. If a function is + * defined, its result will be used. + * @type {function|*} + */ this.expected = expected; + /** + * The method which performs the actual assertion. It is + * called with the result of the value method as the argument. + * @type {function} + */ this.pass = function(value) { return value.indexOf(this.expected) > -1; }; + /** + * The method which returns the value to be used on the + * assertion. It is called with the result of the command's + * callback as argument. + * @type {function} + */ this.value = function(result) { return result.value; }; + /** + * Performs a protocol command/action and its result is + * passed to the value method via the callback argument. + * @type {function} + */ this.command = function(callback) { this.api.title(callback); return this; }; };
27
0.771429
27
0