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
03e2f1a903057992297458d26ab67966edc73dac
doc/index.md
doc/index.md
Finding your way around ----------------------- See the class list to the right and especially take a look at {@link ol.Map} and {@link ol.layer.Layer} because those are the central objects. In general every use of OpenLayers starts by initializing a map, then adding the required layers. Controls and interactions can be added to change the behavior of the map. Projections ----------- A {@link ol.Projection} defines which point on earth is represented by a pair of coordinates. Coordinates within OpenLayers can be used in various projections where some common projections are always supported, others can be used via Proj4js. Maps and Layers --------------- A map in OpenLayers is essentially a staple of layers that is viewed from the top. Layers are responsible for retieving data and displaying it. Contributing ------------ See CONTRIBUTING.md for instructions on building and tesing OpenLayers. The file does also describe how to commit your changes to OpenLayers.
Finding your way around ----------------------- See the class list to the right and especially take a look at {@link ol.Map} and {@link ol.layer.Layer} because those are the central objects. In general every use of OpenLayers starts by initializing a map, then adding the required layers. Controls and interactions can be added to change the behavior of the map. Projections ----------- A {@link ol.Projection} defines which point on earth is represented by a pair of coordinates. Coordinates within OpenLayers can be used in various projections where some common projections are always supported, others can be used via [Proj4js](http://trac.osgeo.org/proj4js/). Maps and Layers --------------- A map in OpenLayers is essentially a staple of layers that is viewed from the top. Layers are responsible for retieving data and displaying it. Contributing ------------ See [CONTRIBUTING.md](https://github.com/openlayers/ol3/blob/master/CONTRIBUTING.md) for instructions on building and tesing OpenLayers. The file does also describe how to commit your changes to OpenLayers.
Add links to Proj4js and CONTRIBUTING.md
Add links to Proj4js and CONTRIBUTING.md
Markdown
bsd-2-clause
landonb/ol3,Distem/ol3,oterral/ol3,planetlabs/ol3,stweil/ol3,stweil/ol3,Antreasgr/ol3,Distem/ol3,klokantech/ol3,tamarmot/ol3,tsauerwein/ol3,gingerik/ol3,Morgul/ol3,gingerik/ol3,ahocevar/openlayers,geekdenz/ol3,ahocevar/ol3,geekdenz/openlayers,oterral/ol3,geekdenz/openlayers,das-peter/ol3,stweil/ol3,itayod/ol3,planetlabs/ol3,Andrey-Pavlov/ol3,kjelderg/ol3,wlerner/ol3,richstoner/ol3,Morgul/ol3,klokantech/ol3,llambanna/ol3,planetlabs/ol3,stweil/openlayers,planetlabs/ol3,hafenr/ol3,ahocevar/ol3,hafenr/ol3,mzur/ol3,NOAA-ORR-ERD/ol3,jacmendt/ol3,openlayers/openlayers,fredj/ol3,kjelderg/ol3,bill-chadwick/ol3,antonio83moura/ol3,fredj/ol3,thomasmoelhave/ol3,NOAA-ORR-ERD/ol3,bogdanvaduva/ol3,wlerner/ol3,NOAA-ORR-ERD/ol3,denilsonsa/ol3,t27/ol3,bill-chadwick/ol3,llambanna/ol3,denilsonsa/ol3,Morgul/ol3,tsauerwein/ol3,bjornharrtell/ol3,kjelderg/ol3,bartvde/ol3,itayod/ol3,xiaoqqchen/ol3,xiaoqqchen/ol3,mechdrew/ol3,alexbrault/ol3,gingerik/ol3,openlayers/openlayers,llambanna/ol3,pmlrsg/ol3,klokantech/ol3raster,kkuunnddaannkk/ol3,stweil/openlayers,landonb/ol3,ahocevar/openlayers,ahocevar/openlayers,klokantech/ol3raster,tsauerwein/ol3,antonio83moura/ol3,antonio83moura/ol3,denilsonsa/ol3,Distem/ol3,bill-chadwick/ol3,freylis/ol3,kkuunnddaannkk/ol3,bartvde/ol3,yinxiaomei/ol3,yinxiaomei/ol3,geekdenz/ol3,fperucic/ol3,mzur/ol3,bogdanvaduva/ol3,fblackburn/ol3,antonio83moura/ol3,bill-chadwick/ol3,klokantech/ol3raster,jmiller-boundless/ol3,ahocevar/ol3,klokantech/ol3,Distem/ol3,landonb/ol3,geekdenz/ol3,geonux/ol3,epointal/ol3,openlayers/openlayers,pmlrsg/ol3,kjelderg/ol3,alvinlindstam/ol3,richstoner/ol3,fperucic/ol3,Antreasgr/ol3,pmlrsg/ol3,fperucic/ol3,alexbrault/ol3,hafenr/ol3,geekdenz/ol3,gingerik/ol3,wlerner/ol3,bartvde/ol3,geonux/ol3,fblackburn/ol3,tschaub/ol3,freylis/ol3,CandoImage/ol3,yinxiaomei/ol3,aisaacs/ol3,yinxiaomei/ol3,alvinlindstam/ol3,jmiller-boundless/ol3,richstoner/ol3,klokantech/ol3,Andrey-Pavlov/ol3,tsauerwein/ol3,xiaoqqchen/ol3,das-peter/ol3,thhomas/ol3,alexbrault/ol3,CandoImage/ol3,tamarmot/ol3,tamarmot/ol3,jacmendt/ol3,Morgul/ol3,das-peter/ol3,t27/ol3,mechdrew/ol3,adube/ol3,wlerner/ol3,tschaub/ol3,fblackburn/ol3,tschaub/ol3,jacmendt/ol3,thomasmoelhave/ol3,jmiller-boundless/ol3,aisaacs/ol3,itayod/ol3,geekdenz/openlayers,fredj/ol3,fblackburn/ol3,alexbrault/ol3,pmlrsg/ol3,itayod/ol3,alvinlindstam/ol3,landonb/ol3,Andrey-Pavlov/ol3,mzur/ol3,bogdanvaduva/ol3,adube/ol3,stweil/ol3,mzur/ol3,bartvde/ol3,xiaoqqchen/ol3,adube/ol3,t27/ol3,oterral/ol3,Antreasgr/ol3,epointal/ol3,fredj/ol3,bogdanvaduva/ol3,llambanna/ol3,CandoImage/ol3,jmiller-boundless/ol3,thomasmoelhave/ol3,thhomas/ol3,elemoine/ol3,hafenr/ol3,elemoine/ol3,fperucic/ol3,kkuunnddaannkk/ol3,richstoner/ol3,tschaub/ol3,tamarmot/ol3,thomasmoelhave/ol3,elemoine/ol3,ahocevar/ol3,elemoine/ol3,mechdrew/ol3,stweil/openlayers,jacmendt/ol3,aisaacs/ol3,jmiller-boundless/ol3,freylis/ol3,klokantech/ol3raster,geonux/ol3,kkuunnddaannkk/ol3,bjornharrtell/ol3,Andrey-Pavlov/ol3,alvinlindstam/ol3,bjornharrtell/ol3,NOAA-ORR-ERD/ol3,t27/ol3,thhomas/ol3,das-peter/ol3,epointal/ol3,denilsonsa/ol3,mechdrew/ol3,thhomas/ol3,aisaacs/ol3,CandoImage/ol3,geonux/ol3,freylis/ol3,epointal/ol3,Antreasgr/ol3
markdown
## Code Before: Finding your way around ----------------------- See the class list to the right and especially take a look at {@link ol.Map} and {@link ol.layer.Layer} because those are the central objects. In general every use of OpenLayers starts by initializing a map, then adding the required layers. Controls and interactions can be added to change the behavior of the map. Projections ----------- A {@link ol.Projection} defines which point on earth is represented by a pair of coordinates. Coordinates within OpenLayers can be used in various projections where some common projections are always supported, others can be used via Proj4js. Maps and Layers --------------- A map in OpenLayers is essentially a staple of layers that is viewed from the top. Layers are responsible for retieving data and displaying it. Contributing ------------ See CONTRIBUTING.md for instructions on building and tesing OpenLayers. The file does also describe how to commit your changes to OpenLayers. ## Instruction: Add links to Proj4js and CONTRIBUTING.md ## Code After: Finding your way around ----------------------- See the class list to the right and especially take a look at {@link ol.Map} and {@link ol.layer.Layer} because those are the central objects. In general every use of OpenLayers starts by initializing a map, then adding the required layers. Controls and interactions can be added to change the behavior of the map. Projections ----------- A {@link ol.Projection} defines which point on earth is represented by a pair of coordinates. Coordinates within OpenLayers can be used in various projections where some common projections are always supported, others can be used via [Proj4js](http://trac.osgeo.org/proj4js/). Maps and Layers --------------- A map in OpenLayers is essentially a staple of layers that is viewed from the top. Layers are responsible for retieving data and displaying it. Contributing ------------ See [CONTRIBUTING.md](https://github.com/openlayers/ol3/blob/master/CONTRIBUTING.md) for instructions on building and tesing OpenLayers. The file does also describe how to commit your changes to OpenLayers.
Finding your way around ----------------------- See the class list to the right and especially take a look at {@link ol.Map} and {@link ol.layer.Layer} because those are the central objects. In general every use of OpenLayers starts by initializing a map, then adding the required layers. Controls and interactions can be added to change the behavior of the map. Projections ----------- - A {@link ol.Projection} defines which point on earth is represented by a pair of coordinates. Coordinates within OpenLayers can be used in various projections where some common projections are always supported, others can be used via Proj4js. + A {@link ol.Projection} defines which point on earth is represented by a pair of coordinates. + Coordinates within OpenLayers can be used in various projections where some common projections are always supported, + others can be used via [Proj4js](http://trac.osgeo.org/proj4js/). Maps and Layers --------------- A map in OpenLayers is essentially a staple of layers that is viewed from the top. Layers are responsible for retieving data and displaying it. Contributing ------------ + See [CONTRIBUTING.md](https://github.com/openlayers/ol3/blob/master/CONTRIBUTING.md) for instructions - See CONTRIBUTING.md for instructions on building and tesing OpenLayers. The file does also describe how to commit your changes to OpenLayers. ? ------------------------------------- + on building and tesing OpenLayers. The file does also describe how to commit your changes to OpenLayers.
7
0.411765
5
2
9a21943db3d55b5f04008f2f61b45903fb376a49
lib/pusher-fake/cucumber.rb
lib/pusher-fake/cucumber.rb
PusherFake.configure do |configuration| configuration.app_id = Pusher.app_id configuration.key = Pusher.key configuration.secret = Pusher.secret end # Set the host and port to the fake web server. PusherFake.configuration.web_options.tap do |options| Pusher.host = options[:host] Pusher.port = options[:port] end # Start the fake web server. fork { PusherFake::Server.start }.tap do |id| at_exit { Process.kill("KILL", id) } end # Reset channels between scenarios. After do PusherFake::Channel.reset end
PusherFake.configure do |configuration| configuration.app_id = Pusher.app_id configuration.key = Pusher.key configuration.secret = Pusher.secret end # Set the host and port to the fake web server. PusherFake.configuration.web_options.tap do |options| Pusher.host = options[:host] Pusher.port = options[:port] end # Start the fake socket and web servers. fork { PusherFake::Server.start }.tap do |id| at_exit { Process.kill("KILL", id) } end # Reset channels between scenarios. After do PusherFake::Channel.reset end
Correct comment about starting the server.
Correct comment about starting the server.
Ruby
mit
tristandunn/pusher-fake,Tybot204/pusher-fake,Drooids/pusher-fake,Tybot204/pusher-fake,tristandunn/pusher-fake,Drooids/pusher-fake
ruby
## Code Before: PusherFake.configure do |configuration| configuration.app_id = Pusher.app_id configuration.key = Pusher.key configuration.secret = Pusher.secret end # Set the host and port to the fake web server. PusherFake.configuration.web_options.tap do |options| Pusher.host = options[:host] Pusher.port = options[:port] end # Start the fake web server. fork { PusherFake::Server.start }.tap do |id| at_exit { Process.kill("KILL", id) } end # Reset channels between scenarios. After do PusherFake::Channel.reset end ## Instruction: Correct comment about starting the server. ## Code After: PusherFake.configure do |configuration| configuration.app_id = Pusher.app_id configuration.key = Pusher.key configuration.secret = Pusher.secret end # Set the host and port to the fake web server. PusherFake.configuration.web_options.tap do |options| Pusher.host = options[:host] Pusher.port = options[:port] end # Start the fake socket and web servers. fork { PusherFake::Server.start }.tap do |id| at_exit { Process.kill("KILL", id) } end # Reset channels between scenarios. After do PusherFake::Channel.reset end
PusherFake.configure do |configuration| configuration.app_id = Pusher.app_id configuration.key = Pusher.key configuration.secret = Pusher.secret end # Set the host and port to the fake web server. PusherFake.configuration.web_options.tap do |options| Pusher.host = options[:host] Pusher.port = options[:port] end - # Start the fake web server. + # Start the fake socket and web servers. ? +++++++++++ + fork { PusherFake::Server.start }.tap do |id| at_exit { Process.kill("KILL", id) } end # Reset channels between scenarios. After do PusherFake::Channel.reset end
2
0.095238
1
1
113284eef505340d428ce87affc1101db2d1d049
robot_tests_arguments/single_item_tender.txt
robot_tests_arguments/single_item_tender.txt
-v MODE:belowThreshold -v NUMBER_OF_ITEMS:1 -v NUMBER_OF_LOTS:1 -v TENDER_MEAT:False -v ITEM_MEAT:False -v LOT_MEAT:False -i create_tender -i add_tender_doc -i find_tender -i tender_view -i extend_tendering_period -i ask_question_to_tender -i answer_question_to_tender -i modify_tender_after_questions -i ask_question_to_tender_after_tendering_period -i make_bid_before_tendering_period -i make_bid_by_provider -i modify_bid_by_provider -i add_doc_to_bid_by_provider -i make_bid_by_provider1 -i bid_view_in_tendering_period -i add_bid_doc_after_tendering_period_by_provider -i modify_bid_doc_after_tendering_period_by_provider -i modify_bid_after_tendering_period_by_provider1 -i cancel_bid_after_tendering_period_by_provider1 -i document_service -i auction_url
-v MODE:belowThreshold -v NUMBER_OF_ITEMS:1 -v TENDER_MEAT:False -v ITEM_MEAT:False -v LOT_MEAT:False -i create_tender -i add_tender_doc -i find_tender -i tender_view -i extend_tendering_period -i ask_question_to_tender -i answer_question_to_tender -i modify_tender_after_questions -i ask_question_to_tender_after_tendering_period -i make_bid_before_tendering_period -i make_bid_by_provider -i modify_bid_by_provider -i add_doc_to_bid_by_provider -i make_bid_by_provider1 -i bid_view_in_tendering_period -i add_bid_doc_after_tendering_period_by_provider -i modify_bid_doc_after_tendering_period_by_provider -i modify_bid_after_tendering_period_by_provider1 -i cancel_bid_after_tendering_period_by_provider1 -i document_service -i auction_url
Remove lot parameter from single item tender
Remove lot parameter from single item tender
Text
apache-2.0
Rzaporozhets/robot_tests,selurvedu/robot_tests,kosaniak/robot_tests,bubanoid/robot_tests,openprocurement/robot_tests,SlaOne/robot_tests
text
## Code Before: -v MODE:belowThreshold -v NUMBER_OF_ITEMS:1 -v NUMBER_OF_LOTS:1 -v TENDER_MEAT:False -v ITEM_MEAT:False -v LOT_MEAT:False -i create_tender -i add_tender_doc -i find_tender -i tender_view -i extend_tendering_period -i ask_question_to_tender -i answer_question_to_tender -i modify_tender_after_questions -i ask_question_to_tender_after_tendering_period -i make_bid_before_tendering_period -i make_bid_by_provider -i modify_bid_by_provider -i add_doc_to_bid_by_provider -i make_bid_by_provider1 -i bid_view_in_tendering_period -i add_bid_doc_after_tendering_period_by_provider -i modify_bid_doc_after_tendering_period_by_provider -i modify_bid_after_tendering_period_by_provider1 -i cancel_bid_after_tendering_period_by_provider1 -i document_service -i auction_url ## Instruction: Remove lot parameter from single item tender ## Code After: -v MODE:belowThreshold -v NUMBER_OF_ITEMS:1 -v TENDER_MEAT:False -v ITEM_MEAT:False -v LOT_MEAT:False -i create_tender -i add_tender_doc -i find_tender -i tender_view -i extend_tendering_period -i ask_question_to_tender -i answer_question_to_tender -i modify_tender_after_questions -i ask_question_to_tender_after_tendering_period -i make_bid_before_tendering_period -i make_bid_by_provider -i modify_bid_by_provider -i add_doc_to_bid_by_provider -i make_bid_by_provider1 -i bid_view_in_tendering_period -i add_bid_doc_after_tendering_period_by_provider -i modify_bid_doc_after_tendering_period_by_provider -i modify_bid_after_tendering_period_by_provider1 -i cancel_bid_after_tendering_period_by_provider1 -i document_service -i auction_url
-v MODE:belowThreshold -v NUMBER_OF_ITEMS:1 - -v NUMBER_OF_LOTS:1 -v TENDER_MEAT:False -v ITEM_MEAT:False -v LOT_MEAT:False -i create_tender -i add_tender_doc -i find_tender -i tender_view -i extend_tendering_period -i ask_question_to_tender -i answer_question_to_tender -i modify_tender_after_questions -i ask_question_to_tender_after_tendering_period -i make_bid_before_tendering_period -i make_bid_by_provider -i modify_bid_by_provider -i add_doc_to_bid_by_provider -i make_bid_by_provider1 -i bid_view_in_tendering_period -i add_bid_doc_after_tendering_period_by_provider -i modify_bid_doc_after_tendering_period_by_provider -i modify_bid_after_tendering_period_by_provider1 -i cancel_bid_after_tendering_period_by_provider1 -i document_service -i auction_url
1
0.029412
0
1
b6e09f04cb29ca296f06f6ea63e31411f86fa264
Documentation/Building.md
Documentation/Building.md
> ***Important:*** This document only matters to you if you want to build Yarn Spinner from source. In almost all cases, you'll be totally fine with [downloading a build](https://github.com/thesecretlab/YarnSpinner/releases), and using that in your project. To build Yarn Spinner, you'll need MonoDevelop. You can [download MonoDevelop for your OS from the MonoDevelop site](http://www.monodevelop.com/download/). Once it's downloaded, follow these steps: * Open **YarnSpinner.sln**. * Open the **Build menu**, and choose **Build All**. * Open the **Unity/Assets/Yarn Spinner** folder. You'll find a copy of **YarnSpinner.dll** there. You can now copy that DLL file wherever you need it.
> ***Important:*** This document only matters to you if you want to build Yarn Spinner from source. In almost all cases, you'll be totally fine with [downloading a build](https://github.com/thesecretlab/YarnSpinner/releases), and using that in your project. To build Yarn Spinner, you'll need MonoDevelop. You can [download MonoDevelop for your OS from the MonoDevelop site](http://www.monodevelop.com/download/). Once it's downloaded, follow these steps: * Open **YarnSpinner.sln**. * Open the **Build menu**, and choose **Build All**. * Open the **Unity/Assets/Yarn Spinner** folder. You'll find a copy of **YarnSpinner.dll** there. You can now copy that DLL file wherever you need it. ## Building Documentation Yarn Spinner uses [Doxygen](https://www.stack.nl/~dimitri/doxygen) to generate [DocBook](http://docbook.org/), [HTML](https://en.wikipedia.org/wiki/HTML), [LaTeX](https://www.latex-project.org/help/documentation/), [RTF](https://en.wikipedia.org/wiki/Rich_Text_Format), and [XML](https://en.wikipedia.org/wiki/XML) documentation. [GNU GLOBAL](https://www.gnu.org/software/global/) is also used. Basic steps to clean out existing documentation, generate new documentation and check the new documentation for generation errors. Note that some ocurrences of the word 'error' will be due to classes/methods etc. of YarnSpinner itself and not an actual error in the documentation. * rm -fr Documentation/{docbook,html,latex,rtf,xml} * doxygen Documentation/Doxyfile > doxyoutput.txt 2>&1 * grep -i error doxyoutput.txt [MarkDown](https://daringfireball.net/projects/markdown/) documentation is available via conversion of the XML output to Markdown using third party tools such as [Pandoc](http://pandoc.org) or [doxygen2md](https://github.com/pferdinand/doxygen2md)
Add some info on using Doxygen with notes for further XML processing
Add some info on using Doxygen with notes for further XML processing
Markdown
mit
thesecretlab/YarnSpinner,thesecretlab/YarnSpinner,thesecretlab/YarnSpinner
markdown
## Code Before: > ***Important:*** This document only matters to you if you want to build Yarn Spinner from source. In almost all cases, you'll be totally fine with [downloading a build](https://github.com/thesecretlab/YarnSpinner/releases), and using that in your project. To build Yarn Spinner, you'll need MonoDevelop. You can [download MonoDevelop for your OS from the MonoDevelop site](http://www.monodevelop.com/download/). Once it's downloaded, follow these steps: * Open **YarnSpinner.sln**. * Open the **Build menu**, and choose **Build All**. * Open the **Unity/Assets/Yarn Spinner** folder. You'll find a copy of **YarnSpinner.dll** there. You can now copy that DLL file wherever you need it. ## Instruction: Add some info on using Doxygen with notes for further XML processing ## Code After: > ***Important:*** This document only matters to you if you want to build Yarn Spinner from source. In almost all cases, you'll be totally fine with [downloading a build](https://github.com/thesecretlab/YarnSpinner/releases), and using that in your project. To build Yarn Spinner, you'll need MonoDevelop. You can [download MonoDevelop for your OS from the MonoDevelop site](http://www.monodevelop.com/download/). Once it's downloaded, follow these steps: * Open **YarnSpinner.sln**. * Open the **Build menu**, and choose **Build All**. * Open the **Unity/Assets/Yarn Spinner** folder. You'll find a copy of **YarnSpinner.dll** there. You can now copy that DLL file wherever you need it. ## Building Documentation Yarn Spinner uses [Doxygen](https://www.stack.nl/~dimitri/doxygen) to generate [DocBook](http://docbook.org/), [HTML](https://en.wikipedia.org/wiki/HTML), [LaTeX](https://www.latex-project.org/help/documentation/), [RTF](https://en.wikipedia.org/wiki/Rich_Text_Format), and [XML](https://en.wikipedia.org/wiki/XML) documentation. [GNU GLOBAL](https://www.gnu.org/software/global/) is also used. Basic steps to clean out existing documentation, generate new documentation and check the new documentation for generation errors. Note that some ocurrences of the word 'error' will be due to classes/methods etc. of YarnSpinner itself and not an actual error in the documentation. * rm -fr Documentation/{docbook,html,latex,rtf,xml} * doxygen Documentation/Doxyfile > doxyoutput.txt 2>&1 * grep -i error doxyoutput.txt [MarkDown](https://daringfireball.net/projects/markdown/) documentation is available via conversion of the XML output to Markdown using third party tools such as [Pandoc](http://pandoc.org) or [doxygen2md](https://github.com/pferdinand/doxygen2md)
> ***Important:*** This document only matters to you if you want to build Yarn Spinner from source. In almost all cases, you'll be totally fine with [downloading a build](https://github.com/thesecretlab/YarnSpinner/releases), and using that in your project. To build Yarn Spinner, you'll need MonoDevelop. You can [download MonoDevelop for your OS from the MonoDevelop site](http://www.monodevelop.com/download/). Once it's downloaded, follow these steps: * Open **YarnSpinner.sln**. * Open the **Build menu**, and choose **Build All**. * Open the **Unity/Assets/Yarn Spinner** folder. You'll find a copy of **YarnSpinner.dll** there. You can now copy that DLL file wherever you need it. + + ## Building Documentation + + Yarn Spinner uses [Doxygen](https://www.stack.nl/~dimitri/doxygen) to generate [DocBook](http://docbook.org/), [HTML](https://en.wikipedia.org/wiki/HTML), [LaTeX](https://www.latex-project.org/help/documentation/), [RTF](https://en.wikipedia.org/wiki/Rich_Text_Format), and [XML](https://en.wikipedia.org/wiki/XML) documentation. [GNU GLOBAL](https://www.gnu.org/software/global/) is also used. + + Basic steps to clean out existing documentation, generate new documentation and check the new documentation for generation errors. Note that some ocurrences of the word 'error' will be due to classes/methods etc. of YarnSpinner itself and not an actual error in the documentation. + + * rm -fr Documentation/{docbook,html,latex,rtf,xml} + * doxygen Documentation/Doxyfile > doxyoutput.txt 2>&1 + * grep -i error doxyoutput.txt + + [MarkDown](https://daringfireball.net/projects/markdown/) documentation is available via conversion of the XML output to Markdown using third party tools such as [Pandoc](http://pandoc.org) or [doxygen2md](https://github.com/pferdinand/doxygen2md)
12
1.2
12
0
cbf68d5002201017ce15a452a8643e8217f11412
Aware/AppDelegate.swift
Aware/AppDelegate.swift
// // AppDelegate.swift // Aware // // Created by Joshua Peek on 12/5/15. // Copyright © 2015 Joshua Peek. All rights reserved. // import Cocoa @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { @IBOutlet weak var window: NSWindow! func applicationDidFinishLaunching(aNotification: NSNotification) { // Insert code here to initialize your application } func applicationWillTerminate(aNotification: NSNotification) { // Insert code here to tear down your application } }
// // AppDelegate.swift // Aware // // Created by Joshua Peek on 12/5/15. // Copyright © 2015 Joshua Peek. All rights reserved. // import Cocoa @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { @IBOutlet weak var window: NSWindow! let statusItem = NSStatusBar.systemStatusBar().statusItemWithLength(NSVariableStatusItemLength) func applicationDidFinishLaunching(aNotification: NSNotification) { if let button = statusItem.button { button.attributedTitle = NSAttributedString(string: "1m") } } func applicationWillTerminate(aNotification: NSNotification) { // Insert code here to tear down your application } }
Install stub status bar item
Install stub status bar item
Swift
mit
josh/Aware
swift
## Code Before: // // AppDelegate.swift // Aware // // Created by Joshua Peek on 12/5/15. // Copyright © 2015 Joshua Peek. All rights reserved. // import Cocoa @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { @IBOutlet weak var window: NSWindow! func applicationDidFinishLaunching(aNotification: NSNotification) { // Insert code here to initialize your application } func applicationWillTerminate(aNotification: NSNotification) { // Insert code here to tear down your application } } ## Instruction: Install stub status bar item ## Code After: // // AppDelegate.swift // Aware // // Created by Joshua Peek on 12/5/15. // Copyright © 2015 Joshua Peek. All rights reserved. // import Cocoa @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { @IBOutlet weak var window: NSWindow! let statusItem = NSStatusBar.systemStatusBar().statusItemWithLength(NSVariableStatusItemLength) func applicationDidFinishLaunching(aNotification: NSNotification) { if let button = statusItem.button { button.attributedTitle = NSAttributedString(string: "1m") } } func applicationWillTerminate(aNotification: NSNotification) { // Insert code here to tear down your application } }
// // AppDelegate.swift // Aware // // Created by Joshua Peek on 12/5/15. // Copyright © 2015 Joshua Peek. All rights reserved. // import Cocoa @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { @IBOutlet weak var window: NSWindow! + let statusItem = NSStatusBar.systemStatusBar().statusItemWithLength(NSVariableStatusItemLength) func applicationDidFinishLaunching(aNotification: NSNotification) { - // Insert code here to initialize your application + if let button = statusItem.button { + button.attributedTitle = NSAttributedString(string: "1m") + } } func applicationWillTerminate(aNotification: NSNotification) { // Insert code here to tear down your application } }
5
0.185185
4
1
dd1c91e8105dbed9c752afcba832633e3b98b7bc
app/lib/services.rb
app/lib/services.rb
require "gds_api/publishing_api" require "gds_api/content_store" require "gds_api/link_checker_api" module Services def self.publishing_api @publishing_api ||= GdsApi::PublishingApi.new( Plek.new.find("publishing-api"), disable_cache: true, bearer_token: ENV["PUBLISHING_API_BEARER_TOKEN"] || "example", ) end def self.content_store @content_store ||= GdsApi::ContentStore.new( Plek.new.find("content-store"), disable_cache: true, ) end def self.link_checker_api @link_checker_api ||= GdsApi::LinkCheckerApi.new( Plek.new.find("link-checker-api"), bearer_token: ENV["LINK_CHECKER_API_BEARER_TOKEN"], ) end end
require "gds_api/publishing_api" require "gds_api/content_store" require "gds_api/link_checker_api" require "gds_api/email_alert_api" module Services def self.publishing_api @publishing_api ||= GdsApi::PublishingApi.new( Plek.new.find("publishing-api"), disable_cache: true, bearer_token: ENV["PUBLISHING_API_BEARER_TOKEN"] || "example", ) end def self.content_store @content_store ||= GdsApi::ContentStore.new( Plek.new.find("content-store"), disable_cache: true, ) end def self.link_checker_api @link_checker_api ||= GdsApi::LinkCheckerApi.new( Plek.new.find("link-checker-api"), bearer_token: ENV["LINK_CHECKER_API_BEARER_TOKEN"], ) end def self.email_alert_api @email_alert_api || GdsApi::EmailAlertApi.new( Plek.new.find("email-alert-api"), bearer_token: ENV["EMAIL_ALERT_API_BEARER_TOKEN"], ) end end
Add Email Alert API to Services
Add Email Alert API to Services We want to be able to unsubscribe users when a specialist topic is archived. Required bearer tokens set up in https://github.com/alphagov/govuk-secrets/pull/1298
Ruby
mit
alphagov/collections-publisher,alphagov/collections-publisher,alphagov/collections-publisher
ruby
## Code Before: require "gds_api/publishing_api" require "gds_api/content_store" require "gds_api/link_checker_api" module Services def self.publishing_api @publishing_api ||= GdsApi::PublishingApi.new( Plek.new.find("publishing-api"), disable_cache: true, bearer_token: ENV["PUBLISHING_API_BEARER_TOKEN"] || "example", ) end def self.content_store @content_store ||= GdsApi::ContentStore.new( Plek.new.find("content-store"), disable_cache: true, ) end def self.link_checker_api @link_checker_api ||= GdsApi::LinkCheckerApi.new( Plek.new.find("link-checker-api"), bearer_token: ENV["LINK_CHECKER_API_BEARER_TOKEN"], ) end end ## Instruction: Add Email Alert API to Services We want to be able to unsubscribe users when a specialist topic is archived. Required bearer tokens set up in https://github.com/alphagov/govuk-secrets/pull/1298 ## Code After: require "gds_api/publishing_api" require "gds_api/content_store" require "gds_api/link_checker_api" require "gds_api/email_alert_api" module Services def self.publishing_api @publishing_api ||= GdsApi::PublishingApi.new( Plek.new.find("publishing-api"), disable_cache: true, bearer_token: ENV["PUBLISHING_API_BEARER_TOKEN"] || "example", ) end def self.content_store @content_store ||= GdsApi::ContentStore.new( Plek.new.find("content-store"), disable_cache: true, ) end def self.link_checker_api @link_checker_api ||= GdsApi::LinkCheckerApi.new( Plek.new.find("link-checker-api"), bearer_token: ENV["LINK_CHECKER_API_BEARER_TOKEN"], ) end def self.email_alert_api @email_alert_api || GdsApi::EmailAlertApi.new( Plek.new.find("email-alert-api"), bearer_token: ENV["EMAIL_ALERT_API_BEARER_TOKEN"], ) end end
require "gds_api/publishing_api" require "gds_api/content_store" require "gds_api/link_checker_api" + require "gds_api/email_alert_api" module Services def self.publishing_api @publishing_api ||= GdsApi::PublishingApi.new( Plek.new.find("publishing-api"), disable_cache: true, bearer_token: ENV["PUBLISHING_API_BEARER_TOKEN"] || "example", ) end def self.content_store @content_store ||= GdsApi::ContentStore.new( Plek.new.find("content-store"), disable_cache: true, ) end def self.link_checker_api @link_checker_api ||= GdsApi::LinkCheckerApi.new( Plek.new.find("link-checker-api"), bearer_token: ENV["LINK_CHECKER_API_BEARER_TOKEN"], ) end + + def self.email_alert_api + @email_alert_api || GdsApi::EmailAlertApi.new( + Plek.new.find("email-alert-api"), + bearer_token: ENV["EMAIL_ALERT_API_BEARER_TOKEN"], + ) + end end
8
0.296296
8
0
582731f7d640b1c40851d028b347cc139a43a4fa
source/manual/github.html.md.erb
source/manual/github.html.md.erb
--- owner_slack: "#govuk-developers" title: How we use GitHub parent: /manual.html layout: manual_layout section: GitHub type: learn last_reviewed_on: 2020-04-21 review_in: 6 months --- We share the [alphagov GitHub organisation][alphagov] with the other teams in the Government Digital Service (GDS). Our GitHub organisation is on the Enterprise Cloud plan. This can sometimes make it hard to find repositories that belong to our team. We use GitHub "topics" to organise the repos. All repos owned by us should be tagged with [`govuk`](https://github.com/search?q=topic:govuk). We use [govuk-saas-config][] to configure our repositories. ## Topics on GitHub <% AppDocs.topics_on_github.each do |topic| %> - <%= link_to topic, "https://github.com/search?q=topic:#{topic}+org:alphagov" %> <% end %> [alphagov]: https://github.com/alphagov [govuk-saas-config]: https://github.com/alphagov/govuk-saas-config/tree/master/github
--- owner_slack: "#govuk-developers" title: How we use GitHub parent: /manual.html layout: manual_layout section: GitHub type: learn last_reviewed_on: 2020-04-21 review_in: 6 months --- We share the [alphagov GitHub organisation][alphagov] with the other teams in the Government Digital Service (GDS). Our GitHub organisation is on the Enterprise Cloud plan. This can sometimes make it hard to find repositories that belong to our team. We use GitHub "topics" to organise the repos. All repos owned by us should be tagged with [`govuk`](https://github.com/search?q=topic:govuk). We use [govuk-saas-config][] to configure our repositories. [alphagov]: https://github.com/alphagov [govuk-saas-config]: https://github.com/alphagov/govuk-saas-config/tree/master/github
Remove reference to 'topics_on_github' method
Remove reference to 'topics_on_github' method This should have been removed in https://github.com/alphagov/govuk-developer-docs/pull/2519
HTML+ERB
mit
alphagov/govuk-developer-docs,alphagov/govuk-developer-docs,alphagov/govuk-developer-docs,alphagov/govuk-developer-docs
html+erb
## Code Before: --- owner_slack: "#govuk-developers" title: How we use GitHub parent: /manual.html layout: manual_layout section: GitHub type: learn last_reviewed_on: 2020-04-21 review_in: 6 months --- We share the [alphagov GitHub organisation][alphagov] with the other teams in the Government Digital Service (GDS). Our GitHub organisation is on the Enterprise Cloud plan. This can sometimes make it hard to find repositories that belong to our team. We use GitHub "topics" to organise the repos. All repos owned by us should be tagged with [`govuk`](https://github.com/search?q=topic:govuk). We use [govuk-saas-config][] to configure our repositories. ## Topics on GitHub <% AppDocs.topics_on_github.each do |topic| %> - <%= link_to topic, "https://github.com/search?q=topic:#{topic}+org:alphagov" %> <% end %> [alphagov]: https://github.com/alphagov [govuk-saas-config]: https://github.com/alphagov/govuk-saas-config/tree/master/github ## Instruction: Remove reference to 'topics_on_github' method This should have been removed in https://github.com/alphagov/govuk-developer-docs/pull/2519 ## Code After: --- owner_slack: "#govuk-developers" title: How we use GitHub parent: /manual.html layout: manual_layout section: GitHub type: learn last_reviewed_on: 2020-04-21 review_in: 6 months --- We share the [alphagov GitHub organisation][alphagov] with the other teams in the Government Digital Service (GDS). Our GitHub organisation is on the Enterprise Cloud plan. This can sometimes make it hard to find repositories that belong to our team. We use GitHub "topics" to organise the repos. All repos owned by us should be tagged with [`govuk`](https://github.com/search?q=topic:govuk). We use [govuk-saas-config][] to configure our repositories. [alphagov]: https://github.com/alphagov [govuk-saas-config]: https://github.com/alphagov/govuk-saas-config/tree/master/github
--- owner_slack: "#govuk-developers" title: How we use GitHub parent: /manual.html layout: manual_layout section: GitHub type: learn last_reviewed_on: 2020-04-21 review_in: 6 months --- We share the [alphagov GitHub organisation][alphagov] with the other teams in the Government Digital Service (GDS). Our GitHub organisation is on the Enterprise Cloud plan. This can sometimes make it hard to find repositories that belong to our team. We use GitHub "topics" to organise the repos. All repos owned by us should be tagged with [`govuk`](https://github.com/search?q=topic:govuk). We use [govuk-saas-config][] to configure our repositories. - ## Topics on GitHub - - <% AppDocs.topics_on_github.each do |topic| %> - - <%= link_to topic, "https://github.com/search?q=topic:#{topic}+org:alphagov" %> - <% end %> - [alphagov]: https://github.com/alphagov [govuk-saas-config]: https://github.com/alphagov/govuk-saas-config/tree/master/github
6
0.206897
0
6
c79f8058a8183b800f34dc01b259640cf2fdde6e
README.md
README.md
This package adds the following functionality to the go language: * `gofmt` support * `goimports` support (change the `Gofmt Path` preference to target `goimports`) * `go vet` support ### Defaults The preferences for this package default to values that match the way `go` is installed on OS X using the package installer: * `go` is installed at `/usr/local/go` * `go` executables are found at `/usr/local/go/bin` Additionally `format on save` and `vet on save` are enabled default. You can override these defaults by updating the `go-plus` preferences. The following features will be added soon: * `go build` and `go test` integration to enhance error display * Status bar text for errors * `gocode` integration * ... and others: https://github.com/joefitzgerald/go-plus/issues ### Contributing Contributions are greatly appreciated. Please fork this repository, make your changes, and open a pull request.
This package adds the following functionality to the go language: * `gofmt` support * `goimports` support (change the `Gofmt Path` preference to target `goimports`) * `go vet` support ### Example ![A screenshot of go-plus in action](http://cl.ly/image/422w3W3F171G/go-plus-example.gif) ### Defaults The preferences for this package default to values that match the way `go` is installed on OS X using the package installer: * `go` is installed at `/usr/local/go` * `go` executables are found at `/usr/local/go/bin` Additionally `format on save` and `vet on save` are enabled default. You can override these defaults by updating the `go-plus` preferences. The following features will be added soon: * `go build` and `go test` integration to enhance error display * Status bar text for errors * `gocode` integration * ... and others: https://github.com/joefitzgerald/go-plus/issues ### Contributing Contributions are greatly appreciated. Please fork this repository, make your changes, and open a pull request.
Add link to demo gif
Add link to demo gif
Markdown
apache-2.0
alecthomas/go-plus,danielchatfield/go-plus,crispinb/go-plus,Gurpartap/go-plus,rengawm/go-plus,greensnark/go-plus,timesking/go-plus,ma314smith/go-plus,alex/go-plus,akutz/go-plus,crispinb/go-plus,alex/go-plus,rodumani/go-plus
markdown
## Code Before: This package adds the following functionality to the go language: * `gofmt` support * `goimports` support (change the `Gofmt Path` preference to target `goimports`) * `go vet` support ### Defaults The preferences for this package default to values that match the way `go` is installed on OS X using the package installer: * `go` is installed at `/usr/local/go` * `go` executables are found at `/usr/local/go/bin` Additionally `format on save` and `vet on save` are enabled default. You can override these defaults by updating the `go-plus` preferences. The following features will be added soon: * `go build` and `go test` integration to enhance error display * Status bar text for errors * `gocode` integration * ... and others: https://github.com/joefitzgerald/go-plus/issues ### Contributing Contributions are greatly appreciated. Please fork this repository, make your changes, and open a pull request. ## Instruction: Add link to demo gif ## Code After: This package adds the following functionality to the go language: * `gofmt` support * `goimports` support (change the `Gofmt Path` preference to target `goimports`) * `go vet` support ### Example ![A screenshot of go-plus in action](http://cl.ly/image/422w3W3F171G/go-plus-example.gif) ### Defaults The preferences for this package default to values that match the way `go` is installed on OS X using the package installer: * `go` is installed at `/usr/local/go` * `go` executables are found at `/usr/local/go/bin` Additionally `format on save` and `vet on save` are enabled default. You can override these defaults by updating the `go-plus` preferences. The following features will be added soon: * `go build` and `go test` integration to enhance error display * Status bar text for errors * `gocode` integration * ... and others: https://github.com/joefitzgerald/go-plus/issues ### Contributing Contributions are greatly appreciated. Please fork this repository, make your changes, and open a pull request.
This package adds the following functionality to the go language: * `gofmt` support * `goimports` support (change the `Gofmt Path` preference to target `goimports`) * `go vet` support + + ### Example + + ![A screenshot of go-plus in action](http://cl.ly/image/422w3W3F171G/go-plus-example.gif) ### Defaults The preferences for this package default to values that match the way `go` is installed on OS X using the package installer: * `go` is installed at `/usr/local/go` * `go` executables are found at `/usr/local/go/bin` Additionally `format on save` and `vet on save` are enabled default. You can override these defaults by updating the `go-plus` preferences. The following features will be added soon: * `go build` and `go test` integration to enhance error display * Status bar text for errors * `gocode` integration * ... and others: https://github.com/joefitzgerald/go-plus/issues ### Contributing Contributions are greatly appreciated. Please fork this repository, make your changes, and open a pull request.
4
0.137931
4
0
9cb80ca85cd5f2ab92d6f6ebb3f9a0edc4a297bf
src/js/ui/app/components/music/scrubbar.js
src/js/ui/app/components/music/scrubbar.js
import React from 'react'; import timeFormatter from './../../utils/timeformatter'; const style = { container: { position: 'absolute', left: '0', bottom: '0', width: '100%' }, barContainer: { background: '#0B486B', height: '1rem', width: '100%' }, time: { color: '#FFF', fontFamily: 'OpenSans, sans-serif', padding: '0.5rem 1rem' }, left: { float: 'left' }, right: { float: 'right' } }; export default class ScrubBar extends React.Component { constructor (params) { super(params); this.state = { position: 0, duration: params.duration } } render () { return ( <div style={style.container}> <span style={Object.assign({}, style.time, style.left)}>{timeFormatter(this.state.position)}</span> <span style={Object.assign({}, style.time, style.right)}>{timeFormatter(this.state.duration)}</span> <div style={{clear: 'both'}} /> <div style={style.barContainer}></div> </div> ) } }
import React from 'react'; import timeFormatter from './../../utils/timeformatter'; const style = { container: { position: 'absolute', left: '0', bottom: '0', width: '100%' }, barContainer: { background: '#0B486B', height: '0.5rem', width: '100%' }, barFill: { background: '#3B8686', height: '0.5rem', width: '0%' }, time: { color: '#FFF', fontFamily: 'OpenSans, sans-serif', padding: '0.5rem 1rem' }, left: { float: 'left' }, right: { float: 'right' }, clear: { clear: 'both' } }; export default class ScrubBar extends React.Component { constructor (params) { super(params); this.state = { position: 0, duration: params.duration } } render () { let progress = this.state.position / (this.state.duration / 100) + '%'; return ( <div style={style.container}> <span style={Object.assign({}, style.time, style.left)}>{timeFormatter(this.state.position)}</span> <span style={Object.assign({}, style.time, style.right)}>{timeFormatter(this.state.duration)}</span> <div style={style.clear} /> <div style={style.barContainer}> <div style={Object.assign({}, style.barFill, {width: progress})} /> </div> </div> ) } }
Add fill to progress bar
Add fill to progress bar
JavaScript
mit
bastuijnman/carpi,bastuijnman/carpi,bastuijnman/carpi
javascript
## Code Before: import React from 'react'; import timeFormatter from './../../utils/timeformatter'; const style = { container: { position: 'absolute', left: '0', bottom: '0', width: '100%' }, barContainer: { background: '#0B486B', height: '1rem', width: '100%' }, time: { color: '#FFF', fontFamily: 'OpenSans, sans-serif', padding: '0.5rem 1rem' }, left: { float: 'left' }, right: { float: 'right' } }; export default class ScrubBar extends React.Component { constructor (params) { super(params); this.state = { position: 0, duration: params.duration } } render () { return ( <div style={style.container}> <span style={Object.assign({}, style.time, style.left)}>{timeFormatter(this.state.position)}</span> <span style={Object.assign({}, style.time, style.right)}>{timeFormatter(this.state.duration)}</span> <div style={{clear: 'both'}} /> <div style={style.barContainer}></div> </div> ) } } ## Instruction: Add fill to progress bar ## Code After: import React from 'react'; import timeFormatter from './../../utils/timeformatter'; const style = { container: { position: 'absolute', left: '0', bottom: '0', width: '100%' }, barContainer: { background: '#0B486B', height: '0.5rem', width: '100%' }, barFill: { background: '#3B8686', height: '0.5rem', width: '0%' }, time: { color: '#FFF', fontFamily: 'OpenSans, sans-serif', padding: '0.5rem 1rem' }, left: { float: 'left' }, right: { float: 'right' }, clear: { clear: 'both' } }; export default class ScrubBar extends React.Component { constructor (params) { super(params); this.state = { position: 0, duration: params.duration } } render () { let progress = this.state.position / (this.state.duration / 100) + '%'; return ( <div style={style.container}> <span style={Object.assign({}, style.time, style.left)}>{timeFormatter(this.state.position)}</span> <span style={Object.assign({}, style.time, style.right)}>{timeFormatter(this.state.duration)}</span> <div style={style.clear} /> <div style={style.barContainer}> <div style={Object.assign({}, style.barFill, {width: progress})} /> </div> </div> ) } }
import React from 'react'; import timeFormatter from './../../utils/timeformatter'; const style = { container: { position: 'absolute', left: '0', bottom: '0', width: '100%' }, barContainer: { background: '#0B486B', - height: '1rem', ? ^ + height: '0.5rem', ? ^^^ width: '100%' + }, + + barFill: { + background: '#3B8686', + height: '0.5rem', + width: '0%' }, time: { color: '#FFF', fontFamily: 'OpenSans, sans-serif', padding: '0.5rem 1rem' }, left: { float: 'left' }, right: { float: 'right' + }, + + clear: { + clear: 'both' } }; export default class ScrubBar extends React.Component { constructor (params) { super(params); this.state = { position: 0, duration: params.duration } } render () { + let progress = this.state.position / (this.state.duration / 100) + '%'; + return ( <div style={style.container}> <span style={Object.assign({}, style.time, style.left)}>{timeFormatter(this.state.position)}</span> <span style={Object.assign({}, style.time, style.right)}>{timeFormatter(this.state.duration)}</span> - <div style={{clear: 'both'}} /> ? ^ --------- + <div style={style.clear} /> ? ^^^^^^ - <div style={style.barContainer}></div> ? ------ + <div style={style.barContainer}> + <div style={Object.assign({}, style.barFill, {width: progress})} /> + </div> </div> ) } }
20
0.333333
17
3
8c19549071782f3a07f1a6f1656817bb36b00dbe
manage.py
manage.py
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "feed_to_kippt.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
import os import sys import re def read_env(): """Pulled from Honcho code with minor updates, reads local default environment variables from a .env file located in the project root directory. """ try: with open('.env') as f: content = f.read() except IOError: content = '' for line in content.splitlines(): m1 = re.match(r'\A([A-Za-z_0-9]+)=(.*)\Z', line) if m1: key, val = m1.group(1), m1.group(2) m2 = re.match(r"\A'(.*)'\Z", val) if m2: val = m2.group(1) m3 = re.match(r'\A"(.*)"\Z', val) if m3: val = re.sub(r'\\(.)', r'\1', m3.group(1)) os.environ.setdefault(key, val) if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "feed_to_kippt.settings") from django.core.management import execute_from_command_line read_env() execute_from_command_line(sys.argv)
Read from local environment file if available
Read from local environment file if available
Python
mit
jpadilla/feedleap,jpadilla/feedleap
python
## Code Before: import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "feed_to_kippt.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv) ## Instruction: Read from local environment file if available ## Code After: import os import sys import re def read_env(): """Pulled from Honcho code with minor updates, reads local default environment variables from a .env file located in the project root directory. """ try: with open('.env') as f: content = f.read() except IOError: content = '' for line in content.splitlines(): m1 = re.match(r'\A([A-Za-z_0-9]+)=(.*)\Z', line) if m1: key, val = m1.group(1), m1.group(2) m2 = re.match(r"\A'(.*)'\Z", val) if m2: val = m2.group(1) m3 = re.match(r'\A"(.*)"\Z', val) if m3: val = re.sub(r'\\(.)', r'\1', m3.group(1)) os.environ.setdefault(key, val) if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "feed_to_kippt.settings") from django.core.management import execute_from_command_line read_env() execute_from_command_line(sys.argv)
import os import sys + import re + + + def read_env(): + """Pulled from Honcho code with minor updates, reads local default + environment variables from a .env file located in the project root + directory. + + """ + try: + with open('.env') as f: + content = f.read() + except IOError: + content = '' + + for line in content.splitlines(): + m1 = re.match(r'\A([A-Za-z_0-9]+)=(.*)\Z', line) + if m1: + key, val = m1.group(1), m1.group(2) + m2 = re.match(r"\A'(.*)'\Z", val) + if m2: + val = m2.group(1) + m3 = re.match(r'\A"(.*)"\Z', val) + if m3: + val = re.sub(r'\\(.)', r'\1', m3.group(1)) + os.environ.setdefault(key, val) if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "feed_to_kippt.settings") from django.core.management import execute_from_command_line + read_env() execute_from_command_line(sys.argv)
27
3
27
0
5f6793480fc6854ad02384157869312e4f8915aa
app/controllers/admin/application_controller.rb
app/controllers/admin/application_controller.rb
module Admin class ApplicationController < Administrate::ApplicationController if Rails.application.secrets.admin_username http_basic_authenticate_with( name: Rails.application.secrets.admin_username, password: Rails.application.secrets.admin_password ) end # Override this value to specify the number of elements to display at a time # on index pages. Defaults to 20. # def records_per_page # params[:per_page] || 20 # end end end
module Admin class ApplicationController < Administrate::ApplicationController if Rails.env.production? http_basic_authenticate_with( name: Rails.application.credentials.admin_username, password: Rails.application.credentials.admin_password ) end # Override this value to specify the number of elements to display at a time # on index pages. Defaults to 20. # def records_per_page # params[:per_page] || 20 # end end end
Use encrypted credentials for authentication of the admin page
Use encrypted credentials for authentication of the admin page
Ruby
mit
kenchan/tdnm,kenchan/tdnm,kenchan/tdnm,kenchan/tdnm
ruby
## Code Before: module Admin class ApplicationController < Administrate::ApplicationController if Rails.application.secrets.admin_username http_basic_authenticate_with( name: Rails.application.secrets.admin_username, password: Rails.application.secrets.admin_password ) end # Override this value to specify the number of elements to display at a time # on index pages. Defaults to 20. # def records_per_page # params[:per_page] || 20 # end end end ## Instruction: Use encrypted credentials for authentication of the admin page ## Code After: module Admin class ApplicationController < Administrate::ApplicationController if Rails.env.production? http_basic_authenticate_with( name: Rails.application.credentials.admin_username, password: Rails.application.credentials.admin_password ) end # Override this value to specify the number of elements to display at a time # on index pages. Defaults to 20. # def records_per_page # params[:per_page] || 20 # end end end
module Admin class ApplicationController < Administrate::ApplicationController - if Rails.application.secrets.admin_username + if Rails.env.production? http_basic_authenticate_with( - name: Rails.application.secrets.admin_username, ? -- + name: Rails.application.credentials.admin_username, ? +++ +++ - password: Rails.application.secrets.admin_password ? -- + password: Rails.application.credentials.admin_password ? +++ +++ ) end # Override this value to specify the number of elements to display at a time # on index pages. Defaults to 20. # def records_per_page # params[:per_page] || 20 # end end end
6
0.375
3
3
404e15219b69ae60f3e3e735636f39c0e3773b5f
cmd/vm-control/findHypervisor.go
cmd/vm-control/findHypervisor.go
package main import ( "fmt" "net" "github.com/Symantec/Dominator/lib/errors" ) func findHypervisor(vmIpAddr net.IP) (string, error) { if *hypervisorHostname != "" { return fmt.Sprintf("%s:%d", *hypervisorHostname, *hypervisorPortNum), nil } else { return "", errors.New("no Hypervisor specified") } }
package main import ( "fmt" "net" "github.com/Symantec/Dominator/lib/errors" "github.com/Symantec/Dominator/lib/srpc" proto "github.com/Symantec/Dominator/proto/fleetmanager" ) func findHypervisor(vmIpAddr net.IP) (string, error) { if *fleetManagerHostname != "" { cm := fmt.Sprintf("%s:%d", *fleetManagerHostname, *fleetManagerPortNum) client, err := srpc.DialHTTP("tcp", cm, 0) if err != nil { return "", err } defer client.Close() request := proto.GetHypervisorForVMRequest{vmIpAddr} var reply proto.GetHypervisorForVMResponse err = client.RequestReply("FleetManager.GetHypervisorForVM", request, &reply) if err != nil { return "", err } if err := errors.New(reply.Error); err != nil { return "", err } return reply.HypervisorAddress, nil } else if *hypervisorHostname != "" { return fmt.Sprintf("%s:%d", *hypervisorHostname, *hypervisorPortNum), nil } else { return fmt.Sprintf("localhost:%d", *hypervisorPortNum), nil } }
Support fleet manager in vm-control command.
Support fleet manager in vm-control command.
Go
apache-2.0
rgooch/Dominator,Symantec/Dominator,rgooch/Dominator,Symantec/Dominator,Symantec/Dominator,rgooch/Dominator
go
## Code Before: package main import ( "fmt" "net" "github.com/Symantec/Dominator/lib/errors" ) func findHypervisor(vmIpAddr net.IP) (string, error) { if *hypervisorHostname != "" { return fmt.Sprintf("%s:%d", *hypervisorHostname, *hypervisorPortNum), nil } else { return "", errors.New("no Hypervisor specified") } } ## Instruction: Support fleet manager in vm-control command. ## Code After: package main import ( "fmt" "net" "github.com/Symantec/Dominator/lib/errors" "github.com/Symantec/Dominator/lib/srpc" proto "github.com/Symantec/Dominator/proto/fleetmanager" ) func findHypervisor(vmIpAddr net.IP) (string, error) { if *fleetManagerHostname != "" { cm := fmt.Sprintf("%s:%d", *fleetManagerHostname, *fleetManagerPortNum) client, err := srpc.DialHTTP("tcp", cm, 0) if err != nil { return "", err } defer client.Close() request := proto.GetHypervisorForVMRequest{vmIpAddr} var reply proto.GetHypervisorForVMResponse err = client.RequestReply("FleetManager.GetHypervisorForVM", request, &reply) if err != nil { return "", err } if err := errors.New(reply.Error); err != nil { return "", err } return reply.HypervisorAddress, nil } else if *hypervisorHostname != "" { return fmt.Sprintf("%s:%d", *hypervisorHostname, *hypervisorPortNum), nil } else { return fmt.Sprintf("localhost:%d", *hypervisorPortNum), nil } }
package main import ( "fmt" "net" "github.com/Symantec/Dominator/lib/errors" + "github.com/Symantec/Dominator/lib/srpc" + proto "github.com/Symantec/Dominator/proto/fleetmanager" ) func findHypervisor(vmIpAddr net.IP) (string, error) { + if *fleetManagerHostname != "" { + cm := fmt.Sprintf("%s:%d", *fleetManagerHostname, + *fleetManagerPortNum) + client, err := srpc.DialHTTP("tcp", cm, 0) + if err != nil { + return "", err + } + defer client.Close() + request := proto.GetHypervisorForVMRequest{vmIpAddr} + var reply proto.GetHypervisorForVMResponse + err = client.RequestReply("FleetManager.GetHypervisorForVM", request, + &reply) + if err != nil { + return "", err + } + if err := errors.New(reply.Error); err != nil { + return "", err + } + return reply.HypervisorAddress, nil - if *hypervisorHostname != "" { + } else if *hypervisorHostname != "" { ? +++++++ return fmt.Sprintf("%s:%d", *hypervisorHostname, *hypervisorPortNum), nil } else { - return "", errors.New("no Hypervisor specified") + return fmt.Sprintf("localhost:%d", *hypervisorPortNum), nil } }
25
1.470588
23
2
eac90ef4d470923bb823f99dc85984faac733f08
pysuru/services.py
pysuru/services.py
import json from collections import namedtuple from pysuru.base import BaseAPI, ObjectMixin SERVICE_INSTANCE_ATTRS = ( 'name', 'description', 'type', 'plan', 'teamOwner', ) _ServiceInstance = namedtuple('ServiceInstance', SERVICE_INSTANCE_ATTRS) class ServiceInstance(_ServiceInstance, ObjectMixin): pass class ServiceInstanceAPI(BaseAPI): def filter_by_app(self, name): http_response = self.request('GET', '/services/instances?app=' + name) response = json.loads(http_response.data.decode('utf-8')) services = [] for service_data in response: for index, instance in enumerate(service_data['instances']): data = { 'name': instance, 'type': service_data['service'], 'plan': service_data['plans'][index], } services.append(ServiceInstance.create(**data)) return services def add(self, data): http_response = self.post_json('/services/instances', data) response = json.loads(http_response.data.decode('utf-8')) if response.status == 409: raise ServiceAlreadyExists() elif response.status == 200: return True else: return False class ServiceAlreadyExists(Exception): pass
import json from collections import namedtuple from pysuru.base import BaseAPI, ObjectMixin SERVICE_INSTANCE_ATTRS = ( 'name', 'description', 'type', 'plan', ) _ServiceInstance = namedtuple('ServiceInstance', SERVICE_INSTANCE_ATTRS) class ServiceInstance(_ServiceInstance, ObjectMixin): pass class ServiceInstanceAPI(BaseAPI): def filter_by_app(self, name): http_response = self.request('GET', '/services/instances?app=' + name) response = json.loads(http_response.data.decode('utf-8')) services = [] for service_data in response: for index, instance in enumerate(service_data['instances']): data = { 'name': instance, 'type': service_data['service'], 'plan': service_data['plans'][index], } services.append(ServiceInstance.create(**data)) return services def add(self, data): http_response = self.post_json('/services/instances', data) response = json.loads(http_response.data.decode('utf-8')) if response.status == 409: raise ServiceAlreadyExists() elif response.status == 200: return True else: return False class ServiceAlreadyExists(Exception): pass
Remove (currently) unused service instance field
Remove (currently) unused service instance field
Python
mit
rcmachado/pysuru
python
## Code Before: import json from collections import namedtuple from pysuru.base import BaseAPI, ObjectMixin SERVICE_INSTANCE_ATTRS = ( 'name', 'description', 'type', 'plan', 'teamOwner', ) _ServiceInstance = namedtuple('ServiceInstance', SERVICE_INSTANCE_ATTRS) class ServiceInstance(_ServiceInstance, ObjectMixin): pass class ServiceInstanceAPI(BaseAPI): def filter_by_app(self, name): http_response = self.request('GET', '/services/instances?app=' + name) response = json.loads(http_response.data.decode('utf-8')) services = [] for service_data in response: for index, instance in enumerate(service_data['instances']): data = { 'name': instance, 'type': service_data['service'], 'plan': service_data['plans'][index], } services.append(ServiceInstance.create(**data)) return services def add(self, data): http_response = self.post_json('/services/instances', data) response = json.loads(http_response.data.decode('utf-8')) if response.status == 409: raise ServiceAlreadyExists() elif response.status == 200: return True else: return False class ServiceAlreadyExists(Exception): pass ## Instruction: Remove (currently) unused service instance field ## Code After: import json from collections import namedtuple from pysuru.base import BaseAPI, ObjectMixin SERVICE_INSTANCE_ATTRS = ( 'name', 'description', 'type', 'plan', ) _ServiceInstance = namedtuple('ServiceInstance', SERVICE_INSTANCE_ATTRS) class ServiceInstance(_ServiceInstance, ObjectMixin): pass class ServiceInstanceAPI(BaseAPI): def filter_by_app(self, name): http_response = self.request('GET', '/services/instances?app=' + name) response = json.loads(http_response.data.decode('utf-8')) services = [] for service_data in response: for index, instance in enumerate(service_data['instances']): data = { 'name': instance, 'type': service_data['service'], 'plan': service_data['plans'][index], } services.append(ServiceInstance.create(**data)) return services def add(self, data): http_response = self.post_json('/services/instances', data) response = json.loads(http_response.data.decode('utf-8')) if response.status == 409: raise ServiceAlreadyExists() elif response.status == 200: return True else: return False class ServiceAlreadyExists(Exception): pass
import json from collections import namedtuple from pysuru.base import BaseAPI, ObjectMixin SERVICE_INSTANCE_ATTRS = ( 'name', 'description', 'type', 'plan', - 'teamOwner', ) _ServiceInstance = namedtuple('ServiceInstance', SERVICE_INSTANCE_ATTRS) class ServiceInstance(_ServiceInstance, ObjectMixin): pass class ServiceInstanceAPI(BaseAPI): def filter_by_app(self, name): http_response = self.request('GET', '/services/instances?app=' + name) response = json.loads(http_response.data.decode('utf-8')) services = [] for service_data in response: for index, instance in enumerate(service_data['instances']): data = { 'name': instance, 'type': service_data['service'], 'plan': service_data['plans'][index], } services.append(ServiceInstance.create(**data)) return services def add(self, data): http_response = self.post_json('/services/instances', data) response = json.loads(http_response.data.decode('utf-8')) if response.status == 409: raise ServiceAlreadyExists() elif response.status == 200: return True else: return False class ServiceAlreadyExists(Exception): pass
1
0.02
0
1
02ac242a16b3b58991cb11f86c97556c88bf3534
src/ZfcTwig/Service/ViewRendererFactory.php
src/ZfcTwig/Service/ViewRendererFactory.php
<?php namespace ZfcTwig\Service; use ZfcTwig\View\Renderer; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; use Zend\View\Resolver\TemplatePathStack; class ViewRendererFactory implements FactoryInterface { public function createService(ServiceLocatorInterface $serviceLocator) { $config = $serviceLocator->get('Configuration'); $config = $config['zfctwig']; $pathResolver = $serviceLocator->get('ViewTemplatePathStack'); $pathResolver->setDefaultSuffix($config['suffix']); $resolver = $serviceLocator->get('ViewResolver'); $renderer = new Renderer(); $renderer->setEngine($serviceLocator->get('TwigEnvironment')); $renderer->setResolver($resolver); return $renderer; } }
<?php namespace ZfcTwig\Service; use ZfcTwig\View\Renderer; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; use Zend\View\Resolver\TemplatePathStack; class ViewRendererFactory implements FactoryInterface { public function createService(ServiceLocatorInterface $serviceLocator) { $config = $serviceLocator->get('Configuration'); $config = $config['zfctwig']; $pathResolver = $serviceLocator->get('ViewTemplatePathStack'); $pathResolver->setDefaultSuffix($config['suffix']); $resolver = $serviceLocator->get('ViewResolver'); $renderer = new Renderer(); $engine = $serviceLocator->get('TwigEnvironment'); $engine->manager()->setRenderer($renderer); $renderer->setEngine($engine); $renderer->setResolver($resolver); return $renderer; } }
Set the Renderer in the View Helper Manager
Set the Renderer in the View Helper Manager This would have been done in the EngineFactory - however - that creates a circular dependency.
PHP
bsd-3-clause
ZF-Commons/ZfcTwig,krhovjak/ZfcTwig,kokspflanze/ZfcTwig,hoppithek/ZfcTwig,kusmierz/ZfcTwig,kusmierz/ZfcTwig
php
## Code Before: <?php namespace ZfcTwig\Service; use ZfcTwig\View\Renderer; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; use Zend\View\Resolver\TemplatePathStack; class ViewRendererFactory implements FactoryInterface { public function createService(ServiceLocatorInterface $serviceLocator) { $config = $serviceLocator->get('Configuration'); $config = $config['zfctwig']; $pathResolver = $serviceLocator->get('ViewTemplatePathStack'); $pathResolver->setDefaultSuffix($config['suffix']); $resolver = $serviceLocator->get('ViewResolver'); $renderer = new Renderer(); $renderer->setEngine($serviceLocator->get('TwigEnvironment')); $renderer->setResolver($resolver); return $renderer; } } ## Instruction: Set the Renderer in the View Helper Manager This would have been done in the EngineFactory - however - that creates a circular dependency. ## Code After: <?php namespace ZfcTwig\Service; use ZfcTwig\View\Renderer; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; use Zend\View\Resolver\TemplatePathStack; class ViewRendererFactory implements FactoryInterface { public function createService(ServiceLocatorInterface $serviceLocator) { $config = $serviceLocator->get('Configuration'); $config = $config['zfctwig']; $pathResolver = $serviceLocator->get('ViewTemplatePathStack'); $pathResolver->setDefaultSuffix($config['suffix']); $resolver = $serviceLocator->get('ViewResolver'); $renderer = new Renderer(); $engine = $serviceLocator->get('TwigEnvironment'); $engine->manager()->setRenderer($renderer); $renderer->setEngine($engine); $renderer->setResolver($resolver); return $renderer; } }
<?php namespace ZfcTwig\Service; use ZfcTwig\View\Renderer; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; use Zend\View\Resolver\TemplatePathStack; class ViewRendererFactory implements FactoryInterface { public function createService(ServiceLocatorInterface $serviceLocator) { $config = $serviceLocator->get('Configuration'); $config = $config['zfctwig']; $pathResolver = $serviceLocator->get('ViewTemplatePathStack'); $pathResolver->setDefaultSuffix($config['suffix']); $resolver = $serviceLocator->get('ViewResolver'); $renderer = new Renderer(); + - $renderer->setEngine($serviceLocator->get('TwigEnvironment')); ? - ------------ ^ - + $engine = $serviceLocator->get('TwigEnvironment'); ? ^^^ + $engine->manager()->setRenderer($renderer); + + $renderer->setEngine($engine); $renderer->setResolver($resolver); return $renderer; } }
6
0.214286
5
1
99e23a83f618e744b1f41d805f1d375955657901
js/hipchat.js
js/hipchat.js
(function() { // Creates an iframe with an embedded HipChat conversation window. // // Options: // url - The url to the room to embed; required // el - The container in which to insert the HipChat panel; required // timezone - The timezone to use in the embedded room; required // width - The width of the iframe; defaults to 100% // height - The height of the iframe; defaults to 400px var parametize = function(params) { var key, toks = []; for (key in params) { toks.push(key + '=' + params[key]); } return toks.join('&'); }; return this.HipChat = function(options) { if (options && options.url && options.el && options.timezone) { var el = document.querySelector(options.el); if (!el) return; var params = { anonymous: false, timezone: options.timezone, minimal: true }; var url = options.url + (options.url.indexOf('?') > 0 ? '&' : '?') + parametize(params); if (url.indexOf('https://') !== 0) { url = 'https://' + url; } var w = options.width || '100%'; var h = options.height || 600; el.innerHTML = '<iframe src="' + url + '" frameborder="' + 0 + '" width="' + w + '" height="' + h + '"></iframe>'; } }; })();
(function() { // Creates an iframe with an embedded HipChat conversation window. // // Options: // url - The url to the room to embed; required // el - The container in which to insert the HipChat panel; required // timezone - The timezone to use in the embedded room; required // width - The width of the iframe; defaults to 100% // height - The height of the iframe; defaults to 400px var parametize = function(params) { var key, toks = []; for (key in params) { toks.push(key + '=' + params[key]); } return toks.join('&'); }; return this.HipChat = function(options) { if (options && options.url && options.el && options.timezone) { var el = document.querySelector(options.el); if (!el) return; var params = { timezone: options.timezone, minimal: true }; var url = options.url + (options.url.indexOf('?') > 0 ? '&' : '?') + parametize(params); if (url.indexOf('https://') !== 0) { url = 'https://' + url; } var w = options.width || '100%'; var h = options.height || 600; el.innerHTML = '<iframe src="' + url + '" frameborder="' + 0 + '" width="' + w + '" height="' + h + '"></iframe>'; } }; })();
Remove anonymous flag to force user to enter name
Remove anonymous flag to force user to enter name
JavaScript
bsd-2-clause
chop-dbhi/harvest-site
javascript
## Code Before: (function() { // Creates an iframe with an embedded HipChat conversation window. // // Options: // url - The url to the room to embed; required // el - The container in which to insert the HipChat panel; required // timezone - The timezone to use in the embedded room; required // width - The width of the iframe; defaults to 100% // height - The height of the iframe; defaults to 400px var parametize = function(params) { var key, toks = []; for (key in params) { toks.push(key + '=' + params[key]); } return toks.join('&'); }; return this.HipChat = function(options) { if (options && options.url && options.el && options.timezone) { var el = document.querySelector(options.el); if (!el) return; var params = { anonymous: false, timezone: options.timezone, minimal: true }; var url = options.url + (options.url.indexOf('?') > 0 ? '&' : '?') + parametize(params); if (url.indexOf('https://') !== 0) { url = 'https://' + url; } var w = options.width || '100%'; var h = options.height || 600; el.innerHTML = '<iframe src="' + url + '" frameborder="' + 0 + '" width="' + w + '" height="' + h + '"></iframe>'; } }; })(); ## Instruction: Remove anonymous flag to force user to enter name ## Code After: (function() { // Creates an iframe with an embedded HipChat conversation window. // // Options: // url - The url to the room to embed; required // el - The container in which to insert the HipChat panel; required // timezone - The timezone to use in the embedded room; required // width - The width of the iframe; defaults to 100% // height - The height of the iframe; defaults to 400px var parametize = function(params) { var key, toks = []; for (key in params) { toks.push(key + '=' + params[key]); } return toks.join('&'); }; return this.HipChat = function(options) { if (options && options.url && options.el && options.timezone) { var el = document.querySelector(options.el); if (!el) return; var params = { timezone: options.timezone, minimal: true }; var url = options.url + (options.url.indexOf('?') > 0 ? '&' : '?') + parametize(params); if (url.indexOf('https://') !== 0) { url = 'https://' + url; } var w = options.width || '100%'; var h = options.height || 600; el.innerHTML = '<iframe src="' + url + '" frameborder="' + 0 + '" width="' + w + '" height="' + h + '"></iframe>'; } }; })();
(function() { // Creates an iframe with an embedded HipChat conversation window. // // Options: // url - The url to the room to embed; required // el - The container in which to insert the HipChat panel; required // timezone - The timezone to use in the embedded room; required // width - The width of the iframe; defaults to 100% // height - The height of the iframe; defaults to 400px var parametize = function(params) { var key, toks = []; for (key in params) { toks.push(key + '=' + params[key]); } return toks.join('&'); }; return this.HipChat = function(options) { if (options && options.url && options.el && options.timezone) { var el = document.querySelector(options.el); if (!el) return; var params = { - anonymous: false, timezone: options.timezone, minimal: true }; var url = options.url + (options.url.indexOf('?') > 0 ? '&' : '?') + parametize(params); if (url.indexOf('https://') !== 0) { url = 'https://' + url; } var w = options.width || '100%'; var h = options.height || 600; el.innerHTML = '<iframe src="' + url + '" frameborder="' + 0 + '" width="' + w + '" height="' + h + '"></iframe>'; } }; })();
1
0.025
0
1
16fd8d6772fb169d1df903db0eb6ff0113fdbacf
src/server/auth-middleware.js
src/server/auth-middleware.js
import _ from "lodash"; import expressJwt from "express-jwt"; export const secret = (req, tokenPayload, cb) => { console.info("req", req); console.info("tokenPayload", tokenPayload); if (_.includes(tokenPayload.aud, process.env.AUTH0_COURTBOT_UI_CLIENT_ID)) { cb(null, process.env.AUTH0_COURTBOT_UI_CLIENT_SECRET); } else { cb(null, process.env.AUTH0_COURTBOT_SIGNING_CERT); } }; const bypassAuthentication = (err, req, res, next) => next(); const jwtAuthentication = expressJwt({secret}); export default process.env.BYPASS_AUTH === 'true' ? bypassAuthentication : jwtAuthentication;
import expressJwt from "express-jwt"; const bypassAuthentication = (err, req, res, next) => next(); const jwtAuthentication = expressJwt({secret: process.env.AUTH0_COURTBOT_UI_CLIENT_SECRET}); export default process.env.BYPASS_AUTH === 'true' ? bypassAuthentication : jwtAuthentication;
Test with just one token...
Test with just one token...
JavaScript
mit
codefortulsa/courtbook,codefortulsa/courtbook
javascript
## Code Before: import _ from "lodash"; import expressJwt from "express-jwt"; export const secret = (req, tokenPayload, cb) => { console.info("req", req); console.info("tokenPayload", tokenPayload); if (_.includes(tokenPayload.aud, process.env.AUTH0_COURTBOT_UI_CLIENT_ID)) { cb(null, process.env.AUTH0_COURTBOT_UI_CLIENT_SECRET); } else { cb(null, process.env.AUTH0_COURTBOT_SIGNING_CERT); } }; const bypassAuthentication = (err, req, res, next) => next(); const jwtAuthentication = expressJwt({secret}); export default process.env.BYPASS_AUTH === 'true' ? bypassAuthentication : jwtAuthentication; ## Instruction: Test with just one token... ## Code After: import expressJwt from "express-jwt"; const bypassAuthentication = (err, req, res, next) => next(); const jwtAuthentication = expressJwt({secret: process.env.AUTH0_COURTBOT_UI_CLIENT_SECRET}); export default process.env.BYPASS_AUTH === 'true' ? bypassAuthentication : jwtAuthentication;
- import _ from "lodash"; import expressJwt from "express-jwt"; - - export const secret = (req, tokenPayload, cb) => { - console.info("req", req); - console.info("tokenPayload", tokenPayload); - if (_.includes(tokenPayload.aud, process.env.AUTH0_COURTBOT_UI_CLIENT_ID)) { - cb(null, process.env.AUTH0_COURTBOT_UI_CLIENT_SECRET); - } else { - cb(null, process.env.AUTH0_COURTBOT_SIGNING_CERT); - } - }; const bypassAuthentication = (err, req, res, next) => next(); - const jwtAuthentication = expressJwt({secret}); + const jwtAuthentication = expressJwt({secret: process.env.AUTH0_COURTBOT_UI_CLIENT_SECRET}); export default process.env.BYPASS_AUTH === 'true' ? bypassAuthentication : jwtAuthentication;
13
0.722222
1
12
7fe1b7f6f13fb703ec7dc4763c6e97c1c8330fd6
docs/android-setup.md
docs/android-setup.md
You will need Android Studio, the Android SDK, and React Native. To install all of these, follow the helpful instructions from React Native upstream on [Getting Started](https://facebook.github.io/react-native/docs/getting-started.html). You want the tab "Building Projects with Native Code"; the "Quick Start" does not apply. If you're new to Android development, expect this step to take some time. If you already have an Android environment set up, pay close attention anyway; you may have to add some configuration. ## Running on Android simulator `Virtual Android device` can be created by using Android Studio 1. Navigate to `Tools/Android/AVD Manager`. 2. Click on `Create Virtual Device...` and choose the device to be used for testing 3. Click on `Next`. 4. Choose the Api level or image to be tested on and click `Next`. 5. Click on `Finished`. Now a `Virtual Android device` has been created. You no longer need Android Studio after this setup step; you can start the emulator [from the command line](https://developer.android.com/studio/run/emulator-commandline.html). Then to run, the command `react-native run-android` will launch a new terminal with the React Native packager and open up the app in the active Virtual Device. ## Running on Android device USB debugging must be active on the Android Device. Make sure to uninstall Zulip from Play Store. Then to run, connect your Android device to PC, and `react-native run-android` will build the application and install the app on your android device.
You will need Android Studio, the Android SDK, and React Native. To install all of these, follow the helpful instructions from React Native upstream on [Getting Started](https://facebook.github.io/react-native/docs/getting-started.html). You want the tab "Building Projects with Native Code"; the "Quick Start" does not apply. If you're new to Android development, expect this step to take some time. If you already have an Android environment set up, pay close attention anyway; you may have to add some configuration. ## Setting up the Android emulator In React Native's [Getting Started](https://facebook.github.io/react-native/docs/getting-started.html) instructions, within the tab "Building Projects with Native Code", follow the instructions under the heading "Using a virtual device". You no longer need Android Studio after this setup step; you can start the emulator [from the command line](https://developer.android.com/studio/run/emulator-commandline.html). Then to build and run the app: `react-native run-android` ## Setting up a physical Android device Follow the React Native instructions titled [Running On Device](https://facebook.github.io/react-native/docs/running-on-device.html). Then to build and run the app: again, `react-native run-android` . You may need to uninstall Zulip first, if the device has it installed from the Play Store.
Use RN upstream's instructions for Android device and AVD setup.
docs: Use RN upstream's instructions for Android device and AVD setup. These are better than ours, and there's no need to duplicate the work. I'm not sure what the issue is that requires uninstalling the Play Store version first; preserving that advice unchanged for now.
Markdown
apache-2.0
vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile
markdown
## Code Before: You will need Android Studio, the Android SDK, and React Native. To install all of these, follow the helpful instructions from React Native upstream on [Getting Started](https://facebook.github.io/react-native/docs/getting-started.html). You want the tab "Building Projects with Native Code"; the "Quick Start" does not apply. If you're new to Android development, expect this step to take some time. If you already have an Android environment set up, pay close attention anyway; you may have to add some configuration. ## Running on Android simulator `Virtual Android device` can be created by using Android Studio 1. Navigate to `Tools/Android/AVD Manager`. 2. Click on `Create Virtual Device...` and choose the device to be used for testing 3. Click on `Next`. 4. Choose the Api level or image to be tested on and click `Next`. 5. Click on `Finished`. Now a `Virtual Android device` has been created. You no longer need Android Studio after this setup step; you can start the emulator [from the command line](https://developer.android.com/studio/run/emulator-commandline.html). Then to run, the command `react-native run-android` will launch a new terminal with the React Native packager and open up the app in the active Virtual Device. ## Running on Android device USB debugging must be active on the Android Device. Make sure to uninstall Zulip from Play Store. Then to run, connect your Android device to PC, and `react-native run-android` will build the application and install the app on your android device. ## Instruction: docs: Use RN upstream's instructions for Android device and AVD setup. These are better than ours, and there's no need to duplicate the work. I'm not sure what the issue is that requires uninstalling the Play Store version first; preserving that advice unchanged for now. ## Code After: You will need Android Studio, the Android SDK, and React Native. To install all of these, follow the helpful instructions from React Native upstream on [Getting Started](https://facebook.github.io/react-native/docs/getting-started.html). You want the tab "Building Projects with Native Code"; the "Quick Start" does not apply. If you're new to Android development, expect this step to take some time. If you already have an Android environment set up, pay close attention anyway; you may have to add some configuration. ## Setting up the Android emulator In React Native's [Getting Started](https://facebook.github.io/react-native/docs/getting-started.html) instructions, within the tab "Building Projects with Native Code", follow the instructions under the heading "Using a virtual device". You no longer need Android Studio after this setup step; you can start the emulator [from the command line](https://developer.android.com/studio/run/emulator-commandline.html). Then to build and run the app: `react-native run-android` ## Setting up a physical Android device Follow the React Native instructions titled [Running On Device](https://facebook.github.io/react-native/docs/running-on-device.html). Then to build and run the app: again, `react-native run-android` . You may need to uninstall Zulip first, if the device has it installed from the Play Store.
You will need Android Studio, the Android SDK, and React Native. To install all of these, follow the helpful instructions from React Native upstream on [Getting Started](https://facebook.github.io/react-native/docs/getting-started.html). You want the tab "Building Projects with Native Code"; the "Quick Start" does not apply. If you're new to Android development, expect this step to take some time. If you already have an Android environment set up, pay close attention anyway; you may have to add some configuration. + ## Setting up the Android emulator - ## Running on Android simulator - `Virtual Android device` can be created by using Android Studio - 1. Navigate to `Tools/Android/AVD Manager`. - 2. Click on `Create Virtual Device...` and choose the device to be used for testing - 3. Click on `Next`. - 4. Choose the Api level or image to be tested on and click `Next`. - 5. Click on `Finished`. - Now a `Virtual Android device` has been created. + In React Native's + [Getting Started](https://facebook.github.io/react-native/docs/getting-started.html) + instructions, within the tab "Building Projects with Native Code", + follow the instructions under the heading "Using a virtual device". You no longer need Android Studio after this setup step; you can start the emulator [from the command line](https://developer.android.com/studio/run/emulator-commandline.html). + Then to build and run the app: `react-native run-android` - Then to run, the command `react-native run-android` will launch a new - terminal with the React Native packager and open up the app in the - active Virtual Device. + ## Setting up a physical Android device - ## Running on Android device - USB debugging must be active on the Android Device. - Make sure to uninstall Zulip from Play Store. - Then to run, connect your Android device to PC, and - `react-native run-android` will build the application and install - the app on your android device. + Follow the React Native instructions titled + [Running On Device](https://facebook.github.io/react-native/docs/running-on-device.html). + + Then to build and run the app: again, `react-native run-android` . + + You may need to uninstall Zulip first, if the device has it installed + from the Play Store.
31
0.815789
14
17
096e3cbdec300579ad6f46f056e1dc5427617a35
pkgs/build-support/docker/store-path-to-layer.sh
pkgs/build-support/docker/store-path-to-layer.sh
set -eu layerNumber=$1 shift layerPath="./layers/$layerNumber" echo "Creating layer #$layerNumber for $@" mkdir -p "$layerPath" tar -rpf "$layerPath/layer.tar" --hard-dereference --sort=name \ --mtime="@$SOURCE_DATE_EPOCH" \ --owner=0 --group=0 "$@" # Compute a checksum of the tarball. tarhash=$(tarsum < $layerPath/layer.tar) # Add a 'checksum' field to the JSON, with the value set to the # checksum of the tarball. cat ./generic.json | jshon -s "$tarhash" -i checksum > $layerPath/json # Indicate to docker that we're using schema version 1.0. echo -n "1.0" > $layerPath/VERSION
set -eu layerNumber=$1 shift layerPath="./layers/$layerNumber" echo "Creating layer #$layerNumber for $@" mkdir -p "$layerPath" tar --no-recursion -rf "$layerPath/layer.tar" /nix /nix/store tar -rpf "$layerPath/layer.tar" --hard-dereference --sort=name \ --mtime="@$SOURCE_DATE_EPOCH" \ --owner=0 --group=0 "$@" # Compute a checksum of the tarball. tarhash=$(tarsum < $layerPath/layer.tar) # Add a 'checksum' field to the JSON, with the value set to the # checksum of the tarball. cat ./generic.json | jshon -s "$tarhash" -i checksum > $layerPath/json # Indicate to docker that we're using schema version 1.0. echo -n "1.0" > $layerPath/VERSION
Add /nix/store to each layer.tar
Add /nix/store to each layer.tar To be totally consistent with the way Docker builds images we need to include the /nix/store in the layer tarballs first.
Shell
mit
NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs
shell
## Code Before: set -eu layerNumber=$1 shift layerPath="./layers/$layerNumber" echo "Creating layer #$layerNumber for $@" mkdir -p "$layerPath" tar -rpf "$layerPath/layer.tar" --hard-dereference --sort=name \ --mtime="@$SOURCE_DATE_EPOCH" \ --owner=0 --group=0 "$@" # Compute a checksum of the tarball. tarhash=$(tarsum < $layerPath/layer.tar) # Add a 'checksum' field to the JSON, with the value set to the # checksum of the tarball. cat ./generic.json | jshon -s "$tarhash" -i checksum > $layerPath/json # Indicate to docker that we're using schema version 1.0. echo -n "1.0" > $layerPath/VERSION ## Instruction: Add /nix/store to each layer.tar To be totally consistent with the way Docker builds images we need to include the /nix/store in the layer tarballs first. ## Code After: set -eu layerNumber=$1 shift layerPath="./layers/$layerNumber" echo "Creating layer #$layerNumber for $@" mkdir -p "$layerPath" tar --no-recursion -rf "$layerPath/layer.tar" /nix /nix/store tar -rpf "$layerPath/layer.tar" --hard-dereference --sort=name \ --mtime="@$SOURCE_DATE_EPOCH" \ --owner=0 --group=0 "$@" # Compute a checksum of the tarball. tarhash=$(tarsum < $layerPath/layer.tar) # Add a 'checksum' field to the JSON, with the value set to the # checksum of the tarball. cat ./generic.json | jshon -s "$tarhash" -i checksum > $layerPath/json # Indicate to docker that we're using schema version 1.0. echo -n "1.0" > $layerPath/VERSION
set -eu layerNumber=$1 shift layerPath="./layers/$layerNumber" echo "Creating layer #$layerNumber for $@" mkdir -p "$layerPath" + tar --no-recursion -rf "$layerPath/layer.tar" /nix /nix/store tar -rpf "$layerPath/layer.tar" --hard-dereference --sort=name \ --mtime="@$SOURCE_DATE_EPOCH" \ --owner=0 --group=0 "$@" # Compute a checksum of the tarball. tarhash=$(tarsum < $layerPath/layer.tar) # Add a 'checksum' field to the JSON, with the value set to the # checksum of the tarball. cat ./generic.json | jshon -s "$tarhash" -i checksum > $layerPath/json # Indicate to docker that we're using schema version 1.0. echo -n "1.0" > $layerPath/VERSION
1
0.043478
1
0
f497259869ba0f920d8a7eaac45bd320566c4808
examples/Interactivity/circlepainter.py
examples/Interactivity/circlepainter.py
size(800, 800) import time colormode(RGB) speed(60) def setup(): # ovallist is the list of ovals we created by moving the mouse. global ovallist stroke(0) strokewidth(1) ovallist = [] class Blob: def __init__(self, x, y, c, r): self.x, self.y = x, y self.color = c self.radius = r def draw(self): fill(self.color) stroke(0) strokewidth(1) oval(self.x-self.radius, self.y-self.radius, self.radius*2, self.radius*2) def draw(): global ovallist x = MOUSEX y = MOUSEY if 0: if x > WIDTH or y > HEIGHT: return b = mousedown if b: d = random() r = random(10, 20) c = color(0,d,0,0.4) ovallist.append( Blob(x,y,c,r) ) for blob in ovallist: blob.draw()
size(800, 800) import time colormode(RGB) speed(60) def setup(): # ovallist is the list of ovals we created by moving the mouse. global ovallist stroke(0) strokewidth(1) ovallist = [] class Blob: def __init__(self, x, y, c, r): self.x, self.y = x, y self.color = c self.radius = r def draw(self): fill(self.color) stroke(0) strokewidth(1) circle(self.x, self.y, self.radius) # oval(self.x-self.radius, self.y-self.radius, self.radius*2, self.radius*2) def draw(): global ovallist x = MOUSEX y = MOUSEY if 0: if x > WIDTH or y > HEIGHT: return b = mousedown if b: d = random() r = random(10, 20) c = color(0,d,0,0.4) ovallist.append( Blob(x,y,c,r) ) for blob in ovallist: blob.draw()
Use of circle() instead of oval()
Use of circle() instead of oval()
Python
mit
karstenw/nodebox-pyobjc,karstenw/nodebox-pyobjc
python
## Code Before: size(800, 800) import time colormode(RGB) speed(60) def setup(): # ovallist is the list of ovals we created by moving the mouse. global ovallist stroke(0) strokewidth(1) ovallist = [] class Blob: def __init__(self, x, y, c, r): self.x, self.y = x, y self.color = c self.radius = r def draw(self): fill(self.color) stroke(0) strokewidth(1) oval(self.x-self.radius, self.y-self.radius, self.radius*2, self.radius*2) def draw(): global ovallist x = MOUSEX y = MOUSEY if 0: if x > WIDTH or y > HEIGHT: return b = mousedown if b: d = random() r = random(10, 20) c = color(0,d,0,0.4) ovallist.append( Blob(x,y,c,r) ) for blob in ovallist: blob.draw() ## Instruction: Use of circle() instead of oval() ## Code After: size(800, 800) import time colormode(RGB) speed(60) def setup(): # ovallist is the list of ovals we created by moving the mouse. global ovallist stroke(0) strokewidth(1) ovallist = [] class Blob: def __init__(self, x, y, c, r): self.x, self.y = x, y self.color = c self.radius = r def draw(self): fill(self.color) stroke(0) strokewidth(1) circle(self.x, self.y, self.radius) # oval(self.x-self.radius, self.y-self.radius, self.radius*2, self.radius*2) def draw(): global ovallist x = MOUSEX y = MOUSEY if 0: if x > WIDTH or y > HEIGHT: return b = mousedown if b: d = random() r = random(10, 20) c = color(0,d,0,0.4) ovallist.append( Blob(x,y,c,r) ) for blob in ovallist: blob.draw()
size(800, 800) import time colormode(RGB) speed(60) def setup(): # ovallist is the list of ovals we created by moving the mouse. global ovallist stroke(0) strokewidth(1) ovallist = [] class Blob: def __init__(self, x, y, c, r): self.x, self.y = x, y self.color = c self.radius = r def draw(self): fill(self.color) stroke(0) strokewidth(1) + circle(self.x, self.y, self.radius) - oval(self.x-self.radius, self.y-self.radius, self.radius*2, self.radius*2) + # oval(self.x-self.radius, self.y-self.radius, self.radius*2, self.radius*2) ? ++ def draw(): global ovallist x = MOUSEX y = MOUSEY if 0: if x > WIDTH or y > HEIGHT: return b = mousedown if b: d = random() r = random(10, 20) c = color(0,d,0,0.4) ovallist.append( Blob(x,y,c,r) ) for blob in ovallist: blob.draw()
3
0.065217
2
1
a3c49666a99a732f76c10e0ef859412daaa8d0c4
README.rst
README.rst
================ feincms-in-a-box ================ Quickly bootstrap projects using Django_, FeinCMS_, and Foundation_. Instructions and other documentation is hosted on read the docs: Documentation_ .. _Django: https://www.djangoproject.com/ .. _FeinCMS: https://feincms.org/ .. _Foundation: https://foundation.zurb.com/ .. _Documentation: https://feincms-in-a-box.readthedocs.org/
================ feincms-in-a-box ================ .. image:: https://travis-ci.org/feinheit/feincms-in-a-box.svg?branch=master :target: https://travis-ci.org/feinheit/feincms-in-a-box Quickly bootstrap projects using Django_, FeinCMS_, and Foundation_. Instructions and other documentation is hosted on read the docs: Documentation_ .. _Django: https://www.djangoproject.com/ .. _FeinCMS: https://feincms.org/ .. _Foundation: https://foundation.zurb.com/ .. _Documentation: https://feincms-in-a-box.readthedocs.org/
Add a Travis CI badge
Add a Travis CI badge
reStructuredText
bsd-3-clause
lucacorsato/feincms-in-a-box,lucacorsato/feincms-in-a-box,lucacorsato/feincms-in-a-box,lucacorsato/feincms-in-a-box
restructuredtext
## Code Before: ================ feincms-in-a-box ================ Quickly bootstrap projects using Django_, FeinCMS_, and Foundation_. Instructions and other documentation is hosted on read the docs: Documentation_ .. _Django: https://www.djangoproject.com/ .. _FeinCMS: https://feincms.org/ .. _Foundation: https://foundation.zurb.com/ .. _Documentation: https://feincms-in-a-box.readthedocs.org/ ## Instruction: Add a Travis CI badge ## Code After: ================ feincms-in-a-box ================ .. image:: https://travis-ci.org/feinheit/feincms-in-a-box.svg?branch=master :target: https://travis-ci.org/feinheit/feincms-in-a-box Quickly bootstrap projects using Django_, FeinCMS_, and Foundation_. Instructions and other documentation is hosted on read the docs: Documentation_ .. _Django: https://www.djangoproject.com/ .. _FeinCMS: https://feincms.org/ .. _Foundation: https://foundation.zurb.com/ .. _Documentation: https://feincms-in-a-box.readthedocs.org/
================ feincms-in-a-box ================ + + .. image:: https://travis-ci.org/feinheit/feincms-in-a-box.svg?branch=master + :target: https://travis-ci.org/feinheit/feincms-in-a-box Quickly bootstrap projects using Django_, FeinCMS_, and Foundation_. Instructions and other documentation is hosted on read the docs: Documentation_ .. _Django: https://www.djangoproject.com/ .. _FeinCMS: https://feincms.org/ .. _Foundation: https://foundation.zurb.com/ .. _Documentation: https://feincms-in-a-box.readthedocs.org/
3
0.230769
3
0
29cd66c28e2c0bed61631ee78a227eeda901ee84
_layouts/home.html
_layouts/home.html
--- layout: default --- {% assign leftSidebarCards = "author, links" | split: ', ' %} {% include sidebar.html cards=leftSidebarCards %} <div class="col-lg-6"> <div class="home"> <div class="card mb-4"> <div class="card-block"> <h1 class="card-title">Home</h1> <div class="card-text"> {{ content }} </div> </div> </div> {% for post in site.posts %} <div class="card mb-4"> {% if post.image %} <img class="card-img-top" src="{{ post.image }}" alt="{{ post.title | escape }}"> {% endif %} <div class="card-block"> <h4 class="card-title"><a href="{{ post.url | relative_url }}">{{ post.title | escape }}</a></h4> <div class="card-text">{{ post.description | markdownify }}</div> </div> <div class="card-footer"> <p class="card-text post-meta text-muted"> <small> <time datetime="{{ post.date | date_to_xmlschema }}" itemprop="datePublished">Posted on {{ post.date | date: "%b %-d, %Y" }}</time> {% if post.categories %} • Filed under <span itemprop="keywords"> {% for cat in post.categories %} {% assign category = site.categories | where: 'title', cat | first %} <a href="{{ category.url | relative_url }}">{{ category.title }}</a>{% unless forloop.last == true %}, {% endunless %} {% endfor %} </span> {% endif %} </small> </p> </div> </div> {% endfor %} </div> </div> {% assign rightSidebarCards = "posts, projects" | split: ', ' %} {% include sidebar.html cards=rightSidebarCards %}
--- layout: default --- {% assign leftSidebarCards = "author, links" | split: ', ' %} {% include sidebar.html cards=leftSidebarCards %} <div class="col-lg-6"> <div class="home"> <div class="card mb-4"> <div class="card-block"> <h1 class="card-title">Welcome</h1> <div class="card-text"> {{ content }} </div> </div> </div> </div> </div> {% assign rightSidebarCards = "posts, projects" | split: ', ' %} {% include sidebar.html cards=rightSidebarCards %}
Remove recent posts from Home page
Remove recent posts from Home page Blog page already handles this
HTML
mit
dajocarter/dajekyll,dajocarter/dajekyll,dajocarter/dajekyll
html
## Code Before: --- layout: default --- {% assign leftSidebarCards = "author, links" | split: ', ' %} {% include sidebar.html cards=leftSidebarCards %} <div class="col-lg-6"> <div class="home"> <div class="card mb-4"> <div class="card-block"> <h1 class="card-title">Home</h1> <div class="card-text"> {{ content }} </div> </div> </div> {% for post in site.posts %} <div class="card mb-4"> {% if post.image %} <img class="card-img-top" src="{{ post.image }}" alt="{{ post.title | escape }}"> {% endif %} <div class="card-block"> <h4 class="card-title"><a href="{{ post.url | relative_url }}">{{ post.title | escape }}</a></h4> <div class="card-text">{{ post.description | markdownify }}</div> </div> <div class="card-footer"> <p class="card-text post-meta text-muted"> <small> <time datetime="{{ post.date | date_to_xmlschema }}" itemprop="datePublished">Posted on {{ post.date | date: "%b %-d, %Y" }}</time> {% if post.categories %} • Filed under <span itemprop="keywords"> {% for cat in post.categories %} {% assign category = site.categories | where: 'title', cat | first %} <a href="{{ category.url | relative_url }}">{{ category.title }}</a>{% unless forloop.last == true %}, {% endunless %} {% endfor %} </span> {% endif %} </small> </p> </div> </div> {% endfor %} </div> </div> {% assign rightSidebarCards = "posts, projects" | split: ', ' %} {% include sidebar.html cards=rightSidebarCards %} ## Instruction: Remove recent posts from Home page Blog page already handles this ## Code After: --- layout: default --- {% assign leftSidebarCards = "author, links" | split: ', ' %} {% include sidebar.html cards=leftSidebarCards %} <div class="col-lg-6"> <div class="home"> <div class="card mb-4"> <div class="card-block"> <h1 class="card-title">Welcome</h1> <div class="card-text"> {{ content }} </div> </div> </div> </div> </div> {% assign rightSidebarCards = "posts, projects" | split: ', ' %} {% include sidebar.html cards=rightSidebarCards %}
--- layout: default --- {% assign leftSidebarCards = "author, links" | split: ', ' %} {% include sidebar.html cards=leftSidebarCards %} <div class="col-lg-6"> <div class="home"> <div class="card mb-4"> <div class="card-block"> - <h1 class="card-title">Home</h1> ? ^ + <h1 class="card-title">Welcome</h1> ? ^^^^ <div class="card-text"> {{ content }} </div> </div> </div> - {% for post in site.posts %} - <div class="card mb-4"> - {% if post.image %} - <img class="card-img-top" src="{{ post.image }}" alt="{{ post.title | escape }}"> - {% endif %} - <div class="card-block"> - <h4 class="card-title"><a href="{{ post.url | relative_url }}">{{ post.title | escape }}</a></h4> - <div class="card-text">{{ post.description | markdownify }}</div> - </div> - <div class="card-footer"> - <p class="card-text post-meta text-muted"> - <small> - <time datetime="{{ post.date | date_to_xmlschema }}" itemprop="datePublished">Posted on {{ post.date | date: "%b %-d, %Y" }}</time> - {% if post.categories %} - • Filed under <span itemprop="keywords"> - {% for cat in post.categories %} - {% assign category = site.categories | where: 'title', cat | first %} - <a href="{{ category.url | relative_url }}">{{ category.title }}</a>{% unless forloop.last == true %}, {% endunless %} - {% endfor %} - </span> - {% endif %} - </small> - </p> - </div> - </div> - {% endfor %} </div> </div> {% assign rightSidebarCards = "posts, projects" | split: ', ' %} {% include sidebar.html cards=rightSidebarCards %}
28
0.54902
1
27
cfd78346a75cd41e633407879ac20d7044c79be7
__tests__/animation.spec.js
__tests__/animation.spec.js
var AnimationModule = require('../src/js/visuals/animation/index'); var PromiseAnimation = AnimationModule.PromiseAnimation; var Animation = AnimationModule.Animation; var Q = require('q'); describe('Promise animation', function() { it('Will execute the closure', function() { var value = 0; var closure = function() { value++; }; var animation = new PromiseAnimation({ deferred: Q.defer(), closure: closure }); animation.play(); expect(value).toBe(1); }); it('also takes animation packs', function() { var value = 0; var animation = new PromiseAnimation({ animation: function() { value++; } }); animation.play(); expect(value).toBe(1); }); it('Will resolve a deferred', function() { var value = 0; var closure = function() { value++; }; var animation = new PromiseAnimation({ closure: closure }); animation .then(function() { value++; }) .then(function() { if (value !== 2) { console.log('second promise failed!!'); } else { console.log('1 more test passed'); } // TODO -- make this work (aka the tests keep running until // this assertion finishes expect(value).toBe(2); }); animation.play(); expect(value).toBe(1); }); it('will make one from a normal animation', function() { // poor mans spy function var value = 0; var anim = new Animation({ closure: function() { value++; } }); var animPromise = PromiseAnimation.fromAnimation(anim); animPromise .then(function() { value++; }).then(function() { // TODO fix expect(value).toBe(2); if (value !== 2) { console.log('a test failed!!'); } else { console.log('another test passed'); } }); animPromise.play(); expect(value).toBe(1); }); });
var AnimationModule = require('../src/js/visuals/animation/index'); var PromiseAnimation = AnimationModule.PromiseAnimation; var Animation = AnimationModule.Animation; var Q = require('q'); describe('Promise animation', function() { it('Will execute the closure', function() { var value = 0; var closure = function() { value++; }; var animation = new PromiseAnimation({ deferred: Q.defer(), closure: closure }); animation.play(); expect(value).toBe(1); }); it('also takes animation packs', function() { var value = 0; var animation = new PromiseAnimation({ animation: function() { value++; } }); animation.play(); expect(value).toBe(1); }); });
Remove animation tests to fix build
Remove animation tests to fix build
JavaScript
mit
pcottle/learnGitBranching,pcottle/learnGitBranching,pcottle/learnGitBranching
javascript
## Code Before: var AnimationModule = require('../src/js/visuals/animation/index'); var PromiseAnimation = AnimationModule.PromiseAnimation; var Animation = AnimationModule.Animation; var Q = require('q'); describe('Promise animation', function() { it('Will execute the closure', function() { var value = 0; var closure = function() { value++; }; var animation = new PromiseAnimation({ deferred: Q.defer(), closure: closure }); animation.play(); expect(value).toBe(1); }); it('also takes animation packs', function() { var value = 0; var animation = new PromiseAnimation({ animation: function() { value++; } }); animation.play(); expect(value).toBe(1); }); it('Will resolve a deferred', function() { var value = 0; var closure = function() { value++; }; var animation = new PromiseAnimation({ closure: closure }); animation .then(function() { value++; }) .then(function() { if (value !== 2) { console.log('second promise failed!!'); } else { console.log('1 more test passed'); } // TODO -- make this work (aka the tests keep running until // this assertion finishes expect(value).toBe(2); }); animation.play(); expect(value).toBe(1); }); it('will make one from a normal animation', function() { // poor mans spy function var value = 0; var anim = new Animation({ closure: function() { value++; } }); var animPromise = PromiseAnimation.fromAnimation(anim); animPromise .then(function() { value++; }).then(function() { // TODO fix expect(value).toBe(2); if (value !== 2) { console.log('a test failed!!'); } else { console.log('another test passed'); } }); animPromise.play(); expect(value).toBe(1); }); }); ## Instruction: Remove animation tests to fix build ## Code After: var AnimationModule = require('../src/js/visuals/animation/index'); var PromiseAnimation = AnimationModule.PromiseAnimation; var Animation = AnimationModule.Animation; var Q = require('q'); describe('Promise animation', function() { it('Will execute the closure', function() { var value = 0; var closure = function() { value++; }; var animation = new PromiseAnimation({ deferred: Q.defer(), closure: closure }); animation.play(); expect(value).toBe(1); }); it('also takes animation packs', function() { var value = 0; var animation = new PromiseAnimation({ animation: function() { value++; } }); animation.play(); expect(value).toBe(1); }); });
var AnimationModule = require('../src/js/visuals/animation/index'); var PromiseAnimation = AnimationModule.PromiseAnimation; var Animation = AnimationModule.Animation; var Q = require('q'); describe('Promise animation', function() { it('Will execute the closure', function() { var value = 0; var closure = function() { value++; }; var animation = new PromiseAnimation({ deferred: Q.defer(), closure: closure }); animation.play(); expect(value).toBe(1); }); it('also takes animation packs', function() { var value = 0; var animation = new PromiseAnimation({ animation: function() { value++; } }); animation.play(); expect(value).toBe(1); }); - - it('Will resolve a deferred', function() { - var value = 0; - var closure = function() { - value++; - }; - - var animation = new PromiseAnimation({ - closure: closure - }); - animation - .then(function() { - value++; - }) - .then(function() { - if (value !== 2) { - console.log('second promise failed!!'); - } else { - console.log('1 more test passed'); - } - // TODO -- make this work (aka the tests keep running until - // this assertion finishes - expect(value).toBe(2); - }); - - animation.play(); - expect(value).toBe(1); - }); - - it('will make one from a normal animation', function() { - // poor mans spy function - var value = 0; - var anim = new Animation({ - closure: function() { value++; } - }); - - var animPromise = PromiseAnimation.fromAnimation(anim); - animPromise - .then(function() { - value++; - }).then(function() { - // TODO fix - expect(value).toBe(2); - if (value !== 2) { - console.log('a test failed!!'); - } else { - console.log('another test passed'); - } - }); - - animPromise.play(); - expect(value).toBe(1); - }); });
53
0.646341
0
53
7f5ddaedecfdfbd86b7dcac15602b39c446d14b1
CTestConfig.cmake
CTestConfig.cmake
set(CTEST_PROJECT_NAME "dsnutil") set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") if(NOT DEFINED CTEST_DROP_METHOD) set(CTEST_DROP_METHOD "http") endif(NOT DEFINED CTEST_DROP_METHOD) if(CTEST_DROP_METHOD STREQUAL "http") set(CTEST_DROP_SITE "harpy.png.das-system.vpn") set(CTEST_DROP_LOCATION "/cdash/submit.php?project=dsnutil") set(CTEST_TRIGGER_SITE "http://${CTEST_DROP_SITE}/") endif(CTEST_DROP_METHOD STREQUAL "http")
set(CTEST_PROJECT_NAME "dsnutil") set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") if(NOT DEFINED CTEST_DROP_METHOD) set(CTEST_DROP_METHOD "http") endif(NOT DEFINED CTEST_DROP_METHOD) if(CTEST_DROP_METHOD STREQUAL "http") set(CTEST_DROP_SITE "cdash.das-system-networks.de") set(CTEST_DROP_LOCATION "/submit.php?project=dsnutil") set(CTEST_TRIGGER_SITE "http://${CTEST_DROP_SITE}/") endif(CTEST_DROP_METHOD STREQUAL "http")
Update CTest configuration for cdash.das-system-networks.de
Update CTest configuration for cdash.das-system-networks.de Signed-off-by: Peter Hille (png!das-system) <4b8373d016f277527198385ba72fda0feb5da015@das-system-networks.de>
CMake
bsd-3-clause
png85/dsnutil,png85/dsnutil
cmake
## Code Before: set(CTEST_PROJECT_NAME "dsnutil") set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") if(NOT DEFINED CTEST_DROP_METHOD) set(CTEST_DROP_METHOD "http") endif(NOT DEFINED CTEST_DROP_METHOD) if(CTEST_DROP_METHOD STREQUAL "http") set(CTEST_DROP_SITE "harpy.png.das-system.vpn") set(CTEST_DROP_LOCATION "/cdash/submit.php?project=dsnutil") set(CTEST_TRIGGER_SITE "http://${CTEST_DROP_SITE}/") endif(CTEST_DROP_METHOD STREQUAL "http") ## Instruction: Update CTest configuration for cdash.das-system-networks.de Signed-off-by: Peter Hille (png!das-system) <4b8373d016f277527198385ba72fda0feb5da015@das-system-networks.de> ## Code After: set(CTEST_PROJECT_NAME "dsnutil") set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") if(NOT DEFINED CTEST_DROP_METHOD) set(CTEST_DROP_METHOD "http") endif(NOT DEFINED CTEST_DROP_METHOD) if(CTEST_DROP_METHOD STREQUAL "http") set(CTEST_DROP_SITE "cdash.das-system-networks.de") set(CTEST_DROP_LOCATION "/submit.php?project=dsnutil") set(CTEST_TRIGGER_SITE "http://${CTEST_DROP_SITE}/") endif(CTEST_DROP_METHOD STREQUAL "http")
set(CTEST_PROJECT_NAME "dsnutil") set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") if(NOT DEFINED CTEST_DROP_METHOD) set(CTEST_DROP_METHOD "http") endif(NOT DEFINED CTEST_DROP_METHOD) if(CTEST_DROP_METHOD STREQUAL "http") - set(CTEST_DROP_SITE "harpy.png.das-system.vpn") + set(CTEST_DROP_SITE "cdash.das-system-networks.de") - set(CTEST_DROP_LOCATION "/cdash/submit.php?project=dsnutil") ? ------ + set(CTEST_DROP_LOCATION "/submit.php?project=dsnutil") set(CTEST_TRIGGER_SITE "http://${CTEST_DROP_SITE}/") endif(CTEST_DROP_METHOD STREQUAL "http")
4
0.333333
2
2
5015bc3f36506d2caa27ba158e698bf8c2429228
src/CustomError.js
src/CustomError.js
import _ from 'lodash'; import type from 'type-of'; class CustomError extends Error { constructor(err, name = 'Error') { super(); if (_.isString(err)) { this.message = err; } else if (err instanceof Error) { this.message = err.message; this.stack = err.stack; } else { throw new Error(`Invalid err argument; expected string or error, received ${type(err)}`); } this.name = name; this.time = new Date(); } } export default CustomError;
import _ from 'lodash'; import type from 'type-of'; class CustomError extends Error { constructor(err, name = 'Error') { super(); if (_.isString(err)) { this.message = err; } else if (err instanceof Error) { this.message = err.message; this.stack = err.stack; } else { throw new Error(`Invalid err argument; expected string or error, received ${type(err)}`); } if (_.isString(name)) { this.name = name; } else { throw new Error(`Invalid name argument; expected string, received ${type(err)}`); } this.time = new Date(); } } export default CustomError;
Make sure name param is valid
Make sure name param is valid
JavaScript
mit
jmike/customerror
javascript
## Code Before: import _ from 'lodash'; import type from 'type-of'; class CustomError extends Error { constructor(err, name = 'Error') { super(); if (_.isString(err)) { this.message = err; } else if (err instanceof Error) { this.message = err.message; this.stack = err.stack; } else { throw new Error(`Invalid err argument; expected string or error, received ${type(err)}`); } this.name = name; this.time = new Date(); } } export default CustomError; ## Instruction: Make sure name param is valid ## Code After: import _ from 'lodash'; import type from 'type-of'; class CustomError extends Error { constructor(err, name = 'Error') { super(); if (_.isString(err)) { this.message = err; } else if (err instanceof Error) { this.message = err.message; this.stack = err.stack; } else { throw new Error(`Invalid err argument; expected string or error, received ${type(err)}`); } if (_.isString(name)) { this.name = name; } else { throw new Error(`Invalid name argument; expected string, received ${type(err)}`); } this.time = new Date(); } } export default CustomError;
import _ from 'lodash'; import type from 'type-of'; class CustomError extends Error { constructor(err, name = 'Error') { super(); if (_.isString(err)) { this.message = err; } else if (err instanceof Error) { this.message = err.message; this.stack = err.stack; } else { throw new Error(`Invalid err argument; expected string or error, received ${type(err)}`); } + if (_.isString(name)) { - this.name = name; + this.name = name; ? ++ + } else { + throw new Error(`Invalid name argument; expected string, received ${type(err)}`); + } + this.time = new Date(); } } export default CustomError;
7
0.291667
6
1
0a637b06dbc2d9b75539feac108b5b9d7dc07dae
spec/actor_spec.rb
spec/actor_spec.rb
require 'spec_helper' FakeActor = Struct.new(:thing, :block) do include LolConcurrency::Actor def call(n) block.call(n) end def call_with_block(n, &blk) blk.call(n) end end describe LolConcurrency::Actor do let(:object) { 'LolConcurrency' } describe 'instance' do subject { FakeActor.new(object, nil) } it { should respond_to(:thing) } it { should respond_to(:async) } end describe 'async' do let(:actor) { FakeActor.new(object, nil) } subject { actor.async } it { should respond_to(:thing) } it { should respond_to(:call) } it { should respond_to(:call_with_block) } it 'should return nil when you call methods on the async' do subject.thing.should be_nil end it 'should call methods passing arguments' do test = 1 actor.block = ->(n) { test = n } subject.call(5) sleep(0.1) test.should == 5 end it 'should pass blocks' do test = 1 subject.call_with_block(2) do |n| test = n end sleep(0.1) test.should == 2 end end end
require 'spec_helper' FakeActor = Struct.new(:thing, :block) do include LolConcurrency::Actor def call(n) block.call(n) end def call_with_block(n, &blk) blk.call(n) end end describe LolConcurrency::Actor do let(:object) { 'LolConcurrency' } describe 'instance' do subject { FakeActor.new(object, nil) } it { should respond_to(:thing) } it { should respond_to(:async) } end describe 'async' do let(:actor) { FakeActor.new(object, nil) } subject { actor.async } it { should respond_to(:thing) } it { should respond_to(:call) } it { should respond_to(:call_with_block) } it { should_not respond_to(:instance) } it { should_not respond_to(:mailbox) } it 'should return nil when you call methods on the async' do subject.thing.should be_nil end it 'should call methods passing arguments' do test = 1 actor.block = ->(n) { test = n } subject.call(5) sleep(0.1) test.should == 5 end it 'should pass blocks' do test = 1 subject.call_with_block(2) do |n| test = n end sleep(0.1) test.should == 2 end end end
Make sure those methods are actually private
Make sure those methods are actually private
Ruby
mit
darkhelmet/lol_concurrency
ruby
## Code Before: require 'spec_helper' FakeActor = Struct.new(:thing, :block) do include LolConcurrency::Actor def call(n) block.call(n) end def call_with_block(n, &blk) blk.call(n) end end describe LolConcurrency::Actor do let(:object) { 'LolConcurrency' } describe 'instance' do subject { FakeActor.new(object, nil) } it { should respond_to(:thing) } it { should respond_to(:async) } end describe 'async' do let(:actor) { FakeActor.new(object, nil) } subject { actor.async } it { should respond_to(:thing) } it { should respond_to(:call) } it { should respond_to(:call_with_block) } it 'should return nil when you call methods on the async' do subject.thing.should be_nil end it 'should call methods passing arguments' do test = 1 actor.block = ->(n) { test = n } subject.call(5) sleep(0.1) test.should == 5 end it 'should pass blocks' do test = 1 subject.call_with_block(2) do |n| test = n end sleep(0.1) test.should == 2 end end end ## Instruction: Make sure those methods are actually private ## Code After: require 'spec_helper' FakeActor = Struct.new(:thing, :block) do include LolConcurrency::Actor def call(n) block.call(n) end def call_with_block(n, &blk) blk.call(n) end end describe LolConcurrency::Actor do let(:object) { 'LolConcurrency' } describe 'instance' do subject { FakeActor.new(object, nil) } it { should respond_to(:thing) } it { should respond_to(:async) } end describe 'async' do let(:actor) { FakeActor.new(object, nil) } subject { actor.async } it { should respond_to(:thing) } it { should respond_to(:call) } it { should respond_to(:call_with_block) } it { should_not respond_to(:instance) } it { should_not respond_to(:mailbox) } it 'should return nil when you call methods on the async' do subject.thing.should be_nil end it 'should call methods passing arguments' do test = 1 actor.block = ->(n) { test = n } subject.call(5) sleep(0.1) test.should == 5 end it 'should pass blocks' do test = 1 subject.call_with_block(2) do |n| test = n end sleep(0.1) test.should == 2 end end end
require 'spec_helper' FakeActor = Struct.new(:thing, :block) do include LolConcurrency::Actor def call(n) block.call(n) end def call_with_block(n, &blk) blk.call(n) end end describe LolConcurrency::Actor do let(:object) { 'LolConcurrency' } describe 'instance' do subject { FakeActor.new(object, nil) } it { should respond_to(:thing) } it { should respond_to(:async) } end describe 'async' do let(:actor) { FakeActor.new(object, nil) } subject { actor.async } it { should respond_to(:thing) } it { should respond_to(:call) } it { should respond_to(:call_with_block) } + it { should_not respond_to(:instance) } + it { should_not respond_to(:mailbox) } it 'should return nil when you call methods on the async' do subject.thing.should be_nil end it 'should call methods passing arguments' do test = 1 actor.block = ->(n) { test = n } subject.call(5) sleep(0.1) test.should == 5 end it 'should pass blocks' do test = 1 subject.call_with_block(2) do |n| test = n end sleep(0.1) test.should == 2 end end end
2
0.037037
2
0
78e3e1cdc770c187168212ca845078aa9d9c62bd
Cargo.toml
Cargo.toml
[package] name = "langid" version = "0.0.1" authors = ["Aleksei Voronov <despawn@gmail.com>"] license = "MIT/Apache-2.0" [dependencies] rustc-serialize = "0.3.18" itertools = "0.4.11" getopts = "0.2.14" [dev-dependencies] glob = "0.2.11"
[package] name = "langid" version = "0.0.1" description = "NGram-based language identification" authors = ["Aleksei Voronov <despawn@gmail.com>"] repository = "https://github.com/despawnerer/langid-rs" keywords = ["langid", "language", "classification", "text"] license = "MIT/Apache-2.0" [dependencies] rustc-serialize = "0.3.18" itertools = "0.4.11" getopts = "0.2.14" [dev-dependencies] glob = "0.2.11"
Add repository, keywords and description to crate info
Add repository, keywords and description to crate info
TOML
apache-2.0
despawnerer/langid-rs
toml
## Code Before: [package] name = "langid" version = "0.0.1" authors = ["Aleksei Voronov <despawn@gmail.com>"] license = "MIT/Apache-2.0" [dependencies] rustc-serialize = "0.3.18" itertools = "0.4.11" getopts = "0.2.14" [dev-dependencies] glob = "0.2.11" ## Instruction: Add repository, keywords and description to crate info ## Code After: [package] name = "langid" version = "0.0.1" description = "NGram-based language identification" authors = ["Aleksei Voronov <despawn@gmail.com>"] repository = "https://github.com/despawnerer/langid-rs" keywords = ["langid", "language", "classification", "text"] license = "MIT/Apache-2.0" [dependencies] rustc-serialize = "0.3.18" itertools = "0.4.11" getopts = "0.2.14" [dev-dependencies] glob = "0.2.11"
[package] name = "langid" version = "0.0.1" + description = "NGram-based language identification" authors = ["Aleksei Voronov <despawn@gmail.com>"] + repository = "https://github.com/despawnerer/langid-rs" + keywords = ["langid", "language", "classification", "text"] license = "MIT/Apache-2.0" [dependencies] rustc-serialize = "0.3.18" itertools = "0.4.11" getopts = "0.2.14" [dev-dependencies] glob = "0.2.11"
3
0.230769
3
0
72ab36671522ceddcbfc3ab753d25d905815603a
tests/docx/style-map.tests.js
tests/docx/style-map.tests.js
var assert = require("assert"); var JSZip = require("jszip"); var zipfile = require("../../lib/zipfile"); var styleMap = require("../../lib/docx/style-map"); var test = require("../testing").test; describe("zipfile", function() { test('embedded style map can be read after being written', function() { var zip = emptyZipFile(); styleMap.writeStyleMap(zip, "p => h1"); return styleMap.readStyleMap(zip).then(function(contents) { assert.equal(contents, "p => h1"); }); }); }); function emptyZipFile() { var zip = new JSZip(); var buffer = zip.generate({type: "arraybuffer"}); return zipfile.openArrayBuffer(buffer); }
var assert = require("assert"); var JSZip = require("jszip"); var zipfile = require("../../lib/zipfile"); var styleMap = require("../../lib/docx/style-map"); var test = require("../testing").test; describe("zipfile", function() { test('embedded style map can be read after being written', function() { var zip = emptyZipFile(); styleMap.writeStyleMap(zip, "p => h1"); return styleMap.readStyleMap(zip).then(function(contents) { assert.equal(contents, "p => h1"); }); }); test('embedded style map is written to separate file', function() { var zip = emptyZipFile(); styleMap.writeStyleMap(zip, "p => h1"); return zip.read("mammoth/style-map", "utf8").then(function(contents) { assert.equal(contents, "p => h1"); }); }); }); function emptyZipFile() { var zip = new JSZip(); var buffer = zip.generate({type: "arraybuffer"}); return zipfile.openArrayBuffer(buffer); }
Test that embedded style map is written to separate file
Test that embedded style map is written to separate file
JavaScript
bsd-2-clause
mwilliamson/mammoth.js,mwilliamson/mammoth.js
javascript
## Code Before: var assert = require("assert"); var JSZip = require("jszip"); var zipfile = require("../../lib/zipfile"); var styleMap = require("../../lib/docx/style-map"); var test = require("../testing").test; describe("zipfile", function() { test('embedded style map can be read after being written', function() { var zip = emptyZipFile(); styleMap.writeStyleMap(zip, "p => h1"); return styleMap.readStyleMap(zip).then(function(contents) { assert.equal(contents, "p => h1"); }); }); }); function emptyZipFile() { var zip = new JSZip(); var buffer = zip.generate({type: "arraybuffer"}); return zipfile.openArrayBuffer(buffer); } ## Instruction: Test that embedded style map is written to separate file ## Code After: var assert = require("assert"); var JSZip = require("jszip"); var zipfile = require("../../lib/zipfile"); var styleMap = require("../../lib/docx/style-map"); var test = require("../testing").test; describe("zipfile", function() { test('embedded style map can be read after being written', function() { var zip = emptyZipFile(); styleMap.writeStyleMap(zip, "p => h1"); return styleMap.readStyleMap(zip).then(function(contents) { assert.equal(contents, "p => h1"); }); }); test('embedded style map is written to separate file', function() { var zip = emptyZipFile(); styleMap.writeStyleMap(zip, "p => h1"); return zip.read("mammoth/style-map", "utf8").then(function(contents) { assert.equal(contents, "p => h1"); }); }); }); function emptyZipFile() { var zip = new JSZip(); var buffer = zip.generate({type: "arraybuffer"}); return zipfile.openArrayBuffer(buffer); }
var assert = require("assert"); var JSZip = require("jszip"); var zipfile = require("../../lib/zipfile"); var styleMap = require("../../lib/docx/style-map"); var test = require("../testing").test; describe("zipfile", function() { test('embedded style map can be read after being written', function() { var zip = emptyZipFile(); styleMap.writeStyleMap(zip, "p => h1"); return styleMap.readStyleMap(zip).then(function(contents) { assert.equal(contents, "p => h1"); }); }); + + test('embedded style map is written to separate file', function() { + var zip = emptyZipFile(); + + styleMap.writeStyleMap(zip, "p => h1"); + + return zip.read("mammoth/style-map", "utf8").then(function(contents) { + assert.equal(contents, "p => h1"); + }); + }); }); function emptyZipFile() { var zip = new JSZip(); var buffer = zip.generate({type: "arraybuffer"}); return zipfile.openArrayBuffer(buffer); }
10
0.384615
10
0
8af5483e48f889b0c890661cc5380b070aeb95b8
lib/whatsnew/project.rb
lib/whatsnew/project.rb
require "pathname" module Whatsnew class Project def initialize(path) @path = path @name = Dir.glob(File.join(path, "*")).find do |file| file =~ %r[(CHANGE|CHANGES|CHANGELOG|NEWS|HISTORY)] end end def news_file NewsFile.new(@name, project_uri) end # git@github.com:jollygoodcode/whatsnew.git # => https://github.com:jollygoodcode/whatsnew def project_uri if matched = matched_from_git_repository "https://#{matched[:host]}/#{matched[:owner]}/#{matched[:repo]}" else "NOT FOUND" end end private def matched_from_git_repository Dir.chdir(Pathname(@path).to_path) do `git config --get remote.origin.url`.match( %r{git@(?<host>.*):(?<owner>jollygoodcode)/(?<repo>whatsnew).git} ) end end end end
require "pathname" module Whatsnew class Project def initialize(path) @path = path @name = Dir.glob(File.join(path, "*")).find do |file| file =~ %r[(CHANGE|CHANGES|CHANGELOG|NEWS|HISTORY)] end end def news_file NewsFile.new(@name, project_uri) end # git@github.com:jollygoodcode/whatsnew.git # => https://github.com:jollygoodcode/whatsnew def project_uri if matched = matched_from_git_repository "https://#{matched[:host]}/#{matched[:owner]}/#{matched[:repo]}" else "NOT FOUND" end end private def matched_from_git_repository Dir.chdir(Pathname(@path).to_path) do `git config --get remote.origin.url`.match( %r{git.+(?<host>(github.com|bitbucket.com|bitbucket.org))[:/](?<owner>\S+)/(?<repo>\S+)\.git} ) end end end end
Fix hardcoded RegExp when matching git repository
Fix hardcoded RegExp when matching git repository
Ruby
mit
jollygoodcode/whatsnew
ruby
## Code Before: require "pathname" module Whatsnew class Project def initialize(path) @path = path @name = Dir.glob(File.join(path, "*")).find do |file| file =~ %r[(CHANGE|CHANGES|CHANGELOG|NEWS|HISTORY)] end end def news_file NewsFile.new(@name, project_uri) end # git@github.com:jollygoodcode/whatsnew.git # => https://github.com:jollygoodcode/whatsnew def project_uri if matched = matched_from_git_repository "https://#{matched[:host]}/#{matched[:owner]}/#{matched[:repo]}" else "NOT FOUND" end end private def matched_from_git_repository Dir.chdir(Pathname(@path).to_path) do `git config --get remote.origin.url`.match( %r{git@(?<host>.*):(?<owner>jollygoodcode)/(?<repo>whatsnew).git} ) end end end end ## Instruction: Fix hardcoded RegExp when matching git repository ## Code After: require "pathname" module Whatsnew class Project def initialize(path) @path = path @name = Dir.glob(File.join(path, "*")).find do |file| file =~ %r[(CHANGE|CHANGES|CHANGELOG|NEWS|HISTORY)] end end def news_file NewsFile.new(@name, project_uri) end # git@github.com:jollygoodcode/whatsnew.git # => https://github.com:jollygoodcode/whatsnew def project_uri if matched = matched_from_git_repository "https://#{matched[:host]}/#{matched[:owner]}/#{matched[:repo]}" else "NOT FOUND" end end private def matched_from_git_repository Dir.chdir(Pathname(@path).to_path) do `git config --get remote.origin.url`.match( %r{git.+(?<host>(github.com|bitbucket.com|bitbucket.org))[:/](?<owner>\S+)/(?<repo>\S+)\.git} ) end end end end
require "pathname" module Whatsnew class Project def initialize(path) @path = path @name = Dir.glob(File.join(path, "*")).find do |file| file =~ %r[(CHANGE|CHANGES|CHANGELOG|NEWS|HISTORY)] end end def news_file NewsFile.new(@name, project_uri) end # git@github.com:jollygoodcode/whatsnew.git # => https://github.com:jollygoodcode/whatsnew def project_uri if matched = matched_from_git_repository "https://#{matched[:host]}/#{matched[:owner]}/#{matched[:repo]}" else "NOT FOUND" end end private def matched_from_git_repository Dir.chdir(Pathname(@path).to_path) do `git config --get remote.origin.url`.match( - %r{git@(?<host>.*):(?<owner>jollygoodcode)/(?<repo>whatsnew).git} + %r{git.+(?<host>(github.com|bitbucket.com|bitbucket.org))[:/](?<owner>\S+)/(?<repo>\S+)\.git} ) end end end end
2
0.055556
1
1
49e5a88be13667d5aa05457c4f5247ef2629f246
Problem010/C++/solution_1.cpp
Problem010/C++/solution_1.cpp
/** * C++ algorithm to get the sum of all prime numbers between a range of 2 and the number desired. */ #include <iostream> #include <cstdlib> bool is_prime(unsigned int number); int main(int argc, char* argv[]) { const char *num = "2000000"; if(argv[1]) num = argv[1]; else if (argv[1] == "--help") std::cerr << "Usage: primes <number_of_primes>" << std::endl; std::cerr << "You've choosen the sum of the first " << num << " prime numbers." << std::endl; // iteration variables. int i = 1; int j = 0; // the number to reach. int number_to = atoi(num); int sum = 0; while(j < number_to) { if(is_prime(i)) { std::cerr << i << std::endl; sum += i; j++; } i++; } std::cerr << "The sum of the numbers between 2 and " << number_to << " are: " << sum << std::endl; std::cout << sum << std::endl; } bool is_prime(unsigned int number) { if (number <= 1) return false; unsigned int i; for (i=2; i*i<=number; i++) { if (number % i == 0) { return false; } } return true; }
/** * C++ algorithm to get the sum of all prime numbers between a range of 2 and the number desired. */ #include <iostream> #include <cstdlib> #include <string.h> bool is_prime(unsigned int number); int main(int argc, char* argv[]) { const char *num = "2000000"; if (strcmp(argv[1],"--help") == 0){ std::cerr << "Usage: primes <number_of_primes>" << std::endl; exit(0); } else if(argv[1]) { num = argv[1]; } // iteration variables. int i = 1; int j = 0; // the number to reach. int number_to = atoi(num); int sum = 0; while(j < number_to) { if(is_prime(i)) { sum += i; j++; } i++; } std::cout << sum << std::endl; } bool is_prime(unsigned int number) { if (number <= 1) return false; unsigned int i; for (i=2; i*i<=number; i++) { if (number % i == 0) { return false; } } return true; }
Fix after @rafaelcn did blame me crying about incorrect usage of cerr
Fix after @rafaelcn did blame me crying about incorrect usage of cerr
C++
mit
DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler
c++
## Code Before: /** * C++ algorithm to get the sum of all prime numbers between a range of 2 and the number desired. */ #include <iostream> #include <cstdlib> bool is_prime(unsigned int number); int main(int argc, char* argv[]) { const char *num = "2000000"; if(argv[1]) num = argv[1]; else if (argv[1] == "--help") std::cerr << "Usage: primes <number_of_primes>" << std::endl; std::cerr << "You've choosen the sum of the first " << num << " prime numbers." << std::endl; // iteration variables. int i = 1; int j = 0; // the number to reach. int number_to = atoi(num); int sum = 0; while(j < number_to) { if(is_prime(i)) { std::cerr << i << std::endl; sum += i; j++; } i++; } std::cerr << "The sum of the numbers between 2 and " << number_to << " are: " << sum << std::endl; std::cout << sum << std::endl; } bool is_prime(unsigned int number) { if (number <= 1) return false; unsigned int i; for (i=2; i*i<=number; i++) { if (number % i == 0) { return false; } } return true; } ## Instruction: Fix after @rafaelcn did blame me crying about incorrect usage of cerr ## Code After: /** * C++ algorithm to get the sum of all prime numbers between a range of 2 and the number desired. */ #include <iostream> #include <cstdlib> #include <string.h> bool is_prime(unsigned int number); int main(int argc, char* argv[]) { const char *num = "2000000"; if (strcmp(argv[1],"--help") == 0){ std::cerr << "Usage: primes <number_of_primes>" << std::endl; exit(0); } else if(argv[1]) { num = argv[1]; } // iteration variables. int i = 1; int j = 0; // the number to reach. int number_to = atoi(num); int sum = 0; while(j < number_to) { if(is_prime(i)) { sum += i; j++; } i++; } std::cout << sum << std::endl; } bool is_prime(unsigned int number) { if (number <= 1) return false; unsigned int i; for (i=2; i*i<=number; i++) { if (number % i == 0) { return false; } } return true; }
/** * C++ algorithm to get the sum of all prime numbers between a range of 2 and the number desired. */ #include <iostream> #include <cstdlib> + #include <string.h> bool is_prime(unsigned int number); int main(int argc, char* argv[]) { const char *num = "2000000"; + if (strcmp(argv[1],"--help") == 0){ + std::cerr << "Usage: primes <number_of_primes>" << std::endl; + exit(0); + } - if(argv[1]) + else if(argv[1]) { ? +++++ ++ num = argv[1]; + } - else if (argv[1] == "--help") - std::cerr << "Usage: primes <number_of_primes>" << std::endl; - - - - std::cerr << "You've choosen the sum of the first " << num - << " prime numbers." << std::endl; // iteration variables. int i = 1; int j = 0; // the number to reach. int number_to = atoi(num); int sum = 0; while(j < number_to) { if(is_prime(i)) - { + { ? + - std::cerr << i << std::endl; sum += i; j++; } i++; } - std::cerr << "The sum of the numbers between 2 and " << number_to - << " are: " << sum << std::endl; std::cout << sum << std::endl; } bool is_prime(unsigned int number) { if (number <= 1) return false; unsigned int i; for (i=2; i*i<=number; i++) { if (number % i == 0) { return false; } } return true; }
20
0.322581
8
12
2f6b434fc96b1f48315e103f4a77fecc2da89471
.gitlab/linters/check-changelogs.sh
.gitlab/linters/check-changelogs.sh
set -e COLOR_RED="\e[31m" COLOR_GREEN="\e[32m" COLOR_NONE="\e[0m" grep TBA libraries/*/changelog.md && ( echo -e "${COLOR_RED}Error: Found \"TBA\"s in changelogs.${COLOR_NONE}" exit 1 ) echo -e "${COLOR_GREEN}changelogs look okay.${COLOR_NONE}"
set -e COLOR_RED="\e[31m" COLOR_GREEN="\e[32m" COLOR_NONE="\e[0m" grep TBA libraries/*/changelog.md && ( echo -e "${COLOR_RED}Error: Found \"TBA\"s in changelogs.${COLOR_NONE}" exit 1 ) || ( echo -e "${COLOR_GREEN}changelogs look okay.${COLOR_NONE}" exit 0 )
Move changelog linting logic to shell script
gitlab-ci: Move changelog linting logic to shell script Allowing it to be easily used locally.
Shell
bsd-3-clause
sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc
shell
## Code Before: set -e COLOR_RED="\e[31m" COLOR_GREEN="\e[32m" COLOR_NONE="\e[0m" grep TBA libraries/*/changelog.md && ( echo -e "${COLOR_RED}Error: Found \"TBA\"s in changelogs.${COLOR_NONE}" exit 1 ) echo -e "${COLOR_GREEN}changelogs look okay.${COLOR_NONE}" ## Instruction: gitlab-ci: Move changelog linting logic to shell script Allowing it to be easily used locally. ## Code After: set -e COLOR_RED="\e[31m" COLOR_GREEN="\e[32m" COLOR_NONE="\e[0m" grep TBA libraries/*/changelog.md && ( echo -e "${COLOR_RED}Error: Found \"TBA\"s in changelogs.${COLOR_NONE}" exit 1 ) || ( echo -e "${COLOR_GREEN}changelogs look okay.${COLOR_NONE}" exit 0 )
set -e COLOR_RED="\e[31m" COLOR_GREEN="\e[32m" COLOR_NONE="\e[0m" grep TBA libraries/*/changelog.md && ( echo -e "${COLOR_RED}Error: Found \"TBA\"s in changelogs.${COLOR_NONE}" exit 1 + ) || ( + echo -e "${COLOR_GREEN}changelogs look okay.${COLOR_NONE}" + exit 0 ) - echo -e "${COLOR_GREEN}changelogs look okay.${COLOR_NONE}"
4
0.307692
3
1
166723c4b42a4ffb11f51bc0dd3702d33e474402
src/HoneypotServiceProvider.php
src/HoneypotServiceProvider.php
<?php namespace Codenexus\Honeypot; use Illuminate\Support\Facades\Validator; use Illuminate\Support\ServiceProvider; class HoneypotServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred. * * @var bool */ protected $defer = false; public function boot() { $this->loadTranslationsFrom(__DIR__ . '/../lang', 'honeypot'); Validator::extend('honeypot', 'honeypot@validateHoneypot', trans('validation.honeypot')); Validator::extend('honeytime', 'honeypot@validateHoneytime', trans('validation.honeytime')); } public function register() { $this->app->singleton('honeypot', function () { return new Honeypot; }); } public function provides() { return array('honeypot'); } }
<?php namespace Codenexus\Honeypot; use Illuminate\Support\Facades\Validator; use Illuminate\Support\ServiceProvider; class HoneypotServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred. * * @var bool */ protected $defer = false; public function boot() { $this->loadTranslationsFrom(__DIR__ . '/../lang', 'honeypot'); Validator::extend('honeypot', 'honeypot@validateHoneypot', trans('honeypot::validation.honeypot')); Validator::extend('honeytime', 'honeypot@validateHoneytime', trans('honeypot::validation.honeytime')); } public function register() { $this->app->singleton('honeypot', function () { return new Honeypot; }); } public function provides() { return array('honeypot'); } }
Fix localization for validation error messages.
Fix localization for validation error messages.
PHP
mit
codenexus/laravel-honeypot
php
## Code Before: <?php namespace Codenexus\Honeypot; use Illuminate\Support\Facades\Validator; use Illuminate\Support\ServiceProvider; class HoneypotServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred. * * @var bool */ protected $defer = false; public function boot() { $this->loadTranslationsFrom(__DIR__ . '/../lang', 'honeypot'); Validator::extend('honeypot', 'honeypot@validateHoneypot', trans('validation.honeypot')); Validator::extend('honeytime', 'honeypot@validateHoneytime', trans('validation.honeytime')); } public function register() { $this->app->singleton('honeypot', function () { return new Honeypot; }); } public function provides() { return array('honeypot'); } } ## Instruction: Fix localization for validation error messages. ## Code After: <?php namespace Codenexus\Honeypot; use Illuminate\Support\Facades\Validator; use Illuminate\Support\ServiceProvider; class HoneypotServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred. * * @var bool */ protected $defer = false; public function boot() { $this->loadTranslationsFrom(__DIR__ . '/../lang', 'honeypot'); Validator::extend('honeypot', 'honeypot@validateHoneypot', trans('honeypot::validation.honeypot')); Validator::extend('honeytime', 'honeypot@validateHoneytime', trans('honeypot::validation.honeytime')); } public function register() { $this->app->singleton('honeypot', function () { return new Honeypot; }); } public function provides() { return array('honeypot'); } }
<?php namespace Codenexus\Honeypot; use Illuminate\Support\Facades\Validator; use Illuminate\Support\ServiceProvider; class HoneypotServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred. * * @var bool */ protected $defer = false; public function boot() { $this->loadTranslationsFrom(__DIR__ . '/../lang', 'honeypot'); - Validator::extend('honeypot', 'honeypot@validateHoneypot', trans('validation.honeypot')); + Validator::extend('honeypot', 'honeypot@validateHoneypot', trans('honeypot::validation.honeypot')); ? ++++++++++ - Validator::extend('honeytime', 'honeypot@validateHoneytime', trans('validation.honeytime')); + Validator::extend('honeytime', 'honeypot@validateHoneytime', trans('honeypot::validation.honeytime')); ? ++++++++++ } public function register() { $this->app->singleton('honeypot', function () { return new Honeypot; }); } public function provides() { return array('honeypot'); } }
4
0.111111
2
2
1a68ccd8c9d3ce9d79708f776192f93e525d40c5
Tests/DataCollector/Util/ValueExporterTest.php
Tests/DataCollector/Util/ValueExporterTest.php
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpKernel\Tests\DataCollector\Util; use Symfony\Component\HttpKernel\DataCollector\Util\ValueExporter; class ValueExporterTest extends \PHPUnit_Framework_TestCase { /** * @var ValueExporter */ private $valueExporter; protected function setUp() { $this->valueExporter = new ValueExporter(); } public function testDateTime() { $dateTime = new \DateTime('2014-06-10 07:35:40', new \DateTimeZone('UTC')); $this->assertSame('Object(DateTime) - 2014-06-10T07:35:40+0000', $this->valueExporter->exportValue($dateTime)); } public function testDateTimeImmutable() { if (!class_exists('DateTimeImmutable', false)) { $this->markTestSkipped('Test skipped, class DateTimeImmutable does not exist.'); } $dateTime = new \DateTimeImmutable('2014-06-10 07:35:40', new \DateTimeZone('UTC')); $this->assertSame('Object(DateTimeImmutable) - 2014-06-10T07:35:40+0000', $this->valueExporter->exportValue($dateTime)); } }
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpKernel\Tests\DataCollector\Util; use Symfony\Component\HttpKernel\DataCollector\Util\ValueExporter; class ValueExporterTest extends \PHPUnit_Framework_TestCase { /** * @var ValueExporter */ private $valueExporter; protected function setUp() { $this->valueExporter = new ValueExporter(); } public function testDateTime() { $dateTime = new \DateTime('2014-06-10 07:35:40', new \DateTimeZone('UTC')); $this->assertSame('Object(DateTime) - 2014-06-10T07:35:40+0000', $this->valueExporter->exportValue($dateTime)); } /** * @requires PHP 5.5 */ public function testDateTimeImmutable() { $dateTime = new \DateTimeImmutable('2014-06-10 07:35:40', new \DateTimeZone('UTC')); $this->assertSame('Object(DateTimeImmutable) - 2014-06-10T07:35:40+0000', $this->valueExporter->exportValue($dateTime)); } }
Use @requires annotation when possible
[tests] Use @requires annotation when possible
PHP
mit
symfony/http-kernel,symfony/HttpKernel
php
## Code Before: <?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpKernel\Tests\DataCollector\Util; use Symfony\Component\HttpKernel\DataCollector\Util\ValueExporter; class ValueExporterTest extends \PHPUnit_Framework_TestCase { /** * @var ValueExporter */ private $valueExporter; protected function setUp() { $this->valueExporter = new ValueExporter(); } public function testDateTime() { $dateTime = new \DateTime('2014-06-10 07:35:40', new \DateTimeZone('UTC')); $this->assertSame('Object(DateTime) - 2014-06-10T07:35:40+0000', $this->valueExporter->exportValue($dateTime)); } public function testDateTimeImmutable() { if (!class_exists('DateTimeImmutable', false)) { $this->markTestSkipped('Test skipped, class DateTimeImmutable does not exist.'); } $dateTime = new \DateTimeImmutable('2014-06-10 07:35:40', new \DateTimeZone('UTC')); $this->assertSame('Object(DateTimeImmutable) - 2014-06-10T07:35:40+0000', $this->valueExporter->exportValue($dateTime)); } } ## Instruction: [tests] Use @requires annotation when possible ## Code After: <?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpKernel\Tests\DataCollector\Util; use Symfony\Component\HttpKernel\DataCollector\Util\ValueExporter; class ValueExporterTest extends \PHPUnit_Framework_TestCase { /** * @var ValueExporter */ private $valueExporter; protected function setUp() { $this->valueExporter = new ValueExporter(); } public function testDateTime() { $dateTime = new \DateTime('2014-06-10 07:35:40', new \DateTimeZone('UTC')); $this->assertSame('Object(DateTime) - 2014-06-10T07:35:40+0000', $this->valueExporter->exportValue($dateTime)); } /** * @requires PHP 5.5 */ public function testDateTimeImmutable() { $dateTime = new \DateTimeImmutable('2014-06-10 07:35:40', new \DateTimeZone('UTC')); $this->assertSame('Object(DateTimeImmutable) - 2014-06-10T07:35:40+0000', $this->valueExporter->exportValue($dateTime)); } }
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpKernel\Tests\DataCollector\Util; use Symfony\Component\HttpKernel\DataCollector\Util\ValueExporter; class ValueExporterTest extends \PHPUnit_Framework_TestCase { /** * @var ValueExporter */ private $valueExporter; protected function setUp() { $this->valueExporter = new ValueExporter(); } public function testDateTime() { $dateTime = new \DateTime('2014-06-10 07:35:40', new \DateTimeZone('UTC')); $this->assertSame('Object(DateTime) - 2014-06-10T07:35:40+0000', $this->valueExporter->exportValue($dateTime)); } + /** + * @requires PHP 5.5 + */ public function testDateTimeImmutable() { - if (!class_exists('DateTimeImmutable', false)) { - $this->markTestSkipped('Test skipped, class DateTimeImmutable does not exist.'); - } - $dateTime = new \DateTimeImmutable('2014-06-10 07:35:40', new \DateTimeZone('UTC')); $this->assertSame('Object(DateTimeImmutable) - 2014-06-10T07:35:40+0000', $this->valueExporter->exportValue($dateTime)); } }
7
0.162791
3
4
4b765f32e63599995bef123d47fd9ddd39bdb235
pages/books/read.js
pages/books/read.js
// @flow /** * Part of GDL gdl-frontend. * Copyright (C) 2017 GDL * * See LICENSE */ import * as React from 'react'; import { fetchBook } from '../../fetch'; import type { BookDetails, Context } from '../../types'; import defaultPage from '../../hocs/defaultPage'; import Head from '../../components/Head'; import Reader from '../../components/Reader'; type Props = { book: BookDetails, url: { query: { chapter?: string } } }; class Read extends React.Component<Props> { static async getInitialProps({ query }: Context) { const bookRes = await fetchBook(query.id, query.lang); if (!bookRes.isOk) { return { statusCode: bookRes.statusCode }; } const book = bookRes.data; // Make sure the chapters are sorted by the chapter numbers // Cause further down we rely on the array indexes book.chapters.sort((a, b) => a.seqNo - b.seqNo); return { book }; } render() { let { book, url } = this.props; return ( <React.Fragment> <Head title={book.title} isBookType description={book.description} imageUrl={book.coverPhoto ? book.coverPhoto.large : null} /> <Reader book={book} initialChapter={url.query.chapter} /> </React.Fragment> ); } } export default defaultPage(Read);
// @flow /** * Part of GDL gdl-frontend. * Copyright (C) 2017 GDL * * See LICENSE */ import * as React from 'react'; import { fetchBook } from '../../fetch'; import type { BookDetails, Context } from '../../types'; import defaultPage from '../../hocs/defaultPage'; import errorPage from '../../hocs/errorPage'; import Head from '../../components/Head'; import Reader from '../../components/Reader'; type Props = { book: BookDetails, url: { query: { chapter?: string } } }; class Read extends React.Component<Props> { static async getInitialProps({ query }: Context) { const bookRes = await fetchBook(query.id, query.lang); if (!bookRes.isOk) { return { statusCode: bookRes.statusCode }; } const book = bookRes.data; // Make sure the chapters are sorted by the chapter numbers // Cause further down we rely on the array indexes book.chapters.sort((a, b) => a.seqNo - b.seqNo); return { book }; } render() { let { book, url } = this.props; return ( <React.Fragment> <Head title={book.title} isBookType description={book.description} imageUrl={book.coverPhoto ? book.coverPhoto.large : null} /> <Reader book={book} initialChapter={url.query.chapter} /> </React.Fragment> ); } } export default defaultPage(errorPage(Read));
Add error handling to Read book page
Add error handling to Read book page
JavaScript
apache-2.0
GlobalDigitalLibraryio/gdl-frontend,GlobalDigitalLibraryio/gdl-frontend
javascript
## Code Before: // @flow /** * Part of GDL gdl-frontend. * Copyright (C) 2017 GDL * * See LICENSE */ import * as React from 'react'; import { fetchBook } from '../../fetch'; import type { BookDetails, Context } from '../../types'; import defaultPage from '../../hocs/defaultPage'; import Head from '../../components/Head'; import Reader from '../../components/Reader'; type Props = { book: BookDetails, url: { query: { chapter?: string } } }; class Read extends React.Component<Props> { static async getInitialProps({ query }: Context) { const bookRes = await fetchBook(query.id, query.lang); if (!bookRes.isOk) { return { statusCode: bookRes.statusCode }; } const book = bookRes.data; // Make sure the chapters are sorted by the chapter numbers // Cause further down we rely on the array indexes book.chapters.sort((a, b) => a.seqNo - b.seqNo); return { book }; } render() { let { book, url } = this.props; return ( <React.Fragment> <Head title={book.title} isBookType description={book.description} imageUrl={book.coverPhoto ? book.coverPhoto.large : null} /> <Reader book={book} initialChapter={url.query.chapter} /> </React.Fragment> ); } } export default defaultPage(Read); ## Instruction: Add error handling to Read book page ## Code After: // @flow /** * Part of GDL gdl-frontend. * Copyright (C) 2017 GDL * * See LICENSE */ import * as React from 'react'; import { fetchBook } from '../../fetch'; import type { BookDetails, Context } from '../../types'; import defaultPage from '../../hocs/defaultPage'; import errorPage from '../../hocs/errorPage'; import Head from '../../components/Head'; import Reader from '../../components/Reader'; type Props = { book: BookDetails, url: { query: { chapter?: string } } }; class Read extends React.Component<Props> { static async getInitialProps({ query }: Context) { const bookRes = await fetchBook(query.id, query.lang); if (!bookRes.isOk) { return { statusCode: bookRes.statusCode }; } const book = bookRes.data; // Make sure the chapters are sorted by the chapter numbers // Cause further down we rely on the array indexes book.chapters.sort((a, b) => a.seqNo - b.seqNo); return { book }; } render() { let { book, url } = this.props; return ( <React.Fragment> <Head title={book.title} isBookType description={book.description} imageUrl={book.coverPhoto ? book.coverPhoto.large : null} /> <Reader book={book} initialChapter={url.query.chapter} /> </React.Fragment> ); } } export default defaultPage(errorPage(Read));
// @flow /** * Part of GDL gdl-frontend. * Copyright (C) 2017 GDL * * See LICENSE */ import * as React from 'react'; import { fetchBook } from '../../fetch'; import type { BookDetails, Context } from '../../types'; import defaultPage from '../../hocs/defaultPage'; + import errorPage from '../../hocs/errorPage'; import Head from '../../components/Head'; import Reader from '../../components/Reader'; type Props = { book: BookDetails, url: { query: { chapter?: string } } }; class Read extends React.Component<Props> { static async getInitialProps({ query }: Context) { const bookRes = await fetchBook(query.id, query.lang); if (!bookRes.isOk) { return { statusCode: bookRes.statusCode }; } const book = bookRes.data; // Make sure the chapters are sorted by the chapter numbers // Cause further down we rely on the array indexes book.chapters.sort((a, b) => a.seqNo - b.seqNo); return { book }; } render() { let { book, url } = this.props; return ( <React.Fragment> <Head title={book.title} isBookType description={book.description} imageUrl={book.coverPhoto ? book.coverPhoto.large : null} /> <Reader book={book} initialChapter={url.query.chapter} /> </React.Fragment> ); } } - export default defaultPage(Read); + export default defaultPage(errorPage(Read)); ? ++++++++++ +
3
0.046154
2
1
ca283fec0b63d9274ddb526d1dd086b675c4f0fe
app/views/ppd/error.html.haml
app/views/ppd/error.html.haml
.row %h2 We're sorry, that didn't work %p We're very sorry, but the query you have just run did not complete. Reasons for this are commonly due to large queries exceeding the time limit, or the result set being too large to transmit. %p %strong Things you can try: %ul %li Make the query more selective. For example, add values for some of the other search fields, such as county, postcode or street. In particular, if you don't enter values for %em any address fields, you're implicitly doing a search for all addresses across England and Wales. %li Limit the years that the data is selected for. If you don't specify a start date, you will be querying the data going back to January 1995. %li Set the sample size. By limiting the number of results to 100 or 1000, you can try out your queries without risking timeouts in the query engine. %li If you have a large analysis that requires all of the data as input, you may be better to %a{ href: "http://www.landregistry.gov.uk/market-trend-data/public-data" } download the raw data and perform your own analysis using your own software. %p If you are still having difficulties accessing the data that you want, or you think that your query should have completed normally, please %a{ href: "/index.html#contact-us"} contact us. %p = @query_command.error_message You can quote this number to support staff so that they can investigate this specific incident.
.row %h2 We're sorry, that didn't work %p We're very sorry, but the query you have just run did not complete. Reasons for this are commonly due to large queries exceeding the time limit, or the result set being too large to transmit. %p %strong Things you can try: %ul %li Make the query more selective. For example, add values for some of the other search fields, such as county, postcode or street. In particular, if you don't enter values for %em any address fields, you're implicitly doing a search for all addresses across England and Wales. %li Limit the years that the data is selected for. If you don't specify a start date, you will be querying the data going back to January 1995. %li Set the sample size. By limiting the number of results to 100 or 1000, you can try out your queries without risking timeouts in the query engine. %li If you have a large analysis that requires all of the data as input, you may be better to %a{ href: "https://www.gov.uk/government/statistical-data-sets/price-paid-data-downloads" } download the raw data and perform your own analysis using your own software. %p If you are still having difficulties accessing the data that you want, or you think that your query should have completed normally, please %a{ href: "/index.html#contact-us"} contact us. %p = @query_command.error_message You can quote this number to support staff so that they can investigate this specific incident.
Change reference to download data
Change reference to download data
Haml
apache-2.0
epimorphics/ppd-explorer,epimorphics/ppd-explorer,epimorphics/ppd-explorer,epimorphics/ppd-explorer
haml
## Code Before: .row %h2 We're sorry, that didn't work %p We're very sorry, but the query you have just run did not complete. Reasons for this are commonly due to large queries exceeding the time limit, or the result set being too large to transmit. %p %strong Things you can try: %ul %li Make the query more selective. For example, add values for some of the other search fields, such as county, postcode or street. In particular, if you don't enter values for %em any address fields, you're implicitly doing a search for all addresses across England and Wales. %li Limit the years that the data is selected for. If you don't specify a start date, you will be querying the data going back to January 1995. %li Set the sample size. By limiting the number of results to 100 or 1000, you can try out your queries without risking timeouts in the query engine. %li If you have a large analysis that requires all of the data as input, you may be better to %a{ href: "http://www.landregistry.gov.uk/market-trend-data/public-data" } download the raw data and perform your own analysis using your own software. %p If you are still having difficulties accessing the data that you want, or you think that your query should have completed normally, please %a{ href: "/index.html#contact-us"} contact us. %p = @query_command.error_message You can quote this number to support staff so that they can investigate this specific incident. ## Instruction: Change reference to download data ## Code After: .row %h2 We're sorry, that didn't work %p We're very sorry, but the query you have just run did not complete. Reasons for this are commonly due to large queries exceeding the time limit, or the result set being too large to transmit. %p %strong Things you can try: %ul %li Make the query more selective. For example, add values for some of the other search fields, such as county, postcode or street. In particular, if you don't enter values for %em any address fields, you're implicitly doing a search for all addresses across England and Wales. %li Limit the years that the data is selected for. If you don't specify a start date, you will be querying the data going back to January 1995. %li Set the sample size. By limiting the number of results to 100 or 1000, you can try out your queries without risking timeouts in the query engine. %li If you have a large analysis that requires all of the data as input, you may be better to %a{ href: "https://www.gov.uk/government/statistical-data-sets/price-paid-data-downloads" } download the raw data and perform your own analysis using your own software. %p If you are still having difficulties accessing the data that you want, or you think that your query should have completed normally, please %a{ href: "/index.html#contact-us"} contact us. %p = @query_command.error_message You can quote this number to support staff so that they can investigate this specific incident.
.row %h2 We're sorry, that didn't work %p We're very sorry, but the query you have just run did not complete. Reasons for this are commonly due to large queries exceeding the time limit, or the result set being too large to transmit. %p %strong Things you can try: %ul %li Make the query more selective. For example, add values for some of the other search fields, such as county, postcode or street. In particular, if you don't enter values for %em any address fields, you're implicitly doing a search for all addresses across England and Wales. %li Limit the years that the data is selected for. If you don't specify a start date, you will be querying the data going back to January 1995. %li Set the sample size. By limiting the number of results to 100 or 1000, you can try out your queries without risking timeouts in the query engine. %li If you have a large analysis that requires all of the data as input, you may be better to - %a{ href: "http://www.landregistry.gov.uk/market-trend-data/public-data" } download the raw data + %a{ href: "https://www.gov.uk/government/statistical-data-sets/price-paid-data-downloads" } download the raw data and perform your own analysis using your own software. %p If you are still having difficulties accessing the data that you want, or you think that your query should have completed normally, please %a{ href: "/index.html#contact-us"} contact us. %p = @query_command.error_message You can quote this number to support staff so that they can investigate this specific incident.
2
0.052632
1
1
518b799193fa800459a0e0921a04f0a1cb2a1ff4
src/scss/shared/_global.scss
src/scss/shared/_global.scss
::selection { background-color: rgba(map-get($brand, 'navy'), 1); color: map-get($brand, 'yellow'); } html { box-sizing: border-box; text-size-adjust: none; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; font-size: 1em; line-height: 1.6; min-height: 100%; &.is-loading { // overflow: hidden; } } body { // @include grid-visual; color: map-get($brand, 'grey'); } main { transform: translate3d(0,0,0); backface-visibility: hidden; perspective: 1000; filter: brightness(100%); transition: all $trans-speed ($trans-delay * 2) $trans-ease; .has-navigation & { pointer-events: none; filter: brightness(50%); transition: all $trans-speed $trans-delay $trans-ease; } } *, *:before, *:after { box-sizing: inherit; }
::selection { background-color: rgba(map-get($brand, 'navy'), 1); color: map-get($brand, 'yellow'); } html { box-sizing: border-box; text-size-adjust: none; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; font-size: 1em; line-height: 1.6; min-height: 100%; } body { color: map-get($brand, 'grey'); .is-loading & { overflow: hidden; } } main { transform: translate3d(0,0,0); backface-visibility: hidden; perspective: 1000; filter: brightness(100%); transition: all $trans-speed ($trans-delay * 2) $trans-ease; .has-navigation & { pointer-events: none; filter: brightness(50%); transition: all $trans-speed $trans-delay $trans-ease; } } *, *:before, *:after { box-sizing: inherit; }
Stop body overflow on loading.
Stop body overflow on loading.
SCSS
agpl-3.0
michaelpumo/michaelpumo.github.io,michaelpumo/michaelpumo.github.io
scss
## Code Before: ::selection { background-color: rgba(map-get($brand, 'navy'), 1); color: map-get($brand, 'yellow'); } html { box-sizing: border-box; text-size-adjust: none; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; font-size: 1em; line-height: 1.6; min-height: 100%; &.is-loading { // overflow: hidden; } } body { // @include grid-visual; color: map-get($brand, 'grey'); } main { transform: translate3d(0,0,0); backface-visibility: hidden; perspective: 1000; filter: brightness(100%); transition: all $trans-speed ($trans-delay * 2) $trans-ease; .has-navigation & { pointer-events: none; filter: brightness(50%); transition: all $trans-speed $trans-delay $trans-ease; } } *, *:before, *:after { box-sizing: inherit; } ## Instruction: Stop body overflow on loading. ## Code After: ::selection { background-color: rgba(map-get($brand, 'navy'), 1); color: map-get($brand, 'yellow'); } html { box-sizing: border-box; text-size-adjust: none; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; font-size: 1em; line-height: 1.6; min-height: 100%; } body { color: map-get($brand, 'grey'); .is-loading & { overflow: hidden; } } main { transform: translate3d(0,0,0); backface-visibility: hidden; perspective: 1000; filter: brightness(100%); transition: all $trans-speed ($trans-delay * 2) $trans-ease; .has-navigation & { pointer-events: none; filter: brightness(50%); transition: all $trans-speed $trans-delay $trans-ease; } } *, *:before, *:after { box-sizing: inherit; }
::selection { background-color: rgba(map-get($brand, 'navy'), 1); color: map-get($brand, 'yellow'); } html { box-sizing: border-box; text-size-adjust: none; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; font-size: 1em; line-height: 1.6; min-height: 100%; - &.is-loading { - - // overflow: hidden; - - } - } body { - // @include grid-visual; + color: map-get($brand, 'grey'); - color: map-get($brand, 'grey'); + .is-loading & { + + overflow: hidden; + + } } main { transform: translate3d(0,0,0); backface-visibility: hidden; perspective: 1000; filter: brightness(100%); transition: all $trans-speed ($trans-delay * 2) $trans-ease; .has-navigation & { pointer-events: none; filter: brightness(50%); transition: all $trans-speed $trans-delay $trans-ease; } } *, *:before, *:after { box-sizing: inherit; }
14
0.233333
6
8
39867d2f48a464926d9e1fbdb0b0dda75b3702d7
spec/ruby/library/stringscanner/getch_spec.rb
spec/ruby/library/stringscanner/getch_spec.rb
require File.expand_path('../../../spec_helper', __FILE__) require 'strscan' describe "StringScanner#getch" do before :each do @kcode = $KCODE end after :each do $KCODE = @kcode end it "scans one character and returns it" do s = StringScanner.new('abc') s.getch.should == "a" s.getch.should == "b" s.getch.should == "c" end it "is multi-byte character sensitive" do $KCODE = 'EUC' # Japanese hiragana "A" in EUC-JP src = encode("\244\242", "euc-jp") s = StringScanner.new(src) s.getch.should == src end it "returns nil at the end of the string" do # empty string case s = StringScanner.new('') s.getch.should == nil s.getch.should == nil # non-empty string case s = StringScanner.new('a') s.getch # skip one s.getch.should == nil end it "does not accept any arguments" do s = StringScanner.new('abc') lambda { s.getch(5) }.should raise_error(ArgumentError, /wrong .* arguments/) end end
require File.expand_path('../../../spec_helper', __FILE__) require 'strscan' describe "StringScanner#getch" do before :each do @kcode = $KCODE end after :each do $KCODE = @kcode end it "scans one character and returns it" do s = StringScanner.new('abc') s.getch.should == "a" s.getch.should == "b" s.getch.should == "c" end it "is multi-byte character sensitive" do $KCODE = 'EUC' # Japanese hiragana "A" in EUC-JP src = encode("\244\242", "euc-jp") s = StringScanner.new(src) s.getch.should == src end it "returns nil at the end of the string" do # empty string case s = StringScanner.new('') s.getch.should == nil s.getch.should == nil # non-empty string case s = StringScanner.new('a') s.getch # skip one s.getch.should == nil end it "always returns instance of String, never a String subclass" do cls = Class.new(String) sub = cls.new("abc") s = StringScanner.new(sub) ch = s.getch ch.should_not be_kind_of(cls) ch.should == "a" end end
Add StringScanner test for class of returned values
Add StringScanner test for class of returned values
Ruby
bsd-3-clause
jemc/rubinius,mlarraz/rubinius,ruipserra/rubinius,benlovell/rubinius,Azizou/rubinius,slawosz/rubinius,benlovell/rubinius,ngpestelos/rubinius,pH14/rubinius,slawosz/rubinius,pH14/rubinius,digitalextremist/rubinius,Wirachmat/rubinius,sferik/rubinius,benlovell/rubinius,sferik/rubinius,heftig/rubinius,sferik/rubinius,mlarraz/rubinius,mlarraz/rubinius,ruipserra/rubinius,sferik/rubinius,digitalextremist/rubinius,kachick/rubinius,lgierth/rubinius,digitalextremist/rubinius,slawosz/rubinius,Wirachmat/rubinius,jsyeo/rubinius,heftig/rubinius,ruipserra/rubinius,Azizou/rubinius,kachick/rubinius,pH14/rubinius,heftig/rubinius,sferik/rubinius,pH14/rubinius,benlovell/rubinius,heftig/rubinius,Azizou/rubinius,Wirachmat/rubinius,lgierth/rubinius,dblock/rubinius,ngpestelos/rubinius,dblock/rubinius,jemc/rubinius,benlovell/rubinius,lgierth/rubinius,mlarraz/rubinius,jemc/rubinius,travis-repos/rubinius,ngpestelos/rubinius,sferik/rubinius,travis-repos/rubinius,jsyeo/rubinius,slawosz/rubinius,Wirachmat/rubinius,pH14/rubinius,heftig/rubinius,jsyeo/rubinius,benlovell/rubinius,lgierth/rubinius,kachick/rubinius,mlarraz/rubinius,dblock/rubinius,ruipserra/rubinius,kachick/rubinius,dblock/rubinius,jemc/rubinius,Azizou/rubinius,heftig/rubinius,pH14/rubinius,dblock/rubinius,slawosz/rubinius,lgierth/rubinius,travis-repos/rubinius,jemc/rubinius,heftig/rubinius,Azizou/rubinius,kachick/rubinius,lgierth/rubinius,Azizou/rubinius,ruipserra/rubinius,Azizou/rubinius,mlarraz/rubinius,ruipserra/rubinius,digitalextremist/rubinius,slawosz/rubinius,ruipserra/rubinius,lgierth/rubinius,dblock/rubinius,kachick/rubinius,kachick/rubinius,pH14/rubinius,sferik/rubinius,digitalextremist/rubinius,jemc/rubinius,mlarraz/rubinius,Wirachmat/rubinius,jemc/rubinius,jsyeo/rubinius,jsyeo/rubinius,jsyeo/rubinius,ngpestelos/rubinius,travis-repos/rubinius,ngpestelos/rubinius,digitalextremist/rubinius,dblock/rubinius,ngpestelos/rubinius,travis-repos/rubinius,travis-repos/rubinius,jsyeo/rubinius,slawosz/rubinius,benlovell/rubinius,kachick/rubinius,travis-repos/rubinius,ngpestelos/rubinius,Wirachmat/rubinius,Wirachmat/rubinius,digitalextremist/rubinius
ruby
## Code Before: require File.expand_path('../../../spec_helper', __FILE__) require 'strscan' describe "StringScanner#getch" do before :each do @kcode = $KCODE end after :each do $KCODE = @kcode end it "scans one character and returns it" do s = StringScanner.new('abc') s.getch.should == "a" s.getch.should == "b" s.getch.should == "c" end it "is multi-byte character sensitive" do $KCODE = 'EUC' # Japanese hiragana "A" in EUC-JP src = encode("\244\242", "euc-jp") s = StringScanner.new(src) s.getch.should == src end it "returns nil at the end of the string" do # empty string case s = StringScanner.new('') s.getch.should == nil s.getch.should == nil # non-empty string case s = StringScanner.new('a') s.getch # skip one s.getch.should == nil end it "does not accept any arguments" do s = StringScanner.new('abc') lambda { s.getch(5) }.should raise_error(ArgumentError, /wrong .* arguments/) end end ## Instruction: Add StringScanner test for class of returned values ## Code After: require File.expand_path('../../../spec_helper', __FILE__) require 'strscan' describe "StringScanner#getch" do before :each do @kcode = $KCODE end after :each do $KCODE = @kcode end it "scans one character and returns it" do s = StringScanner.new('abc') s.getch.should == "a" s.getch.should == "b" s.getch.should == "c" end it "is multi-byte character sensitive" do $KCODE = 'EUC' # Japanese hiragana "A" in EUC-JP src = encode("\244\242", "euc-jp") s = StringScanner.new(src) s.getch.should == src end it "returns nil at the end of the string" do # empty string case s = StringScanner.new('') s.getch.should == nil s.getch.should == nil # non-empty string case s = StringScanner.new('a') s.getch # skip one s.getch.should == nil end it "always returns instance of String, never a String subclass" do cls = Class.new(String) sub = cls.new("abc") s = StringScanner.new(sub) ch = s.getch ch.should_not be_kind_of(cls) ch.should == "a" end end
require File.expand_path('../../../spec_helper', __FILE__) require 'strscan' describe "StringScanner#getch" do before :each do @kcode = $KCODE end after :each do $KCODE = @kcode end it "scans one character and returns it" do s = StringScanner.new('abc') s.getch.should == "a" s.getch.should == "b" s.getch.should == "c" end it "is multi-byte character sensitive" do $KCODE = 'EUC' # Japanese hiragana "A" in EUC-JP src = encode("\244\242", "euc-jp") s = StringScanner.new(src) s.getch.should == src end it "returns nil at the end of the string" do # empty string case s = StringScanner.new('') s.getch.should == nil s.getch.should == nil # non-empty string case s = StringScanner.new('a') s.getch # skip one s.getch.should == nil end - it "does not accept any arguments" do + it "always returns instance of String, never a String subclass" do + cls = Class.new(String) + sub = cls.new("abc") + - s = StringScanner.new('abc') ? ^^ -- + s = StringScanner.new(sub) ? ^^ - lambda { - s.getch(5) ? --- + ch = s.getch ? ++ + - }.should raise_error(ArgumentError, /wrong .* arguments/) + ch.should_not be_kind_of(cls) + ch.should == "a" end end
13
0.270833
8
5
15313c3baf557acbbd493e1642374aadffcfc9b8
readme.md
readme.md
A collection of examples showing how [Astun Technology](http://astuntechnology.com/) services can be used with the [OpenLayers 3](http://ol3js.org/) client-side mapping library. To view simply clone the repo or download the zip and open each of the html files in a web browser. You can also view the example thanks to rawgithub.com here: * [ADS OS Open WMS](http://rawgithub.com/AstunTechnology/astun-ol3-examples/master/ads/ads_wms.html) Also see [astun-leaflet-examples](https://github.com/AstunTechnology/astun-leaflet-examples).
A collection of examples showing how [Astun Technology](http://astuntechnology.com/) services can be used with the [OpenLayers 3](http://ol3js.org/) client-side mapping library. To view simply clone the repo or download the zip and open each of the html files in a web browser. You can also view the example thanks to rawgithub.com here: * [ADS OS Open WMS](http://rawgithub.com/AstunTechnology/astun-ol3-examples/master/ads/ads_wms.html) * [iShare GeoJSON](http://rawgithub.com/AstunTechnology/astun-ol3-examples/master/ishare/ishare_geojson.html) Also see [astun-leaflet-examples](https://github.com/AstunTechnology/astun-leaflet-examples).
Add link to iShare GeoJSON example showing markers & popup
Add link to iShare GeoJSON example showing markers & popup
Markdown
mit
AstunTechnology/astun-ol3-examples,AstunTechnology/astun-ol3-examples
markdown
## Code Before: A collection of examples showing how [Astun Technology](http://astuntechnology.com/) services can be used with the [OpenLayers 3](http://ol3js.org/) client-side mapping library. To view simply clone the repo or download the zip and open each of the html files in a web browser. You can also view the example thanks to rawgithub.com here: * [ADS OS Open WMS](http://rawgithub.com/AstunTechnology/astun-ol3-examples/master/ads/ads_wms.html) Also see [astun-leaflet-examples](https://github.com/AstunTechnology/astun-leaflet-examples). ## Instruction: Add link to iShare GeoJSON example showing markers & popup ## Code After: A collection of examples showing how [Astun Technology](http://astuntechnology.com/) services can be used with the [OpenLayers 3](http://ol3js.org/) client-side mapping library. To view simply clone the repo or download the zip and open each of the html files in a web browser. You can also view the example thanks to rawgithub.com here: * [ADS OS Open WMS](http://rawgithub.com/AstunTechnology/astun-ol3-examples/master/ads/ads_wms.html) * [iShare GeoJSON](http://rawgithub.com/AstunTechnology/astun-ol3-examples/master/ishare/ishare_geojson.html) Also see [astun-leaflet-examples](https://github.com/AstunTechnology/astun-leaflet-examples).
A collection of examples showing how [Astun Technology](http://astuntechnology.com/) services can be used with the [OpenLayers 3](http://ol3js.org/) client-side mapping library. To view simply clone the repo or download the zip and open each of the html files in a web browser. You can also view the example thanks to rawgithub.com here: * [ADS OS Open WMS](http://rawgithub.com/AstunTechnology/astun-ol3-examples/master/ads/ads_wms.html) + * [iShare GeoJSON](http://rawgithub.com/AstunTechnology/astun-ol3-examples/master/ishare/ishare_geojson.html) Also see [astun-leaflet-examples](https://github.com/AstunTechnology/astun-leaflet-examples).
1
0.125
1
0
000312abf1628d3a69103f7f81bb9a280c951cfc
test/models/product_test.rb
test/models/product_test.rb
require 'test_helper' class ProductTest < ActiveSupport::TestCase # test "the truth" do # assert true # end end
require 'test_helper' class ProductTest < ActiveSupport::TestCase test "product attributes must not be empty" do # Properties must not be empty. product = Product.new assert product.invalid? assert product.errors[:title].any? assert product.errors[:description].any? assert product.errors[:price].any? assert product.errors[:image_url].any? end end
Add model test for Product properties
Add model test for Product properties
Ruby
mit
bdisney/eShop,bdisney/eShop,bdisney/eShop
ruby
## Code Before: require 'test_helper' class ProductTest < ActiveSupport::TestCase # test "the truth" do # assert true # end end ## Instruction: Add model test for Product properties ## Code After: require 'test_helper' class ProductTest < ActiveSupport::TestCase test "product attributes must not be empty" do # Properties must not be empty. product = Product.new assert product.invalid? assert product.errors[:title].any? assert product.errors[:description].any? assert product.errors[:price].any? assert product.errors[:image_url].any? end end
require 'test_helper' class ProductTest < ActiveSupport::TestCase - # test "the truth" do - # assert true + test "product attributes must not be empty" do + # Properties must not be empty. + product = Product.new + assert product.invalid? + assert product.errors[:title].any? + assert product.errors[:description].any? + assert product.errors[:price].any? + assert product.errors[:image_url].any? - # end ? -- + end end
12
1.714286
9
3
ed55987842f835999f180fc0008100a9c65c9787
source/renderer/app/components/staking/delegation-center/DelegationCenterHeader.scss
source/renderer/app/components/staking/delegation-center/DelegationCenterHeader.scss
@import '../stakingConfig'; .component { background-color: var(--theme-staking-background-color); margin: 20px; text-align: center; } .mainContent { @extend %contentBorderAndBackground; padding: 20px 102px; position: relative; } .progressRing { position: absolute; right: 38px; top: 60px; } .heading { @extend %accentText; font-size: 19px; margin-bottom: 14px; } .description { @extend %regularLightColorText; margin-bottom: 24px; b { @extend %accentText; } a { border-bottom: 1px solid var(--theme-staking-link-color); color: var(--theme-staking-link-color); margin: 0 5px; padding-right: 18px; position: relative; text-decoration: none; } .linkNewWindowIcon { display: inline-block; height: 15px; position: absolute; right: 0; top: 2px; width: 15px; } }
@import '../stakingConfig'; .component { background-color: var(--theme-staking-background-color); margin: 20px; text-align: center; } .mainContent { @extend %contentBorderAndBackground; padding: 20px 102px; position: relative; } .progressRing { position: absolute; right: 38px; top: 60px; } .heading { @extend %accentText; font-size: 19px; margin-bottom: 14px; } .description { @extend %regularLightColorText; margin-bottom: 24px; b { @extend %accentText; } a { border-bottom: 1px solid var(--theme-staking-link-color); color: var(--theme-staking-link-color); margin: 0 5px; padding-right: 18px; position: relative; text-decoration: none; } .linkNewWindowIcon { display: inline-block; height: 15px; position: absolute; right: 0; top: 2px; width: 15px; & > svg { & > g { stroke: var(--theme-staking-link-color); } } } }
Update link color to use theme specific one on delegation center header section
[DDW-651]: Update link color to use theme specific one on delegation center header section
SCSS
apache-2.0
input-output-hk/daedalus,input-output-hk/daedalus,input-output-hk/daedalus,input-output-hk/daedalus,input-output-hk/daedalus,input-output-hk/daedalus
scss
## Code Before: @import '../stakingConfig'; .component { background-color: var(--theme-staking-background-color); margin: 20px; text-align: center; } .mainContent { @extend %contentBorderAndBackground; padding: 20px 102px; position: relative; } .progressRing { position: absolute; right: 38px; top: 60px; } .heading { @extend %accentText; font-size: 19px; margin-bottom: 14px; } .description { @extend %regularLightColorText; margin-bottom: 24px; b { @extend %accentText; } a { border-bottom: 1px solid var(--theme-staking-link-color); color: var(--theme-staking-link-color); margin: 0 5px; padding-right: 18px; position: relative; text-decoration: none; } .linkNewWindowIcon { display: inline-block; height: 15px; position: absolute; right: 0; top: 2px; width: 15px; } } ## Instruction: [DDW-651]: Update link color to use theme specific one on delegation center header section ## Code After: @import '../stakingConfig'; .component { background-color: var(--theme-staking-background-color); margin: 20px; text-align: center; } .mainContent { @extend %contentBorderAndBackground; padding: 20px 102px; position: relative; } .progressRing { position: absolute; right: 38px; top: 60px; } .heading { @extend %accentText; font-size: 19px; margin-bottom: 14px; } .description { @extend %regularLightColorText; margin-bottom: 24px; b { @extend %accentText; } a { border-bottom: 1px solid var(--theme-staking-link-color); color: var(--theme-staking-link-color); margin: 0 5px; padding-right: 18px; position: relative; text-decoration: none; } .linkNewWindowIcon { display: inline-block; height: 15px; position: absolute; right: 0; top: 2px; width: 15px; & > svg { & > g { stroke: var(--theme-staking-link-color); } } } }
@import '../stakingConfig'; .component { background-color: var(--theme-staking-background-color); margin: 20px; text-align: center; } .mainContent { @extend %contentBorderAndBackground; padding: 20px 102px; position: relative; } .progressRing { position: absolute; right: 38px; top: 60px; } .heading { @extend %accentText; font-size: 19px; margin-bottom: 14px; } .description { @extend %regularLightColorText; margin-bottom: 24px; b { @extend %accentText; } a { border-bottom: 1px solid var(--theme-staking-link-color); color: var(--theme-staking-link-color); margin: 0 5px; padding-right: 18px; position: relative; text-decoration: none; } .linkNewWindowIcon { display: inline-block; height: 15px; position: absolute; right: 0; top: 2px; width: 15px; + + & > svg { + & > g { + stroke: var(--theme-staking-link-color); + } + } } }
6
0.115385
6
0
106085c21165b23f4fe8d60a1d4fc3ee774a087c
README.md
README.md
Boilerplate to start new project
> Simple markup builder to start new project ## Basic features * Included Gulp v4.0 * Included Bower. * Included Bootstrap v4.0.0-alpha.2 (with tether). * Included jQuery 2.2.2. * [SCSS (SASS)](http://sass-lang.com/) as a preprocessor for css. Sourcemaps is included. [PostCSS](https://github.com/postcss/postcss) with [autoprefixer](https://github.com/postcss/autoprefixer), postcss-import, postcss-assets. * JavaScript with sourcemaps, gulp-rigger and gulp-uglify. * HTML with gulp-rigger. ## Install 1. Clone repository ``` $ git clone https://github.com/hobcode/hobcore ``` 2. Install node modules. ``` $ npm install ``` 3. Install bower globally and components. ``` $ npm install -g bower $ bower install ``` ## Usage Basic developer usage ``` $ export PATH=./node_modules/.bin:$PATH $ export NODE_ENV=development $ gulp ``` Production ``` $ NODE_ENV=production gulp ``` or just build `dist` without run server ``` $ NODE_ENV=production gulp build ```
Add description in Readme file.
Add description in Readme file.
Markdown
mit
hobcode/hobcore,hobcode/hobcore
markdown
## Code Before: Boilerplate to start new project ## Instruction: Add description in Readme file. ## Code After: > Simple markup builder to start new project ## Basic features * Included Gulp v4.0 * Included Bower. * Included Bootstrap v4.0.0-alpha.2 (with tether). * Included jQuery 2.2.2. * [SCSS (SASS)](http://sass-lang.com/) as a preprocessor for css. Sourcemaps is included. [PostCSS](https://github.com/postcss/postcss) with [autoprefixer](https://github.com/postcss/autoprefixer), postcss-import, postcss-assets. * JavaScript with sourcemaps, gulp-rigger and gulp-uglify. * HTML with gulp-rigger. ## Install 1. Clone repository ``` $ git clone https://github.com/hobcode/hobcore ``` 2. Install node modules. ``` $ npm install ``` 3. Install bower globally and components. ``` $ npm install -g bower $ bower install ``` ## Usage Basic developer usage ``` $ export PATH=./node_modules/.bin:$PATH $ export NODE_ENV=development $ gulp ``` Production ``` $ NODE_ENV=production gulp ``` or just build `dist` without run server ``` $ NODE_ENV=production gulp build ```
- Boilerplate to start new project + > Simple markup builder to start new project + + ## Basic features + * Included Gulp v4.0 + * Included Bower. + * Included Bootstrap v4.0.0-alpha.2 (with tether). + * Included jQuery 2.2.2. + * [SCSS (SASS)](http://sass-lang.com/) as a preprocessor for css. Sourcemaps is included. [PostCSS](https://github.com/postcss/postcss) with [autoprefixer](https://github.com/postcss/autoprefixer), postcss-import, postcss-assets. + * JavaScript with sourcemaps, gulp-rigger and gulp-uglify. + * HTML with gulp-rigger. + + ## Install + 1. Clone repository + ``` + $ git clone https://github.com/hobcode/hobcore + ``` + 2. Install node modules. + ``` + $ npm install + ``` + 3. Install bower globally and components. + ``` + $ npm install -g bower + $ bower install + ``` + + ## Usage + Basic developer usage + ``` + $ export PATH=./node_modules/.bin:$PATH + $ export NODE_ENV=development + $ gulp + ``` + Production + ``` + $ NODE_ENV=production gulp + ``` + or just build `dist` without run server + ``` + $ NODE_ENV=production gulp build + ```
42
42
41
1
1bf765eaa15bc4efa023c18d11371932bf6122e7
composer.json
composer.json
{ "name": "zikula/tools", "homepage": "http://zikula.org/", "license": "MIT", "description": "Zikula Tools", "minimum-stability": "dev", "autoload": { "psr-0": { "Zikula\\Tools": "" } }, "authors": [ { "name": "Drak", "email": "drak@zikula.org" } ], "require": { "php": ">=5.3.3", "symfony/config": "2.2.*", "symfony/console": "2.2.*", "symfony/finder": "2.2.*", "symfony/filesystem": "2.2.*", "nikic/php-parser": "dev-master" }, "bin": ["zikula-tools"] }
{ "name": "zikula/tools", "homepage": "http://zikula.org/", "license": "MIT", "description": "Zikula Tools", "minimum-stability": "dev", "autoload": { "psr-0": { "Zikula\\Tools": "" } }, "authors": [ { "name": "Drak", "email": "drak@zikula.org" } ], "require": { "php": ">=5.3.3", "symfony/config": "2.2.*", "symfony/console": "2.2.*", "symfony/finder": "2.2.*", "symfony/filesystem": "2.2.*", "nikic/php-parser": "dev-master", "fabpot/php-cs-fixer": "0.3.*@dev" }, "bin": ["zikula-tools"] }
Add PHP-CS_FIXER so we can force PSR-2 formatting
Add PHP-CS_FIXER so we can force PSR-2 formatting
JSON
mit
zikula/Tools
json
## Code Before: { "name": "zikula/tools", "homepage": "http://zikula.org/", "license": "MIT", "description": "Zikula Tools", "minimum-stability": "dev", "autoload": { "psr-0": { "Zikula\\Tools": "" } }, "authors": [ { "name": "Drak", "email": "drak@zikula.org" } ], "require": { "php": ">=5.3.3", "symfony/config": "2.2.*", "symfony/console": "2.2.*", "symfony/finder": "2.2.*", "symfony/filesystem": "2.2.*", "nikic/php-parser": "dev-master" }, "bin": ["zikula-tools"] } ## Instruction: Add PHP-CS_FIXER so we can force PSR-2 formatting ## Code After: { "name": "zikula/tools", "homepage": "http://zikula.org/", "license": "MIT", "description": "Zikula Tools", "minimum-stability": "dev", "autoload": { "psr-0": { "Zikula\\Tools": "" } }, "authors": [ { "name": "Drak", "email": "drak@zikula.org" } ], "require": { "php": ">=5.3.3", "symfony/config": "2.2.*", "symfony/console": "2.2.*", "symfony/finder": "2.2.*", "symfony/filesystem": "2.2.*", "nikic/php-parser": "dev-master", "fabpot/php-cs-fixer": "0.3.*@dev" }, "bin": ["zikula-tools"] }
{ "name": "zikula/tools", "homepage": "http://zikula.org/", "license": "MIT", "description": "Zikula Tools", "minimum-stability": "dev", "autoload": { "psr-0": { "Zikula\\Tools": "" } }, "authors": [ { "name": "Drak", "email": "drak@zikula.org" } ], "require": { "php": ">=5.3.3", "symfony/config": "2.2.*", "symfony/console": "2.2.*", "symfony/finder": "2.2.*", "symfony/filesystem": "2.2.*", - "nikic/php-parser": "dev-master" + "nikic/php-parser": "dev-master", ? + + "fabpot/php-cs-fixer": "0.3.*@dev" }, "bin": ["zikula-tools"] }
3
0.111111
2
1
4adef079be66919a1960c0fdcfde70a4a8b4f238
app/Http/Controllers/API/EditorServicesController.php
app/Http/Controllers/API/EditorServicesController.php
<?php namespace App\Http\Controllers\API; use App\Http\Controllers\Controller; use Illuminate\Http\Response; use Illuminate\Http\Request; class EditorServicesController extends Controller { public function __construct(){} public function course($question_id) { return response()->json(['value' => $question_id]); } public function submit(Request $request) { // Get test case // // Submit file and test case to compiler // // return result } }
<?php namespace App\Http\Controllers\API; use App\Http\Controllers\Controller; use Illuminate\Http\Response; use Illuminate\Http\Request; use Editor\Connection; use Editor\CourseInformationConnection; class EditorServicesController extends Controller { public function __construct(){} public function course($question_id) { return response()->json(['value' => $question_id]); } public function submit(Request $request, $id) { // Get test case $content_url = sprintf( config('service.course.testcase'), $id ); $content = $this->getContent($content_url); return response()->json($content); // Submit file and test case to compiler // // return result } protected function getContent($url) { $context = stream_context_create( [ 'http' => ['header'=>'Connection: close\r\n'] ] ); return file_get_contents($url, false, $context); } }
Add getContent for getting faster
Add getContent for getting faster
PHP
mit
sitdh/editr
php
## Code Before: <?php namespace App\Http\Controllers\API; use App\Http\Controllers\Controller; use Illuminate\Http\Response; use Illuminate\Http\Request; class EditorServicesController extends Controller { public function __construct(){} public function course($question_id) { return response()->json(['value' => $question_id]); } public function submit(Request $request) { // Get test case // // Submit file and test case to compiler // // return result } } ## Instruction: Add getContent for getting faster ## Code After: <?php namespace App\Http\Controllers\API; use App\Http\Controllers\Controller; use Illuminate\Http\Response; use Illuminate\Http\Request; use Editor\Connection; use Editor\CourseInformationConnection; class EditorServicesController extends Controller { public function __construct(){} public function course($question_id) { return response()->json(['value' => $question_id]); } public function submit(Request $request, $id) { // Get test case $content_url = sprintf( config('service.course.testcase'), $id ); $content = $this->getContent($content_url); return response()->json($content); // Submit file and test case to compiler // // return result } protected function getContent($url) { $context = stream_context_create( [ 'http' => ['header'=>'Connection: close\r\n'] ] ); return file_get_contents($url, false, $context); } }
<?php namespace App\Http\Controllers\API; use App\Http\Controllers\Controller; + use Illuminate\Http\Response; use Illuminate\Http\Request; + + use Editor\Connection; + use Editor\CourseInformationConnection; class EditorServicesController extends Controller { public function __construct(){} public function course($question_id) { return response()->json(['value' => $question_id]); } - public function submit(Request $request) + public function submit(Request $request, $id) ? +++++ { // Get test case - // + $content_url = sprintf( + config('service.course.testcase'), + $id + ); + $content = $this->getContent($content_url); + + return response()->json($content); // Submit file and test case to compiler // // return result } + + protected function getContent($url) + { + $context = stream_context_create( + [ + 'http' => ['header'=>'Connection: close\r\n'] + ] + ); + + return file_get_contents($url, false, $context); + } + }
26
0.928571
24
2
f5f813bd298e48b93fb955ea78375e0bb9efa72d
src/core/bootstrap.js
src/core/bootstrap.js
'use strict'; const Promise = require('bluebird'); const Server = require('./server'); module.exports = {start}; function start () { return Promise.resolve() .then(() => { Server.start((err) => { if (err) throw err; Server.log('info', 'Server running at: ' + Server.info.uri); }); }) .catch((err) => { Server.log('==> App Error', err); process.exit(); }); }
'use strict'; const Promise = require('bluebird'); const Server = require('./server'); module.exports = {start}; function start () { return Promise.resolve() .then(() => { Server.start((err) => { if (err) { throw err; } Server.log('info', 'Server running at: ' + Server.info.uri); }); }) .catch((err) => { Server.log('==> App Error', err); process.exit(); }); }
Fix last PR. ever see the PR and make a if with curly braces
Fix last PR. ever see the PR and make a if with curly braces
JavaScript
isc
thebergamo/ecommerce.js,thebergamo/ecommerce.js,thebergamo/ecommerce.js
javascript
## Code Before: 'use strict'; const Promise = require('bluebird'); const Server = require('./server'); module.exports = {start}; function start () { return Promise.resolve() .then(() => { Server.start((err) => { if (err) throw err; Server.log('info', 'Server running at: ' + Server.info.uri); }); }) .catch((err) => { Server.log('==> App Error', err); process.exit(); }); } ## Instruction: Fix last PR. ever see the PR and make a if with curly braces ## Code After: 'use strict'; const Promise = require('bluebird'); const Server = require('./server'); module.exports = {start}; function start () { return Promise.resolve() .then(() => { Server.start((err) => { if (err) { throw err; } Server.log('info', 'Server running at: ' + Server.info.uri); }); }) .catch((err) => { Server.log('==> App Error', err); process.exit(); }); }
'use strict'; const Promise = require('bluebird'); const Server = require('./server'); module.exports = {start}; function start () { return Promise.resolve() .then(() => { Server.start((err) => { - if (err) + if (err) { ? ++ throw err; + } Server.log('info', 'Server running at: ' + Server.info.uri); }); }) .catch((err) => { Server.log('==> App Error', err); process.exit(); }); }
3
0.136364
2
1
0b3a69e9c602150767800e169c1c0c444b2b187a
tenets/codelingo/lomik-go-carbon/lingo_bundle.yaml
tenets/codelingo/lomik-go-carbon/lingo_bundle.yaml
description: Tenets written for lomik-go-carbon version: 0.0.0 tenets: - missing-stop-ticker tags: - go - lomik - go-carbon
description: Tenets written for lomik-go-carbon version: 0.0.0 tenets: - assignment-to-nil-map - missing-stop-ticker tags: - go - lomik - go-carbon
Add tenet to bundle file
Add tenet to bundle file
YAML
agpl-3.0
lingo-reviews/lingo,lingo-reviews/lingo
yaml
## Code Before: description: Tenets written for lomik-go-carbon version: 0.0.0 tenets: - missing-stop-ticker tags: - go - lomik - go-carbon ## Instruction: Add tenet to bundle file ## Code After: description: Tenets written for lomik-go-carbon version: 0.0.0 tenets: - assignment-to-nil-map - missing-stop-ticker tags: - go - lomik - go-carbon
description: Tenets written for lomik-go-carbon version: 0.0.0 tenets: + - assignment-to-nil-map - missing-stop-ticker tags: - go - lomik - go-carbon
1
0.125
1
0
6bc6776a0722d1b87cf7b2479e01e47432adba59
index.js
index.js
var url = require('url'), add = function (logger, level) { loggers.push([logger, level]); return fn; }, loggers = [], fn, Churchill; fn = function (req, res, next) { var requestEnd = res.end, requestToLog = { status: null, method: req.method, url: req.originalUrl }; //if we're using a connect middleware logger this will already exist req._startTime = req._startTime || new Date(); // Use the end function res.end = function (chunk, encoding) { res.end = requestEnd; res.end(chunk, encoding); requestToLog.status = res.statusCode; requestToLog.response_time = (new Date() - req._startTime) + 'ms'; loggers.forEach(function (arr) { var logger = arr[0], level = arr[1]; level = level || 'info'; logger.log(level, requestToLog); }); }; next(); }; fn.add = add; Churchill = function (logger, level) { add(logger, level); return fn; }; Churchill.add = add; module.exports = Churchill;
var url = require('url'), add = function (logger, level) { loggers.push([logger, level]); return fn; }, loggers = [], fn, Churchill; fn = function (req, res, next) { var requestEnd = res.end, requestToLog = { status: null, method: req.method, url: req.originalUrl }; //if we're using a connect middleware logger this will already exist req._startTime = req._startTime || new Date(); // Use the end function res.end = function (chunk, encoding) { res.end = requestEnd; res.end(chunk, encoding); requestToLog.status = res.statusCode; requestToLog.response_time = (new Date() - req._startTime) + 'ms'; requestToLog.content_length = res.get('Content-Length') || '-'; loggers.forEach(function (arr) { var logger = arr[0], level = arr[1]; level = level || 'info'; logger.log(level, requestToLog); }); }; next(); }; fn.add = add; Churchill = function (logger, level) { add(logger, level); return fn; }; Churchill.add = add; module.exports = Churchill;
Add content length to logging
Add content length to logging
JavaScript
mit
easternbloc/churchill
javascript
## Code Before: var url = require('url'), add = function (logger, level) { loggers.push([logger, level]); return fn; }, loggers = [], fn, Churchill; fn = function (req, res, next) { var requestEnd = res.end, requestToLog = { status: null, method: req.method, url: req.originalUrl }; //if we're using a connect middleware logger this will already exist req._startTime = req._startTime || new Date(); // Use the end function res.end = function (chunk, encoding) { res.end = requestEnd; res.end(chunk, encoding); requestToLog.status = res.statusCode; requestToLog.response_time = (new Date() - req._startTime) + 'ms'; loggers.forEach(function (arr) { var logger = arr[0], level = arr[1]; level = level || 'info'; logger.log(level, requestToLog); }); }; next(); }; fn.add = add; Churchill = function (logger, level) { add(logger, level); return fn; }; Churchill.add = add; module.exports = Churchill; ## Instruction: Add content length to logging ## Code After: var url = require('url'), add = function (logger, level) { loggers.push([logger, level]); return fn; }, loggers = [], fn, Churchill; fn = function (req, res, next) { var requestEnd = res.end, requestToLog = { status: null, method: req.method, url: req.originalUrl }; //if we're using a connect middleware logger this will already exist req._startTime = req._startTime || new Date(); // Use the end function res.end = function (chunk, encoding) { res.end = requestEnd; res.end(chunk, encoding); requestToLog.status = res.statusCode; requestToLog.response_time = (new Date() - req._startTime) + 'ms'; requestToLog.content_length = res.get('Content-Length') || '-'; loggers.forEach(function (arr) { var logger = arr[0], level = arr[1]; level = level || 'info'; logger.log(level, requestToLog); }); }; next(); }; fn.add = add; Churchill = function (logger, level) { add(logger, level); return fn; }; Churchill.add = add; module.exports = Churchill;
var url = require('url'), add = function (logger, level) { loggers.push([logger, level]); return fn; }, loggers = [], fn, Churchill; fn = function (req, res, next) { var requestEnd = res.end, requestToLog = { status: null, method: req.method, url: req.originalUrl }; //if we're using a connect middleware logger this will already exist req._startTime = req._startTime || new Date(); // Use the end function res.end = function (chunk, encoding) { res.end = requestEnd; res.end(chunk, encoding); requestToLog.status = res.statusCode; requestToLog.response_time = (new Date() - req._startTime) + 'ms'; + requestToLog.content_length = res.get('Content-Length') || '-'; loggers.forEach(function (arr) { var logger = arr[0], level = arr[1]; level = level || 'info'; logger.log(level, requestToLog); }); }; next(); }; fn.add = add; Churchill = function (logger, level) { add(logger, level); return fn; }; Churchill.add = add; module.exports = Churchill;
1
0.020408
1
0
e8409ad449f72d0e4ad6a33cc1effea1ef16d177
core/src/main/java/RedQueryBuilderCore.gwt.xml
core/src/main/java/RedQueryBuilderCore.gwt.xml
<module> <inherits name="com.google.gwt.user.User" /> <inherits name="com.google.gwt.i18n.I18N"/> <inherits name="com.google.gwt.resources.Resources" /> <entry-point class="com.redspr.redquerybuilder.core.RedQueryBuilder" /> <!-- extend-property name="locale" values="en_GB"/ --> <source path="" > <include name="com/redspr/**" /> <include name="java/sql/**" /> <include name="java/math/**" /> </source> </module>
<module> <inherits name="com.google.gwt.user.User" /> <inherits name="com.google.gwt.i18n.I18N"/> <inherits name="com.google.gwt.resources.Resources" /> <source path="" > <include name="com/redspr/**" /> <include name="java/sql/**" /> <include name="java/math/**" /> </source> </module>
Remove entry point for library module.
Remove entry point for library module.
XML
epl-1.0
scottdear/RedQueryBuilder,salk31/RedQueryBuilder,scottdear/RedQueryBuilder,scottdear/RedQueryBuilder,salk31/RedQueryBuilder,salk31/RedQueryBuilder
xml
## Code Before: <module> <inherits name="com.google.gwt.user.User" /> <inherits name="com.google.gwt.i18n.I18N"/> <inherits name="com.google.gwt.resources.Resources" /> <entry-point class="com.redspr.redquerybuilder.core.RedQueryBuilder" /> <!-- extend-property name="locale" values="en_GB"/ --> <source path="" > <include name="com/redspr/**" /> <include name="java/sql/**" /> <include name="java/math/**" /> </source> </module> ## Instruction: Remove entry point for library module. ## Code After: <module> <inherits name="com.google.gwt.user.User" /> <inherits name="com.google.gwt.i18n.I18N"/> <inherits name="com.google.gwt.resources.Resources" /> <source path="" > <include name="com/redspr/**" /> <include name="java/sql/**" /> <include name="java/math/**" /> </source> </module>
<module> <inherits name="com.google.gwt.user.User" /> <inherits name="com.google.gwt.i18n.I18N"/> <inherits name="com.google.gwt.resources.Resources" /> - - <entry-point class="com.redspr.redquerybuilder.core.RedQueryBuilder" /> - - <!-- extend-property name="locale" values="en_GB"/ --> <source path="" > <include name="com/redspr/**" /> <include name="java/sql/**" /> <include name="java/math/**" /> </source> </module>
4
0.25
0
4
29117d55706c2f93565cc7bbe61d4fa5739a05ec
shell/common/source/functions/functions_erlang.sh
shell/common/source/functions/functions_erlang.sh
download_erlang_mk() { local erlangMkUrl="https://erlang.mk/erlang.mk" log_info "Downloading Erlang project Make template" curl -sSLO "${erlangMkUrl}" } # Turn the current working directory into an Erlang project. bootstrap_erlang_project() { local erlangMkFile="erlang.mk" if [ ! -f "${erlangMkFile}" ]; then download_erlang_mk fi log_info "Bootstrapping new Erlang project" make -f "${erlangMkFile}" bootstrap bootstrap-rel } # vim:foldenable:foldmethod=indent:foldnestmax=1
download_erlang_mk() { local erlangMkUrl="https://erlang.mk/erlang.mk" log_info "Downloading Erlang project Make template" curl -sSLO "${erlangMkUrl}" } # Turn the current working directory into an Erlang project. bootstrap_erlang_project() { local erlangMkFile="erlang.mk" if [ ! -f "${erlangMkFile}" ]; then download_erlang_mk fi log_info "Bootstrapping new Erlang project" make -f "${erlangMkFile}" bootstrap bootstrap-rel } # Install the Erlang language server. install_erlang_ls() { local erlangLsGitRepoUrl="https://github.com/erlang-ls/erlang_ls.git" local erlangLsDest="${WS:-${HOME}/workspace}/erlang_ls" # The directory containing the "bin/" directory where the erlang_ls executable # script will be installed. local installPrefix="${HOME}/.local" if [ -d "${erlangLsDest}" ]; then log_info "Updating erlang_ls" git -C "${erlangLsDest}" clean -df git -C "${erlangLsDest}" restore --staged . git -C "${erlangLsDest}" restore . git -C "${erlangLsDest}" pull else log_info "Cloning erlang_ls" git clone "${erlangLsGitRepoUrl}" "${erlangLsDest}" fi log_info "Installing erlang_ls" mkdir -p "${installPrefix}" ( cd "${erlangLsDest}" make PREFIX="${installPrefix}" make -e install ) } # vim:foldenable:foldmethod=indent:foldnestmax=1
Add func to install erlang_ls
Add func to install erlang_ls
Shell
mit
tjtrabue/dotfiles,tjtrabue/dotfiles,tjtrabue/dotfiles,tjtrabue/dotfiles,tjtrabue/dotfiles
shell
## Code Before: download_erlang_mk() { local erlangMkUrl="https://erlang.mk/erlang.mk" log_info "Downloading Erlang project Make template" curl -sSLO "${erlangMkUrl}" } # Turn the current working directory into an Erlang project. bootstrap_erlang_project() { local erlangMkFile="erlang.mk" if [ ! -f "${erlangMkFile}" ]; then download_erlang_mk fi log_info "Bootstrapping new Erlang project" make -f "${erlangMkFile}" bootstrap bootstrap-rel } # vim:foldenable:foldmethod=indent:foldnestmax=1 ## Instruction: Add func to install erlang_ls ## Code After: download_erlang_mk() { local erlangMkUrl="https://erlang.mk/erlang.mk" log_info "Downloading Erlang project Make template" curl -sSLO "${erlangMkUrl}" } # Turn the current working directory into an Erlang project. bootstrap_erlang_project() { local erlangMkFile="erlang.mk" if [ ! -f "${erlangMkFile}" ]; then download_erlang_mk fi log_info "Bootstrapping new Erlang project" make -f "${erlangMkFile}" bootstrap bootstrap-rel } # Install the Erlang language server. install_erlang_ls() { local erlangLsGitRepoUrl="https://github.com/erlang-ls/erlang_ls.git" local erlangLsDest="${WS:-${HOME}/workspace}/erlang_ls" # The directory containing the "bin/" directory where the erlang_ls executable # script will be installed. local installPrefix="${HOME}/.local" if [ -d "${erlangLsDest}" ]; then log_info "Updating erlang_ls" git -C "${erlangLsDest}" clean -df git -C "${erlangLsDest}" restore --staged . git -C "${erlangLsDest}" restore . git -C "${erlangLsDest}" pull else log_info "Cloning erlang_ls" git clone "${erlangLsGitRepoUrl}" "${erlangLsDest}" fi log_info "Installing erlang_ls" mkdir -p "${installPrefix}" ( cd "${erlangLsDest}" make PREFIX="${installPrefix}" make -e install ) } # vim:foldenable:foldmethod=indent:foldnestmax=1
download_erlang_mk() { local erlangMkUrl="https://erlang.mk/erlang.mk" log_info "Downloading Erlang project Make template" curl -sSLO "${erlangMkUrl}" } # Turn the current working directory into an Erlang project. bootstrap_erlang_project() { local erlangMkFile="erlang.mk" if [ ! -f "${erlangMkFile}" ]; then download_erlang_mk fi log_info "Bootstrapping new Erlang project" make -f "${erlangMkFile}" bootstrap bootstrap-rel } + # Install the Erlang language server. + install_erlang_ls() { + local erlangLsGitRepoUrl="https://github.com/erlang-ls/erlang_ls.git" + local erlangLsDest="${WS:-${HOME}/workspace}/erlang_ls" + # The directory containing the "bin/" directory where the erlang_ls executable + # script will be installed. + local installPrefix="${HOME}/.local" + + if [ -d "${erlangLsDest}" ]; then + log_info "Updating erlang_ls" + git -C "${erlangLsDest}" clean -df + git -C "${erlangLsDest}" restore --staged . + git -C "${erlangLsDest}" restore . + git -C "${erlangLsDest}" pull + else + log_info "Cloning erlang_ls" + git clone "${erlangLsGitRepoUrl}" "${erlangLsDest}" + fi + + log_info "Installing erlang_ls" + mkdir -p "${installPrefix}" + ( + cd "${erlangLsDest}" + make + PREFIX="${installPrefix}" make -e install + ) + } + # vim:foldenable:foldmethod=indent:foldnestmax=1
28
1.4
28
0
348b99d82a330b4f02290587129a24b232b1d432
features/step_definitions/user_submits_comment.rb
features/step_definitions/user_submits_comment.rb
When(/^I visit question page$/) do @question = FactoryGirl.create(:question) visit question_path(@question) end When(/^I fill out the comment form$/) do @comment_body = "#{Faker::Lorem.paragraph} http://bit.ly/example" fill_in 'comment_body', with: @comment_body click_on 'Post comment' end When(/^I fill out the comment form with "(.*?)"$/) do |arg1| @comment_body = arg1 fill_in 'comment_body', with: @comment_body click_on 'Post comment' end Then(/^I should see my comment at the top of the list$/) do expect(page).to have_content(@comment_body) end Then(/^I should not see my comment in the list$/) do expect(page).to_not have_content(@comment_body) end Then(/^I should see my link is autolinked$/) do expect(page).to have_content("<a href=\"http://bit.ly.example\">http://bit.ly.example</a>") end
When(/^I visit question page$/) do @question = FactoryGirl.create(:question) visit question_path(@question) end When(/^I fill out the comment form$/) do @comment_body = Faker::Lorem.paragraph + " http://bit.ly/example" fill_in 'comment_body', with: @comment_body click_on 'Post comment' end When(/^I fill out the comment form with "(.*?)"$/) do |arg1| @comment_body = arg1 fill_in 'comment_body', with: @comment_body click_on 'Post comment' end Then(/^I should see my comment at the top of the list$/) do expect(page).to have_content(@comment_body) end Then(/^I should not see my comment in the list$/) do expect(page).to_not have_content(@comment_body) end Then(/^I should see my link is autolinked$/) do expect(page).to have_link("http://bit.ly/example", :href => "http://bit.ly/example") end
Fix test for linked comment.
Fix test for linked comment.
Ruby
agpl-3.0
scoopmedia/anyquestions,scoopmedia/anyquestions,askaway/askaway,askaway/askaway,scoopmedia/anyquestions,askaway/askaway
ruby
## Code Before: When(/^I visit question page$/) do @question = FactoryGirl.create(:question) visit question_path(@question) end When(/^I fill out the comment form$/) do @comment_body = "#{Faker::Lorem.paragraph} http://bit.ly/example" fill_in 'comment_body', with: @comment_body click_on 'Post comment' end When(/^I fill out the comment form with "(.*?)"$/) do |arg1| @comment_body = arg1 fill_in 'comment_body', with: @comment_body click_on 'Post comment' end Then(/^I should see my comment at the top of the list$/) do expect(page).to have_content(@comment_body) end Then(/^I should not see my comment in the list$/) do expect(page).to_not have_content(@comment_body) end Then(/^I should see my link is autolinked$/) do expect(page).to have_content("<a href=\"http://bit.ly.example\">http://bit.ly.example</a>") end ## Instruction: Fix test for linked comment. ## Code After: When(/^I visit question page$/) do @question = FactoryGirl.create(:question) visit question_path(@question) end When(/^I fill out the comment form$/) do @comment_body = Faker::Lorem.paragraph + " http://bit.ly/example" fill_in 'comment_body', with: @comment_body click_on 'Post comment' end When(/^I fill out the comment form with "(.*?)"$/) do |arg1| @comment_body = arg1 fill_in 'comment_body', with: @comment_body click_on 'Post comment' end Then(/^I should see my comment at the top of the list$/) do expect(page).to have_content(@comment_body) end Then(/^I should not see my comment in the list$/) do expect(page).to_not have_content(@comment_body) end Then(/^I should see my link is autolinked$/) do expect(page).to have_link("http://bit.ly/example", :href => "http://bit.ly/example") end
When(/^I visit question page$/) do @question = FactoryGirl.create(:question) visit question_path(@question) end When(/^I fill out the comment form$/) do - @comment_body = "#{Faker::Lorem.paragraph} http://bit.ly/example" ? --- ^ + @comment_body = Faker::Lorem.paragraph + " http://bit.ly/example" ? ^^^^ fill_in 'comment_body', with: @comment_body click_on 'Post comment' end When(/^I fill out the comment form with "(.*?)"$/) do |arg1| @comment_body = arg1 fill_in 'comment_body', with: @comment_body click_on 'Post comment' end Then(/^I should see my comment at the top of the list$/) do expect(page).to have_content(@comment_body) end Then(/^I should not see my comment in the list$/) do expect(page).to_not have_content(@comment_body) end Then(/^I should see my link is autolinked$/) do - expect(page).to have_content("<a href=\"http://bit.ly.example\">http://bit.ly.example</a>") ? ^^ ^^^^ ---------- ^ - ^ ---- + expect(page).to have_link("http://bit.ly/example", :href => "http://bit.ly/example") ? ^^ ^ ^ +++++++++ ++ ^ end
4
0.142857
2
2
6480a810b66a437ac716eb164c20f5bcc97d0934
src/handlers/admin.py
src/handlers/admin.py
from flask.ext.admin import Admin from flask.ext.admin.contrib.sqla import ModelView import db.schema as schema import db.query as query from handlers.rest import app admin = Admin(app, url="/admin") class RoundModelView(ModelView): def __init__(self, name=None, category=None, endpoint=None, url=None, **kwargs): for k, v in kwargs.iteritems(): setattr(self, k, v) super(RoundModelView, self).__init__( schema.Round, query.session, name=name, category=category, endpoint=endpoint, url=url ) class PerspectiveModelView(ModelView): form_columns = \ ('gender', 'text') def __init__(self, name=None, category=None, endpoint=None, url=None, **kwargs): for k, v in kwargs.iteritems(): setattr(self, k, v) super(PerspectiveModelView, self).__init__( schema.Perspective, query.session, name=name, category=category, endpoint=endpoint, url=url ) admin.add_view(RoundModelView()) admin.add_view(PerspectiveModelView()) admin.add_view(ModelView(schema.Submission, query.session))
from flask.ext.admin import Admin from flask.ext.admin.contrib.sqla import ModelView import db.schema as schema import db.query as query from handlers.rest import app admin = Admin(app, url="/admin") class RoundModelView(ModelView): column_list = ('id', 'perspective', 'start_time') def __init__(self, name=None, category=None, endpoint=None, url=None, **kwargs): for k, v in kwargs.iteritems(): setattr(self, k, v) super(RoundModelView, self).__init__( schema.Round, query.session, name=name, category=category, endpoint=endpoint, url=url ) class PerspectiveModelView(ModelView): form_columns = \ ('gender', 'text') column_list = ('id', 'gender', 'text', 'created_at') def __init__(self, name=None, category=None, endpoint=None, url=None, **kwargs): for k, v in kwargs.iteritems(): setattr(self, k, v) super(PerspectiveModelView, self).__init__( schema.Perspective, query.session, name=name, category=category, endpoint=endpoint, url=url ) class SubmissionModelView(ModelView): column_list = ('id', 'perspective_id', 'text', 'likes', 'created_at') def __init__(self, name=None, category=None, endpoint=None, url=None, **kwargs): for k, v in kwargs.iteritems(): setattr(self, k, v) super(SubmissionModelView, self).__init__( schema.Submission, query.session, name=name, category=category, endpoint=endpoint, url=url ) admin.add_view(RoundModelView()) admin.add_view(PerspectiveModelView()) admin.add_view(SubmissionModelView())
Fix list columns for all models
Fix list columns for all models
Python
apache-2.0
pascalc/narrative-roulette,pascalc/narrative-roulette
python
## Code Before: from flask.ext.admin import Admin from flask.ext.admin.contrib.sqla import ModelView import db.schema as schema import db.query as query from handlers.rest import app admin = Admin(app, url="/admin") class RoundModelView(ModelView): def __init__(self, name=None, category=None, endpoint=None, url=None, **kwargs): for k, v in kwargs.iteritems(): setattr(self, k, v) super(RoundModelView, self).__init__( schema.Round, query.session, name=name, category=category, endpoint=endpoint, url=url ) class PerspectiveModelView(ModelView): form_columns = \ ('gender', 'text') def __init__(self, name=None, category=None, endpoint=None, url=None, **kwargs): for k, v in kwargs.iteritems(): setattr(self, k, v) super(PerspectiveModelView, self).__init__( schema.Perspective, query.session, name=name, category=category, endpoint=endpoint, url=url ) admin.add_view(RoundModelView()) admin.add_view(PerspectiveModelView()) admin.add_view(ModelView(schema.Submission, query.session)) ## Instruction: Fix list columns for all models ## Code After: from flask.ext.admin import Admin from flask.ext.admin.contrib.sqla import ModelView import db.schema as schema import db.query as query from handlers.rest import app admin = Admin(app, url="/admin") class RoundModelView(ModelView): column_list = ('id', 'perspective', 'start_time') def __init__(self, name=None, category=None, endpoint=None, url=None, **kwargs): for k, v in kwargs.iteritems(): setattr(self, k, v) super(RoundModelView, self).__init__( schema.Round, query.session, name=name, category=category, endpoint=endpoint, url=url ) class PerspectiveModelView(ModelView): form_columns = \ ('gender', 'text') column_list = ('id', 'gender', 'text', 'created_at') def __init__(self, name=None, category=None, endpoint=None, url=None, **kwargs): for k, v in kwargs.iteritems(): setattr(self, k, v) super(PerspectiveModelView, self).__init__( schema.Perspective, query.session, name=name, category=category, endpoint=endpoint, url=url ) class SubmissionModelView(ModelView): column_list = ('id', 'perspective_id', 'text', 'likes', 'created_at') def __init__(self, name=None, category=None, endpoint=None, url=None, **kwargs): for k, v in kwargs.iteritems(): setattr(self, k, v) super(SubmissionModelView, self).__init__( schema.Submission, query.session, name=name, category=category, endpoint=endpoint, url=url ) admin.add_view(RoundModelView()) admin.add_view(PerspectiveModelView()) admin.add_view(SubmissionModelView())
from flask.ext.admin import Admin from flask.ext.admin.contrib.sqla import ModelView import db.schema as schema import db.query as query from handlers.rest import app admin = Admin(app, url="/admin") class RoundModelView(ModelView): + column_list = ('id', 'perspective', 'start_time') def __init__(self, name=None, category=None, endpoint=None, url=None, **kwargs): for k, v in kwargs.iteritems(): setattr(self, k, v) super(RoundModelView, self).__init__( schema.Round, query.session, name=name, category=category, endpoint=endpoint, url=url ) class PerspectiveModelView(ModelView): form_columns = \ ('gender', 'text') + column_list = ('id', 'gender', 'text', 'created_at') + def __init__(self, name=None, category=None, endpoint=None, url=None, **kwargs): for k, v in kwargs.iteritems(): setattr(self, k, v) super(PerspectiveModelView, self).__init__( schema.Perspective, query.session, name=name, category=category, endpoint=endpoint, url=url ) + class SubmissionModelView(ModelView): + column_list = ('id', 'perspective_id', 'text', 'likes', 'created_at') + def __init__(self, name=None, category=None, endpoint=None, url=None, **kwargs): + for k, v in kwargs.iteritems(): + setattr(self, k, v) + + super(SubmissionModelView, self).__init__( + schema.Submission, + query.session, + name=name, + category=category, + endpoint=endpoint, + url=url + ) + admin.add_view(RoundModelView()) admin.add_view(PerspectiveModelView()) - admin.add_view(ModelView(schema.Submission, query.session)) + admin.add_view(SubmissionModelView())
20
0.454545
19
1
389f2bb0ef1daee91ecef918127bde2c77b43575
lib/jdomodels/src/main/resources/schema/Changes-ddl.sql
lib/jdomodels/src/main/resources/schema/Changes-ddl.sql
CREATE TABLE `CHANGES` ( `CHANGE_NUM` bigint(20) NOT NULL AUTO_INCREMENT, `TIME_STAMP` TIMESTAMP NOT NULL, `OBJECT_ID` bigint(20) NOT NULL, `PARENT_ID` bigint(20) DEFAULT NULL, `OBJECT_TYPE` ENUM('ENTITY', 'PRINCIPAL', 'ACTIVITY', 'COMPETITION', 'SUBMISSION', 'FILE', 'WIKI') NOT NULL, `OBJECT_ETAG` char(36) DEFAULT NULL, `CHANGE_TYPE` ENUM('CREATE','UPDATE','DELETE'), PRIMARY KEY (`CHANGE_NUM`) )
CREATE TABLE `CHANGES` ( `CHANGE_NUM` bigint(20) NOT NULL AUTO_INCREMENT, `TIME_STAMP` TIMESTAMP NOT NULL, `OBJECT_ID` bigint(20) NOT NULL, `PARENT_ID` bigint(20) DEFAULT NULL, `OBJECT_TYPE` ENUM('ENTITY', 'PRINCIPAL', 'ACTIVITY', 'COMPETITION', 'SUBMISSION', 'FILE', 'WIKI') NOT NULL, `OBJECT_ETAG` char(36) DEFAULT NULL, `CHANGE_TYPE` ENUM('CREATE','UPDATE','DELETE'), PRIMARY KEY (`CHANGE_NUM`), UNIQUE KEY `CHANGES_UKEY_OID_OTYPE` (`OBJECT_ID`, `OBJECT_TYPE`) )
Add covering index for 'select change_num from changes' qry in stack migrator
Add covering index for 'select change_num from changes' qry in stack migrator
SQL
apache-2.0
hhu94/Synapse-Repository-Services,Sage-Bionetworks/Synapse-Repository-Services,zimingd/Synapse-Repository-Services,zimingd/Synapse-Repository-Services,xschildw/Synapse-Repository-Services,zimingd/Synapse-Repository-Services,xschildw/Synapse-Repository-Services,zimingd/Synapse-Repository-Services,Sage-Bionetworks/Synapse-Repository-Services,Sage-Bionetworks/Synapse-Repository-Services,hhu94/Synapse-Repository-Services,hhu94/Synapse-Repository-Services,xschildw/Synapse-Repository-Services,Sage-Bionetworks/Synapse-Repository-Services,xschildw/Synapse-Repository-Services,hhu94/Synapse-Repository-Services
sql
## Code Before: CREATE TABLE `CHANGES` ( `CHANGE_NUM` bigint(20) NOT NULL AUTO_INCREMENT, `TIME_STAMP` TIMESTAMP NOT NULL, `OBJECT_ID` bigint(20) NOT NULL, `PARENT_ID` bigint(20) DEFAULT NULL, `OBJECT_TYPE` ENUM('ENTITY', 'PRINCIPAL', 'ACTIVITY', 'COMPETITION', 'SUBMISSION', 'FILE', 'WIKI') NOT NULL, `OBJECT_ETAG` char(36) DEFAULT NULL, `CHANGE_TYPE` ENUM('CREATE','UPDATE','DELETE'), PRIMARY KEY (`CHANGE_NUM`) ) ## Instruction: Add covering index for 'select change_num from changes' qry in stack migrator ## Code After: CREATE TABLE `CHANGES` ( `CHANGE_NUM` bigint(20) NOT NULL AUTO_INCREMENT, `TIME_STAMP` TIMESTAMP NOT NULL, `OBJECT_ID` bigint(20) NOT NULL, `PARENT_ID` bigint(20) DEFAULT NULL, `OBJECT_TYPE` ENUM('ENTITY', 'PRINCIPAL', 'ACTIVITY', 'COMPETITION', 'SUBMISSION', 'FILE', 'WIKI') NOT NULL, `OBJECT_ETAG` char(36) DEFAULT NULL, `CHANGE_TYPE` ENUM('CREATE','UPDATE','DELETE'), PRIMARY KEY (`CHANGE_NUM`), UNIQUE KEY `CHANGES_UKEY_OID_OTYPE` (`OBJECT_ID`, `OBJECT_TYPE`) )
CREATE TABLE `CHANGES` ( `CHANGE_NUM` bigint(20) NOT NULL AUTO_INCREMENT, `TIME_STAMP` TIMESTAMP NOT NULL, `OBJECT_ID` bigint(20) NOT NULL, `PARENT_ID` bigint(20) DEFAULT NULL, `OBJECT_TYPE` ENUM('ENTITY', 'PRINCIPAL', 'ACTIVITY', 'COMPETITION', 'SUBMISSION', 'FILE', 'WIKI') NOT NULL, `OBJECT_ETAG` char(36) DEFAULT NULL, `CHANGE_TYPE` ENUM('CREATE','UPDATE','DELETE'), - PRIMARY KEY (`CHANGE_NUM`) + PRIMARY KEY (`CHANGE_NUM`), ? + + UNIQUE KEY `CHANGES_UKEY_OID_OTYPE` (`OBJECT_ID`, `OBJECT_TYPE`) )
3
0.3
2
1
1641027af57d03542b017abcf936624761af2a83
index.html
index.html
<!doctype> <html> <head> <meta charset='utf-8'> <title>Daejeon programming</title> </head> <body> <p>Hello World!</p> <a href='members'>members</a> </body> </html>
<!doctype> <html> <head> <meta charset='utf-8'> <title>Daejeon programming</title> <link rel='stylesheet' type='text/css' href='globalStyle.css'> </head> <body> <div id='stickyFooter'> <header> <h1>Daejeon Programming</h1> </header> <div id='middleWrapper'> <nav> <h2>Navigation</h2> <ul> <li><a href='members'>members</a></li> </ul> <h2>Links</h2> <ul> <li>Meetup: <a href='https://www.meetup.com/Daejeon-Programming-Meetup/'>meetup.com/Daejeon-Programming-Meetup</a></li> <li>Github: <a href='https://github.com/orgs/Daejeon-Programming/'>github.com/orgs/Daejeon-Programming</a></li> <li>Reddit: <a href='https://www.reddit.com/r/daejeon_programmers/'>reddit.com/r/daejeon_programmers</a> </li> <li>Discord: <a href='https://discordapp.com/channels/305671841475723265/305697516043632642'>discordapp.com/channels/(...)</a></li> </ul> </nav> <div class='wrapperForMiddleWrapper'> <article> <h2>Introduction</h2> Daejeon programming is a newborn group of programmers and people interrested in programming living in Daejeon. Feel free to join us on the web or in real life (you will find infos about the meeting on the meetup group). </article> <article> <h2>But why these flashy colors</h2> For this first trial at making an elegant design for this website we just used the "It's Daejeon" flag colors witout giving it too much thought... </article> </div> </div> </div> <footer>Footer</footer> </body> </html>
Add some content to make the CSS visible
Add some content to make the CSS visible
HTML
unlicense
Daejeon-Programming/Daejeon-Programming.github.io,Daejeon-Programming/Daejeon-Programming.github.io
html
## Code Before: <!doctype> <html> <head> <meta charset='utf-8'> <title>Daejeon programming</title> </head> <body> <p>Hello World!</p> <a href='members'>members</a> </body> </html> ## Instruction: Add some content to make the CSS visible ## Code After: <!doctype> <html> <head> <meta charset='utf-8'> <title>Daejeon programming</title> <link rel='stylesheet' type='text/css' href='globalStyle.css'> </head> <body> <div id='stickyFooter'> <header> <h1>Daejeon Programming</h1> </header> <div id='middleWrapper'> <nav> <h2>Navigation</h2> <ul> <li><a href='members'>members</a></li> </ul> <h2>Links</h2> <ul> <li>Meetup: <a href='https://www.meetup.com/Daejeon-Programming-Meetup/'>meetup.com/Daejeon-Programming-Meetup</a></li> <li>Github: <a href='https://github.com/orgs/Daejeon-Programming/'>github.com/orgs/Daejeon-Programming</a></li> <li>Reddit: <a href='https://www.reddit.com/r/daejeon_programmers/'>reddit.com/r/daejeon_programmers</a> </li> <li>Discord: <a href='https://discordapp.com/channels/305671841475723265/305697516043632642'>discordapp.com/channels/(...)</a></li> </ul> </nav> <div class='wrapperForMiddleWrapper'> <article> <h2>Introduction</h2> Daejeon programming is a newborn group of programmers and people interrested in programming living in Daejeon. Feel free to join us on the web or in real life (you will find infos about the meeting on the meetup group). </article> <article> <h2>But why these flashy colors</h2> For this first trial at making an elegant design for this website we just used the "It's Daejeon" flag colors witout giving it too much thought... </article> </div> </div> </div> <footer>Footer</footer> </body> </html>
<!doctype> <html> <head> <meta charset='utf-8'> <title>Daejeon programming</title> + <link rel='stylesheet' type='text/css' href='globalStyle.css'> </head> <body> - <p>Hello World!</p> + <div id='stickyFooter'> + <header> + <h1>Daejeon Programming</h1> + </header> + <div id='middleWrapper'> + <nav> + <h2>Navigation</h2> + <ul> - <a href='members'>members</a> + <li><a href='members'>members</a></li> ? ++++++++++++ +++++ + </ul> + <h2>Links</h2> + <ul> + <li>Meetup: <a href='https://www.meetup.com/Daejeon-Programming-Meetup/'>meetup.com/Daejeon-Programming-Meetup</a></li> + <li>Github: <a href='https://github.com/orgs/Daejeon-Programming/'>github.com/orgs/Daejeon-Programming</a></li> + <li>Reddit: <a href='https://www.reddit.com/r/daejeon_programmers/'>reddit.com/r/daejeon_programmers</a> + </li> + <li>Discord: <a href='https://discordapp.com/channels/305671841475723265/305697516043632642'>discordapp.com/channels/(...)</a></li> + </ul> + </nav> + <div class='wrapperForMiddleWrapper'> + <article> + <h2>Introduction</h2> + Daejeon programming is a newborn group of programmers and people interrested in programming living in Daejeon. Feel free to join us on the web or in real life (you will find infos about the meeting on the meetup group). + </article> + <article> + <h2>But why these flashy colors</h2> + For this first trial at making an elegant design for this website we just used the "It's Daejeon" flag colors witout giving it too much thought... + </article> + </div> + + </div> + </div> + <footer>Footer</footer> </body> </html>
36
2.571429
34
2
c3c84614b84db97d19b2a8c7bcc499e6ed3bc435
config/motd.txt
config/motd.txt
<h1>Welcome to Baystation 12!</h1> -<i>This server is running <a href="http://baystation12.net/">Baystation 12's</a> modification of the <a href="http://nanotrasen.com/">/tg/station13</a> SS13 code.</i> <br><br> <strong>Bugtracker:</strong> <a href="https://github.com/Baystation12/Baystation12/issues">https://github.com/Baystation12/Baystation12/issues</a> <br> <strong>Rules and roleplaying tips:</strong> <a href="http://baystation12.net/wiki/index.php/Rules">http://baystation12.net/wiki/index.php/Rules</a> or the Rules command. <br><br> This is a roleplaying server, so don't forget to remain in character while playing. Make sure to read and abide by the rules and if you have any questions, feel free to adminhelp! Remember that even when there are no admins on, adminhelps are being sent to IRC and it is possible for an administrator to see it and respond.
<h1>Welcome to Baystation 12!</h1> -<i>This server is running <a href="http://baystation12.net/">Baystation 12's</a> modification of the <a href="http://nanotrasen.com/">/tg/station13</a> SS13 code.</i> <br><br> <strong>Bugtracker:</strong> <a href="http://baystation12.net/forums/viewtopic.php?f=18&t=8185">http://baystation12.net/forums/viewtopic.php?f=18&t=8185</a> <br> <strong>Rules and roleplaying tips:</strong> <a href="http://baystation12.net/wiki/index.php/Rules">http://baystation12.net/wiki/index.php/Rules</a> or the Rules command. <br><br> This is a roleplaying server, so don't forget to remain in character while playing. Make sure to read and abide by the rules and if you have any questions, feel free to adminhelp! Remember that even when there are no admins on, adminhelps are being sent to IRC and it is possible for an administrator to see it and respond.
Update MOTD for new bugtracker link.
Update MOTD for new bugtracker link. Signed-off-by: Mloc-Argent <35d3be2bcaf6c8e9bf91340f3e1456527c7ef7ea@gmail.com>
Text
agpl-3.0
ZomgPonies/Paradise64,ZomgPonies/Paradise64,ZomgPonies/Paradise64,ZomgPonies/Paradise64,ZomgPonies/Paradise64,ZomgPonies/Paradise64
text
## Code Before: <h1>Welcome to Baystation 12!</h1> -<i>This server is running <a href="http://baystation12.net/">Baystation 12's</a> modification of the <a href="http://nanotrasen.com/">/tg/station13</a> SS13 code.</i> <br><br> <strong>Bugtracker:</strong> <a href="https://github.com/Baystation12/Baystation12/issues">https://github.com/Baystation12/Baystation12/issues</a> <br> <strong>Rules and roleplaying tips:</strong> <a href="http://baystation12.net/wiki/index.php/Rules">http://baystation12.net/wiki/index.php/Rules</a> or the Rules command. <br><br> This is a roleplaying server, so don't forget to remain in character while playing. Make sure to read and abide by the rules and if you have any questions, feel free to adminhelp! Remember that even when there are no admins on, adminhelps are being sent to IRC and it is possible for an administrator to see it and respond. ## Instruction: Update MOTD for new bugtracker link. Signed-off-by: Mloc-Argent <35d3be2bcaf6c8e9bf91340f3e1456527c7ef7ea@gmail.com> ## Code After: <h1>Welcome to Baystation 12!</h1> -<i>This server is running <a href="http://baystation12.net/">Baystation 12's</a> modification of the <a href="http://nanotrasen.com/">/tg/station13</a> SS13 code.</i> <br><br> <strong>Bugtracker:</strong> <a href="http://baystation12.net/forums/viewtopic.php?f=18&t=8185">http://baystation12.net/forums/viewtopic.php?f=18&t=8185</a> <br> <strong>Rules and roleplaying tips:</strong> <a href="http://baystation12.net/wiki/index.php/Rules">http://baystation12.net/wiki/index.php/Rules</a> or the Rules command. <br><br> This is a roleplaying server, so don't forget to remain in character while playing. Make sure to read and abide by the rules and if you have any questions, feel free to adminhelp! Remember that even when there are no admins on, adminhelps are being sent to IRC and it is possible for an administrator to see it and respond.
<h1>Welcome to Baystation 12!</h1> -<i>This server is running <a href="http://baystation12.net/">Baystation 12's</a> modification of the <a href="http://nanotrasen.com/">/tg/station13</a> SS13 code.</i> <br><br> - <strong>Bugtracker:</strong> <a href="https://github.com/Baystation12/Baystation12/issues">https://github.com/Baystation12/Baystation12/issues</a> + <strong>Bugtracker:</strong> <a href="http://baystation12.net/forums/viewtopic.php?f=18&t=8185">http://baystation12.net/forums/viewtopic.php?f=18&t=8185</a> <br> <strong>Rules and roleplaying tips:</strong> <a href="http://baystation12.net/wiki/index.php/Rules">http://baystation12.net/wiki/index.php/Rules</a> or the Rules command. <br><br> This is a roleplaying server, so don't forget to remain in character while playing. Make sure to read and abide by the rules and if you have any questions, feel free to adminhelp! Remember that even when there are no admins on, adminhelps are being sent to IRC and it is possible for an administrator to see it and respond.
2
0.222222
1
1
6f5bf0246c98ff98cf73652ad2e4a4a096a00e6e
partials/footer-content.php
partials/footer-content.php
<footer> <div class="container"> <div class="row"> <div class="column-1-4"> <div class="footer-div"> <h2 class="orange-border">FOCUS</h2> <ul> <li><a href="/contact.php">Contact Us</a></li> <li><a href="https://github.com/scveglug">Source Code</a></li> </ul> </div> </div> <div class="column-1-4"> <div class="footer-div"> <h2 class="gray-border">Free Software</h2> <ul> <li><a href="http://www.fsmk.org/">Free Software Movement Karnataka</a></li> </ul> </div> </div> <div class="column-1-4"> <div class="footer-div"> <h2 class="gray-border">Other GLUG</h2> <ul> <li><a href="http://pluginatpes.wordpress.com/">PLUGIN</a></li> <li><a href="http://draitglug.wordpress.com/">Dr. AIT GLUG</a></li> <li><a href="http://glugpesce.blogspot.in/">PESCE GLUG</a></li> <li><a href="http://gluegechassan.wordpress.com/">GLUE</a></li> <li><a href="http://paceglug.blogspot.in/">PACE GLUG</a></li> </ul> </div> </div> <div class="column-1-4"> <div class="footer-div"> <h2 class="gray-border">Creative Commons</h2> </div> </div> </div> </div> </footer>
<footer> <div class="container"> <div class="row"> <div class="column-1-4"> <div class="footer-div"> <h2 class="orange-border">FOCUS</h2> <ul> <li><a href="/contact.php">Contact Us</a></li> <li><a href="https://github.com/scveglug">Source Code</a></li> </ul> </div> </div> <div class="column-1-4"> <div class="footer-div"> <h2 class="gray-border">Free Software</h2> <ul> <li><a href="http://www.fsmk.org/">Free Software Movement Karnataka</a></li> </ul> </div> </div> <div class="column-1-4"> <div class="footer-div"> <h2 class="gray-border">Creative Commons</h2> </div> </div> </div> </div> </footer>
Remove other glug links in footer
Remove other glug links in footer
PHP
cc0-1.0
svceglug/focus,svceglug/focus
php
## Code Before: <footer> <div class="container"> <div class="row"> <div class="column-1-4"> <div class="footer-div"> <h2 class="orange-border">FOCUS</h2> <ul> <li><a href="/contact.php">Contact Us</a></li> <li><a href="https://github.com/scveglug">Source Code</a></li> </ul> </div> </div> <div class="column-1-4"> <div class="footer-div"> <h2 class="gray-border">Free Software</h2> <ul> <li><a href="http://www.fsmk.org/">Free Software Movement Karnataka</a></li> </ul> </div> </div> <div class="column-1-4"> <div class="footer-div"> <h2 class="gray-border">Other GLUG</h2> <ul> <li><a href="http://pluginatpes.wordpress.com/">PLUGIN</a></li> <li><a href="http://draitglug.wordpress.com/">Dr. AIT GLUG</a></li> <li><a href="http://glugpesce.blogspot.in/">PESCE GLUG</a></li> <li><a href="http://gluegechassan.wordpress.com/">GLUE</a></li> <li><a href="http://paceglug.blogspot.in/">PACE GLUG</a></li> </ul> </div> </div> <div class="column-1-4"> <div class="footer-div"> <h2 class="gray-border">Creative Commons</h2> </div> </div> </div> </div> </footer> ## Instruction: Remove other glug links in footer ## Code After: <footer> <div class="container"> <div class="row"> <div class="column-1-4"> <div class="footer-div"> <h2 class="orange-border">FOCUS</h2> <ul> <li><a href="/contact.php">Contact Us</a></li> <li><a href="https://github.com/scveglug">Source Code</a></li> </ul> </div> </div> <div class="column-1-4"> <div class="footer-div"> <h2 class="gray-border">Free Software</h2> <ul> <li><a href="http://www.fsmk.org/">Free Software Movement Karnataka</a></li> </ul> </div> </div> <div class="column-1-4"> <div class="footer-div"> <h2 class="gray-border">Creative Commons</h2> </div> </div> </div> </div> </footer>
<footer> <div class="container"> <div class="row"> <div class="column-1-4"> <div class="footer-div"> <h2 class="orange-border">FOCUS</h2> <ul> <li><a href="/contact.php">Contact Us</a></li> <li><a href="https://github.com/scveglug">Source Code</a></li> </ul> </div> </div> <div class="column-1-4"> <div class="footer-div"> <h2 class="gray-border">Free Software</h2> <ul> <li><a href="http://www.fsmk.org/">Free Software Movement Karnataka</a></li> </ul> </div> </div> <div class="column-1-4"> <div class="footer-div"> - <h2 class="gray-border">Other GLUG</h2> - <ul> - <li><a href="http://pluginatpes.wordpress.com/">PLUGIN</a></li> - <li><a href="http://draitglug.wordpress.com/">Dr. AIT GLUG</a></li> - <li><a href="http://glugpesce.blogspot.in/">PESCE GLUG</a></li> - <li><a href="http://gluegechassan.wordpress.com/">GLUE</a></li> - <li><a href="http://paceglug.blogspot.in/">PACE GLUG</a></li> - </ul> - </div> - </div> - <div class="column-1-4"> - <div class="footer-div"> <h2 class="gray-border">Creative Commons</h2> </div> </div> </div> </div> </footer>
12
0.3
0
12
2e6cd584aa5f078ce6e97c661a9c137bfd04a011
src/Api/Serializer/MailSettingsSerializer.php
src/Api/Serializer/MailSettingsSerializer.php
<?php /* * This file is part of Flarum. * * For detailed copyright and license information, please view the * LICENSE file that was distributed with this source code. */ namespace Flarum\Api\Serializer; use Flarum\Mail\DriverInterface; use InvalidArgumentException; class MailSettingsSerializer extends AbstractSerializer { /** * {@inheritdoc} */ protected $type = 'mail-settings'; /** * {@inheritdoc} * * @param array $settings * @throws InvalidArgumentException */ protected function getDefaultAttributes($settings) { return [ 'fields' => array_map([$this, 'serializeDriver'], $settings['drivers']), 'sending' => $settings['sending'], 'errors' => $settings['errors'], ]; } private function serializeDriver(DriverInterface $driver) { $settings = $driver->availableSettings(); if (key($settings) === 0) { // BACKWARDS COMPATIBILITY: Support a simple list of fields (without // type or additional metadata). // Turns ["f1", "f2"] into {"f1": "", "f2": ""} // @deprecated since 0.1.0-beta.12 $settings = array_reduce($settings, function ($memo, $key) { return [$key => ''] + $memo; }, []); } return $settings; } public function getId($model) { return 'global'; } }
<?php /* * This file is part of Flarum. * * For detailed copyright and license information, please view the * LICENSE file that was distributed with this source code. */ namespace Flarum\Api\Serializer; use Flarum\Mail\DriverInterface; use InvalidArgumentException; class MailSettingsSerializer extends AbstractSerializer { /** * {@inheritdoc} */ protected $type = 'mail-settings'; /** * {@inheritdoc} * * @param array $settings * @throws InvalidArgumentException */ protected function getDefaultAttributes($settings) { return [ 'fields' => array_map([$this, 'serializeDriver'], $settings['drivers']), 'sending' => $settings['sending'], 'errors' => $settings['errors'], ]; } private function serializeDriver(DriverInterface $driver) { return $driver->availableSettings(); } public function getId($model) { return 'global'; } }
Remove mail settings backwards compatibility layer
Remove mail settings backwards compatibility layer
PHP
mit
flarum/core,flarum/core,flarum/core
php
## Code Before: <?php /* * This file is part of Flarum. * * For detailed copyright and license information, please view the * LICENSE file that was distributed with this source code. */ namespace Flarum\Api\Serializer; use Flarum\Mail\DriverInterface; use InvalidArgumentException; class MailSettingsSerializer extends AbstractSerializer { /** * {@inheritdoc} */ protected $type = 'mail-settings'; /** * {@inheritdoc} * * @param array $settings * @throws InvalidArgumentException */ protected function getDefaultAttributes($settings) { return [ 'fields' => array_map([$this, 'serializeDriver'], $settings['drivers']), 'sending' => $settings['sending'], 'errors' => $settings['errors'], ]; } private function serializeDriver(DriverInterface $driver) { $settings = $driver->availableSettings(); if (key($settings) === 0) { // BACKWARDS COMPATIBILITY: Support a simple list of fields (without // type or additional metadata). // Turns ["f1", "f2"] into {"f1": "", "f2": ""} // @deprecated since 0.1.0-beta.12 $settings = array_reduce($settings, function ($memo, $key) { return [$key => ''] + $memo; }, []); } return $settings; } public function getId($model) { return 'global'; } } ## Instruction: Remove mail settings backwards compatibility layer ## Code After: <?php /* * This file is part of Flarum. * * For detailed copyright and license information, please view the * LICENSE file that was distributed with this source code. */ namespace Flarum\Api\Serializer; use Flarum\Mail\DriverInterface; use InvalidArgumentException; class MailSettingsSerializer extends AbstractSerializer { /** * {@inheritdoc} */ protected $type = 'mail-settings'; /** * {@inheritdoc} * * @param array $settings * @throws InvalidArgumentException */ protected function getDefaultAttributes($settings) { return [ 'fields' => array_map([$this, 'serializeDriver'], $settings['drivers']), 'sending' => $settings['sending'], 'errors' => $settings['errors'], ]; } private function serializeDriver(DriverInterface $driver) { return $driver->availableSettings(); } public function getId($model) { return 'global'; } }
<?php /* * This file is part of Flarum. * * For detailed copyright and license information, please view the * LICENSE file that was distributed with this source code. */ namespace Flarum\Api\Serializer; use Flarum\Mail\DriverInterface; use InvalidArgumentException; class MailSettingsSerializer extends AbstractSerializer { /** * {@inheritdoc} */ protected $type = 'mail-settings'; /** * {@inheritdoc} * * @param array $settings * @throws InvalidArgumentException */ protected function getDefaultAttributes($settings) { return [ 'fields' => array_map([$this, 'serializeDriver'], $settings['drivers']), 'sending' => $settings['sending'], 'errors' => $settings['errors'], ]; } private function serializeDriver(DriverInterface $driver) { - $settings = $driver->availableSettings(); ? ^^ ^^ ---- + return $driver->availableSettings(); ? ^ ^^ - - if (key($settings) === 0) { - // BACKWARDS COMPATIBILITY: Support a simple list of fields (without - // type or additional metadata). - // Turns ["f1", "f2"] into {"f1": "", "f2": ""} - // @deprecated since 0.1.0-beta.12 - $settings = array_reduce($settings, function ($memo, $key) { - return [$key => ''] + $memo; - }, []); - } - - return $settings; } public function getId($model) { return 'global'; } }
14
0.241379
1
13
dc882cec2257f17f65325bfec6194aac3b390758
.travis.yml
.travis.yml
language: perl sudo: false addons: apt: packages: - libluajit-5.1-2 - libluajit-5.1-dev env: global: - LUAJIT_LIB=/usr/lib/x86_64-linux-gnu/ - LUAJIT_INC=/usr/include/luajit-2.0/ matrix: - VER_LIBSASS=3.4.9 VER_LUA_NGINX=0.10.15 VER_NGINX=1.12.2 - VER_LIBSASS=3.5.5 VER_LUA_NGINX=0.10.15 VER_NGINX=1.14.2 - VER_LIBSASS=3.6.2 VER_LUA_NGINX=0.10.15 VER_NGINX=1.16.1 - DYNAMIC=true VER_LIBSASS=3.6.2 VER_LUA_NGINX=0.10.15 VER_NGINX=1.16.1 install: cpanm -v --notest Test::Nginx script: ./compile_and_test.sh
language: perl perl: 5.22 sudo: false addons: apt: packages: - libluajit-5.1-2 - libluajit-5.1-dev env: global: - LUAJIT_LIB=/usr/lib/x86_64-linux-gnu/ - LUAJIT_INC=/usr/include/luajit-2.0/ matrix: - VER_LIBSASS=3.4.9 VER_LUA_NGINX=0.10.15 VER_NGINX=1.12.2 - VER_LIBSASS=3.5.5 VER_LUA_NGINX=0.10.15 VER_NGINX=1.14.2 - VER_LIBSASS=3.6.2 VER_LUA_NGINX=0.10.15 VER_NGINX=1.16.1 - DYNAMIC=true VER_LIBSASS=3.6.2 VER_LUA_NGINX=0.10.15 VER_NGINX=1.16.1 install: cpanm -v --notest Test::Nginx script: ./compile_and_test.sh
Use specific Perl version on Travis
Use specific Perl version on Travis
YAML
bsd-2-clause
mneudert/sass-nginx-module,mneudert/sass-nginx-module,mneudert/sass-nginx-module
yaml
## Code Before: language: perl sudo: false addons: apt: packages: - libluajit-5.1-2 - libluajit-5.1-dev env: global: - LUAJIT_LIB=/usr/lib/x86_64-linux-gnu/ - LUAJIT_INC=/usr/include/luajit-2.0/ matrix: - VER_LIBSASS=3.4.9 VER_LUA_NGINX=0.10.15 VER_NGINX=1.12.2 - VER_LIBSASS=3.5.5 VER_LUA_NGINX=0.10.15 VER_NGINX=1.14.2 - VER_LIBSASS=3.6.2 VER_LUA_NGINX=0.10.15 VER_NGINX=1.16.1 - DYNAMIC=true VER_LIBSASS=3.6.2 VER_LUA_NGINX=0.10.15 VER_NGINX=1.16.1 install: cpanm -v --notest Test::Nginx script: ./compile_and_test.sh ## Instruction: Use specific Perl version on Travis ## Code After: language: perl perl: 5.22 sudo: false addons: apt: packages: - libluajit-5.1-2 - libluajit-5.1-dev env: global: - LUAJIT_LIB=/usr/lib/x86_64-linux-gnu/ - LUAJIT_INC=/usr/include/luajit-2.0/ matrix: - VER_LIBSASS=3.4.9 VER_LUA_NGINX=0.10.15 VER_NGINX=1.12.2 - VER_LIBSASS=3.5.5 VER_LUA_NGINX=0.10.15 VER_NGINX=1.14.2 - VER_LIBSASS=3.6.2 VER_LUA_NGINX=0.10.15 VER_NGINX=1.16.1 - DYNAMIC=true VER_LIBSASS=3.6.2 VER_LUA_NGINX=0.10.15 VER_NGINX=1.16.1 install: cpanm -v --notest Test::Nginx script: ./compile_and_test.sh
language: perl + perl: 5.22 sudo: false addons: apt: packages: - libluajit-5.1-2 - libluajit-5.1-dev env: global: - LUAJIT_LIB=/usr/lib/x86_64-linux-gnu/ - LUAJIT_INC=/usr/include/luajit-2.0/ matrix: - VER_LIBSASS=3.4.9 VER_LUA_NGINX=0.10.15 VER_NGINX=1.12.2 - VER_LIBSASS=3.5.5 VER_LUA_NGINX=0.10.15 VER_NGINX=1.14.2 - VER_LIBSASS=3.6.2 VER_LUA_NGINX=0.10.15 VER_NGINX=1.16.1 - DYNAMIC=true VER_LIBSASS=3.6.2 VER_LUA_NGINX=0.10.15 VER_NGINX=1.16.1 install: cpanm -v --notest Test::Nginx script: ./compile_and_test.sh
1
0.047619
1
0
a36c167974b9633afc4525c5ed2f5ecb9659749b
setup_pkgs.sh
setup_pkgs.sh
PKGS=$(cat debian-pkgs | sed -re 's/#.*//g' -e '/^\s*$/d') apt-get update apt-get install $PKGS # PPAs apt-get install software-properties-common # Lollypop music player apt-add-repository -y ppa:gnumdk/lollypop apt-get install lollypop
PKGS=$(cat debian-pkgs | sed -re 's/#.*//g' -e '/^\s*$/d') is_installed() { local pkgname=$1 dpkg -l | grep -q $pkgname } install_if_needed() { local pkgname=$1 if is_installed $pkgname; then echo "Package $pkgname already installed, skipping" else apt-get install $pkgname fi } install_ppa_pkg_if_needed() { local ppa=$1 local pkgname=$2 if $(grep -q "^deb http://ppa.launchpad.net/$ppa" /etc/apt/sources.list.d/*); then echo "PPA $ppa already being used, skipping" else apt-add-repository ppa:$ppa fi install_if_needed $pkgname } apt-get update apt-get install $PKGS # PPAs install_if_needed software-properties-common # Lollypop music player install_ppa_pkg_if_needed gnumdk/lollypop lollypop
Check for existing installation for packages not in debian-pkgs
Check for existing installation for packages not in debian-pkgs
Shell
mit
Technius/dotfiles
shell
## Code Before: PKGS=$(cat debian-pkgs | sed -re 's/#.*//g' -e '/^\s*$/d') apt-get update apt-get install $PKGS # PPAs apt-get install software-properties-common # Lollypop music player apt-add-repository -y ppa:gnumdk/lollypop apt-get install lollypop ## Instruction: Check for existing installation for packages not in debian-pkgs ## Code After: PKGS=$(cat debian-pkgs | sed -re 's/#.*//g' -e '/^\s*$/d') is_installed() { local pkgname=$1 dpkg -l | grep -q $pkgname } install_if_needed() { local pkgname=$1 if is_installed $pkgname; then echo "Package $pkgname already installed, skipping" else apt-get install $pkgname fi } install_ppa_pkg_if_needed() { local ppa=$1 local pkgname=$2 if $(grep -q "^deb http://ppa.launchpad.net/$ppa" /etc/apt/sources.list.d/*); then echo "PPA $ppa already being used, skipping" else apt-add-repository ppa:$ppa fi install_if_needed $pkgname } apt-get update apt-get install $PKGS # PPAs install_if_needed software-properties-common # Lollypop music player install_ppa_pkg_if_needed gnumdk/lollypop lollypop
PKGS=$(cat debian-pkgs | sed -re 's/#.*//g' -e '/^\s*$/d') + + is_installed() { + local pkgname=$1 + dpkg -l | grep -q $pkgname + } + + install_if_needed() { + local pkgname=$1 + if is_installed $pkgname; then + echo "Package $pkgname already installed, skipping" + else + apt-get install $pkgname + fi + } + + install_ppa_pkg_if_needed() { + local ppa=$1 + local pkgname=$2 + if $(grep -q "^deb http://ppa.launchpad.net/$ppa" /etc/apt/sources.list.d/*); then + echo "PPA $ppa already being used, skipping" + else + apt-add-repository ppa:$ppa + fi + install_if_needed $pkgname + } apt-get update apt-get install $PKGS # PPAs - apt-get install software-properties-common ? -------- + install_if_needed software-properties-common ? ++++++++++ # Lollypop music player + install_ppa_pkg_if_needed gnumdk/lollypop lollypop - apt-add-repository -y ppa:gnumdk/lollypop - apt-get install lollypop
30
2.5
27
3
60ac75f10f7e74aea5636651de05b7bedd4f2be2
tests/main.py
tests/main.py
import json import unittest import requests import validators class DomainsTests(unittest.TestCase): def test_json_is_valid(self): with open("../world_universities_and_domains.json") as json_file: valid_json = json.load(json_file) for university in valid_json: self.assertIn("name", university) self.assertIn("domains", university) self.assertIsInstance(university["domains"], list) for domain in university["domains"]: self.assertTrue(validators.domain(domain)) self.assertIn("web_pages", university) self.assertIsInstance(university["web_pages"], list) for web_page in university["web_pages"]: self.assertTrue(validators.url(web_page)) self.assertIn("alpha_two_code", university) self.assertIn("state-province", university) self.assertIn("country", university) def check_is_alive(): """ check url then if url isn't alive, add to file """ with open('../world_universities_and_domains.json') as json_raw: universities = json.load(json_raw) for university in universities[:]: try: for web_page in university["web_pages"]: print(web_page) requests.get(web_page, allow_redirects=False, timeout=10.0) except requests.exceptions.ConnectionError as exc: print('- Website doesn\'t exists: ', exc) if __name__ == '__main__': unittest.main(verbosity=2)
import json import unittest import requests import validators class DomainsTests(unittest.TestCase): def test_json_is_valid(self): with open("../world_universities_and_domains.json") as json_file: valid_json = json.load(json_file) for university in valid_json: self.assertIn("name", university) self.assertIn("domains", university) self.assertIsInstance(university["domains"], list) for domain in university["domains"]: self.assertTrue(validators.domain(domain)) self.assertIn("web_pages", university) self.assertIn("alpha_two_code", university) self.assertIn("state-province", university) self.assertIn("country", university) def check_is_alive(): """ check url then if url isn't alive, add to file """ with open('../world_universities_and_domains.json') as json_raw: universities = json.load(json_raw) for university in universities[:]: try: for web_page in university["web_pages"]: print(web_page) requests.get(web_page, allow_redirects=False, timeout=10.0) except requests.exceptions.ConnectionError as exc: print('- Website doesn\'t exists: ', exc) if __name__ == '__main__': unittest.main(verbosity=2)
Remove URL test due to bad validator
Remove URL test due to bad validator
Python
mit
Hipo/university-domains-list
python
## Code Before: import json import unittest import requests import validators class DomainsTests(unittest.TestCase): def test_json_is_valid(self): with open("../world_universities_and_domains.json") as json_file: valid_json = json.load(json_file) for university in valid_json: self.assertIn("name", university) self.assertIn("domains", university) self.assertIsInstance(university["domains"], list) for domain in university["domains"]: self.assertTrue(validators.domain(domain)) self.assertIn("web_pages", university) self.assertIsInstance(university["web_pages"], list) for web_page in university["web_pages"]: self.assertTrue(validators.url(web_page)) self.assertIn("alpha_two_code", university) self.assertIn("state-province", university) self.assertIn("country", university) def check_is_alive(): """ check url then if url isn't alive, add to file """ with open('../world_universities_and_domains.json') as json_raw: universities = json.load(json_raw) for university in universities[:]: try: for web_page in university["web_pages"]: print(web_page) requests.get(web_page, allow_redirects=False, timeout=10.0) except requests.exceptions.ConnectionError as exc: print('- Website doesn\'t exists: ', exc) if __name__ == '__main__': unittest.main(verbosity=2) ## Instruction: Remove URL test due to bad validator ## Code After: import json import unittest import requests import validators class DomainsTests(unittest.TestCase): def test_json_is_valid(self): with open("../world_universities_and_domains.json") as json_file: valid_json = json.load(json_file) for university in valid_json: self.assertIn("name", university) self.assertIn("domains", university) self.assertIsInstance(university["domains"], list) for domain in university["domains"]: self.assertTrue(validators.domain(domain)) self.assertIn("web_pages", university) self.assertIn("alpha_two_code", university) self.assertIn("state-province", university) self.assertIn("country", university) def check_is_alive(): """ check url then if url isn't alive, add to file """ with open('../world_universities_and_domains.json') as json_raw: universities = json.load(json_raw) for university in universities[:]: try: for web_page in university["web_pages"]: print(web_page) requests.get(web_page, allow_redirects=False, timeout=10.0) except requests.exceptions.ConnectionError as exc: print('- Website doesn\'t exists: ', exc) if __name__ == '__main__': unittest.main(verbosity=2)
import json import unittest import requests import validators class DomainsTests(unittest.TestCase): def test_json_is_valid(self): with open("../world_universities_and_domains.json") as json_file: valid_json = json.load(json_file) for university in valid_json: self.assertIn("name", university) self.assertIn("domains", university) self.assertIsInstance(university["domains"], list) for domain in university["domains"]: self.assertTrue(validators.domain(domain)) self.assertIn("web_pages", university) - self.assertIsInstance(university["web_pages"], list) - for web_page in university["web_pages"]: - self.assertTrue(validators.url(web_page)) self.assertIn("alpha_two_code", university) self.assertIn("state-province", university) self.assertIn("country", university) def check_is_alive(): """ check url then if url isn't alive, add to file """ with open('../world_universities_and_domains.json') as json_raw: universities = json.load(json_raw) for university in universities[:]: try: for web_page in university["web_pages"]: print(web_page) requests.get(web_page, allow_redirects=False, timeout=10.0) except requests.exceptions.ConnectionError as exc: print('- Website doesn\'t exists: ', exc) if __name__ == '__main__': unittest.main(verbosity=2)
3
0.078947
0
3
1f85518c25acdc9df41178901c5eb276430cf4f6
app/controllers/wafflemix/pages_controller.rb
app/controllers/wafflemix/pages_controller.rb
require_dependency "wafflemix/application_controller" module Wafflemix class PagesController < ApplicationController def index @pages = Page.active.arrange(:order => :position) respond_to do |format| format.html end end def show if params[:id] @page = Page.find_by_link_url(params[:id]) else @page = Page.find_by_link_url(params[:path].to_s.split('/').last)#(params[:path] ? params[:path].to_s.split('/').last : params[:id]) end respond_to do |format| format.html end end def home @page = Page.find_by_link_url("home") respond_to do |format| format.html end end def mercury_update page = Page.find(params[:id]) page.title = params[:content][:page_title][:value] params[:content].each do |key, value| if key =~ /content_section/ section = key.gsub('content_section_','') content_to_update = page.content_parts.find_by_name(section) content_to_update.content = value[:value] content_to_update.save end end page.save! render text: "" end end end
require_dependency "wafflemix/application_controller" module Wafflemix class PagesController < ApplicationController def index @pages = Page.active.arrange(:order => :position) respond_to do |format| format.html end end def show if params[:id] @page = Page.find_by_link_url(params[:id]) else @page = Page.find_by_link_url(params[:path].to_s.split('/').last)#(params[:path] ? params[:path].to_s.split('/').last : params[:id]) end respond_to do |format| format.html end end def home @page = Page.find_by_link_url("home") respond_to do |format| format.html end end def mercury_update page = Page.find(params[:id]) page.title = params[:content][:page_title][:value] params[:content].each do |key, value| if key =~ /content_section/ section = key.gsub('content_section_','') section = key.gsub /(content_section_|_)/, "content_section_" => "", "_" => " " content_to_update = page.content_parts.find_by_name(section) content_to_update.content = value[:value] content_to_update.save end end page.save! render text: "" end end end
Use the new 1.9 style gsub.
Use the new 1.9 style gsub.
Ruby
mit
jrissler/wafflemix,jrissler/wafflemix
ruby
## Code Before: require_dependency "wafflemix/application_controller" module Wafflemix class PagesController < ApplicationController def index @pages = Page.active.arrange(:order => :position) respond_to do |format| format.html end end def show if params[:id] @page = Page.find_by_link_url(params[:id]) else @page = Page.find_by_link_url(params[:path].to_s.split('/').last)#(params[:path] ? params[:path].to_s.split('/').last : params[:id]) end respond_to do |format| format.html end end def home @page = Page.find_by_link_url("home") respond_to do |format| format.html end end def mercury_update page = Page.find(params[:id]) page.title = params[:content][:page_title][:value] params[:content].each do |key, value| if key =~ /content_section/ section = key.gsub('content_section_','') content_to_update = page.content_parts.find_by_name(section) content_to_update.content = value[:value] content_to_update.save end end page.save! render text: "" end end end ## Instruction: Use the new 1.9 style gsub. ## Code After: require_dependency "wafflemix/application_controller" module Wafflemix class PagesController < ApplicationController def index @pages = Page.active.arrange(:order => :position) respond_to do |format| format.html end end def show if params[:id] @page = Page.find_by_link_url(params[:id]) else @page = Page.find_by_link_url(params[:path].to_s.split('/').last)#(params[:path] ? params[:path].to_s.split('/').last : params[:id]) end respond_to do |format| format.html end end def home @page = Page.find_by_link_url("home") respond_to do |format| format.html end end def mercury_update page = Page.find(params[:id]) page.title = params[:content][:page_title][:value] params[:content].each do |key, value| if key =~ /content_section/ section = key.gsub('content_section_','') section = key.gsub /(content_section_|_)/, "content_section_" => "", "_" => " " content_to_update = page.content_parts.find_by_name(section) content_to_update.content = value[:value] content_to_update.save end end page.save! render text: "" end end end
require_dependency "wafflemix/application_controller" module Wafflemix class PagesController < ApplicationController def index @pages = Page.active.arrange(:order => :position) respond_to do |format| format.html end end def show if params[:id] @page = Page.find_by_link_url(params[:id]) else @page = Page.find_by_link_url(params[:path].to_s.split('/').last)#(params[:path] ? params[:path].to_s.split('/').last : params[:id]) end respond_to do |format| format.html end end def home @page = Page.find_by_link_url("home") respond_to do |format| format.html end end def mercury_update page = Page.find(params[:id]) page.title = params[:content][:page_title][:value] params[:content].each do |key, value| if key =~ /content_section/ section = key.gsub('content_section_','') + section = key.gsub /(content_section_|_)/, "content_section_" => "", "_" => " " content_to_update = page.content_parts.find_by_name(section) content_to_update.content = value[:value] content_to_update.save end end page.save! render text: "" end end end
1
0.02
1
0
818c47e572911d7b1705adff8b5fcd68b855a45a
gradle.properties
gradle.properties
android.useAndroidX=true android.enableJetifier=true org.gradle.parallel=true
android.useAndroidX=true android.enableJetifier=true org.gradle.jvmargs=-Xmx1g org.gradle.parallel=true
Set max heap size for Gradle daemon because the default is too low
Set max heap size for Gradle daemon because the default is too low
INI
apache-2.0
cketti/k-9,cketti/k-9,cketti/k-9,k9mail/k-9,cketti/k-9,k9mail/k-9,k9mail/k-9
ini
## Code Before: android.useAndroidX=true android.enableJetifier=true org.gradle.parallel=true ## Instruction: Set max heap size for Gradle daemon because the default is too low ## Code After: android.useAndroidX=true android.enableJetifier=true org.gradle.jvmargs=-Xmx1g org.gradle.parallel=true
android.useAndroidX=true android.enableJetifier=true + org.gradle.jvmargs=-Xmx1g org.gradle.parallel=true
1
0.333333
1
0
b0483495dd68751931dae8b3d1fd53b4cba40fc8
troposphere/static/js/components/common/ui/TabLinks.react.js
troposphere/static/js/components/common/ui/TabLinks.react.js
import React from 'react'; export default React.createClass({ displayName: "TabLinks", propTypes: { currentView: React.PropTypes.string.isRequired, linkList: React.PropTypes.array.isRequired, onChangeView: React.PropTypes.func.isRequired }, onChangeView: function(item) { this.props.onChangeView(item); }, renderLinks: function(item, i) { let active = ""; if (item === this.props.currentView) { active = "TabLinks--active"; } return ( <li key={i} className="TabLinks-link"> <a className={active} onClick={this.onChangeView.bind(this, item)} > {item} </a> </li> ) }, render: function() { return ( <ul className="TabLinks clearFix"> {this.props.linkList.map(this.renderLinks)} </ul> ) } });
import React from 'react'; // Renders a nav with several tabs. This nav is created with an onTabClick // handler, such that, the parent can be notified when a new tab is selected. // The parent could then render a view when a tab is selected. export default React.createClass({ displayName: "TabLinks", propTypes: { // Index into links that will be shown by default defaultLink: React.PropTypes.number.isRequired, // List of link names to be rendered links: React.PropTypes.array.isRequired, onTabClick: React.PropTypes.func.isRequired }, getInitialState: function() { return { index: this.props.defaultLink } }, onTabClick: function(index) { this.props.onTabClick(index); this.setState({ index }) }, renderLink: function(link, index) { let active = ""; if (index === this.state.index) { active = "TabLinks--active"; } let onClick = this.onTabClick.bind(this, index); return ( <li key={index} className="TabLinks-link"> <a className={active} onClick={onClick}> {link} </a> </li> ); }, render: function() { return ( <ul className="TabLinks clearFix"> {this.props.links.map(this.renderLink)} </ul> ); } });
Change UI component to be independent and use indeces
Change UI component to be independent and use indeces This tab nav now has more internal state. Before it required the parent to set which tab is the current, now the parent only sets a default. The other change is that the onChange listener relies an index rather than an element (see propType defaultLink). There are a few good reasons for this, it's better to compare against indexes than elements (typically strings). There were some small name updates.
JavaScript
apache-2.0
CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend
javascript
## Code Before: import React from 'react'; export default React.createClass({ displayName: "TabLinks", propTypes: { currentView: React.PropTypes.string.isRequired, linkList: React.PropTypes.array.isRequired, onChangeView: React.PropTypes.func.isRequired }, onChangeView: function(item) { this.props.onChangeView(item); }, renderLinks: function(item, i) { let active = ""; if (item === this.props.currentView) { active = "TabLinks--active"; } return ( <li key={i} className="TabLinks-link"> <a className={active} onClick={this.onChangeView.bind(this, item)} > {item} </a> </li> ) }, render: function() { return ( <ul className="TabLinks clearFix"> {this.props.linkList.map(this.renderLinks)} </ul> ) } }); ## Instruction: Change UI component to be independent and use indeces This tab nav now has more internal state. Before it required the parent to set which tab is the current, now the parent only sets a default. The other change is that the onChange listener relies an index rather than an element (see propType defaultLink). There are a few good reasons for this, it's better to compare against indexes than elements (typically strings). There were some small name updates. ## Code After: import React from 'react'; // Renders a nav with several tabs. This nav is created with an onTabClick // handler, such that, the parent can be notified when a new tab is selected. // The parent could then render a view when a tab is selected. export default React.createClass({ displayName: "TabLinks", propTypes: { // Index into links that will be shown by default defaultLink: React.PropTypes.number.isRequired, // List of link names to be rendered links: React.PropTypes.array.isRequired, onTabClick: React.PropTypes.func.isRequired }, getInitialState: function() { return { index: this.props.defaultLink } }, onTabClick: function(index) { this.props.onTabClick(index); this.setState({ index }) }, renderLink: function(link, index) { let active = ""; if (index === this.state.index) { active = "TabLinks--active"; } let onClick = this.onTabClick.bind(this, index); return ( <li key={index} className="TabLinks-link"> <a className={active} onClick={onClick}> {link} </a> </li> ); }, render: function() { return ( <ul className="TabLinks clearFix"> {this.props.links.map(this.renderLink)} </ul> ); } });
import React from 'react'; + // Renders a nav with several tabs. This nav is created with an onTabClick + // handler, such that, the parent can be notified when a new tab is selected. + // The parent could then render a view when a tab is selected. export default React.createClass({ displayName: "TabLinks", propTypes: { - currentView: React.PropTypes.string.isRequired, + // Index into links that will be shown by default + defaultLink: React.PropTypes.number.isRequired, + // List of link names to be rendered - linkList: React.PropTypes.array.isRequired, ? -- - + links: React.PropTypes.array.isRequired, - onChangeView: React.PropTypes.func.isRequired ? ^^^^^^ ^^ + onTabClick: React.PropTypes.func.isRequired ? +++ ^ ^^ }, - onChangeView: function(item) { - this.props.onChangeView(item); + getInitialState: function() { + return { + index: this.props.defaultLink + } }, + onTabClick: function(index) { + this.props.onTabClick(index); + this.setState({ index }) + }, + + - renderLinks: function(item, i) { ? - ^^^ + renderLink: function(link, index) { ? + ^^ ++++ let active = ""; - if (item === this.props.currentView) { + + if (index === this.state.index) { active = "TabLinks--active"; } + let onClick = this.onTabClick.bind(this, index); + return ( - <li key={i} className="TabLinks-link"> + <li key={index} className="TabLinks-link"> ? ++++ - <a className={active} + <a className={active} onClick={onClick}> ? +++++++++++++++++++ - onClick={this.onChangeView.bind(this, item)} - > - {item} ? ^^^ + {link} ? + ^^ </a> </li> - ) + ); ? + }, render: function() { return ( <ul className="TabLinks clearFix"> - {this.props.linkList.map(this.renderLinks)} ? -- - - + {this.props.links.map(this.renderLink)} </ul> - ) + ); ? + } });
44
1.1
29
15
fd08ac356a47d3430ec9bc1f22b527984fd877ff
src/ng2-restangular-http.ts
src/ng2-restangular-http.ts
import {Injectable} from '@angular/core'; import {Http, Request} from '@angular/http'; import {Observable} from 'rxjs'; import {RestangularHelper} from './ng2-restangular-helper'; @Injectable() export class RestangularHttp { constructor(public http: Http) { } createRequest(options) { let requestOptions = RestangularHelper.createRequestOptions(options); let request = new Request(requestOptions); return this.request(request); } request(request) { return this.http.request(request) .map((response: any) => { response.config = {params: request}; return response; }) .map((response: any) => { if (response._body) { response.data = typeof response._body == 'string' ? JSON.parse(response._body) : response._body; } else { response.data = null } return response; }) .catch(err => { err.data = typeof err._body == 'string' ? JSON.parse(err._body) : err._body; err.request = request; err.repeatRequest = (newRequest?) => { return this.request(newRequest || request); }; return Observable.throw(err); }) } }
import {Injectable} from '@angular/core'; import {Http, Request} from '@angular/http'; import {Observable} from 'rxjs'; import {RestangularHelper} from './ng2-restangular-helper'; @Injectable() export class RestangularHttp { constructor(public http: Http) { } createRequest(options) { let requestOptions = RestangularHelper.createRequestOptions(options); let request = new Request(requestOptions); return this.request(request); } request(request) { return this.http.request(request) .map((response: any) => { response.config = {params: request}; return response; }) .map((response: any) => { if (response._body) { response.data = typeof response._body == 'string' ? JSON.parse(response._body) : response._body; } else { response.data = null } return response; }) .catch(err => { err.data = typeof err._body == 'string' && err._body.length > 0 ? JSON.parse(err._body) : err._body; err.request = request; err.repeatRequest = (newRequest?) => { return this.request(newRequest || request); }; return Observable.throw(err); }) } }
Check error response before parsing
Check error response before parsing
TypeScript
mit
2muchcoffeecom/ngx-restangular,2muchcoffeecom/ngx-restangular,2muchcoffeecom/ng2-restangular,2muchcoffeecom/ng2-restangular
typescript
## Code Before: import {Injectable} from '@angular/core'; import {Http, Request} from '@angular/http'; import {Observable} from 'rxjs'; import {RestangularHelper} from './ng2-restangular-helper'; @Injectable() export class RestangularHttp { constructor(public http: Http) { } createRequest(options) { let requestOptions = RestangularHelper.createRequestOptions(options); let request = new Request(requestOptions); return this.request(request); } request(request) { return this.http.request(request) .map((response: any) => { response.config = {params: request}; return response; }) .map((response: any) => { if (response._body) { response.data = typeof response._body == 'string' ? JSON.parse(response._body) : response._body; } else { response.data = null } return response; }) .catch(err => { err.data = typeof err._body == 'string' ? JSON.parse(err._body) : err._body; err.request = request; err.repeatRequest = (newRequest?) => { return this.request(newRequest || request); }; return Observable.throw(err); }) } } ## Instruction: Check error response before parsing ## Code After: import {Injectable} from '@angular/core'; import {Http, Request} from '@angular/http'; import {Observable} from 'rxjs'; import {RestangularHelper} from './ng2-restangular-helper'; @Injectable() export class RestangularHttp { constructor(public http: Http) { } createRequest(options) { let requestOptions = RestangularHelper.createRequestOptions(options); let request = new Request(requestOptions); return this.request(request); } request(request) { return this.http.request(request) .map((response: any) => { response.config = {params: request}; return response; }) .map((response: any) => { if (response._body) { response.data = typeof response._body == 'string' ? JSON.parse(response._body) : response._body; } else { response.data = null } return response; }) .catch(err => { err.data = typeof err._body == 'string' && err._body.length > 0 ? JSON.parse(err._body) : err._body; err.request = request; err.repeatRequest = (newRequest?) => { return this.request(newRequest || request); }; return Observable.throw(err); }) } }
import {Injectable} from '@angular/core'; import {Http, Request} from '@angular/http'; import {Observable} from 'rxjs'; import {RestangularHelper} from './ng2-restangular-helper'; @Injectable() export class RestangularHttp { constructor(public http: Http) { } createRequest(options) { let requestOptions = RestangularHelper.createRequestOptions(options); let request = new Request(requestOptions); return this.request(request); } request(request) { return this.http.request(request) .map((response: any) => { response.config = {params: request}; return response; }) .map((response: any) => { if (response._body) { response.data = typeof response._body == 'string' ? JSON.parse(response._body) : response._body; } else { response.data = null } return response; }) .catch(err => { - err.data = typeof err._body == 'string' ? JSON.parse(err._body) : err._body; + err.data = typeof err._body == 'string' && err._body.length > 0 ? JSON.parse(err._body) : err._body; ? ++++++++++++++++++++++++ err.request = request; err.repeatRequest = (newRequest?) => { return this.request(newRequest || request); }; return Observable.throw(err); }) } }
2
0.043478
1
1
6e68a97ba6f17685a2bb8b5080c7c8ad24db3674
strigi-analyzer/vcf/CMakeLists.txt
strigi-analyzer/vcf/CMakeLists.txt
set(vcfendanalyzer_SRCS vcfendanalyzer.cpp ) include_directories(${CMAKE_SOURCE_DIR}/strigi-analyzer ${STRIGI_INCLUDE_DIR}) kde4_add_library(vcf MODULE ${vcfendanalyzer_SRCS}) target_link_libraries(vcf ${STRIGI_STREAMANALYZER_LIBRARY} -L${KDE4_LIB_DIR} ${KDE4_KABC_LIBS} ${QT_QTCORE_LIBRARY}) set_target_properties(vcf PROPERTIES PREFIX strigiea_) install(TARGETS vcf LIBRARY DESTINATION ${LIB_INSTALL_DIR}/strigi)
set(vcfendanalyzer_SRCS vcfendanalyzer.cpp ) include_directories(${CMAKE_SOURCE_DIR}/strigi-analyzer ${STRIGI_INCLUDE_DIR}) kde4_add_library(vcf MODULE ${vcfendanalyzer_SRCS}) target_link_libraries(vcf ${STRIGI_STREAMANALYZER_LIBRARY} ${KDE4_KABC_LIBS}) set_target_properties(vcf PROPERTIES PREFIX strigiea_) install(TARGETS vcf LIBRARY DESTINATION ${LIB_INSTALL_DIR}/strigi)
Revert workaround for lack of proper dependencies; Laurent added a KDEPimLibsDependencies.cmake now. Good to see pradeepto wasn't the only one who was lacking those dependencies. CCMAIL:tokoe@kde.org CCMAIL:ralf.habacker@freenet.de
Revert workaround for lack of proper dependencies; Laurent added a KDEPimLibsDependencies.cmake now. Good to see pradeepto wasn't the only one who was lacking those dependencies. CCMAIL:tokoe@kde.org CCMAIL:ralf.habacker@freenet.de svn path=/trunk/KDE/kdepim/strigi-analyzer/; revision=684842
Text
lgpl-2.1
lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi
text
## Code Before: set(vcfendanalyzer_SRCS vcfendanalyzer.cpp ) include_directories(${CMAKE_SOURCE_DIR}/strigi-analyzer ${STRIGI_INCLUDE_DIR}) kde4_add_library(vcf MODULE ${vcfendanalyzer_SRCS}) target_link_libraries(vcf ${STRIGI_STREAMANALYZER_LIBRARY} -L${KDE4_LIB_DIR} ${KDE4_KABC_LIBS} ${QT_QTCORE_LIBRARY}) set_target_properties(vcf PROPERTIES PREFIX strigiea_) install(TARGETS vcf LIBRARY DESTINATION ${LIB_INSTALL_DIR}/strigi) ## Instruction: Revert workaround for lack of proper dependencies; Laurent added a KDEPimLibsDependencies.cmake now. Good to see pradeepto wasn't the only one who was lacking those dependencies. CCMAIL:tokoe@kde.org CCMAIL:ralf.habacker@freenet.de svn path=/trunk/KDE/kdepim/strigi-analyzer/; revision=684842 ## Code After: set(vcfendanalyzer_SRCS vcfendanalyzer.cpp ) include_directories(${CMAKE_SOURCE_DIR}/strigi-analyzer ${STRIGI_INCLUDE_DIR}) kde4_add_library(vcf MODULE ${vcfendanalyzer_SRCS}) target_link_libraries(vcf ${STRIGI_STREAMANALYZER_LIBRARY} ${KDE4_KABC_LIBS}) set_target_properties(vcf PROPERTIES PREFIX strigiea_) install(TARGETS vcf LIBRARY DESTINATION ${LIB_INSTALL_DIR}/strigi)
set(vcfendanalyzer_SRCS vcfendanalyzer.cpp ) include_directories(${CMAKE_SOURCE_DIR}/strigi-analyzer ${STRIGI_INCLUDE_DIR}) kde4_add_library(vcf MODULE ${vcfendanalyzer_SRCS}) - target_link_libraries(vcf ${STRIGI_STREAMANALYZER_LIBRARY} -L${KDE4_LIB_DIR} ${KDE4_KABC_LIBS} ${QT_QTCORE_LIBRARY}) ? ------------------ --------------------- + target_link_libraries(vcf ${STRIGI_STREAMANALYZER_LIBRARY} ${KDE4_KABC_LIBS}) set_target_properties(vcf PROPERTIES PREFIX strigiea_) install(TARGETS vcf LIBRARY DESTINATION ${LIB_INSTALL_DIR}/strigi)
2
0.222222
1
1
07fff6c7c7cd81eed617519f524e8bb590df4668
etc/taskcluster/docker/base.dockerfile
etc/taskcluster/docker/base.dockerfile
FROM ubuntu:eoan-20200608 ENV \ # # Some APT packages like 'tzdata' wait for user input on install by default. # https://stackoverflow.com/questions/44331836/apt-get-install-tzdata-noninteractive DEBIAN_FRONTEND=noninteractive \ LANG=C.UTF-8 \ LANGUAGE=C.UTF-8 \ LC_ALL=C.UTF-8 RUN \ apt-get update -q && \ apt-get install -qy --no-install-recommends \ # # Cloning the repository git \ ca-certificates \ # # Running mach with Python 2 python \ python-pip \ python-dev \ python-virtualenv \ # # Running mach with Python 3 python3 \ python3-pip \ python3-dev \ virtualenv \ # # Compiling C modules when installing Python packages in a virtualenv gcc \ # # Installing rustup and sccache (build dockerfile) or fetching build artifacts (run tasks) curl \ # Setting the default locale locales \ locales-all
FROM ubuntu:20.04 ENV \ # # Some APT packages like 'tzdata' wait for user input on install by default. # https://stackoverflow.com/questions/44331836/apt-get-install-tzdata-noninteractive DEBIAN_FRONTEND=noninteractive \ LANG=C.UTF-8 \ LANGUAGE=C.UTF-8 \ LC_ALL=C.UTF-8 RUN \ apt-get update -q && \ apt-get install -qy --no-install-recommends \ # # Cloning the repository git \ ca-certificates \ # # Running mach with Python 2 python2 \ python2-dev \ python-is-python2 \ # # Running mach with Python 3 python3 \ python3-pip \ python3-dev \ virtualenv \ # # Compiling C modules when installing Python packages in a virtualenv gcc \ # # Installing rustup and sccache (build dockerfile) or fetching build artifacts (run tasks) curl \ # Setting the default locale locales \ locales-all \ && \ # # Python 2 bits that have been removed from Ubuntu packages curl https://bootstrap.pypa.io/get-pip.py -sSf -o get-pip.py && \ python2 get-pip.py && \ python2 -m pip install virtualenv
Upgrade CI to Ubuntu 20.04 LTS
Upgrade CI to Ubuntu 20.04 LTS 19.10 has been at end-of-life since July. Also switch to an un-dated Docker Hub tag. Built docker images expire after a month, and when rebuilding we install the latest versions of additional packages. We might has well pick up-to-date versions of the base system as well. We do stay within one Ubuntu release, though.
Dockerfile
mpl-2.0
KiChjang/servo,KiChjang/servo,KiChjang/servo,KiChjang/servo,KiChjang/servo,KiChjang/servo,KiChjang/servo,KiChjang/servo,KiChjang/servo,KiChjang/servo
dockerfile
## Code Before: FROM ubuntu:eoan-20200608 ENV \ # # Some APT packages like 'tzdata' wait for user input on install by default. # https://stackoverflow.com/questions/44331836/apt-get-install-tzdata-noninteractive DEBIAN_FRONTEND=noninteractive \ LANG=C.UTF-8 \ LANGUAGE=C.UTF-8 \ LC_ALL=C.UTF-8 RUN \ apt-get update -q && \ apt-get install -qy --no-install-recommends \ # # Cloning the repository git \ ca-certificates \ # # Running mach with Python 2 python \ python-pip \ python-dev \ python-virtualenv \ # # Running mach with Python 3 python3 \ python3-pip \ python3-dev \ virtualenv \ # # Compiling C modules when installing Python packages in a virtualenv gcc \ # # Installing rustup and sccache (build dockerfile) or fetching build artifacts (run tasks) curl \ # Setting the default locale locales \ locales-all ## Instruction: Upgrade CI to Ubuntu 20.04 LTS 19.10 has been at end-of-life since July. Also switch to an un-dated Docker Hub tag. Built docker images expire after a month, and when rebuilding we install the latest versions of additional packages. We might has well pick up-to-date versions of the base system as well. We do stay within one Ubuntu release, though. ## Code After: FROM ubuntu:20.04 ENV \ # # Some APT packages like 'tzdata' wait for user input on install by default. # https://stackoverflow.com/questions/44331836/apt-get-install-tzdata-noninteractive DEBIAN_FRONTEND=noninteractive \ LANG=C.UTF-8 \ LANGUAGE=C.UTF-8 \ LC_ALL=C.UTF-8 RUN \ apt-get update -q && \ apt-get install -qy --no-install-recommends \ # # Cloning the repository git \ ca-certificates \ # # Running mach with Python 2 python2 \ python2-dev \ python-is-python2 \ # # Running mach with Python 3 python3 \ python3-pip \ python3-dev \ virtualenv \ # # Compiling C modules when installing Python packages in a virtualenv gcc \ # # Installing rustup and sccache (build dockerfile) or fetching build artifacts (run tasks) curl \ # Setting the default locale locales \ locales-all \ && \ # # Python 2 bits that have been removed from Ubuntu packages curl https://bootstrap.pypa.io/get-pip.py -sSf -o get-pip.py && \ python2 get-pip.py && \ python2 -m pip install virtualenv
+ FROM ubuntu:20.04 - - FROM ubuntu:eoan-20200608 ENV \ # # Some APT packages like 'tzdata' wait for user input on install by default. # https://stackoverflow.com/questions/44331836/apt-get-install-tzdata-noninteractive DEBIAN_FRONTEND=noninteractive \ LANG=C.UTF-8 \ LANGUAGE=C.UTF-8 \ LC_ALL=C.UTF-8 RUN \ apt-get update -q && \ apt-get install -qy --no-install-recommends \ # # Cloning the repository git \ ca-certificates \ # # Running mach with Python 2 - python \ + python2 \ ? + - python-pip \ - python-dev \ + python2-dev \ ? + - python-virtualenv \ + python-is-python2 \ # # Running mach with Python 3 python3 \ python3-pip \ python3-dev \ virtualenv \ # # Compiling C modules when installing Python packages in a virtualenv gcc \ # # Installing rustup and sccache (build dockerfile) or fetching build artifacts (run tasks) curl \ # Setting the default locale locales \ - locales-all + locales-all \ ? ++ - + && \ + # + # Python 2 bits that have been removed from Ubuntu packages + curl https://bootstrap.pypa.io/get-pip.py -sSf -o get-pip.py && \ + python2 get-pip.py && \ + python2 -m pip install virtualenv
19
0.463415
11
8
3fa9aed3c398061e4f69223d707246adeb765fdd
test/dalitests/images.js
test/dalitests/images.js
/* Copyright 2015-2016 Teeming Society. Licensed under the Apache License, Version 2.0 (the "License"); DreemGL is a collaboration between Teeming Society & Samsung Electronics, sponsored by Samsung and others. You may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.*/ //Pure JS based composition define.class(function($server$, composition, $ui$, screen, view, label, require){ this.render = function(){ var dynviews = []; for (var digit=0; digit<10; digit++) { for (var w=100; w<=200; w+= 25) { var v1 = view({ size: vec2(w, w) ,bgimage: define.classPath(this) + 'assets/' + digit + '.png' ,bgimagemode:"stretch" }) dynviews.push(v1); } } var views = [ screen({name:'default', clearcolor:'#484230'} ,dynviews) ]; return views } })
/* Copyright 2015-2016 Teeming Society. Licensed under the Apache License, Version 2.0 (the "License"); DreemGL is a collaboration between Teeming Society & Samsung Electronics, sponsored by Samsung and others. You may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.*/ //Pure JS based composition define.class(function($server$, composition, $ui$, screen, view, label, require){ this.render = function(){ var dynviews = []; for (var digit=0; digit<10; digit++) { for (var w=100; w<=200; w+= 25) { var v1 = view({ size: vec2(w, w) ,bgimage: require('./assets/' + digit + '.png') // ,bgimage: define.classPath(this) + 'assets/' + digit + '.png' ,bgimagemode:"stretch" }) dynviews.push(v1); } } var views = [ screen({name:'default', clearcolor:'#484230'} ,dynviews) ]; return views } })
Revert the ,bgimage: define.classPath(this) to require, since the correct new way of loading local resources for WebGL causes an exception in Dali. /root/teem/dreemgl-dev/classes/ui/view.js:532 if(require.loaded(this._bgimage)){
Revert the ,bgimage: define.classPath(this) to require, since the correct new way of loading local resources for WebGL causes an exception in Dali. /root/teem/dreemgl-dev/classes/ui/view.js:532 if(require.loaded(this._bgimage)){ bgimagemode:"stretch" is left in the code, since that fixes the problem with the sizing of images for the Dali runtime.
JavaScript
apache-2.0
teem2/dreemgl,teem2/dreemgl,teem2/dreemgl,dreemproject/dreemgl,dreemproject/dreemgl,dreemproject/dreemgl,teem2/dreemgl,dreemproject/dreemgl,teem2/dreemgl,dreemproject/dreemgl
javascript
## Code Before: /* Copyright 2015-2016 Teeming Society. Licensed under the Apache License, Version 2.0 (the "License"); DreemGL is a collaboration between Teeming Society & Samsung Electronics, sponsored by Samsung and others. You may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.*/ //Pure JS based composition define.class(function($server$, composition, $ui$, screen, view, label, require){ this.render = function(){ var dynviews = []; for (var digit=0; digit<10; digit++) { for (var w=100; w<=200; w+= 25) { var v1 = view({ size: vec2(w, w) ,bgimage: define.classPath(this) + 'assets/' + digit + '.png' ,bgimagemode:"stretch" }) dynviews.push(v1); } } var views = [ screen({name:'default', clearcolor:'#484230'} ,dynviews) ]; return views } }) ## Instruction: Revert the ,bgimage: define.classPath(this) to require, since the correct new way of loading local resources for WebGL causes an exception in Dali. /root/teem/dreemgl-dev/classes/ui/view.js:532 if(require.loaded(this._bgimage)){ bgimagemode:"stretch" is left in the code, since that fixes the problem with the sizing of images for the Dali runtime. ## Code After: /* Copyright 2015-2016 Teeming Society. Licensed under the Apache License, Version 2.0 (the "License"); DreemGL is a collaboration between Teeming Society & Samsung Electronics, sponsored by Samsung and others. You may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.*/ //Pure JS based composition define.class(function($server$, composition, $ui$, screen, view, label, require){ this.render = function(){ var dynviews = []; for (var digit=0; digit<10; digit++) { for (var w=100; w<=200; w+= 25) { var v1 = view({ size: vec2(w, w) ,bgimage: require('./assets/' + digit + '.png') // ,bgimage: define.classPath(this) + 'assets/' + digit + '.png' ,bgimagemode:"stretch" }) dynviews.push(v1); } } var views = [ screen({name:'default', clearcolor:'#484230'} ,dynviews) ]; return views } })
/* Copyright 2015-2016 Teeming Society. Licensed under the Apache License, Version 2.0 (the "License"); DreemGL is a collaboration between Teeming Society & Samsung Electronics, sponsored by Samsung and others. You may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.*/ //Pure JS based composition define.class(function($server$, composition, $ui$, screen, view, label, require){ this.render = function(){ var dynviews = []; for (var digit=0; digit<10; digit++) { for (var w=100; w<=200; w+= 25) { var v1 = view({ size: vec2(w, w) + ,bgimage: require('./assets/' + digit + '.png') - ,bgimage: define.classPath(this) + 'assets/' + digit + '.png' + // ,bgimage: define.classPath(this) + 'assets/' + digit + '.png' ? +++ ,bgimagemode:"stretch" }) dynviews.push(v1); } } var views = [ screen({name:'default', clearcolor:'#484230'} ,dynviews) ]; return views } })
3
0.1
2
1
404becd6bddf605d35d965a7c351f2f43de337b3
content/doc/upgrade/from-gogs.en-us.md
content/doc/upgrade/from-gogs.en-us.md
--- date: "2016-12-01T16:00:00+02:00" title: "Upgrade from Gogs" weight: 10 toc: true draft: false menu: sidebar: parent: "upgrade" name: "From Gogs" weight: 10 identifier: "upgrade-from-gogs" --- # Upgrade from Gogs If you are running Gogs which version is below 0.9.99, you can upgrade Gogs to Gitea smoothly. There are some steps to do below: * Stop Gogs * Copy Gogs `custom/conf/app.ini` to Gitea. If you have changed the templates, you have to merge them to Gitea's templates manually. * Run Gitea * Enter Gitea admin panel on the UI, run `Rewrite '.ssh/authorized_keys' file (caution: non-Gitea keys will be lost)` and `Rewrite all update hook of repositories (needed when custom config path is changed)`. ## TBD
--- date: "2016-12-01T16:00:00+02:00" title: "Upgrade from Gogs" weight: 10 toc: true draft: false menu: sidebar: parent: "upgrade" name: "From Gogs" weight: 10 identifier: "upgrade-from-gogs" --- # Upgrade from Gogs If you are running Gogs which version is below 0.9.99, you can upgrade Gogs to Gitea smoothly. There are some steps to do below: * Stop Gogs * Copy Gogs `custom/conf/app.ini` to Gitea. * If you have more custom content on `custom/` folder, like templates or localization files, you should carrefully merge manually because these files changed on Gitea. * Copy `data/` folder from Gogs to Gitea. It contains issue attachments and avatars. * Run Gitea * Enter Gitea admin panel on the UI, run `Rewrite '.ssh/authorized_keys' file` (caution: non-Gitea keys will be lost) and `Rewrite all update hook of repositories` (needed when custom config path is changed). ## TBD
Improve "Upgrade from Gogs" docs
Improve "Upgrade from Gogs" docs `custom/data/` folder should also be copied
Markdown
apache-2.0
luffyke/docs,go-gitea/docs,luffyke/docs,go-gitea/docs
markdown
## Code Before: --- date: "2016-12-01T16:00:00+02:00" title: "Upgrade from Gogs" weight: 10 toc: true draft: false menu: sidebar: parent: "upgrade" name: "From Gogs" weight: 10 identifier: "upgrade-from-gogs" --- # Upgrade from Gogs If you are running Gogs which version is below 0.9.99, you can upgrade Gogs to Gitea smoothly. There are some steps to do below: * Stop Gogs * Copy Gogs `custom/conf/app.ini` to Gitea. If you have changed the templates, you have to merge them to Gitea's templates manually. * Run Gitea * Enter Gitea admin panel on the UI, run `Rewrite '.ssh/authorized_keys' file (caution: non-Gitea keys will be lost)` and `Rewrite all update hook of repositories (needed when custom config path is changed)`. ## TBD ## Instruction: Improve "Upgrade from Gogs" docs `custom/data/` folder should also be copied ## Code After: --- date: "2016-12-01T16:00:00+02:00" title: "Upgrade from Gogs" weight: 10 toc: true draft: false menu: sidebar: parent: "upgrade" name: "From Gogs" weight: 10 identifier: "upgrade-from-gogs" --- # Upgrade from Gogs If you are running Gogs which version is below 0.9.99, you can upgrade Gogs to Gitea smoothly. There are some steps to do below: * Stop Gogs * Copy Gogs `custom/conf/app.ini` to Gitea. * If you have more custom content on `custom/` folder, like templates or localization files, you should carrefully merge manually because these files changed on Gitea. * Copy `data/` folder from Gogs to Gitea. It contains issue attachments and avatars. * Run Gitea * Enter Gitea admin panel on the UI, run `Rewrite '.ssh/authorized_keys' file` (caution: non-Gitea keys will be lost) and `Rewrite all update hook of repositories` (needed when custom config path is changed). ## TBD
--- date: "2016-12-01T16:00:00+02:00" title: "Upgrade from Gogs" weight: 10 toc: true draft: false menu: sidebar: parent: "upgrade" name: "From Gogs" weight: 10 identifier: "upgrade-from-gogs" --- # Upgrade from Gogs If you are running Gogs which version is below 0.9.99, you can upgrade Gogs to Gitea smoothly. There are some steps to do below: * Stop Gogs - * Copy Gogs `custom/conf/app.ini` to Gitea. If you have changed the templates, you have to merge them to Gitea's templates manually. + * Copy Gogs `custom/conf/app.ini` to Gitea. + * If you have more custom content on `custom/` folder, like templates or + localization files, you should carrefully merge manually because these files + changed on Gitea. + * Copy `data/` folder from Gogs to Gitea. It contains issue attachments and avatars. * Run Gitea - * Enter Gitea admin panel on the UI, run `Rewrite '.ssh/authorized_keys' file (caution: non-Gitea keys will be lost)` ? - + * Enter Gitea admin panel on the UI, run `Rewrite '.ssh/authorized_keys' file` (caution: non-Gitea keys will be lost) ? + - and `Rewrite all update hook of repositories (needed when custom config path is changed)`. ? - + and `Rewrite all update hook of repositories` (needed when custom config path is changed). ? + ## TBD
10
0.4
7
3
bd6bab77d0499266d298f037e1722a370339f55f
java/env.sh
java/env.sh
JAVA8=$(/usr/libexec/java_home -v 1.8) export JAVA_HOME=$JAVA8
if [ -f "/usr/libexec/java_home" ]; then JAVA8=$(/usr/libexec/java_home -v 1.8) export JAVA_HOME=$JAVA8 fi
Check that java exists before setting it up
Check that java exists before setting it up
Shell
mit
alexrudy/dotfiles,alexrudy/dotfiles,alexrudy/dotfiles
shell
## Code Before: JAVA8=$(/usr/libexec/java_home -v 1.8) export JAVA_HOME=$JAVA8 ## Instruction: Check that java exists before setting it up ## Code After: if [ -f "/usr/libexec/java_home" ]; then JAVA8=$(/usr/libexec/java_home -v 1.8) export JAVA_HOME=$JAVA8 fi
+ if [ -f "/usr/libexec/java_home" ]; then - JAVA8=$(/usr/libexec/java_home -v 1.8) + JAVA8=$(/usr/libexec/java_home -v 1.8) ? + - export JAVA_HOME=$JAVA8 + export JAVA_HOME=$JAVA8 ? + + fi
6
3
4
2
b37166570fc1cd69d98e9ca82b0118df19b3089e
app/views/shared/_banner.html.haml
app/views/shared/_banner.html.haml
- if params["category"] == "career" || @proposal.try(:category_list).try(:include?, "career") .top-banner %a.top-banner-clickable{ href: "http://effectivealtruismhub.com/career-help", target: "_blank" } Interested in career advice? You should also check out the career-advice page on the Effective Altruism Hub!
- if params["category"] == "career" || @proposal.try(:category_list).try(:include?, "career") .top-banner %a.top-banner-clickable{ href: "http://eahub.org/career-help", target: "_blank" } Interested in career advice? You should also check out the career-advice page on the Effective Altruism Hub!
Update EA Hub career-advice link
Update EA Hub career-advice link
Haml
mit
patbl/Skillshare.im,patbl/Skillshare.im,patbl/Skillshare.im
haml
## Code Before: - if params["category"] == "career" || @proposal.try(:category_list).try(:include?, "career") .top-banner %a.top-banner-clickable{ href: "http://effectivealtruismhub.com/career-help", target: "_blank" } Interested in career advice? You should also check out the career-advice page on the Effective Altruism Hub! ## Instruction: Update EA Hub career-advice link ## Code After: - if params["category"] == "career" || @proposal.try(:category_list).try(:include?, "career") .top-banner %a.top-banner-clickable{ href: "http://eahub.org/career-help", target: "_blank" } Interested in career advice? You should also check out the career-advice page on the Effective Altruism Hub!
- if params["category"] == "career" || @proposal.try(:category_list).try(:include?, "career") .top-banner - %a.top-banner-clickable{ href: "http://effectivealtruismhub.com/career-help", target: "_blank" } Interested in career advice? You should also check out the career-advice page on the Effective Altruism Hub! + %a.top-banner-clickable{ href: "http://eahub.org/career-help", target: "_blank" } + Interested in career advice? You should also check out the career-advice page on the Effective Altruism Hub!
3
1
2
1
872ceaf3394759c99f49380e6a26d3a08705d2ae
dev/git/README.md
dev/git/README.md
* [Download a specific tag with Git](http://stackoverflow.com/questions/791959/download-a-specific-tag-with-git)
* [git reset --hard HEAD leaves untracked files behind](http://stackoverflow.com/questions/4327708/git-reset-hard-head-leaves-untracked-files-behind) #### Tag * [Download a specific tag with Git](http://stackoverflow.com/questions/791959/download-a-specific-tag-with-git)
Add git reset --hard HEAD leaves untracked files behind
Add git reset --hard HEAD leaves untracked files behind
Markdown
mit
northbright/bookmarks,northbright/bookmarks,northbright/bookmarks
markdown
## Code Before: * [Download a specific tag with Git](http://stackoverflow.com/questions/791959/download-a-specific-tag-with-git) ## Instruction: Add git reset --hard HEAD leaves untracked files behind ## Code After: * [git reset --hard HEAD leaves untracked files behind](http://stackoverflow.com/questions/4327708/git-reset-hard-head-leaves-untracked-files-behind) #### Tag * [Download a specific tag with Git](http://stackoverflow.com/questions/791959/download-a-specific-tag-with-git)
+ * [git reset --hard HEAD leaves untracked files behind](http://stackoverflow.com/questions/4327708/git-reset-hard-head-leaves-untracked-files-behind) + + #### Tag * [Download a specific tag with Git](http://stackoverflow.com/questions/791959/download-a-specific-tag-with-git)
3
3
3
0
476dc6fa3d921764a9f8e95bd7f41b21d6f26d0d
app/models/concerns/historical.rb
app/models/concerns/historical.rb
require "./lib/collection_merger" module Historical extend ActiveSupport::Concern included do has_paper_trail end def has_history? !history.empty? end def history self.versions.reverse.map do |version| changeset = version.changeset.dup changeset.merge!("object" => self.class.name) changeset.merge!("event" => version.event) changeset.merge!("actor_id" => version.whodunnit) changeset.merge!("recorded_at" => version.created_at) end end def historical_merge(historical_model) CollectionMerger.new(self.history, historical_model.history) .merge(field: ->(version) { version["recorded_at"] }, order: :desc) end end
require "./lib/collection_merger" module Historical extend ActiveSupport::Concern included do has_paper_trail end def has_history? !history.empty? end def history self.versions.reverse.map do |version| changeset = version.changeset.dup changeset.merge!("object" => self.class.name) changeset.merge!("event" => version.event) changeset.merge!("actor_id" => version.whodunnit) changeset.merge!("recorded_at" => version.created_at) end end def historical_merge(historical_model) return self.history if historical_model.nil? CollectionMerger.new(self.history, historical_model.history) .merge(field: ->(version) { version["recorded_at"] }, order: :desc) end end
Return the history of the model if the other model is nil
Return the history of the model if the other model is nil
Ruby
agpl-3.0
UM-USElab/gradecraft-development,mkoon/gradecraft-development,UM-USElab/gradecraft-development,mkoon/gradecraft-development,UM-USElab/gradecraft-development,UM-USElab/gradecraft-development,mkoon/gradecraft-development
ruby
## Code Before: require "./lib/collection_merger" module Historical extend ActiveSupport::Concern included do has_paper_trail end def has_history? !history.empty? end def history self.versions.reverse.map do |version| changeset = version.changeset.dup changeset.merge!("object" => self.class.name) changeset.merge!("event" => version.event) changeset.merge!("actor_id" => version.whodunnit) changeset.merge!("recorded_at" => version.created_at) end end def historical_merge(historical_model) CollectionMerger.new(self.history, historical_model.history) .merge(field: ->(version) { version["recorded_at"] }, order: :desc) end end ## Instruction: Return the history of the model if the other model is nil ## Code After: require "./lib/collection_merger" module Historical extend ActiveSupport::Concern included do has_paper_trail end def has_history? !history.empty? end def history self.versions.reverse.map do |version| changeset = version.changeset.dup changeset.merge!("object" => self.class.name) changeset.merge!("event" => version.event) changeset.merge!("actor_id" => version.whodunnit) changeset.merge!("recorded_at" => version.created_at) end end def historical_merge(historical_model) return self.history if historical_model.nil? CollectionMerger.new(self.history, historical_model.history) .merge(field: ->(version) { version["recorded_at"] }, order: :desc) end end
require "./lib/collection_merger" module Historical extend ActiveSupport::Concern included do has_paper_trail end def has_history? !history.empty? end def history self.versions.reverse.map do |version| changeset = version.changeset.dup changeset.merge!("object" => self.class.name) changeset.merge!("event" => version.event) changeset.merge!("actor_id" => version.whodunnit) changeset.merge!("recorded_at" => version.created_at) end end def historical_merge(historical_model) + return self.history if historical_model.nil? + CollectionMerger.new(self.history, historical_model.history) .merge(field: ->(version) { version["recorded_at"] }, order: :desc) end end
2
0.071429
2
0
bd6cbc1b6be96e7c1e75380dfd83dfcc41864967
.travis.yml
.travis.yml
--- language: go env: - GO15VENDOREXPERIMENT=1 go: - 1.7 before_install: - go get github.com/Masterminds/glide - pip install cram --user install: - go build . before_script: - go vet -v `glide nv` script: - go test -v `glide nv` - PATH=$PWD:$PATH cram -v tests/*.t
--- language: go env: - GO15VENDOREXPERIMENT=1 go: - 1.7.5 - 1.8 before_install: - go get github.com/Masterminds/glide - pip install cram --user install: - go build . before_script: - go vet -v `glide nv` script: - go test -v `glide nv` - PATH=$PWD:$PATH cram -v tests/*.t
Add Go 1.8, and bump 1.7 to 1.7.5
Add Go 1.8, and bump 1.7 to 1.7.5
YAML
apache-2.0
square/certigo,square/certigo,square/certigo
yaml
## Code Before: --- language: go env: - GO15VENDOREXPERIMENT=1 go: - 1.7 before_install: - go get github.com/Masterminds/glide - pip install cram --user install: - go build . before_script: - go vet -v `glide nv` script: - go test -v `glide nv` - PATH=$PWD:$PATH cram -v tests/*.t ## Instruction: Add Go 1.8, and bump 1.7 to 1.7.5 ## Code After: --- language: go env: - GO15VENDOREXPERIMENT=1 go: - 1.7.5 - 1.8 before_install: - go get github.com/Masterminds/glide - pip install cram --user install: - go build . before_script: - go vet -v `glide nv` script: - go test -v `glide nv` - PATH=$PWD:$PATH cram -v tests/*.t
--- language: go env: - GO15VENDOREXPERIMENT=1 go: - - 1.7 + - 1.7.5 ? ++ + - 1.8 before_install: - go get github.com/Masterminds/glide - pip install cram --user install: - go build . before_script: - go vet -v `glide nv` script: - go test -v `glide nv` - PATH=$PWD:$PATH cram -v tests/*.t
3
0.130435
2
1
54b40237434b60daa7e25d32ebd37700c6ed7102
tools/ubuntu.sh
tools/ubuntu.sh
sudo apt-get install zsh meld ack-grep ruby clang build-essential git mercurial sudo ln -s /usr/bin/ack-grep /usr/bin/ack
set -e set -x sudo apt update sudo apt install -y zsh meld build-essential git vim silversearch-ag libelf-dev dkms curl cp -i vimrc ~/.vimrc cp -i -r vim ~/.vim cp -i zshrc ~/.zshrc cp -i zlogout ~/.zlogout cp -i zlocal ~/.zlocal cp -i -r fonts ~/.fonts cp -i nanorc ~/.nanorc cp -i tmux.conf ~/.tmux.conf chsh -s /bin/zsh git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim vim +PluginInstall +qall
Update Ubuntu script to actually setup the system
Update Ubuntu script to actually setup the system
Shell
mit
sirnuke/unix-settings,sirnuke/unix-settings
shell
## Code Before: sudo apt-get install zsh meld ack-grep ruby clang build-essential git mercurial sudo ln -s /usr/bin/ack-grep /usr/bin/ack ## Instruction: Update Ubuntu script to actually setup the system ## Code After: set -e set -x sudo apt update sudo apt install -y zsh meld build-essential git vim silversearch-ag libelf-dev dkms curl cp -i vimrc ~/.vimrc cp -i -r vim ~/.vim cp -i zshrc ~/.zshrc cp -i zlogout ~/.zlogout cp -i zlocal ~/.zlocal cp -i -r fonts ~/.fonts cp -i nanorc ~/.nanorc cp -i tmux.conf ~/.tmux.conf chsh -s /bin/zsh git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim vim +PluginInstall +qall
- sudo apt-get install zsh meld ack-grep ruby clang build-essential git mercurial - sudo ln -s /usr/bin/ack-grep /usr/bin/ack + set -e + set -x + + sudo apt update + sudo apt install -y zsh meld build-essential git vim silversearch-ag libelf-dev dkms curl + + cp -i vimrc ~/.vimrc + cp -i -r vim ~/.vim + cp -i zshrc ~/.zshrc + cp -i zlogout ~/.zlogout + cp -i zlocal ~/.zlocal + cp -i -r fonts ~/.fonts + cp -i nanorc ~/.nanorc + cp -i tmux.conf ~/.tmux.conf + + chsh -s /bin/zsh + + git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim + vim +PluginInstall +qall
21
10.5
19
2
5fb406194e2ae83205b502a97d62c4fab2af48c7
settings/lk/scratch.clj
settings/lk/scratch.clj
(ns scratch (:require [clojure.test :as test] [clojure.repl :as repl] [eftest.runner :as eftest] [clojure.tools.namespace.find :as ns.find] [clojure.tools.namespace.repl :as ns.repl] [clojure.java.io :as io]) (:import (java.io File))) (defn init! [] (ns.repl/disable-reload! *ns*)) (def refresh ns.repl/refresh) (def refresh-all ns.repl/refresh-all) (defn list-ns "Return list of symbols of namespaces found in src dir" [] (ns.find/find-namespaces-in-dir (File. "./src/"))) (defn t "Reload and run tests. Without arguments run all tests. If argument is passed (String) is interpreted as a regex to find a namespace" ([] (refresh) (eftest/run-tests (eftest/find-tests "test"))) ([pattern] (let [regex (re-pattern pattern) nss (filter (fn [v] (re-find regex (str v))) (eftest/find-tests "test"))] (refresh) (eftest/run-tests nss)))) (println "yo") (init!)
(ns scratch (:require [clojure.test :as test] [clojure.repl :as repl] [eftest.runner :as eftest] [clojure.tools.namespace.find :as ns.find] [clojure.tools.namespace.repl :as ns.repl] [clojure.java.io :as io]) (:import (java.io File))) (def multithread (atom false)) (defn init! [] (ns.repl/disable-reload! *ns*)) (def refresh ns.repl/refresh) (def refresh-all ns.repl/refresh-all) (defn list-ns "Return list of symbols of namespaces found in src dir" [] (ns.find/find-namespaces-in-dir (File. "./src/"))) (defn t "Reload and run tests. Without arguments run all tests. If argument is passed (String) is interpreted as a regex to find a namespace" ([] (refresh) (eftest/run-tests (eftest/find-tests "test") {:multithread? @multithread})) ([pattern] (let [regex (re-pattern pattern) nss (filter (fn [v] (re-find regex (str v))) (eftest/find-tests "test"))] (refresh) (eftest/run-tests nss {:multithread? @multithread})))) (println "yo") (init!)
Disable eftest multi threading by default
Disable eftest multi threading by default
Clojure
mit
lukaszkorecki/cult-leader
clojure
## Code Before: (ns scratch (:require [clojure.test :as test] [clojure.repl :as repl] [eftest.runner :as eftest] [clojure.tools.namespace.find :as ns.find] [clojure.tools.namespace.repl :as ns.repl] [clojure.java.io :as io]) (:import (java.io File))) (defn init! [] (ns.repl/disable-reload! *ns*)) (def refresh ns.repl/refresh) (def refresh-all ns.repl/refresh-all) (defn list-ns "Return list of symbols of namespaces found in src dir" [] (ns.find/find-namespaces-in-dir (File. "./src/"))) (defn t "Reload and run tests. Without arguments run all tests. If argument is passed (String) is interpreted as a regex to find a namespace" ([] (refresh) (eftest/run-tests (eftest/find-tests "test"))) ([pattern] (let [regex (re-pattern pattern) nss (filter (fn [v] (re-find regex (str v))) (eftest/find-tests "test"))] (refresh) (eftest/run-tests nss)))) (println "yo") (init!) ## Instruction: Disable eftest multi threading by default ## Code After: (ns scratch (:require [clojure.test :as test] [clojure.repl :as repl] [eftest.runner :as eftest] [clojure.tools.namespace.find :as ns.find] [clojure.tools.namespace.repl :as ns.repl] [clojure.java.io :as io]) (:import (java.io File))) (def multithread (atom false)) (defn init! [] (ns.repl/disable-reload! *ns*)) (def refresh ns.repl/refresh) (def refresh-all ns.repl/refresh-all) (defn list-ns "Return list of symbols of namespaces found in src dir" [] (ns.find/find-namespaces-in-dir (File. "./src/"))) (defn t "Reload and run tests. Without arguments run all tests. If argument is passed (String) is interpreted as a regex to find a namespace" ([] (refresh) (eftest/run-tests (eftest/find-tests "test") {:multithread? @multithread})) ([pattern] (let [regex (re-pattern pattern) nss (filter (fn [v] (re-find regex (str v))) (eftest/find-tests "test"))] (refresh) (eftest/run-tests nss {:multithread? @multithread})))) (println "yo") (init!)
(ns scratch (:require [clojure.test :as test] [clojure.repl :as repl] [eftest.runner :as eftest] [clojure.tools.namespace.find :as ns.find] [clojure.tools.namespace.repl :as ns.repl] [clojure.java.io :as io]) (:import (java.io File))) + (def multithread (atom false)) (defn init! [] (ns.repl/disable-reload! *ns*)) (def refresh ns.repl/refresh) (def refresh-all ns.repl/refresh-all) (defn list-ns "Return list of symbols of namespaces found in src dir" [] (ns.find/find-namespaces-in-dir (File. "./src/"))) (defn t "Reload and run tests. Without arguments run all tests. If argument is passed (String) is interpreted as a regex to find a namespace" ([] (refresh) - (eftest/run-tests (eftest/find-tests "test"))) ? -- + (eftest/run-tests (eftest/find-tests "test") + {:multithread? @multithread})) ([pattern] (let [regex (re-pattern pattern) nss (filter (fn [v] (re-find regex (str v))) (eftest/find-tests "test"))] (refresh) - (eftest/run-tests nss)))) ? ---- + (eftest/run-tests nss + {:multithread? @multithread})))) (println "yo") (init!)
7
0.194444
5
2
799b4c5e2934ca4962f75dabfe13d25ceeeaa3ea
resources/ext/build-scripts/gem-list.txt
resources/ext/build-scripts/gem-list.txt
semantic_puppet 0.1.3 hocon 1.2.5 text 1.3.1 locale 2.1.2 gettext 3.2.2 fast_gettext 1.1.2 hiera-eyaml 2.1.0
semantic_puppet 0.1.3 hocon 1.2.5 text 1.3.1 locale 2.1.2 gettext 3.2.2 fast_gettext 1.1.2 hiera-eyaml 2.1.0 jrjackson 0.4.5
Revert "(SERVER-2098) Remove jrjackson gem"
Revert "(SERVER-2098) Remove jrjackson gem" This reverts commit c7cb533eb2df9840d3c5d66dd832a5f6f1b5291a, readding the JrJackson gem now that we are properly configured to not parse extreme numbers as BigDecimals.
Text
apache-2.0
puppetlabs/puppetserver,puppetlabs/puppet-server,puppetlabs/puppet-server,puppetlabs/puppetserver,puppetlabs/puppetserver,puppetlabs/puppetserver,puppetlabs/puppet-server
text
## Code Before: semantic_puppet 0.1.3 hocon 1.2.5 text 1.3.1 locale 2.1.2 gettext 3.2.2 fast_gettext 1.1.2 hiera-eyaml 2.1.0 ## Instruction: Revert "(SERVER-2098) Remove jrjackson gem" This reverts commit c7cb533eb2df9840d3c5d66dd832a5f6f1b5291a, readding the JrJackson gem now that we are properly configured to not parse extreme numbers as BigDecimals. ## Code After: semantic_puppet 0.1.3 hocon 1.2.5 text 1.3.1 locale 2.1.2 gettext 3.2.2 fast_gettext 1.1.2 hiera-eyaml 2.1.0 jrjackson 0.4.5
semantic_puppet 0.1.3 hocon 1.2.5 text 1.3.1 locale 2.1.2 gettext 3.2.2 fast_gettext 1.1.2 hiera-eyaml 2.1.0 + jrjackson 0.4.5
1
0.142857
1
0
8eb7bdbb5e5bee2cc350f740430fb20432221a86
movie_page_scraper.rb
movie_page_scraper.rb
require 'nokogiri' require 'rest-client' # Scrapes a movie's mubi page for information not provided by the API class MoviePageScraper def initialize(id) @doc = Nokogiri::HTML RestClient.get "https://mubi.com/films/#{id}" end def release_country @release_country ||= # The line is in the form country, year @doc.css('.film-show__country-year').text.strip.split(',').first end def genres @genres ||= begin text = @doc.css('.film-show__genres').text.strip # Split the comma separated list of values and trim the spaces text.split(',').map(&:strip) end end # In minutes def runtime @runtime ||= @doc.css('.film-show__film-meta').text.strip.to_i end def synopsis @synopsis ||= # Synopsis is in the form Synopsis\n<synopsis copy>. We want the copy. @doc.css('.film-show__descriptions__synopsis').text.strip.split("\n")[1] end def rating @rating ||= @doc.css('.film-show__average-rating-overall').text.strip.to_f end end
require 'nokogiri' require 'rest-client' # Scrapes a movie's mubi page for information not provided by the API class MoviePageScraper CSS_SELECTORS = { release_country: '.film-show__country-year', genres: '.film-show__genres', runtime: '.film-show__film-meta', synopsis: '.film-show__descriptions__synopsis', rating: '.film-show__average-rating-overall' }.freeze def initialize(id) @doc = Nokogiri::HTML RestClient.get "https://mubi.com/films/#{id}" end def release_country @release_country ||= # The line is in the form country, year @doc.css(CSS_SELECTORS[:release_country]).text.strip.split(',').first end def genres @genres ||= begin text = @doc.css(CSS_SELECTORS[:genres]).text.strip # Genres are comma separated text.split(',').map(&:strip) end end # In minutes def runtime @runtime ||= @doc.css(CSS_SELECTORS[:runtime]).text.strip.to_i end def synopsis @synopsis ||= # Synopsis is in the form Synopsis\n<synopsis copy>. We want the copy. @doc.css(CSS_SELECTORS[:synopsis]).text.strip.split("\n")[1] end def rating @rating ||= @doc.css(CSS_SELECTORS[:rating]).text.strip.to_f end end
Refactor css selectors This will hopefully make them easier to change if the site breaks.
Refactor css selectors This will hopefully make them easier to change if the site breaks.
Ruby
mit
mpace965/edgar-wright-top-movies
ruby
## Code Before: require 'nokogiri' require 'rest-client' # Scrapes a movie's mubi page for information not provided by the API class MoviePageScraper def initialize(id) @doc = Nokogiri::HTML RestClient.get "https://mubi.com/films/#{id}" end def release_country @release_country ||= # The line is in the form country, year @doc.css('.film-show__country-year').text.strip.split(',').first end def genres @genres ||= begin text = @doc.css('.film-show__genres').text.strip # Split the comma separated list of values and trim the spaces text.split(',').map(&:strip) end end # In minutes def runtime @runtime ||= @doc.css('.film-show__film-meta').text.strip.to_i end def synopsis @synopsis ||= # Synopsis is in the form Synopsis\n<synopsis copy>. We want the copy. @doc.css('.film-show__descriptions__synopsis').text.strip.split("\n")[1] end def rating @rating ||= @doc.css('.film-show__average-rating-overall').text.strip.to_f end end ## Instruction: Refactor css selectors This will hopefully make them easier to change if the site breaks. ## Code After: require 'nokogiri' require 'rest-client' # Scrapes a movie's mubi page for information not provided by the API class MoviePageScraper CSS_SELECTORS = { release_country: '.film-show__country-year', genres: '.film-show__genres', runtime: '.film-show__film-meta', synopsis: '.film-show__descriptions__synopsis', rating: '.film-show__average-rating-overall' }.freeze def initialize(id) @doc = Nokogiri::HTML RestClient.get "https://mubi.com/films/#{id}" end def release_country @release_country ||= # The line is in the form country, year @doc.css(CSS_SELECTORS[:release_country]).text.strip.split(',').first end def genres @genres ||= begin text = @doc.css(CSS_SELECTORS[:genres]).text.strip # Genres are comma separated text.split(',').map(&:strip) end end # In minutes def runtime @runtime ||= @doc.css(CSS_SELECTORS[:runtime]).text.strip.to_i end def synopsis @synopsis ||= # Synopsis is in the form Synopsis\n<synopsis copy>. We want the copy. @doc.css(CSS_SELECTORS[:synopsis]).text.strip.split("\n")[1] end def rating @rating ||= @doc.css(CSS_SELECTORS[:rating]).text.strip.to_f end end
require 'nokogiri' require 'rest-client' # Scrapes a movie's mubi page for information not provided by the API class MoviePageScraper + CSS_SELECTORS = { + release_country: '.film-show__country-year', + genres: '.film-show__genres', + runtime: '.film-show__film-meta', + synopsis: '.film-show__descriptions__synopsis', + rating: '.film-show__average-rating-overall' + }.freeze + def initialize(id) @doc = Nokogiri::HTML RestClient.get "https://mubi.com/films/#{id}" end def release_country @release_country ||= # The line is in the form country, year - @doc.css('.film-show__country-year').text.strip.split(',').first + @doc.css(CSS_SELECTORS[:release_country]).text.strip.split(',').first end def genres @genres ||= begin - text = @doc.css('.film-show__genres').text.strip + text = @doc.css(CSS_SELECTORS[:genres]).text.strip - # Split the comma separated list of values and trim the spaces + # Genres are comma separated text.split(',').map(&:strip) end end # In minutes def runtime - @runtime ||= @doc.css('.film-show__film-meta').text.strip.to_i + @runtime ||= @doc.css(CSS_SELECTORS[:runtime]).text.strip.to_i end def synopsis @synopsis ||= # Synopsis is in the form Synopsis\n<synopsis copy>. We want the copy. - @doc.css('.film-show__descriptions__synopsis').text.strip.split("\n")[1] + @doc.css(CSS_SELECTORS[:synopsis]).text.strip.split("\n")[1] end def rating - @rating ||= @doc.css('.film-show__average-rating-overall').text.strip.to_f + @rating ||= @doc.css(CSS_SELECTORS[:rating]).text.strip.to_f end end
20
0.512821
14
6
34d3a2aa3474433e6d4c4c85b7c7c971688209a4
Server/src/main/java/me/jesensky/dan/playertracker/util/DatabaseManager.java
Server/src/main/java/me/jesensky/dan/playertracker/util/DatabaseManager.java
package me.jesensky.dan.playertracker.util; import com.mysql.jdbc.MySQLConnection; import com.mysql.jdbc.jdbc2.optional.MysqlDataSource; import javax.sql.DataSource; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class DatabaseManager { private Connection connection; private String host; private String username; private String password; private String table; private String db; private int port; public DatabaseManager(String host, int port, String user, String password, String table, String db, String defaults) throws SQLException { this.host = host; this.port = port; this.username = user; this.password = password; this.table = table; this.db = db; this.connect(defaults); } private void connect(String defaults){ MysqlDataSource d = new MysqlDataSource(); d.setUser(this.username); d.setPassword(this.password); d.setServerName(this.host); d.setPort(this.port); d.setDatabaseName(this.db); } private void connect(){ } }
package me.jesensky.dan.playertracker.util; import com.mysql.jdbc.jdbc2.optional.MysqlDataSource; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; public class DatabaseManager { private Connection connection; private String host; private String username; private String password; private String table; private String db; private int port; public static final String PLAYER_DB_DEFAULT = "SELECT * FROM information_schema.tables WHERE table_schema = '?' AND table_name = 'players' LIMIT 1;"; public static final String USER_DB_DEFAULT = "SELECT * FROM information_schema.tables WHERE table_schema = '?' AND table_name = 'users' LIMIT 1;"; public DatabaseManager(String host, int port, String user, String password, String db, String table) throws SQLException { super(); this.host = host; this.port = port; this.username = user; this.password = password; this.table = table; this.db = db; } public void connect(String defaults, String... args) throws SQLException{ this.connect(); PreparedStatement statement = this.connection.prepareStatement(defaults); for(int x = 0; x < args.length; x++) try { statement.setInt(x, Integer.parseInt(args[x])); }catch(NumberFormatException e){ statement.setString(x, args[x]); } statement.execute(); statement.close(); } public void connect() throws SQLException{ MysqlDataSource d = new MysqlDataSource(); d.setUser(this.username); d.setPassword(this.password); d.setServerName(this.host); d.setPort(this.port); d.setDatabaseName(this.db); this.connection = d.getConnection(); } public PreparedStatement prepareStatement(String sql) throws SQLException{ return this.connection.prepareStatement(sql); } }
Rewrite part of how the database manager works (specifically defaults)
Rewrite part of how the database manager works (specifically defaults)
Java
artistic-2.0
14jesenskyd/PlayerTracker-Java
java
## Code Before: package me.jesensky.dan.playertracker.util; import com.mysql.jdbc.MySQLConnection; import com.mysql.jdbc.jdbc2.optional.MysqlDataSource; import javax.sql.DataSource; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class DatabaseManager { private Connection connection; private String host; private String username; private String password; private String table; private String db; private int port; public DatabaseManager(String host, int port, String user, String password, String table, String db, String defaults) throws SQLException { this.host = host; this.port = port; this.username = user; this.password = password; this.table = table; this.db = db; this.connect(defaults); } private void connect(String defaults){ MysqlDataSource d = new MysqlDataSource(); d.setUser(this.username); d.setPassword(this.password); d.setServerName(this.host); d.setPort(this.port); d.setDatabaseName(this.db); } private void connect(){ } } ## Instruction: Rewrite part of how the database manager works (specifically defaults) ## Code After: package me.jesensky.dan.playertracker.util; import com.mysql.jdbc.jdbc2.optional.MysqlDataSource; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; public class DatabaseManager { private Connection connection; private String host; private String username; private String password; private String table; private String db; private int port; public static final String PLAYER_DB_DEFAULT = "SELECT * FROM information_schema.tables WHERE table_schema = '?' AND table_name = 'players' LIMIT 1;"; public static final String USER_DB_DEFAULT = "SELECT * FROM information_schema.tables WHERE table_schema = '?' AND table_name = 'users' LIMIT 1;"; public DatabaseManager(String host, int port, String user, String password, String db, String table) throws SQLException { super(); this.host = host; this.port = port; this.username = user; this.password = password; this.table = table; this.db = db; } public void connect(String defaults, String... args) throws SQLException{ this.connect(); PreparedStatement statement = this.connection.prepareStatement(defaults); for(int x = 0; x < args.length; x++) try { statement.setInt(x, Integer.parseInt(args[x])); }catch(NumberFormatException e){ statement.setString(x, args[x]); } statement.execute(); statement.close(); } public void connect() throws SQLException{ MysqlDataSource d = new MysqlDataSource(); d.setUser(this.username); d.setPassword(this.password); d.setServerName(this.host); d.setPort(this.port); d.setDatabaseName(this.db); this.connection = d.getConnection(); } public PreparedStatement prepareStatement(String sql) throws SQLException{ return this.connection.prepareStatement(sql); } }
package me.jesensky.dan.playertracker.util; - import com.mysql.jdbc.MySQLConnection; import com.mysql.jdbc.jdbc2.optional.MysqlDataSource; - import javax.sql.DataSource; import java.sql.Connection; - import java.sql.DriverManager; + import java.sql.PreparedStatement; import java.sql.SQLException; public class DatabaseManager { private Connection connection; private String host; private String username; private String password; private String table; private String db; private int port; + public static final String PLAYER_DB_DEFAULT = "SELECT * FROM information_schema.tables WHERE table_schema = '?' AND table_name = 'players' LIMIT 1;"; + public static final String USER_DB_DEFAULT = "SELECT * FROM information_schema.tables WHERE table_schema = '?' AND table_name = 'users' LIMIT 1;"; - public DatabaseManager(String host, int port, String user, String password, String table, String db, String defaults) throws SQLException { ? -------------- ^ ------ + public DatabaseManager(String host, int port, String user, String password, String db, String table) throws SQLException { ? ^^^^ + super(); this.host = host; this.port = port; this.username = user; this.password = password; this.table = table; this.db = db; - this.connect(defaults); } - private void connect(String defaults){ + public void connect(String defaults, String... args) throws SQLException{ + this.connect(); + PreparedStatement statement = this.connection.prepareStatement(defaults); + for(int x = 0; x < args.length; x++) + try { + statement.setInt(x, Integer.parseInt(args[x])); + }catch(NumberFormatException e){ + statement.setString(x, args[x]); + } + statement.execute(); + statement.close(); + } + + public void connect() throws SQLException{ MysqlDataSource d = new MysqlDataSource(); d.setUser(this.username); d.setPassword(this.password); d.setServerName(this.host); d.setPort(this.port); d.setDatabaseName(this.db); + this.connection = d.getConnection(); } - private void connect(){ - + public PreparedStatement prepareStatement(String sql) throws SQLException{ + return this.connection.prepareStatement(sql); } }
30
0.714286
22
8
8626951cd346e687b3e707318ec98ce4da3f9c6d
config/initializers/exception_notification.rb
config/initializers/exception_notification.rb
unless Rails.env.development? or Rails.env.test? Rails.application.config.middleware.use ExceptionNotifier, :email_prefix => "[#{Rails.application.to_s.split('::').first}] ", :sender_address => %{"Winston Smith-Churchill" <winston@alphagov.co.uk>}, :exception_recipients => %w{govuk-publishing-platform-notifications@digital.cabinet-office.gov.uk} end
unless Rails.env.development? or Rails.env.test? Rails.application.config.middleware.use ExceptionNotifier, :email_prefix => "[#{Rails.application.to_s.split('::').first}] ", :sender_address => %{"Winston Smith-Churchill" <winston@alphagov.co.uk>}, :exception_recipients => %w{govuk-dev@digital.cabinet-office.gov.uk} end
Revert "Use notification email address" Wrong email address.
Revert "Use notification email address" Wrong email address. This reverts commit 3f1622900b95398017aae49d8887cd2d6abb6118.
Ruby
mit
gds-attic/need-o-tron,gds-attic/need-o-tron,gds-attic/need-o-tron
ruby
## Code Before: unless Rails.env.development? or Rails.env.test? Rails.application.config.middleware.use ExceptionNotifier, :email_prefix => "[#{Rails.application.to_s.split('::').first}] ", :sender_address => %{"Winston Smith-Churchill" <winston@alphagov.co.uk>}, :exception_recipients => %w{govuk-publishing-platform-notifications@digital.cabinet-office.gov.uk} end ## Instruction: Revert "Use notification email address" Wrong email address. This reverts commit 3f1622900b95398017aae49d8887cd2d6abb6118. ## Code After: unless Rails.env.development? or Rails.env.test? Rails.application.config.middleware.use ExceptionNotifier, :email_prefix => "[#{Rails.application.to_s.split('::').first}] ", :sender_address => %{"Winston Smith-Churchill" <winston@alphagov.co.uk>}, :exception_recipients => %w{govuk-dev@digital.cabinet-office.gov.uk} end
unless Rails.env.development? or Rails.env.test? Rails.application.config.middleware.use ExceptionNotifier, :email_prefix => "[#{Rails.application.to_s.split('::').first}] ", :sender_address => %{"Winston Smith-Churchill" <winston@alphagov.co.uk>}, - :exception_recipients => %w{govuk-publishing-platform-notifications@digital.cabinet-office.gov.uk} ? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + :exception_recipients => %w{govuk-dev@digital.cabinet-office.gov.uk} ? ^^^ end
2
0.333333
1
1
80c24f86d0ed9655f74c710f11a59bc050df5432
app/assets/javascripts/spree/apps/checkout/checkout_controller.js
app/assets/javascripts/spree/apps/checkout/checkout_controller.js
SpreeStore.module('Checkout',function(Checkout, SpreeStore, Backbone,Marionette,$,_){ Checkout.Controller = { show: function(state) { SpreeStore.noSidebar() order = new SpreeStore.Models.Order({ number: SpreeStore.current_order_id }) order.fetch({ data: $.param({ order_token: SpreeStore.current_order_token}), success: function(order) { if (order.attributes.state == "complete") { SpreeStore.navigate("/orders/" + order.attributes.number, true) } else { Checkout.Controller.renderFor(order, state) } } }) }, renderFor: function(order, state) { state = state || order.attributes.state SpreeStore.navigate("/checkout/" + state) orderView = Checkout[state + 'View'] if (orderView != undefined) { SpreeStore.mainRegion.show(new orderView({model: order})) } else { SpreeStore.navigate("/checkout/" + order.attributes.state) this.renderFor(order, order.attributes.state) } } } })
SpreeStore.module('Checkout',function(Checkout, SpreeStore, Backbone,Marionette,$,_){ Checkout.Controller = { show: function(state) { SpreeStore.noSidebar() order = new SpreeStore.Models.Order({ number: SpreeStore.current_order_id }) order.fetch({ data: $.param({ order_token: SpreeStore.current_order_token}), success: function(order) { if (order.attributes.state == "complete") { window.localStorage.removeItem('current_order_id'); window.localStorage.removeItem('current_order_token'); SpreeStore.navigate("/orders/" + order.attributes.number, true) } else { Checkout.Controller.renderFor(order, state) } } }) }, renderFor: function(order, state) { state = state || order.attributes.state SpreeStore.navigate("/checkout/" + state) orderView = Checkout[state + 'View'] if (orderView != undefined) { SpreeStore.mainRegion.show(new orderView({model: order})) } else { SpreeStore.navigate("/checkout/" + order.attributes.state) this.renderFor(order, order.attributes.state) } } } })
Clear localStorage order variables when order is complete
Clear localStorage order variables when order is complete
JavaScript
bsd-3-clause
njaw/spree,njaw/spree,njaw/spree
javascript
## Code Before: SpreeStore.module('Checkout',function(Checkout, SpreeStore, Backbone,Marionette,$,_){ Checkout.Controller = { show: function(state) { SpreeStore.noSidebar() order = new SpreeStore.Models.Order({ number: SpreeStore.current_order_id }) order.fetch({ data: $.param({ order_token: SpreeStore.current_order_token}), success: function(order) { if (order.attributes.state == "complete") { SpreeStore.navigate("/orders/" + order.attributes.number, true) } else { Checkout.Controller.renderFor(order, state) } } }) }, renderFor: function(order, state) { state = state || order.attributes.state SpreeStore.navigate("/checkout/" + state) orderView = Checkout[state + 'View'] if (orderView != undefined) { SpreeStore.mainRegion.show(new orderView({model: order})) } else { SpreeStore.navigate("/checkout/" + order.attributes.state) this.renderFor(order, order.attributes.state) } } } }) ## Instruction: Clear localStorage order variables when order is complete ## Code After: SpreeStore.module('Checkout',function(Checkout, SpreeStore, Backbone,Marionette,$,_){ Checkout.Controller = { show: function(state) { SpreeStore.noSidebar() order = new SpreeStore.Models.Order({ number: SpreeStore.current_order_id }) order.fetch({ data: $.param({ order_token: SpreeStore.current_order_token}), success: function(order) { if (order.attributes.state == "complete") { window.localStorage.removeItem('current_order_id'); window.localStorage.removeItem('current_order_token'); SpreeStore.navigate("/orders/" + order.attributes.number, true) } else { Checkout.Controller.renderFor(order, state) } } }) }, renderFor: function(order, state) { state = state || order.attributes.state SpreeStore.navigate("/checkout/" + state) orderView = Checkout[state + 'View'] if (orderView != undefined) { SpreeStore.mainRegion.show(new orderView({model: order})) } else { SpreeStore.navigate("/checkout/" + order.attributes.state) this.renderFor(order, order.attributes.state) } } } })
SpreeStore.module('Checkout',function(Checkout, SpreeStore, Backbone,Marionette,$,_){ Checkout.Controller = { show: function(state) { SpreeStore.noSidebar() order = new SpreeStore.Models.Order({ number: SpreeStore.current_order_id }) order.fetch({ data: $.param({ order_token: SpreeStore.current_order_token}), success: function(order) { if (order.attributes.state == "complete") { + window.localStorage.removeItem('current_order_id'); + window.localStorage.removeItem('current_order_token'); SpreeStore.navigate("/orders/" + order.attributes.number, true) } else { Checkout.Controller.renderFor(order, state) } } }) }, renderFor: function(order, state) { state = state || order.attributes.state SpreeStore.navigate("/checkout/" + state) orderView = Checkout[state + 'View'] if (orderView != undefined) { SpreeStore.mainRegion.show(new orderView({model: order})) } else { SpreeStore.navigate("/checkout/" + order.attributes.state) this.renderFor(order, order.attributes.state) } } } })
2
0.066667
2
0
4887c076413582ca447e7248551778e3259c43fc
src/compose.js
src/compose.js
import { compose, composeWithTracker } from 'react-komposer' import { inject } from '@mindhive/di' export const withAsync = (asyncFunc, shouldResubscribe) => compose( inject((appContext, ownProps, onData) => { const pushProps = (props = {}) => onData(null, props) asyncFunc(appContext, pushProps, ownProps) }), null, null, { shouldResubscribe }, ) /* Inside meteorDataUsingFunc calls to Meteor reactive calls are tracked, and meteorDataUsingFunc rerun if the result of those Meteor calls changes meteorDataUsingFunc: (appContext, pushProps, ownProps) Call pushProps with the props to push to the child component. Note: we don't use the loading and error component of react-komposer. Push that data through props to handle it nicely. */ export const withLiveData = (meteorDataUsingFunc) => composeWithTracker( inject((appContext, ownProps, onData) => { const pushProps = (props = {}) => onData(null, props) meteorDataUsingFunc(appContext, pushProps, ownProps) }) )
import { compose, composeWithTracker } from 'react-komposer' import { inject } from '@mindhive/di' const Empty = () => null export const withAsync = (asyncFunc, shouldResubscribe) => compose( inject((appContext, ownProps, onData) => { const pushProps = (props = {}) => onData(null, props) asyncFunc(appContext, pushProps, ownProps) }), Empty, null, { shouldResubscribe }, ) /* Inside meteorDataUsingFunc calls to Meteor reactive calls are tracked, and meteorDataUsingFunc rerun if the result of those Meteor calls changes meteorDataUsingFunc: (appContext, pushProps, ownProps) Call pushProps with the props to push to the child component. Note: we don't use the loading and error component of react-komposer. Push that data through props to handle it nicely. */ export const withLiveData = (meteorDataUsingFunc) => composeWithTracker( inject((appContext, ownProps, onData) => { const pushProps = (props = {}) => onData(null, props) meteorDataUsingFunc(appContext, pushProps, ownProps) }), Empty, )
Stop Loading... component displaying from react-komposer
Stop Loading... component displaying from react-komposer
JavaScript
mit
mindhivenz/meteor-base,mindhivenz/meteor-base
javascript
## Code Before: import { compose, composeWithTracker } from 'react-komposer' import { inject } from '@mindhive/di' export const withAsync = (asyncFunc, shouldResubscribe) => compose( inject((appContext, ownProps, onData) => { const pushProps = (props = {}) => onData(null, props) asyncFunc(appContext, pushProps, ownProps) }), null, null, { shouldResubscribe }, ) /* Inside meteorDataUsingFunc calls to Meteor reactive calls are tracked, and meteorDataUsingFunc rerun if the result of those Meteor calls changes meteorDataUsingFunc: (appContext, pushProps, ownProps) Call pushProps with the props to push to the child component. Note: we don't use the loading and error component of react-komposer. Push that data through props to handle it nicely. */ export const withLiveData = (meteorDataUsingFunc) => composeWithTracker( inject((appContext, ownProps, onData) => { const pushProps = (props = {}) => onData(null, props) meteorDataUsingFunc(appContext, pushProps, ownProps) }) ) ## Instruction: Stop Loading... component displaying from react-komposer ## Code After: import { compose, composeWithTracker } from 'react-komposer' import { inject } from '@mindhive/di' const Empty = () => null export const withAsync = (asyncFunc, shouldResubscribe) => compose( inject((appContext, ownProps, onData) => { const pushProps = (props = {}) => onData(null, props) asyncFunc(appContext, pushProps, ownProps) }), Empty, null, { shouldResubscribe }, ) /* Inside meteorDataUsingFunc calls to Meteor reactive calls are tracked, and meteorDataUsingFunc rerun if the result of those Meteor calls changes meteorDataUsingFunc: (appContext, pushProps, ownProps) Call pushProps with the props to push to the child component. Note: we don't use the loading and error component of react-komposer. Push that data through props to handle it nicely. */ export const withLiveData = (meteorDataUsingFunc) => composeWithTracker( inject((appContext, ownProps, onData) => { const pushProps = (props = {}) => onData(null, props) meteorDataUsingFunc(appContext, pushProps, ownProps) }), Empty, )
import { compose, composeWithTracker } from 'react-komposer' import { inject } from '@mindhive/di' + + const Empty = () => null export const withAsync = (asyncFunc, shouldResubscribe) => compose( inject((appContext, ownProps, onData) => { const pushProps = (props = {}) => onData(null, props) asyncFunc(appContext, pushProps, ownProps) }), + Empty, - null, null, ? ------ + null, { shouldResubscribe }, ) /* Inside meteorDataUsingFunc calls to Meteor reactive calls are tracked, and meteorDataUsingFunc rerun if the result of those Meteor calls changes meteorDataUsingFunc: (appContext, pushProps, ownProps) Call pushProps with the props to push to the child component. Note: we don't use the loading and error component of react-komposer. Push that data through props to handle it nicely. */ export const withLiveData = (meteorDataUsingFunc) => composeWithTracker( inject((appContext, ownProps, onData) => { const pushProps = (props = {}) => onData(null, props) meteorDataUsingFunc(appContext, pushProps, ownProps) - }) + }), ? + + Empty, )
8
0.235294
6
2
11d5bc30e387972e35c55eee9f638e7e8c7d5d09
config.reek
config.reek
IrresponsibleModule: enabled: false UncommunicativeVariableName: enabled: true exclude: [] reject: - !ruby/regexp /[0-9]$/ - !ruby/regexp /[A-Z]/ accept: - _ # Removed " - !ruby/regexp /^.$/" to allow single character (frequent at loops and maps)
IrresponsibleModule: enabled: false DuplicateMethodCall: enabled: true exclude: [] max_calls: 2 allow_calls: [] UncommunicativeVariableName: enabled: true exclude: [] reject: - !ruby/regexp /[0-9]$/ - !ruby/regexp /[A-Z]/ accept: - _ # Removed " - !ruby/regexp /^.$/" to allow single character (frequent at loops and maps)
Allow 2 invocations to the same method
Allow 2 invocations to the same method At least 2 is really useful for common scenarios of doing something with a value if that value is present: `my_hash['xxx'] = something.value if something.value`
YAML
bsd-3-clause
splashblot/dronedb,CartoDB/cartodb,CartoDB/cartodb,splashblot/dronedb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,splashblot/dronedb,splashblot/dronedb,splashblot/dronedb
yaml
## Code Before: IrresponsibleModule: enabled: false UncommunicativeVariableName: enabled: true exclude: [] reject: - !ruby/regexp /[0-9]$/ - !ruby/regexp /[A-Z]/ accept: - _ # Removed " - !ruby/regexp /^.$/" to allow single character (frequent at loops and maps) ## Instruction: Allow 2 invocations to the same method At least 2 is really useful for common scenarios of doing something with a value if that value is present: `my_hash['xxx'] = something.value if something.value` ## Code After: IrresponsibleModule: enabled: false DuplicateMethodCall: enabled: true exclude: [] max_calls: 2 allow_calls: [] UncommunicativeVariableName: enabled: true exclude: [] reject: - !ruby/regexp /[0-9]$/ - !ruby/regexp /[A-Z]/ accept: - _ # Removed " - !ruby/regexp /^.$/" to allow single character (frequent at loops and maps)
IrresponsibleModule: enabled: false + DuplicateMethodCall: + enabled: true + exclude: [] + max_calls: 2 + allow_calls: [] UncommunicativeVariableName: enabled: true exclude: [] reject: - !ruby/regexp /[0-9]$/ - !ruby/regexp /[A-Z]/ accept: - _ # Removed " - !ruby/regexp /^.$/" to allow single character (frequent at loops and maps)
5
0.454545
5
0
41b132d2b09ccba449766c68ffacac37b7dc06bf
examples/web3/README.md
examples/web3/README.md
This directory is an example project that shows how to use Jupyter widgets in a web context other than the notebook. This example requires a Jupyter notebook server to be running. The user is prompted with a dialog to provide the URL with a running notebook server. This example also displays read-only text area containing the code provided in the `widget_code.json`, which we used to generate the widget state. ## Try it 1. Start with a repository checkout, and run `npm install` in the root directory. 2. Run `npm run build:examples` in the root directory. 3. Change to this directory 4. Run `npm run host` 5. In a new terminal run `python -m notebook --no-browser --NotebookApp.allow_origin="*" --NotebookApp.disable_check_xsrf=True --NotebookApp.token=''` 6. In a web browser, navigate to `http://localhost:8080/` (or the address specified by the `npm run host` command)
This directory is an example project that shows how to use Jupyter widgets in a web context other than the notebook. This example requires a Jupyter notebook server to be running. The user is prompted with a dialog to provide the URL with a running notebook server. This example also displays read-only text area containing the code provided in the `widget_code.json`, which we used to generate the widget state. ## Try it 1. Start with a repository checkout, and run `npm install` in the root directory. 2. Run `npm run build:examples` in the root directory. 3. Change to this directory 4. Run `npm run host` 5. In a new terminal run `python -m notebook --no-browser --NotebookApp.allow_origin="*" --NotebookApp.disable_check_xsrf=True --NotebookApp.token=''`. **WARNING: This starts an insecure Jupyter notebook server. Do not do this in production.** 6. In a web browser, navigate to `http://localhost:8080/` (or the address specified by the `npm run host` command)
Add warning note in web3 example.
Add warning note in web3 example.
Markdown
bsd-3-clause
ipython/ipywidgets,ipython/ipywidgets,ipython/ipywidgets,ipython/ipywidgets,SylvainCorlay/ipywidgets,ipython/ipywidgets,jupyter-widgets/ipywidgets,jupyter-widgets/ipywidgets,jupyter-widgets/ipywidgets,SylvainCorlay/ipywidgets,SylvainCorlay/ipywidgets,SylvainCorlay/ipywidgets,jupyter-widgets/ipywidgets
markdown
## Code Before: This directory is an example project that shows how to use Jupyter widgets in a web context other than the notebook. This example requires a Jupyter notebook server to be running. The user is prompted with a dialog to provide the URL with a running notebook server. This example also displays read-only text area containing the code provided in the `widget_code.json`, which we used to generate the widget state. ## Try it 1. Start with a repository checkout, and run `npm install` in the root directory. 2. Run `npm run build:examples` in the root directory. 3. Change to this directory 4. Run `npm run host` 5. In a new terminal run `python -m notebook --no-browser --NotebookApp.allow_origin="*" --NotebookApp.disable_check_xsrf=True --NotebookApp.token=''` 6. In a web browser, navigate to `http://localhost:8080/` (or the address specified by the `npm run host` command) ## Instruction: Add warning note in web3 example. ## Code After: This directory is an example project that shows how to use Jupyter widgets in a web context other than the notebook. This example requires a Jupyter notebook server to be running. The user is prompted with a dialog to provide the URL with a running notebook server. This example also displays read-only text area containing the code provided in the `widget_code.json`, which we used to generate the widget state. ## Try it 1. Start with a repository checkout, and run `npm install` in the root directory. 2. Run `npm run build:examples` in the root directory. 3. Change to this directory 4. Run `npm run host` 5. In a new terminal run `python -m notebook --no-browser --NotebookApp.allow_origin="*" --NotebookApp.disable_check_xsrf=True --NotebookApp.token=''`. **WARNING: This starts an insecure Jupyter notebook server. Do not do this in production.** 6. In a web browser, navigate to `http://localhost:8080/` (or the address specified by the `npm run host` command)
This directory is an example project that shows how to use Jupyter widgets in a web context other than the notebook. This example requires a Jupyter notebook server to be running. The user is prompted with a dialog to provide the URL with a running notebook server. This example also displays read-only text area containing the code provided in the `widget_code.json`, which we used to generate the widget state. ## Try it 1. Start with a repository checkout, and run `npm install` in the root directory. 2. Run `npm run build:examples` in the root directory. 3. Change to this directory 4. Run `npm run host` - 5. In a new terminal run `python -m notebook --no-browser --NotebookApp.allow_origin="*" --NotebookApp.disable_check_xsrf=True --NotebookApp.token=''` + 5. In a new terminal run `python -m notebook --no-browser --NotebookApp.allow_origin="*" --NotebookApp.disable_check_xsrf=True --NotebookApp.token=''`. **WARNING: This starts an insecure Jupyter notebook server. Do not do this in production.** ? +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 6. In a web browser, navigate to `http://localhost:8080/` (or the address specified by the `npm run host` command)
2
0.111111
1
1
49a3869a4d1572b187b1b1e5e1ac865db3153190
src/index.css
src/index.css
@import 'highlight.js/styles/github.css'; @import 'style.css'; @import 'top-bar.css'; body { min-height: 100vh; display: flex; flex-direction: column; } main { flex-grow: 1; } .header { text-align: center; padding-bottom: 1em; } .header .avatar { border: 1px solid rgba(0,0,0,.1); border-radius: 50%; padding: 4px; } .header .title { margin: 0; /* border-bottom: 1px solid rgba(0,0,0,.1); */ /* margin-bottom: .25em; */ /* padding-bottom: .25em; */ } .header .subtitle { color: #888; font-size: .8em; } .top-bar { margin-bottom: 0; margin-top: 0; } nav.top-bar { position: sticky; top: -1px; } @media screen and (max-width: 85em) { nav.top-bar { position: inherit; top: inherit; bottom: inherit; } } @media screen and (max-width: 42em) { span.external { display: none; } }
@import 'highlight.js/styles/github.css'; @import 'style.css'; @import 'top-bar.css'; body { min-height: 100vh; display: flex; flex-direction: column; } main { flex-grow: 1; } .header { text-align: center; padding-bottom: 1em; } .header .avatar { border: 1px solid rgba(0,0,0,.1); border-radius: 50%; padding: 4px; } .header .title { margin: 0; /* border-bottom: 1px solid rgba(0,0,0,.1); */ /* margin-bottom: .25em; */ /* padding-bottom: .25em; */ } .header .subtitle { color: #888; font-size: .8em; } .top-bar { margin-bottom: 0; margin-top: 0; } nav.top-bar { position: sticky; top: -1px; } footer.top-bar { position: sticky; bottom: 1px; } @media screen and (max-width: 85em) { nav.top-bar, footer.top-bar { position: inherit; top: inherit; bottom: inherit; } } @media screen and (max-width: 42em) { span.external { display: none; } }
Revert "fix footer in printing"
Revert "fix footer in printing" This reverts commit 1afd380064683d75b7e4d336de7bd8d7ae00ba0b.
CSS
mit
bcomnes/bret.io
css
## Code Before: @import 'highlight.js/styles/github.css'; @import 'style.css'; @import 'top-bar.css'; body { min-height: 100vh; display: flex; flex-direction: column; } main { flex-grow: 1; } .header { text-align: center; padding-bottom: 1em; } .header .avatar { border: 1px solid rgba(0,0,0,.1); border-radius: 50%; padding: 4px; } .header .title { margin: 0; /* border-bottom: 1px solid rgba(0,0,0,.1); */ /* margin-bottom: .25em; */ /* padding-bottom: .25em; */ } .header .subtitle { color: #888; font-size: .8em; } .top-bar { margin-bottom: 0; margin-top: 0; } nav.top-bar { position: sticky; top: -1px; } @media screen and (max-width: 85em) { nav.top-bar { position: inherit; top: inherit; bottom: inherit; } } @media screen and (max-width: 42em) { span.external { display: none; } } ## Instruction: Revert "fix footer in printing" This reverts commit 1afd380064683d75b7e4d336de7bd8d7ae00ba0b. ## Code After: @import 'highlight.js/styles/github.css'; @import 'style.css'; @import 'top-bar.css'; body { min-height: 100vh; display: flex; flex-direction: column; } main { flex-grow: 1; } .header { text-align: center; padding-bottom: 1em; } .header .avatar { border: 1px solid rgba(0,0,0,.1); border-radius: 50%; padding: 4px; } .header .title { margin: 0; /* border-bottom: 1px solid rgba(0,0,0,.1); */ /* margin-bottom: .25em; */ /* padding-bottom: .25em; */ } .header .subtitle { color: #888; font-size: .8em; } .top-bar { margin-bottom: 0; margin-top: 0; } nav.top-bar { position: sticky; top: -1px; } footer.top-bar { position: sticky; bottom: 1px; } @media screen and (max-width: 85em) { nav.top-bar, footer.top-bar { position: inherit; top: inherit; bottom: inherit; } } @media screen and (max-width: 42em) { span.external { display: none; } }
@import 'highlight.js/styles/github.css'; @import 'style.css'; @import 'top-bar.css'; body { min-height: 100vh; display: flex; flex-direction: column; } main { flex-grow: 1; } .header { text-align: center; padding-bottom: 1em; } .header .avatar { border: 1px solid rgba(0,0,0,.1); border-radius: 50%; padding: 4px; } .header .title { margin: 0; /* border-bottom: 1px solid rgba(0,0,0,.1); */ /* margin-bottom: .25em; */ /* padding-bottom: .25em; */ } .header .subtitle { color: #888; font-size: .8em; } .top-bar { margin-bottom: 0; margin-top: 0; } nav.top-bar { position: sticky; top: -1px; } + footer.top-bar { + position: sticky; + bottom: 1px; + } + @media screen and (max-width: 85em) { - nav.top-bar { + nav.top-bar, footer.top-bar { position: inherit; top: inherit; bottom: inherit; } } @media screen and (max-width: 42em) { span.external { display: none; } }
7
0.114754
6
1
65167247a31d6ce47d3a72f85dcee0c948bc377d
.rubocop.yml
.rubocop.yml
Style/Tab: Enabled: false Style/IndentationWidth: Width: 1 Style/MultilineMethodCallIndentation: EnforcedStyle: indented AllCops: TargetRubyVersion: 2.3 Metrics/BlockLength: Exclude: - 'spec/**/*' - '*.gemspec'
Layout/Tab: Enabled: false Layout/IndentationWidth: Width: 1 Layout/MultilineMethodCallIndentation: EnforcedStyle: indented AllCops: TargetRubyVersion: 2.3 Metrics/BlockLength: Exclude: - 'spec/**/*' - '*.gemspec'
Fix scope of rules for new RuboCop
Fix scope of rules for new RuboCop
YAML
mit
AlexWayfer/flame,AlexWayfer/flame
yaml
## Code Before: Style/Tab: Enabled: false Style/IndentationWidth: Width: 1 Style/MultilineMethodCallIndentation: EnforcedStyle: indented AllCops: TargetRubyVersion: 2.3 Metrics/BlockLength: Exclude: - 'spec/**/*' - '*.gemspec' ## Instruction: Fix scope of rules for new RuboCop ## Code After: Layout/Tab: Enabled: false Layout/IndentationWidth: Width: 1 Layout/MultilineMethodCallIndentation: EnforcedStyle: indented AllCops: TargetRubyVersion: 2.3 Metrics/BlockLength: Exclude: - 'spec/**/*' - '*.gemspec'
- Style/Tab: + Layout/Tab: Enabled: false - Style/IndentationWidth: ? ^ --- + Layout/IndentationWidth: ? ^^^^^ Width: 1 - Style/MultilineMethodCallIndentation: ? ^ --- + Layout/MultilineMethodCallIndentation: ? ^^^^^ EnforcedStyle: indented AllCops: TargetRubyVersion: 2.3 Metrics/BlockLength: Exclude: - 'spec/**/*' - '*.gemspec'
6
0.428571
3
3
32575bc18fc0fddde387de7426041e16da4d85e6
scripts/extension.swift.erb
scripts/extension.swift.erb
// // <%= kls %>+Mixed.swift // Pods // // Created by Draveness. // // import Foundation public extension <%= kls %> { <% properties.each do |property| %><% cap = property.slice(0,1).capitalize + property.slice(1..-1) %> public var mixed<%= cap %>: MixedColor? { get { return getMixedColor(&Keys.<%= property %>) } set { <%= property %>= newValue?.unfold() setMixedColor(&Keys.<%= property %>, value: newValue) } } <% end %> override func updateCurrentColor() { super.updateCurrentColor() <% properties.each do |property| %><% cap = property.slice(0,1).capitalize + property.slice(1..-1) %> if let mixed<%= cap %> = mixed<%= cap %> { <%= property %> = mixed<%= cap %>.unfold() } <% end %> } }
// // <%= kls %>+Mixed.swift // Pods // // Created by Draveness. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // import Foundation public extension <%= kls %> { <% properties.each do |property| %><% cap = property.slice(0,1).capitalize + property.slice(1..-1) %> public var mixed<%= cap %>: MixedColor? { get { return getMixedColor(&Keys.<%= property %>) } set { <%= property %>= newValue?.unfold() setMixedColor(&Keys.<%= property %>, value: newValue) } } <% end %> override func updateCurrentColor() { super.updateCurrentColor() <% properties.each do |property| %><% cap = property.slice(0,1).capitalize + property.slice(1..-1) %> if let mixed<%= cap %> = mixed<%= cap %> { <%= property %> = mixed<%= cap %>.unfold() } <% end %> } }
Add file header for license
Add file header for license
HTML+ERB
mit
Draveness/NightNight,Draveness/NightNight,Draveness/NightNight
html+erb
## Code Before: // // <%= kls %>+Mixed.swift // Pods // // Created by Draveness. // // import Foundation public extension <%= kls %> { <% properties.each do |property| %><% cap = property.slice(0,1).capitalize + property.slice(1..-1) %> public var mixed<%= cap %>: MixedColor? { get { return getMixedColor(&Keys.<%= property %>) } set { <%= property %>= newValue?.unfold() setMixedColor(&Keys.<%= property %>, value: newValue) } } <% end %> override func updateCurrentColor() { super.updateCurrentColor() <% properties.each do |property| %><% cap = property.slice(0,1).capitalize + property.slice(1..-1) %> if let mixed<%= cap %> = mixed<%= cap %> { <%= property %> = mixed<%= cap %>.unfold() } <% end %> } } ## Instruction: Add file header for license ## Code After: // // <%= kls %>+Mixed.swift // Pods // // Created by Draveness. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // import Foundation public extension <%= kls %> { <% properties.each do |property| %><% cap = property.slice(0,1).capitalize + property.slice(1..-1) %> public var mixed<%= cap %>: MixedColor? { get { return getMixedColor(&Keys.<%= property %>) } set { <%= property %>= newValue?.unfold() setMixedColor(&Keys.<%= property %>, value: newValue) } } <% end %> override func updateCurrentColor() { super.updateCurrentColor() <% properties.each do |property| %><% cap = property.slice(0,1).capitalize + property.slice(1..-1) %> if let mixed<%= cap %> = mixed<%= cap %> { <%= property %> = mixed<%= cap %>.unfold() } <% end %> } }
// // <%= kls %>+Mixed.swift // Pods // // Created by Draveness. // + // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // + // + import Foundation public extension <%= kls %> { <% properties.each do |property| %><% cap = property.slice(0,1).capitalize + property.slice(1..-1) %> public var mixed<%= cap %>: MixedColor? { get { return getMixedColor(&Keys.<%= property %>) } set { <%= property %>= newValue?.unfold() setMixedColor(&Keys.<%= property %>, value: newValue) } } <% end %> override func updateCurrentColor() { super.updateCurrentColor() <% properties.each do |property| %><% cap = property.slice(0,1).capitalize + property.slice(1..-1) %> if let mixed<%= cap %> = mixed<%= cap %> { <%= property %> = mixed<%= cap %>.unfold() } <% end %> } }
12
0.387097
12
0
fdffb2d16a4a6a6f0e6f40e3771d5a1115b6edf1
extension.driver.php
extension.driver.php
<?php Class extension_Symphony_German extends Extension { /** * Extension information */ public function about() { return array( 'name' => 'German Localisation', 'type' => 'Interface', 'version' => '1.1', 'release-date' => '2010-02-01', 'author' => array( 'name' => 'Nils Hörrmann', 'website' => 'http://www.nilshoerrmann.de', 'email' => 'post@nilshoerrmann.de' ), 'description' => 'German translation for the Symphony backend', 'compatibility' => array( '2.0.0' => false, '2.0.1' => false, '2.0.2' => false, '2.0.3' => true, '2.0.4' => true, '2.0.5' => true, '2.0.6' => true, '2.0.7' => true ) ); } }
<?php Class extension_lang_german extends Extension { /** * Extension information */ public function about() { return array( 'name' => 'Language: German', 'type' => 'Localisation', 'version' => '1.1', 'release-date' => '2010-02-01', 'author' => array( 'name' => 'Nils Hörrmann', 'website' => 'http://www.nilshoerrmann.de', 'email' => 'post@nilshoerrmann.de' ), 'description' => 'Official German translation for the Symphony backend', 'compatibility' => array( '2.0.0' => false, '2.0.1' => false, '2.0.2' => false, '2.0.3' => true, '2.0.4' => true, '2.0.5' => true, '2.0.6' => true, '2.0.7' => true ) ); } }
Rename entire repository as suggested by the Symphony team
Rename entire repository as suggested by the Symphony team
PHP
mit
jonmifsud/lang_german,froschdesign/lang_german
php
## Code Before: <?php Class extension_Symphony_German extends Extension { /** * Extension information */ public function about() { return array( 'name' => 'German Localisation', 'type' => 'Interface', 'version' => '1.1', 'release-date' => '2010-02-01', 'author' => array( 'name' => 'Nils Hörrmann', 'website' => 'http://www.nilshoerrmann.de', 'email' => 'post@nilshoerrmann.de' ), 'description' => 'German translation for the Symphony backend', 'compatibility' => array( '2.0.0' => false, '2.0.1' => false, '2.0.2' => false, '2.0.3' => true, '2.0.4' => true, '2.0.5' => true, '2.0.6' => true, '2.0.7' => true ) ); } } ## Instruction: Rename entire repository as suggested by the Symphony team ## Code After: <?php Class extension_lang_german extends Extension { /** * Extension information */ public function about() { return array( 'name' => 'Language: German', 'type' => 'Localisation', 'version' => '1.1', 'release-date' => '2010-02-01', 'author' => array( 'name' => 'Nils Hörrmann', 'website' => 'http://www.nilshoerrmann.de', 'email' => 'post@nilshoerrmann.de' ), 'description' => 'Official German translation for the Symphony backend', 'compatibility' => array( '2.0.0' => false, '2.0.1' => false, '2.0.2' => false, '2.0.3' => true, '2.0.4' => true, '2.0.5' => true, '2.0.6' => true, '2.0.7' => true ) ); } }
<?php - Class extension_Symphony_German extends Extension { ? ^^^^^^ ^ ^ + Class extension_lang_german extends Extension { ? ^^ ^ ^ /** * Extension information */ public function about() { return array( + 'name' => 'Language: German', - 'name' => 'German Localisation', ? ^^^ ------- + 'type' => 'Localisation', ? ^^^ - 'type' => 'Interface', 'version' => '1.1', 'release-date' => '2010-02-01', 'author' => array( 'name' => 'Nils Hörrmann', 'website' => 'http://www.nilshoerrmann.de', 'email' => 'post@nilshoerrmann.de' ), - 'description' => 'German translation for the Symphony backend', + 'description' => 'Official German translation for the Symphony backend', ? +++++++++ 'compatibility' => array( '2.0.0' => false, '2.0.1' => false, '2.0.2' => false, '2.0.3' => true, '2.0.4' => true, '2.0.5' => true, '2.0.6' => true, '2.0.7' => true ) ); } }
8
0.228571
4
4
f5cdd574a531ed156d30efe2e06c4cf463469588
libkmod/missing.h
libkmod/missing.h
static inline int finit_module(int fd, const char *uargs, int flags) { if (__NR_finit_module == -1) { errno = ENOSYS; return -1; } return syscall(__NR_finit_module, fd, uargs, flags); } #endif #if !HAVE_DECL_STRNDUPA #define strndupa(s, length) \ ({ \ size_t __len = strnlen((s), (length)); \ strncpy(alloca(__len + 1), (s), __len); \ }) #endif
static inline int finit_module(int fd, const char *uargs, int flags) { if (__NR_finit_module == -1) { errno = ENOSYS; return -1; } return syscall(__NR_finit_module, fd, uargs, flags); } #endif #if !HAVE_DECL_STRNDUPA #define strndupa(s, n) \ ({ \ const char *__old = (s); \ size_t __len = strnlen(__old, (n)); \ char *__new = alloca(__len + 1); \ __new[__len] = '\0'; \ memcpy(__new, __old, __len); \ }) #endif
Make sure there's NUL byte at the end of strndupa
Make sure there's NUL byte at the end of strndupa Since strcpy() doesn't ensure we have a NUL byte in the resulting string, use alloca() + memcpy(). Also make sure we don't evaluate "s" twice.
C
lgpl-2.1
pmmccorm/kmod,lpereira/kmod,Distrotech/kmod,pmmccorm/kmod,pmmccorm/kmod,lucasdemarchi/kmod,lpereira/kmod,Distrotech/kmod,lucasdemarchi/kmod,Distrotech/kmod,lpereira/kmod,lucasdemarchi/kmod
c
## Code Before: static inline int finit_module(int fd, const char *uargs, int flags) { if (__NR_finit_module == -1) { errno = ENOSYS; return -1; } return syscall(__NR_finit_module, fd, uargs, flags); } #endif #if !HAVE_DECL_STRNDUPA #define strndupa(s, length) \ ({ \ size_t __len = strnlen((s), (length)); \ strncpy(alloca(__len + 1), (s), __len); \ }) #endif ## Instruction: Make sure there's NUL byte at the end of strndupa Since strcpy() doesn't ensure we have a NUL byte in the resulting string, use alloca() + memcpy(). Also make sure we don't evaluate "s" twice. ## Code After: static inline int finit_module(int fd, const char *uargs, int flags) { if (__NR_finit_module == -1) { errno = ENOSYS; return -1; } return syscall(__NR_finit_module, fd, uargs, flags); } #endif #if !HAVE_DECL_STRNDUPA #define strndupa(s, n) \ ({ \ const char *__old = (s); \ size_t __len = strnlen(__old, (n)); \ char *__new = alloca(__len + 1); \ __new[__len] = '\0'; \ memcpy(__new, __old, __len); \ }) #endif
static inline int finit_module(int fd, const char *uargs, int flags) { if (__NR_finit_module == -1) { errno = ENOSYS; return -1; } return syscall(__NR_finit_module, fd, uargs, flags); } #endif #if !HAVE_DECL_STRNDUPA - #define strndupa(s, length) \ ? -- --- ^ + #define strndupa(s, n) \ ? ^^^^^^^ - ({ \ + ({ \ + const char *__old = (s); \ - size_t __len = strnlen((s), (length)); \ ? ^^^ -- --- ^ + size_t __len = strnlen(__old, (n)); \ ? ^^^^^ ^^^ - strncpy(alloca(__len + 1), (s), __len); \ + char *__new = alloca(__len + 1); \ + __new[__len] = '\0'; \ + memcpy(__new, __old, __len); \ }) #endif
11
0.578947
7
4
2ae6048c81c73253f6a7ce251bc2644dff0b9bf9
src/rads/kafka/transit/MsgpackMessageFormatter.clj
src/rads/kafka/transit/MsgpackMessageFormatter.clj
(ns rads.kafka.transit.MsgpackMessageFormatter (:require [cognitect.transit :as transit] [clojure.java.io :as io]) (:import (kafka.common MessageFormatter) (java.io PrintStream ByteArrayInputStream) (java.util Properties) (org.apache.kafka.clients.consumer ConsumerRecord)) (:gen-class :implements [kafka.common.MessageFormatter] :constructors {[] []})) (defn -init [this ^Properties props]) (defn -writeTo [this ^ConsumerRecord record ^PrintStream output] (let [input-stream (ByteArrayInputStream. (.value record)) reader (transit/reader input-stream :msgpack)] (.println output (pr-str (transit/read reader))))) (defn -close [this])
(ns rads.kafka.transit.MsgpackMessageFormatter (:require [cognitect.transit :as transit] [clojure.java.io :as io]) (:import (kafka.common MessageFormatter) (java.io PrintStream ByteArrayInputStream) (java.util Properties) (org.apache.kafka.clients.consumer ConsumerRecord)) (:gen-class :implements [kafka.common.MessageFormatter] :init init-state :state state :constructors {[] []})) (defn -init [this ^Properties props] (swap! (.state this) assoc :props props)) (defn -init-state [] [[] (atom {:props nil})]) (defn read-transit [value] (let [input-stream (ByteArrayInputStream. value) reader (transit/reader input-stream :msgpack)] (transit/read reader))) (defn -writeTo [this ^ConsumerRecord record ^PrintStream output] (when (.get (:props @(.state this)) "print.key") (.print output (str (pr-str (read-transit (.key record))) " "))) (.println output (pr-str (read-transit (.value record))))) (defn -close [this])
Make the MessageFormatter work with keys
Make the MessageFormatter work with keys
Clojure
mit
rads/kafka.transit
clojure
## Code Before: (ns rads.kafka.transit.MsgpackMessageFormatter (:require [cognitect.transit :as transit] [clojure.java.io :as io]) (:import (kafka.common MessageFormatter) (java.io PrintStream ByteArrayInputStream) (java.util Properties) (org.apache.kafka.clients.consumer ConsumerRecord)) (:gen-class :implements [kafka.common.MessageFormatter] :constructors {[] []})) (defn -init [this ^Properties props]) (defn -writeTo [this ^ConsumerRecord record ^PrintStream output] (let [input-stream (ByteArrayInputStream. (.value record)) reader (transit/reader input-stream :msgpack)] (.println output (pr-str (transit/read reader))))) (defn -close [this]) ## Instruction: Make the MessageFormatter work with keys ## Code After: (ns rads.kafka.transit.MsgpackMessageFormatter (:require [cognitect.transit :as transit] [clojure.java.io :as io]) (:import (kafka.common MessageFormatter) (java.io PrintStream ByteArrayInputStream) (java.util Properties) (org.apache.kafka.clients.consumer ConsumerRecord)) (:gen-class :implements [kafka.common.MessageFormatter] :init init-state :state state :constructors {[] []})) (defn -init [this ^Properties props] (swap! (.state this) assoc :props props)) (defn -init-state [] [[] (atom {:props nil})]) (defn read-transit [value] (let [input-stream (ByteArrayInputStream. value) reader (transit/reader input-stream :msgpack)] (transit/read reader))) (defn -writeTo [this ^ConsumerRecord record ^PrintStream output] (when (.get (:props @(.state this)) "print.key") (.print output (str (pr-str (read-transit (.key record))) " "))) (.println output (pr-str (read-transit (.value record))))) (defn -close [this])
(ns rads.kafka.transit.MsgpackMessageFormatter (:require [cognitect.transit :as transit] [clojure.java.io :as io]) (:import (kafka.common MessageFormatter) (java.io PrintStream ByteArrayInputStream) (java.util Properties) (org.apache.kafka.clients.consumer ConsumerRecord)) (:gen-class :implements [kafka.common.MessageFormatter] + :init init-state + :state state :constructors {[] []})) - (defn -init [this ^Properties props]) ? - + (defn -init [this ^Properties props] + (swap! (.state this) assoc :props props)) + + (defn -init-state [] + [[] (atom {:props nil})]) + + (defn read-transit [value] + (let [input-stream (ByteArrayInputStream. value) + reader (transit/reader input-stream :msgpack)] + (transit/read reader))) (defn -writeTo [this ^ConsumerRecord record ^PrintStream output] - (let [input-stream (ByteArrayInputStream. (.value record)) - reader (transit/reader input-stream :msgpack)] + (when (.get (:props @(.state this)) "print.key") + (.print output (str (pr-str (read-transit (.key record))) " "))) - (.println output (pr-str (transit/read reader))))) ? -- ^^ -- ^ -- + (.println output (pr-str (read-transit (.value record))))) ? +++++ ^^^^^^^ ^^^ (defn -close [this])
19
0.904762
15
4
3fd332d3da078621354e9186ad561a44e7af5a5b
desktop/folders.csv
desktop/folders.csv
Id,Desktop,Desktop[Brazil],Desktop[Guatemala],Name,Name[en],Name[es],Name[pt],Name[zh],Icon,Icon[en],Icon[es],Icon[pt],Icon[zh] curiosity,140,140,140,Curiosity,,Curiosidades,Curiosidade,,eos-folder-curiosity,,,, games,110,110,110,Games,,Juegos,Jogos,,eos-folder-games,,,, media,100,100,100,Media,,Multimedia,Mídia,,eos-folder-media,,,, news,130,130,130,News,,Noticias,Notícias,,eos-folder-news,,,, settings,150,150,150,Settings,,Definiciones,Preferências,,eos-folder-settings,,,, work,120,120,120,Work,,Trabajo,Trabalho,,eos-folder-work,,,,
Id,Desktop,Desktop[Brazil],Desktop[Guatemala],Name,Name[en],Name[es],Name[pt],Name[zh],Icon,Icon[en],Icon[es],Icon[pt],Icon[zh] curiosity,140,140,140,Curiosity,,Curiosidades,Curiosidade,,eos-folder-curiosity,,,, games,110,110,110,Games,,Juegos,Jogos,,eos-folder-games,,,, media,100,100,100,Media,,Multimedia,Mídia,,eos-folder-media,,,, news,130,130,130,News,,Noticias,Notícias,,eos-folder-news,,,, settings,150,150,150,Settings,,Configuración,Preferências,,eos-folder-settings,,,, work,120,120,120,Work,,Trabajo,Trabalho,,eos-folder-work,,,,
Fix Spanish translation of Settings
Fix Spanish translation of Settings [endlessm/eos-shell#586]
CSV
lgpl-2.1
endlessm/eos-theme
csv
## Code Before: Id,Desktop,Desktop[Brazil],Desktop[Guatemala],Name,Name[en],Name[es],Name[pt],Name[zh],Icon,Icon[en],Icon[es],Icon[pt],Icon[zh] curiosity,140,140,140,Curiosity,,Curiosidades,Curiosidade,,eos-folder-curiosity,,,, games,110,110,110,Games,,Juegos,Jogos,,eos-folder-games,,,, media,100,100,100,Media,,Multimedia,Mídia,,eos-folder-media,,,, news,130,130,130,News,,Noticias,Notícias,,eos-folder-news,,,, settings,150,150,150,Settings,,Definiciones,Preferências,,eos-folder-settings,,,, work,120,120,120,Work,,Trabajo,Trabalho,,eos-folder-work,,,, ## Instruction: Fix Spanish translation of Settings [endlessm/eos-shell#586] ## Code After: Id,Desktop,Desktop[Brazil],Desktop[Guatemala],Name,Name[en],Name[es],Name[pt],Name[zh],Icon,Icon[en],Icon[es],Icon[pt],Icon[zh] curiosity,140,140,140,Curiosity,,Curiosidades,Curiosidade,,eos-folder-curiosity,,,, games,110,110,110,Games,,Juegos,Jogos,,eos-folder-games,,,, media,100,100,100,Media,,Multimedia,Mídia,,eos-folder-media,,,, news,130,130,130,News,,Noticias,Notícias,,eos-folder-news,,,, settings,150,150,150,Settings,,Configuración,Preferências,,eos-folder-settings,,,, work,120,120,120,Work,,Trabajo,Trabalho,,eos-folder-work,,,,
Id,Desktop,Desktop[Brazil],Desktop[Guatemala],Name,Name[en],Name[es],Name[pt],Name[zh],Icon,Icon[en],Icon[es],Icon[pt],Icon[zh] curiosity,140,140,140,Curiosity,,Curiosidades,Curiosidade,,eos-folder-curiosity,,,, games,110,110,110,Games,,Juegos,Jogos,,eos-folder-games,,,, media,100,100,100,Media,,Multimedia,Mídia,,eos-folder-media,,,, news,130,130,130,News,,Noticias,Notícias,,eos-folder-news,,,, - settings,150,150,150,Settings,,Definiciones,Preferências,,eos-folder-settings,,,, ? ^^ ^^ ^ -- + settings,150,150,150,Settings,,Configuración,Preferências,,eos-folder-settings,,,, ? ^^^ ^^^^ ^ work,120,120,120,Work,,Trabajo,Trabalho,,eos-folder-work,,,,
2
0.285714
1
1
b6c7749859a6bba20301d5b0ad01754624964829
coeus-webapp/src/main/webapp/scripts/common/global.js
coeus-webapp/src/main/webapp/scripts/common/global.js
var Kc = Kc || {}; Kc.Global = Kc.Global || {}; (function (namespace, $) { // set all modals to static behavior (clicking out does not close) $.fn.modal.Constructor.DEFAULTS.backdrop = "static"; })(Kc.Global, jQuery);
var Kc = Kc || {}; Kc.Global = Kc.Global || {}; (function (namespace, $) { // set all modals to static behavior (clicking out does not close) $.fn.modal.Constructor.DEFAULTS.backdrop = "static"; $(document).on("ready", function(){ // date conversion for date fields to full leading 0 - for days and months and to full year dates $(document).on("blur", ".uif-dateControl", function(){ var dateFormat = $.datepicker._defaults.dateFormat; var date = $(this).val(); if (!date) { return; } date = date.replace(/-/g, "/"); if (date && (date.match(/\//g) || []).length === 2) { // find the expected position and value of year in the string based on date format var year; if (dateFormat.indexOf("y") === 0) { year = date.substr(0, date.indexOf("/")); } else { year = date.substr(date.lastIndexOf("/") + 1, date.length - 1); } // when year is length of 2 append the first 2 numbers of the current full year (ie 14 -> 2014) if (year.length === 2) { var currentDate = new Date(); year = currentDate.getFullYear().toString().substr(0,2) + year; } var dateObj = new Date(date); if (isNaN(dateObj.valueOf())) { // not valid abandon conversion return; } dateObj.setFullYear(year); var formattedDate = $.datepicker.formatDate(dateFormat, dateObj); $(this).val(formattedDate); } }); }); })(Kc.Global, jQuery);
Convert non-full date to full date on loss of focus in js
[KRACOEUS-8479] Convert non-full date to full date on loss of focus in js
JavaScript
agpl-3.0
geothomasp/kcmit,geothomasp/kcmit,geothomasp/kcmit,geothomasp/kcmit,geothomasp/kcmit
javascript
## Code Before: var Kc = Kc || {}; Kc.Global = Kc.Global || {}; (function (namespace, $) { // set all modals to static behavior (clicking out does not close) $.fn.modal.Constructor.DEFAULTS.backdrop = "static"; })(Kc.Global, jQuery); ## Instruction: [KRACOEUS-8479] Convert non-full date to full date on loss of focus in js ## Code After: var Kc = Kc || {}; Kc.Global = Kc.Global || {}; (function (namespace, $) { // set all modals to static behavior (clicking out does not close) $.fn.modal.Constructor.DEFAULTS.backdrop = "static"; $(document).on("ready", function(){ // date conversion for date fields to full leading 0 - for days and months and to full year dates $(document).on("blur", ".uif-dateControl", function(){ var dateFormat = $.datepicker._defaults.dateFormat; var date = $(this).val(); if (!date) { return; } date = date.replace(/-/g, "/"); if (date && (date.match(/\//g) || []).length === 2) { // find the expected position and value of year in the string based on date format var year; if (dateFormat.indexOf("y") === 0) { year = date.substr(0, date.indexOf("/")); } else { year = date.substr(date.lastIndexOf("/") + 1, date.length - 1); } // when year is length of 2 append the first 2 numbers of the current full year (ie 14 -> 2014) if (year.length === 2) { var currentDate = new Date(); year = currentDate.getFullYear().toString().substr(0,2) + year; } var dateObj = new Date(date); if (isNaN(dateObj.valueOf())) { // not valid abandon conversion return; } dateObj.setFullYear(year); var formattedDate = $.datepicker.formatDate(dateFormat, dateObj); $(this).val(formattedDate); } }); }); })(Kc.Global, jQuery);
var Kc = Kc || {}; Kc.Global = Kc.Global || {}; (function (namespace, $) { // set all modals to static behavior (clicking out does not close) $.fn.modal.Constructor.DEFAULTS.backdrop = "static"; + + $(document).on("ready", function(){ + // date conversion for date fields to full leading 0 - for days and months and to full year dates + $(document).on("blur", ".uif-dateControl", function(){ + var dateFormat = $.datepicker._defaults.dateFormat; + var date = $(this).val(); + if (!date) { + return; + } + + date = date.replace(/-/g, "/"); + + if (date && (date.match(/\//g) || []).length === 2) { + + // find the expected position and value of year in the string based on date format + var year; + if (dateFormat.indexOf("y") === 0) { + year = date.substr(0, date.indexOf("/")); + } + else { + year = date.substr(date.lastIndexOf("/") + 1, date.length - 1); + } + + // when year is length of 2 append the first 2 numbers of the current full year (ie 14 -> 2014) + if (year.length === 2) { + var currentDate = new Date(); + year = currentDate.getFullYear().toString().substr(0,2) + year; + } + + var dateObj = new Date(date); + if (isNaN(dateObj.valueOf())) { + // not valid abandon conversion + return; + } + + dateObj.setFullYear(year); + + var formattedDate = $.datepicker.formatDate(dateFormat, dateObj); + $(this).val(formattedDate); + } + }); + }); })(Kc.Global, jQuery);
42
7
42
0
e2d51e23f530202b82ba13ae11c686deb1388435
prototype/BioID.py
prototype/BioID.py
import re import json import mmap class BioID: defs = None def __init__(self, defpath): with open(defpath, "r") as deffile: conts = deffile.read() self.defs = json.loads(conts)["formats"] @classmethod def identify(cls, files): recog = {} for file in files: with open(file, "r") as infile: buff = infile.read() mem_map = mmap.mmap(infile.fileno(), 0, mmap.MAP_PRIVATE, mmap.PROT_READ) if len(buff) == 0: recog[file] = "empty" # Empty files have no format :) continue for fdef in cls.defs: matched = True if "regexen" in fdef: for regex in fdef["regexen"]: if not re.findall(regex.replace("\\n", "\n"), buff, re.IGNORECASE): matched = False break if "bytes" in fdef: for bytes in fdef["bytes"]: if mem_map.find(bytes.decode("string_escape")) == -1: matched = False break if matched: recog[file] = fdef["name"] break mem_map.close() if file not in recog: recog[file] = "unrecognized" return recog
import re import json import mmap class BioID: defs = None def __init__(self, defpath): with open(defpath, "r") as deffile: conts = deffile.read() self.defs = json.loads(conts)["formats"] @classmethod def identify(cls, files): recog = {} for file in files: with open(file, "r") as infile: buff = infile.read() mem_map = mmap.mmap(infile.fileno(), 0, mmap.MAP_PRIVATE, mmap.PROT_READ) if len(buff) == 0: recog[file] = "empty" # Empty files have no format :) continue for fdef in cls.defs: matched = True if "regexen" in fdef: for regex in fdef["regexen"]: if not re.findall(regex.replace("\\n", "\n"), buff, re.IGNORECASE): matched = False break if "bytes" in fdef: for bytes in fdef["bytes"]: if mem_map.find(bytes.decode("string_escape")) == -1: matched = False break if matched: recog[file] = fdef["name"] break mem_map.close() if file not in recog: recog[file] = "unrecognized" return recog
Indent return in identify class.
Indent return in identify class.
Python
mit
LeeBergstrand/BioMagick,LeeBergstrand/BioMagick
python
## Code Before: import re import json import mmap class BioID: defs = None def __init__(self, defpath): with open(defpath, "r") as deffile: conts = deffile.read() self.defs = json.loads(conts)["formats"] @classmethod def identify(cls, files): recog = {} for file in files: with open(file, "r") as infile: buff = infile.read() mem_map = mmap.mmap(infile.fileno(), 0, mmap.MAP_PRIVATE, mmap.PROT_READ) if len(buff) == 0: recog[file] = "empty" # Empty files have no format :) continue for fdef in cls.defs: matched = True if "regexen" in fdef: for regex in fdef["regexen"]: if not re.findall(regex.replace("\\n", "\n"), buff, re.IGNORECASE): matched = False break if "bytes" in fdef: for bytes in fdef["bytes"]: if mem_map.find(bytes.decode("string_escape")) == -1: matched = False break if matched: recog[file] = fdef["name"] break mem_map.close() if file not in recog: recog[file] = "unrecognized" return recog ## Instruction: Indent return in identify class. ## Code After: import re import json import mmap class BioID: defs = None def __init__(self, defpath): with open(defpath, "r") as deffile: conts = deffile.read() self.defs = json.loads(conts)["formats"] @classmethod def identify(cls, files): recog = {} for file in files: with open(file, "r") as infile: buff = infile.read() mem_map = mmap.mmap(infile.fileno(), 0, mmap.MAP_PRIVATE, mmap.PROT_READ) if len(buff) == 0: recog[file] = "empty" # Empty files have no format :) continue for fdef in cls.defs: matched = True if "regexen" in fdef: for regex in fdef["regexen"]: if not re.findall(regex.replace("\\n", "\n"), buff, re.IGNORECASE): matched = False break if "bytes" in fdef: for bytes in fdef["bytes"]: if mem_map.find(bytes.decode("string_escape")) == -1: matched = False break if matched: recog[file] = fdef["name"] break mem_map.close() if file not in recog: recog[file] = "unrecognized" return recog
import re import json import mmap class BioID: - defs = None ? ^^^^ + defs = None ? ^ - def __init__(self, defpath): ? ^^^^ + def __init__(self, defpath): ? ^ - with open(defpath, "r") as deffile: ? ^^^^^^^^ + with open(defpath, "r") as deffile: ? ^^ - conts = deffile.read() + conts = deffile.read() - self.defs = json.loads(conts)["formats"] ? ^^^^^^^^ + self.defs = json.loads(conts)["formats"] ? ^^ - @classmethod ? ^^^^ + @classmethod ? ^ - def identify(cls, files): ? ^^^^ + def identify(cls, files): ? ^ - recog = {} + recog = {} - for file in files: ? ^^^^^^^^ + for file in files: ? ^^ - with open(file, "r") as infile: ? ^^^^^^^^^^^^ + with open(file, "r") as infile: ? ^^^ - buff = infile.read() + buff = infile.read() - mem_map = mmap.mmap(infile.fileno(), 0, mmap.MAP_PRIVATE, mmap.PROT_READ) ? ^^^^^^^^^^^^^^^^ + mem_map = mmap.mmap(infile.fileno(), 0, mmap.MAP_PRIVATE, mmap.PROT_READ) ? ^^^^ - if len(buff) == 0: + if len(buff) == 0: - recog[file] = "empty" # Empty files have no format :) ? ^^^^^^^^^^^^^^^^ + recog[file] = "empty" # Empty files have no format :) ? ^^^^ - continue + continue - for fdef in cls.defs: - matched = True - if "regexen" in fdef: - for regex in fdef["regexen"]: + for fdef in cls.defs: + matched = True + if "regexen" in fdef: + for regex in fdef["regexen"]: if not re.findall(regex.replace("\\n", "\n"), buff, re.IGNORECASE): - matched = False - break - if "bytes" in fdef: - for bytes in fdef["bytes"]: + matched = False + break + if "bytes" in fdef: + for bytes in fdef["bytes"]: - if mem_map.find(bytes.decode("string_escape")) == -1: ? ^^^^^^^^^^^^^^^^^^^^^^^^ + if mem_map.find(bytes.decode("string_escape")) == -1: ? ^^^^^ - matched = False - break - if matched: - recog[file] = fdef["name"] - break + matched = False + break + if matched: + recog[file] = fdef["name"] + break - mem_map.close() + mem_map.close() - if file not in recog: ? ^^^^^^^^^^^^ + if file not in recog: ? ^^ - recog[file] = "unrecognized" + recog[file] = "unrecognized" - return recog + return recog
66
1.404255
33
33
0003ef7fe3d59c4bda034dee334d45b6d7a2622d
pyvm_test.py
pyvm_test.py
import pyvm import unittest class PyVMTest(unittest.TestCase): def setUp(self): self.vm = pyvm.PythonVM() def test_load_const_num(self): self.assertEqual( 10, self.vm.eval('10') ) def test_load_const_str(self): self.assertEqual( "hoge", self.vm.eval('"hoge"') ) if __name__ == '__main__': unittest.main()
import pyvm import unittest class PyVMTest(unittest.TestCase): def setUp(self): self.vm = pyvm.PythonVM() def test_load_const_num(self): self.assertEqual( 10, self.vm.eval('10') ) def test_load_const_num_float(self): self.assertEqual( 10.55, self.vm.eval('10.55') ) def test_load_const_str(self): self.assertEqual( "hoge", self.vm.eval('"hoge"') ) if __name__ == '__main__': unittest.main()
Add test of storing float
Add test of storing float
Python
mit
utgwkk/tiny-python-vm
python
## Code Before: import pyvm import unittest class PyVMTest(unittest.TestCase): def setUp(self): self.vm = pyvm.PythonVM() def test_load_const_num(self): self.assertEqual( 10, self.vm.eval('10') ) def test_load_const_str(self): self.assertEqual( "hoge", self.vm.eval('"hoge"') ) if __name__ == '__main__': unittest.main() ## Instruction: Add test of storing float ## Code After: import pyvm import unittest class PyVMTest(unittest.TestCase): def setUp(self): self.vm = pyvm.PythonVM() def test_load_const_num(self): self.assertEqual( 10, self.vm.eval('10') ) def test_load_const_num_float(self): self.assertEqual( 10.55, self.vm.eval('10.55') ) def test_load_const_str(self): self.assertEqual( "hoge", self.vm.eval('"hoge"') ) if __name__ == '__main__': unittest.main()
import pyvm import unittest class PyVMTest(unittest.TestCase): def setUp(self): self.vm = pyvm.PythonVM() def test_load_const_num(self): self.assertEqual( 10, self.vm.eval('10') ) + def test_load_const_num_float(self): + self.assertEqual( + 10.55, + self.vm.eval('10.55') + ) + def test_load_const_str(self): self.assertEqual( "hoge", self.vm.eval('"hoge"') ) if __name__ == '__main__': unittest.main()
6
0.285714
6
0
0427c3777f8543e79d8d9d0c8cba19322d1e6aaf
app/scripts/utils/download.js
app/scripts/utils/download.js
export function download(filename, data) { // yanked from here // https://stackoverflow.com/questions/3665115/create-a-file-in-memory-for-user-to-download-not-through-server var blob = new Blob([data], {type: 'text/csv'}); if(window.navigator.msSaveOrOpenBlob) { window.navigator.msSaveBlob(blob, filename); } else{ var elem = window.document.createElement('a'); elem.href = window.URL.createObjectURL(blob); elem.download = filename; document.body.appendChild(elem); elem.click(); document.body.removeChild(elem); } } export default download;
export function download(filename, data) { // yanked from here // https://stackoverflow.com/questions/3665115/create-a-file-in-memory-for-user-to-download-not-through-server const blob = new Blob([data], { type: 'text/csv' }); if (window.navigator.msSaveOrOpenBlob) { window.navigator.msSaveBlob(blob, filename); } else { const elem = window.document.createElement('a'); elem.href = window.URL.createObjectURL(blob); elem.download = filename; document.body.appendChild(elem); elem.click(); document.body.removeChild(elem); } } export default download;
Fix code style and ES6ify
Fix code style and ES6ify
JavaScript
mit
hms-dbmi/higlass,hms-dbmi/4DN_matrix-viewer,hms-dbmi/4DN_matrix-viewer,hms-dbmi/higlass,hms-dbmi/higlass,hms-dbmi/higlass,hms-dbmi/4DN_matrix-viewer
javascript
## Code Before: export function download(filename, data) { // yanked from here // https://stackoverflow.com/questions/3665115/create-a-file-in-memory-for-user-to-download-not-through-server var blob = new Blob([data], {type: 'text/csv'}); if(window.navigator.msSaveOrOpenBlob) { window.navigator.msSaveBlob(blob, filename); } else{ var elem = window.document.createElement('a'); elem.href = window.URL.createObjectURL(blob); elem.download = filename; document.body.appendChild(elem); elem.click(); document.body.removeChild(elem); } } export default download; ## Instruction: Fix code style and ES6ify ## Code After: export function download(filename, data) { // yanked from here // https://stackoverflow.com/questions/3665115/create-a-file-in-memory-for-user-to-download-not-through-server const blob = new Blob([data], { type: 'text/csv' }); if (window.navigator.msSaveOrOpenBlob) { window.navigator.msSaveBlob(blob, filename); } else { const elem = window.document.createElement('a'); elem.href = window.URL.createObjectURL(blob); elem.download = filename; document.body.appendChild(elem); elem.click(); document.body.removeChild(elem); } } export default download;
export function download(filename, data) { // yanked from here // https://stackoverflow.com/questions/3665115/create-a-file-in-memory-for-user-to-download-not-through-server - var blob = new Blob([data], {type: 'text/csv'}); ? ^^^ + const blob = new Blob([data], { type: 'text/csv' }); ? ^^^^^ + + - if(window.navigator.msSaveOrOpenBlob) { + if (window.navigator.msSaveOrOpenBlob) { ? + window.navigator.msSaveBlob(blob, filename); - } - else{ + } else { ? ++ + - var elem = window.document.createElement('a'); ? ^^^ + const elem = window.document.createElement('a'); ? ^^^^^ elem.href = window.URL.createObjectURL(blob); elem.download = filename; document.body.appendChild(elem); elem.click(); document.body.removeChild(elem); } } export default download;
9
0.5
4
5
e68dad6fafaff0bc0d064f6bbdff0fb4053b7d18
README.md
README.md
continuate ========== [![Build Status](https://travis-ci.org/termoshtt/continuate.svg?branch=master)](https://travis-ci.org/termoshtt/continuate) [![PyPI version](https://badge.fury.io/py/continuate.svg)](https://badge.fury.io/py/continuate) [![Code Climate](https://codeclimate.com/github/termoshtt/continuate/badges/gpa.svg)](https://codeclimate.com/github/termoshtt/continuate) [![Test Coverage](https://codeclimate.com/github/termoshtt/continuate/badges/coverage.svg)](https://codeclimate.com/github/termoshtt/continuate/coverage) [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE) Continuation tools. ***CAUTION***: This program is alpha version. Fatal errors may be included. Install ------- Please install from PyPI ```command pip install continuate ``` or use development install ```command python setup.py develop ``` Sample ------- - [single parameter continuation](sample/single_parameter.ipynb) Document --------- See http://termoshtt.github.io/continuate License ------- This software is released under the MIT License, see LICENSE file.
continuate ========== [![Build Status](https://travis-ci.org/termoshtt/continuate.svg?branch=master)](https://travis-ci.org/termoshtt/continuate) [![PyPI version](https://badge.fury.io/py/continuate.svg)](https://badge.fury.io/py/continuate) [![Code Climate](https://codeclimate.com/github/termoshtt/continuate/badges/gpa.svg)](https://codeclimate.com/github/termoshtt/continuate) [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE) Continuation tools. ***CAUTION***: This program is alpha version. Fatal errors may be included. Install ------- Please install from PyPI ```command pip install continuate ``` or use development install ```command python setup.py develop ``` Sample ------- - [single parameter continuation](sample/single_parameter.ipynb) Document --------- See http://termoshtt.github.io/continuate License ------- This software is released under the MIT License, see LICENSE file.
Remove coverage badge (not working)
Remove coverage badge (not working)
Markdown
mit
termoshtt/continuate
markdown
## Code Before: continuate ========== [![Build Status](https://travis-ci.org/termoshtt/continuate.svg?branch=master)](https://travis-ci.org/termoshtt/continuate) [![PyPI version](https://badge.fury.io/py/continuate.svg)](https://badge.fury.io/py/continuate) [![Code Climate](https://codeclimate.com/github/termoshtt/continuate/badges/gpa.svg)](https://codeclimate.com/github/termoshtt/continuate) [![Test Coverage](https://codeclimate.com/github/termoshtt/continuate/badges/coverage.svg)](https://codeclimate.com/github/termoshtt/continuate/coverage) [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE) Continuation tools. ***CAUTION***: This program is alpha version. Fatal errors may be included. Install ------- Please install from PyPI ```command pip install continuate ``` or use development install ```command python setup.py develop ``` Sample ------- - [single parameter continuation](sample/single_parameter.ipynb) Document --------- See http://termoshtt.github.io/continuate License ------- This software is released under the MIT License, see LICENSE file. ## Instruction: Remove coverage badge (not working) ## Code After: continuate ========== [![Build Status](https://travis-ci.org/termoshtt/continuate.svg?branch=master)](https://travis-ci.org/termoshtt/continuate) [![PyPI version](https://badge.fury.io/py/continuate.svg)](https://badge.fury.io/py/continuate) [![Code Climate](https://codeclimate.com/github/termoshtt/continuate/badges/gpa.svg)](https://codeclimate.com/github/termoshtt/continuate) [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE) Continuation tools. ***CAUTION***: This program is alpha version. Fatal errors may be included. Install ------- Please install from PyPI ```command pip install continuate ``` or use development install ```command python setup.py develop ``` Sample ------- - [single parameter continuation](sample/single_parameter.ipynb) Document --------- See http://termoshtt.github.io/continuate License ------- This software is released under the MIT License, see LICENSE file.
continuate ========== [![Build Status](https://travis-ci.org/termoshtt/continuate.svg?branch=master)](https://travis-ci.org/termoshtt/continuate) [![PyPI version](https://badge.fury.io/py/continuate.svg)](https://badge.fury.io/py/continuate) [![Code Climate](https://codeclimate.com/github/termoshtt/continuate/badges/gpa.svg)](https://codeclimate.com/github/termoshtt/continuate) - [![Test Coverage](https://codeclimate.com/github/termoshtt/continuate/badges/coverage.svg)](https://codeclimate.com/github/termoshtt/continuate/coverage) [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE) Continuation tools. ***CAUTION***: This program is alpha version. Fatal errors may be included. Install ------- Please install from PyPI ```command pip install continuate ``` or use development install ```command python setup.py develop ``` Sample ------- - [single parameter continuation](sample/single_parameter.ipynb) Document --------- See http://termoshtt.github.io/continuate License ------- This software is released under the MIT License, see LICENSE file.
1
0.025
0
1
af2165a6972e50cbf4afd1780b2f2e59f9d95a22
custom-locales.json
custom-locales.json
{ "an": { "locale": "an", "parentLocale": "ca" }, "cat": { "locale": "cat", "parentLocale": "en" }, "ht": { "locale": "ht", "parentLocale": "fr" }, "ja-hr": { "locale": "ja-hr", "parentLocale": "ja" }, "la": { "locale": "la", "parentLocale": "it" }, "yum": { "locale": "yum", "parentLocale": "en" }, "zh-cn": { "locale": "zh-cn", "parentLocale": "zh" }, "zh-tw": { "locale": "zh-tw", "parentLocale": "zh" } }
{ "ab": { "locale": "ab", "parentLocale": "az" }, "an": { "locale": "an", "parentLocale": "ca" }, "cat": { "locale": "cat", "parentLocale": "en" }, "ht": { "locale": "ht", "parentLocale": "fr" }, "ja-hr": { "locale": "ja-hr", "parentLocale": "ja" }, "la": { "locale": "la", "parentLocale": "it" }, "yum": { "locale": "yum", "parentLocale": "en" }, "zh-cn": { "locale": "zh-cn", "parentLocale": "zh" }, "zh-tw": { "locale": "zh-tw", "parentLocale": "zh" } }
Add Abkhaz to custom locale list
Add Abkhaz to custom locale list it’s not in `intl-messageformat`. Give it Azerbaijani as a parent language for now, as they have similar enough structures for plualization/alphabet purposes.
JSON
bsd-3-clause
LLK/scratch-www,LLK/scratch-www
json
## Code Before: { "an": { "locale": "an", "parentLocale": "ca" }, "cat": { "locale": "cat", "parentLocale": "en" }, "ht": { "locale": "ht", "parentLocale": "fr" }, "ja-hr": { "locale": "ja-hr", "parentLocale": "ja" }, "la": { "locale": "la", "parentLocale": "it" }, "yum": { "locale": "yum", "parentLocale": "en" }, "zh-cn": { "locale": "zh-cn", "parentLocale": "zh" }, "zh-tw": { "locale": "zh-tw", "parentLocale": "zh" } } ## Instruction: Add Abkhaz to custom locale list it’s not in `intl-messageformat`. Give it Azerbaijani as a parent language for now, as they have similar enough structures for plualization/alphabet purposes. ## Code After: { "ab": { "locale": "ab", "parentLocale": "az" }, "an": { "locale": "an", "parentLocale": "ca" }, "cat": { "locale": "cat", "parentLocale": "en" }, "ht": { "locale": "ht", "parentLocale": "fr" }, "ja-hr": { "locale": "ja-hr", "parentLocale": "ja" }, "la": { "locale": "la", "parentLocale": "it" }, "yum": { "locale": "yum", "parentLocale": "en" }, "zh-cn": { "locale": "zh-cn", "parentLocale": "zh" }, "zh-tw": { "locale": "zh-tw", "parentLocale": "zh" } }
{ + "ab": { + "locale": "ab", + "parentLocale": "az" + }, "an": { "locale": "an", "parentLocale": "ca" }, "cat": { "locale": "cat", "parentLocale": "en" }, "ht": { "locale": "ht", "parentLocale": "fr" }, "ja-hr": { "locale": "ja-hr", "parentLocale": "ja" }, "la": { "locale": "la", "parentLocale": "it" }, "yum": { "locale": "yum", "parentLocale": "en" }, "zh-cn": { "locale": "zh-cn", "parentLocale": "zh" }, "zh-tw": { "locale": "zh-tw", "parentLocale": "zh" } }
4
0.117647
4
0
dee3192eb32a4e208cb48fa99ef81a70ccd5b136
index.js
index.js
var cookie = require('cookie'); module.exports = { /** * Parse function to be handed to restify server.use * * @param {object} req * @param {object} res * @param {Function} next * @return {undefined} */ parse: function(req, res, next){ var self = this; var cookieHeader = req.headers.cookie; if(cookieHeader){ req.cookies = cookie.parse(cookieHeader); } else { req.cookies = {}; } /** * Add a cookie to our response. Uses a Set-Cookie header * per cookie added. * * @param {String} key - Cookie name * @param {String} val - Cookie value * @param {[type]} opts - Options object can contain path, secure, * expires, domain, http */ res.setCookie = function(key, val, opts){ var HEADER = "Set-Cookie"; if(res.header(HEADER)){ var curCookies = res.header(HEADER); if( !(curCookies instanceof Array) ) { curCookies = [curCookies]; } curCookies.push( cookie.serialize(key, val, opts) ); res.header(HEADER, curCookies); } else { res.header(HEADER, cookie.serialize(key,val, opts)); } }; next(); } };
var cookie = require('cookie'); module.exports = { /** * Parse function to be handed to restify server.use * * @param {object} req * @param {object} res * @param {Function} next * @return {undefined} */ parse: function parseCookies (req, res, next){ var self = this; var cookieHeader = req.headers.cookie; if(cookieHeader){ req.cookies = cookie.parse(cookieHeader); } else { req.cookies = {}; } /** * Add a cookie to our response. Uses a Set-Cookie header * per cookie added. * * @param {String} key - Cookie name * @param {String} val - Cookie value * @param {[type]} opts - Options object can contain path, secure, * expires, domain, http */ res.setCookie = function setCookie (key, val, opts){ var HEADER = "Set-Cookie"; if(res.header(HEADER)){ var curCookies = res.header(HEADER); if( !(curCookies instanceof Array) ) { curCookies = [curCookies]; } curCookies.push( cookie.serialize(key, val, opts) ); res.header(HEADER, curCookies); } else { res.header(HEADER, cookie.serialize(key,val, opts)); } }; next(); } };
Add name to anonymous function for bunyan -- restify automatically uses the function name in the timers list, so this sets a name so it's not handler-0
Add name to anonymous function for bunyan -- restify automatically uses the function name in the timers list, so this sets a name so it's not handler-0
JavaScript
mit
nathschmidt/restify-cookies
javascript
## Code Before: var cookie = require('cookie'); module.exports = { /** * Parse function to be handed to restify server.use * * @param {object} req * @param {object} res * @param {Function} next * @return {undefined} */ parse: function(req, res, next){ var self = this; var cookieHeader = req.headers.cookie; if(cookieHeader){ req.cookies = cookie.parse(cookieHeader); } else { req.cookies = {}; } /** * Add a cookie to our response. Uses a Set-Cookie header * per cookie added. * * @param {String} key - Cookie name * @param {String} val - Cookie value * @param {[type]} opts - Options object can contain path, secure, * expires, domain, http */ res.setCookie = function(key, val, opts){ var HEADER = "Set-Cookie"; if(res.header(HEADER)){ var curCookies = res.header(HEADER); if( !(curCookies instanceof Array) ) { curCookies = [curCookies]; } curCookies.push( cookie.serialize(key, val, opts) ); res.header(HEADER, curCookies); } else { res.header(HEADER, cookie.serialize(key,val, opts)); } }; next(); } }; ## Instruction: Add name to anonymous function for bunyan -- restify automatically uses the function name in the timers list, so this sets a name so it's not handler-0 ## Code After: var cookie = require('cookie'); module.exports = { /** * Parse function to be handed to restify server.use * * @param {object} req * @param {object} res * @param {Function} next * @return {undefined} */ parse: function parseCookies (req, res, next){ var self = this; var cookieHeader = req.headers.cookie; if(cookieHeader){ req.cookies = cookie.parse(cookieHeader); } else { req.cookies = {}; } /** * Add a cookie to our response. Uses a Set-Cookie header * per cookie added. * * @param {String} key - Cookie name * @param {String} val - Cookie value * @param {[type]} opts - Options object can contain path, secure, * expires, domain, http */ res.setCookie = function setCookie (key, val, opts){ var HEADER = "Set-Cookie"; if(res.header(HEADER)){ var curCookies = res.header(HEADER); if( !(curCookies instanceof Array) ) { curCookies = [curCookies]; } curCookies.push( cookie.serialize(key, val, opts) ); res.header(HEADER, curCookies); } else { res.header(HEADER, cookie.serialize(key,val, opts)); } }; next(); } };
var cookie = require('cookie'); module.exports = { /** * Parse function to be handed to restify server.use * * @param {object} req * @param {object} res * @param {Function} next * @return {undefined} */ - parse: function(req, res, next){ + parse: function parseCookies (req, res, next){ ? ++++++++++++++ var self = this; var cookieHeader = req.headers.cookie; if(cookieHeader){ req.cookies = cookie.parse(cookieHeader); } else { req.cookies = {}; } /** * Add a cookie to our response. Uses a Set-Cookie header * per cookie added. * * @param {String} key - Cookie name * @param {String} val - Cookie value * @param {[type]} opts - Options object can contain path, secure, * expires, domain, http */ - res.setCookie = function(key, val, opts){ + res.setCookie = function setCookie (key, val, opts){ ? +++++++++++ var HEADER = "Set-Cookie"; if(res.header(HEADER)){ var curCookies = res.header(HEADER); if( !(curCookies instanceof Array) ) { curCookies = [curCookies]; } curCookies.push( cookie.serialize(key, val, opts) ); res.header(HEADER, curCookies); } else { res.header(HEADER, cookie.serialize(key,val, opts)); } }; next(); } };
4
0.071429
2
2
508c2c51bbf446c49be17f1da165d4d598e26e79
.travis.yml
.travis.yml
language: java jdk: - oraclejdk8
language: java jdk: - oraclejdk8 notifications: slack: secure: WA2Z6i7vFRS6+Ogj6CgrXeqeCBXOQ7aMG+fJD/7XCcUvr9ZBfSEdz+GLEdqnb8KFHNfzHkzgpYLqfyxrvUi/YGC5HUGN3W5LBGMRQ2Y7aEdzDwOonnnuGmMIZCnoDHr+tOzDAuOf8bAummQL/Cg155QsbMXYdectKmAzrGVspVCdIQKZKbqasNI3KBzE2PpHK9mMqV/7jAK6Q9FX1B5nFHc3ahPLjweQIPYz5Hai9iJJDCqhF9I3k1r60Gymn7TNHPHSuHEqqQ/S9RR1cV2N9O9A3fPBqwyqn1CkWrBGH3gJ4I+tYov5dI30ceuA0g3ERVejCOBFiWOsjAUs2Hys9JsAPNVQ74Xo7SMKFleWgPAK646VMv2WmSCFQKCihNP63CwOxYnD/1tvSpKXiKgJjnSnYp2VrT1eTJcGTpRyB4EqNGGLHP1Ra//7A76FUJkaSZwdSWaouJ6bNHRR0naZuXoFJXKhTl0ADJuTKaq76TKswGasMYpyR7PZZRAd2HQWGv6wixjAtJDTNFMrwCtoGLfqQVmpaE1OTM9ibY8ghiQiYD27bsJOh5WnMwT7/KuOG9ik8k2zDHS7ln0HS4OVXJ2sdacP9/Lh+nNduiPLW+LbeAzo26QJG8AmXpAjw9wR5qXfm+DbfFle+ZoJHsUjE2lXx/fAKokt4pGapdt3Uus=
Add slack notifications for TravisCI
Add slack notifications for TravisCI
YAML
apache-2.0
Sonicity/cmsha-backend
yaml
## Code Before: language: java jdk: - oraclejdk8 ## Instruction: Add slack notifications for TravisCI ## Code After: language: java jdk: - oraclejdk8 notifications: slack: secure: WA2Z6i7vFRS6+Ogj6CgrXeqeCBXOQ7aMG+fJD/7XCcUvr9ZBfSEdz+GLEdqnb8KFHNfzHkzgpYLqfyxrvUi/YGC5HUGN3W5LBGMRQ2Y7aEdzDwOonnnuGmMIZCnoDHr+tOzDAuOf8bAummQL/Cg155QsbMXYdectKmAzrGVspVCdIQKZKbqasNI3KBzE2PpHK9mMqV/7jAK6Q9FX1B5nFHc3ahPLjweQIPYz5Hai9iJJDCqhF9I3k1r60Gymn7TNHPHSuHEqqQ/S9RR1cV2N9O9A3fPBqwyqn1CkWrBGH3gJ4I+tYov5dI30ceuA0g3ERVejCOBFiWOsjAUs2Hys9JsAPNVQ74Xo7SMKFleWgPAK646VMv2WmSCFQKCihNP63CwOxYnD/1tvSpKXiKgJjnSnYp2VrT1eTJcGTpRyB4EqNGGLHP1Ra//7A76FUJkaSZwdSWaouJ6bNHRR0naZuXoFJXKhTl0ADJuTKaq76TKswGasMYpyR7PZZRAd2HQWGv6wixjAtJDTNFMrwCtoGLfqQVmpaE1OTM9ibY8ghiQiYD27bsJOh5WnMwT7/KuOG9ik8k2zDHS7ln0HS4OVXJ2sdacP9/Lh+nNduiPLW+LbeAzo26QJG8AmXpAjw9wR5qXfm+DbfFle+ZoJHsUjE2lXx/fAKokt4pGapdt3Uus=
language: java - jdk: - - oraclejdk8 ? -- + - oraclejdk8 + notifications: + slack: + secure: WA2Z6i7vFRS6+Ogj6CgrXeqeCBXOQ7aMG+fJD/7XCcUvr9ZBfSEdz+GLEdqnb8KFHNfzHkzgpYLqfyxrvUi/YGC5HUGN3W5LBGMRQ2Y7aEdzDwOonnnuGmMIZCnoDHr+tOzDAuOf8bAummQL/Cg155QsbMXYdectKmAzrGVspVCdIQKZKbqasNI3KBzE2PpHK9mMqV/7jAK6Q9FX1B5nFHc3ahPLjweQIPYz5Hai9iJJDCqhF9I3k1r60Gymn7TNHPHSuHEqqQ/S9RR1cV2N9O9A3fPBqwyqn1CkWrBGH3gJ4I+tYov5dI30ceuA0g3ERVejCOBFiWOsjAUs2Hys9JsAPNVQ74Xo7SMKFleWgPAK646VMv2WmSCFQKCihNP63CwOxYnD/1tvSpKXiKgJjnSnYp2VrT1eTJcGTpRyB4EqNGGLHP1Ra//7A76FUJkaSZwdSWaouJ6bNHRR0naZuXoFJXKhTl0ADJuTKaq76TKswGasMYpyR7PZZRAd2HQWGv6wixjAtJDTNFMrwCtoGLfqQVmpaE1OTM9ibY8ghiQiYD27bsJOh5WnMwT7/KuOG9ik8k2zDHS7ln0HS4OVXJ2sdacP9/Lh+nNduiPLW+LbeAzo26QJG8AmXpAjw9wR5qXfm+DbfFle+ZoJHsUjE2lXx/fAKokt4pGapdt3Uus=
6
1.5
4
2
3a82f7aca54c37a28158a5bb7f78459bc69e7f0e
public/script/init.js
public/script/init.js
/* global hljs */ (function() { 'use strict'; var cells = document.querySelectorAll('.diff tbody td'); for (var i = 0, len = cells.length; i < len; i++) { hljs.highlightBlock(cells[i]); } })();
/* global hljs */ (function() { 'use strict'; document.addEventListener('DOMContentLoaded', function() { var cells = document.querySelectorAll('.diff tbody td'); for (var i = 0, len = cells.length; i < len; i++) { hljs.highlightBlock(cells[i]); } }); })();
Tweak execution timing of highlighting
Tweak execution timing of highlighting
JavaScript
mit
takenspc/diffofhtmls,takenspc/diffofhtmls,takenspc/diffofhtmls
javascript
## Code Before: /* global hljs */ (function() { 'use strict'; var cells = document.querySelectorAll('.diff tbody td'); for (var i = 0, len = cells.length; i < len; i++) { hljs.highlightBlock(cells[i]); } })(); ## Instruction: Tweak execution timing of highlighting ## Code After: /* global hljs */ (function() { 'use strict'; document.addEventListener('DOMContentLoaded', function() { var cells = document.querySelectorAll('.diff tbody td'); for (var i = 0, len = cells.length; i < len; i++) { hljs.highlightBlock(cells[i]); } }); })();
/* global hljs */ (function() { 'use strict'; + document.addEventListener('DOMContentLoaded', function() { - var cells = document.querySelectorAll('.diff tbody td'); + var cells = document.querySelectorAll('.diff tbody td'); ? ++++ - for (var i = 0, len = cells.length; i < len; i++) { + for (var i = 0, len = cells.length; i < len; i++) { ? ++++ - hljs.highlightBlock(cells[i]); + hljs.highlightBlock(cells[i]); ? +++ + } - } + }); ? ++ })();
10
1.25
6
4
3eae7523afae8468baddac1b914f3d4bde01fe8d
README.md
README.md
Group your tabs into groups. The folder icons are under GNU General Public License and came from franksouza183: http://www.iconarchive.com/show/fs-icons-by-franksouza183/Places-folder-green-icon.html The other ressources are created by me and are in the public domain.
Group your tabs into groups. The chrome extention is avalaible here: https://chrome.google.com/webstore/detail/tabsfolder/pdfepgdcmifhbmldcofnkmnbabamjdnm The folder icons are under GNU General Public License and came from franksouza183: http://www.iconarchive.com/show/fs-icons-by-franksouza183/Places-folder-green-icon.html The other ressources are created by me and are in the public domain.
Update Readme - Add a link to the chrome web store
Update Readme - Add a link to the chrome web store
Markdown
unlicense
Conchylicultor/TabsFolder,dactivo/TabsFolder,dactivo/TabsFolder,Conchylicultor/TabsFolder
markdown
## Code Before: Group your tabs into groups. The folder icons are under GNU General Public License and came from franksouza183: http://www.iconarchive.com/show/fs-icons-by-franksouza183/Places-folder-green-icon.html The other ressources are created by me and are in the public domain. ## Instruction: Update Readme - Add a link to the chrome web store ## Code After: Group your tabs into groups. The chrome extention is avalaible here: https://chrome.google.com/webstore/detail/tabsfolder/pdfepgdcmifhbmldcofnkmnbabamjdnm The folder icons are under GNU General Public License and came from franksouza183: http://www.iconarchive.com/show/fs-icons-by-franksouza183/Places-folder-green-icon.html The other ressources are created by me and are in the public domain.
Group your tabs into groups. + The chrome extention is avalaible here: https://chrome.google.com/webstore/detail/tabsfolder/pdfepgdcmifhbmldcofnkmnbabamjdnm The folder icons are under GNU General Public License and came from franksouza183: http://www.iconarchive.com/show/fs-icons-by-franksouza183/Places-folder-green-icon.html The other ressources are created by me and are in the public domain.
1
0.142857
1
0
b70a646930d0922a7bfb67b185e5278b14a5dacd
mk.bash
mk.bash
OS=$(uname -s) if [[ $OS = "OpenBSD" ]];then echo "using OpenBSD Makefile." make -f makefile.openbsd elif [[ $OS = "Darwin" ]];then echo "using Mac OS X Makefile." make -f makefile.macosx else echo "using Linux Makefile." make -f makefile fi #Clear object files rm *.o
OS=$(uname -s) if [[ $OS = "OpenBSD" ]];then echo "using OpenBSD Makefile." make -f makefile.openbsd else echo "using Linux Makefile." make -f makefile fi #Clear object files rm *.o
Revert "Mac OS X option"
Revert "Mac OS X option" This reverts commit 69af8d5adb3795c5bfad8349b9e0b2b00611aa30.
Shell
bsd-2-clause
gabordemooij/citrine,takano32/citrine,gabordemooij/citrine,gabordemooij/citrine,takano32/citrine,takano32/citrine
shell
## Code Before: OS=$(uname -s) if [[ $OS = "OpenBSD" ]];then echo "using OpenBSD Makefile." make -f makefile.openbsd elif [[ $OS = "Darwin" ]];then echo "using Mac OS X Makefile." make -f makefile.macosx else echo "using Linux Makefile." make -f makefile fi #Clear object files rm *.o ## Instruction: Revert "Mac OS X option" This reverts commit 69af8d5adb3795c5bfad8349b9e0b2b00611aa30. ## Code After: OS=$(uname -s) if [[ $OS = "OpenBSD" ]];then echo "using OpenBSD Makefile." make -f makefile.openbsd else echo "using Linux Makefile." make -f makefile fi #Clear object files rm *.o
OS=$(uname -s) if [[ $OS = "OpenBSD" ]];then echo "using OpenBSD Makefile." make -f makefile.openbsd - elif [[ $OS = "Darwin" ]];then - echo "using Mac OS X Makefile." - make -f makefile.macosx else echo "using Linux Makefile." make -f makefile fi #Clear object files rm *.o
3
0.214286
0
3
41a0f3a9ecbe63fb777002df2c4e940ef05b2c7b
README.md
README.md
regexp-js =========
regexp-js ========= ## Easier JavaScript Regular Expressions regexp.js is a JavaScript library that helps to use Regular Expression more easily. ## Usage ```HTML <script type="text/javascript" src="regexp.js"></script> ``` ```javascript var Rpj = new Rpj(); var alpha = "abc"; console.log(Rpj.start().alpha().end().match(alpha)); // true console.log(Rpj.start().numeric().end().match(alpha)); // false var numeric = "0123456789"; console.log(Rpj.start().numeric().end().match(numeric)); // true console.log(Rpj.start().alpha().end().match(numeric)); // false var http = "http://hogehoge.com"; console.log(Rpj.start().url().match(http)); // true console.log(Rpj.start().alpha().match(http)); // true var https = "https://hogehoge.com"; console.log(Rpj.start().url().match(https)); // true console.log(Rpj.start().alpha().match(https)); // true ```
Add usage and description of this library
Add usage and description of this library
Markdown
mit
shigemk2/regexp-js
markdown
## Code Before: regexp-js ========= ## Instruction: Add usage and description of this library ## Code After: regexp-js ========= ## Easier JavaScript Regular Expressions regexp.js is a JavaScript library that helps to use Regular Expression more easily. ## Usage ```HTML <script type="text/javascript" src="regexp.js"></script> ``` ```javascript var Rpj = new Rpj(); var alpha = "abc"; console.log(Rpj.start().alpha().end().match(alpha)); // true console.log(Rpj.start().numeric().end().match(alpha)); // false var numeric = "0123456789"; console.log(Rpj.start().numeric().end().match(numeric)); // true console.log(Rpj.start().alpha().end().match(numeric)); // false var http = "http://hogehoge.com"; console.log(Rpj.start().url().match(http)); // true console.log(Rpj.start().alpha().match(http)); // true var https = "https://hogehoge.com"; console.log(Rpj.start().url().match(https)); // true console.log(Rpj.start().alpha().match(https)); // true ```
regexp-js ========= + + ## Easier JavaScript Regular Expressions + + regexp.js is a JavaScript library that helps to use Regular Expression more easily. + + ## Usage + + ```HTML + <script type="text/javascript" src="regexp.js"></script> + ``` + + ```javascript + var Rpj = new Rpj(); + + var alpha = "abc"; + console.log(Rpj.start().alpha().end().match(alpha)); // true + console.log(Rpj.start().numeric().end().match(alpha)); // false + + var numeric = "0123456789"; + console.log(Rpj.start().numeric().end().match(numeric)); // true + console.log(Rpj.start().alpha().end().match(numeric)); // false + + var http = "http://hogehoge.com"; + console.log(Rpj.start().url().match(http)); // true + console.log(Rpj.start().alpha().match(http)); // true + + var https = "https://hogehoge.com"; + console.log(Rpj.start().url().match(https)); // true + console.log(Rpj.start().alpha().match(https)); // true + ```
30
15
30
0
cce746795625eac178a3840e4451cfebd3203b7d
lib/myhtmlex/safe.ex
lib/myhtmlex/safe.ex
defmodule Myhtmlex.Safe do @moduledoc false use Application app = Mix.Project.config[:app] def start(_type, _args) do import Supervisor.Spec unless Node.alive? do Nodex.Distributed.up end myhtml_worker = Path.join(:code.priv_dir(unquote(app)), "myhtml_worker") children = [ worker(Nodex.Cnode, [%{exec_path: myhtml_worker}, [name: Myhtmlex.Safe.Cnode]]) ] Supervisor.start_link(children, strategy: :one_for_one, name: Myhtmlex.Safe.Supervisor) end def decode(bin) do decode(bin, []) end def decode(bin, flags) do {:ok, res} = Nodex.Cnode.call(Myhtmlex.Safe.Cnode, {:decode, bin, flags}) res end end
defmodule Myhtmlex.Safe do @moduledoc false use Application app = Mix.Project.config[:app] defp random_sname, do: :crypto.strong_rand_bytes(4) |> Base.encode16(case: :lower) defp sname, do: :"myhtmlex_#{random_sname()}" def start(_type, _args) do import Supervisor.Spec unless Node.alive? do Nodex.Distributed.up end myhtml_worker = Path.join(:code.priv_dir(unquote(app)), "myhtml_worker") children = [ worker(Nodex.Cnode, [%{exec_path: myhtml_worker, sname: sname()}, [name: Myhtmlex.Safe.Cnode]]) ] Supervisor.start_link(children, strategy: :one_for_one, name: Myhtmlex.Safe.Supervisor) end def decode(bin) do decode(bin, []) end def decode(bin, flags) do {:ok, res} = Nodex.Cnode.call(Myhtmlex.Safe.Cnode, {:decode, bin, flags}) res end end
Use an identifiable prefix for snames
cnode: Use an identifiable prefix for snames Swarm tries to include the cnode into the hash ring and fails, interfering with the application startup. The solution is to give these nodes indentifiable snames, so they can be blacklisted from the Swarm hash ring.
Elixir
lgpl-2.1
Overbryd/myhtmlex,Overbryd/myhtmlex,Overbryd/myhtmlex
elixir
## Code Before: defmodule Myhtmlex.Safe do @moduledoc false use Application app = Mix.Project.config[:app] def start(_type, _args) do import Supervisor.Spec unless Node.alive? do Nodex.Distributed.up end myhtml_worker = Path.join(:code.priv_dir(unquote(app)), "myhtml_worker") children = [ worker(Nodex.Cnode, [%{exec_path: myhtml_worker}, [name: Myhtmlex.Safe.Cnode]]) ] Supervisor.start_link(children, strategy: :one_for_one, name: Myhtmlex.Safe.Supervisor) end def decode(bin) do decode(bin, []) end def decode(bin, flags) do {:ok, res} = Nodex.Cnode.call(Myhtmlex.Safe.Cnode, {:decode, bin, flags}) res end end ## Instruction: cnode: Use an identifiable prefix for snames Swarm tries to include the cnode into the hash ring and fails, interfering with the application startup. The solution is to give these nodes indentifiable snames, so they can be blacklisted from the Swarm hash ring. ## Code After: defmodule Myhtmlex.Safe do @moduledoc false use Application app = Mix.Project.config[:app] defp random_sname, do: :crypto.strong_rand_bytes(4) |> Base.encode16(case: :lower) defp sname, do: :"myhtmlex_#{random_sname()}" def start(_type, _args) do import Supervisor.Spec unless Node.alive? do Nodex.Distributed.up end myhtml_worker = Path.join(:code.priv_dir(unquote(app)), "myhtml_worker") children = [ worker(Nodex.Cnode, [%{exec_path: myhtml_worker, sname: sname()}, [name: Myhtmlex.Safe.Cnode]]) ] Supervisor.start_link(children, strategy: :one_for_one, name: Myhtmlex.Safe.Supervisor) end def decode(bin) do decode(bin, []) end def decode(bin, flags) do {:ok, res} = Nodex.Cnode.call(Myhtmlex.Safe.Cnode, {:decode, bin, flags}) res end end
defmodule Myhtmlex.Safe do @moduledoc false use Application app = Mix.Project.config[:app] + + + defp random_sname, do: :crypto.strong_rand_bytes(4) |> Base.encode16(case: :lower) + + defp sname, do: :"myhtmlex_#{random_sname()}" def start(_type, _args) do import Supervisor.Spec unless Node.alive? do Nodex.Distributed.up end myhtml_worker = Path.join(:code.priv_dir(unquote(app)), "myhtml_worker") children = [ - worker(Nodex.Cnode, [%{exec_path: myhtml_worker}, [name: Myhtmlex.Safe.Cnode]]) + worker(Nodex.Cnode, [%{exec_path: myhtml_worker, sname: sname()}, [name: Myhtmlex.Safe.Cnode]]) ? ++++++++++++++++ ] Supervisor.start_link(children, strategy: :one_for_one, name: Myhtmlex.Safe.Supervisor) end def decode(bin) do decode(bin, []) end def decode(bin, flags) do {:ok, res} = Nodex.Cnode.call(Myhtmlex.Safe.Cnode, {:decode, bin, flags}) res end end
7
0.233333
6
1