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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c6c8784b6e2d7a186c41101b4263e133a63242d9 | week-4/shortest-string/my_solution.rb | week-4/shortest-string/my_solution.rb | def shortest_string(list_of_words)
# Your code goes here!
return list_of_words[0].to_s if list_of_words.length == 1
smallest_word(list_of_words)
# smallest = list_of_words[0]
# list_of_words.each do |word|
# smallest = word if word.length < smallest.length
# end
# return smallest
end
def smallest_word(array)
smallest = array[0]
array.each do |word|
smallest = word if word.length < smallest.length
end
return smallest
end | def shortest_string(list_of_words)
# Your code goes here!
return list_of_words[0].to_s if list_of_words.length == 1
smallest_word(list_of_words)
# until_loop(list_of_words)
# for_loop(list_of_words)
# smallest = list_of_words[0]
# list_of_words.each do |word|
# smallest = word if word.length < smallest.length
# end
# return smallest
end
#solved with each loop
def smallest_word(array)
smallest = array[0]
array.each do |word|
smallest = word if word.length < smallest.length
end
return smallest
end
#solved with until loop
def until_loop(array)
shortest = array[0]
until array.empty?
word = array.shift
shortest = word if shortest.length > word.length
end
return shortest
end
#solved with for loop
def for_loop(array)
shortest = array[0]
for array in array[0..array.length]
shortest = array if shortest.length > array.length
end
return shortest
end | Add more solution to problem | Add more solution to problem
| Ruby | mit | jhack32/phase-0,jhack32/phase-0,jhack32/phase-0 | ruby | ## Code Before:
def shortest_string(list_of_words)
# Your code goes here!
return list_of_words[0].to_s if list_of_words.length == 1
smallest_word(list_of_words)
# smallest = list_of_words[0]
# list_of_words.each do |word|
# smallest = word if word.length < smallest.length
# end
# return smallest
end
def smallest_word(array)
smallest = array[0]
array.each do |word|
smallest = word if word.length < smallest.length
end
return smallest
end
## Instruction:
Add more solution to problem
## Code After:
def shortest_string(list_of_words)
# Your code goes here!
return list_of_words[0].to_s if list_of_words.length == 1
smallest_word(list_of_words)
# until_loop(list_of_words)
# for_loop(list_of_words)
# smallest = list_of_words[0]
# list_of_words.each do |word|
# smallest = word if word.length < smallest.length
# end
# return smallest
end
#solved with each loop
def smallest_word(array)
smallest = array[0]
array.each do |word|
smallest = word if word.length < smallest.length
end
return smallest
end
#solved with until loop
def until_loop(array)
shortest = array[0]
until array.empty?
word = array.shift
shortest = word if shortest.length > word.length
end
return shortest
end
#solved with for loop
def for_loop(array)
shortest = array[0]
for array in array[0..array.length]
shortest = array if shortest.length > array.length
end
return shortest
end | def shortest_string(list_of_words)
# Your code goes here!
return list_of_words[0].to_s if list_of_words.length == 1
smallest_word(list_of_words)
+ # until_loop(list_of_words)
+ # for_loop(list_of_words)
# smallest = list_of_words[0]
# list_of_words.each do |word|
# smallest = word if word.length < smallest.length
# end
# return smallest
end
+ #solved with each loop
def smallest_word(array)
smallest = array[0]
array.each do |word|
smallest = word if word.length < smallest.length
end
return smallest
end
+
+ #solved with until loop
+ def until_loop(array)
+ shortest = array[0]
+ until array.empty?
+ word = array.shift
+ shortest = word if shortest.length > word.length
+ end
+ return shortest
+ end
+
+ #solved with for loop
+ def for_loop(array)
+ shortest = array[0]
+ for array in array[0..array.length]
+ shortest = array if shortest.length > array.length
+ end
+ return shortest
+ end | 22 | 1.222222 | 22 | 0 |
4565b18da7e18d5602c27497ddc6d52a632cf133 | src/app/dashboard/Dashboard.scss | src/app/dashboard/Dashboard.scss | @import "../../res/styles/_required";
$dashboard-item-title-bg-color: theme-color('light');
$dashboard-item-title-bg-color-hover: darken($dashboard-item-title-bg-color, 2%);
$dashboard-item-bg-color: color('white');
$dashboard-item-bg-color-hover: darken($dashboard-item-bg-color, 2%);
.dashboard {
a.card {
background-color: $dashboard-item-bg-color;
text-decoration: none;
padding: 2rem;
border: 0;
box-shadow:0 5px 15px 0 rgba($black, 0.2), 0 0 2px 0 rgba($black, 0.2);
transition: background-color 0.3s ease;
&:hover {
background-color: $dashboard-item-bg-color-hover;
text-decoration: none;
.card-footer {
color: $black;
}
}
img {
width: 80px;
height: 80px;
}
.card-footer {
white-space: nowrap;
font-family: $headings-font-family;
font-size: $font-size-lg;
font-weight: 500;
color: $gray-900;
padding: 0.5em;
background-color: transparent;
border-top: 0;
}
}
}
| @import "../../res/styles/_required";
$dashboard-item-title-bg-color: theme-color('light');
$dashboard-item-title-bg-color-hover: darken($dashboard-item-title-bg-color, 2%);
$dashboard-item-bg-color: color('white');
$dashboard-item-bg-color-hover: darken($dashboard-item-bg-color, 2%);
.dashboard {
a.card {
background-color: $dashboard-item-bg-color;
text-decoration: none;
padding: 2rem;
border: 0;
box-shadow:0 5px 15px 0 rgba($black, 0.2), 0 0 2px 0 rgba($black, 0.2);
transition: background-color 0.3s ease;
&:hover {
background-color: $dashboard-item-bg-color-hover;
text-decoration: none;
.card-footer {
color: $black;
}
}
.card-body {
flex-grow: 0;
img {
width: 80px;
height: 80px;
}
}
.card-footer {
flex-grow: 1;
display: flex;
align-items: center;
justify-content: center;
font-family: $headings-font-family;
font-size: $font-size-lg;
font-weight: 500;
color: $gray-900;
padding: 0.5em;
background-color: transparent;
border-top: 0;
}
}
}
| Fix display of long titles in dashboard | Fix display of long titles in dashboard
| SCSS | agpl-3.0 | mailvelope/mailvelope,mailvelope/mailvelope,mailvelope/mailvelope | scss | ## Code Before:
@import "../../res/styles/_required";
$dashboard-item-title-bg-color: theme-color('light');
$dashboard-item-title-bg-color-hover: darken($dashboard-item-title-bg-color, 2%);
$dashboard-item-bg-color: color('white');
$dashboard-item-bg-color-hover: darken($dashboard-item-bg-color, 2%);
.dashboard {
a.card {
background-color: $dashboard-item-bg-color;
text-decoration: none;
padding: 2rem;
border: 0;
box-shadow:0 5px 15px 0 rgba($black, 0.2), 0 0 2px 0 rgba($black, 0.2);
transition: background-color 0.3s ease;
&:hover {
background-color: $dashboard-item-bg-color-hover;
text-decoration: none;
.card-footer {
color: $black;
}
}
img {
width: 80px;
height: 80px;
}
.card-footer {
white-space: nowrap;
font-family: $headings-font-family;
font-size: $font-size-lg;
font-weight: 500;
color: $gray-900;
padding: 0.5em;
background-color: transparent;
border-top: 0;
}
}
}
## Instruction:
Fix display of long titles in dashboard
## Code After:
@import "../../res/styles/_required";
$dashboard-item-title-bg-color: theme-color('light');
$dashboard-item-title-bg-color-hover: darken($dashboard-item-title-bg-color, 2%);
$dashboard-item-bg-color: color('white');
$dashboard-item-bg-color-hover: darken($dashboard-item-bg-color, 2%);
.dashboard {
a.card {
background-color: $dashboard-item-bg-color;
text-decoration: none;
padding: 2rem;
border: 0;
box-shadow:0 5px 15px 0 rgba($black, 0.2), 0 0 2px 0 rgba($black, 0.2);
transition: background-color 0.3s ease;
&:hover {
background-color: $dashboard-item-bg-color-hover;
text-decoration: none;
.card-footer {
color: $black;
}
}
.card-body {
flex-grow: 0;
img {
width: 80px;
height: 80px;
}
}
.card-footer {
flex-grow: 1;
display: flex;
align-items: center;
justify-content: center;
font-family: $headings-font-family;
font-size: $font-size-lg;
font-weight: 500;
color: $gray-900;
padding: 0.5em;
background-color: transparent;
border-top: 0;
}
}
}
| @import "../../res/styles/_required";
$dashboard-item-title-bg-color: theme-color('light');
$dashboard-item-title-bg-color-hover: darken($dashboard-item-title-bg-color, 2%);
$dashboard-item-bg-color: color('white');
$dashboard-item-bg-color-hover: darken($dashboard-item-bg-color, 2%);
.dashboard {
a.card {
background-color: $dashboard-item-bg-color;
text-decoration: none;
padding: 2rem;
border: 0;
box-shadow:0 5px 15px 0 rgba($black, 0.2), 0 0 2px 0 rgba($black, 0.2);
transition: background-color 0.3s ease;
&:hover {
background-color: $dashboard-item-bg-color-hover;
text-decoration: none;
.card-footer {
color: $black;
}
}
+ .card-body {
+ flex-grow: 0;
- img {
+ img {
? ++
- width: 80px;
+ width: 80px;
? ++
- height: 80px;
+ height: 80px;
? ++
+ }
}
+
.card-footer {
- white-space: nowrap;
+ flex-grow: 1;
+ display: flex;
+ align-items: center;
+ justify-content: center;
font-family: $headings-font-family;
font-size: $font-size-lg;
font-weight: 500;
color: $gray-900;
padding: 0.5em;
background-color: transparent;
border-top: 0;
}
}
} | 15 | 0.375 | 11 | 4 |
14f71e81fac07dd6d1641850aed688977ced9c89 | README.md | README.md |
This package wraps the Polymer project's core elements, providing the
following features:
* Because the elements are bundled into a single pub package, you can add
`core_elements` as a dependency in your pubspec. You don't need to
install npm or bower.
* Core elements that are either performance sensitive (like `core-list`) or
use native objects that are difficult to use via dart:js (like `core-ajax`)
have been ported to Dart.
* The remaining core elements are wrapped with Dart proxy classes, making
them easier to interact with from Dart apps.
You can find out more about core elements here:
http://www.polymer-project.org/docs/elements/core-elements.html
## Status
This is an early access version of the core elements. The elements are still
changing on both the JavaScript and Dart sides.
## Using elements
All elements live at the top level of the `lib/` folder.
Import into HTML:
```html
<link rel="import" href="packages/core_elements/core_input.html">
```
Or import into Dart:
```dart
import 'package:core_elements/core_input.dart';
```
## Examples
All examples are located in a separate repo,
https://github.com/dart-lang/polymer-core-and-paper-examples.
|
**Note:** This package is for polymer.dart < 0.17
This package wraps the Polymer project's core elements, providing the
following features:
* Because the elements are bundled into a single pub package, you can add
`core_elements` as a dependency in your pubspec. You don't need to
install npm or bower.
* Core elements that are either performance sensitive (like `core-list`) or
use native objects that are difficult to use via dart:js (like `core-ajax`)
have been ported to Dart.
* The remaining core elements are wrapped with Dart proxy classes, making
them easier to interact with from Dart apps.
You can find out more about core elements here:
http://www.polymer-project.org/docs/elements/core-elements.html
## Status
This is an early access version of the core elements. The elements are still
changing on both the JavaScript and Dart sides.
## Using elements
All elements live at the top level of the `lib/` folder.
Import into HTML:
```html
<link rel="import" href="packages/core_elements/core_input.html">
```
Or import into Dart:
```dart
import 'package:core_elements/core_input.dart';
```
## Examples
All examples are located in a separate repo,
https://github.com/dart-lang/polymer-core-and-paper-examples.
| Clarify which version of polymer.dart this is for. | Clarify which version of polymer.dart this is for. | Markdown | apache-2.0 | dart-archive/core-elements,dart-archive/core-elements,dart-archive/core-elements,orgsea/core-elements,orgsea/core-elements,orgsea/core-elements,dart-archive/core-elements,orgsea/core-elements | markdown | ## Code Before:
This package wraps the Polymer project's core elements, providing the
following features:
* Because the elements are bundled into a single pub package, you can add
`core_elements` as a dependency in your pubspec. You don't need to
install npm or bower.
* Core elements that are either performance sensitive (like `core-list`) or
use native objects that are difficult to use via dart:js (like `core-ajax`)
have been ported to Dart.
* The remaining core elements are wrapped with Dart proxy classes, making
them easier to interact with from Dart apps.
You can find out more about core elements here:
http://www.polymer-project.org/docs/elements/core-elements.html
## Status
This is an early access version of the core elements. The elements are still
changing on both the JavaScript and Dart sides.
## Using elements
All elements live at the top level of the `lib/` folder.
Import into HTML:
```html
<link rel="import" href="packages/core_elements/core_input.html">
```
Or import into Dart:
```dart
import 'package:core_elements/core_input.dart';
```
## Examples
All examples are located in a separate repo,
https://github.com/dart-lang/polymer-core-and-paper-examples.
## Instruction:
Clarify which version of polymer.dart this is for.
## Code After:
**Note:** This package is for polymer.dart < 0.17
This package wraps the Polymer project's core elements, providing the
following features:
* Because the elements are bundled into a single pub package, you can add
`core_elements` as a dependency in your pubspec. You don't need to
install npm or bower.
* Core elements that are either performance sensitive (like `core-list`) or
use native objects that are difficult to use via dart:js (like `core-ajax`)
have been ported to Dart.
* The remaining core elements are wrapped with Dart proxy classes, making
them easier to interact with from Dart apps.
You can find out more about core elements here:
http://www.polymer-project.org/docs/elements/core-elements.html
## Status
This is an early access version of the core elements. The elements are still
changing on both the JavaScript and Dart sides.
## Using elements
All elements live at the top level of the `lib/` folder.
Import into HTML:
```html
<link rel="import" href="packages/core_elements/core_input.html">
```
Or import into Dart:
```dart
import 'package:core_elements/core_input.dart';
```
## Examples
All examples are located in a separate repo,
https://github.com/dart-lang/polymer-core-and-paper-examples.
| +
+ **Note:** This package is for polymer.dart < 0.17
This package wraps the Polymer project's core elements, providing the
following features:
* Because the elements are bundled into a single pub package, you can add
`core_elements` as a dependency in your pubspec. You don't need to
install npm or bower.
* Core elements that are either performance sensitive (like `core-list`) or
use native objects that are difficult to use via dart:js (like `core-ajax`)
have been ported to Dart.
* The remaining core elements are wrapped with Dart proxy classes, making
them easier to interact with from Dart apps.
You can find out more about core elements here:
http://www.polymer-project.org/docs/elements/core-elements.html
## Status
This is an early access version of the core elements. The elements are still
changing on both the JavaScript and Dart sides.
## Using elements
All elements live at the top level of the `lib/` folder.
Import into HTML:
```html
<link rel="import" href="packages/core_elements/core_input.html">
```
Or import into Dart:
```dart
import 'package:core_elements/core_input.dart';
```
## Examples
All examples are located in a separate repo,
https://github.com/dart-lang/polymer-core-and-paper-examples. | 2 | 0.04878 | 2 | 0 |
d2121c459cafe626993fe86f87de1ae5720aa2d7 | backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/EnumUtilsTest.java | backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/EnumUtilsTest.java | package org.ovirt.engine.core.utils;
import org.ovirt.engine.core.common.utils.EnumUtils;
import junit.framework.TestCase;
public class EnumUtilsTest extends TestCase {
public void testConvertToStringWithSpaces() {
assertEquals("Hello There", EnumUtils.ConvertToStringWithSpaces("HelloThere"));
}
}
| package org.ovirt.engine.core.utils;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.ovirt.engine.core.common.utils.EnumUtils;
public class EnumUtilsTest {
@Test
public void convertToStringWithSpaces() {
assertEquals("Hello There", EnumUtils.ConvertToStringWithSpaces("HelloThere"));
}
}
| Change to JUnit 4 test | backend: Change to JUnit 4 test
Change the test to be junit 4 test for adding more tests later.
Change-Id: I7a8d38bbbbce976f5bf12573bb6936e5d7ff7c1e
| Java | apache-2.0 | walteryang47/ovirt-engine,eayun/ovirt-engine,eayun/ovirt-engine,halober/ovirt-engine,raksha-rao/gluster-ovirt,walteryang47/ovirt-engine,eayun/ovirt-engine,raksha-rao/gluster-ovirt,anjalshireesh/gluster-ovirt-poc,Dhandapani/gluster-ovirt,zerodengxinchao/ovirt-engine,anjalshireesh/gluster-ovirt-poc,OpenUniversity/ovirt-engine,halober/ovirt-engine,walteryang47/ovirt-engine,raksha-rao/gluster-ovirt,anjalshireesh/gluster-ovirt-poc,OpenUniversity/ovirt-engine,Dhandapani/gluster-ovirt,Dhandapani/gluster-ovirt,anjalshireesh/gluster-ovirt-poc,yingyun001/ovirt-engine,raksha-rao/gluster-ovirt,yapengsong/ovirt-engine,zerodengxinchao/ovirt-engine,yapengsong/ovirt-engine,eayun/ovirt-engine,yapengsong/ovirt-engine,OpenUniversity/ovirt-engine,OpenUniversity/ovirt-engine,walteryang47/ovirt-engine,zerodengxinchao/ovirt-engine,derekhiggins/ovirt-engine,halober/ovirt-engine,derekhiggins/ovirt-engine,zerodengxinchao/ovirt-engine,Dhandapani/gluster-ovirt,raksha-rao/gluster-ovirt,yapengsong/ovirt-engine,yingyun001/ovirt-engine,Dhandapani/gluster-ovirt,walteryang47/ovirt-engine,yingyun001/ovirt-engine,derekhiggins/ovirt-engine,yingyun001/ovirt-engine,yapengsong/ovirt-engine,OpenUniversity/ovirt-engine,derekhiggins/ovirt-engine,yingyun001/ovirt-engine,anjalshireesh/gluster-ovirt-poc,eayun/ovirt-engine,zerodengxinchao/ovirt-engine,halober/ovirt-engine | java | ## Code Before:
package org.ovirt.engine.core.utils;
import org.ovirt.engine.core.common.utils.EnumUtils;
import junit.framework.TestCase;
public class EnumUtilsTest extends TestCase {
public void testConvertToStringWithSpaces() {
assertEquals("Hello There", EnumUtils.ConvertToStringWithSpaces("HelloThere"));
}
}
## Instruction:
backend: Change to JUnit 4 test
Change the test to be junit 4 test for adding more tests later.
Change-Id: I7a8d38bbbbce976f5bf12573bb6936e5d7ff7c1e
## Code After:
package org.ovirt.engine.core.utils;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.ovirt.engine.core.common.utils.EnumUtils;
public class EnumUtilsTest {
@Test
public void convertToStringWithSpaces() {
assertEquals("Hello There", EnumUtils.ConvertToStringWithSpaces("HelloThere"));
}
}
| package org.ovirt.engine.core.utils;
+ import static org.junit.Assert.assertEquals;
+
+ import org.junit.Test;
import org.ovirt.engine.core.common.utils.EnumUtils;
- import junit.framework.TestCase;
+ public class EnumUtilsTest {
- public class EnumUtilsTest extends TestCase {
+ @Test
- public void testConvertToStringWithSpaces() {
? ^^^^^
+ public void convertToStringWithSpaces() {
? ^
assertEquals("Hello There", EnumUtils.ConvertToStringWithSpaces("HelloThere"));
}
} | 9 | 0.818182 | 6 | 3 |
ca63a66ad6ded4dd109b0bb9b4c6d9782c6b2557 | recipes/cppast/bld.bat | recipes/cppast/bld.bat | setlocal EnableDelayedExpansion
mkdir build
cd build
cmake -G "NMake Makefiles" ^
-DCMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX%" ^
-DCMAKE_PREFIX_PATH:PATH="%LIBRARY_PREFIX%" ^
-DCMAKE_BUILD_TYPE:STRING=Release ^
-DCMAKE_LIBRARY_PATH:PATH="%LIBRARY_PREFIX%;%LIBRARY_PREFIX%/bin" ^
..
if errorlevel 1 exit 1
nmake
if errorlevel 1 exit 1
| setlocal EnableDelayedExpansion
mkdir build
cd build
cmake -G "NMake Makefiles" ^
-DCMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX%" ^
-DCMAKE_PREFIX_PATH:PATH="%LIBRARY_PREFIX%" ^
-DCMAKE_BUILD_TYPE:STRING=Release ^
-DCMAKE_LIBRARY_PATH:PATH="%LIBRARY_PREFIX%;%LIBRARY_PREFIX%/bin" ^
-DBUILD_SHARED_LIBS:BOOL=ON ^
..
if errorlevel 1 exit 1
nmake
if errorlevel 1 exit 1
| Build shared library on Windows | Build shared library on Windows
| Batchfile | bsd-3-clause | conda-forge/staged-recipes,johanneskoester/staged-recipes,ocefpaf/staged-recipes,conda-forge/staged-recipes,johanneskoester/staged-recipes,ocefpaf/staged-recipes | batchfile | ## Code Before:
setlocal EnableDelayedExpansion
mkdir build
cd build
cmake -G "NMake Makefiles" ^
-DCMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX%" ^
-DCMAKE_PREFIX_PATH:PATH="%LIBRARY_PREFIX%" ^
-DCMAKE_BUILD_TYPE:STRING=Release ^
-DCMAKE_LIBRARY_PATH:PATH="%LIBRARY_PREFIX%;%LIBRARY_PREFIX%/bin" ^
..
if errorlevel 1 exit 1
nmake
if errorlevel 1 exit 1
## Instruction:
Build shared library on Windows
## Code After:
setlocal EnableDelayedExpansion
mkdir build
cd build
cmake -G "NMake Makefiles" ^
-DCMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX%" ^
-DCMAKE_PREFIX_PATH:PATH="%LIBRARY_PREFIX%" ^
-DCMAKE_BUILD_TYPE:STRING=Release ^
-DCMAKE_LIBRARY_PATH:PATH="%LIBRARY_PREFIX%;%LIBRARY_PREFIX%/bin" ^
-DBUILD_SHARED_LIBS:BOOL=ON ^
..
if errorlevel 1 exit 1
nmake
if errorlevel 1 exit 1
| setlocal EnableDelayedExpansion
mkdir build
cd build
cmake -G "NMake Makefiles" ^
-DCMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX%" ^
-DCMAKE_PREFIX_PATH:PATH="%LIBRARY_PREFIX%" ^
-DCMAKE_BUILD_TYPE:STRING=Release ^
-DCMAKE_LIBRARY_PATH:PATH="%LIBRARY_PREFIX%;%LIBRARY_PREFIX%/bin" ^
+ -DBUILD_SHARED_LIBS:BOOL=ON ^
..
+
if errorlevel 1 exit 1
nmake
if errorlevel 1 exit 1 | 2 | 0.133333 | 2 | 0 |
4ec22f8a0fdd549967e3a30096867b87bc458dde | tensorflow_cloud/python/tests/integration/call_run_on_script_with_keras_ctl_test.py | tensorflow_cloud/python/tests/integration/call_run_on_script_with_keras_ctl_test.py |
import tensorflow_cloud as tfc
# MultiWorkerMirroredStrategy
tfc.run(
entry_point="tensorflow_cloud/python/tests/testdata/mnist_example_using_ctl.py",
distribution_strategy=None,
worker_count=1,
requirements_txt="tensorflow_cloud/python/tests/testdata/requirements.txt",
stream_logs=True,
)
| """Integration tests for calling tfc.run on script with keras."""
import os
import sys
from unittest import mock
import tensorflow as tf
import tensorflow_cloud as tfc
class TensorflowCloudOnScriptTest(tf.test.TestCase):
def setUp(self):
super(TensorflowCloudOnScriptTest, self).setUp()
self.test_data_path = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "../testdata/"
)
@mock.patch.object(sys, "exit", autospec=True)
def test_MWMS_on_script(self, mock_exit):
mock_exit.side_effect = RuntimeError("exit called")
with self.assertRaises(RuntimeError):
tfc.run(
entry_point=os.path.join(
self.test_data_path, "mnist_example_using_ctl.py"
),
distribution_strategy=None,
worker_count=1,
requirements_txt=os.path.join(
self.test_data_path, "requirements.txt"),
)
mock_exit.assert_called_once_with(0)
if __name__ == "__main__":
tf.test.main()
| Add test harness to call_run_on_script_with_keras | Add test harness to call_run_on_script_with_keras
| Python | apache-2.0 | tensorflow/cloud,tensorflow/cloud | python | ## Code Before:
import tensorflow_cloud as tfc
# MultiWorkerMirroredStrategy
tfc.run(
entry_point="tensorflow_cloud/python/tests/testdata/mnist_example_using_ctl.py",
distribution_strategy=None,
worker_count=1,
requirements_txt="tensorflow_cloud/python/tests/testdata/requirements.txt",
stream_logs=True,
)
## Instruction:
Add test harness to call_run_on_script_with_keras
## Code After:
"""Integration tests for calling tfc.run on script with keras."""
import os
import sys
from unittest import mock
import tensorflow as tf
import tensorflow_cloud as tfc
class TensorflowCloudOnScriptTest(tf.test.TestCase):
def setUp(self):
super(TensorflowCloudOnScriptTest, self).setUp()
self.test_data_path = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "../testdata/"
)
@mock.patch.object(sys, "exit", autospec=True)
def test_MWMS_on_script(self, mock_exit):
mock_exit.side_effect = RuntimeError("exit called")
with self.assertRaises(RuntimeError):
tfc.run(
entry_point=os.path.join(
self.test_data_path, "mnist_example_using_ctl.py"
),
distribution_strategy=None,
worker_count=1,
requirements_txt=os.path.join(
self.test_data_path, "requirements.txt"),
)
mock_exit.assert_called_once_with(0)
if __name__ == "__main__":
tf.test.main()
| + """Integration tests for calling tfc.run on script with keras."""
+ import os
+ import sys
+ from unittest import mock
+ import tensorflow as tf
import tensorflow_cloud as tfc
- # MultiWorkerMirroredStrategy
- tfc.run(
- entry_point="tensorflow_cloud/python/tests/testdata/mnist_example_using_ctl.py",
+
+ class TensorflowCloudOnScriptTest(tf.test.TestCase):
+ def setUp(self):
+ super(TensorflowCloudOnScriptTest, self).setUp()
+ self.test_data_path = os.path.join(
+ os.path.dirname(os.path.abspath(__file__)), "../testdata/"
+ )
+
+ @mock.patch.object(sys, "exit", autospec=True)
+ def test_MWMS_on_script(self, mock_exit):
+ mock_exit.side_effect = RuntimeError("exit called")
+ with self.assertRaises(RuntimeError):
+ tfc.run(
+ entry_point=os.path.join(
+ self.test_data_path, "mnist_example_using_ctl.py"
+ ),
- distribution_strategy=None,
+ distribution_strategy=None,
? ++++++++++++
- worker_count=1,
+ worker_count=1,
? ++++++++++++
- requirements_txt="tensorflow_cloud/python/tests/testdata/requirements.txt",
- stream_logs=True,
- )
+ requirements_txt=os.path.join(
+ self.test_data_path, "requirements.txt"),
+ )
+ mock_exit.assert_called_once_with(0)
+
+
+ if __name__ == "__main__":
+ tf.test.main() | 39 | 3.545455 | 31 | 8 |
0284ddef2289675613d98d8b433d78da1e9a8a98 | lib/developer_notes/dump_and_reload_data.md | lib/developer_notes/dump_and_reload_data.md |
1. `rake db:schema:load` clear the database and rebuild the sceme
1. Make sure you have the `h2o_prod-data.dump` file in your root directory.
1. `pg_restore --verbose --clean --no-acl --no-owner -U h2oadmin -h [aws link] -d h2o ~/h2o_prod-data.dump` port the data dump into the database
1. (for running locally: `pg_restore --verbose --clean --no-acl --no-owner -h localhost -d h2o_dev ~/h2o_prod-data.dump `)
1. `rake db:migrate`
1. `rails c`
|
1. `bundle exec rake db:schema:load DISABLE_DATABASE_ENVIRONMENT_CHECK=1` clear the database and rebuild the sceme
1. Make sure you have the `h2o-prod-8-28-18.dump` file in your root directory.
1. `pg_restore --verbose --clean --no-acl --no-owner -U h2oadmin -h [aws link] -d h2o ~/h2o_prod-data.dump` port the data dump into the database
1. (for running locally: `pg_restore --verbose --clean --no-acl --no-owner -h localhost -d h2o_dev ~/h2o-prod-8-28-18.dump `)
1. `rake db:migrate`
1. `rails c`
| Update dump and reload data notes. | Update dump and reload data notes.
| Markdown | agpl-3.0 | harvard-lil/h2o,harvard-lil/h2o,harvard-lil/h2o,harvard-lil/h2o | markdown | ## Code Before:
1. `rake db:schema:load` clear the database and rebuild the sceme
1. Make sure you have the `h2o_prod-data.dump` file in your root directory.
1. `pg_restore --verbose --clean --no-acl --no-owner -U h2oadmin -h [aws link] -d h2o ~/h2o_prod-data.dump` port the data dump into the database
1. (for running locally: `pg_restore --verbose --clean --no-acl --no-owner -h localhost -d h2o_dev ~/h2o_prod-data.dump `)
1. `rake db:migrate`
1. `rails c`
## Instruction:
Update dump and reload data notes.
## Code After:
1. `bundle exec rake db:schema:load DISABLE_DATABASE_ENVIRONMENT_CHECK=1` clear the database and rebuild the sceme
1. Make sure you have the `h2o-prod-8-28-18.dump` file in your root directory.
1. `pg_restore --verbose --clean --no-acl --no-owner -U h2oadmin -h [aws link] -d h2o ~/h2o_prod-data.dump` port the data dump into the database
1. (for running locally: `pg_restore --verbose --clean --no-acl --no-owner -h localhost -d h2o_dev ~/h2o-prod-8-28-18.dump `)
1. `rake db:migrate`
1. `rails c`
|
- 1. `rake db:schema:load` clear the database and rebuild the sceme
+ 1. `bundle exec rake db:schema:load DISABLE_DATABASE_ENVIRONMENT_CHECK=1` clear the database and rebuild the sceme
- 1. Make sure you have the `h2o_prod-data.dump` file in your root directory.
? ^ ^^^^
+ 1. Make sure you have the `h2o-prod-8-28-18.dump` file in your root directory.
? ^ ^^^^^^^
1. `pg_restore --verbose --clean --no-acl --no-owner -U h2oadmin -h [aws link] -d h2o ~/h2o_prod-data.dump` port the data dump into the database
- 1. (for running locally: `pg_restore --verbose --clean --no-acl --no-owner -h localhost -d h2o_dev ~/h2o_prod-data.dump `)
? ^ ^^^^
+ 1. (for running locally: `pg_restore --verbose --clean --no-acl --no-owner -h localhost -d h2o_dev ~/h2o-prod-8-28-18.dump `)
? ^ ^^^^^^^
1. `rake db:migrate`
1. `rails c` | 6 | 0.75 | 3 | 3 |
2ce3a69263cc6d7afa55d9d261ce47103460daeb | atlassian-ide-plugin.xml | atlassian-ide-plugin.xml | <atlassian-ide-plugin>
<project-configuration>
<servers />
</project-configuration>
</atlassian-ide-plugin> | <atlassian-ide-plugin>
<project-configuration>
<servers>
<jira>
<server-id>4a297ae5-259f-4ae5-baeb-17b5e6892edd</server-id>
<name>team.ops4j.org (JIRA Studio)</name>
<url>http://team.ops4j.org</url>
<shared>false</shared>
</jira>
</servers>
<default-jira-server>4a297ae5-259f-4ae5-baeb-17b5e6892edd</default-jira-server>
</project-configuration>
</atlassian-ide-plugin> | Add team.ops4j.org as intellij issue server | Add team.ops4j.org as intellij issue server
Signed-off-by: Andreas Pieber <[email protected]>
(cherry picked from commit d99b3c26100a5d9c6fe1a29ccb24f4b79523b67b)
Signed-off-by: Andreas Pieber <[email protected]>
(cherry picked from commit 862927d50821d76f7811d8e820b930af76e2ebfa)
Signed-off-by: Andreas Pieber <[email protected]>
(cherry picked from commit 77a563bddb4a2cbfec2333ffdfe89d7a6d4e5c13)
Signed-off-by: Andreas Pieber <[email protected]>
(cherry picked from commit 8e9970ee7d975899ed80811c1fde46c97423d381)
Signed-off-by: Andreas Pieber <[email protected]>
| XML | apache-2.0 | ops4j/org.ops4j.pax.wicket,ops4j/org.ops4j.pax.wicket,ops4j/org.ops4j.pax.wicket,thrau/org.ops4j.pax.wicket,thrau/org.ops4j.pax.wicket,thrau/org.ops4j.pax.wicket | xml | ## Code Before:
<atlassian-ide-plugin>
<project-configuration>
<servers />
</project-configuration>
</atlassian-ide-plugin>
## Instruction:
Add team.ops4j.org as intellij issue server
Signed-off-by: Andreas Pieber <[email protected]>
(cherry picked from commit d99b3c26100a5d9c6fe1a29ccb24f4b79523b67b)
Signed-off-by: Andreas Pieber <[email protected]>
(cherry picked from commit 862927d50821d76f7811d8e820b930af76e2ebfa)
Signed-off-by: Andreas Pieber <[email protected]>
(cherry picked from commit 77a563bddb4a2cbfec2333ffdfe89d7a6d4e5c13)
Signed-off-by: Andreas Pieber <[email protected]>
(cherry picked from commit 8e9970ee7d975899ed80811c1fde46c97423d381)
Signed-off-by: Andreas Pieber <[email protected]>
## Code After:
<atlassian-ide-plugin>
<project-configuration>
<servers>
<jira>
<server-id>4a297ae5-259f-4ae5-baeb-17b5e6892edd</server-id>
<name>team.ops4j.org (JIRA Studio)</name>
<url>http://team.ops4j.org</url>
<shared>false</shared>
</jira>
</servers>
<default-jira-server>4a297ae5-259f-4ae5-baeb-17b5e6892edd</default-jira-server>
</project-configuration>
</atlassian-ide-plugin> | <atlassian-ide-plugin>
<project-configuration>
- <servers />
? --
+ <servers>
+ <jira>
+ <server-id>4a297ae5-259f-4ae5-baeb-17b5e6892edd</server-id>
+ <name>team.ops4j.org (JIRA Studio)</name>
+ <url>http://team.ops4j.org</url>
+ <shared>false</shared>
+ </jira>
+ </servers>
+ <default-jira-server>4a297ae5-259f-4ae5-baeb-17b5e6892edd</default-jira-server>
</project-configuration>
</atlassian-ide-plugin> | 10 | 2 | 9 | 1 |
fc74e6a4bc9992647abbb9f92a7e5880e5c29506 | models.py | models.py | from django.db import models
# Create your models here.
class User(models.Model):
display_name = models.CharField(max_length=64)
auth_key = models.CharField(max_length=64)
class Post(models.Model):
user = models.ForeignKey(User)
text = models.CharField(max_length=4000)
class Comment(models.Model):
user = models.ForeignKey(User)
post = models.ForeignKey(Post)
text = models.CharField(max_length=4000)
| from django.db import models
# Create your models here.
class User(models.Model):
display_name = models.CharField(max_length=64)
auth_key = models.CharField(max_length=64)
class Post(models.Model):
user = models.ForeignKey(User)
text = models.CharField(max_length=4000)
last_modified = models.DateTimeField()
class Comment(models.Model):
user = models.ForeignKey(User)
post = models.ForeignKey(Post)
text = models.CharField(max_length=4000)
| Add 'last modified' field to Post model | Add 'last modified' field to Post model | Python | mit | SyntaxBlitz/bridie,SyntaxBlitz/bridie | python | ## Code Before:
from django.db import models
# Create your models here.
class User(models.Model):
display_name = models.CharField(max_length=64)
auth_key = models.CharField(max_length=64)
class Post(models.Model):
user = models.ForeignKey(User)
text = models.CharField(max_length=4000)
class Comment(models.Model):
user = models.ForeignKey(User)
post = models.ForeignKey(Post)
text = models.CharField(max_length=4000)
## Instruction:
Add 'last modified' field to Post model
## Code After:
from django.db import models
# Create your models here.
class User(models.Model):
display_name = models.CharField(max_length=64)
auth_key = models.CharField(max_length=64)
class Post(models.Model):
user = models.ForeignKey(User)
text = models.CharField(max_length=4000)
last_modified = models.DateTimeField()
class Comment(models.Model):
user = models.ForeignKey(User)
post = models.ForeignKey(Post)
text = models.CharField(max_length=4000)
| from django.db import models
# Create your models here.
class User(models.Model):
display_name = models.CharField(max_length=64)
auth_key = models.CharField(max_length=64)
class Post(models.Model):
user = models.ForeignKey(User)
text = models.CharField(max_length=4000)
+ last_modified = models.DateTimeField()
class Comment(models.Model):
user = models.ForeignKey(User)
post = models.ForeignKey(Post)
text = models.CharField(max_length=4000) | 1 | 0.0625 | 1 | 0 |
662bcccd7451a615c4b2dd19b3a376bd63e54044 | SIGS/app/controllers/administrative_assistant_controller.rb | SIGS/app/controllers/administrative_assistant_controller.rb | class AdministrativeAssistantController < ApplicationController
def registration_request
end
def edit
end
def update
end
def show
@administrative_assistant = AdministrativeAssistant.find(params[:id])
@user = User.find(@administrative_assistant.user_id)
end
def destroy
@administrative_assistant = AdministrativeAssistant.find(params[:id])
@user = User.find(@administrative_assistant.user_id)
@user.destroy
end
def enable
end
def approve_registration
end
def approve_allocation
end
def index_users
@users = User.all
end
def view_users
end
def edit_users
end
def remove_users
end
end
| class AdministrativeAssistantController < ApplicationController
def new
@administrative_assistant = AdministrativeAssistant.new
end
def create
@administrative_assistant = AdministrativeAssistant.create(administrative_assistant_params)
if @administrative_assistant.save
end
def show
@administrative_assistant = AdministrativeAssistant.find(params[:id])
@user = User.find(@administrative_assistant.user_id)
end
def destroy
@administrative_assistant = AdministrativeAssistant.find(params[:id])
@user = User.find(@administrative_assistant.user_id)
@user.destroy
end
def enable
end
def approve_registration
end
def approve_allocation
end
def index_users
@users = User.all
end
def view_users
end
def edit_users
end
def remove_users
end
private
def administrative_assistant_params
params[:administrative_assistant].permit(:user_id)
end
| Add methods new and create | Add methods new and create
| Ruby | mit | fga-gpp-mds/2017.1-SIGS,fga-gpp-mds/2017.1-SIGS,fga-gpp-mds/2017.1-SIGS,fga-gpp-mds/2017.1-SIGS,fga-gpp-mds/2017.1-SIGS | ruby | ## Code Before:
class AdministrativeAssistantController < ApplicationController
def registration_request
end
def edit
end
def update
end
def show
@administrative_assistant = AdministrativeAssistant.find(params[:id])
@user = User.find(@administrative_assistant.user_id)
end
def destroy
@administrative_assistant = AdministrativeAssistant.find(params[:id])
@user = User.find(@administrative_assistant.user_id)
@user.destroy
end
def enable
end
def approve_registration
end
def approve_allocation
end
def index_users
@users = User.all
end
def view_users
end
def edit_users
end
def remove_users
end
end
## Instruction:
Add methods new and create
## Code After:
class AdministrativeAssistantController < ApplicationController
def new
@administrative_assistant = AdministrativeAssistant.new
end
def create
@administrative_assistant = AdministrativeAssistant.create(administrative_assistant_params)
if @administrative_assistant.save
end
def show
@administrative_assistant = AdministrativeAssistant.find(params[:id])
@user = User.find(@administrative_assistant.user_id)
end
def destroy
@administrative_assistant = AdministrativeAssistant.find(params[:id])
@user = User.find(@administrative_assistant.user_id)
@user.destroy
end
def enable
end
def approve_registration
end
def approve_allocation
end
def index_users
@users = User.all
end
def view_users
end
def edit_users
end
def remove_users
end
private
def administrative_assistant_params
params[:administrative_assistant].permit(:user_id)
end
| class AdministrativeAssistantController < ApplicationController
- def registration_request
+ def new
+ @administrative_assistant = AdministrativeAssistant.new
end
- def edit
- end
-
- def update
? ^^^
+ def create
? ^^^
+ @administrative_assistant = AdministrativeAssistant.create(administrative_assistant_params)
+ if @administrative_assistant.save
end
def show
@administrative_assistant = AdministrativeAssistant.find(params[:id])
@user = User.find(@administrative_assistant.user_id)
end
def destroy
@administrative_assistant = AdministrativeAssistant.find(params[:id])
@user = User.find(@administrative_assistant.user_id)
@user.destroy
end
def enable
end
def approve_registration
end
def approve_allocation
end
def index_users
@users = User.all
end
def view_users
end
def edit_users
end
def remove_users
end
+
+ private
+ def administrative_assistant_params
+ params[:administrative_assistant].permit(:user_id)
end | 14 | 0.325581 | 9 | 5 |
b6aeda08eb787fa4e0254a789d625485ba6684c8 | lua/engine/fileutil.lua | lua/engine/fileutil.lua | -- ---------------------------------------------------------
-- fileutil.lua
-- Copyright (C) 2015 Laurent Zubiaur, voodoocactus.com
-- All Rights Reserved.
-- ---------------------------------------------------------
local jit = require 'jit'
local ffi = require 'ffi'
local fileutil = {}
function fileutil.getRealPath(name)
local buf = ffi.new("uint8_t[?]", 1024)
ffi.C.realpath(name,buf)
return ffi.string(buf)
end
function fileutil.init()
ffi.cdef [[
char *realpath(const char *path, char *resolved_path);
]]
if (jit.os == 'OSX') then
fileutil.getModulePath = function(name)
return '../MacOS/lib' .. name .. '.dylib'
end
elseif (jit.os == 'Linux') then
fileutil.getModulePath = function(name)
return './bin/lib' .. name .. '.so'
end
elseif (jit.os == 'Windows') then
fileutil.getModulePath = function(name)
return './bin/' .. name .. '.dll'
end
else
error('Unsupported platform')
end
end
-- Return this package
return fileutil
-- EOF
| -- ---------------------------------------------------------
-- fileutil.lua
-- Copyright (C) 2015 Laurent Zubiaur, voodoocactus.com
-- All Rights Reserved.
-- ---------------------------------------------------------
local jit = require 'jit'
local ffi = require 'ffi'
local fileutil = {}
function fileutil.getRealPath(name)
local buf = ffi.new("uint8_t[?]", 1024)
ffi.C.realpath(name,buf)
return ffi.string(buf)
end
function fileutil.init()
ffi.cdef [[
char *realpath(const char *path, char *resolved_path);
]]
if (jit.os == 'OSX') then
fileutil.getModulePath = function(name)
return '../MacOS/lib' .. name .. '.dylib'
end
elseif (jit.os == 'Linux') then
fileutil.getModulePath = function(name)
return './bin/lib' .. name .. '.so'
end
elseif (jit.os == 'Windows') then
fileutil.getModulePath = function(name)
return './bin/' .. name .. '.dll'
end
else
error('Unsupported platform')
end
return fileutil
end
-- Return this package
return fileutil
-- EOF
| Fix missing return in init function | Fix missing return in init function
| Lua | mit | lzubiaur/woot,lzubiaur/woot,lzubiaur/woot,lzubiaur/woot,lzubiaur/woot,lzubiaur/woot,lzubiaur/woot | lua | ## Code Before:
-- ---------------------------------------------------------
-- fileutil.lua
-- Copyright (C) 2015 Laurent Zubiaur, voodoocactus.com
-- All Rights Reserved.
-- ---------------------------------------------------------
local jit = require 'jit'
local ffi = require 'ffi'
local fileutil = {}
function fileutil.getRealPath(name)
local buf = ffi.new("uint8_t[?]", 1024)
ffi.C.realpath(name,buf)
return ffi.string(buf)
end
function fileutil.init()
ffi.cdef [[
char *realpath(const char *path, char *resolved_path);
]]
if (jit.os == 'OSX') then
fileutil.getModulePath = function(name)
return '../MacOS/lib' .. name .. '.dylib'
end
elseif (jit.os == 'Linux') then
fileutil.getModulePath = function(name)
return './bin/lib' .. name .. '.so'
end
elseif (jit.os == 'Windows') then
fileutil.getModulePath = function(name)
return './bin/' .. name .. '.dll'
end
else
error('Unsupported platform')
end
end
-- Return this package
return fileutil
-- EOF
## Instruction:
Fix missing return in init function
## Code After:
-- ---------------------------------------------------------
-- fileutil.lua
-- Copyright (C) 2015 Laurent Zubiaur, voodoocactus.com
-- All Rights Reserved.
-- ---------------------------------------------------------
local jit = require 'jit'
local ffi = require 'ffi'
local fileutil = {}
function fileutil.getRealPath(name)
local buf = ffi.new("uint8_t[?]", 1024)
ffi.C.realpath(name,buf)
return ffi.string(buf)
end
function fileutil.init()
ffi.cdef [[
char *realpath(const char *path, char *resolved_path);
]]
if (jit.os == 'OSX') then
fileutil.getModulePath = function(name)
return '../MacOS/lib' .. name .. '.dylib'
end
elseif (jit.os == 'Linux') then
fileutil.getModulePath = function(name)
return './bin/lib' .. name .. '.so'
end
elseif (jit.os == 'Windows') then
fileutil.getModulePath = function(name)
return './bin/' .. name .. '.dll'
end
else
error('Unsupported platform')
end
return fileutil
end
-- Return this package
return fileutil
-- EOF
| -- ---------------------------------------------------------
-- fileutil.lua
-- Copyright (C) 2015 Laurent Zubiaur, voodoocactus.com
-- All Rights Reserved.
-- ---------------------------------------------------------
local jit = require 'jit'
local ffi = require 'ffi'
local fileutil = {}
function fileutil.getRealPath(name)
local buf = ffi.new("uint8_t[?]", 1024)
ffi.C.realpath(name,buf)
return ffi.string(buf)
end
function fileutil.init()
ffi.cdef [[
char *realpath(const char *path, char *resolved_path);
]]
if (jit.os == 'OSX') then
fileutil.getModulePath = function(name)
return '../MacOS/lib' .. name .. '.dylib'
end
elseif (jit.os == 'Linux') then
fileutil.getModulePath = function(name)
return './bin/lib' .. name .. '.so'
end
elseif (jit.os == 'Windows') then
fileutil.getModulePath = function(name)
return './bin/' .. name .. '.dll'
end
else
error('Unsupported platform')
end
+ return fileutil
end
-- Return this package
return fileutil
-- EOF | 1 | 0.02381 | 1 | 0 |
56318e207b482f7eac702e31d0d568a64ab95a36 | discussion/templates/discussion/_post_form_fields.html | discussion/templates/discussion/_post_form_fields.html | {% csrf_token %}
<form action="" method="post" enctype="multipart/form-data" class="post-form">
{% csrf_token %}
{{ form.non_field_errors }}
<div class="body-field">
{{ form.body }}
{{ form.body.errors }}
</div>
<div class="file-upload-field">
<label for="id_{{ form.attachment.html_name }}">Add a file:</label>
{{ form.attachment }}
{{ form.attachment.errors }}
</div>
<span class="button"><input type="submit" value="Post"></span>
</form> | {% csrf_token %}
{{ form.non_field_errors }}
<div class="body-field">
{{ form.body }}
{{ form.body.errors }}
</div>
<div class="file-upload-field">
<label for="id_{{ form.attachment.html_name }}">Add a file:</label>
{{ form.attachment }}
{{ form.attachment.errors }}
</div>
<span class="button"><input type="submit" value="Post"></span>
| Remove incrorect form wrapper from form fields include | Remove incrorect form wrapper from form fields include
| HTML | bsd-2-clause | incuna/django-discussion,lehins/lehins-discussion,lehins/lehins-discussion,incuna/django-discussion,lehins/lehins-discussion | html | ## Code Before:
{% csrf_token %}
<form action="" method="post" enctype="multipart/form-data" class="post-form">
{% csrf_token %}
{{ form.non_field_errors }}
<div class="body-field">
{{ form.body }}
{{ form.body.errors }}
</div>
<div class="file-upload-field">
<label for="id_{{ form.attachment.html_name }}">Add a file:</label>
{{ form.attachment }}
{{ form.attachment.errors }}
</div>
<span class="button"><input type="submit" value="Post"></span>
</form>
## Instruction:
Remove incrorect form wrapper from form fields include
## Code After:
{% csrf_token %}
{{ form.non_field_errors }}
<div class="body-field">
{{ form.body }}
{{ form.body.errors }}
</div>
<div class="file-upload-field">
<label for="id_{{ form.attachment.html_name }}">Add a file:</label>
{{ form.attachment }}
{{ form.attachment.errors }}
</div>
<span class="button"><input type="submit" value="Post"></span>
| - {% csrf_token %}
? ----
+ {% csrf_token %}
- <form action="" method="post" enctype="multipart/form-data" class="post-form">
- {% csrf_token %}
- {{ form.non_field_errors }}
? --------
+ {{ form.non_field_errors }}
- <div class="body-field">
? --------
+ <div class="body-field">
- {{ form.body }}
? --------
+ {{ form.body }}
- {{ form.body.errors }}
? --------
+ {{ form.body.errors }}
- </div>
+ </div>
- <div class="file-upload-field">
? --------
+ <div class="file-upload-field">
- <label for="id_{{ form.attachment.html_name }}">Add a file:</label>
? --------
+ <label for="id_{{ form.attachment.html_name }}">Add a file:</label>
- {{ form.attachment }}
? --------
+ {{ form.attachment }}
- {{ form.attachment.errors }}
? --------
+ {{ form.attachment.errors }}
- </div>
+ </div>
- <span class="button"><input type="submit" value="Post"></span>
? ------
+ <span class="button"><input type="submit" value="Post"></span>
- </form> | 27 | 1.8 | 12 | 15 |
5f9d67408c243d5bf40709cc778852a2a57ebe1a | src/js/letters/routes.jsx | src/js/letters/routes.jsx | import React from 'react';
import { Route } from 'react-router';
import DownloadLetters from './containers/DownloadLetters.jsx';
import AddressSection from './containers/AddressSection.jsx';
import LetterList from './containers/LetterList.jsx';
import Main from './containers/Main.jsx';
const routes = [
<Route
component={Main}
key="main">
<Route
component={DownloadLetters}
name="Download Letters"
key="download-letters">
<Route
component={AddressSection}
name="Review your address"
key="confirm-address"
path="confirm-address"/>,
<Route
component={LetterList}
name="Select and download"
key="letter-list"
path="letter-list"/>
</Route>
</Route>
];
export default routes;
export const chapters = [
{ name: 'Review your address', path: '/confirm-address' },
{ name: 'Select and download', path: '/letter-list' }
];
| import React from 'react';
import { Route, IndexRedirect } from 'react-router';
import DownloadLetters from './containers/DownloadLetters.jsx';
import AddressSection from './containers/AddressSection.jsx';
import LetterList from './containers/LetterList.jsx';
import Main from './containers/Main.jsx';
const routes = [
<Route
component={Main}
key="main">
<Route
component={DownloadLetters}
name="Download Letters"
key="download-letters">
<IndexRedirect to="confirm-address"/>,
<Route
component={AddressSection}
name="Review your address"
key="confirm-address"
path="confirm-address"/>,
<Route
component={LetterList}
name="Select and download"
key="letter-list"
path="letter-list"/>
</Route>
</Route>
];
export default routes;
export const chapters = [
{ name: 'Review your address', path: '/confirm-address' },
{ name: 'Select and download', path: '/letter-list' }
];
| Add redirect to first page | Add redirect to first page
| JSX | cc0-1.0 | department-of-veterans-affairs/vets-website,department-of-veterans-affairs/vets-website | jsx | ## Code Before:
import React from 'react';
import { Route } from 'react-router';
import DownloadLetters from './containers/DownloadLetters.jsx';
import AddressSection from './containers/AddressSection.jsx';
import LetterList from './containers/LetterList.jsx';
import Main from './containers/Main.jsx';
const routes = [
<Route
component={Main}
key="main">
<Route
component={DownloadLetters}
name="Download Letters"
key="download-letters">
<Route
component={AddressSection}
name="Review your address"
key="confirm-address"
path="confirm-address"/>,
<Route
component={LetterList}
name="Select and download"
key="letter-list"
path="letter-list"/>
</Route>
</Route>
];
export default routes;
export const chapters = [
{ name: 'Review your address', path: '/confirm-address' },
{ name: 'Select and download', path: '/letter-list' }
];
## Instruction:
Add redirect to first page
## Code After:
import React from 'react';
import { Route, IndexRedirect } from 'react-router';
import DownloadLetters from './containers/DownloadLetters.jsx';
import AddressSection from './containers/AddressSection.jsx';
import LetterList from './containers/LetterList.jsx';
import Main from './containers/Main.jsx';
const routes = [
<Route
component={Main}
key="main">
<Route
component={DownloadLetters}
name="Download Letters"
key="download-letters">
<IndexRedirect to="confirm-address"/>,
<Route
component={AddressSection}
name="Review your address"
key="confirm-address"
path="confirm-address"/>,
<Route
component={LetterList}
name="Select and download"
key="letter-list"
path="letter-list"/>
</Route>
</Route>
];
export default routes;
export const chapters = [
{ name: 'Review your address', path: '/confirm-address' },
{ name: 'Select and download', path: '/letter-list' }
];
| import React from 'react';
- import { Route } from 'react-router';
+ import { Route, IndexRedirect } from 'react-router';
? +++++++++++++++
import DownloadLetters from './containers/DownloadLetters.jsx';
import AddressSection from './containers/AddressSection.jsx';
import LetterList from './containers/LetterList.jsx';
import Main from './containers/Main.jsx';
const routes = [
<Route
component={Main}
key="main">
<Route
component={DownloadLetters}
name="Download Letters"
key="download-letters">
+ <IndexRedirect to="confirm-address"/>,
<Route
component={AddressSection}
name="Review your address"
key="confirm-address"
path="confirm-address"/>,
<Route
component={LetterList}
name="Select and download"
key="letter-list"
path="letter-list"/>
</Route>
</Route>
];
export default routes;
export const chapters = [
{ name: 'Review your address', path: '/confirm-address' },
{ name: 'Select and download', path: '/letter-list' }
]; | 3 | 0.083333 | 2 | 1 |
b197ae39986acf0a02171a48add706bf36cdf718 | .travis.yml | .travis.yml | sudo: false
language: rust
rust:
- beta
- nightly
script: cargo test --verbose --jobs 4
| sudo: false
language: rust
cache: cargo
rust:
- beta
- nightly
script: cargo test --verbose --jobs 4
| Enable cache on Travis CI | Enable cache on Travis CI
| YAML | mit | Aaron1011/cargo-urlcrate | yaml | ## Code Before:
sudo: false
language: rust
rust:
- beta
- nightly
script: cargo test --verbose --jobs 4
## Instruction:
Enable cache on Travis CI
## Code After:
sudo: false
language: rust
cache: cargo
rust:
- beta
- nightly
script: cargo test --verbose --jobs 4
| sudo: false
language: rust
+ cache: cargo
+
rust:
- beta
- nightly
script: cargo test --verbose --jobs 4 | 2 | 0.333333 | 2 | 0 |
531855c7ecb28718111b905445e2edd88785e652 | backup.sh | backup.sh |
echo "Starting Backup" >> /var/log/cron.log
restic backup /data --tag=${RESTIC_TAG?"Missing environment variable RESTIC_TAG"} > /var/log/backup-last.log 2>&1
rc=$?
if [[ $rc == 0 ]]; then
echo "Backup Successfull" >> /var/log/cron.log
else
echo "Backup Failed with Status ${rc}" >> /var/log/cron.log
restic unlock >> /var/log/cron.log 2>&1
fi
if [ -n "${RESTIC_FORGET_ARGS}" ]; then
echo "Forget about old snapshots based on RESTIC_FORGET_ARGS = ${RESTIC_FORGET_ARGS}" >> /var/log/cron.log
restic forget ${RESTIC_FORGET_ARGS} >> /var/log/backup-last.log 2>&1
rc=$?
if [[ $rc == 0 ]]; then
echo "Forget Successfull" >> /var/log/cron.log
else
echo "Forget Failed with Status ${rc}" >> /var/log/cron.log
restic unlock >> /var/log/cron.log 2>&1
fi
fi
|
echo "Starting Backup"
# Do not save full backup log to logfile but to backup-last.log
restic backup /data --tag=${RESTIC_TAG?"Missing environment variable RESTIC_TAG"} > /var/log/backup-last.log 2>&1
rc=$?
echo "Finished backup at $(date)" >> /var/log/backup-last.log
if [[ $rc == 0 ]]; then
echo "Backup Successfull"
else
echo "Backup Failed with Status ${rc}"
restic unlock
fi
if [ -n "${RESTIC_FORGET_ARGS}" ]; then
echo "Forget about old snapshots based on RESTIC_FORGET_ARGS = ${RESTIC_FORGET_ARGS}"
restic forget ${RESTIC_FORGET_ARGS} >> /var/log/backup-last.log 2>&1
rc=$?
echo "Finished forget at $(date)" >> /var/log/backup-last.log
if [[ $rc == 0 ]]; then
echo "Forget Successfull"
else
echo "Forget Failed with Status ${rc}"
restic unlock
fi
fi
| Remove redundant echo to cron log | Remove redundant echo to cron log
| Shell | apache-2.0 | Lobaro/restic-backup-docker | shell | ## Code Before:
echo "Starting Backup" >> /var/log/cron.log
restic backup /data --tag=${RESTIC_TAG?"Missing environment variable RESTIC_TAG"} > /var/log/backup-last.log 2>&1
rc=$?
if [[ $rc == 0 ]]; then
echo "Backup Successfull" >> /var/log/cron.log
else
echo "Backup Failed with Status ${rc}" >> /var/log/cron.log
restic unlock >> /var/log/cron.log 2>&1
fi
if [ -n "${RESTIC_FORGET_ARGS}" ]; then
echo "Forget about old snapshots based on RESTIC_FORGET_ARGS = ${RESTIC_FORGET_ARGS}" >> /var/log/cron.log
restic forget ${RESTIC_FORGET_ARGS} >> /var/log/backup-last.log 2>&1
rc=$?
if [[ $rc == 0 ]]; then
echo "Forget Successfull" >> /var/log/cron.log
else
echo "Forget Failed with Status ${rc}" >> /var/log/cron.log
restic unlock >> /var/log/cron.log 2>&1
fi
fi
## Instruction:
Remove redundant echo to cron log
## Code After:
echo "Starting Backup"
# Do not save full backup log to logfile but to backup-last.log
restic backup /data --tag=${RESTIC_TAG?"Missing environment variable RESTIC_TAG"} > /var/log/backup-last.log 2>&1
rc=$?
echo "Finished backup at $(date)" >> /var/log/backup-last.log
if [[ $rc == 0 ]]; then
echo "Backup Successfull"
else
echo "Backup Failed with Status ${rc}"
restic unlock
fi
if [ -n "${RESTIC_FORGET_ARGS}" ]; then
echo "Forget about old snapshots based on RESTIC_FORGET_ARGS = ${RESTIC_FORGET_ARGS}"
restic forget ${RESTIC_FORGET_ARGS} >> /var/log/backup-last.log 2>&1
rc=$?
echo "Finished forget at $(date)" >> /var/log/backup-last.log
if [[ $rc == 0 ]]; then
echo "Forget Successfull"
else
echo "Forget Failed with Status ${rc}"
restic unlock
fi
fi
|
- echo "Starting Backup" >> /var/log/cron.log
+ echo "Starting Backup"
+ # Do not save full backup log to logfile but to backup-last.log
restic backup /data --tag=${RESTIC_TAG?"Missing environment variable RESTIC_TAG"} > /var/log/backup-last.log 2>&1
rc=$?
+ echo "Finished backup at $(date)" >> /var/log/backup-last.log
if [[ $rc == 0 ]]; then
- echo "Backup Successfull" >> /var/log/cron.log
? --------------------
+ echo "Backup Successfull"
else
- echo "Backup Failed with Status ${rc}" >> /var/log/cron.log
? ---------------------
+ echo "Backup Failed with Status ${rc}"
- restic unlock >> /var/log/cron.log 2>&1
+ restic unlock
fi
if [ -n "${RESTIC_FORGET_ARGS}" ]; then
- echo "Forget about old snapshots based on RESTIC_FORGET_ARGS = ${RESTIC_FORGET_ARGS}" >> /var/log/cron.log
? ---------------------
+ echo "Forget about old snapshots based on RESTIC_FORGET_ARGS = ${RESTIC_FORGET_ARGS}"
restic forget ${RESTIC_FORGET_ARGS} >> /var/log/backup-last.log 2>&1
rc=$?
+ echo "Finished forget at $(date)" >> /var/log/backup-last.log
if [[ $rc == 0 ]]; then
- echo "Forget Successfull" >> /var/log/cron.log
? ---------------------
+ echo "Forget Successfull"
else
- echo "Forget Failed with Status ${rc}" >> /var/log/cron.log
? ---------------------
+ echo "Forget Failed with Status ${rc}"
- restic unlock >> /var/log/cron.log 2>&1
+ restic unlock
fi
fi | 19 | 0.826087 | 11 | 8 |
0c016435ac6ca3c8e09b06bdf862911b4cc439e7 | scripts/activate_node.sh | scripts/activate_node.sh |
NODE_PATH=$(pwd)/node_modules
NODE_BIN=$(pwd)/node_modules/.bin
if [ -d $NODE_PATH ]; then
export PATH=$NODE_BIN:$PATH
echo "$NODE_BIN was prepended to your PATH"
else
echo "Not $NODE_PATH found"
fi
|
NODE_PATH=$(pwd)/node_modules
NODE_BIN=$(pwd)/node_modules/.bin
export PATH=$NODE_BIN:$PATH
echo "$NODE_BIN was prepended to your PATH" | Prepend the node_modules/.bin path always | Prepend the node_modules/.bin path always
| Shell | bsd-3-clause | edina/fieldtrip-open,edina/fieldtrip-open,edina/fieldtrip-open,edina/fieldtrip-open | shell | ## Code Before:
NODE_PATH=$(pwd)/node_modules
NODE_BIN=$(pwd)/node_modules/.bin
if [ -d $NODE_PATH ]; then
export PATH=$NODE_BIN:$PATH
echo "$NODE_BIN was prepended to your PATH"
else
echo "Not $NODE_PATH found"
fi
## Instruction:
Prepend the node_modules/.bin path always
## Code After:
NODE_PATH=$(pwd)/node_modules
NODE_BIN=$(pwd)/node_modules/.bin
export PATH=$NODE_BIN:$PATH
echo "$NODE_BIN was prepended to your PATH" |
NODE_PATH=$(pwd)/node_modules
NODE_BIN=$(pwd)/node_modules/.bin
- if [ -d $NODE_PATH ]; then
- export PATH=$NODE_BIN:$PATH
? ----
+ export PATH=$NODE_BIN:$PATH
- echo "$NODE_BIN was prepended to your PATH"
? ----
+ echo "$NODE_BIN was prepended to your PATH"
- else
- echo "Not $NODE_PATH found"
- fi | 8 | 0.8 | 2 | 6 |
4f2ac29df0afa63509eacda66ed674f6b869c7fb | test/clj/rumahsewa141/test/db/core.clj | test/clj/rumahsewa141/test/db/core.clj | (ns rumahsewa141.test.db.core
(:require [rumahsewa141.db.core :refer [*db*] :as db]
[luminus-migrations.core :as migrations]
[clojure.test :refer :all]
[clojure.java.jdbc :as jdbc]
[rumahsewa141.config :refer [env]]
[mount.core :as mount]))
(use-fixtures
:once
(fn [f]
(mount/start
#'rumahsewa141.config/env
#'rumahsewa141.db.core/*db*)
(migrations/migrate ["migrate"] (select-keys env [:database-url]))
(f)))
(deftest test-users
(jdbc/with-db-transaction [t-conn *db*]
(jdbc/db-set-rollback-only! t-conn)
(is (= 1 (db/create-user!
t-conn
{:id "1"
:first_name "Sam"
:last_name "Smith"
:email "[email protected]"
:pass "pass"})))
(is (= {:id "1"
:first_name "Sam"
:last_name "Smith"
:email "[email protected]"
:pass "pass"
:admin nil
:last_login nil
:is_active nil}
(db/get-user t-conn {:id "1"})))))
| (ns rumahsewa141.test.db.core
(:require [rumahsewa141.db.core :refer [*db*] :as db]
[luminus-migrations.core :as migrations]
[clojure.test :refer :all]
[clojure.java.jdbc :as jdbc]
[rumahsewa141.config :refer [env]]
[mount.core :as mount]))
(use-fixtures
:once
(fn [f]
(mount/start
#'rumahsewa141.config/env
#'rumahsewa141.db.core/*db*)
(migrations/migrate ["migrate"] (select-keys env [:database-url]))
(f)))
(deftest test-users
(jdbc/with-db-transaction [t-conn *db*]
(jdbc/db-set-rollback-only! t-conn)
(is (= 1 (db/create-user!
t-conn
{:username "dingdong123"
:nickname "Ding Dong"
:phone_no "012-9876543"
:password "pass"})))
(is (= {:username "dingdong123"
:nickname "Ding Dong"
:phone_no "012-9876543"
:password "pass"
:admin nil}
(dissoc (db/fetch-user-by-username t-conn {:username "dingdong123"})
:id)))))
| Update test just to make it works | Update test just to make it works
| Clojure | mit | burhanloey/rumahsewa141 | clojure | ## Code Before:
(ns rumahsewa141.test.db.core
(:require [rumahsewa141.db.core :refer [*db*] :as db]
[luminus-migrations.core :as migrations]
[clojure.test :refer :all]
[clojure.java.jdbc :as jdbc]
[rumahsewa141.config :refer [env]]
[mount.core :as mount]))
(use-fixtures
:once
(fn [f]
(mount/start
#'rumahsewa141.config/env
#'rumahsewa141.db.core/*db*)
(migrations/migrate ["migrate"] (select-keys env [:database-url]))
(f)))
(deftest test-users
(jdbc/with-db-transaction [t-conn *db*]
(jdbc/db-set-rollback-only! t-conn)
(is (= 1 (db/create-user!
t-conn
{:id "1"
:first_name "Sam"
:last_name "Smith"
:email "[email protected]"
:pass "pass"})))
(is (= {:id "1"
:first_name "Sam"
:last_name "Smith"
:email "[email protected]"
:pass "pass"
:admin nil
:last_login nil
:is_active nil}
(db/get-user t-conn {:id "1"})))))
## Instruction:
Update test just to make it works
## Code After:
(ns rumahsewa141.test.db.core
(:require [rumahsewa141.db.core :refer [*db*] :as db]
[luminus-migrations.core :as migrations]
[clojure.test :refer :all]
[clojure.java.jdbc :as jdbc]
[rumahsewa141.config :refer [env]]
[mount.core :as mount]))
(use-fixtures
:once
(fn [f]
(mount/start
#'rumahsewa141.config/env
#'rumahsewa141.db.core/*db*)
(migrations/migrate ["migrate"] (select-keys env [:database-url]))
(f)))
(deftest test-users
(jdbc/with-db-transaction [t-conn *db*]
(jdbc/db-set-rollback-only! t-conn)
(is (= 1 (db/create-user!
t-conn
{:username "dingdong123"
:nickname "Ding Dong"
:phone_no "012-9876543"
:password "pass"})))
(is (= {:username "dingdong123"
:nickname "Ding Dong"
:phone_no "012-9876543"
:password "pass"
:admin nil}
(dissoc (db/fetch-user-by-username t-conn {:username "dingdong123"})
:id)))))
| (ns rumahsewa141.test.db.core
(:require [rumahsewa141.db.core :refer [*db*] :as db]
[luminus-migrations.core :as migrations]
[clojure.test :refer :all]
[clojure.java.jdbc :as jdbc]
[rumahsewa141.config :refer [env]]
[mount.core :as mount]))
(use-fixtures
:once
(fn [f]
(mount/start
#'rumahsewa141.config/env
#'rumahsewa141.db.core/*db*)
(migrations/migrate ["migrate"] (select-keys env [:database-url]))
(f)))
(deftest test-users
(jdbc/with-db-transaction [t-conn *db*]
(jdbc/db-set-rollback-only! t-conn)
(is (= 1 (db/create-user!
t-conn
+ {:username "dingdong123"
+ :nickname "Ding Dong"
+ :phone_no "012-9876543"
- {:id "1"
- :first_name "Sam"
- :last_name "Smith"
- :email "[email protected]"
- :pass "pass"})))
? ^^^^^^
+ :password "pass"})))
? ^^^^
+ (is (= {:username "dingdong123"
+ :nickname "Ding Dong"
+ :phone_no "012-9876543"
- (is (= {:id "1"
- :first_name "Sam"
- :last_name "Smith"
- :email "[email protected]"
- :pass "pass"
? ^^^^^^
+ :password "pass"
? ^^^^
- :admin nil
? --
+ :admin nil}
? +
+ (dissoc (db/fetch-user-by-username t-conn {:username "dingdong123"})
+ :id)))))
- :last_login nil
- :is_active nil}
- (db/get-user t-conn {:id "1"}))))) | 25 | 0.694444 | 11 | 14 |
fd8b68457b51e7ad8fa0a3f2698e673c3de95bce | src/vs/workbench/electron-sandbox/loaderCyclicChecker.ts | src/vs/workbench/electron-sandbox/loaderCyclicChecker.ts | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as nls from 'vs/nls';
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
import { Disposable } from 'vs/base/common/lifecycle';
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
import { Severity } from 'vs/platform/notification/common/notification';
import { INativeHostService } from 'vs/platform/native/electron-sandbox/native';
export class LoaderCyclicChecker extends Disposable implements IWorkbenchContribution {
constructor(
@IDialogService dialogService: IDialogService,
@INativeHostService nativeHostService: INativeHostService,
) {
super();
if (require.hasDependencyCycle()) {
dialogService.show(Severity.Error, nls.localize('loaderCycle', "There is a dependency cycle in the AMD modules"), [nls.localize('ok', "OK")]);
nativeHostService.openDevTools();
}
}
}
| /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as nls from 'vs/nls';
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
import { Disposable } from 'vs/base/common/lifecycle';
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
import { Severity } from 'vs/platform/notification/common/notification';
import { INativeHostService } from 'vs/platform/native/electron-sandbox/native';
export class LoaderCyclicChecker extends Disposable implements IWorkbenchContribution {
constructor(
@IDialogService dialogService: IDialogService,
@INativeHostService nativeHostService: INativeHostService,
) {
super();
if (require.hasDependencyCycle()) {
if (process.env.CI || process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) {
// running on a build machine, just exit
console.log('There is a dependency cycle in the AMD modules');
nativeHostService.exit(37);
}
dialogService.show(Severity.Error, nls.localize('loaderCycle', "There is a dependency cycle in the AMD modules"), [nls.localize('ok', "OK")]);
nativeHostService.openDevTools();
}
}
}
| Exit immediately when a cycle is found and running on the build | Exit immediately when a cycle is found and running on the build
| TypeScript | mit | Krzysztof-Cieslak/vscode,microsoft/vscode,microsoft/vscode,Krzysztof-Cieslak/vscode,Microsoft/vscode,Krzysztof-Cieslak/vscode,Microsoft/vscode,Microsoft/vscode,Microsoft/vscode,eamodio/vscode,Microsoft/vscode,eamodio/vscode,eamodio/vscode,Krzysztof-Cieslak/vscode,eamodio/vscode,Krzysztof-Cieslak/vscode,eamodio/vscode,microsoft/vscode,Microsoft/vscode,microsoft/vscode,eamodio/vscode,microsoft/vscode,eamodio/vscode,eamodio/vscode,Krzysztof-Cieslak/vscode,Microsoft/vscode,eamodio/vscode,Krzysztof-Cieslak/vscode,microsoft/vscode,Krzysztof-Cieslak/vscode,eamodio/vscode,Krzysztof-Cieslak/vscode,microsoft/vscode,Krzysztof-Cieslak/vscode,Krzysztof-Cieslak/vscode,microsoft/vscode,Microsoft/vscode,Microsoft/vscode,Microsoft/vscode,Microsoft/vscode,microsoft/vscode,microsoft/vscode,microsoft/vscode,eamodio/vscode,Krzysztof-Cieslak/vscode,microsoft/vscode,Krzysztof-Cieslak/vscode,Microsoft/vscode,microsoft/vscode,Krzysztof-Cieslak/vscode,microsoft/vscode,eamodio/vscode,Microsoft/vscode,eamodio/vscode,Microsoft/vscode,Krzysztof-Cieslak/vscode,Krzysztof-Cieslak/vscode,Microsoft/vscode,microsoft/vscode,microsoft/vscode,eamodio/vscode,Krzysztof-Cieslak/vscode,Microsoft/vscode,Microsoft/vscode,eamodio/vscode,eamodio/vscode,eamodio/vscode,microsoft/vscode | typescript | ## Code Before:
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as nls from 'vs/nls';
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
import { Disposable } from 'vs/base/common/lifecycle';
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
import { Severity } from 'vs/platform/notification/common/notification';
import { INativeHostService } from 'vs/platform/native/electron-sandbox/native';
export class LoaderCyclicChecker extends Disposable implements IWorkbenchContribution {
constructor(
@IDialogService dialogService: IDialogService,
@INativeHostService nativeHostService: INativeHostService,
) {
super();
if (require.hasDependencyCycle()) {
dialogService.show(Severity.Error, nls.localize('loaderCycle', "There is a dependency cycle in the AMD modules"), [nls.localize('ok', "OK")]);
nativeHostService.openDevTools();
}
}
}
## Instruction:
Exit immediately when a cycle is found and running on the build
## Code After:
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as nls from 'vs/nls';
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
import { Disposable } from 'vs/base/common/lifecycle';
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
import { Severity } from 'vs/platform/notification/common/notification';
import { INativeHostService } from 'vs/platform/native/electron-sandbox/native';
export class LoaderCyclicChecker extends Disposable implements IWorkbenchContribution {
constructor(
@IDialogService dialogService: IDialogService,
@INativeHostService nativeHostService: INativeHostService,
) {
super();
if (require.hasDependencyCycle()) {
if (process.env.CI || process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) {
// running on a build machine, just exit
console.log('There is a dependency cycle in the AMD modules');
nativeHostService.exit(37);
}
dialogService.show(Severity.Error, nls.localize('loaderCycle', "There is a dependency cycle in the AMD modules"), [nls.localize('ok', "OK")]);
nativeHostService.openDevTools();
}
}
}
| /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as nls from 'vs/nls';
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
import { Disposable } from 'vs/base/common/lifecycle';
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
import { Severity } from 'vs/platform/notification/common/notification';
import { INativeHostService } from 'vs/platform/native/electron-sandbox/native';
export class LoaderCyclicChecker extends Disposable implements IWorkbenchContribution {
constructor(
@IDialogService dialogService: IDialogService,
@INativeHostService nativeHostService: INativeHostService,
) {
super();
if (require.hasDependencyCycle()) {
+ if (process.env.CI || process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) {
+ // running on a build machine, just exit
+ console.log('There is a dependency cycle in the AMD modules');
+ nativeHostService.exit(37);
+ }
dialogService.show(Severity.Error, nls.localize('loaderCycle', "There is a dependency cycle in the AMD modules"), [nls.localize('ok', "OK")]);
nativeHostService.openDevTools();
}
}
}
| 5 | 0.185185 | 5 | 0 |
3b57227d55c74872169c9ab66e7f723a2b5bcd31 | capstone/src/main/java/com/google/sps/data/Form.java | capstone/src/main/java/com/google/sps/data/Form.java | package com.google.sps.data;
import java.io.*;
import com.google.appengine.api.datastore.Entity;
public class Form {
private String editURL;
private String URL;
private String id;
private boolean isPublished;
public Form(String editURL, String URL, String id) {
this.editURL = editURL;
this.URL = URL;
this.id = id;
this.isPublished = false;
}
public Form(Entity entity){
this.editURL = (String) entity.getProperty("editURL");
this.URL = (String) entity.getProperty("URL");
this.id = (String) entity.getProperty("id");
this.isPublished = Boolean.parseBoolean((String) entity.getProperty("isPublished"));
}
// Getters
public String getEditURL() {
return this.editURL;
}
public String getURL() {
return this.URL;
}
public String getID() {
return this.id;
}
public boolean isPublished() {
return this.isPublished;
}
// Setters
public void publish(){
this.isPublished = true;
}
public void unpublish(){
this.isPublished = false;
}
public Entity toDatastoreEntity(){
Entity formEntity = new Entity("Form");
formEntity.setProperty("editURL", this.editURL);
formEntity.setProperty("URL", this.URL);
formEntity.setProperty("id", this.id);
<<<<<<< HEAD
formEntity.setProperty("isPublished", this.isPublished);
=======
>>>>>>> MVP-K
return formEntity;
}
} | package com.google.sps.data;
import java.io.*;
import com.google.appengine.api.datastore.Entity;
public class Form {
private String editURL;
private String URL;
private String id;
private boolean isPublished;
public Form(String editURL, String URL, String id) {
this.editURL = editURL;
this.URL = URL;
this.id = id;
this.isPublished = false;
}
public Form(Entity entity){
this.editURL = (String) entity.getProperty("editURL");
this.URL = (String) entity.getProperty("URL");
this.id = (String) entity.getProperty("id");
this.isPublished = Boolean.parseBoolean((String) entity.getProperty("isPublished"));
}
// Getters
public String getEditURL() {
return this.editURL;
}
public String getURL() {
return this.URL;
}
public String getID() {
return this.id;
}
public boolean isPublished() {
return this.isPublished;
}
// Setters
public void publish(){
this.isPublished = true;
}
public void unpublish(){
this.isPublished = false;
}
public Entity toDatastoreEntity(){
Entity formEntity = new Entity("Form");
formEntity.setProperty("editURL", this.editURL);
formEntity.setProperty("URL", this.URL);
formEntity.setProperty("id", this.id);
formEntity.setProperty("isPublished", this.isPublished);
return formEntity;
}
} | Remove Head/Tail conflict in form.java | Remove Head/Tail conflict in form.java
| Java | apache-2.0 | googleinterns/step152-2020,googleinterns/step152-2020,googleinterns/step152-2020,googleinterns/step152-2020 | java | ## Code Before:
package com.google.sps.data;
import java.io.*;
import com.google.appengine.api.datastore.Entity;
public class Form {
private String editURL;
private String URL;
private String id;
private boolean isPublished;
public Form(String editURL, String URL, String id) {
this.editURL = editURL;
this.URL = URL;
this.id = id;
this.isPublished = false;
}
public Form(Entity entity){
this.editURL = (String) entity.getProperty("editURL");
this.URL = (String) entity.getProperty("URL");
this.id = (String) entity.getProperty("id");
this.isPublished = Boolean.parseBoolean((String) entity.getProperty("isPublished"));
}
// Getters
public String getEditURL() {
return this.editURL;
}
public String getURL() {
return this.URL;
}
public String getID() {
return this.id;
}
public boolean isPublished() {
return this.isPublished;
}
// Setters
public void publish(){
this.isPublished = true;
}
public void unpublish(){
this.isPublished = false;
}
public Entity toDatastoreEntity(){
Entity formEntity = new Entity("Form");
formEntity.setProperty("editURL", this.editURL);
formEntity.setProperty("URL", this.URL);
formEntity.setProperty("id", this.id);
<<<<<<< HEAD
formEntity.setProperty("isPublished", this.isPublished);
=======
>>>>>>> MVP-K
return formEntity;
}
}
## Instruction:
Remove Head/Tail conflict in form.java
## Code After:
package com.google.sps.data;
import java.io.*;
import com.google.appengine.api.datastore.Entity;
public class Form {
private String editURL;
private String URL;
private String id;
private boolean isPublished;
public Form(String editURL, String URL, String id) {
this.editURL = editURL;
this.URL = URL;
this.id = id;
this.isPublished = false;
}
public Form(Entity entity){
this.editURL = (String) entity.getProperty("editURL");
this.URL = (String) entity.getProperty("URL");
this.id = (String) entity.getProperty("id");
this.isPublished = Boolean.parseBoolean((String) entity.getProperty("isPublished"));
}
// Getters
public String getEditURL() {
return this.editURL;
}
public String getURL() {
return this.URL;
}
public String getID() {
return this.id;
}
public boolean isPublished() {
return this.isPublished;
}
// Setters
public void publish(){
this.isPublished = true;
}
public void unpublish(){
this.isPublished = false;
}
public Entity toDatastoreEntity(){
Entity formEntity = new Entity("Form");
formEntity.setProperty("editURL", this.editURL);
formEntity.setProperty("URL", this.URL);
formEntity.setProperty("id", this.id);
formEntity.setProperty("isPublished", this.isPublished);
return formEntity;
}
} | package com.google.sps.data;
import java.io.*;
import com.google.appengine.api.datastore.Entity;
public class Form {
private String editURL;
private String URL;
private String id;
private boolean isPublished;
public Form(String editURL, String URL, String id) {
this.editURL = editURL;
this.URL = URL;
this.id = id;
this.isPublished = false;
}
public Form(Entity entity){
this.editURL = (String) entity.getProperty("editURL");
this.URL = (String) entity.getProperty("URL");
this.id = (String) entity.getProperty("id");
this.isPublished = Boolean.parseBoolean((String) entity.getProperty("isPublished"));
}
// Getters
public String getEditURL() {
return this.editURL;
}
public String getURL() {
return this.URL;
}
public String getID() {
return this.id;
}
public boolean isPublished() {
return this.isPublished;
}
// Setters
public void publish(){
this.isPublished = true;
}
public void unpublish(){
this.isPublished = false;
}
public Entity toDatastoreEntity(){
Entity formEntity = new Entity("Form");
formEntity.setProperty("editURL", this.editURL);
formEntity.setProperty("URL", this.URL);
formEntity.setProperty("id", this.id);
- <<<<<<< HEAD
formEntity.setProperty("isPublished", this.isPublished);
- =======
- >>>>>>> MVP-K
return formEntity;
}
} | 3 | 0.047619 | 0 | 3 |
4696df59ec678d310cba499133f494ff954903dd | contrib/examples/actions/workflows/tests/mistral-test-pause-resume.yaml | contrib/examples/actions/workflows/tests/mistral-test-pause-resume.yaml | version: '2.0'
examples.mistral-test-pause-resume:
description: A sample workflow used to test the pause and resume feature.
type: direct
input:
- tempfile
- message
tasks:
task1:
action: core.local
input:
cmd: "while [ -e '<% $.tempfile %>' ]; do sleep 0.1; done"
timeout: 300
publish:
var1: <% $.message %>
on-success:
- task2
task2:
action: core.local
input:
cmd: 'sleep 10; echo "<% $.var1 %>"'
| version: '2.0'
examples.mistral-test-pause-resume:
description: A sample workflow used to test the pause and resume feature.
type: direct
input:
- tempfile
- message
tasks:
task1:
action: core.local
input:
cmd: "while [ -e '<% $.tempfile %>' ]; do sleep 0.1; done"
timeout: 300
publish:
var1: <% $.message %>
on-success:
- task2
task2:
action: core.local
input:
cmd: 'echo "<% $.var1 %>"'
| Clean up troubleshooting statements in tests | Clean up troubleshooting statements in tests
| YAML | apache-2.0 | Plexxi/st2,StackStorm/st2,Plexxi/st2,StackStorm/st2,nzlosh/st2,StackStorm/st2,nzlosh/st2,Plexxi/st2,nzlosh/st2,StackStorm/st2,nzlosh/st2,Plexxi/st2 | yaml | ## Code Before:
version: '2.0'
examples.mistral-test-pause-resume:
description: A sample workflow used to test the pause and resume feature.
type: direct
input:
- tempfile
- message
tasks:
task1:
action: core.local
input:
cmd: "while [ -e '<% $.tempfile %>' ]; do sleep 0.1; done"
timeout: 300
publish:
var1: <% $.message %>
on-success:
- task2
task2:
action: core.local
input:
cmd: 'sleep 10; echo "<% $.var1 %>"'
## Instruction:
Clean up troubleshooting statements in tests
## Code After:
version: '2.0'
examples.mistral-test-pause-resume:
description: A sample workflow used to test the pause and resume feature.
type: direct
input:
- tempfile
- message
tasks:
task1:
action: core.local
input:
cmd: "while [ -e '<% $.tempfile %>' ]; do sleep 0.1; done"
timeout: 300
publish:
var1: <% $.message %>
on-success:
- task2
task2:
action: core.local
input:
cmd: 'echo "<% $.var1 %>"'
| version: '2.0'
examples.mistral-test-pause-resume:
description: A sample workflow used to test the pause and resume feature.
type: direct
input:
- tempfile
- message
tasks:
task1:
action: core.local
input:
cmd: "while [ -e '<% $.tempfile %>' ]; do sleep 0.1; done"
timeout: 300
publish:
var1: <% $.message %>
on-success:
- task2
task2:
action: core.local
input:
- cmd: 'sleep 10; echo "<% $.var1 %>"'
? ----------
+ cmd: 'echo "<% $.var1 %>"' | 2 | 0.090909 | 1 | 1 |
029e1a2bf4bd7cf70d5cdad12d29f4adaf75e32c | lib/bombshell/completor.rb | lib/bombshell/completor.rb | module Bombshell
class Completor
def initialize(shell)
@shell = shell
end
attr_reader :shell
def complete(fragment)
self.class.filter(shell.instance_methods).grep Regexp.new(Regexp.quote(fragment))
end
def self.filter(m)
m - Bombshell::Environment.instance_methods - Bombshell::Shell::Commands::HIDE
end
end
end
| module Bombshell
class Completor
def initialize(shell)
@shell = shell
end
attr_reader :shell
def complete(fragment)
self.class.filter(shell.instance_methods).grep Regexp.new(Regexp.quote(fragment))
end
def self.filter(m)
(m - Bombshell::Environment.instance_methods - Bombshell::Shell::Commands::HIDE).reject do |m|
m =~ /^_/
end
end
end
end
| Hide _initial_underscore methods from tab completion | Hide _initial_underscore methods from tab completion
| Ruby | mit | rossmeissl/bombshell | ruby | ## Code Before:
module Bombshell
class Completor
def initialize(shell)
@shell = shell
end
attr_reader :shell
def complete(fragment)
self.class.filter(shell.instance_methods).grep Regexp.new(Regexp.quote(fragment))
end
def self.filter(m)
m - Bombshell::Environment.instance_methods - Bombshell::Shell::Commands::HIDE
end
end
end
## Instruction:
Hide _initial_underscore methods from tab completion
## Code After:
module Bombshell
class Completor
def initialize(shell)
@shell = shell
end
attr_reader :shell
def complete(fragment)
self.class.filter(shell.instance_methods).grep Regexp.new(Regexp.quote(fragment))
end
def self.filter(m)
(m - Bombshell::Environment.instance_methods - Bombshell::Shell::Commands::HIDE).reject do |m|
m =~ /^_/
end
end
end
end
| module Bombshell
class Completor
def initialize(shell)
@shell = shell
end
attr_reader :shell
def complete(fragment)
self.class.filter(shell.instance_methods).grep Regexp.new(Regexp.quote(fragment))
end
def self.filter(m)
- m - Bombshell::Environment.instance_methods - Bombshell::Shell::Commands::HIDE
+ (m - Bombshell::Environment.instance_methods - Bombshell::Shell::Commands::HIDE).reject do |m|
? + +++++++++++++++
+ m =~ /^_/
+ end
end
end
end
| 4 | 0.222222 | 3 | 1 |
889b9ad3f05da1a02275b9c2c6a2b7386136a8b2 | components/profile_traits/lib.rs | components/profile_traits/lib.rs | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! This module contains APIs for the `profile` crate used generically in the
//! rest of Servo. These APIs are here instead of in `profile` so that these
//! modules won't have to depend on `profile`.
#![feature(box_syntax)]
#![feature(plugin, proc_macro)]
#![plugin(plugins)]
#![deny(unsafe_code)]
extern crate ipc_channel;
#[macro_use]
extern crate log;
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate signpost;
extern crate util;
pub mod energy;
pub mod mem;
pub mod time;
| /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! This module contains APIs for the `profile` crate used generically in the
//! rest of Servo. These APIs are here instead of in `profile` so that these
//! modules won't have to depend on `profile`.
#![feature(box_syntax)]
#![feature(plugin, proc_macro)]
#![plugin(plugins)]
#![deny(unsafe_code)]
extern crate ipc_channel;
#[macro_use]
extern crate log;
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate signpost;
extern crate util;
#[allow(unsafe_code)]
pub mod energy;
pub mod mem;
pub mod time;
| Allow unsafe code for energy module (build failure otherwise) | Allow unsafe code for energy module (build failure otherwise)
| Rust | mpl-2.0 | splav/servo,anthgur/servo,cbrewster/servo,anthgur/servo,rnestler/servo,canaltinova/servo,dsandeephegde/servo,cbrewster/servo,mbrubeck/servo,CJ8664/servo,rnestler/servo,mattnenterprise/servo,CJ8664/servo,emilio/servo,szeged/servo,larsbergstrom/servo,dati91/servo,nnethercote/servo,ConnorGBrewster/servo,mbrubeck/servo,peterjoel/servo,CJ8664/servo,rnestler/servo,canaltinova/servo,larsbergstrom/servo,jimberlage/servo,SimonSapin/servo,mattnenterprise/servo,larsbergstrom/servo,DominoTree/servo,splav/servo,peterjoel/servo,splav/servo,DominoTree/servo,mbrubeck/servo,thiagopnts/servo,avadacatavra/servo,larsbergstrom/servo,ConnorGBrewster/servo,thiagopnts/servo,KiChjang/servo,peterjoel/servo,jimberlage/servo,pyfisch/servo,notriddle/servo,larsbergstrom/servo,SimonSapin/servo,fiji-flo/servo,upsuper/servo,ConnorGBrewster/servo,dati91/servo,sadmansk/servo,thiagopnts/servo,splav/servo,eddyb/servo,cbrewster/servo,notriddle/servo,larsbergstrom/servo,upsuper/servo,mattnenterprise/servo,notriddle/servo,SimonSapin/servo,sadmansk/servo,peterjoel/servo,eddyb/servo,SimonSapin/servo,dati91/servo,DominoTree/servo,szeged/servo,dati91/servo,DominoTree/servo,cbrewster/servo,nnethercote/servo,ConnorGBrewster/servo,fiji-flo/servo,upsuper/servo,saneyuki/servo,larsbergstrom/servo,avadacatavra/servo,dsandeephegde/servo,dsandeephegde/servo,saneyuki/servo,ConnorGBrewster/servo,eddyb/servo,szeged/servo,nnethercote/servo,splav/servo,splav/servo,pyfisch/servo,canaltinova/servo,cbrewster/servo,eddyb/servo,peterjoel/servo,dsandeephegde/servo,szeged/servo,dati91/servo,pyfisch/servo,dsandeephegde/servo,nnethercote/servo,splav/servo,upsuper/servo,pyfisch/servo,pyfisch/servo,eddyb/servo,szeged/servo,paulrouget/servo,canaltinova/servo,CJ8664/servo,canaltinova/servo,notriddle/servo,larsbergstrom/servo,mbrubeck/servo,mbrubeck/servo,anthgur/servo,mattnenterprise/servo,thiagopnts/servo,CJ8664/servo,CJ8664/servo,pyfisch/servo,cbrewster/servo,jimberlage/servo,jimberlage/servo,szeged/servo,jimberlage/servo,KiChjang/servo,emilio/servo,sadmansk/servo,paulrouget/servo,szeged/servo,saneyuki/servo,rnestler/servo,mattnenterprise/servo,anthgur/servo,saneyuki/servo,paulrouget/servo,thiagopnts/servo,sadmansk/servo,KiChjang/servo,dati91/servo,upsuper/servo,avadacatavra/servo,splav/servo,emilio/servo,DominoTree/servo,eddyb/servo,paulrouget/servo,pyfisch/servo,saneyuki/servo,nnethercote/servo,mattnenterprise/servo,emilio/servo,eddyb/servo,anthgur/servo,szeged/servo,jimberlage/servo,paulrouget/servo,fiji-flo/servo,notriddle/servo,peterjoel/servo,peterjoel/servo,avadacatavra/servo,ConnorGBrewster/servo,saneyuki/servo,thiagopnts/servo,splav/servo,KiChjang/servo,fiji-flo/servo,jimberlage/servo,rnestler/servo,KiChjang/servo,emilio/servo,upsuper/servo,paulrouget/servo,avadacatavra/servo,dsandeephegde/servo,saneyuki/servo,DominoTree/servo,dati91/servo,cbrewster/servo,mbrubeck/servo,emilio/servo,avadacatavra/servo,nnethercote/servo,sadmansk/servo,anthgur/servo,sadmansk/servo,SimonSapin/servo,KiChjang/servo,mattnenterprise/servo,avadacatavra/servo,peterjoel/servo,eddyb/servo,pyfisch/servo,anthgur/servo,dsandeephegde/servo,paulrouget/servo,CJ8664/servo,paulrouget/servo,fiji-flo/servo,ConnorGBrewster/servo,anthgur/servo,nnethercote/servo,dsandeephegde/servo,canaltinova/servo,ConnorGBrewster/servo,peterjoel/servo,emilio/servo,notriddle/servo,rnestler/servo,mattnenterprise/servo,saneyuki/servo,nnethercote/servo,emilio/servo,KiChjang/servo,DominoTree/servo,saneyuki/servo,upsuper/servo,canaltinova/servo,avadacatavra/servo,pyfisch/servo,canaltinova/servo,notriddle/servo,nnethercote/servo,thiagopnts/servo,paulrouget/servo,SimonSapin/servo,DominoTree/servo,emilio/servo,pyfisch/servo,cbrewster/servo,szeged/servo,dati91/servo,mbrubeck/servo,saneyuki/servo,nnethercote/servo,sadmansk/servo,rnestler/servo,szeged/servo,fiji-flo/servo,SimonSapin/servo,rnestler/servo,paulrouget/servo,KiChjang/servo,emilio/servo,KiChjang/servo,DominoTree/servo,notriddle/servo,fiji-flo/servo,notriddle/servo,larsbergstrom/servo,fiji-flo/servo,jimberlage/servo,mbrubeck/servo,notriddle/servo,CJ8664/servo,SimonSapin/servo,larsbergstrom/servo,jimberlage/servo,thiagopnts/servo,KiChjang/servo,sadmansk/servo,splav/servo,peterjoel/servo,DominoTree/servo,upsuper/servo | rust | ## Code Before:
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! This module contains APIs for the `profile` crate used generically in the
//! rest of Servo. These APIs are here instead of in `profile` so that these
//! modules won't have to depend on `profile`.
#![feature(box_syntax)]
#![feature(plugin, proc_macro)]
#![plugin(plugins)]
#![deny(unsafe_code)]
extern crate ipc_channel;
#[macro_use]
extern crate log;
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate signpost;
extern crate util;
pub mod energy;
pub mod mem;
pub mod time;
## Instruction:
Allow unsafe code for energy module (build failure otherwise)
## Code After:
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! This module contains APIs for the `profile` crate used generically in the
//! rest of Servo. These APIs are here instead of in `profile` so that these
//! modules won't have to depend on `profile`.
#![feature(box_syntax)]
#![feature(plugin, proc_macro)]
#![plugin(plugins)]
#![deny(unsafe_code)]
extern crate ipc_channel;
#[macro_use]
extern crate log;
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate signpost;
extern crate util;
#[allow(unsafe_code)]
pub mod energy;
pub mod mem;
pub mod time;
| /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! This module contains APIs for the `profile` crate used generically in the
//! rest of Servo. These APIs are here instead of in `profile` so that these
//! modules won't have to depend on `profile`.
#![feature(box_syntax)]
#![feature(plugin, proc_macro)]
#![plugin(plugins)]
#![deny(unsafe_code)]
extern crate ipc_channel;
#[macro_use]
extern crate log;
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate signpost;
extern crate util;
+ #[allow(unsafe_code)]
pub mod energy;
pub mod mem;
pub mod time; | 1 | 0.038462 | 1 | 0 |
e64d760ad3f44170c92a7398710c1b4f30b02b8c | src/test/sanity_tests.cpp | src/test/sanity_tests.cpp | // Copyright (c) 2012-2015 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "compat/sanity.h"
#include "key.h"
#include "test/test_bitcoin.h"
#include <boost/test/unit_test.hpp>
BOOST_FIXTURE_TEST_SUITE(sanity_tests, BasicTestingSetup)
BOOST_AUTO_TEST_CASE(basic_sanity)
{
BOOST_CHECK_MESSAGE(glibc_sanity_test() == true, "libc sanity test");
BOOST_CHECK_MESSAGE(glibcxx_sanity_test() == true, "stdlib sanity test");
BOOST_CHECK_MESSAGE(ECC_InitSanityCheck() == true, "openssl ECC test");
}
BOOST_AUTO_TEST_SUITE_END()
| // Copyright (c) 2012-2015 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "compat/sanity.h"
#include "key.h"
#include "test/test_bitcoin.h"
#include <boost/test/unit_test.hpp>
BOOST_FIXTURE_TEST_SUITE(sanity_tests, BasicTestingSetup)
BOOST_AUTO_TEST_CASE(basic_sanity)
{
BOOST_CHECK_MESSAGE(glibc_sanity_test() == true, "libc sanity test");
BOOST_CHECK_MESSAGE(glibcxx_sanity_test() == true, "stdlib sanity test");
BOOST_CHECK_MESSAGE(ECC_InitSanityCheck() == true, "openssl ECC test");
BOOST_CHECK_MESSAGE(init_and_check_sodium() == 0, "libsodium sanity test");
}
BOOST_AUTO_TEST_SUITE_END()
| Add the sanity test for libsodium. | Add the sanity test for libsodium.
Tested:
./src/test/test_bitcoin --run_test=sanity_tests
| C++ | mit | spiritlinxl/BTCGPU,BTCGPU/BTCGPU,StarbuckBG/BTCGPU,h4x3rotab/BTCGPU,shelvenzhou/BTCGPU,shelvenzhou/BTCGPU,h4x3rotab/BTCGPU,StarbuckBG/BTCGPU,spiritlinxl/BTCGPU,h4x3rotab/BTCGPU,h4x3rotab/BTCGPU,BTCGPU/BTCGPU,h4x3rotab/BTCGPU,spiritlinxl/BTCGPU,BTCGPU/BTCGPU,shelvenzhou/BTCGPU,StarbuckBG/BTCGPU,BTCGPU/BTCGPU,shelvenzhou/BTCGPU,spiritlinxl/BTCGPU,BTCGPU/BTCGPU,spiritlinxl/BTCGPU,StarbuckBG/BTCGPU,BTCGPU/BTCGPU,shelvenzhou/BTCGPU,StarbuckBG/BTCGPU,shelvenzhou/BTCGPU,StarbuckBG/BTCGPU,spiritlinxl/BTCGPU,h4x3rotab/BTCGPU | c++ | ## Code Before:
// Copyright (c) 2012-2015 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "compat/sanity.h"
#include "key.h"
#include "test/test_bitcoin.h"
#include <boost/test/unit_test.hpp>
BOOST_FIXTURE_TEST_SUITE(sanity_tests, BasicTestingSetup)
BOOST_AUTO_TEST_CASE(basic_sanity)
{
BOOST_CHECK_MESSAGE(glibc_sanity_test() == true, "libc sanity test");
BOOST_CHECK_MESSAGE(glibcxx_sanity_test() == true, "stdlib sanity test");
BOOST_CHECK_MESSAGE(ECC_InitSanityCheck() == true, "openssl ECC test");
}
BOOST_AUTO_TEST_SUITE_END()
## Instruction:
Add the sanity test for libsodium.
Tested:
./src/test/test_bitcoin --run_test=sanity_tests
## Code After:
// Copyright (c) 2012-2015 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "compat/sanity.h"
#include "key.h"
#include "test/test_bitcoin.h"
#include <boost/test/unit_test.hpp>
BOOST_FIXTURE_TEST_SUITE(sanity_tests, BasicTestingSetup)
BOOST_AUTO_TEST_CASE(basic_sanity)
{
BOOST_CHECK_MESSAGE(glibc_sanity_test() == true, "libc sanity test");
BOOST_CHECK_MESSAGE(glibcxx_sanity_test() == true, "stdlib sanity test");
BOOST_CHECK_MESSAGE(ECC_InitSanityCheck() == true, "openssl ECC test");
BOOST_CHECK_MESSAGE(init_and_check_sodium() == 0, "libsodium sanity test");
}
BOOST_AUTO_TEST_SUITE_END()
| // Copyright (c) 2012-2015 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "compat/sanity.h"
#include "key.h"
#include "test/test_bitcoin.h"
#include <boost/test/unit_test.hpp>
BOOST_FIXTURE_TEST_SUITE(sanity_tests, BasicTestingSetup)
BOOST_AUTO_TEST_CASE(basic_sanity)
{
BOOST_CHECK_MESSAGE(glibc_sanity_test() == true, "libc sanity test");
BOOST_CHECK_MESSAGE(glibcxx_sanity_test() == true, "stdlib sanity test");
BOOST_CHECK_MESSAGE(ECC_InitSanityCheck() == true, "openssl ECC test");
+ BOOST_CHECK_MESSAGE(init_and_check_sodium() == 0, "libsodium sanity test");
}
BOOST_AUTO_TEST_SUITE_END() | 1 | 0.05 | 1 | 0 |
388d30f266630975e30de38b987038859207d3bc | tests/glibc_syscall_wrappers/test_stat.c | tests/glibc_syscall_wrappers/test_stat.c | /*
* Copyright 2010 The Native Client Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can
* be found in the LICENSE file.
*/
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <sys/stat.h>
#pragma GCC diagnostic ignored "-Wnonnull"
#define KNOWN_FILE_SIZE 30
int main(int argc, char** argv) {
struct stat st;
struct stat64 st64;
if (2 != argc) {
printf("Usage: sel_ldr test_stat.nexe test_stat_data\n");
return 1;
}
st.st_size = 0;
st64.st_size = 0;
assert(-1 == stat(NULL, &st));
assert(EFAULT == errno);
assert(-1 == stat(".", NULL));
assert(EFAULT == errno);
errno = 0;
assert(0 == stat(argv[1], &st));
assert(0 == errno);
assert(KNOWN_FILE_SIZE == st.st_size);
assert(-1 == stat64(NULL, &st64));
assert(EFAULT == errno);
assert(-1 == stat64(".", NULL));
assert(EFAULT == errno);
errno = 0;
assert(0 == stat64(argv[1], &st64));
assert(0 == errno);
assert(KNOWN_FILE_SIZE == st64.st_size);
return 0;
}
| /*
* Copyright 2010 The Native Client Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can
* be found in the LICENSE file.
*/
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <sys/stat.h>
#pragma GCC diagnostic ignored "-Wnonnull"
#define KNOWN_FILE_SIZE 30
int main(int argc, char** argv) {
struct stat st;
if (2 != argc) {
printf("Usage: sel_ldr test_stat.nexe test_stat_data\n");
return 1;
}
st.st_size = 0;
assert(-1 == stat(NULL, &st));
assert(EFAULT == errno);
assert(-1 == stat(".", NULL));
assert(EFAULT == errno);
errno = 0;
assert(0 == stat(argv[1], &st));
assert(0 == errno);
assert(KNOWN_FILE_SIZE == st.st_size);
return 0;
}
| Remove test for obsolete function stat64. | Remove test for obsolete function stat64.
BUG=
TEST=run_stat_test
Review URL: http://codereview.chromium.org/6300006
git-svn-id: 721b910a23eff8a86f00c8fd261a7587cddf18f8@4152 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
| C | bsd-3-clause | sbc100/native_client,sbc100/native_client,nacl-webkit/native_client,nacl-webkit/native_client,sbc100/native_client,nacl-webkit/native_client,sbc100/native_client,sbc100/native_client,nacl-webkit/native_client,nacl-webkit/native_client,sbc100/native_client | c | ## Code Before:
/*
* Copyright 2010 The Native Client Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can
* be found in the LICENSE file.
*/
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <sys/stat.h>
#pragma GCC diagnostic ignored "-Wnonnull"
#define KNOWN_FILE_SIZE 30
int main(int argc, char** argv) {
struct stat st;
struct stat64 st64;
if (2 != argc) {
printf("Usage: sel_ldr test_stat.nexe test_stat_data\n");
return 1;
}
st.st_size = 0;
st64.st_size = 0;
assert(-1 == stat(NULL, &st));
assert(EFAULT == errno);
assert(-1 == stat(".", NULL));
assert(EFAULT == errno);
errno = 0;
assert(0 == stat(argv[1], &st));
assert(0 == errno);
assert(KNOWN_FILE_SIZE == st.st_size);
assert(-1 == stat64(NULL, &st64));
assert(EFAULT == errno);
assert(-1 == stat64(".", NULL));
assert(EFAULT == errno);
errno = 0;
assert(0 == stat64(argv[1], &st64));
assert(0 == errno);
assert(KNOWN_FILE_SIZE == st64.st_size);
return 0;
}
## Instruction:
Remove test for obsolete function stat64.
BUG=
TEST=run_stat_test
Review URL: http://codereview.chromium.org/6300006
git-svn-id: 721b910a23eff8a86f00c8fd261a7587cddf18f8@4152 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
## Code After:
/*
* Copyright 2010 The Native Client Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can
* be found in the LICENSE file.
*/
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <sys/stat.h>
#pragma GCC diagnostic ignored "-Wnonnull"
#define KNOWN_FILE_SIZE 30
int main(int argc, char** argv) {
struct stat st;
if (2 != argc) {
printf("Usage: sel_ldr test_stat.nexe test_stat_data\n");
return 1;
}
st.st_size = 0;
assert(-1 == stat(NULL, &st));
assert(EFAULT == errno);
assert(-1 == stat(".", NULL));
assert(EFAULT == errno);
errno = 0;
assert(0 == stat(argv[1], &st));
assert(0 == errno);
assert(KNOWN_FILE_SIZE == st.st_size);
return 0;
}
| /*
* Copyright 2010 The Native Client Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can
* be found in the LICENSE file.
*/
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <sys/stat.h>
#pragma GCC diagnostic ignored "-Wnonnull"
#define KNOWN_FILE_SIZE 30
int main(int argc, char** argv) {
struct stat st;
- struct stat64 st64;
if (2 != argc) {
printf("Usage: sel_ldr test_stat.nexe test_stat_data\n");
return 1;
}
st.st_size = 0;
- st64.st_size = 0;
assert(-1 == stat(NULL, &st));
assert(EFAULT == errno);
assert(-1 == stat(".", NULL));
assert(EFAULT == errno);
errno = 0;
assert(0 == stat(argv[1], &st));
assert(0 == errno);
assert(KNOWN_FILE_SIZE == st.st_size);
- assert(-1 == stat64(NULL, &st64));
- assert(EFAULT == errno);
- assert(-1 == stat64(".", NULL));
- assert(EFAULT == errno);
- errno = 0;
- assert(0 == stat64(argv[1], &st64));
- assert(0 == errno);
- assert(KNOWN_FILE_SIZE == st64.st_size);
-
return 0;
} | 11 | 0.23913 | 0 | 11 |
aa899e5de023ce13a333d12ea459b8e14a13d4b7 | app/assets/javascripts/ui.js.coffee | app/assets/javascripts/ui.js.coffee | jQuery ->
$(".clickable").live "click", (e) ->
window.location.href = $(this).find("a.primary-link").attr("href")
$(".collapsible")
.hover ->
$(this).find(".collapse").slideDown()
, ->
$(this).find(".collapse").slideUp()
.find(".collapse").hide()
$(":input.date").dateinput
format: "dddd, dd mmmm yyyy"
| jQuery ->
# Crude way to make large blocks .clickable by definiting a.primary-link in them
$(".clickable").live "click", (e) ->
window.location.href = $(this).find("a.primary-link").attr("href")
# When .collapsible item is hovered in/out the .collapse elements inside
# expand and collapse
$(".collapsible")
.hover ->
$(this).find(".collapse").slideDown()
, ->
$(this).find(".collapse").slideUp()
.find(".collapse").hide()
# Apply date selector to all date inputs
$(":input.date").dateinput
format: "dddd, dd mmmm yyyy"
# When a select box is changed search for other selects that
# are linked via the autoset and autoset-param data attributes
# and update them with the new value.
$(document).on "change", "select", ->
source_select = $ this
$("select[data-autoset='##{this.id}']").each ->
target_select = $ this
param = target_select.data("autoset-param")
new_value = source_select.find("option:selected").data(param)
console.info source_select, target_select, param, new_value
target_select.val(new_value)
# When a select box is changed find any dependent elements and
# hide or show based on whether the new value is blank or not.
$(document).on "change", "select", ->
source_select = $ this
$("*[data-dependent='##{this.id}']").each ->
target = $ this
if source_select.val() != ""
target.show()
else
target.hide()
| Add autoset and dependent methods to select inputs. | Add autoset and dependent methods to select inputs.
* Autoset allows one select to influence another.
* Dependent shows or hides elements based on the value of a select.
| CoffeeScript | mit | cyclestreets/cyclescape,cyclestreets/cyclescape,auto-mat/toolkit,auto-mat/toolkit,cyclestreets/cyclescape | coffeescript | ## Code Before:
jQuery ->
$(".clickable").live "click", (e) ->
window.location.href = $(this).find("a.primary-link").attr("href")
$(".collapsible")
.hover ->
$(this).find(".collapse").slideDown()
, ->
$(this).find(".collapse").slideUp()
.find(".collapse").hide()
$(":input.date").dateinput
format: "dddd, dd mmmm yyyy"
## Instruction:
Add autoset and dependent methods to select inputs.
* Autoset allows one select to influence another.
* Dependent shows or hides elements based on the value of a select.
## Code After:
jQuery ->
# Crude way to make large blocks .clickable by definiting a.primary-link in them
$(".clickable").live "click", (e) ->
window.location.href = $(this).find("a.primary-link").attr("href")
# When .collapsible item is hovered in/out the .collapse elements inside
# expand and collapse
$(".collapsible")
.hover ->
$(this).find(".collapse").slideDown()
, ->
$(this).find(".collapse").slideUp()
.find(".collapse").hide()
# Apply date selector to all date inputs
$(":input.date").dateinput
format: "dddd, dd mmmm yyyy"
# When a select box is changed search for other selects that
# are linked via the autoset and autoset-param data attributes
# and update them with the new value.
$(document).on "change", "select", ->
source_select = $ this
$("select[data-autoset='##{this.id}']").each ->
target_select = $ this
param = target_select.data("autoset-param")
new_value = source_select.find("option:selected").data(param)
console.info source_select, target_select, param, new_value
target_select.val(new_value)
# When a select box is changed find any dependent elements and
# hide or show based on whether the new value is blank or not.
$(document).on "change", "select", ->
source_select = $ this
$("*[data-dependent='##{this.id}']").each ->
target = $ this
if source_select.val() != ""
target.show()
else
target.hide()
| jQuery ->
+ # Crude way to make large blocks .clickable by definiting a.primary-link in them
$(".clickable").live "click", (e) ->
window.location.href = $(this).find("a.primary-link").attr("href")
+ # When .collapsible item is hovered in/out the .collapse elements inside
+ # expand and collapse
$(".collapsible")
.hover ->
$(this).find(".collapse").slideDown()
, ->
$(this).find(".collapse").slideUp()
.find(".collapse").hide()
+ # Apply date selector to all date inputs
$(":input.date").dateinput
format: "dddd, dd mmmm yyyy"
+
+ # When a select box is changed search for other selects that
+ # are linked via the autoset and autoset-param data attributes
+ # and update them with the new value.
+ $(document).on "change", "select", ->
+ source_select = $ this
+ $("select[data-autoset='##{this.id}']").each ->
+ target_select = $ this
+ param = target_select.data("autoset-param")
+ new_value = source_select.find("option:selected").data(param)
+ console.info source_select, target_select, param, new_value
+ target_select.val(new_value)
+
+ # When a select box is changed find any dependent elements and
+ # hide or show based on whether the new value is blank or not.
+ $(document).on "change", "select", ->
+ source_select = $ this
+ $("*[data-dependent='##{this.id}']").each ->
+ target = $ this
+ if source_select.val() != ""
+ target.show()
+ else
+ target.hide() | 27 | 2.076923 | 27 | 0 |
970da55f2320bef2103f879f4b6c7278b431bfbe | cast/cast.h | cast/cast.h | /*
* CAST-128 in C
* Written by Steve Reid <[email protected]>
* 100% Public Domain - no warranty
* Released 1997.10.11
*/
#ifndef _CAST_H_
#define _CAST_H_
typedef unsigned char u8; /* 8-bit unsigned */
typedef unsigned long u32; /* 32-bit unsigned */
typedef struct {
u32 xkey[32]; /* Key, after expansion */
int rounds; /* Number of rounds to use, 12 or 16 */
} cast_key;
void cast_setkey(cast_key* key, u8* rawkey, int keybytes);
void cast_encrypt(cast_key* key, u8* inblock, u8* outblock);
void cast_decrypt(cast_key* key, u8* inblock, u8* outblock);
#endif /* ifndef _CAST_H_ */
| /*
* CAST-128 in C
* Written by Steve Reid <[email protected]>
* 100% Public Domain - no warranty
* Released 1997.10.11
*/
#ifndef _CAST_H_
#define _CAST_H_
#include <stdint.h>
typedef uint8_t u8; /* 8-bit unsigned */
typedef uint32_t u32; /* 32-bit unsigned */
typedef struct {
u32 xkey[32]; /* Key, after expansion */
int rounds; /* Number of rounds to use, 12 or 16 */
} cast_key;
void cast_setkey(cast_key* key, u8* rawkey, int keybytes);
void cast_encrypt(cast_key* key, u8* inblock, u8* outblock);
void cast_decrypt(cast_key* key, u8* inblock, u8* outblock);
#endif /* ifndef _CAST_H_ */
| Use stdint.h in CAST to implement 32 bit and 8 bit unsigned integers. | Use stdint.h in CAST to implement 32 bit and 8 bit unsigned integers.
| C | bsd-3-clause | wilx/apg,wilx/apg,wilx/apg,rogerapras/apg,rogerapras/apg,rogerapras/apg,rogerapras/apg,wilx/apg | c | ## Code Before:
/*
* CAST-128 in C
* Written by Steve Reid <[email protected]>
* 100% Public Domain - no warranty
* Released 1997.10.11
*/
#ifndef _CAST_H_
#define _CAST_H_
typedef unsigned char u8; /* 8-bit unsigned */
typedef unsigned long u32; /* 32-bit unsigned */
typedef struct {
u32 xkey[32]; /* Key, after expansion */
int rounds; /* Number of rounds to use, 12 or 16 */
} cast_key;
void cast_setkey(cast_key* key, u8* rawkey, int keybytes);
void cast_encrypt(cast_key* key, u8* inblock, u8* outblock);
void cast_decrypt(cast_key* key, u8* inblock, u8* outblock);
#endif /* ifndef _CAST_H_ */
## Instruction:
Use stdint.h in CAST to implement 32 bit and 8 bit unsigned integers.
## Code After:
/*
* CAST-128 in C
* Written by Steve Reid <[email protected]>
* 100% Public Domain - no warranty
* Released 1997.10.11
*/
#ifndef _CAST_H_
#define _CAST_H_
#include <stdint.h>
typedef uint8_t u8; /* 8-bit unsigned */
typedef uint32_t u32; /* 32-bit unsigned */
typedef struct {
u32 xkey[32]; /* Key, after expansion */
int rounds; /* Number of rounds to use, 12 or 16 */
} cast_key;
void cast_setkey(cast_key* key, u8* rawkey, int keybytes);
void cast_encrypt(cast_key* key, u8* inblock, u8* outblock);
void cast_decrypt(cast_key* key, u8* inblock, u8* outblock);
#endif /* ifndef _CAST_H_ */
| /*
* CAST-128 in C
* Written by Steve Reid <[email protected]>
* 100% Public Domain - no warranty
* Released 1997.10.11
*/
#ifndef _CAST_H_
#define _CAST_H_
+ #include <stdint.h>
+
- typedef unsigned char u8; /* 8-bit unsigned */
? ^^^^^^^^^^^
+ typedef uint8_t u8; /* 8-bit unsigned */
? + ^^^^
- typedef unsigned long u32; /* 32-bit unsigned */
? ^^^^^^^^^^^
+ typedef uint32_t u32; /* 32-bit unsigned */
? + ^^^^^
typedef struct {
- u32 xkey[32]; /* Key, after expansion */
? ^
+ u32 xkey[32]; /* Key, after expansion */
? ^^^^^^^^
- int rounds; /* Number of rounds to use, 12 or 16 */
? ^
+ int rounds; /* Number of rounds to use, 12 or 16 */
? ^^^^^^^^
} cast_key;
void cast_setkey(cast_key* key, u8* rawkey, int keybytes);
void cast_encrypt(cast_key* key, u8* inblock, u8* outblock);
void cast_decrypt(cast_key* key, u8* inblock, u8* outblock);
#endif /* ifndef _CAST_H_ */
- | 11 | 0.458333 | 6 | 5 |
482ade3beba0c9f3be89925719c2fff965fa6f52 | attributes/default.rb | attributes/default.rb | default.admin_essentials.packages = %w(
mc
htop
strace
screen
inotify-tools
debconf-utils
rlwrap
multitail
vim
zsh
lsof
less
bc
dc
psmisc
tcpdump
moreutils
tree
sudo
dnsutils
curl
zip
unzip
aptitude
iotop
tmux
keychain
rar
unrar
wakeonlan
whois
tcpdump
nmap
)
# users to set admin preferences for (apart from root)
default.admin_essentials.admin_users = []
default.admin_essentials.admin_groups = []
# $EDITOR to set for admins, defaults to current $EDITOR (unless empty)
default.admin_essentials.editor =
(ENV['EDITOR'].nil? || ENV['EDITOR'].empty?) ? 'emacs' : ENV['EDITOR']
| default.admin_essentials.packages = %w(
mc
htop
strace
screen
inotify-tools
debconf-utils
rlwrap
multitail
vim
zsh
lsof
less
bc
dc
psmisc
tcpdump
moreutils
tree
sudo
dnsutils
curl
zip
unzip
aptitude
iotop
tmux
keychain
wakeonlan
whois
tcpdump
nmap
)
# users to set admin preferences for (apart from root)
default.admin_essentials.admin_users = []
default.admin_essentials.admin_groups = []
# $EDITOR to set for admins, defaults to current $EDITOR (unless empty)
default.admin_essentials.editor =
(ENV['EDITOR'].nil? || ENV['EDITOR'].empty?) ? 'emacs' : ENV['EDITOR']
| Revert "Install rar and unrar" (multiverse should be optional) | Revert "Install rar and unrar" (multiverse should be optional)
This reverts commit dd31e5575fc173d476bec7e9fe65233014e0afd8.
Conflicts:
attributes/default.rb
| Ruby | mit | sometimesfood/chef-admin-essentials,sometimesfood/chef-admin-essentials,sometimesfood/chef-admin-essentials | ruby | ## Code Before:
default.admin_essentials.packages = %w(
mc
htop
strace
screen
inotify-tools
debconf-utils
rlwrap
multitail
vim
zsh
lsof
less
bc
dc
psmisc
tcpdump
moreutils
tree
sudo
dnsutils
curl
zip
unzip
aptitude
iotop
tmux
keychain
rar
unrar
wakeonlan
whois
tcpdump
nmap
)
# users to set admin preferences for (apart from root)
default.admin_essentials.admin_users = []
default.admin_essentials.admin_groups = []
# $EDITOR to set for admins, defaults to current $EDITOR (unless empty)
default.admin_essentials.editor =
(ENV['EDITOR'].nil? || ENV['EDITOR'].empty?) ? 'emacs' : ENV['EDITOR']
## Instruction:
Revert "Install rar and unrar" (multiverse should be optional)
This reverts commit dd31e5575fc173d476bec7e9fe65233014e0afd8.
Conflicts:
attributes/default.rb
## Code After:
default.admin_essentials.packages = %w(
mc
htop
strace
screen
inotify-tools
debconf-utils
rlwrap
multitail
vim
zsh
lsof
less
bc
dc
psmisc
tcpdump
moreutils
tree
sudo
dnsutils
curl
zip
unzip
aptitude
iotop
tmux
keychain
wakeonlan
whois
tcpdump
nmap
)
# users to set admin preferences for (apart from root)
default.admin_essentials.admin_users = []
default.admin_essentials.admin_groups = []
# $EDITOR to set for admins, defaults to current $EDITOR (unless empty)
default.admin_essentials.editor =
(ENV['EDITOR'].nil? || ENV['EDITOR'].empty?) ? 'emacs' : ENV['EDITOR']
| default.admin_essentials.packages = %w(
mc
htop
strace
screen
inotify-tools
debconf-utils
rlwrap
multitail
vim
zsh
lsof
less
bc
dc
psmisc
tcpdump
moreutils
tree
sudo
dnsutils
curl
zip
unzip
aptitude
iotop
tmux
keychain
- rar
- unrar
wakeonlan
whois
tcpdump
nmap
)
# users to set admin preferences for (apart from root)
default.admin_essentials.admin_users = []
default.admin_essentials.admin_groups = []
# $EDITOR to set for admins, defaults to current $EDITOR (unless empty)
default.admin_essentials.editor =
(ENV['EDITOR'].nil? || ENV['EDITOR'].empty?) ? 'emacs' : ENV['EDITOR'] | 2 | 0.046512 | 0 | 2 |
603870ee07d2d62382cf19107643e0acb79e3b58 | test/summary.js | test/summary.js | var fs = require('fs');
var path = require('path');
var assert = require('assert');
var summary = require('../lib/summary');
var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/SUMMARY.md'), 'utf8');
var LEXED = summary(CONTENT);
describe('Summary parsing', function () {
console.log(LEXED);
it('should detect chapters', function() {
assert.equal(LEXED.chapters.length, 3);
});
it('should support articles', function() {
assert.equal(LEXED.chapters[0].articles.length, 2);
assert.equal(LEXED.chapters[1].articles.length, 0);
assert.equal(LEXED.chapters[2].articles.length, 0);
});
});
| var fs = require('fs');
var path = require('path');
var assert = require('assert');
var summary = require('../lib/summary');
var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/SUMMARY.md'), 'utf8');
var LEXED = summary(CONTENT);
describe('Summary parsing', function () {
console.log(LEXED);
it('should detect chapters', function() {
assert.equal(LEXED.chapters.length, 3);
});
it('should support articles', function() {
assert.equal(LEXED.chapters[0].articles.length, 2);
assert.equal(LEXED.chapters[1].articles.length, 0);
assert.equal(LEXED.chapters[2].articles.length, 0);
});
it('should detect paths and titles', function() {
assert(LEXED.chapters[0].chapter.path);
assert(LEXED.chapters[1].chapter.path);
assert(LEXED.chapters[2].chapter.path);
assert(LEXED.chapters[0].chapter.title);
assert(LEXED.chapters[1].chapter.title);
assert(LEXED.chapters[2].chapter.title);
});
});
| Add test for titles & paths | Add test for titles & paths
| JavaScript | apache-2.0 | 2390183798/gitbook,justinleoye/gitbook,2390183798/gitbook,JozoVilcek/gitbook,rohan07/gitbook,snowsnail/gitbook,ZachLamb/gitbook,FKV587/gitbook,xiongjungit/gitbook,Keystion/gitbook,rohan07/gitbook,ShaguptaS/gitbook,bradparks/gitbook,qingying5810/gitbook,nycitt/gitbook,megumiteam/documentation,qingying5810/gitbook,mruse/gitbook,webwlsong/gitbook,xxxhycl2010/gitbook,intfrr/gitbook,snowsnail/gitbook,mruse/gitbook,bradparks/gitbook,gencer/gitbook,minghe/gitbook,tzq668766/gitbook,boyXiong/gitbook,webwlsong/gitbook,xcv58/gitbook,alex-dixon/gitbook,ryanswanson/gitbook,codepiano/gitbook,tshoper/gitbook,justinleoye/gitbook,mautic/documentation,JohnTroony/gitbook,ZachLamb/gitbook,ShaguptaS/gitbook,sunlianghua/gitbook,intfrr/gitbook,a-moses/gitbook,xiongjungit/gitbook,anrim/gitbook,hujianfei1989/gitbook,nycitt/gitbook,xcv58/gitbook,OriPekelman/gitbook,a-moses/gitbook,minghe/gitbook,kamyu104/gitbook,vehar/gitbook,gaearon/gitbook,guiquanz/gitbook,codepiano/gitbook,thelastmile/gitbook,npracht/documentation,palerdot/gitbook,bjlxj2008/gitbook,hongbinz/gitbook,ferrior30/gitbook,shibe97/gitbook,shibe97/gitbook,gdbooks/gitbook,hujianfei1989/gitbook,vehar/gitbook,ferrior30/gitbook,tshoper/gitbook,yaonphy/SwiftBlog,jasonslyvia/gitbook,youprofit/gitbook,mautic/documentation,jasonslyvia/gitbook,athiruban/gitbook,svenkatreddy/gitbook,lucciano/gitbook,youprofit/gitbook,gencer/gitbook,lucciano/gitbook,FKV587/gitbook,OriPekelman/gitbook,sudobashme/gitbook,tzq668766/gitbook,haamop/documentation,gaearon/gitbook,iflyup/gitbook,sunlianghua/gitbook,thelastmile/gitbook,iflyup/gitbook,escopecz/documentation,haamop/documentation,gdbooks/gitbook,iamchenxin/gitbook,jocr1627/gitbook,Abhikos/gitbook,grokcoder/gitbook,xxxhycl2010/gitbook,svenkatreddy/gitbook,grokcoder/gitbook,hongbinz/gitbook,switchspan/gitbook,sudobashme/gitbook,escopecz/documentation,JohnTroony/gitbook,kamyu104/gitbook,boyXiong/gitbook,bjlxj2008/gitbook,GitbookIO/gitbook,iamchenxin/gitbook,CN-Sean/gitbook,guiquanz/gitbook,megumiteam/documentation,strawluffy/gitbook,jocr1627/gitbook,wewelove/gitbook,athiruban/gitbook,palerdot/gitbook,wewelove/gitbook,switchspan/gitbook,npracht/documentation,alex-dixon/gitbook,CN-Sean/gitbook | javascript | ## Code Before:
var fs = require('fs');
var path = require('path');
var assert = require('assert');
var summary = require('../lib/summary');
var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/SUMMARY.md'), 'utf8');
var LEXED = summary(CONTENT);
describe('Summary parsing', function () {
console.log(LEXED);
it('should detect chapters', function() {
assert.equal(LEXED.chapters.length, 3);
});
it('should support articles', function() {
assert.equal(LEXED.chapters[0].articles.length, 2);
assert.equal(LEXED.chapters[1].articles.length, 0);
assert.equal(LEXED.chapters[2].articles.length, 0);
});
});
## Instruction:
Add test for titles & paths
## Code After:
var fs = require('fs');
var path = require('path');
var assert = require('assert');
var summary = require('../lib/summary');
var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/SUMMARY.md'), 'utf8');
var LEXED = summary(CONTENT);
describe('Summary parsing', function () {
console.log(LEXED);
it('should detect chapters', function() {
assert.equal(LEXED.chapters.length, 3);
});
it('should support articles', function() {
assert.equal(LEXED.chapters[0].articles.length, 2);
assert.equal(LEXED.chapters[1].articles.length, 0);
assert.equal(LEXED.chapters[2].articles.length, 0);
});
it('should detect paths and titles', function() {
assert(LEXED.chapters[0].chapter.path);
assert(LEXED.chapters[1].chapter.path);
assert(LEXED.chapters[2].chapter.path);
assert(LEXED.chapters[0].chapter.title);
assert(LEXED.chapters[1].chapter.title);
assert(LEXED.chapters[2].chapter.title);
});
});
| var fs = require('fs');
var path = require('path');
var assert = require('assert');
var summary = require('../lib/summary');
var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/SUMMARY.md'), 'utf8');
var LEXED = summary(CONTENT);
describe('Summary parsing', function () {
console.log(LEXED);
+
it('should detect chapters', function() {
assert.equal(LEXED.chapters.length, 3);
});
+
it('should support articles', function() {
assert.equal(LEXED.chapters[0].articles.length, 2);
assert.equal(LEXED.chapters[1].articles.length, 0);
assert.equal(LEXED.chapters[2].articles.length, 0);
});
+
+ it('should detect paths and titles', function() {
+ assert(LEXED.chapters[0].chapter.path);
+ assert(LEXED.chapters[1].chapter.path);
+ assert(LEXED.chapters[2].chapter.path);
+
+ assert(LEXED.chapters[0].chapter.title);
+ assert(LEXED.chapters[1].chapter.title);
+ assert(LEXED.chapters[2].chapter.title);
+ });
}); | 12 | 0.545455 | 12 | 0 |
167aa9c05d802c022335bdcb32edd5cf2345532d | gradle.properties | gradle.properties | version = 0.3.6-SNAPSHOT
gosuVersion = 1.14.5
testedVersions = 2.12, 2.13, 2.14.1, 3.0, 3.1, 3.2.1, 3.3, 3.4.1, 3.5, 4.0.2, 4.1, 4.3-20171004093631+0000, 4.3-20171009073120+0000, 4.4-20171009141228+0000
| version = 0.3.6-SNAPSHOT
gosuVersion = 1.14.5
testedVersions = 2.12, 2.13, 2.14.1, 3.0, 3.1, 3.2.1, 3.3, 3.4.1, 3.5, 4.0.2, 4.1, 4.3.1, 4.4-rc-3
| Test against 4.3.1 release and 4.4-rc-3 | Test against 4.3.1 release and 4.4-rc-3
| INI | bsd-3-clause | gosu-lang/gradle-gosu-plugin | ini | ## Code Before:
version = 0.3.6-SNAPSHOT
gosuVersion = 1.14.5
testedVersions = 2.12, 2.13, 2.14.1, 3.0, 3.1, 3.2.1, 3.3, 3.4.1, 3.5, 4.0.2, 4.1, 4.3-20171004093631+0000, 4.3-20171009073120+0000, 4.4-20171009141228+0000
## Instruction:
Test against 4.3.1 release and 4.4-rc-3
## Code After:
version = 0.3.6-SNAPSHOT
gosuVersion = 1.14.5
testedVersions = 2.12, 2.13, 2.14.1, 3.0, 3.1, 3.2.1, 3.3, 3.4.1, 3.5, 4.0.2, 4.1, 4.3.1, 4.4-rc-3
| version = 0.3.6-SNAPSHOT
gosuVersion = 1.14.5
- testedVersions = 2.12, 2.13, 2.14.1, 3.0, 3.1, 3.2.1, 3.3, 3.4.1, 3.5, 4.0.2, 4.1, 4.3-20171004093631+0000, 4.3-20171009073120+0000, 4.4-20171009141228+0000
+ testedVersions = 2.12, 2.13, 2.14.1, 3.0, 3.1, 3.2.1, 3.3, 3.4.1, 3.5, 4.0.2, 4.1, 4.3.1, 4.4-rc-3 | 2 | 0.666667 | 1 | 1 |
24d1410363db3cb5af948fd8b443182bed446c9c | steve-server/src/main/scala/dao/StevePostgresProfile.scala | steve-server/src/main/scala/dao/StevePostgresProfile.scala | package dao
import com.github.tminglei.slickpg._
import play.api.libs.json.{JsValue, Json}
import slick.basic.Capability
import slick.jdbc.JdbcCapabilities
trait StevePostgresProfile extends ExPostgresProfile
with PgArraySupport
with PgHStoreSupport
with PgDate2Support {
def pgjson = "jsonb" // jsonb support is in postgres 9.4.0 onward; for 9.3.x use "json"
// Add back `capabilities.insertOrUpdate` to enable native `upsert` support; for postgres 9.5+
override protected def computeCapabilities: Set[Capability] =
super.computeCapabilities + JdbcCapabilities.insertOrUpdate
override val api = StevePostgresAPI
object StevePostgresAPI extends API with ArrayImplicits
with DateTimeImplicits
with HStoreImplicits {
implicit val strListTypeMapper = new SimpleArrayJdbcType[String]("text").to(_.toList)
implicit val playJsonArrayTypeMapper =
new AdvancedArrayJdbcType[JsValue](pgjson,
(s) => utils.SimpleArrayUtils.fromString[JsValue](Json.parse)(s).orNull,
(v) => utils.SimpleArrayUtils.mkString[JsValue](_.toString())(v)
).to(_.toList)
implicit val JavaUtilDateMapper =
MappedColumnType.base[java.util.Date, java.sql.Timestamp](
d => new java.sql.Timestamp(d.getTime),
d => new java.util.Date(d.getTime))
}
}
object StevePostgresProfile extends StevePostgresProfile
| package dao
import com.github.tminglei.slickpg._
import slick.basic.Capability
import slick.jdbc.JdbcCapabilities
trait StevePostgresProfile extends ExPostgresProfile
with PgArraySupport
with PgHStoreSupport
with PgDate2Support {
def pgjson = "jsonb" // jsonb support is in postgres 9.4.0 onward; for 9.3.x use "json"
// Add back `capabilities.insertOrUpdate` to enable native `upsert` support; for postgres 9.5+
override protected def computeCapabilities: Set[Capability] =
super.computeCapabilities + JdbcCapabilities.insertOrUpdate
override val api = StevePostgresAPI
object StevePostgresAPI extends API with ArrayImplicits
with DateTimeImplicits
with HStoreImplicits {
implicit val strListTypeMapper = new SimpleArrayJdbcType[String]("text").to(_.toList)
implicit val JavaUtilDateMapper =
MappedColumnType.base[java.util.Date, java.sql.Timestamp](
d => new java.sql.Timestamp(d.getTime),
d => new java.util.Date(d.getTime))
}
}
object StevePostgresProfile extends StevePostgresProfile
| Remove PlayJSON stuff as we don't need it anymore. | Remove PlayJSON stuff as we don't need it anymore.
See 290140583e544364b85afbb9b6d3e4f1d096a017.
| Scala | apache-2.0 | ind9/steve | scala | ## Code Before:
package dao
import com.github.tminglei.slickpg._
import play.api.libs.json.{JsValue, Json}
import slick.basic.Capability
import slick.jdbc.JdbcCapabilities
trait StevePostgresProfile extends ExPostgresProfile
with PgArraySupport
with PgHStoreSupport
with PgDate2Support {
def pgjson = "jsonb" // jsonb support is in postgres 9.4.0 onward; for 9.3.x use "json"
// Add back `capabilities.insertOrUpdate` to enable native `upsert` support; for postgres 9.5+
override protected def computeCapabilities: Set[Capability] =
super.computeCapabilities + JdbcCapabilities.insertOrUpdate
override val api = StevePostgresAPI
object StevePostgresAPI extends API with ArrayImplicits
with DateTimeImplicits
with HStoreImplicits {
implicit val strListTypeMapper = new SimpleArrayJdbcType[String]("text").to(_.toList)
implicit val playJsonArrayTypeMapper =
new AdvancedArrayJdbcType[JsValue](pgjson,
(s) => utils.SimpleArrayUtils.fromString[JsValue](Json.parse)(s).orNull,
(v) => utils.SimpleArrayUtils.mkString[JsValue](_.toString())(v)
).to(_.toList)
implicit val JavaUtilDateMapper =
MappedColumnType.base[java.util.Date, java.sql.Timestamp](
d => new java.sql.Timestamp(d.getTime),
d => new java.util.Date(d.getTime))
}
}
object StevePostgresProfile extends StevePostgresProfile
## Instruction:
Remove PlayJSON stuff as we don't need it anymore.
See 290140583e544364b85afbb9b6d3e4f1d096a017.
## Code After:
package dao
import com.github.tminglei.slickpg._
import slick.basic.Capability
import slick.jdbc.JdbcCapabilities
trait StevePostgresProfile extends ExPostgresProfile
with PgArraySupport
with PgHStoreSupport
with PgDate2Support {
def pgjson = "jsonb" // jsonb support is in postgres 9.4.0 onward; for 9.3.x use "json"
// Add back `capabilities.insertOrUpdate` to enable native `upsert` support; for postgres 9.5+
override protected def computeCapabilities: Set[Capability] =
super.computeCapabilities + JdbcCapabilities.insertOrUpdate
override val api = StevePostgresAPI
object StevePostgresAPI extends API with ArrayImplicits
with DateTimeImplicits
with HStoreImplicits {
implicit val strListTypeMapper = new SimpleArrayJdbcType[String]("text").to(_.toList)
implicit val JavaUtilDateMapper =
MappedColumnType.base[java.util.Date, java.sql.Timestamp](
d => new java.sql.Timestamp(d.getTime),
d => new java.util.Date(d.getTime))
}
}
object StevePostgresProfile extends StevePostgresProfile
| package dao
import com.github.tminglei.slickpg._
- import play.api.libs.json.{JsValue, Json}
import slick.basic.Capability
import slick.jdbc.JdbcCapabilities
trait StevePostgresProfile extends ExPostgresProfile
with PgArraySupport
with PgHStoreSupport
with PgDate2Support {
def pgjson = "jsonb" // jsonb support is in postgres 9.4.0 onward; for 9.3.x use "json"
// Add back `capabilities.insertOrUpdate` to enable native `upsert` support; for postgres 9.5+
override protected def computeCapabilities: Set[Capability] =
super.computeCapabilities + JdbcCapabilities.insertOrUpdate
override val api = StevePostgresAPI
object StevePostgresAPI extends API with ArrayImplicits
with DateTimeImplicits
with HStoreImplicits {
implicit val strListTypeMapper = new SimpleArrayJdbcType[String]("text").to(_.toList)
- implicit val playJsonArrayTypeMapper =
- new AdvancedArrayJdbcType[JsValue](pgjson,
- (s) => utils.SimpleArrayUtils.fromString[JsValue](Json.parse)(s).orNull,
- (v) => utils.SimpleArrayUtils.mkString[JsValue](_.toString())(v)
- ).to(_.toList)
implicit val JavaUtilDateMapper =
MappedColumnType.base[java.util.Date, java.sql.Timestamp](
d => new java.sql.Timestamp(d.getTime),
d => new java.util.Date(d.getTime))
}
}
object StevePostgresProfile extends StevePostgresProfile | 6 | 0.162162 | 0 | 6 |
78d61b68d6b791860fd1e691e62ec1bac36d9ac5 | README.md | README.md |
> MTG utilities for node.
## License
[MIT](ihttps://raw.githubusercontent.com/jtrussell/node-mtg/master/LICENSE-MIT)
|
> MTG utilities for node.
## CLI
```
mtg info|i <card>
curve <decklist>
cache clean|clear|list|ls [<card> [, ...]]
-h|--help|help [<command>]
-v|--version|version
```
## License
[MIT](ihttps://raw.githubusercontent.com/jtrussell/node-mtg/master/LICENSE-MIT)
| Add some cli usage concepts | Add some cli usage concepts
| Markdown | mit | jtrussell/node-mtg | markdown | ## Code Before:
> MTG utilities for node.
## License
[MIT](ihttps://raw.githubusercontent.com/jtrussell/node-mtg/master/LICENSE-MIT)
## Instruction:
Add some cli usage concepts
## Code After:
> MTG utilities for node.
## CLI
```
mtg info|i <card>
curve <decklist>
cache clean|clear|list|ls [<card> [, ...]]
-h|--help|help [<command>]
-v|--version|version
```
## License
[MIT](ihttps://raw.githubusercontent.com/jtrussell/node-mtg/master/LICENSE-MIT)
|
> MTG utilities for node.
+
+ ## CLI
+
+ ```
+ mtg info|i <card>
+ curve <decklist>
+ cache clean|clear|list|ls [<card> [, ...]]
+ -h|--help|help [<command>]
+ -v|--version|version
+ ```
## License
[MIT](ihttps://raw.githubusercontent.com/jtrussell/node-mtg/master/LICENSE-MIT) | 10 | 1.666667 | 10 | 0 |
03c7bf40cba105ac4305cbae94d3131b211563bf | bundles/base/setup.yml | bundles/base/setup.yml | ---
- hosts: 127.0.0.1
sudo: yes
connection: local
vars:
- ipython_pem_file: "/home/{{ dst_username }}/.ssh/ipython_dst.pem"
vars_prompt:
- name: "ipython_password"
prompt: "IPython notebook password"
private: yes
confirm: yes
tasks:
- name: Encrypt password
shell: ./passwd.py {{ ipython_password }}
- name: Load password
include_vars: passwd_hash.yml
- name: Make sure that the notebooks directory exists
file: path=/home/{{ dst_username }}/notebooks state=directory owner={{ dst_username }} group={{ dst_username }}
- name: Create IPython profile
shell: "ipython profile create dst --ipython-dir=/home/{{ dst_username }}/.ipython"
- name: Remove password file
shell: rm passwd_hash.yml
- name: Create self-signed SSL certificate
shell: openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout {{ ipython_pem_file }} -out {{ ipython_pem_file }} -batch
- name: Update IPython configuration
template: src=ipython_notebook_config.py.j2 dest=/home/{{ dst_username }}/.ipython/profile_dst/ipython_notebook_config.py owner={{ dst_username }} group={{ dst_username }} mode=0644 backup=true
- name: IPython -- Change IPython owner.
file: path=/home/{{ dst_username }} /.ipython owner={{ dst_username }} recurse=yes state=directory
| ---
- hosts: 127.0.0.1
sudo: yes
connection: local
vars:
- ipython_pem_file: "/home/{{ dst_username }}/.ssh/ipython_dst.pem"
vars_prompt:
- name: "ipython_password"
prompt: "IPython notebook password"
private: yes
confirm: yes
tasks:
- name: Encrypt password
shell: ./passwd.py {{ ipython_password }}
- name: Load password
include_vars: passwd_hash.yml
- name: Make sure that the notebooks directory exists
file: path=/home/{{ dst_username }}/notebooks state=directory owner={{ dst_username }} group={{ dst_username }}
- name: Create IPython profile
shell: "ipython profile create dst --ipython-dir=/home/{{ dst_username }}/.ipython"
- name: Remove password file
shell: rm passwd_hash.yml
- name: Create self-signed SSL certificate
shell: openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout {{ ipython_pem_file }} -out {{ ipython_pem_file }} -batch
- name: Update IPython configuration
template: src=ipython_notebook_config.py.j2 dest=/home/{{ dst_username }}/.ipython/profile_dst/ipython_notebook_config.py owner={{ dst_username }} group={{ dst_username }} mode=0644 backup=true
- name: Change owner
file: path=/home/{{ dst_username }} state=directory owner={{ dst_username }} group={{ dst_username }} recurse=yes
| Change owner of home directory | Change owner of home directory
| YAML | bsd-2-clause | jljones/data-science-toolbox,DataScienceToolbox/data-science-toolbox,Rafeh01/data-science-toolbox,Rafeh01/data-science-toolbox,tkamag/data-science-toolbox,Rafeh01/data-science-toolbox,DanteChavez/DataScienceToolbox,DanteChavez/DataScienceToolbox,DataScienceToolbox/data-science-toolbox,tkamag/data-science-toolbox,jljones/data-science-toolbox,DanteChavez/DataScienceToolbox,tkamag/data-science-toolbox,jljones/data-science-toolbox,DataScienceToolbox/data-science-toolbox | yaml | ## Code Before:
---
- hosts: 127.0.0.1
sudo: yes
connection: local
vars:
- ipython_pem_file: "/home/{{ dst_username }}/.ssh/ipython_dst.pem"
vars_prompt:
- name: "ipython_password"
prompt: "IPython notebook password"
private: yes
confirm: yes
tasks:
- name: Encrypt password
shell: ./passwd.py {{ ipython_password }}
- name: Load password
include_vars: passwd_hash.yml
- name: Make sure that the notebooks directory exists
file: path=/home/{{ dst_username }}/notebooks state=directory owner={{ dst_username }} group={{ dst_username }}
- name: Create IPython profile
shell: "ipython profile create dst --ipython-dir=/home/{{ dst_username }}/.ipython"
- name: Remove password file
shell: rm passwd_hash.yml
- name: Create self-signed SSL certificate
shell: openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout {{ ipython_pem_file }} -out {{ ipython_pem_file }} -batch
- name: Update IPython configuration
template: src=ipython_notebook_config.py.j2 dest=/home/{{ dst_username }}/.ipython/profile_dst/ipython_notebook_config.py owner={{ dst_username }} group={{ dst_username }} mode=0644 backup=true
- name: IPython -- Change IPython owner.
file: path=/home/{{ dst_username }} /.ipython owner={{ dst_username }} recurse=yes state=directory
## Instruction:
Change owner of home directory
## Code After:
---
- hosts: 127.0.0.1
sudo: yes
connection: local
vars:
- ipython_pem_file: "/home/{{ dst_username }}/.ssh/ipython_dst.pem"
vars_prompt:
- name: "ipython_password"
prompt: "IPython notebook password"
private: yes
confirm: yes
tasks:
- name: Encrypt password
shell: ./passwd.py {{ ipython_password }}
- name: Load password
include_vars: passwd_hash.yml
- name: Make sure that the notebooks directory exists
file: path=/home/{{ dst_username }}/notebooks state=directory owner={{ dst_username }} group={{ dst_username }}
- name: Create IPython profile
shell: "ipython profile create dst --ipython-dir=/home/{{ dst_username }}/.ipython"
- name: Remove password file
shell: rm passwd_hash.yml
- name: Create self-signed SSL certificate
shell: openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout {{ ipython_pem_file }} -out {{ ipython_pem_file }} -batch
- name: Update IPython configuration
template: src=ipython_notebook_config.py.j2 dest=/home/{{ dst_username }}/.ipython/profile_dst/ipython_notebook_config.py owner={{ dst_username }} group={{ dst_username }} mode=0644 backup=true
- name: Change owner
file: path=/home/{{ dst_username }} state=directory owner={{ dst_username }} group={{ dst_username }} recurse=yes
| ---
- hosts: 127.0.0.1
sudo: yes
connection: local
vars:
- ipython_pem_file: "/home/{{ dst_username }}/.ssh/ipython_dst.pem"
vars_prompt:
- name: "ipython_password"
prompt: "IPython notebook password"
private: yes
confirm: yes
tasks:
- name: Encrypt password
shell: ./passwd.py {{ ipython_password }}
- name: Load password
include_vars: passwd_hash.yml
- name: Make sure that the notebooks directory exists
file: path=/home/{{ dst_username }}/notebooks state=directory owner={{ dst_username }} group={{ dst_username }}
- name: Create IPython profile
shell: "ipython profile create dst --ipython-dir=/home/{{ dst_username }}/.ipython"
- name: Remove password file
shell: rm passwd_hash.yml
- name: Create self-signed SSL certificate
shell: openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout {{ ipython_pem_file }} -out {{ ipython_pem_file }} -batch
- name: Update IPython configuration
template: src=ipython_notebook_config.py.j2 dest=/home/{{ dst_username }}/.ipython/profile_dst/ipython_notebook_config.py owner={{ dst_username }} group={{ dst_username }} mode=0644 backup=true
- - name: IPython -- Change IPython owner.
- file: path=/home/{{ dst_username }} /.ipython owner={{ dst_username }} recurse=yes state=directory
+ - name: Change owner
+ file: path=/home/{{ dst_username }} state=directory owner={{ dst_username }} group={{ dst_username }} recurse=yes | 4 | 0.142857 | 2 | 2 |
42bc5dffd43d9e90b55d0072bc367071090778b5 | README.md | README.md |
An experimental project in wildcard domain name hackery and exceptionally-British name-calling. More to follow.
|
An experimental project in wildcard domain name hackery and exceptionally-British name-calling.
More to follow.
## License
© Copyright Dan Q 2017. Released under the MIT license (you may do anything they want with this code as long as you provide attribution back to me and don't hold me liable).
| Add license details to readme | Add license details to readme | Markdown | mit | Dan-Q/plonker,Dan-Q/plonker,Dan-Q/plonker | markdown | ## Code Before:
An experimental project in wildcard domain name hackery and exceptionally-British name-calling. More to follow.
## Instruction:
Add license details to readme
## Code After:
An experimental project in wildcard domain name hackery and exceptionally-British name-calling.
More to follow.
## License
© Copyright Dan Q 2017. Released under the MIT license (you may do anything they want with this code as long as you provide attribution back to me and don't hold me liable).
|
- An experimental project in wildcard domain name hackery and exceptionally-British name-calling. More to follow.
? ----------------
+ An experimental project in wildcard domain name hackery and exceptionally-British name-calling.
+
+ More to follow.
+
+ ## License
+
+ © Copyright Dan Q 2017. Released under the MIT license (you may do anything they want with this code as long as you provide attribution back to me and don't hold me liable). | 8 | 4 | 7 | 1 |
fcfdabd0c60c3a353f037d1ba11bd81fe471411a | frontend/src/styles/style.css | frontend/src/styles/style.css | :root {
/* SLURP palette constants */
--SLURP-BLUE: #264653;
--SLURP-CYAN: #2A9D8F;
--SLURP-YELLOW: #E9C46A;
--SLURP-ORANGE: #F4A261;
--SLURP-RED: #E76F51;
--SLURP-OFFWHITE: #FFFDFA;
--SLURP-GRAY: #545352;
}
#logo64 {
height: 64px;
width: 64px;
}
#logo256 {
height: 256px;
width: 256px;
}
| :root {
/* SLURP palette constants */
--SLURP-BLUE: #264653;
--SLURP-CYAN: #2A9D8F;
--SLURP-YELLOW: #E9C46A;
--SLURP-ORANGE: #F4A261;
--SLURP-RED: #E76F51;
--SLURP-OFFWHITE: #FFFDFA;
--SLURP-GRAY: #545352;
}
html, body, #root, #root>div, #root>div>* {
height: 100%
}
#logo64 {
height: 64px;
width: 64px;
}
#logo256 {
height: 256px;
width: 256px;
}
| Make App span at least the entire window | Make App span at least the entire window
| CSS | apache-2.0 | googleinterns/SLURP,googleinterns/SLURP,googleinterns/SLURP | css | ## Code Before:
:root {
/* SLURP palette constants */
--SLURP-BLUE: #264653;
--SLURP-CYAN: #2A9D8F;
--SLURP-YELLOW: #E9C46A;
--SLURP-ORANGE: #F4A261;
--SLURP-RED: #E76F51;
--SLURP-OFFWHITE: #FFFDFA;
--SLURP-GRAY: #545352;
}
#logo64 {
height: 64px;
width: 64px;
}
#logo256 {
height: 256px;
width: 256px;
}
## Instruction:
Make App span at least the entire window
## Code After:
:root {
/* SLURP palette constants */
--SLURP-BLUE: #264653;
--SLURP-CYAN: #2A9D8F;
--SLURP-YELLOW: #E9C46A;
--SLURP-ORANGE: #F4A261;
--SLURP-RED: #E76F51;
--SLURP-OFFWHITE: #FFFDFA;
--SLURP-GRAY: #545352;
}
html, body, #root, #root>div, #root>div>* {
height: 100%
}
#logo64 {
height: 64px;
width: 64px;
}
#logo256 {
height: 256px;
width: 256px;
}
| :root {
/* SLURP palette constants */
--SLURP-BLUE: #264653;
--SLURP-CYAN: #2A9D8F;
--SLURP-YELLOW: #E9C46A;
--SLURP-ORANGE: #F4A261;
--SLURP-RED: #E76F51;
--SLURP-OFFWHITE: #FFFDFA;
--SLURP-GRAY: #545352;
}
+ html, body, #root, #root>div, #root>div>* {
+ height: 100%
+ }
+
#logo64 {
height: 64px;
width: 64px;
}
#logo256 {
height: 256px;
width: 256px;
} | 4 | 0.2 | 4 | 0 |
59fdc2b701205888c4bca148ee5b5c231acd5aab | NOTICE.txt | NOTICE.txt | Lumberjack
Copyright (c) 2012 Bogdan Pistol
This product uses and extends the logging library SLF4J (http://www.slf4j.org/),
which is open source software licensed under the MIT license.
License: LICENSE.slf4j.txt
This product has test dependency on the JUnit testing framework (http://junit.sourceforge.net/),
which is open source software licensed under the CPL license.
License: LICENSE.junit.txt
This product has test dependency on the Mockito library (http://code.google.com/p/mockito/),
which is open source software licensed under the MIT license.
License: LICENSE.mockito.txt
| Lumberjack
Copyright (c) 2012 Bogdan Pistol
This product uses and extends the logging library SLF4J (http://www.slf4j.org/),
which is open source software licensed under the MIT license.
License: LICENSE.slf4j.txt
This product has test dependency on the JUnit testing framework (http://junit.sourceforge.net/),
which is open source software licensed under the CPL version 1.0 license.
License: LICENSE.junit.txt
This product has test dependency on the Mockito library (http://code.google.com/p/mockito/),
which is open source software licensed under the MIT license.
License: LICENSE.mockito.txt
| Add CPL license version information for JUnit | Add CPL license version information for JUnit
| Text | mit | bogdanu/lumberjack | text | ## Code Before:
Lumberjack
Copyright (c) 2012 Bogdan Pistol
This product uses and extends the logging library SLF4J (http://www.slf4j.org/),
which is open source software licensed under the MIT license.
License: LICENSE.slf4j.txt
This product has test dependency on the JUnit testing framework (http://junit.sourceforge.net/),
which is open source software licensed under the CPL license.
License: LICENSE.junit.txt
This product has test dependency on the Mockito library (http://code.google.com/p/mockito/),
which is open source software licensed under the MIT license.
License: LICENSE.mockito.txt
## Instruction:
Add CPL license version information for JUnit
## Code After:
Lumberjack
Copyright (c) 2012 Bogdan Pistol
This product uses and extends the logging library SLF4J (http://www.slf4j.org/),
which is open source software licensed under the MIT license.
License: LICENSE.slf4j.txt
This product has test dependency on the JUnit testing framework (http://junit.sourceforge.net/),
which is open source software licensed under the CPL version 1.0 license.
License: LICENSE.junit.txt
This product has test dependency on the Mockito library (http://code.google.com/p/mockito/),
which is open source software licensed under the MIT license.
License: LICENSE.mockito.txt
| Lumberjack
Copyright (c) 2012 Bogdan Pistol
This product uses and extends the logging library SLF4J (http://www.slf4j.org/),
which is open source software licensed under the MIT license.
License: LICENSE.slf4j.txt
This product has test dependency on the JUnit testing framework (http://junit.sourceforge.net/),
- which is open source software licensed under the CPL license.
+ which is open source software licensed under the CPL version 1.0 license.
? ++++++++++++
License: LICENSE.junit.txt
This product has test dependency on the Mockito library (http://code.google.com/p/mockito/),
which is open source software licensed under the MIT license.
License: LICENSE.mockito.txt
| 2 | 0.133333 | 1 | 1 |
412db0a39be9e6be402088af36a087b84d881179 | strings/create.md | strings/create.md |
You can define strings in JavaScript by enclosing the text in single quotes or double quotes:
```js
// Single quotes can be used
var str = 'Our lovely string';
// Double quotes as well
var otherStr = "Another nice string";
```
**Note:** Strings can not be substracted, multiplied or divided.
---
Create a variable named `str` set to the value `"abc"`.
```js
```
```js
var str = 'abc';
```
```js
assert(str === 'abc');
```
---
|
You can define strings in JavaScript by enclosing the text in single quotes or double quotes:
```js
// Single quotes can be used
var str = 'Our lovely string';
// Double quotes as well
var otherStr = "Another nice string";
```
In Javascript, Strings can contain UTF-8 characters:
```js
"中文 español English हिन्दी العربية português বাংলা русский 日本語 ਪੰਜਾਬੀ 한국어";
```
**Note:** Strings can not be substracted, multiplied or divided.
---
Create a variable named `str` set to the value `"abc"`.
```js
```
```js
var str = 'abc';
```
```js
assert(str === 'abc');
```
---
| Add infos about utf-8 srings | Add infos about utf-8 srings
| Markdown | apache-2.0 | hubbsy/javascript | markdown | ## Code Before:
You can define strings in JavaScript by enclosing the text in single quotes or double quotes:
```js
// Single quotes can be used
var str = 'Our lovely string';
// Double quotes as well
var otherStr = "Another nice string";
```
**Note:** Strings can not be substracted, multiplied or divided.
---
Create a variable named `str` set to the value `"abc"`.
```js
```
```js
var str = 'abc';
```
```js
assert(str === 'abc');
```
---
## Instruction:
Add infos about utf-8 srings
## Code After:
You can define strings in JavaScript by enclosing the text in single quotes or double quotes:
```js
// Single quotes can be used
var str = 'Our lovely string';
// Double quotes as well
var otherStr = "Another nice string";
```
In Javascript, Strings can contain UTF-8 characters:
```js
"中文 español English हिन्दी العربية português বাংলা русский 日本語 ਪੰਜਾਬੀ 한국어";
```
**Note:** Strings can not be substracted, multiplied or divided.
---
Create a variable named `str` set to the value `"abc"`.
```js
```
```js
var str = 'abc';
```
```js
assert(str === 'abc');
```
---
|
You can define strings in JavaScript by enclosing the text in single quotes or double quotes:
```js
// Single quotes can be used
var str = 'Our lovely string';
// Double quotes as well
var otherStr = "Another nice string";
```
+
+ In Javascript, Strings can contain UTF-8 characters:
+
+ ```js
+ "中文 español English हिन्दी العربية português বাংলা русский 日本語 ਪੰਜਾਬੀ 한국어";
+ ```
+
**Note:** Strings can not be substracted, multiplied or divided.
---
Create a variable named `str` set to the value `"abc"`.
```js
```
```js
var str = 'abc';
```
```js
assert(str === 'abc');
```
--- | 7 | 0.233333 | 7 | 0 |
eedae77f6f1f9137f3701d72ea79ab2acb6e4ff0 | metadata/com.jtmcn.archwiki.viewer.yml | metadata/com.jtmcn.archwiki.viewer.yml | Categories:
- Reading
- Internet
License: Apache-2.0
SourceCode: https://github.com/jtmcn/archwiki-viewer
IssueTracker: https://github.com/jtmcn/archwiki-viewer/issues
Changelog: https://github.com/jtmcn/archwiki-viewer/releases
AutoName: ArchWiki Viewer
Description: Quickly view Arch Linux Wiki articles on your phone with an easy to read
format.
RepoType: git
Repo: https://github.com/jtmcn/archwiki-viewer
Builds:
- versionName: 1.0.7
versionCode: 8
commit: v1.0.7
subdir: app
gradle:
- yes
- versionName: 1.0.11
versionCode: 12
commit: v1.0.11
subdir: app
gradle:
- yes
AutoUpdateMode: Version v%v
UpdateCheckMode: Tags
CurrentVersion: 1.0.11
CurrentVersionCode: 12
| Categories:
- Reading
- Internet
License: Apache-2.0
SourceCode: https://github.com/jtmcn/archwiki-viewer
IssueTracker: https://github.com/jtmcn/archwiki-viewer/issues
Changelog: https://github.com/jtmcn/archwiki-viewer/releases
AutoName: ArchWiki Viewer
Description: Quickly view Arch Linux Wiki articles on your phone with an easy to read
format.
RepoType: git
Repo: https://github.com/jtmcn/archwiki-viewer
Builds:
- versionName: 1.0.7
versionCode: 8
commit: v1.0.7
subdir: app
gradle:
- yes
- versionName: 1.0.11
versionCode: 12
commit: v1.0.11
subdir: app
gradle:
- yes
- versionName: 1.0.13
versionCode: 14
commit: v1.0.13
subdir: app
gradle:
- yes
AutoUpdateMode: Version v%v
UpdateCheckMode: Tags
CurrentVersion: 1.0.13
CurrentVersionCode: 14
| Update ArchWiki Viewer to 1.0.13 (14) | Update ArchWiki Viewer to 1.0.13 (14)
| YAML | agpl-3.0 | f-droid/fdroiddata,f-droid/fdroiddata | yaml | ## Code Before:
Categories:
- Reading
- Internet
License: Apache-2.0
SourceCode: https://github.com/jtmcn/archwiki-viewer
IssueTracker: https://github.com/jtmcn/archwiki-viewer/issues
Changelog: https://github.com/jtmcn/archwiki-viewer/releases
AutoName: ArchWiki Viewer
Description: Quickly view Arch Linux Wiki articles on your phone with an easy to read
format.
RepoType: git
Repo: https://github.com/jtmcn/archwiki-viewer
Builds:
- versionName: 1.0.7
versionCode: 8
commit: v1.0.7
subdir: app
gradle:
- yes
- versionName: 1.0.11
versionCode: 12
commit: v1.0.11
subdir: app
gradle:
- yes
AutoUpdateMode: Version v%v
UpdateCheckMode: Tags
CurrentVersion: 1.0.11
CurrentVersionCode: 12
## Instruction:
Update ArchWiki Viewer to 1.0.13 (14)
## Code After:
Categories:
- Reading
- Internet
License: Apache-2.0
SourceCode: https://github.com/jtmcn/archwiki-viewer
IssueTracker: https://github.com/jtmcn/archwiki-viewer/issues
Changelog: https://github.com/jtmcn/archwiki-viewer/releases
AutoName: ArchWiki Viewer
Description: Quickly view Arch Linux Wiki articles on your phone with an easy to read
format.
RepoType: git
Repo: https://github.com/jtmcn/archwiki-viewer
Builds:
- versionName: 1.0.7
versionCode: 8
commit: v1.0.7
subdir: app
gradle:
- yes
- versionName: 1.0.11
versionCode: 12
commit: v1.0.11
subdir: app
gradle:
- yes
- versionName: 1.0.13
versionCode: 14
commit: v1.0.13
subdir: app
gradle:
- yes
AutoUpdateMode: Version v%v
UpdateCheckMode: Tags
CurrentVersion: 1.0.13
CurrentVersionCode: 14
| Categories:
- Reading
- Internet
License: Apache-2.0
SourceCode: https://github.com/jtmcn/archwiki-viewer
IssueTracker: https://github.com/jtmcn/archwiki-viewer/issues
Changelog: https://github.com/jtmcn/archwiki-viewer/releases
AutoName: ArchWiki Viewer
Description: Quickly view Arch Linux Wiki articles on your phone with an easy to read
format.
RepoType: git
Repo: https://github.com/jtmcn/archwiki-viewer
Builds:
- versionName: 1.0.7
versionCode: 8
commit: v1.0.7
subdir: app
gradle:
- yes
- versionName: 1.0.11
versionCode: 12
commit: v1.0.11
subdir: app
gradle:
- yes
+ - versionName: 1.0.13
+ versionCode: 14
+ commit: v1.0.13
+ subdir: app
+ gradle:
+ - yes
+
AutoUpdateMode: Version v%v
UpdateCheckMode: Tags
- CurrentVersion: 1.0.11
? ^
+ CurrentVersion: 1.0.13
? ^
- CurrentVersionCode: 12
? ^
+ CurrentVersionCode: 14
? ^
| 11 | 0.323529 | 9 | 2 |
e11166ed27b49250ee914c1227b3022ef7659e15 | curator/script.py | curator/script.py | import hashlib
from redis.exceptions import NoScriptError
class LuaScript(object):
def __init__(self, redis, template, cache):
self.redis = redis
self.template = template
self.cache = cache
self.script = self._render_template(template)
def _render_template(self, template):
if template.filename in self.cache:
script = self.cache[template.filename]
else:
script = template.render()
self.cache[template.filename] = script
return script
def _get_script_sha(self):
return hashlib.sha1(self.script).hexdigest()
def __call__(self, *args, **kwargs):
script_sha = self._get_script_sha()
keys = kwargs.get('keys', [])
arguments = kwargs.get('args', [])
num_keys = len(keys)
keys_and_args = keys + arguments
try:
response = self.redis.evalsha(script_sha, num_keys, *keys_and_args)
except NoScriptError:
response = self.redis.eval(self.script, num_keys, *keys_and_args)
return response
| import hashlib
from redis.exceptions import ResponseError
class LuaScript(object):
def __init__(self, redis, template, cache):
self.redis = redis
self.template = template
self.cache = cache
self.script = self._render_template(template)
def _render_template(self, template):
if template.filename in self.cache:
script = self.cache[template.filename]
else:
script = template.render()
self.cache[template.filename] = script
return script
def _get_script_sha(self):
return hashlib.sha1(self.script).hexdigest()
def __call__(self, *args, **kwargs):
script_sha = self._get_script_sha()
keys = kwargs.get('keys', [])
arguments = kwargs.get('args', [])
num_keys = len(keys)
keys_and_args = keys + arguments
try:
response = self.redis.evalsha(script_sha, num_keys, *keys_and_args)
except ResponseError:
response = self.redis.eval(self.script, num_keys, *keys_and_args)
return response
| Use ResponseError instead of NoScriptError to be compatible with earlier versions of the redis client | Use ResponseError instead of NoScriptError to be compatible with earlier versions of the redis client
| Python | mit | eventbrite/curator | python | ## Code Before:
import hashlib
from redis.exceptions import NoScriptError
class LuaScript(object):
def __init__(self, redis, template, cache):
self.redis = redis
self.template = template
self.cache = cache
self.script = self._render_template(template)
def _render_template(self, template):
if template.filename in self.cache:
script = self.cache[template.filename]
else:
script = template.render()
self.cache[template.filename] = script
return script
def _get_script_sha(self):
return hashlib.sha1(self.script).hexdigest()
def __call__(self, *args, **kwargs):
script_sha = self._get_script_sha()
keys = kwargs.get('keys', [])
arguments = kwargs.get('args', [])
num_keys = len(keys)
keys_and_args = keys + arguments
try:
response = self.redis.evalsha(script_sha, num_keys, *keys_and_args)
except NoScriptError:
response = self.redis.eval(self.script, num_keys, *keys_and_args)
return response
## Instruction:
Use ResponseError instead of NoScriptError to be compatible with earlier versions of the redis client
## Code After:
import hashlib
from redis.exceptions import ResponseError
class LuaScript(object):
def __init__(self, redis, template, cache):
self.redis = redis
self.template = template
self.cache = cache
self.script = self._render_template(template)
def _render_template(self, template):
if template.filename in self.cache:
script = self.cache[template.filename]
else:
script = template.render()
self.cache[template.filename] = script
return script
def _get_script_sha(self):
return hashlib.sha1(self.script).hexdigest()
def __call__(self, *args, **kwargs):
script_sha = self._get_script_sha()
keys = kwargs.get('keys', [])
arguments = kwargs.get('args', [])
num_keys = len(keys)
keys_and_args = keys + arguments
try:
response = self.redis.evalsha(script_sha, num_keys, *keys_and_args)
except ResponseError:
response = self.redis.eval(self.script, num_keys, *keys_and_args)
return response
| import hashlib
- from redis.exceptions import NoScriptError
? ^ ^^^^^^
+ from redis.exceptions import ResponseError
? ^^^^ ^^^
class LuaScript(object):
def __init__(self, redis, template, cache):
self.redis = redis
self.template = template
self.cache = cache
self.script = self._render_template(template)
def _render_template(self, template):
if template.filename in self.cache:
script = self.cache[template.filename]
else:
script = template.render()
self.cache[template.filename] = script
return script
def _get_script_sha(self):
return hashlib.sha1(self.script).hexdigest()
def __call__(self, *args, **kwargs):
script_sha = self._get_script_sha()
keys = kwargs.get('keys', [])
arguments = kwargs.get('args', [])
num_keys = len(keys)
keys_and_args = keys + arguments
try:
response = self.redis.evalsha(script_sha, num_keys, *keys_and_args)
- except NoScriptError:
? ^ ^^^^^^
+ except ResponseError:
? ^^^^ ^^^
response = self.redis.eval(self.script, num_keys, *keys_and_args)
return response | 4 | 0.114286 | 2 | 2 |
2f5df69a39e52380cb52590f54a0a2e89af65aa9 | src/mainpage_generator.rs | src/mainpage_generator.rs | use horrorshow::prelude::*;
use scripts::Script;
pub struct MainPageHtml {
pub html_string: String,
}
impl MainPageHtml {
pub fn new(scripts: Vec<Box<Script>>) -> MainPageHtml {
MainPageHtml {
html_string: html! {
: raw!("<!DOCTYPE html>");
html {
head {
title { : "Runnable scripts"}
}
body {
h1(id="main_header") {
: "Runnable Scripts"
}
h2(id="scripts_header") {
: "Scripts"
}
ul(id="normal_scripts_list") {
@ for script in scripts {
li {
: raw!(format!("<a href=\"/scr/{}\">{}</a>", script.get_name(), script.get_name()))
}
}
}
}
}
}.into_string().unwrap()
}
}
}
| use horrorshow::prelude::*;
use scripts::Script;
pub struct MainPageHtml {
pub html_string: String,
}
impl MainPageHtml {
pub fn new(scripts: Vec<Box<Script>>) -> MainPageHtml {
MainPageHtml {
html_string: html! {
: raw!("<!DOCTYPE html>");
html {
head {
meta(name="viewport", content="width=device-width, initial-scale=1.0"){}
title { : "Runnable scripts"}
}
body(style="display: table") {
h1(id="main_header", style="display: table") {
: "Runnable Scripts"
}
h2(id="scripts_header", style="display: table") {
: "Scripts"
}
ul(id="normal_scripts_list", style="display: table") {
@ for script in scripts {
li {
: raw!(format!("<a href=\"/scr/{}\">{}</a>", script.get_name(), script.get_name()))
}
}
}
}
}
}.into_string().unwrap()
}
}
}
| Make generated mainpage a little more mobile-friendly | Make generated mainpage a little more mobile-friendly
| Rust | mit | pingzing/articulator | rust | ## Code Before:
use horrorshow::prelude::*;
use scripts::Script;
pub struct MainPageHtml {
pub html_string: String,
}
impl MainPageHtml {
pub fn new(scripts: Vec<Box<Script>>) -> MainPageHtml {
MainPageHtml {
html_string: html! {
: raw!("<!DOCTYPE html>");
html {
head {
title { : "Runnable scripts"}
}
body {
h1(id="main_header") {
: "Runnable Scripts"
}
h2(id="scripts_header") {
: "Scripts"
}
ul(id="normal_scripts_list") {
@ for script in scripts {
li {
: raw!(format!("<a href=\"/scr/{}\">{}</a>", script.get_name(), script.get_name()))
}
}
}
}
}
}.into_string().unwrap()
}
}
}
## Instruction:
Make generated mainpage a little more mobile-friendly
## Code After:
use horrorshow::prelude::*;
use scripts::Script;
pub struct MainPageHtml {
pub html_string: String,
}
impl MainPageHtml {
pub fn new(scripts: Vec<Box<Script>>) -> MainPageHtml {
MainPageHtml {
html_string: html! {
: raw!("<!DOCTYPE html>");
html {
head {
meta(name="viewport", content="width=device-width, initial-scale=1.0"){}
title { : "Runnable scripts"}
}
body(style="display: table") {
h1(id="main_header", style="display: table") {
: "Runnable Scripts"
}
h2(id="scripts_header", style="display: table") {
: "Scripts"
}
ul(id="normal_scripts_list", style="display: table") {
@ for script in scripts {
li {
: raw!(format!("<a href=\"/scr/{}\">{}</a>", script.get_name(), script.get_name()))
}
}
}
}
}
}.into_string().unwrap()
}
}
}
| use horrorshow::prelude::*;
use scripts::Script;
pub struct MainPageHtml {
pub html_string: String,
}
impl MainPageHtml {
pub fn new(scripts: Vec<Box<Script>>) -> MainPageHtml {
MainPageHtml {
html_string: html! {
: raw!("<!DOCTYPE html>");
html {
head {
+ meta(name="viewport", content="width=device-width, initial-scale=1.0"){}
title { : "Runnable scripts"}
}
- body {
+ body(style="display: table") {
- h1(id="main_header") {
+ h1(id="main_header", style="display: table") {
? ++++++++++++++++++++++++
: "Runnable Scripts"
}
- h2(id="scripts_header") {
+ h2(id="scripts_header", style="display: table") {
? ++++++++++++++++++++++++
: "Scripts"
}
- ul(id="normal_scripts_list") {
+ ul(id="normal_scripts_list", style="display: table") {
? ++++++++++++++++++++++++
@ for script in scripts {
li {
: raw!(format!("<a href=\"/scr/{}\">{}</a>", script.get_name(), script.get_name()))
}
}
}
}
}
}.into_string().unwrap()
}
}
} | 9 | 0.25 | 5 | 4 |
a07b9b3d19db910a6a94dd143ed2a0d45a6b4801 | app/models/user_location.rb | app/models/user_location.rb |
class UserLocation < ActiveRecord::Base
include Locatable
belongs_to :user
belongs_to :category, class_name: 'LocationCategory'
validates :location, presence: true
validates :user, presence: true
def buffered
if (buffered_loc = location.buffer(Geo::USER_LOCATIONS_BUFFER).union(location))
buffered_loc
else
location.buffer(Geo::USER_LOCATIONS_BUFFER)
end
end
end
|
class UserLocation < ActiveRecord::Base
include Locatable
belongs_to :user
belongs_to :category, class_name: 'LocationCategory'
validates :location, presence: true
validates :user, presence: true, uniqueness: true
def buffered
if (buffered_loc = location.buffer(Geo::USER_LOCATIONS_BUFFER).union(location))
buffered_loc
else
location.buffer(Geo::USER_LOCATIONS_BUFFER)
end
end
end
| Validate one one user location | Validate one one user location
Rollbar errors on double POSTs
| Ruby | mit | cyclestreets/cyclescape,cyclestreets/cyclescape,cyclestreets/cyclescape | ruby | ## Code Before:
class UserLocation < ActiveRecord::Base
include Locatable
belongs_to :user
belongs_to :category, class_name: 'LocationCategory'
validates :location, presence: true
validates :user, presence: true
def buffered
if (buffered_loc = location.buffer(Geo::USER_LOCATIONS_BUFFER).union(location))
buffered_loc
else
location.buffer(Geo::USER_LOCATIONS_BUFFER)
end
end
end
## Instruction:
Validate one one user location
Rollbar errors on double POSTs
## Code After:
class UserLocation < ActiveRecord::Base
include Locatable
belongs_to :user
belongs_to :category, class_name: 'LocationCategory'
validates :location, presence: true
validates :user, presence: true, uniqueness: true
def buffered
if (buffered_loc = location.buffer(Geo::USER_LOCATIONS_BUFFER).union(location))
buffered_loc
else
location.buffer(Geo::USER_LOCATIONS_BUFFER)
end
end
end
|
class UserLocation < ActiveRecord::Base
include Locatable
belongs_to :user
belongs_to :category, class_name: 'LocationCategory'
validates :location, presence: true
- validates :user, presence: true
+ validates :user, presence: true, uniqueness: true
? ++++++++++++++++++
def buffered
if (buffered_loc = location.buffer(Geo::USER_LOCATIONS_BUFFER).union(location))
buffered_loc
else
location.buffer(Geo::USER_LOCATIONS_BUFFER)
end
end
end | 2 | 0.111111 | 1 | 1 |
76698748d645a1dd73589313405e2aefcdba5d90 | include/nmlib.h | include/nmlib.h | // All-in-one header of nmlib
#ifndef NMLIB_H
#define NMLIB_H
#include "chrono.h"
#include "diff.h"
#include "fft.h"
#include "integral.h"
#include "io.h"
#include "kalman.h"
#include "lp.h"
#include "matrix.h"
#include "matrix_decomp.h"
#include "optimization.h"
#include "polynomial.h"
#include "random.h"
#include "robot.h"
#include "route.h"
#include "solver.h"
#include "sparse.h"
#include "spline.h"
#include "stat.h"
#ifdef NMLIB_DISABLE_NAMESPACE
using namespace nmlib;
#endif
#endif //NMLIB_H
| // All-in-one header of nmlib
#ifndef NMLIB_H
#define NMLIB_H
#include "chrono.h"
#include "diff.h"
#include "fft.h"
#include "integral.h"
#include "io.h"
#include "kalman.h"
#include "lp.h"
#include "matrix.h"
#include "matrix_decomp.h"
#include "ode.h"
#include "optimization.h"
#include "polynomial.h"
#include "random.h"
#include "robot.h"
#include "route.h"
#include "solver.h"
#include "sparse.h"
#include "spline.h"
#include "stat.h"
#ifdef NMLIB_DISABLE_NAMESPACE
using namespace nmlib;
#endif
#endif //NMLIB_H
| Update all-in-one header (add ode.h) | Update all-in-one header (add ode.h)
| C | mit | nmakimoto/nmlib,nmakimoto/nmlib | c | ## Code Before:
// All-in-one header of nmlib
#ifndef NMLIB_H
#define NMLIB_H
#include "chrono.h"
#include "diff.h"
#include "fft.h"
#include "integral.h"
#include "io.h"
#include "kalman.h"
#include "lp.h"
#include "matrix.h"
#include "matrix_decomp.h"
#include "optimization.h"
#include "polynomial.h"
#include "random.h"
#include "robot.h"
#include "route.h"
#include "solver.h"
#include "sparse.h"
#include "spline.h"
#include "stat.h"
#ifdef NMLIB_DISABLE_NAMESPACE
using namespace nmlib;
#endif
#endif //NMLIB_H
## Instruction:
Update all-in-one header (add ode.h)
## Code After:
// All-in-one header of nmlib
#ifndef NMLIB_H
#define NMLIB_H
#include "chrono.h"
#include "diff.h"
#include "fft.h"
#include "integral.h"
#include "io.h"
#include "kalman.h"
#include "lp.h"
#include "matrix.h"
#include "matrix_decomp.h"
#include "ode.h"
#include "optimization.h"
#include "polynomial.h"
#include "random.h"
#include "robot.h"
#include "route.h"
#include "solver.h"
#include "sparse.h"
#include "spline.h"
#include "stat.h"
#ifdef NMLIB_DISABLE_NAMESPACE
using namespace nmlib;
#endif
#endif //NMLIB_H
| // All-in-one header of nmlib
#ifndef NMLIB_H
#define NMLIB_H
#include "chrono.h"
#include "diff.h"
#include "fft.h"
#include "integral.h"
#include "io.h"
#include "kalman.h"
#include "lp.h"
#include "matrix.h"
#include "matrix_decomp.h"
+ #include "ode.h"
#include "optimization.h"
#include "polynomial.h"
#include "random.h"
#include "robot.h"
#include "route.h"
#include "solver.h"
#include "sparse.h"
#include "spline.h"
#include "stat.h"
#ifdef NMLIB_DISABLE_NAMESPACE
using namespace nmlib;
#endif
#endif //NMLIB_H | 1 | 0.03125 | 1 | 0 |
aec13a06476136c770a81b877040ef6e79b2f14c | spec/lib/danica/variable_spec.rb | spec/lib/danica/variable_spec.rb | require 'spec_helper'
describe Danica::Variable do
describe 'to_f' do
context 'when variable has no value' do
it { expect { subject.to_f }.to raise_error(Danica::NotDefined) }
end
context 'when variable has value' do
let(:value) { 100 }
let(:subject) { described_class.new(value: value) }
it { expect(subject.to_f).to eq(value) }
end
end
describe 'to_tex' do
let(:name) { :delta }
context 'when latex is not defined ' do
let(:subject) { described_class.new name: name }
it 'returns name' do
expect(subject.to_tex).to eq('delta')
end
end
context 'when latex has been defined' do
let(:subject) { described_class.new name: name, latex: '\delta' }
it 'returns latex' do
expect(subject.to_tex).to eq('\delta')
end
end
end
end
| require 'spec_helper'
describe Danica::Variable do
describe 'to_f' do
context 'when variable has no value' do
it { expect { subject.to_f }.to raise_error(Danica::NotDefined) }
end
context 'when variable has value' do
let(:value) { 100 }
let(:subject) { described_class.new(value: value) }
it 'returns the value' do
expect(subject.to_f).to eq(value)
end
end
end
describe 'to_tex' do
let(:name) { :delta }
context 'when latex is not defined ' do
let(:subject) { described_class.new name: name }
it 'returns name' do
expect(subject.to_tex).to eq('delta')
end
end
context 'when latex has been defined' do
let(:subject) { described_class.new name: name, latex: '\delta' }
it 'returns latex' do
expect(subject.to_tex).to eq('\delta')
end
end
end
end
| Correct spec description to variable spec | Correct spec description to variable spec
| Ruby | mit | darthjee/danica,darthjee/danica | ruby | ## Code Before:
require 'spec_helper'
describe Danica::Variable do
describe 'to_f' do
context 'when variable has no value' do
it { expect { subject.to_f }.to raise_error(Danica::NotDefined) }
end
context 'when variable has value' do
let(:value) { 100 }
let(:subject) { described_class.new(value: value) }
it { expect(subject.to_f).to eq(value) }
end
end
describe 'to_tex' do
let(:name) { :delta }
context 'when latex is not defined ' do
let(:subject) { described_class.new name: name }
it 'returns name' do
expect(subject.to_tex).to eq('delta')
end
end
context 'when latex has been defined' do
let(:subject) { described_class.new name: name, latex: '\delta' }
it 'returns latex' do
expect(subject.to_tex).to eq('\delta')
end
end
end
end
## Instruction:
Correct spec description to variable spec
## Code After:
require 'spec_helper'
describe Danica::Variable do
describe 'to_f' do
context 'when variable has no value' do
it { expect { subject.to_f }.to raise_error(Danica::NotDefined) }
end
context 'when variable has value' do
let(:value) { 100 }
let(:subject) { described_class.new(value: value) }
it 'returns the value' do
expect(subject.to_f).to eq(value)
end
end
end
describe 'to_tex' do
let(:name) { :delta }
context 'when latex is not defined ' do
let(:subject) { described_class.new name: name }
it 'returns name' do
expect(subject.to_tex).to eq('delta')
end
end
context 'when latex has been defined' do
let(:subject) { described_class.new name: name, latex: '\delta' }
it 'returns latex' do
expect(subject.to_tex).to eq('\delta')
end
end
end
end
| require 'spec_helper'
describe Danica::Variable do
describe 'to_f' do
context 'when variable has no value' do
it { expect { subject.to_f }.to raise_error(Danica::NotDefined) }
end
context 'when variable has value' do
let(:value) { 100 }
let(:subject) { described_class.new(value: value) }
+ it 'returns the value' do
- it { expect(subject.to_f).to eq(value) }
? -- - --
+ expect(subject.to_f).to eq(value)
+ end
end
end
describe 'to_tex' do
let(:name) { :delta }
context 'when latex is not defined ' do
let(:subject) { described_class.new name: name }
it 'returns name' do
expect(subject.to_tex).to eq('delta')
end
end
context 'when latex has been defined' do
let(:subject) { described_class.new name: name, latex: '\delta' }
it 'returns latex' do
expect(subject.to_tex).to eq('\delta')
end
end
end
end | 4 | 0.111111 | 3 | 1 |
4c8d7b976acebe87c9148e4f11a6daeb9074d449 | spec/spec_helper.rb | spec/spec_helper.rb | require 'fabrication'
require 'ffaker'
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}
RSpec.configure do |config|
Turnip::Config.step_dirs = ['turnip', File.expand_path('lib/rails/generators/fabrication/turnip_steps/templates/')]
config.before(:each) do
TestMigration.up
clear_mongodb
end
end
| require 'fabrication'
require 'ffaker'
require 'active_support'
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}
RSpec.configure do |config|
Turnip::Config.step_dirs = ['turnip', File.expand_path('lib/rails/generators/fabrication/turnip_steps/templates/')]
config.before(:each) do
TestMigration.up
clear_mongodb
end
end
| Add active support require to rspec | Add active support require to rspec
| Ruby | mit | damsonn/fabrication,gregburek/fabrication,supremebeing7/fabrication,gregburek/fabrication,supremebeing7/fabrication,damsonn/fabrication,paulelliott/fabrication,paulelliott/fabrication | ruby | ## Code Before:
require 'fabrication'
require 'ffaker'
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}
RSpec.configure do |config|
Turnip::Config.step_dirs = ['turnip', File.expand_path('lib/rails/generators/fabrication/turnip_steps/templates/')]
config.before(:each) do
TestMigration.up
clear_mongodb
end
end
## Instruction:
Add active support require to rspec
## Code After:
require 'fabrication'
require 'ffaker'
require 'active_support'
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}
RSpec.configure do |config|
Turnip::Config.step_dirs = ['turnip', File.expand_path('lib/rails/generators/fabrication/turnip_steps/templates/')]
config.before(:each) do
TestMigration.up
clear_mongodb
end
end
| require 'fabrication'
require 'ffaker'
+ require 'active_support'
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}
RSpec.configure do |config|
Turnip::Config.step_dirs = ['turnip', File.expand_path('lib/rails/generators/fabrication/turnip_steps/templates/')]
config.before(:each) do
TestMigration.up
clear_mongodb
end
end | 1 | 0.071429 | 1 | 0 |
bc41043872576cdb781e1126e4269e4e45ff28ff | README.md | README.md | [](https://travis-ci.org/bm5w/second_dataS.svg?branch=master)
BST (Binary Search Tree): An implementation of a BST utilizing a dictionary
of dictionaries to keep track of each node and it's left and right children.
While this is an unordinary method, where the ordinary method would use a
linked list type structure, this method allows for O(1) for 'contains' methods,
quick size methods. The downside of this approach is that recursive methods
for finding depth and inserting nodes are not as readable and helper methods
are required.
| [](https://travis-ci.org/bm5w/second_dataS.svg?branch=master)
BST (Binary Search Tree): An implementation of a BST utilizing a dictionary
of dictionaries to keep track of each node and it's left and right children.
While this is an unordinary method, where the ordinary method would use a
linked list type structure, this method allows for O(1) for 'contains' methods,
quick size methods. The downside of this approach is that recursive methods
for finding depth and inserting nodes are not as readable and helper methods
are required.
Insertion Sort: This method will sort a list of numbers (int and floats). Insertion sort works with time complexity O(n) in the best case scenario. In the worse case, where the list is in reverse order and every value must be compared against every other number, the time complexity is O(n^2). It works well for lists that are already partially sorted. It can also sort the list as it receives it. | Add insertion sort description to readme. | Add insertion sort description to readme.
| Markdown | mit | bm5w/second_dataS | markdown | ## Code Before:
[](https://travis-ci.org/bm5w/second_dataS.svg?branch=master)
BST (Binary Search Tree): An implementation of a BST utilizing a dictionary
of dictionaries to keep track of each node and it's left and right children.
While this is an unordinary method, where the ordinary method would use a
linked list type structure, this method allows for O(1) for 'contains' methods,
quick size methods. The downside of this approach is that recursive methods
for finding depth and inserting nodes are not as readable and helper methods
are required.
## Instruction:
Add insertion sort description to readme.
## Code After:
[](https://travis-ci.org/bm5w/second_dataS.svg?branch=master)
BST (Binary Search Tree): An implementation of a BST utilizing a dictionary
of dictionaries to keep track of each node and it's left and right children.
While this is an unordinary method, where the ordinary method would use a
linked list type structure, this method allows for O(1) for 'contains' methods,
quick size methods. The downside of this approach is that recursive methods
for finding depth and inserting nodes are not as readable and helper methods
are required.
Insertion Sort: This method will sort a list of numbers (int and floats). Insertion sort works with time complexity O(n) in the best case scenario. In the worse case, where the list is in reverse order and every value must be compared against every other number, the time complexity is O(n^2). It works well for lists that are already partially sorted. It can also sort the list as it receives it. | [](https://travis-ci.org/bm5w/second_dataS.svg?branch=master)
BST (Binary Search Tree): An implementation of a BST utilizing a dictionary
of dictionaries to keep track of each node and it's left and right children.
While this is an unordinary method, where the ordinary method would use a
linked list type structure, this method allows for O(1) for 'contains' methods,
quick size methods. The downside of this approach is that recursive methods
for finding depth and inserting nodes are not as readable and helper methods
are required.
+ Insertion Sort: This method will sort a list of numbers (int and floats). Insertion sort works with time complexity O(n) in the best case scenario. In the worse case, where the list is in reverse order and every value must be compared against every other number, the time complexity is O(n^2). It works well for lists that are already partially sorted. It can also sort the list as it receives it. | 1 | 0.111111 | 1 | 0 |
c6192eba09525d7ccd5f9ba7fef116e4050d013e | .github/workflows/gradle.yml | .github/workflows/gradle.yml |
name: Java CI with Gradle
on:
push:
branches: [ DEV-1235 ]
pull_request:
branches: [ DEV-1235 ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Remove existing build cache
run: rm -f $HOME/.gradle/caches/modules-2/modules-2.lock ; rm -fr $HOME/.gradle/caches/*/plugin-resoluti
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Install with Gradle
run: ./gradlew --stacktrace printInfo
- name: Build with Gradle
run: ./gradlew --continue --stacktrace --profile build
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Run some code test
run: ./gradlew --stacktrace -Djdk.tls.client.protocols="TLSv1,TLSv1.1,TLSv1.2" sonarqube jacocoTestReport coveralls
|
name: Java CI with Gradle
on:
push:
branches: [ DEV-1235 ]
pull_request:
branches: [ DEV-1235 ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Remove existing build cache
run: rm -f $HOME/.gradle/caches/modules-2/modules-2.lock ; rm -fr $HOME/.gradle/caches/*/plugin-resoluti
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Install with Gradle
run: ./gradlew --stacktrace printInfo
- name: Build with Gradle
run: ./gradlew --continue --stacktrace --profile build
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ab81ec76bcb0de28a933bf908ccca2562b33df83
- name: Run some code test
run: ./gradlew --stacktrace -Djdk.tls.client.protocols="TLSv1,TLSv1.1,TLSv1.2" jacocoTestReport coveralls
| Fix github actions due to sonarqube token auth. | Fix github actions due to sonarqube token auth.
| YAML | apache-2.0 | nus-ncl/service-web,nus-ncl/service-web,nus-ncl/service-web,nus-ncl/service-web | yaml | ## Code Before:
name: Java CI with Gradle
on:
push:
branches: [ DEV-1235 ]
pull_request:
branches: [ DEV-1235 ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Remove existing build cache
run: rm -f $HOME/.gradle/caches/modules-2/modules-2.lock ; rm -fr $HOME/.gradle/caches/*/plugin-resoluti
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Install with Gradle
run: ./gradlew --stacktrace printInfo
- name: Build with Gradle
run: ./gradlew --continue --stacktrace --profile build
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Run some code test
run: ./gradlew --stacktrace -Djdk.tls.client.protocols="TLSv1,TLSv1.1,TLSv1.2" sonarqube jacocoTestReport coveralls
## Instruction:
Fix github actions due to sonarqube token auth.
## Code After:
name: Java CI with Gradle
on:
push:
branches: [ DEV-1235 ]
pull_request:
branches: [ DEV-1235 ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Remove existing build cache
run: rm -f $HOME/.gradle/caches/modules-2/modules-2.lock ; rm -fr $HOME/.gradle/caches/*/plugin-resoluti
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Install with Gradle
run: ./gradlew --stacktrace printInfo
- name: Build with Gradle
run: ./gradlew --continue --stacktrace --profile build
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ab81ec76bcb0de28a933bf908ccca2562b33df83
- name: Run some code test
run: ./gradlew --stacktrace -Djdk.tls.client.protocols="TLSv1,TLSv1.1,TLSv1.2" jacocoTestReport coveralls
|
name: Java CI with Gradle
on:
push:
branches: [ DEV-1235 ]
pull_request:
branches: [ DEV-1235 ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Remove existing build cache
run: rm -f $HOME/.gradle/caches/modules-2/modules-2.lock ; rm -fr $HOME/.gradle/caches/*/plugin-resoluti
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Install with Gradle
run: ./gradlew --stacktrace printInfo
- name: Build with Gradle
run: ./gradlew --continue --stacktrace --profile build
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
+ SONAR_TOKEN: ab81ec76bcb0de28a933bf908ccca2562b33df83
- name: Run some code test
- run: ./gradlew --stacktrace -Djdk.tls.client.protocols="TLSv1,TLSv1.1,TLSv1.2" sonarqube jacocoTestReport coveralls
? ----------
+ run: ./gradlew --stacktrace -Djdk.tls.client.protocols="TLSv1,TLSv1.1,TLSv1.2" jacocoTestReport coveralls | 4 | 0.111111 | 2 | 2 |
45bbebf1d6e6b50c75730bda0b0bff890465b04a | .travis.yml | .travis.yml | language: php
php:
- 5.4
before_script:
- cp app/config/parameters.yml.travis app/config/parameters.yml
- composer install
- app/console --env=test --quiet doctrine:database:create
- app/console --env=test --quiet doctrine:schema:create
- app/console --env=test --quiet doctrine:fixtures:load
script: phpunit -c app
| language: php
php:
- 5.4
before_script:
- cp app/config/parameters.yml.travis app/config/parameters.yml
- composer install
- app/console --env=test doctrine:database:create
- app/console --env=test doctrine:schema:create
- app/console --env=test doctrine:fixtures:load --append
script: phpunit -c app
| Load fixtures required for testing. | Load fixtures required for testing.
| YAML | mit | BCRM/www,BCRM/www,BCRM/www,BCRM/www | yaml | ## Code Before:
language: php
php:
- 5.4
before_script:
- cp app/config/parameters.yml.travis app/config/parameters.yml
- composer install
- app/console --env=test --quiet doctrine:database:create
- app/console --env=test --quiet doctrine:schema:create
- app/console --env=test --quiet doctrine:fixtures:load
script: phpunit -c app
## Instruction:
Load fixtures required for testing.
## Code After:
language: php
php:
- 5.4
before_script:
- cp app/config/parameters.yml.travis app/config/parameters.yml
- composer install
- app/console --env=test doctrine:database:create
- app/console --env=test doctrine:schema:create
- app/console --env=test doctrine:fixtures:load --append
script: phpunit -c app
| language: php
php:
- 5.4
before_script:
- cp app/config/parameters.yml.travis app/config/parameters.yml
- composer install
- - app/console --env=test --quiet doctrine:database:create
? --------
+ - app/console --env=test doctrine:database:create
- - app/console --env=test --quiet doctrine:schema:create
? --------
+ - app/console --env=test doctrine:schema:create
- - app/console --env=test --quiet doctrine:fixtures:load
? --------
+ - app/console --env=test doctrine:fixtures:load --append
? +++++++++
script: phpunit -c app | 6 | 0.461538 | 3 | 3 |
23641c0cfd40a3cb0018ed69513e92f550d95997 | renderer.js | renderer.js | // This file is required by the index.html file and will
// be executed in the renderer process for that window.
// All of the Node.js APIs are available in this process.
const electron = require('electron');
const React = require("react");
const ReactDOM = require("react-dom");
const App = require("./dist/containers/App");
ReactDOM.render(React.createElement(App), document.getElementById("app"));
console.log(`Renderer JavaScript Startup Time: ${performance.now() - global.startTime}ms`);
// Allow opening links in browser with CMD+CLICK
(() => {
document.addEventListener('click', e => {
if (e.target.tagName === 'A') {
const url = e.target.getAttribute('href');
if (url && e.metaKey) {
electron.shell.openExternal(url)
e.preventDefault();
}
}
});
document.addEventListener('keydown', e => {
if (e.key === 'Meta') {
document.body.classList.add('links');
}
});
document.addEventListener('keyup', e => {
if (e.key === 'Meta') {
document.body.classList.remove('links');
}
});
})();
| // This file is required by the index.html file and will
// be executed in the renderer process for that window.
// All of the Node.js APIs are available in this process.
const electron = require('electron');
const React = require('react');
const ReactDOM = require('react-dom');
const App = require('./dist/containers/App');
ReactDOM.render(React.createElement(App), document.getElementById('app'));
console.log(`Renderer JavaScript Startup Time: ${performance.now() - global.startTime}ms`);
// Allow opening links in browser with CMD+CLICK
(() => {
document.addEventListener('click', e => {
const elem = e.target.tagName === 'A' ? e.target : e.target.parentElement;
if (elem.tagName === 'A') {
const url = elem.getAttribute('href');
if (url && e.metaKey) {
electron.shell.openExternal(url);
e.preventDefault();
}
}
});
document.addEventListener('keydown', e => {
if (e.key === 'Meta') {
document.body.classList.add('links');
}
});
document.addEventListener('keyup', e => {
if (e.key === 'Meta') {
document.body.classList.remove('links');
}
});
})();
| Fix links with nested elements | Fix links with nested elements
| JavaScript | cc0-1.0 | anotherletter/N,anotherletter/N,anotherletter/N | javascript | ## Code Before:
// This file is required by the index.html file and will
// be executed in the renderer process for that window.
// All of the Node.js APIs are available in this process.
const electron = require('electron');
const React = require("react");
const ReactDOM = require("react-dom");
const App = require("./dist/containers/App");
ReactDOM.render(React.createElement(App), document.getElementById("app"));
console.log(`Renderer JavaScript Startup Time: ${performance.now() - global.startTime}ms`);
// Allow opening links in browser with CMD+CLICK
(() => {
document.addEventListener('click', e => {
if (e.target.tagName === 'A') {
const url = e.target.getAttribute('href');
if (url && e.metaKey) {
electron.shell.openExternal(url)
e.preventDefault();
}
}
});
document.addEventListener('keydown', e => {
if (e.key === 'Meta') {
document.body.classList.add('links');
}
});
document.addEventListener('keyup', e => {
if (e.key === 'Meta') {
document.body.classList.remove('links');
}
});
})();
## Instruction:
Fix links with nested elements
## Code After:
// This file is required by the index.html file and will
// be executed in the renderer process for that window.
// All of the Node.js APIs are available in this process.
const electron = require('electron');
const React = require('react');
const ReactDOM = require('react-dom');
const App = require('./dist/containers/App');
ReactDOM.render(React.createElement(App), document.getElementById('app'));
console.log(`Renderer JavaScript Startup Time: ${performance.now() - global.startTime}ms`);
// Allow opening links in browser with CMD+CLICK
(() => {
document.addEventListener('click', e => {
const elem = e.target.tagName === 'A' ? e.target : e.target.parentElement;
if (elem.tagName === 'A') {
const url = elem.getAttribute('href');
if (url && e.metaKey) {
electron.shell.openExternal(url);
e.preventDefault();
}
}
});
document.addEventListener('keydown', e => {
if (e.key === 'Meta') {
document.body.classList.add('links');
}
});
document.addEventListener('keyup', e => {
if (e.key === 'Meta') {
document.body.classList.remove('links');
}
});
})();
| // This file is required by the index.html file and will
// be executed in the renderer process for that window.
// All of the Node.js APIs are available in this process.
const electron = require('electron');
- const React = require("react");
? ^ ^
+ const React = require('react');
? ^ ^
- const ReactDOM = require("react-dom");
? ^ ^
+ const ReactDOM = require('react-dom');
? ^ ^
- const App = require("./dist/containers/App");
? ^ ^
+ const App = require('./dist/containers/App');
? ^ ^
- ReactDOM.render(React.createElement(App), document.getElementById("app"));
? ^ ^
+ ReactDOM.render(React.createElement(App), document.getElementById('app'));
? ^ ^
console.log(`Renderer JavaScript Startup Time: ${performance.now() - global.startTime}ms`);
// Allow opening links in browser with CMD+CLICK
(() => {
document.addEventListener('click', e => {
+ const elem = e.target.tagName === 'A' ? e.target : e.target.parentElement;
- if (e.target.tagName === 'A') {
? ^^^^^ ^
+ if (elem.tagName === 'A') {
? ^ ^
- const url = e.target.getAttribute('href');
? ^^^^^ ^
+ const url = elem.getAttribute('href');
? ^ ^
if (url && e.metaKey) {
- electron.shell.openExternal(url)
+ electron.shell.openExternal(url);
? +
e.preventDefault();
}
}
});
document.addEventListener('keydown', e => {
if (e.key === 'Meta') {
document.body.classList.add('links');
}
});
document.addEventListener('keyup', e => {
if (e.key === 'Meta') {
document.body.classList.remove('links');
}
});
})(); | 15 | 0.405405 | 8 | 7 |
bd41d132010abf67651241cc678f52594b5dc9c8 | monitoring/post_to_slack/cloudfront_trigger.tf | monitoring/post_to_slack/cloudfront_trigger.tf |
provider "aws" {
region = "us-east-1"
alias = "us_east_1"
}
resource "random_id" "statement_id" {
keepers = {
aws_sns_topic_subscription = "${aws_sns_topic_subscription.subscribe_lambda_to_cloudfront_errors.id}"
}
byte_length = 8
}
resource "aws_lambda_permission" "allow_sns_cloudfront_trigger" {
statement_id = "${random_id.statement_id.hex}"
action = "lambda:InvokeFunction"
function_name = "${module.lambda_post_to_slack.arn}"
principal = "sns.amazonaws.com"
source_arn = "${var.cloudfront_errors_topic_arn}"
depends_on = ["aws_sns_topic_subscription.subscribe_lambda_to_cloudfront_errors"]
}
resource "aws_sns_topic_subscription" "subscribe_lambda_to_cloudfront_errors" {
topic_arn = "${var.cloudfront_errors_topic_arn}"
protocol = "lambda"
endpoint = "${module.lambda_post_to_slack.arn}"
}
|
provider "aws" {
region = "us-east-1"
alias = "us_east_1"
}
resource "random_id" "statement_id" {
keepers = {
aws_sns_topic_subscription = "${aws_sns_topic_subscription.subscribe_lambda_to_cloudfront_errors.id}"
}
byte_length = 8
}
resource "aws_lambda_permission" "allow_sns_cloudfront_trigger" {
statement_id = "${random_id.statement_id.hex}"
action = "lambda:InvokeFunction"
function_name = "${module.lambda_post_to_slack.arn}"
principal = "sns.amazonaws.com"
source_arn = "${var.cloudfront_errors_topic_arn}"
depends_on = ["aws_sns_topic_subscription.subscribe_lambda_to_cloudfront_errors"]
}
resource "aws_sns_topic_subscription" "subscribe_lambda_to_cloudfront_errors" {
provider = "aws.us_east_1"
topic_arn = "${var.cloudfront_errors_topic_arn}"
protocol = "lambda"
endpoint = "${module.lambda_post_to_slack.arn}"
}
| Define the trigger in us_east_1 | Define the trigger in us_east_1
| HCL | mit | wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api | hcl | ## Code Before:
provider "aws" {
region = "us-east-1"
alias = "us_east_1"
}
resource "random_id" "statement_id" {
keepers = {
aws_sns_topic_subscription = "${aws_sns_topic_subscription.subscribe_lambda_to_cloudfront_errors.id}"
}
byte_length = 8
}
resource "aws_lambda_permission" "allow_sns_cloudfront_trigger" {
statement_id = "${random_id.statement_id.hex}"
action = "lambda:InvokeFunction"
function_name = "${module.lambda_post_to_slack.arn}"
principal = "sns.amazonaws.com"
source_arn = "${var.cloudfront_errors_topic_arn}"
depends_on = ["aws_sns_topic_subscription.subscribe_lambda_to_cloudfront_errors"]
}
resource "aws_sns_topic_subscription" "subscribe_lambda_to_cloudfront_errors" {
topic_arn = "${var.cloudfront_errors_topic_arn}"
protocol = "lambda"
endpoint = "${module.lambda_post_to_slack.arn}"
}
## Instruction:
Define the trigger in us_east_1
## Code After:
provider "aws" {
region = "us-east-1"
alias = "us_east_1"
}
resource "random_id" "statement_id" {
keepers = {
aws_sns_topic_subscription = "${aws_sns_topic_subscription.subscribe_lambda_to_cloudfront_errors.id}"
}
byte_length = 8
}
resource "aws_lambda_permission" "allow_sns_cloudfront_trigger" {
statement_id = "${random_id.statement_id.hex}"
action = "lambda:InvokeFunction"
function_name = "${module.lambda_post_to_slack.arn}"
principal = "sns.amazonaws.com"
source_arn = "${var.cloudfront_errors_topic_arn}"
depends_on = ["aws_sns_topic_subscription.subscribe_lambda_to_cloudfront_errors"]
}
resource "aws_sns_topic_subscription" "subscribe_lambda_to_cloudfront_errors" {
provider = "aws.us_east_1"
topic_arn = "${var.cloudfront_errors_topic_arn}"
protocol = "lambda"
endpoint = "${module.lambda_post_to_slack.arn}"
}
|
provider "aws" {
region = "us-east-1"
alias = "us_east_1"
}
resource "random_id" "statement_id" {
keepers = {
aws_sns_topic_subscription = "${aws_sns_topic_subscription.subscribe_lambda_to_cloudfront_errors.id}"
}
byte_length = 8
}
resource "aws_lambda_permission" "allow_sns_cloudfront_trigger" {
statement_id = "${random_id.statement_id.hex}"
action = "lambda:InvokeFunction"
function_name = "${module.lambda_post_to_slack.arn}"
principal = "sns.amazonaws.com"
source_arn = "${var.cloudfront_errors_topic_arn}"
depends_on = ["aws_sns_topic_subscription.subscribe_lambda_to_cloudfront_errors"]
}
resource "aws_sns_topic_subscription" "subscribe_lambda_to_cloudfront_errors" {
+ provider = "aws.us_east_1"
+
topic_arn = "${var.cloudfront_errors_topic_arn}"
protocol = "lambda"
endpoint = "${module.lambda_post_to_slack.arn}"
} | 2 | 0.071429 | 2 | 0 |
373b0210483839b7ac5b4fd8eb0bcfdfe8d63d83 | begood_sites/fields.py | begood_sites/fields.py | from django.db import models
from django.contrib.sites.models import Site
class MultiSiteField(models.ManyToManyField):
def __init__(self, **kwargs):
defaults = {
'blank': False,
}
defaults.update(kwargs)
super(MultiSiteField, self).__init__(Site, **defaults)
class SingleSiteField(models.ForeignKey):
def __init__(self, **kwargs):
super(SingleSiteField, self).__init__(Site, **kwargs)
# Make sure South migrations work
try:
from south.modelsinspector import add_introspection_rules
add_introspection_rules([], ["^begood_sites\.fields\.MultiSiteField"])
add_introspection_rules([], ["^begood_sites\.fields\.SingleSiteField"])
except:
pass
| from django.db import models
from django.contrib.sites.models import Site
class MultiSiteField(models.ManyToManyField):
def __init__(self, **kwargs):
defaults = {
'blank': False,
}
defaults.update(kwargs)
if 'to' in defaults:
del defaults['to']
super(MultiSiteField, self).__init__(Site, **defaults)
class SingleSiteField(models.ForeignKey):
def __init__(self, **kwargs):
if 'to' in kwargs:
del kwargs['to']
super(SingleSiteField, self).__init__(Site, **kwargs)
# Make sure South migrations work
try:
from south.modelsinspector import add_introspection_rules
add_introspection_rules([], ["^begood_sites\.fields\.MultiSiteField"])
add_introspection_rules([], ["^begood_sites\.fields\.SingleSiteField"])
except:
pass
| Fix problem with South migrations. | Fix problem with South migrations.
| Python | mit | AGoodId/begood-sites | python | ## Code Before:
from django.db import models
from django.contrib.sites.models import Site
class MultiSiteField(models.ManyToManyField):
def __init__(self, **kwargs):
defaults = {
'blank': False,
}
defaults.update(kwargs)
super(MultiSiteField, self).__init__(Site, **defaults)
class SingleSiteField(models.ForeignKey):
def __init__(self, **kwargs):
super(SingleSiteField, self).__init__(Site, **kwargs)
# Make sure South migrations work
try:
from south.modelsinspector import add_introspection_rules
add_introspection_rules([], ["^begood_sites\.fields\.MultiSiteField"])
add_introspection_rules([], ["^begood_sites\.fields\.SingleSiteField"])
except:
pass
## Instruction:
Fix problem with South migrations.
## Code After:
from django.db import models
from django.contrib.sites.models import Site
class MultiSiteField(models.ManyToManyField):
def __init__(self, **kwargs):
defaults = {
'blank': False,
}
defaults.update(kwargs)
if 'to' in defaults:
del defaults['to']
super(MultiSiteField, self).__init__(Site, **defaults)
class SingleSiteField(models.ForeignKey):
def __init__(self, **kwargs):
if 'to' in kwargs:
del kwargs['to']
super(SingleSiteField, self).__init__(Site, **kwargs)
# Make sure South migrations work
try:
from south.modelsinspector import add_introspection_rules
add_introspection_rules([], ["^begood_sites\.fields\.MultiSiteField"])
add_introspection_rules([], ["^begood_sites\.fields\.SingleSiteField"])
except:
pass
| from django.db import models
from django.contrib.sites.models import Site
class MultiSiteField(models.ManyToManyField):
def __init__(self, **kwargs):
defaults = {
'blank': False,
}
defaults.update(kwargs)
+ if 'to' in defaults:
+ del defaults['to']
super(MultiSiteField, self).__init__(Site, **defaults)
class SingleSiteField(models.ForeignKey):
def __init__(self, **kwargs):
+ if 'to' in kwargs:
+ del kwargs['to']
super(SingleSiteField, self).__init__(Site, **kwargs)
# Make sure South migrations work
try:
from south.modelsinspector import add_introspection_rules
add_introspection_rules([], ["^begood_sites\.fields\.MultiSiteField"])
add_introspection_rules([], ["^begood_sites\.fields\.SingleSiteField"])
except:
pass | 4 | 0.148148 | 4 | 0 |
496a3a27879ed3e1c47781959325ba67bac9da13 | .vscode/tasks.json | .vscode/tasks.json | {
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "yarn",
"isShellCommand": true,
"showOutput": "never",
"suppressTaskName": true,
"isBackground": true,
"tasks": [
{
"taskName": "storybook",
"args": [
"run",
"storybook"
]
}
]
}
| {
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "yarn",
"isShellCommand": true,
"showOutput": "never",
"suppressTaskName": true,
"isBackground": true,
"tasks": [
{
"taskName": "storybook",
"args": [
"run",
"storybook"
]
},
{
"taskName": "TSLint: Lint all files",
"command": "yarn",
"args": ["lint"],
"problemMatcher": {
"owner": "tslint",
"fileLocation": [
"relative",
"${workspaceRoot}"
],
"severity": "warning",
"pattern": {
"regexp": "^(\\S.*)\\[(\\d+), (\\d+)\\]:\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
}
}
]
}
| Add task to run tslint and show all problems in Problems view. | [vscode] Add task to run tslint and show all problems in Problems view.
| JSON | mit | artsy/reaction-force,artsy/reaction,xtina-starr/reaction,artsy/reaction-force,xtina-starr/reaction,craigspaeth/reaction,craigspaeth/reaction,artsy/reaction,xtina-starr/reaction,craigspaeth/reaction,xtina-starr/reaction,artsy/reaction | json | ## Code Before:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "yarn",
"isShellCommand": true,
"showOutput": "never",
"suppressTaskName": true,
"isBackground": true,
"tasks": [
{
"taskName": "storybook",
"args": [
"run",
"storybook"
]
}
]
}
## Instruction:
[vscode] Add task to run tslint and show all problems in Problems view.
## Code After:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "yarn",
"isShellCommand": true,
"showOutput": "never",
"suppressTaskName": true,
"isBackground": true,
"tasks": [
{
"taskName": "storybook",
"args": [
"run",
"storybook"
]
},
{
"taskName": "TSLint: Lint all files",
"command": "yarn",
"args": ["lint"],
"problemMatcher": {
"owner": "tslint",
"fileLocation": [
"relative",
"${workspaceRoot}"
],
"severity": "warning",
"pattern": {
"regexp": "^(\\S.*)\\[(\\d+), (\\d+)\\]:\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
}
}
]
}
| {
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "yarn",
"isShellCommand": true,
"showOutput": "never",
"suppressTaskName": true,
"isBackground": true,
"tasks": [
{
"taskName": "storybook",
"args": [
"run",
"storybook"
]
+ },
+ {
+ "taskName": "TSLint: Lint all files",
+ "command": "yarn",
+ "args": ["lint"],
+ "problemMatcher": {
+ "owner": "tslint",
+ "fileLocation": [
+ "relative",
+ "${workspaceRoot}"
+ ],
+ "severity": "warning",
+ "pattern": {
+ "regexp": "^(\\S.*)\\[(\\d+), (\\d+)\\]:\\s+(.*)$",
+ "file": 1,
+ "line": 2,
+ "column": 3,
+ "message": 4
+ }
+ }
}
]
} | 20 | 1.052632 | 20 | 0 |
6b71430e1631dd7c7f66dcd80848884429cf516d | appveyor.yml | appveyor.yml | version: 0.1.{build}
os: WMF 5
environment:
Coveralls_Key:
secure: 0eJvIYA/nSAW0zBTrjkNZ+7s76G3zGM5Oas2iWJicIwjZnRraAbtzrCCb8ndVMhq
GitHub_Key:
secure: wtrwAJK+i7Ar5L8TXeXOUtsxmVD+2wXu9u9bOf6GRfPP0Xn2V4yqTatLwaT7VWA6
before_build:
- ps: Write-Host "Build version :` $env:APPVEYOR_BUILD_VERSION"
- ps: Write-Host "Branch :` $env:APPVEYOR_REPO_BRANCH"
- ps: Install-PackageProvider -Name NuGet -Force
- ps: Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
- ps: Install-Module InvokeBuild -Scope CurrentUser -AllowClobber -Force
- ps: Import-Module InvokeBuild
build_script:
- ps: Invoke-Build
| version: 0.1.{build}
image: Visual Studio 2017
environment:
Coveralls_Key:
secure: 0eJvIYA/nSAW0zBTrjkNZ+7s76G3zGM5Oas2iWJicIwjZnRraAbtzrCCb8ndVMhq
GitHub_Key:
secure: wtrwAJK+i7Ar5L8TXeXOUtsxmVD+2wXu9u9bOf6GRfPP0Xn2V4yqTatLwaT7VWA6
before_build:
- ps: Write-Host "Build version :` $env:APPVEYOR_BUILD_VERSION"
- ps: Write-Host "Branch :` $env:APPVEYOR_REPO_BRANCH"
- ps: Install-PackageProvider -Name NuGet -Force
- ps: Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
- ps: Install-Module InvokeBuild -Scope CurrentUser -AllowClobber -Force
- ps: Import-Module InvokeBuild
build_script:
- ps: Invoke-Build
| Update Appveyor build image to 'Visual Studio 2017' | Update Appveyor build image to 'Visual Studio 2017'
| YAML | mit | MathieuBuisson/PSCodeHealth,MathieuBuisson/PSCodeHealth | yaml | ## Code Before:
version: 0.1.{build}
os: WMF 5
environment:
Coveralls_Key:
secure: 0eJvIYA/nSAW0zBTrjkNZ+7s76G3zGM5Oas2iWJicIwjZnRraAbtzrCCb8ndVMhq
GitHub_Key:
secure: wtrwAJK+i7Ar5L8TXeXOUtsxmVD+2wXu9u9bOf6GRfPP0Xn2V4yqTatLwaT7VWA6
before_build:
- ps: Write-Host "Build version :` $env:APPVEYOR_BUILD_VERSION"
- ps: Write-Host "Branch :` $env:APPVEYOR_REPO_BRANCH"
- ps: Install-PackageProvider -Name NuGet -Force
- ps: Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
- ps: Install-Module InvokeBuild -Scope CurrentUser -AllowClobber -Force
- ps: Import-Module InvokeBuild
build_script:
- ps: Invoke-Build
## Instruction:
Update Appveyor build image to 'Visual Studio 2017'
## Code After:
version: 0.1.{build}
image: Visual Studio 2017
environment:
Coveralls_Key:
secure: 0eJvIYA/nSAW0zBTrjkNZ+7s76G3zGM5Oas2iWJicIwjZnRraAbtzrCCb8ndVMhq
GitHub_Key:
secure: wtrwAJK+i7Ar5L8TXeXOUtsxmVD+2wXu9u9bOf6GRfPP0Xn2V4yqTatLwaT7VWA6
before_build:
- ps: Write-Host "Build version :` $env:APPVEYOR_BUILD_VERSION"
- ps: Write-Host "Branch :` $env:APPVEYOR_REPO_BRANCH"
- ps: Install-PackageProvider -Name NuGet -Force
- ps: Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
- ps: Install-Module InvokeBuild -Scope CurrentUser -AllowClobber -Force
- ps: Import-Module InvokeBuild
build_script:
- ps: Invoke-Build
| version: 0.1.{build}
- os: WMF 5
+ image: Visual Studio 2017
environment:
Coveralls_Key:
secure: 0eJvIYA/nSAW0zBTrjkNZ+7s76G3zGM5Oas2iWJicIwjZnRraAbtzrCCb8ndVMhq
GitHub_Key:
secure: wtrwAJK+i7Ar5L8TXeXOUtsxmVD+2wXu9u9bOf6GRfPP0Xn2V4yqTatLwaT7VWA6
before_build:
- ps: Write-Host "Build version :` $env:APPVEYOR_BUILD_VERSION"
- ps: Write-Host "Branch :` $env:APPVEYOR_REPO_BRANCH"
- ps: Install-PackageProvider -Name NuGet -Force
- ps: Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
- ps: Install-Module InvokeBuild -Scope CurrentUser -AllowClobber -Force
- ps: Import-Module InvokeBuild
build_script:
- ps: Invoke-Build | 2 | 0.1 | 1 | 1 |
8573dde60e7f0fbc75d9d918db25fb68f5014255 | .travis.yml | .travis.yml | language: python
python:
- 2.7
# Django releases
env:
- DJANGO_VERSION=Django==1.6.2
# Services
services:
- redis-server
- elasticsearch
# Package installation
install:
- python setup.py install
- pip install psycopg2 pyelasticsearch elasticutils wand
- pip install coveralls
# Pre-test configuration
before_script:
- psql -c 'create database wagtaildemo;' -U postgres
# Run the tests
script:
coverage run runtests.py
after_success:
coveralls
# Who to notify about build results
notifications:
email:
recipients:
- [email protected]
on_success: change
on_failure: always
webhooks:
urls:
- secure: "dQZBPlCC2OQE2L7EqOMkKsQxCJm05BhFrfmKmJ0AnKqxiEyZDKd2JiQaMg8X7XtIdJ87dlnBZH5h3erPSMgI3mIfNCWKKs/f6idgWIXPpklzU95KmPOrCoOyT3lkDTEOXCYXhgvOExp8qLHc4qjEWbSoIfPwqYyPlGry3Z76UBM="
on_success: change
on_failure: always
# bump Travis: 1
| language: python
python:
- 2.7
# Django releases
env:
- DJANGO_VERSION=Django==1.6.2
# Services
services:
- redis-server
- elasticsearch
# Package installation
install:
- python setup.py install
- apt-get install python-wand
- pip install psycopg2 pyelasticsearch elasticutils
- pip install coveralls
# Pre-test configuration
before_script:
- psql -c 'create database wagtaildemo;' -U postgres
# Run the tests
script:
coverage run runtests.py
after_success:
coveralls
# Who to notify about build results
notifications:
email:
recipients:
- [email protected]
on_success: change
on_failure: always
webhooks:
urls:
- secure: "dQZBPlCC2OQE2L7EqOMkKsQxCJm05BhFrfmKmJ0AnKqxiEyZDKd2JiQaMg8X7XtIdJ87dlnBZH5h3erPSMgI3mIfNCWKKs/f6idgWIXPpklzU95KmPOrCoOyT3lkDTEOXCYXhgvOExp8qLHc4qjEWbSoIfPwqYyPlGry3Z76UBM="
on_success: change
on_failure: always
# bump Travis: 1
| Use python-wand apt package for testing | Use python-wand apt package for testing
which includes all dependencies (e.g. ImageMagick) | YAML | bsd-3-clause | janusnic/wagtail,mixxorz/wagtail,chimeno/wagtail,m-sanders/wagtail,mixxorz/wagtail,mayapurmedia/wagtail,rv816/wagtail,rjsproxy/wagtail,hamsterbacke23/wagtail,KimGlazebrook/wagtail-experiment,Pennebaker/wagtail,nrsimha/wagtail,mixxorz/wagtail,quru/wagtail,WQuanfeng/wagtail,gogobook/wagtail,benjaoming/wagtail,rsalmaso/wagtail,marctc/wagtail,nutztherookie/wagtail,helenwarren/pied-wagtail,JoshBarr/wagtail,iho/wagtail,lojack/wagtail,quru/wagtail,iansprice/wagtail,benjaoming/wagtail,takeshineshiro/wagtail,mikedingjan/wagtail,rjsproxy/wagtail,taedori81/wagtail,kurtrwall/wagtail,janusnic/wagtail,takeshineshiro/wagtail,stevenewey/wagtail,janusnic/wagtail,kurtw/wagtail,kaedroho/wagtail,chimeno/wagtail,dresiu/wagtail,nilnvoid/wagtail,nrsimha/wagtail,stevenewey/wagtail,hanpama/wagtail,FlipperPA/wagtail,tangentlabs/wagtail,m-sanders/wagtail,stevenewey/wagtail,thenewguy/wagtail,dresiu/wagtail,nealtodd/wagtail,FlipperPA/wagtail,bjesus/wagtail,torchbox/wagtail,bjesus/wagtail,chimeno/wagtail,davecranwell/wagtail,thenewguy/wagtail,WQuanfeng/wagtail,taedori81/wagtail,Tivix/wagtail,darith27/wagtail,mjec/wagtail,kurtrwall/wagtail,iho/wagtail,benjaoming/wagtail,jorge-marques/wagtail,Toshakins/wagtail,serzans/wagtail,m-sanders/wagtail,lojack/wagtail,benemery/wagtail,kurtw/wagtail,inonit/wagtail,wagtail/wagtail,nimasmi/wagtail,nimasmi/wagtail,mayapurmedia/wagtail,Klaudit/wagtail,quru/wagtail,mikedingjan/wagtail,gasman/wagtail,kaedroho/wagtail,willcodefortea/wagtail,inonit/wagtail,helenwarren/pied-wagtail,chrxr/wagtail,timorieber/wagtail,darith27/wagtail,janusnic/wagtail,Toshakins/wagtail,chimeno/wagtail,mixxorz/wagtail,JoshBarr/wagtail,benjaoming/wagtail,wagtail/wagtail,mayapurmedia/wagtail,hanpama/wagtail,willcodefortea/wagtail,jordij/wagtail,zerolab/wagtail,KimGlazebrook/wagtail-experiment,benemery/wagtail,rsalmaso/wagtail,hamsterbacke23/wagtail,zerolab/wagtail,jnns/wagtail,KimGlazebrook/wagtail-experiment,takeflight/wagtail,timorieber/wagtail,bjesus/wagtail,chimeno/wagtail,gasman/wagtail,nrsimha/wagtail,nutztherookie/wagtail,Pennebaker/wagtail,rsalmaso/wagtail,mephizzle/wagtail,inonit/wagtail,WQuanfeng/wagtail,marctc/wagtail,mephizzle/wagtail,takeflight/wagtail,nealtodd/wagtail,jorge-marques/wagtail,timorieber/wagtail,jnns/wagtail,takeshineshiro/wagtail,helenwarren/pied-wagtail,m-sanders/wagtail,JoshBarr/wagtail,benemery/wagtail,JoshBarr/wagtail,kurtrwall/wagtail,dresiu/wagtail,kaedroho/wagtail,torchbox/wagtail,mjec/wagtail,taedori81/wagtail,Pennebaker/wagtail,chrxr/wagtail,rv816/wagtail,nilnvoid/wagtail,hamsterbacke23/wagtail,nealtodd/wagtail,Tivix/wagtail,dresiu/wagtail,dresiu/wagtail,mikedingjan/wagtail,rsalmaso/wagtail,quru/wagtail,Klaudit/wagtail,iansprice/wagtail,mjec/wagtail,takeflight/wagtail,wagtail/wagtail,stevenewey/wagtail,serzans/wagtail,torchbox/wagtail,jnns/wagtail,mjec/wagtail,jordij/wagtail,hanpama/wagtail,lojack/wagtail,mikedingjan/wagtail,nimasmi/wagtail,jordij/wagtail,darith27/wagtail,zerolab/wagtail,jnns/wagtail,taedori81/wagtail,hamsterbacke23/wagtail,davecranwell/wagtail,100Shapes/wagtail,iansprice/wagtail,gasman/wagtail,100Shapes/wagtail,iansprice/wagtail,nimasmi/wagtail,rv816/wagtail,davecranwell/wagtail,gogobook/wagtail,kurtw/wagtail,FlipperPA/wagtail,marctc/wagtail,tangentlabs/wagtail,mephizzle/wagtail,jorge-marques/wagtail,mephizzle/wagtail,kurtrwall/wagtail,nilnvoid/wagtail,KimGlazebrook/wagtail-experiment,iho/wagtail,benemery/wagtail,takeshineshiro/wagtail,willcodefortea/wagtail,bjesus/wagtail,takeflight/wagtail,timorieber/wagtail,tangentlabs/wagtail,jorge-marques/wagtail,marctc/wagtail,kaedroho/wagtail,jordij/wagtail,kaedroho/wagtail,Klaudit/wagtail,Tivix/wagtail,Pennebaker/wagtail,darith27/wagtail,serzans/wagtail,chrxr/wagtail,FlipperPA/wagtail,Klaudit/wagtail,Toshakins/wagtail,Tivix/wagtail,wagtail/wagtail,tangentlabs/wagtail,gasman/wagtail,nealtodd/wagtail,zerolab/wagtail,taedori81/wagtail,hanpama/wagtail,WQuanfeng/wagtail,serzans/wagtail,thenewguy/wagtail,jorge-marques/wagtail,nutztherookie/wagtail,iho/wagtail,rsalmaso/wagtail,mixxorz/wagtail,gogobook/wagtail,thenewguy/wagtail,inonit/wagtail,rjsproxy/wagtail,kurtw/wagtail,Toshakins/wagtail,willcodefortea/wagtail,nutztherookie/wagtail,davecranwell/wagtail,wagtail/wagtail,thenewguy/wagtail,gasman/wagtail,nilnvoid/wagtail,100Shapes/wagtail,zerolab/wagtail,nrsimha/wagtail,rjsproxy/wagtail,rv816/wagtail,gogobook/wagtail,chrxr/wagtail,mayapurmedia/wagtail,torchbox/wagtail | yaml | ## Code Before:
language: python
python:
- 2.7
# Django releases
env:
- DJANGO_VERSION=Django==1.6.2
# Services
services:
- redis-server
- elasticsearch
# Package installation
install:
- python setup.py install
- pip install psycopg2 pyelasticsearch elasticutils wand
- pip install coveralls
# Pre-test configuration
before_script:
- psql -c 'create database wagtaildemo;' -U postgres
# Run the tests
script:
coverage run runtests.py
after_success:
coveralls
# Who to notify about build results
notifications:
email:
recipients:
- [email protected]
on_success: change
on_failure: always
webhooks:
urls:
- secure: "dQZBPlCC2OQE2L7EqOMkKsQxCJm05BhFrfmKmJ0AnKqxiEyZDKd2JiQaMg8X7XtIdJ87dlnBZH5h3erPSMgI3mIfNCWKKs/f6idgWIXPpklzU95KmPOrCoOyT3lkDTEOXCYXhgvOExp8qLHc4qjEWbSoIfPwqYyPlGry3Z76UBM="
on_success: change
on_failure: always
# bump Travis: 1
## Instruction:
Use python-wand apt package for testing
which includes all dependencies (e.g. ImageMagick)
## Code After:
language: python
python:
- 2.7
# Django releases
env:
- DJANGO_VERSION=Django==1.6.2
# Services
services:
- redis-server
- elasticsearch
# Package installation
install:
- python setup.py install
- apt-get install python-wand
- pip install psycopg2 pyelasticsearch elasticutils
- pip install coveralls
# Pre-test configuration
before_script:
- psql -c 'create database wagtaildemo;' -U postgres
# Run the tests
script:
coverage run runtests.py
after_success:
coveralls
# Who to notify about build results
notifications:
email:
recipients:
- [email protected]
on_success: change
on_failure: always
webhooks:
urls:
- secure: "dQZBPlCC2OQE2L7EqOMkKsQxCJm05BhFrfmKmJ0AnKqxiEyZDKd2JiQaMg8X7XtIdJ87dlnBZH5h3erPSMgI3mIfNCWKKs/f6idgWIXPpklzU95KmPOrCoOyT3lkDTEOXCYXhgvOExp8qLHc4qjEWbSoIfPwqYyPlGry3Z76UBM="
on_success: change
on_failure: always
# bump Travis: 1
| language: python
python:
- 2.7
# Django releases
env:
- DJANGO_VERSION=Django==1.6.2
# Services
services:
- redis-server
- elasticsearch
# Package installation
install:
- python setup.py install
+ - apt-get install python-wand
- - pip install psycopg2 pyelasticsearch elasticutils wand
? -----
+ - pip install psycopg2 pyelasticsearch elasticutils
- pip install coveralls
# Pre-test configuration
before_script:
- psql -c 'create database wagtaildemo;' -U postgres
# Run the tests
script:
coverage run runtests.py
after_success:
coveralls
# Who to notify about build results
notifications:
email:
recipients:
- [email protected]
on_success: change
on_failure: always
webhooks:
urls:
- secure: "dQZBPlCC2OQE2L7EqOMkKsQxCJm05BhFrfmKmJ0AnKqxiEyZDKd2JiQaMg8X7XtIdJ87dlnBZH5h3erPSMgI3mIfNCWKKs/f6idgWIXPpklzU95KmPOrCoOyT3lkDTEOXCYXhgvOExp8qLHc4qjEWbSoIfPwqYyPlGry3Z76UBM="
on_success: change
on_failure: always
# bump Travis: 1 | 3 | 0.081081 | 2 | 1 |
4efa9388b0295935f2ba09a5b73ec553c630d9e0 | lib/riddle/0.9.9/configuration/searchd.rb | lib/riddle/0.9.9/configuration/searchd.rb | module Riddle
class Configuration
class Searchd
def valid?
set_listen
!( @listen.nil? || @listen.empty? || @pid_file.nil? )
end
private
def set_listen
@listen = @listen.to_s if @listen.is_a?(Fixnum)
return unless @listen.nil? || @listen.empty?
@listen = []
@listen << @port.to_s if @port
@listen << "9306:mysql41" if @mysql41.is_a?(TrueClass)
@listen << "#{@mysql41}:mysql41" if @mysql41.is_a?(Fixnum)
@listen.each { |l| l.insert(0, "#{@address}:") } if @address
end
def settings
@listen.nil? ? super : super - [:address, :port]
end
end
end
end
| module Riddle
class Configuration
class Searchd
NUMBER = 1.class
def valid?
set_listen
!( @listen.nil? || @listen.empty? || @pid_file.nil? )
end
private
def set_listen
@listen = @listen.to_s if @listen.is_a?(NUMBER)
return unless @listen.nil? || @listen.empty?
@listen = []
@listen << @port.to_s if @port
@listen << "9306:mysql41" if @mysql41.is_a?(TrueClass)
@listen << "#{@mysql41}:mysql41" if @mysql41.is_a?(NUMBER)
@listen.each { |l| l.insert(0, "#{@address}:") } if @address
end
def settings
@listen.nil? ? super : super - [:address, :port]
end
end
end
end
| Check for numbers in a MRI 2.4 friendly manner. | Check for numbers in a MRI 2.4 friendly manner.
| Ruby | mit | pat/riddle,pat/riddle | ruby | ## Code Before:
module Riddle
class Configuration
class Searchd
def valid?
set_listen
!( @listen.nil? || @listen.empty? || @pid_file.nil? )
end
private
def set_listen
@listen = @listen.to_s if @listen.is_a?(Fixnum)
return unless @listen.nil? || @listen.empty?
@listen = []
@listen << @port.to_s if @port
@listen << "9306:mysql41" if @mysql41.is_a?(TrueClass)
@listen << "#{@mysql41}:mysql41" if @mysql41.is_a?(Fixnum)
@listen.each { |l| l.insert(0, "#{@address}:") } if @address
end
def settings
@listen.nil? ? super : super - [:address, :port]
end
end
end
end
## Instruction:
Check for numbers in a MRI 2.4 friendly manner.
## Code After:
module Riddle
class Configuration
class Searchd
NUMBER = 1.class
def valid?
set_listen
!( @listen.nil? || @listen.empty? || @pid_file.nil? )
end
private
def set_listen
@listen = @listen.to_s if @listen.is_a?(NUMBER)
return unless @listen.nil? || @listen.empty?
@listen = []
@listen << @port.to_s if @port
@listen << "9306:mysql41" if @mysql41.is_a?(TrueClass)
@listen << "#{@mysql41}:mysql41" if @mysql41.is_a?(NUMBER)
@listen.each { |l| l.insert(0, "#{@address}:") } if @address
end
def settings
@listen.nil? ? super : super - [:address, :port]
end
end
end
end
| module Riddle
class Configuration
class Searchd
+ NUMBER = 1.class
+
def valid?
set_listen
!( @listen.nil? || @listen.empty? || @pid_file.nil? )
end
private
def set_listen
- @listen = @listen.to_s if @listen.is_a?(Fixnum)
? ^^^^^^
+ @listen = @listen.to_s if @listen.is_a?(NUMBER)
? ^^^^^^
return unless @listen.nil? || @listen.empty?
@listen = []
@listen << @port.to_s if @port
@listen << "9306:mysql41" if @mysql41.is_a?(TrueClass)
- @listen << "#{@mysql41}:mysql41" if @mysql41.is_a?(Fixnum)
? ^^^^^^
+ @listen << "#{@mysql41}:mysql41" if @mysql41.is_a?(NUMBER)
? ^^^^^^
@listen.each { |l| l.insert(0, "#{@address}:") } if @address
end
def settings
@listen.nil? ? super : super - [:address, :port]
end
end
end
end | 6 | 0.2 | 4 | 2 |
8959c113536a83e4b3a6e8852cbd719bb8ac6314 | Kwc/Basic/ImageEnlarge/Component.tpl | Kwc/Basic/ImageEnlarge/Component.tpl | <div class="<?=$this->cssClass?><? if ($this->showImageCaption && !empty($this->image_caption)) { ?> showImageCaption<? } ?>" style="max-width:<?=$this->width;?>px;<? if ($this->defineWidth) {?> width:<?=$this->width;?>px;<? } ?>">
<? if ($this->baseUrl) { ?>
<?=$this->component($this->linkTag)?>
<div class="container<? if ($this->width>100) { ?> webResponsiveImgLoading<? } ?>" style="padding-bottom:<?=$this->aspectRatio?>%;"
data-min-width="<?=$this->minWidth;?>"
data-max-width="<?=$this->maxWidth;?>"
data-src="<?=$this->baseUrl;?>">
<noscript>
<?=$this->image($this->image, $this->altText, $this->imgAttributes)?>
</noscript>
</div>
<? if ($this->showImageCaption && !empty($this->image_caption)) { ?>
<div class="imageCaption" style="max-width:<?=$this->imageParam($this->image,'width','default');?>px;"><?=(!empty($this->image_caption) ? $this->image_caption : '');?></div>
<? } ?>
<?if ($this->hasContent($this->linkTag)) {?>
</a>
<?}?>
<? } ?>
</div>
| <div class="<?=$this->cssClass?><? if ($this->showImageCaption && !empty($this->image_caption)) { ?> showImageCaption<? } ?>" style="<?=$this->style;?>">
<? if ($this->baseUrl) { ?>
<?=$this->component($this->linkTag)?>
<div class="<?=$this->containerClass?>" style="padding-bottom:<?=$this->aspectRatio?>%;"
data-min-width="<?=$this->minWidth;?>"
data-max-width="<?=$this->maxWidth;?>"
data-src="<?=$this->baseUrl;?>">
<noscript>
<?=$this->image($this->image, $this->altText, $this->imgAttributes)?>
</noscript>
</div>
<? if ($this->showImageCaption && !empty($this->image_caption)) { ?>
<div class="imageCaption" style="max-width:<?=$this->imageParam($this->image,'width','default');?>px;"><?=(!empty($this->image_caption) ? $this->image_caption : '');?></div>
<? } ?>
<?if ($this->hasContent($this->linkTag)) {?>
</a>
<?}?>
<? } ?>
</div>
| Use style and classes set in image component | Use style and classes set in image component
| Smarty | bsd-2-clause | koala-framework/koala-framework,koala-framework/koala-framework | smarty | ## Code Before:
<div class="<?=$this->cssClass?><? if ($this->showImageCaption && !empty($this->image_caption)) { ?> showImageCaption<? } ?>" style="max-width:<?=$this->width;?>px;<? if ($this->defineWidth) {?> width:<?=$this->width;?>px;<? } ?>">
<? if ($this->baseUrl) { ?>
<?=$this->component($this->linkTag)?>
<div class="container<? if ($this->width>100) { ?> webResponsiveImgLoading<? } ?>" style="padding-bottom:<?=$this->aspectRatio?>%;"
data-min-width="<?=$this->minWidth;?>"
data-max-width="<?=$this->maxWidth;?>"
data-src="<?=$this->baseUrl;?>">
<noscript>
<?=$this->image($this->image, $this->altText, $this->imgAttributes)?>
</noscript>
</div>
<? if ($this->showImageCaption && !empty($this->image_caption)) { ?>
<div class="imageCaption" style="max-width:<?=$this->imageParam($this->image,'width','default');?>px;"><?=(!empty($this->image_caption) ? $this->image_caption : '');?></div>
<? } ?>
<?if ($this->hasContent($this->linkTag)) {?>
</a>
<?}?>
<? } ?>
</div>
## Instruction:
Use style and classes set in image component
## Code After:
<div class="<?=$this->cssClass?><? if ($this->showImageCaption && !empty($this->image_caption)) { ?> showImageCaption<? } ?>" style="<?=$this->style;?>">
<? if ($this->baseUrl) { ?>
<?=$this->component($this->linkTag)?>
<div class="<?=$this->containerClass?>" style="padding-bottom:<?=$this->aspectRatio?>%;"
data-min-width="<?=$this->minWidth;?>"
data-max-width="<?=$this->maxWidth;?>"
data-src="<?=$this->baseUrl;?>">
<noscript>
<?=$this->image($this->image, $this->altText, $this->imgAttributes)?>
</noscript>
</div>
<? if ($this->showImageCaption && !empty($this->image_caption)) { ?>
<div class="imageCaption" style="max-width:<?=$this->imageParam($this->image,'width','default');?>px;"><?=(!empty($this->image_caption) ? $this->image_caption : '');?></div>
<? } ?>
<?if ($this->hasContent($this->linkTag)) {?>
</a>
<?}?>
<? } ?>
</div>
| - <div class="<?=$this->cssClass?><? if ($this->showImageCaption && !empty($this->image_caption)) { ?> showImageCaption<? } ?>" style="max-width:<?=$this->width;?>px;<? if ($this->defineWidth) {?> width:<?=$this->width;?>px;<? } ?>">
? ---------- ^^^ ^ --------------------------------------------------------------------
+ <div class="<?=$this->cssClass?><? if ($this->showImageCaption && !empty($this->image_caption)) { ?> showImageCaption<? } ?>" style="<?=$this->style;?>">
? ^ ^^^
<? if ($this->baseUrl) { ?>
<?=$this->component($this->linkTag)?>
- <div class="container<? if ($this->width>100) { ?> webResponsiveImgLoading<? } ?>" style="padding-bottom:<?=$this->aspectRatio?>%;"
+ <div class="<?=$this->containerClass?>" style="padding-bottom:<?=$this->aspectRatio?>%;"
data-min-width="<?=$this->minWidth;?>"
data-max-width="<?=$this->maxWidth;?>"
data-src="<?=$this->baseUrl;?>">
<noscript>
<?=$this->image($this->image, $this->altText, $this->imgAttributes)?>
</noscript>
</div>
<? if ($this->showImageCaption && !empty($this->image_caption)) { ?>
<div class="imageCaption" style="max-width:<?=$this->imageParam($this->image,'width','default');?>px;"><?=(!empty($this->image_caption) ? $this->image_caption : '');?></div>
<? } ?>
<?if ($this->hasContent($this->linkTag)) {?>
</a>
<?}?>
<? } ?>
</div> | 4 | 0.210526 | 2 | 2 |
8cc1e17e1e121c38d7b8376bce46360cffa4106e | _events/baby-dedication.html | _events/baby-dedication.html | ---
title: "Baby Dedication"
startDate: 2018-05-13
description: ""
---
<style>
.Event__Time {
margin-top: 50px;
}
.Event__Image {
max-width: 100%;
}
@media (min-width: 767px) {
.Event__Image {
max-width: 50%;
}
}
</style>
<!-- <img class="Event__Image" src="/assets/uploads/events/dessert.jpg" /> -->
{% include eventForm.html link="https://lifestonechurch.breezechms.com/form/82933e" height="2700" %}
| ---
title: "Baby Dedication"
startDate: 2018-05-13
description: ""
---
<style>
.Event__Time {
margin-top: 50px;
}
.Event__Image {
max-width: 100%;
}
@media (min-width: 767px) {
.Event__Image {
max-width: 50%;
}
}
</style>
<!-- <img class="Event__Image" src="/assets/uploads/events/dessert.jpg" /> -->
<p>During Baby Dedication, we will challenge you, the parents, to commit to teach your children to love Jesus more than anything else. We will also challenge our Lifestone Church family to commit to support you in this effort.</p>
<p>This celebration is for children 12 months of age or younger.</p>
{% include eventForm.html link="https://lifestonechurch.breezechms.com/form/82933e" height="2700" %}
| Revert "Remove baby dedication description" | Revert "Remove baby dedication description"
This reverts commit d1b11ee31fafebd0a2234e76e40c61220d7cd22c.
| HTML | mit | Mountainview-WebDesign/lifestonechurch,Mountainview-WebDesign/lifestonechurch,Mountainview-WebDesign/lifestonechurch | html | ## Code Before:
---
title: "Baby Dedication"
startDate: 2018-05-13
description: ""
---
<style>
.Event__Time {
margin-top: 50px;
}
.Event__Image {
max-width: 100%;
}
@media (min-width: 767px) {
.Event__Image {
max-width: 50%;
}
}
</style>
<!-- <img class="Event__Image" src="/assets/uploads/events/dessert.jpg" /> -->
{% include eventForm.html link="https://lifestonechurch.breezechms.com/form/82933e" height="2700" %}
## Instruction:
Revert "Remove baby dedication description"
This reverts commit d1b11ee31fafebd0a2234e76e40c61220d7cd22c.
## Code After:
---
title: "Baby Dedication"
startDate: 2018-05-13
description: ""
---
<style>
.Event__Time {
margin-top: 50px;
}
.Event__Image {
max-width: 100%;
}
@media (min-width: 767px) {
.Event__Image {
max-width: 50%;
}
}
</style>
<!-- <img class="Event__Image" src="/assets/uploads/events/dessert.jpg" /> -->
<p>During Baby Dedication, we will challenge you, the parents, to commit to teach your children to love Jesus more than anything else. We will also challenge our Lifestone Church family to commit to support you in this effort.</p>
<p>This celebration is for children 12 months of age or younger.</p>
{% include eventForm.html link="https://lifestonechurch.breezechms.com/form/82933e" height="2700" %}
| ---
title: "Baby Dedication"
startDate: 2018-05-13
description: ""
---
<style>
.Event__Time {
margin-top: 50px;
}
.Event__Image {
max-width: 100%;
}
@media (min-width: 767px) {
.Event__Image {
max-width: 50%;
}
}
</style>
<!-- <img class="Event__Image" src="/assets/uploads/events/dessert.jpg" /> -->
+ <p>During Baby Dedication, we will challenge you, the parents, to commit to teach your children to love Jesus more than anything else. We will also challenge our Lifestone Church family to commit to support you in this effort.</p>
+
+ <p>This celebration is for children 12 months of age or younger.</p>
+
{% include eventForm.html link="https://lifestonechurch.breezechms.com/form/82933e" height="2700" %} | 4 | 0.166667 | 4 | 0 |
a97df98128f1205fdcce30b31c89bb90946be71d | README.md | README.md |
Open source project management app.
## Deploy to Heroku
[](https://heroku.com/deploy?template=https://github.com/phawkinsltd/openhq)
## Deploy to your own servers
Coming soon.
## License
GPLv3
|
Open source project management app.
## Deploy to Heroku
To make using Open HQ as easy as possible we have optimised it for usage on Heroku with the 1 click deploy button, however for now we still require you to have a mailgun and amazon s3 account.
### Prerequisites
1. **File upload storage** - Sign up for [Amazon S3](https://aws.amazon.com) and have your S3 AWS access key ID, secret access key and S3 bucket name ready.
2. **Sending Email** - Sign up for [Mailgun](https://mailgun.com) and have your API key, mailgun domain and from address ready.
Once you have these setup click the magic deploy button, enter your details and get started with Open HQ!
[](https://heroku.com/deploy?template=https://github.com/phawkinsltd/openhq)
## Deploy to your own servers
Coming soon.
## License
GPLv3
| Add extra steps to readme | Add extra steps to readme
| Markdown | mit | openhq/openhq,openhq/openhq,openhq/openhq,openhq/openhq | markdown | ## Code Before:
Open source project management app.
## Deploy to Heroku
[](https://heroku.com/deploy?template=https://github.com/phawkinsltd/openhq)
## Deploy to your own servers
Coming soon.
## License
GPLv3
## Instruction:
Add extra steps to readme
## Code After:
Open source project management app.
## Deploy to Heroku
To make using Open HQ as easy as possible we have optimised it for usage on Heroku with the 1 click deploy button, however for now we still require you to have a mailgun and amazon s3 account.
### Prerequisites
1. **File upload storage** - Sign up for [Amazon S3](https://aws.amazon.com) and have your S3 AWS access key ID, secret access key and S3 bucket name ready.
2. **Sending Email** - Sign up for [Mailgun](https://mailgun.com) and have your API key, mailgun domain and from address ready.
Once you have these setup click the magic deploy button, enter your details and get started with Open HQ!
[](https://heroku.com/deploy?template=https://github.com/phawkinsltd/openhq)
## Deploy to your own servers
Coming soon.
## License
GPLv3
|
Open source project management app.
## Deploy to Heroku
+
+ To make using Open HQ as easy as possible we have optimised it for usage on Heroku with the 1 click deploy button, however for now we still require you to have a mailgun and amazon s3 account.
+
+ ### Prerequisites
+
+ 1. **File upload storage** - Sign up for [Amazon S3](https://aws.amazon.com) and have your S3 AWS access key ID, secret access key and S3 bucket name ready.
+ 2. **Sending Email** - Sign up for [Mailgun](https://mailgun.com) and have your API key, mailgun domain and from address ready.
+
+ Once you have these setup click the magic deploy button, enter your details and get started with Open HQ!
[](https://heroku.com/deploy?template=https://github.com/phawkinsltd/openhq)
## Deploy to your own servers
Coming soon.
## License
GPLv3 | 9 | 0.642857 | 9 | 0 |
049d8f68f5074be890c5b77cb07550b238279ef1 | lib/backburner/tasks.rb | lib/backburner/tasks.rb |
namespace :backburner do
# QUEUE=foo,bar,baz rake backburner:work
desc "Start backburner worker using default worker"
task :work => :environment do
queues = (ENV["QUEUE"] ? ENV["QUEUE"].split(',') : nil) rescue nil
Backburner.work queues
end
namespace :simple do
# QUEUE=foo,bar,baz rake backburner:simple:work
desc "Starts backburner worker using simple processing"
task :work => :environment do
queues = (ENV["QUEUE"] ? ENV["QUEUE"].split(',') : nil) rescue nil
Backburner.work queues, :worker => Backburner::Workers::Simple
end
end # simple
namespace :threads_on_fork do
# QUEUE=twitter:10:5000:5,parse_page,send_mail,verify_bithday THREADS=2 GARBAGE=1000 rake backburner:threads_on_fork:work
# twitter tube will have 10 threads, garbage after 5k executions and retry 5 times.
desc "Starts backburner worker using threads_on_fork processing"
task :work => :environment do
queues = (ENV["QUEUE"] ? ENV["QUEUE"].split(',') : nil) rescue nil
Backburner.work queues, :worker => Backburner::Workers::ThreadsOnFork
end
end # threads_on_fork
end |
namespace :backburner do
# QUEUE=foo,bar,baz rake backburner:work
desc "Start backburner worker using default worker"
task :work => :environment do
queues = (ENV["QUEUE"] ? ENV["QUEUE"].split(',') : nil) rescue nil
Backburner.work queues
end
namespace :simple do
# QUEUE=foo,bar,baz rake backburner:simple:work
desc "Starts backburner worker using simple processing"
task :work => :environment do
queues = (ENV["QUEUE"] ? ENV["QUEUE"].split(',') : nil) rescue nil
Backburner.work queues, :worker => Backburner::Workers::Simple
end
end # simple
namespace :threads_on_fork do
# QUEUE=twitter:10:5000:5,parse_page,send_mail,verify_bithday THREADS=2 GARBAGE=1000 rake backburner:threads_on_fork:work
# twitter tube will have 10 threads, garbage after 5k executions and retry 5 times.
desc "Starts backburner worker using threads_on_fork processing"
task :work => :environment do
queues = (ENV["QUEUE"] ? ENV["QUEUE"].split(',') : nil) rescue nil
threads = ENV['THREADS'].to_i
garbage = ENV['GARBAGE'].to_i
Backburner::Workers::ThreadsOnFork.threads_number = threads if threads > 0
Backburner::Workers::ThreadsOnFork.garbage_after = garbage if garbage > 0
Backburner.work queues, :worker => Backburner::Workers::ThreadsOnFork
end
end # threads_on_fork
end | Add support to THREADS and GARBAGE on threads_on_fork worker task | Add support to THREADS and GARBAGE on threads_on_fork worker task
| Ruby | mit | contentfree/backburner,bfolkens/backburner,nesquena/backburner,deepakshinde/backburner | ruby | ## Code Before:
namespace :backburner do
# QUEUE=foo,bar,baz rake backburner:work
desc "Start backburner worker using default worker"
task :work => :environment do
queues = (ENV["QUEUE"] ? ENV["QUEUE"].split(',') : nil) rescue nil
Backburner.work queues
end
namespace :simple do
# QUEUE=foo,bar,baz rake backburner:simple:work
desc "Starts backburner worker using simple processing"
task :work => :environment do
queues = (ENV["QUEUE"] ? ENV["QUEUE"].split(',') : nil) rescue nil
Backburner.work queues, :worker => Backburner::Workers::Simple
end
end # simple
namespace :threads_on_fork do
# QUEUE=twitter:10:5000:5,parse_page,send_mail,verify_bithday THREADS=2 GARBAGE=1000 rake backburner:threads_on_fork:work
# twitter tube will have 10 threads, garbage after 5k executions and retry 5 times.
desc "Starts backburner worker using threads_on_fork processing"
task :work => :environment do
queues = (ENV["QUEUE"] ? ENV["QUEUE"].split(',') : nil) rescue nil
Backburner.work queues, :worker => Backburner::Workers::ThreadsOnFork
end
end # threads_on_fork
end
## Instruction:
Add support to THREADS and GARBAGE on threads_on_fork worker task
## Code After:
namespace :backburner do
# QUEUE=foo,bar,baz rake backburner:work
desc "Start backburner worker using default worker"
task :work => :environment do
queues = (ENV["QUEUE"] ? ENV["QUEUE"].split(',') : nil) rescue nil
Backburner.work queues
end
namespace :simple do
# QUEUE=foo,bar,baz rake backburner:simple:work
desc "Starts backburner worker using simple processing"
task :work => :environment do
queues = (ENV["QUEUE"] ? ENV["QUEUE"].split(',') : nil) rescue nil
Backburner.work queues, :worker => Backburner::Workers::Simple
end
end # simple
namespace :threads_on_fork do
# QUEUE=twitter:10:5000:5,parse_page,send_mail,verify_bithday THREADS=2 GARBAGE=1000 rake backburner:threads_on_fork:work
# twitter tube will have 10 threads, garbage after 5k executions and retry 5 times.
desc "Starts backburner worker using threads_on_fork processing"
task :work => :environment do
queues = (ENV["QUEUE"] ? ENV["QUEUE"].split(',') : nil) rescue nil
threads = ENV['THREADS'].to_i
garbage = ENV['GARBAGE'].to_i
Backburner::Workers::ThreadsOnFork.threads_number = threads if threads > 0
Backburner::Workers::ThreadsOnFork.garbage_after = garbage if garbage > 0
Backburner.work queues, :worker => Backburner::Workers::ThreadsOnFork
end
end # threads_on_fork
end |
namespace :backburner do
# QUEUE=foo,bar,baz rake backburner:work
desc "Start backburner worker using default worker"
task :work => :environment do
queues = (ENV["QUEUE"] ? ENV["QUEUE"].split(',') : nil) rescue nil
Backburner.work queues
end
namespace :simple do
# QUEUE=foo,bar,baz rake backburner:simple:work
desc "Starts backburner worker using simple processing"
task :work => :environment do
queues = (ENV["QUEUE"] ? ENV["QUEUE"].split(',') : nil) rescue nil
Backburner.work queues, :worker => Backburner::Workers::Simple
end
end # simple
namespace :threads_on_fork do
# QUEUE=twitter:10:5000:5,parse_page,send_mail,verify_bithday THREADS=2 GARBAGE=1000 rake backburner:threads_on_fork:work
# twitter tube will have 10 threads, garbage after 5k executions and retry 5 times.
desc "Starts backburner worker using threads_on_fork processing"
task :work => :environment do
queues = (ENV["QUEUE"] ? ENV["QUEUE"].split(',') : nil) rescue nil
+ threads = ENV['THREADS'].to_i
+ garbage = ENV['GARBAGE'].to_i
+ Backburner::Workers::ThreadsOnFork.threads_number = threads if threads > 0
+ Backburner::Workers::ThreadsOnFork.garbage_after = garbage if garbage > 0
Backburner.work queues, :worker => Backburner::Workers::ThreadsOnFork
end
end # threads_on_fork
end | 4 | 0.142857 | 4 | 0 |
4e19bc38f62eecbad01e9e11aa2b516f7049e24e | gulpfile.js | gulpfile.js | const path = require('path');
const gulp = require('gulp');
const babel = require('gulp-babel');
const changed = require('gulp-changed');
const plumber = require('gulp-plumber');
const sourcemaps = require('gulp-sourcemaps');
const rimraf = require('rimraf');
const paths = {
source: 'src/**/*.js',
build: 'build',
sourceRoot: path.join(__dirname, 'src'),
builtFiles: 'build/**/*.{js,map}',
nextBuild: 'expo-cli/build',
};
const tasks = {
babel() {
return gulp
.src(paths.source)
.pipe(changed(paths.build))
.pipe(plumber())
.pipe(sourcemaps.init())
.pipe(babel())
.pipe(sourcemaps.write('__sourcemaps__', { sourceRoot: paths.sourceRoot }))
.pipe(gulp.dest(paths.build));
},
copy() {
return gulp.src(paths.builtFiles).pipe(gulp.dest(paths.nextBuild));
},
watchBabel(done) {
gulp.watch(paths.source, gulp.series([tasks.babel, tasks.copy]));
done();
},
};
gulp.task('build', gulp.series([tasks.babel, tasks.copy]));
gulp.task('watch', tasks.watchBabel);
gulp.task('clean', done => {
rimraf(paths.build, done);
});
gulp.task('default', gulp.series('watch'));
| const path = require('path');
const gulp = require('gulp');
const babel = require('gulp-babel');
const changed = require('gulp-changed');
const plumber = require('gulp-plumber');
const sourcemaps = require('gulp-sourcemaps');
const rimraf = require('rimraf');
const package = require('./package.json');
const paths = {
source: 'src/**/*.js',
build: 'build',
builtFiles: 'build/**/*.{js,map}',
nextBuild: 'expo-cli/build',
};
const tasks = {
babel() {
return gulp
.src(paths.source)
.pipe(changed(paths.build))
.pipe(plumber())
.pipe(sourcemaps.init())
.pipe(babel())
.pipe(
sourcemaps.write('__sourcemaps__', {
sourceRoot: `/${package.name}@${package.version}/src`,
})
)
.pipe(gulp.dest(paths.build));
},
copy() {
return gulp.src(paths.builtFiles).pipe(gulp.dest(paths.nextBuild));
},
watchBabel(done) {
gulp.watch(paths.source, gulp.series([tasks.babel, tasks.copy]));
done();
},
};
gulp.task('build', gulp.series([tasks.babel, tasks.copy]));
gulp.task('watch', tasks.watchBabel);
gulp.task('clean', done => {
rimraf(paths.build, done);
});
gulp.task('default', gulp.series('watch'));
| Set sourceRoot in source maps | Set sourceRoot in source maps
This removes the full source path of whoever last published the package
from the stacktraces we show when `EXPO_DEBUG` is enabled and instead
uses `exp@<version>` or `xdl@<version>` as the path.
fbshipit-source-id: a12977a
| JavaScript | mit | exponentjs/exp | javascript | ## Code Before:
const path = require('path');
const gulp = require('gulp');
const babel = require('gulp-babel');
const changed = require('gulp-changed');
const plumber = require('gulp-plumber');
const sourcemaps = require('gulp-sourcemaps');
const rimraf = require('rimraf');
const paths = {
source: 'src/**/*.js',
build: 'build',
sourceRoot: path.join(__dirname, 'src'),
builtFiles: 'build/**/*.{js,map}',
nextBuild: 'expo-cli/build',
};
const tasks = {
babel() {
return gulp
.src(paths.source)
.pipe(changed(paths.build))
.pipe(plumber())
.pipe(sourcemaps.init())
.pipe(babel())
.pipe(sourcemaps.write('__sourcemaps__', { sourceRoot: paths.sourceRoot }))
.pipe(gulp.dest(paths.build));
},
copy() {
return gulp.src(paths.builtFiles).pipe(gulp.dest(paths.nextBuild));
},
watchBabel(done) {
gulp.watch(paths.source, gulp.series([tasks.babel, tasks.copy]));
done();
},
};
gulp.task('build', gulp.series([tasks.babel, tasks.copy]));
gulp.task('watch', tasks.watchBabel);
gulp.task('clean', done => {
rimraf(paths.build, done);
});
gulp.task('default', gulp.series('watch'));
## Instruction:
Set sourceRoot in source maps
This removes the full source path of whoever last published the package
from the stacktraces we show when `EXPO_DEBUG` is enabled and instead
uses `exp@<version>` or `xdl@<version>` as the path.
fbshipit-source-id: a12977a
## Code After:
const path = require('path');
const gulp = require('gulp');
const babel = require('gulp-babel');
const changed = require('gulp-changed');
const plumber = require('gulp-plumber');
const sourcemaps = require('gulp-sourcemaps');
const rimraf = require('rimraf');
const package = require('./package.json');
const paths = {
source: 'src/**/*.js',
build: 'build',
builtFiles: 'build/**/*.{js,map}',
nextBuild: 'expo-cli/build',
};
const tasks = {
babel() {
return gulp
.src(paths.source)
.pipe(changed(paths.build))
.pipe(plumber())
.pipe(sourcemaps.init())
.pipe(babel())
.pipe(
sourcemaps.write('__sourcemaps__', {
sourceRoot: `/${package.name}@${package.version}/src`,
})
)
.pipe(gulp.dest(paths.build));
},
copy() {
return gulp.src(paths.builtFiles).pipe(gulp.dest(paths.nextBuild));
},
watchBabel(done) {
gulp.watch(paths.source, gulp.series([tasks.babel, tasks.copy]));
done();
},
};
gulp.task('build', gulp.series([tasks.babel, tasks.copy]));
gulp.task('watch', tasks.watchBabel);
gulp.task('clean', done => {
rimraf(paths.build, done);
});
gulp.task('default', gulp.series('watch'));
| const path = require('path');
const gulp = require('gulp');
const babel = require('gulp-babel');
const changed = require('gulp-changed');
const plumber = require('gulp-plumber');
const sourcemaps = require('gulp-sourcemaps');
const rimraf = require('rimraf');
+ const package = require('./package.json');
+
const paths = {
source: 'src/**/*.js',
build: 'build',
- sourceRoot: path.join(__dirname, 'src'),
builtFiles: 'build/**/*.{js,map}',
nextBuild: 'expo-cli/build',
};
const tasks = {
babel() {
return gulp
.src(paths.source)
.pipe(changed(paths.build))
.pipe(plumber())
.pipe(sourcemaps.init())
.pipe(babel())
- .pipe(sourcemaps.write('__sourcemaps__', { sourceRoot: paths.sourceRoot }))
+ .pipe(
+ sourcemaps.write('__sourcemaps__', {
+ sourceRoot: `/${package.name}@${package.version}/src`,
+ })
+ )
.pipe(gulp.dest(paths.build));
},
copy() {
return gulp.src(paths.builtFiles).pipe(gulp.dest(paths.nextBuild));
},
watchBabel(done) {
gulp.watch(paths.source, gulp.series([tasks.babel, tasks.copy]));
done();
},
};
gulp.task('build', gulp.series([tasks.babel, tasks.copy]));
gulp.task('watch', tasks.watchBabel);
gulp.task('clean', done => {
rimraf(paths.build, done);
});
gulp.task('default', gulp.series('watch')); | 9 | 0.2 | 7 | 2 |
f9c6f64e390cdc09ab8a3f9bb28923d6cd2b6af6 | src/@data/withHomeFeed/homeFeedQuery.js | src/@data/withHomeFeed/homeFeedQuery.js | import gql from 'graphql-tag';
const contentFragment = gql`
fragment ContentForFeed on Content {
entryId: id
title
channelName
status
meta {
siteId
date
channelId
}
parent {
entryId: id
content {
isLight
colors {
value
description
}
}
}
content {
isLiked
images(sizes: ["large"]) {
fileName
fileType
fileLabel
url
size
}
isLight
colors {
value
description
}
}
}
`;
export default gql`
query HomeFeed($filters: [String]!, $options: String!, $limit: Int!, $skip: Int!, $cache: Boolean!) {
feed: userFeed(filters: $filters, options: $options, limit: $limit, skip: $skip, cache: $cache) {
... on Content {
...ContentForFeed
parent {
...ContentForFeed
}
}
}
}
${contentFragment}
`;
| import gql from 'graphql-tag';
const contentFragment = gql`
fragment ContentForFeed on Content {
entryId: id
title
channelName
status
meta {
siteId
date
channelId
}
parent {
entryId: id
content {
isLight
colors {
value
description
}
}
}
content {
isLiked
images(sizes: ["large"]) {
fileName
fileType
fileLabel
url
size
}
isLight
colors {
value
description
}
}
}
`;
export default gql`
query HomeFeed($filters: [String]!, $limit: Int!, $skip: Int!, $cache: Boolean!) {
feed: userFeed(filters: $filters, limit: $limit, skip: $skip, cache: $cache) {
... on Content {
...ContentForFeed
parent {
...ContentForFeed
}
}
}
}
${contentFragment}
`;
| Remove $options from userFeed query | Remove $options from userFeed query
| JavaScript | mit | NewSpring/Apollos,NewSpring/Apollos,NewSpring/Apollos,NewSpring/Apollos,NewSpring/Apollos,NewSpring/Apollos | javascript | ## Code Before:
import gql from 'graphql-tag';
const contentFragment = gql`
fragment ContentForFeed on Content {
entryId: id
title
channelName
status
meta {
siteId
date
channelId
}
parent {
entryId: id
content {
isLight
colors {
value
description
}
}
}
content {
isLiked
images(sizes: ["large"]) {
fileName
fileType
fileLabel
url
size
}
isLight
colors {
value
description
}
}
}
`;
export default gql`
query HomeFeed($filters: [String]!, $options: String!, $limit: Int!, $skip: Int!, $cache: Boolean!) {
feed: userFeed(filters: $filters, options: $options, limit: $limit, skip: $skip, cache: $cache) {
... on Content {
...ContentForFeed
parent {
...ContentForFeed
}
}
}
}
${contentFragment}
`;
## Instruction:
Remove $options from userFeed query
## Code After:
import gql from 'graphql-tag';
const contentFragment = gql`
fragment ContentForFeed on Content {
entryId: id
title
channelName
status
meta {
siteId
date
channelId
}
parent {
entryId: id
content {
isLight
colors {
value
description
}
}
}
content {
isLiked
images(sizes: ["large"]) {
fileName
fileType
fileLabel
url
size
}
isLight
colors {
value
description
}
}
}
`;
export default gql`
query HomeFeed($filters: [String]!, $limit: Int!, $skip: Int!, $cache: Boolean!) {
feed: userFeed(filters: $filters, limit: $limit, skip: $skip, cache: $cache) {
... on Content {
...ContentForFeed
parent {
...ContentForFeed
}
}
}
}
${contentFragment}
`;
| import gql from 'graphql-tag';
const contentFragment = gql`
fragment ContentForFeed on Content {
entryId: id
title
channelName
status
meta {
siteId
date
channelId
}
parent {
entryId: id
content {
isLight
colors {
value
description
}
}
}
content {
isLiked
images(sizes: ["large"]) {
fileName
fileType
fileLabel
url
size
}
isLight
colors {
value
description
}
}
}
`;
export default gql`
- query HomeFeed($filters: [String]!, $options: String!, $limit: Int!, $skip: Int!, $cache: Boolean!) {
? -------------------
+ query HomeFeed($filters: [String]!, $limit: Int!, $skip: Int!, $cache: Boolean!) {
- feed: userFeed(filters: $filters, options: $options, limit: $limit, skip: $skip, cache: $cache) {
? -------------------
+ feed: userFeed(filters: $filters, limit: $limit, skip: $skip, cache: $cache) {
... on Content {
...ContentForFeed
parent {
...ContentForFeed
}
}
}
}
${contentFragment}
`; | 4 | 0.074074 | 2 | 2 |
62a604d3a4b48abb7d8e1c1b85b436974927c98e | update_from_git.sh | update_from_git.sh |
WEBDIR=/var/www/ritcraft.net/public_html
HOMEDIR=$HOME/websites/ritcraft.net
#####################################################
# Pull down the latest changes from GitHub #
#####################################################
cd $HOMEDIR && git pull
#####################################################
# Delete all known files in web server directory #
#####################################################
cd $WEBDIR && rm -r calendar/ css/ fonts/ images/ js/ reports/ favicon.ico index.* sitemap.xml.gz status.class.php template.html
#####################################################
# Copy the files from the git repo into virtualhost #
#####################################################
cd $HOMEDIR
cp -r calendar/ css/ fonts/ images/ js/ reports/ favicon.ico index.* sitemap.xml.gz status.class.php template.html $WEBDIR
|
WEBDIR=/var/www/ritcraft.net/public_html
HOMEDIR=$HOME/websites/ritcraft.net
#####################################################
# Pull down the latest changes from GitHub #
#####################################################
cd $HOMEDIR && git pull
#####################################################
# Delete all known files in web server directory #
#####################################################
rsync -rav $HOMEDIR/* $WEBDIR
| Use rsync. Why aren't we using rsync? Who wrote this script?! Who is responsible?!? …oh, yeah, right… | Use rsync. Why aren't we using rsync? Who wrote this script?! Who is responsible?!? …oh, yeah, right…
| Shell | apache-2.0 | RITcraft/ritcraft.net,RITcraft/RITcraft-Site,RITcraft/ritcraft.net,RITcraft/RITcraft-Site,RITcraft/RITcraft-Site,RITcraft/ritcraft.net | shell | ## Code Before:
WEBDIR=/var/www/ritcraft.net/public_html
HOMEDIR=$HOME/websites/ritcraft.net
#####################################################
# Pull down the latest changes from GitHub #
#####################################################
cd $HOMEDIR && git pull
#####################################################
# Delete all known files in web server directory #
#####################################################
cd $WEBDIR && rm -r calendar/ css/ fonts/ images/ js/ reports/ favicon.ico index.* sitemap.xml.gz status.class.php template.html
#####################################################
# Copy the files from the git repo into virtualhost #
#####################################################
cd $HOMEDIR
cp -r calendar/ css/ fonts/ images/ js/ reports/ favicon.ico index.* sitemap.xml.gz status.class.php template.html $WEBDIR
## Instruction:
Use rsync. Why aren't we using rsync? Who wrote this script?! Who is responsible?!? …oh, yeah, right…
## Code After:
WEBDIR=/var/www/ritcraft.net/public_html
HOMEDIR=$HOME/websites/ritcraft.net
#####################################################
# Pull down the latest changes from GitHub #
#####################################################
cd $HOMEDIR && git pull
#####################################################
# Delete all known files in web server directory #
#####################################################
rsync -rav $HOMEDIR/* $WEBDIR
|
WEBDIR=/var/www/ritcraft.net/public_html
HOMEDIR=$HOME/websites/ritcraft.net
#####################################################
# Pull down the latest changes from GitHub #
#####################################################
cd $HOMEDIR && git pull
#####################################################
# Delete all known files in web server directory #
#####################################################
+ rsync -rav $HOMEDIR/* $WEBDIR
- cd $WEBDIR && rm -r calendar/ css/ fonts/ images/ js/ reports/ favicon.ico index.* sitemap.xml.gz status.class.php template.html
-
- #####################################################
- # Copy the files from the git repo into virtualhost #
- #####################################################
- cd $HOMEDIR
- cp -r calendar/ css/ fonts/ images/ js/ reports/ favicon.ico index.* sitemap.xml.gz status.class.php template.html $WEBDIR | 8 | 0.421053 | 1 | 7 |
853675bfd045236d78cf7067b3623a6f271b64ea | .travis.yml | .travis.yml | sudo: false
# Blacklist
branches:
except:
- gh-pages
# Environment variables
env:
global:
- GH_REPO_NAME: TelegramBotPHP
- DOXYFILE: $TRAVIS_BUILD_DIR/Doxyfile
- GH_REPO_REF: github.com/Eleirbag89/TelegramBotPHP.git
# Install dependencies
addons:
apt:
packages:
- doxygen
- doxygen-doc
- doxygen-latex
- doxygen-gui
- graphviz
# Build your code e.g. by calling make
script:
- make
# Generate and deploy documentation
after_success:
- cd $TRAVIS_BUILD_DIR
- chmod +x generateDocumentationAndDeploy.sh
- ./generateDocumentationAndDeploy.sh
| sudo: false
# Blacklist
branches:
except:
- gh-pages
# Environment variables
env:
global:
- GH_REPO_NAME: TelegramBotPHP
- DOXYFILE: $TRAVIS_BUILD_DIR/Doxyfile
- GH_REPO_REF: github.com/Eleirbag89/TelegramBotPHP.git
# Install dependencies
addons:
apt:
packages:
- doxygen
- doxygen-doc
- doxygen-latex
- doxygen-gui
- graphviz
# Build your code e.g. by calling make
script:
- echo "Setup done"
# Generate and deploy documentation
after_success:
- cd $TRAVIS_BUILD_DIR
- chmod +x generateDocumentationAndDeploy.sh
- ./generateDocumentationAndDeploy.sh
| Test automatic documentation build using Travis 2 | Test automatic documentation build using Travis 2 | YAML | mit | Eleirbag89/TelegramBotPHP | yaml | ## Code Before:
sudo: false
# Blacklist
branches:
except:
- gh-pages
# Environment variables
env:
global:
- GH_REPO_NAME: TelegramBotPHP
- DOXYFILE: $TRAVIS_BUILD_DIR/Doxyfile
- GH_REPO_REF: github.com/Eleirbag89/TelegramBotPHP.git
# Install dependencies
addons:
apt:
packages:
- doxygen
- doxygen-doc
- doxygen-latex
- doxygen-gui
- graphviz
# Build your code e.g. by calling make
script:
- make
# Generate and deploy documentation
after_success:
- cd $TRAVIS_BUILD_DIR
- chmod +x generateDocumentationAndDeploy.sh
- ./generateDocumentationAndDeploy.sh
## Instruction:
Test automatic documentation build using Travis 2
## Code After:
sudo: false
# Blacklist
branches:
except:
- gh-pages
# Environment variables
env:
global:
- GH_REPO_NAME: TelegramBotPHP
- DOXYFILE: $TRAVIS_BUILD_DIR/Doxyfile
- GH_REPO_REF: github.com/Eleirbag89/TelegramBotPHP.git
# Install dependencies
addons:
apt:
packages:
- doxygen
- doxygen-doc
- doxygen-latex
- doxygen-gui
- graphviz
# Build your code e.g. by calling make
script:
- echo "Setup done"
# Generate and deploy documentation
after_success:
- cd $TRAVIS_BUILD_DIR
- chmod +x generateDocumentationAndDeploy.sh
- ./generateDocumentationAndDeploy.sh
| sudo: false
# Blacklist
branches:
except:
- gh-pages
# Environment variables
env:
global:
- GH_REPO_NAME: TelegramBotPHP
- DOXYFILE: $TRAVIS_BUILD_DIR/Doxyfile
- GH_REPO_REF: github.com/Eleirbag89/TelegramBotPHP.git
# Install dependencies
addons:
apt:
packages:
- doxygen
- doxygen-doc
- doxygen-latex
- doxygen-gui
- graphviz
# Build your code e.g. by calling make
script:
- - make
+ - echo "Setup done"
# Generate and deploy documentation
after_success:
- cd $TRAVIS_BUILD_DIR
- chmod +x generateDocumentationAndDeploy.sh
- ./generateDocumentationAndDeploy.sh | 2 | 0.060606 | 1 | 1 |
26c76d3eb9b210a7692ae4a0d255f4fb9ad0ca18 | src/components/MapContainer.js | src/components/MapContainer.js | import React from 'react'
import ReactDOM from 'react-dom'
class MapContainer extends React.Component {
render() {
return (
<div css={{
display: 'flex',
minHeight: '30em',
}}>
<iframe src="https://www.openstreetmap.org/export/embed.html?bbox=13.462725877761843%2C52.54733633046878%2C13.467746973037722%2C52.54960019277862&layer=hot&marker=52.548471504454746%2C13.46523642539978"
css={{
flex: 1,
margin: 0,
border: 0
}}
/>
</div>
)
}
}
export default MapContainer | import React from 'react'
import ReactDOM from 'react-dom'
class MapContainer extends React.Component {
render() {
return (
<div css={{
display: 'flex',
minHeight: '30em',
}}>
<iframe src="https://www.openstreetmap.org/export/embed.html?bbox=13.451471328735353%2C52.5439337932714%2C13.479065895080568%2C52.55298924386305&layer=hot&marker=52.548461752121476%2C13.465268611907959"
css={{
flex: 1,
margin: 0,
border: 0
}}
/>
</div>
)
}
}
export default MapContainer | Adjust zoom of open street map | Adjust zoom of open street map
| JavaScript | mit | benruehl/gatsby-kruemelkiste | javascript | ## Code Before:
import React from 'react'
import ReactDOM from 'react-dom'
class MapContainer extends React.Component {
render() {
return (
<div css={{
display: 'flex',
minHeight: '30em',
}}>
<iframe src="https://www.openstreetmap.org/export/embed.html?bbox=13.462725877761843%2C52.54733633046878%2C13.467746973037722%2C52.54960019277862&layer=hot&marker=52.548471504454746%2C13.46523642539978"
css={{
flex: 1,
margin: 0,
border: 0
}}
/>
</div>
)
}
}
export default MapContainer
## Instruction:
Adjust zoom of open street map
## Code After:
import React from 'react'
import ReactDOM from 'react-dom'
class MapContainer extends React.Component {
render() {
return (
<div css={{
display: 'flex',
minHeight: '30em',
}}>
<iframe src="https://www.openstreetmap.org/export/embed.html?bbox=13.451471328735353%2C52.5439337932714%2C13.479065895080568%2C52.55298924386305&layer=hot&marker=52.548461752121476%2C13.465268611907959"
css={{
flex: 1,
margin: 0,
border: 0
}}
/>
</div>
)
}
}
export default MapContainer | import React from 'react'
import ReactDOM from 'react-dom'
class MapContainer extends React.Component {
render() {
return (
<div css={{
display: 'flex',
minHeight: '30em',
}}>
- <iframe src="https://www.openstreetmap.org/export/embed.html?bbox=13.462725877761843%2C52.54733633046878%2C13.467746973037722%2C52.54960019277862&layer=hot&marker=52.548471504454746%2C13.46523642539978"
+ <iframe src="https://www.openstreetmap.org/export/embed.html?bbox=13.451471328735353%2C52.5439337932714%2C13.479065895080568%2C52.55298924386305&layer=hot&marker=52.548461752121476%2C13.465268611907959"
css={{
flex: 1,
margin: 0,
border: 0
}}
/>
</div>
)
}
}
export default MapContainer | 2 | 0.083333 | 1 | 1 |
d617d52b1764fdeb0d90c2b6be9e8d84eb6c153b | data/transition-sites/treasury_gfp.yml | data/transition-sites/treasury_gfp.yml | ---
site: treasury_gfp
whitehall_slug: hm-treasury
homepage: https://www.gov.uk/government/organisations/hm-treasury
tna_timestamp: 20140407135236
host: www.thegfp-treasury.org
homepage_furl: www.gov.uk/treasury
aliases:
- thegfp-treasury.org
options: --query-string newsid:eventid
| ---
site: treasury_gfp
whitehall_slug: hm-treasury
homepage: https://www.gov.uk/government/organisations/hm-treasury
tna_timestamp: 20140407135236
host: www.thegfp-treasury.org
homepage_furl: www.gov.uk/treasury
aliases:
- thegfp-treasury.org
- thegfp.treasury.gov.uk
options: --query-string newsid:eventid
| Add thegfp.treasury.gov.uk as an alias | Add thegfp.treasury.gov.uk as an alias | YAML | mit | alphagov/transition-config,alphagov/transition-config | yaml | ## Code Before:
---
site: treasury_gfp
whitehall_slug: hm-treasury
homepage: https://www.gov.uk/government/organisations/hm-treasury
tna_timestamp: 20140407135236
host: www.thegfp-treasury.org
homepage_furl: www.gov.uk/treasury
aliases:
- thegfp-treasury.org
options: --query-string newsid:eventid
## Instruction:
Add thegfp.treasury.gov.uk as an alias
## Code After:
---
site: treasury_gfp
whitehall_slug: hm-treasury
homepage: https://www.gov.uk/government/organisations/hm-treasury
tna_timestamp: 20140407135236
host: www.thegfp-treasury.org
homepage_furl: www.gov.uk/treasury
aliases:
- thegfp-treasury.org
- thegfp.treasury.gov.uk
options: --query-string newsid:eventid
| ---
site: treasury_gfp
whitehall_slug: hm-treasury
homepage: https://www.gov.uk/government/organisations/hm-treasury
tna_timestamp: 20140407135236
host: www.thegfp-treasury.org
homepage_furl: www.gov.uk/treasury
aliases:
- thegfp-treasury.org
+ - thegfp.treasury.gov.uk
options: --query-string newsid:eventid | 1 | 0.1 | 1 | 0 |
e9d52f86ab25db0a01dfe5e55c17484327855867 | .travis.yml | .travis.yml | language: ruby
rvm:
- 1.9.3
gemfile:
- Gemfile
- spec/support/gemfiles/Gemfile.chef11
before_script:
- ln -s chef-aria2 ../aria2
- cd spec/support/; librarian-chef install; cd ../..
| language: ruby
rvm:
- 1.9.3
gemfile:
- Gemfile
- spec/support/gemfiles/Gemfile.chef11
before_script:
- ln -s chef-aria2 ../aria2
- cd spec/support/; librarian-chef install; cd ../..
matrix:
allow_failures:
- gemfile: spec/support/gemfiles/Gemfile.chef11
| Allow Chef 11 to fail | Allow Chef 11 to fail
| YAML | apache-2.0 | cmur2/chef-aria2 | yaml | ## Code Before:
language: ruby
rvm:
- 1.9.3
gemfile:
- Gemfile
- spec/support/gemfiles/Gemfile.chef11
before_script:
- ln -s chef-aria2 ../aria2
- cd spec/support/; librarian-chef install; cd ../..
## Instruction:
Allow Chef 11 to fail
## Code After:
language: ruby
rvm:
- 1.9.3
gemfile:
- Gemfile
- spec/support/gemfiles/Gemfile.chef11
before_script:
- ln -s chef-aria2 ../aria2
- cd spec/support/; librarian-chef install; cd ../..
matrix:
allow_failures:
- gemfile: spec/support/gemfiles/Gemfile.chef11
| language: ruby
rvm:
- 1.9.3
gemfile:
- Gemfile
- spec/support/gemfiles/Gemfile.chef11
before_script:
- ln -s chef-aria2 ../aria2
- cd spec/support/; librarian-chef install; cd ../..
+
+ matrix:
+ allow_failures:
+ - gemfile: spec/support/gemfiles/Gemfile.chef11 | 4 | 0.333333 | 4 | 0 |
011d03723bfb28a0098f036d0e9cbdfa8765623c | doc/source/dev/faq.rst | doc/source/dev/faq.rst | .. _faq:
==========================================
Developer FAQ (frequently asked questions)
==========================================
Here are some answers to frequently-asked questions from IRC and
elsewhere.
.. contents::
:local:
:depth: 2
How do I…
=========
…create a migration script template?
------------------------------------
Using the ``alembic revision`` command, e.g::
$ cd ironic/ironic/db/sqlalchemy
$ alembic revision -m "create foo table"
For more information see the `alembic documentation`_.
.. _`alembic documentation`: https://alembic.readthedocs.org/en/latest/tutorial.html#create-a-migration-script
| .. _faq:
==========================================
Developer FAQ (frequently asked questions)
==========================================
Here are some answers to frequently-asked questions from IRC and
elsewhere.
.. contents::
:local:
:depth: 2
How do I...
===========
...create a migration script template?
--------------------------------------
Using the ``alembic revision`` command, e.g::
$ cd ironic/ironic/db/sqlalchemy
$ alembic revision -m "create foo table"
For more information see the `alembic documentation`_.
.. _`alembic documentation`: https://alembic.readthedocs.org/en/latest/tutorial.html#create-a-migration-script
...create a new release note?
-----------------------------
By running ``reno`` command via tox, e.g::
$ tox -e venv -- reno new version-foo
venv create: /home/foo/ironic/.tox/venv
venv installdeps: -r/home/foo/ironic/test-requirements.txt
venv develop-inst: /home/foo/ironic
venv runtests: PYTHONHASHSEED='0'
venv runtests: commands[0] | reno new version-foo
Created new notes file in releasenotes/notes/version-foo-ecb3875dc1cbf6d9.yaml
venv: commands succeeded
congratulations :)
$ git status
On branch test
Untracked files:
(use "git add <file>..." to include in what will be committed)
releasenotes/notes/version-foo-ecb3875dc1cbf6d9.yaml
Then edit the result file.
For more information see the `reno documentation`_.
.. _`reno documentation`: http://docs.openstack.org/developer/reno/usage.html#creating-new-release-notes
| Extend FAQ with answer of how to create a new release note | Extend FAQ with answer of how to create a new release note
The question was raised in the #openstack-ironic IRC channel
Change-Id: I7d72adc96d606e6062930fe3c9e653ba369e621b
| reStructuredText | apache-2.0 | pshchelo/ironic,devananda/ironic,openstack/ironic,NaohiroTamura/ironic,openstack/ironic,SauloAislan/ironic,dims/ironic,SauloAislan/ironic,dims/ironic,ionutbalutoiu/ironic,ionutbalutoiu/ironic,bacaldwell/ironic,NaohiroTamura/ironic,bacaldwell/ironic,pshchelo/ironic | restructuredtext | ## Code Before:
.. _faq:
==========================================
Developer FAQ (frequently asked questions)
==========================================
Here are some answers to frequently-asked questions from IRC and
elsewhere.
.. contents::
:local:
:depth: 2
How do I…
=========
…create a migration script template?
------------------------------------
Using the ``alembic revision`` command, e.g::
$ cd ironic/ironic/db/sqlalchemy
$ alembic revision -m "create foo table"
For more information see the `alembic documentation`_.
.. _`alembic documentation`: https://alembic.readthedocs.org/en/latest/tutorial.html#create-a-migration-script
## Instruction:
Extend FAQ with answer of how to create a new release note
The question was raised in the #openstack-ironic IRC channel
Change-Id: I7d72adc96d606e6062930fe3c9e653ba369e621b
## Code After:
.. _faq:
==========================================
Developer FAQ (frequently asked questions)
==========================================
Here are some answers to frequently-asked questions from IRC and
elsewhere.
.. contents::
:local:
:depth: 2
How do I...
===========
...create a migration script template?
--------------------------------------
Using the ``alembic revision`` command, e.g::
$ cd ironic/ironic/db/sqlalchemy
$ alembic revision -m "create foo table"
For more information see the `alembic documentation`_.
.. _`alembic documentation`: https://alembic.readthedocs.org/en/latest/tutorial.html#create-a-migration-script
...create a new release note?
-----------------------------
By running ``reno`` command via tox, e.g::
$ tox -e venv -- reno new version-foo
venv create: /home/foo/ironic/.tox/venv
venv installdeps: -r/home/foo/ironic/test-requirements.txt
venv develop-inst: /home/foo/ironic
venv runtests: PYTHONHASHSEED='0'
venv runtests: commands[0] | reno new version-foo
Created new notes file in releasenotes/notes/version-foo-ecb3875dc1cbf6d9.yaml
venv: commands succeeded
congratulations :)
$ git status
On branch test
Untracked files:
(use "git add <file>..." to include in what will be committed)
releasenotes/notes/version-foo-ecb3875dc1cbf6d9.yaml
Then edit the result file.
For more information see the `reno documentation`_.
.. _`reno documentation`: http://docs.openstack.org/developer/reno/usage.html#creating-new-release-notes
| .. _faq:
==========================================
Developer FAQ (frequently asked questions)
==========================================
Here are some answers to frequently-asked questions from IRC and
elsewhere.
.. contents::
:local:
:depth: 2
- How do I…
? ^
+ How do I...
? ^^^
- =========
+ ===========
? ++
- …create a migration script template?
? ^
+ ...create a migration script template?
? ^^^
- ------------------------------------
+ --------------------------------------
? ++
Using the ``alembic revision`` command, e.g::
$ cd ironic/ironic/db/sqlalchemy
$ alembic revision -m "create foo table"
For more information see the `alembic documentation`_.
.. _`alembic documentation`: https://alembic.readthedocs.org/en/latest/tutorial.html#create-a-migration-script
+
+ ...create a new release note?
+ -----------------------------
+
+ By running ``reno`` command via tox, e.g::
+
+ $ tox -e venv -- reno new version-foo
+ venv create: /home/foo/ironic/.tox/venv
+ venv installdeps: -r/home/foo/ironic/test-requirements.txt
+ venv develop-inst: /home/foo/ironic
+ venv runtests: PYTHONHASHSEED='0'
+ venv runtests: commands[0] | reno new version-foo
+ Created new notes file in releasenotes/notes/version-foo-ecb3875dc1cbf6d9.yaml
+ venv: commands succeeded
+ congratulations :)
+
+ $ git status
+ On branch test
+ Untracked files:
+ (use "git add <file>..." to include in what will be committed)
+
+ releasenotes/notes/version-foo-ecb3875dc1cbf6d9.yaml
+
+ Then edit the result file.
+
+ For more information see the `reno documentation`_.
+
+ .. _`reno documentation`: http://docs.openstack.org/developer/reno/usage.html#creating-new-release-notes | 36 | 1.285714 | 32 | 4 |
ee1f2920d0316da3a5f397d43af408236526fd89 | templates/legislators/_geo_legislator_display.html | templates/legislators/_geo_legislator_display.html | <div class="col-md-6">
<p><strong>Your senator is:</strong></p>
<p><a href="{{ address_senator.url }}">{{ address_senator.name }}</a></p>
<a href="{{ address_senator.url }}"><img src="{{ address_senator.image }}" class="legislator-image"></a>
<input type="hidden" name="senator" value="{{ address_senator.id }}">
</div>
<div class="col-md-6">
<p><strong>Your representative is:</strong></p>
<p><a href="{{ address_representative.url }}">{{ address_representative.name }}</a></p>
<a href="{{ address_representative.url }}"><img src=" {{ address_representative.image }}" class="legislator-image"></a>
<input type="hidden" name="representative" value="{{ address_representative.id }}">
</div>
| <div class="col-md-6">
<p><strong>Your senator is:</strong></p>
<p><a href="{% url 'legislator_detail' address_senator.id %}">{{ address_senator.name }}</p>
<img src="{{ address_senator.image }}" class="legislator-image"></a>
<input type="hidden" name="senator" value="{{ address_senator.id }}">
</div>
<div class="col-md-6">
<p><strong>Your representative is:</strong></p>
<p><a href="{% url 'legislator_detail' address_representative.id %}">{{ address_representative.name }}</p>
<img src=" {{ address_representative.image }}" class="legislator-image"></a>
<input type="hidden" name="representative" value="{{ address_representative.id }}">
</div>
| Make homepage legislators go to tot detail page | Make homepage legislators go to tot detail page
| HTML | mit | jamesturk/tot,jamesturk/tot,jamesturk/tot,jamesturk/tot,jamesturk/tot | html | ## Code Before:
<div class="col-md-6">
<p><strong>Your senator is:</strong></p>
<p><a href="{{ address_senator.url }}">{{ address_senator.name }}</a></p>
<a href="{{ address_senator.url }}"><img src="{{ address_senator.image }}" class="legislator-image"></a>
<input type="hidden" name="senator" value="{{ address_senator.id }}">
</div>
<div class="col-md-6">
<p><strong>Your representative is:</strong></p>
<p><a href="{{ address_representative.url }}">{{ address_representative.name }}</a></p>
<a href="{{ address_representative.url }}"><img src=" {{ address_representative.image }}" class="legislator-image"></a>
<input type="hidden" name="representative" value="{{ address_representative.id }}">
</div>
## Instruction:
Make homepage legislators go to tot detail page
## Code After:
<div class="col-md-6">
<p><strong>Your senator is:</strong></p>
<p><a href="{% url 'legislator_detail' address_senator.id %}">{{ address_senator.name }}</p>
<img src="{{ address_senator.image }}" class="legislator-image"></a>
<input type="hidden" name="senator" value="{{ address_senator.id }}">
</div>
<div class="col-md-6">
<p><strong>Your representative is:</strong></p>
<p><a href="{% url 'legislator_detail' address_representative.id %}">{{ address_representative.name }}</p>
<img src=" {{ address_representative.image }}" class="legislator-image"></a>
<input type="hidden" name="representative" value="{{ address_representative.id }}">
</div>
| <div class="col-md-6">
<p><strong>Your senator is:</strong></p>
- <p><a href="{{ address_senator.url }}">{{ address_senator.name }}</a></p>
? ^ ^^^ ^ ----
+ <p><a href="{% url 'legislator_detail' address_senator.id %}">{{ address_senator.name }}</p>
? ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^
- <a href="{{ address_senator.url }}"><img src="{{ address_senator.image }}" class="legislator-image"></a>
? ------------------------------------
+ <img src="{{ address_senator.image }}" class="legislator-image"></a>
<input type="hidden" name="senator" value="{{ address_senator.id }}">
</div>
<div class="col-md-6">
<p><strong>Your representative is:</strong></p>
- <p><a href="{{ address_representative.url }}">{{ address_representative.name }}</a></p>
? ^ ^^^ ^ ----
+ <p><a href="{% url 'legislator_detail' address_representative.id %}">{{ address_representative.name }}</p>
? ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^
- <a href="{{ address_representative.url }}"><img src=" {{ address_representative.image }}" class="legislator-image"></a>
? -------------------------------------------
+ <img src=" {{ address_representative.image }}" class="legislator-image"></a>
<input type="hidden" name="representative" value="{{ address_representative.id }}">
</div> | 8 | 0.615385 | 4 | 4 |
9dbd1c3779be31e53ecc9504008aaa85dfa59f3e | test/cases/markdown/expected.html | test/cases/markdown/expected.html | <!-- test/cases/markdown/a.md -->
<h1>Markdown</h1>
<p><strong>kicks</strong></p>
<p><code>ass</code></p>
| <!-- test/cases/markdown/a.md -->
<h1 id="markdown">Markdown</h1>
<p><strong>kicks</strong></p>
<p><code>ass</code></p>
| Fix broken test for new markdown parser | Fix broken test for new markdown parser
| HTML | mit | caseywebdev/cogs,caseywebdev/cogs | html | ## Code Before:
<!-- test/cases/markdown/a.md -->
<h1>Markdown</h1>
<p><strong>kicks</strong></p>
<p><code>ass</code></p>
## Instruction:
Fix broken test for new markdown parser
## Code After:
<!-- test/cases/markdown/a.md -->
<h1 id="markdown">Markdown</h1>
<p><strong>kicks</strong></p>
<p><code>ass</code></p>
| <!-- test/cases/markdown/a.md -->
- <h1>Markdown</h1>
+ <h1 id="markdown">Markdown</h1>
<p><strong>kicks</strong></p>
<p><code>ass</code></p> | 2 | 0.5 | 1 | 1 |
394a1346f10c383eec1378bc2b349ae4e2fa8367 | app/components/filterableNoteTable.component.js | app/components/filterableNoteTable.component.js | import React from 'react';
import SearchBar from './searchbar.component'
import NoteTable from './noteTable.component'
//combines note table and searchbar
class FilterableNoteTable extends React.Component {
constructor(props) {
super(props);
this.state = {
filterText: ''
};
this.handleSearchInput = this.handleSearchInput.bind(this);
}
handleSearchInput(filterText) {
this.setState({
filterText: filterText
});
}
render() {
//Filter notes by filterText
var filtered = this.props.notes.filter( (note) => {
if(note.name.toLowerCase().indexOf(this.state.filterText.toLowerCase()) === -1)
return false;
else
return true;
});
return (
<div className="filterableNoteTable">
<SearchBar filterText={this.state.filterText} onUserInput={this.handleSearchInput}/>
<NoteTable
notes={filtered}
onSelectNote={this.props.onSelectNote}
selectedNote={this.props.selectedNote}
/>
</div>
)
}
}
export default FilterableNoteTable | import React from 'react';
import SearchBar from './searchbar.component'
import NoteTable from './noteTable.component'
//combines note table and searchbar
class FilterableNoteTable extends React.Component {
constructor(props) {
super(props);
this.state = {
filterText: ''
};
this.handleSearchInput = this.handleSearchInput.bind(this);
}
handleSearchInput(filterText) {
this.setState({
filterText: filterText
});
}
render() {
//Filter notes by filterText
var filtered = this.props.notes.filter( (note) => {
if(note.name && note.name.toLowerCase().indexOf(this.state.filterText.toLowerCase()) === -1)
return false;
else
return true;
});
return (
<div className="filterableNoteTable">
<SearchBar filterText={this.state.filterText} onUserInput={this.handleSearchInput}/>
<NoteTable
notes={filtered}
onSelectNote={this.props.onSelectNote}
selectedNote={this.props.selectedNote}
/>
</div>
)
}
}
export default FilterableNoteTable | Check that note has name property before equivalency check. | Check that note has name property before equivalency check.
| JavaScript | cc0-1.0 | bigredwill/notational-markdown,bigredwill/notational-markdown | javascript | ## Code Before:
import React from 'react';
import SearchBar from './searchbar.component'
import NoteTable from './noteTable.component'
//combines note table and searchbar
class FilterableNoteTable extends React.Component {
constructor(props) {
super(props);
this.state = {
filterText: ''
};
this.handleSearchInput = this.handleSearchInput.bind(this);
}
handleSearchInput(filterText) {
this.setState({
filterText: filterText
});
}
render() {
//Filter notes by filterText
var filtered = this.props.notes.filter( (note) => {
if(note.name.toLowerCase().indexOf(this.state.filterText.toLowerCase()) === -1)
return false;
else
return true;
});
return (
<div className="filterableNoteTable">
<SearchBar filterText={this.state.filterText} onUserInput={this.handleSearchInput}/>
<NoteTable
notes={filtered}
onSelectNote={this.props.onSelectNote}
selectedNote={this.props.selectedNote}
/>
</div>
)
}
}
export default FilterableNoteTable
## Instruction:
Check that note has name property before equivalency check.
## Code After:
import React from 'react';
import SearchBar from './searchbar.component'
import NoteTable from './noteTable.component'
//combines note table and searchbar
class FilterableNoteTable extends React.Component {
constructor(props) {
super(props);
this.state = {
filterText: ''
};
this.handleSearchInput = this.handleSearchInput.bind(this);
}
handleSearchInput(filterText) {
this.setState({
filterText: filterText
});
}
render() {
//Filter notes by filterText
var filtered = this.props.notes.filter( (note) => {
if(note.name && note.name.toLowerCase().indexOf(this.state.filterText.toLowerCase()) === -1)
return false;
else
return true;
});
return (
<div className="filterableNoteTable">
<SearchBar filterText={this.state.filterText} onUserInput={this.handleSearchInput}/>
<NoteTable
notes={filtered}
onSelectNote={this.props.onSelectNote}
selectedNote={this.props.selectedNote}
/>
</div>
)
}
}
export default FilterableNoteTable | import React from 'react';
import SearchBar from './searchbar.component'
import NoteTable from './noteTable.component'
//combines note table and searchbar
class FilterableNoteTable extends React.Component {
constructor(props) {
super(props);
this.state = {
filterText: ''
};
this.handleSearchInput = this.handleSearchInput.bind(this);
}
handleSearchInput(filterText) {
this.setState({
filterText: filterText
});
}
render() {
//Filter notes by filterText
var filtered = this.props.notes.filter( (note) => {
- if(note.name.toLowerCase().indexOf(this.state.filterText.toLowerCase()) === -1)
+ if(note.name && note.name.toLowerCase().indexOf(this.state.filterText.toLowerCase()) === -1)
? +++++++++++++
return false;
else
return true;
});
return (
<div className="filterableNoteTable">
<SearchBar filterText={this.state.filterText} onUserInput={this.handleSearchInput}/>
<NoteTable
notes={filtered}
onSelectNote={this.props.onSelectNote}
selectedNote={this.props.selectedNote}
/>
</div>
)
}
}
export default FilterableNoteTable | 2 | 0.044444 | 1 | 1 |
d943870fcd5a844bc7cf3acca046a50899fad0e9 | test/bench/client_integration/write_batch.rb | test/bench/client_integration/write_batch.rb | require_relative 'client_integration_init'
context "Write Batch of Events" do
message = EventStore::Messaging::Controls::Message.example
stream_name = EventStore::Messaging::Controls::StreamName.get 'testBatch'
path = "/streams/#{stream_name}"
writer = EventStore::Client::HTTP::EventWriter.build
token_1 = Controls::ID.get 1
token_2 = Controls::ID.get 2
message_1 = EventStore::Messaging::Controls::Message.example
message_2 = EventStore::Messaging::Controls::Message.example
message_1.some_attribute = token_1
message_2.some_attribute = token_2
writer = EventStore::Messaging::Writer.build
writer.write [message_1, message_2], stream_name
get = EventStore::Client::HTTP::Request::Get.build
body_text_1, get_response = get.("#{path}/0")
body_text_2, get_response = get.("#{path}/1")
read_data_1 = EventStore::Client::HTTP::EventData::Read.parse body_text_1
read_data_2 = EventStore::Client::HTTP::EventData::Read.parse body_text_2
2.times do |i|
i += 1
event_data = eval("read_data_#{i}")
test "Individual events are written" do
assert(event_data.data['some_attribute'] == eval("token_#{i}"))
end
end
end
| require_relative 'client_integration_init'
context "Write Batch of Events" do
message = EventStore::Messaging::Controls::Message.example
stream_name = EventStore::Messaging::Controls::StreamName.get 'testBatch'
path = "/streams/#{stream_name}"
writer = EventStore::Client::HTTP::EventWriter.build
token_1 = Controls::ID.get 1
token_2 = Controls::ID.get 2
message_1 = EventStore::Messaging::Controls::Message.example
message_2 = EventStore::Messaging::Controls::Message.example
message_1.some_attribute = token_1
message_2.some_attribute = token_2
writer = EventStore::Messaging::Writer.build
writer.write [message_1, message_2], stream_name
get = EventStore::Client::HTTP::Request::Get.build
body_text_1, get_response = get.("#{path}/0")
body_text_2, get_response = get.("#{path}/1")
read_data_1 = EventStore::Client::HTTP::EventData::Read.parse body_text_1
read_data_2 = EventStore::Client::HTTP::EventData::Read.parse body_text_2
2.times do |i|
i += 1
event_data = binding.local_variable_get "read_data_#{i}"
test "Individual events are written" do
control_attribute = binding.local_variable_get "token_#{i}"
assert event_data.data[:some_attribute] == control_attribute
end
end
end
| Update tests to expect event data with Symbol keys | Update tests to expect event data with Symbol keys
| Ruby | mit | obsidian-btc/event-store-messaging,obsidian-btc/event-store-messaging | ruby | ## Code Before:
require_relative 'client_integration_init'
context "Write Batch of Events" do
message = EventStore::Messaging::Controls::Message.example
stream_name = EventStore::Messaging::Controls::StreamName.get 'testBatch'
path = "/streams/#{stream_name}"
writer = EventStore::Client::HTTP::EventWriter.build
token_1 = Controls::ID.get 1
token_2 = Controls::ID.get 2
message_1 = EventStore::Messaging::Controls::Message.example
message_2 = EventStore::Messaging::Controls::Message.example
message_1.some_attribute = token_1
message_2.some_attribute = token_2
writer = EventStore::Messaging::Writer.build
writer.write [message_1, message_2], stream_name
get = EventStore::Client::HTTP::Request::Get.build
body_text_1, get_response = get.("#{path}/0")
body_text_2, get_response = get.("#{path}/1")
read_data_1 = EventStore::Client::HTTP::EventData::Read.parse body_text_1
read_data_2 = EventStore::Client::HTTP::EventData::Read.parse body_text_2
2.times do |i|
i += 1
event_data = eval("read_data_#{i}")
test "Individual events are written" do
assert(event_data.data['some_attribute'] == eval("token_#{i}"))
end
end
end
## Instruction:
Update tests to expect event data with Symbol keys
## Code After:
require_relative 'client_integration_init'
context "Write Batch of Events" do
message = EventStore::Messaging::Controls::Message.example
stream_name = EventStore::Messaging::Controls::StreamName.get 'testBatch'
path = "/streams/#{stream_name}"
writer = EventStore::Client::HTTP::EventWriter.build
token_1 = Controls::ID.get 1
token_2 = Controls::ID.get 2
message_1 = EventStore::Messaging::Controls::Message.example
message_2 = EventStore::Messaging::Controls::Message.example
message_1.some_attribute = token_1
message_2.some_attribute = token_2
writer = EventStore::Messaging::Writer.build
writer.write [message_1, message_2], stream_name
get = EventStore::Client::HTTP::Request::Get.build
body_text_1, get_response = get.("#{path}/0")
body_text_2, get_response = get.("#{path}/1")
read_data_1 = EventStore::Client::HTTP::EventData::Read.parse body_text_1
read_data_2 = EventStore::Client::HTTP::EventData::Read.parse body_text_2
2.times do |i|
i += 1
event_data = binding.local_variable_get "read_data_#{i}"
test "Individual events are written" do
control_attribute = binding.local_variable_get "token_#{i}"
assert event_data.data[:some_attribute] == control_attribute
end
end
end
| require_relative 'client_integration_init'
context "Write Batch of Events" do
message = EventStore::Messaging::Controls::Message.example
stream_name = EventStore::Messaging::Controls::StreamName.get 'testBatch'
path = "/streams/#{stream_name}"
writer = EventStore::Client::HTTP::EventWriter.build
token_1 = Controls::ID.get 1
token_2 = Controls::ID.get 2
message_1 = EventStore::Messaging::Controls::Message.example
message_2 = EventStore::Messaging::Controls::Message.example
message_1.some_attribute = token_1
message_2.some_attribute = token_2
writer = EventStore::Messaging::Writer.build
writer.write [message_1, message_2], stream_name
get = EventStore::Client::HTTP::Request::Get.build
body_text_1, get_response = get.("#{path}/0")
body_text_2, get_response = get.("#{path}/1")
read_data_1 = EventStore::Client::HTTP::EventData::Read.parse body_text_1
read_data_2 = EventStore::Client::HTTP::EventData::Read.parse body_text_2
2.times do |i|
i += 1
- event_data = eval("read_data_#{i}")
+ event_data = binding.local_variable_get "read_data_#{i}"
test "Individual events are written" do
- assert(event_data.data['some_attribute'] == eval("token_#{i}"))
+ control_attribute = binding.local_variable_get "token_#{i}"
+
+ assert event_data.data[:some_attribute] == control_attribute
end
end
end | 6 | 0.153846 | 4 | 2 |
8631a456826431c28495f73fda535606ba9ea8f4 | app/controllers/tags_controller.rb | app/controllers/tags_controller.rb | class TagsController < ContentController
before_action :auto_discovery_feed, only: [:show, :index]
layout :theme_layout
def index
@tags = Tag.page(params[:page]).per(100)
@page_title = controller_name.capitalize
@keywords = ''
@description = "#{self.class.to_s.sub(/Controller$/, '')} for #{this_blog.blog_name}"
end
def show
@tag = Tag.find_by!(name: params[:id])
@page_title = this_blog.tag_title_template.to_title(@tag, this_blog, params)
@description = @tag.description.to_s
@articles = @tag.
articles.includes(:blog, :user, :tags, :resources, :text_filter).
published.page(params[:page]).per(10)
respond_to do |format|
format.html do
if @articles.empty?
raise ActiveRecord::RecordNotFound
else
@keywords = this_blog.meta_keywords
render template_name(params[:id])
end
end
format.atom do
@articles = @articles[0, this_blog.limit_rss_display]
render 'articles/index_atom_feed', layout: false
end
format.rss do
@articles = @articles[0, this_blog.limit_rss_display]
render 'articles/index_rss_feed', layout: false
end
end
end
private
def template_name(value)
template_exists?("tags/#{value}") ? value : :show
end
end
| class TagsController < ContentController
before_action :auto_discovery_feed, only: [:show, :index]
layout :theme_layout
def index
@tags = Tag.page(params[:page]).per(100)
@page_title = controller_name.capitalize
@keywords = ''
@description = "Tags for #{this_blog.blog_name}"
end
def show
@tag = Tag.find_by!(name: params[:id])
@page_title = this_blog.tag_title_template.to_title(@tag, this_blog, params)
@description = @tag.description.to_s
@articles = @tag.
articles.includes(:blog, :user, :tags, :resources, :text_filter).
published.page(params[:page]).per(10)
respond_to do |format|
format.html do
if @articles.empty?
raise ActiveRecord::RecordNotFound
else
@keywords = this_blog.meta_keywords
render template_name(params[:id])
end
end
format.atom do
@articles = @articles[0, this_blog.limit_rss_display]
render 'articles/index_atom_feed', layout: false
end
format.rss do
@articles = @articles[0, this_blog.limit_rss_display]
render 'articles/index_rss_feed', layout: false
end
end
end
private
def template_name(value)
template_exists?("tags/#{value}") ? value : :show
end
end
| Remove old grouping code in favor of hardcoded description | Remove old grouping code in favor of hardcoded description
| Ruby | mit | publify/publify_core,publify/publify_core,publify/publify_core | ruby | ## Code Before:
class TagsController < ContentController
before_action :auto_discovery_feed, only: [:show, :index]
layout :theme_layout
def index
@tags = Tag.page(params[:page]).per(100)
@page_title = controller_name.capitalize
@keywords = ''
@description = "#{self.class.to_s.sub(/Controller$/, '')} for #{this_blog.blog_name}"
end
def show
@tag = Tag.find_by!(name: params[:id])
@page_title = this_blog.tag_title_template.to_title(@tag, this_blog, params)
@description = @tag.description.to_s
@articles = @tag.
articles.includes(:blog, :user, :tags, :resources, :text_filter).
published.page(params[:page]).per(10)
respond_to do |format|
format.html do
if @articles.empty?
raise ActiveRecord::RecordNotFound
else
@keywords = this_blog.meta_keywords
render template_name(params[:id])
end
end
format.atom do
@articles = @articles[0, this_blog.limit_rss_display]
render 'articles/index_atom_feed', layout: false
end
format.rss do
@articles = @articles[0, this_blog.limit_rss_display]
render 'articles/index_rss_feed', layout: false
end
end
end
private
def template_name(value)
template_exists?("tags/#{value}") ? value : :show
end
end
## Instruction:
Remove old grouping code in favor of hardcoded description
## Code After:
class TagsController < ContentController
before_action :auto_discovery_feed, only: [:show, :index]
layout :theme_layout
def index
@tags = Tag.page(params[:page]).per(100)
@page_title = controller_name.capitalize
@keywords = ''
@description = "Tags for #{this_blog.blog_name}"
end
def show
@tag = Tag.find_by!(name: params[:id])
@page_title = this_blog.tag_title_template.to_title(@tag, this_blog, params)
@description = @tag.description.to_s
@articles = @tag.
articles.includes(:blog, :user, :tags, :resources, :text_filter).
published.page(params[:page]).per(10)
respond_to do |format|
format.html do
if @articles.empty?
raise ActiveRecord::RecordNotFound
else
@keywords = this_blog.meta_keywords
render template_name(params[:id])
end
end
format.atom do
@articles = @articles[0, this_blog.limit_rss_display]
render 'articles/index_atom_feed', layout: false
end
format.rss do
@articles = @articles[0, this_blog.limit_rss_display]
render 'articles/index_rss_feed', layout: false
end
end
end
private
def template_name(value)
template_exists?("tags/#{value}") ? value : :show
end
end
| class TagsController < ContentController
before_action :auto_discovery_feed, only: [:show, :index]
layout :theme_layout
def index
@tags = Tag.page(params[:page]).per(100)
@page_title = controller_name.capitalize
@keywords = ''
- @description = "#{self.class.to_s.sub(/Controller$/, '')} for #{this_blog.blog_name}"
+ @description = "Tags for #{this_blog.blog_name}"
end
def show
@tag = Tag.find_by!(name: params[:id])
@page_title = this_blog.tag_title_template.to_title(@tag, this_blog, params)
@description = @tag.description.to_s
@articles = @tag.
articles.includes(:blog, :user, :tags, :resources, :text_filter).
published.page(params[:page]).per(10)
respond_to do |format|
format.html do
if @articles.empty?
raise ActiveRecord::RecordNotFound
else
@keywords = this_blog.meta_keywords
render template_name(params[:id])
end
end
format.atom do
@articles = @articles[0, this_blog.limit_rss_display]
render 'articles/index_atom_feed', layout: false
end
format.rss do
@articles = @articles[0, this_blog.limit_rss_display]
render 'articles/index_rss_feed', layout: false
end
end
end
private
def template_name(value)
template_exists?("tags/#{value}") ? value : :show
end
end | 2 | 0.041667 | 1 | 1 |
dcd2051c37b524dafa6c14e504fc67191731c7a6 | .travis.yml | .travis.yml | language: node_js
matrix:
include:
- node_js: "0.12"
sudo: require
before_install:
- npm install -g grunt-cli babel mocha jshint
install:
- npm install --unsafe-perm
- npm install
| language: node_js
matrix:
include:
- node_js: "0.12"
- node_js: "4.2"
sudo: require
before_install:
- npm install -g grunt-cli babel mocha jshint
install:
- npm install --unsafe-perm
- npm install
| Add 4.2 target without apt-get | Add 4.2 target without apt-get
| YAML | unknown | CANDY-LINE/candy-red,CANDY-LINE/candy-red,dbaba/candy-red,dbaba/candy-red,dbaba/candy-red,CANDY-LINE/candy-red | yaml | ## Code Before:
language: node_js
matrix:
include:
- node_js: "0.12"
sudo: require
before_install:
- npm install -g grunt-cli babel mocha jshint
install:
- npm install --unsafe-perm
- npm install
## Instruction:
Add 4.2 target without apt-get
## Code After:
language: node_js
matrix:
include:
- node_js: "0.12"
- node_js: "4.2"
sudo: require
before_install:
- npm install -g grunt-cli babel mocha jshint
install:
- npm install --unsafe-perm
- npm install
| language: node_js
matrix:
include:
- node_js: "0.12"
+ - node_js: "4.2"
sudo: require
before_install:
- npm install -g grunt-cli babel mocha jshint
install:
- npm install --unsafe-perm
- npm install | 1 | 0.071429 | 1 | 0 |
90ac2cc681c51f5270364208abdbb041285d0c3c | airtime_mvc/application/controllers/FeedsController.php | airtime_mvc/application/controllers/FeedsController.php | <?php
class FeedsController extends Zend_Controller_Action
{
public function stationRssAction()
{
$this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
if (!RestAuth::verifyAuth(true, true, $this)
&& (Application_Model_Preference::getStationPodcastPrivacy()
&& $this->getRequest()->getParam("sharing_token") != Application_Model_Preference::getStationPodcastDownloadKey())) {
$this->getResponse()
->setHttpResponseCode(401);
return;
}
header('Content-Type: text/xml; charset=UTF-8');
echo Application_Service_PodcastService::createStationRssFeed();
}
} | <?php
class FeedsController extends Zend_Controller_Action
{
public function stationRssAction()
{
$this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
if ((Application_Model_Preference::getStationPodcastPrivacy()
&& $this->getRequest()->getParam("sharing_token") != Application_Model_Preference::getStationPodcastDownloadKey())
&& !RestAuth::verifyAuth(true, true, $this)) {
$this->getResponse()
->setHttpResponseCode(401);
return;
}
header('Content-Type: text/xml; charset=UTF-8');
echo Application_Service_PodcastService::createStationRssFeed();
}
} | Fix bug where public station podcast feed would not display when logged out | Fix bug where public station podcast feed would not display when logged out
| PHP | agpl-3.0 | comiconomenclaturist/libretime,Lapotor/libretime,Lapotor/libretime,LibreTime/libretime,Lapotor/libretime,Lapotor/libretime,LibreTime/libretime,comiconomenclaturist/libretime,LibreTime/libretime,LibreTime/libretime,comiconomenclaturist/libretime,Lapotor/libretime,LibreTime/libretime,comiconomenclaturist/libretime,Lapotor/libretime,comiconomenclaturist/libretime,LibreTime/libretime,comiconomenclaturist/libretime,comiconomenclaturist/libretime | php | ## Code Before:
<?php
class FeedsController extends Zend_Controller_Action
{
public function stationRssAction()
{
$this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
if (!RestAuth::verifyAuth(true, true, $this)
&& (Application_Model_Preference::getStationPodcastPrivacy()
&& $this->getRequest()->getParam("sharing_token") != Application_Model_Preference::getStationPodcastDownloadKey())) {
$this->getResponse()
->setHttpResponseCode(401);
return;
}
header('Content-Type: text/xml; charset=UTF-8');
echo Application_Service_PodcastService::createStationRssFeed();
}
}
## Instruction:
Fix bug where public station podcast feed would not display when logged out
## Code After:
<?php
class FeedsController extends Zend_Controller_Action
{
public function stationRssAction()
{
$this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
if ((Application_Model_Preference::getStationPodcastPrivacy()
&& $this->getRequest()->getParam("sharing_token") != Application_Model_Preference::getStationPodcastDownloadKey())
&& !RestAuth::verifyAuth(true, true, $this)) {
$this->getResponse()
->setHttpResponseCode(401);
return;
}
header('Content-Type: text/xml; charset=UTF-8');
echo Application_Service_PodcastService::createStationRssFeed();
}
} | <?php
class FeedsController extends Zend_Controller_Action
{
public function stationRssAction()
{
$this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
- if (!RestAuth::verifyAuth(true, true, $this)
- && (Application_Model_Preference::getStationPodcastPrivacy()
? ^^^^^^
+ if ((Application_Model_Preference::getStationPodcastPrivacy()
? ++ ^
- && $this->getRequest()->getParam("sharing_token") != Application_Model_Preference::getStationPodcastDownloadKey())) {
? ---
+ && $this->getRequest()->getParam("sharing_token") != Application_Model_Preference::getStationPodcastDownloadKey())
? ++++
+ && !RestAuth::verifyAuth(true, true, $this)) {
$this->getResponse()
->setHttpResponseCode(401);
return;
}
header('Content-Type: text/xml; charset=UTF-8');
echo Application_Service_PodcastService::createStationRssFeed();
}
} | 6 | 0.272727 | 3 | 3 |
9a2768a67bc2f4032d8fb4df867c6112b328647f | app/views/milestones/index.html.haml | app/views/milestones/index.html.haml | = render "issues/head"
.milestones_content
%h3.page_title
Milestones
- if can? current_user, :admin_milestone, @project
= link_to new_project_milestone_path(@project), class: "pull-right btn btn-primary", title: "New Milestone" do
%i.icon-plus
New Milestone
%br
.row
.span3
%ul.nav.nav-pills.nav-stacked
%li{class: ("active" if (params[:f] == "active" || !params[:f]))}
= link_to project_milestones_path(@project, f: "active") do
Active
%li{class: ("active" if params[:f] == "closed")}
= link_to project_milestones_path(@project, f: "closed") do
Closed
%li{class: ("active" if params[:f] == "all")}
= link_to project_milestones_path(@project, f: "all") do
All
.span9
%div.ui-box
%ul.well-list
= render @milestones
- if @milestones.present?
%li.bottom= paginate @milestones, theme: "gitlab"
- else
%li
%h3.nothing_here_message Nothing to show here
| = render "issues/head"
.milestones_content
%h3.page_title
Milestones
- if can? current_user, :admin_milestone, @project
= link_to new_project_milestone_path(@project), class: "pull-right btn btn-primary", title: "New Milestone" do
%i.icon-plus
New Milestone
%br
.row
.span3
%ul.nav.nav-pills.nav-stacked
%li{class: ("active" if (params[:f] == "active" || !params[:f]))}
= link_to project_milestones_path(@project, f: "active") do
Active
%li{class: ("active" if params[:f] == "closed")}
= link_to project_milestones_path(@project, f: "closed") do
Closed
%li{class: ("active" if params[:f] == "all")}
= link_to project_milestones_path(@project, f: "all") do
All
.span9
.ui-box
%ul.well-list
= render @milestones
- if @milestones.blank?
%li
%h3.nothing_here_message Nothing to show here
= paginate @milestones, theme: "gitlab"
| Fix milestones list pagination style | Fix milestones list pagination style
| Haml | mit | inetfuture/gitlab-tweak,inetfuture/gitlab-tweak,inetfuture/gitlab-tweak | haml | ## Code Before:
= render "issues/head"
.milestones_content
%h3.page_title
Milestones
- if can? current_user, :admin_milestone, @project
= link_to new_project_milestone_path(@project), class: "pull-right btn btn-primary", title: "New Milestone" do
%i.icon-plus
New Milestone
%br
.row
.span3
%ul.nav.nav-pills.nav-stacked
%li{class: ("active" if (params[:f] == "active" || !params[:f]))}
= link_to project_milestones_path(@project, f: "active") do
Active
%li{class: ("active" if params[:f] == "closed")}
= link_to project_milestones_path(@project, f: "closed") do
Closed
%li{class: ("active" if params[:f] == "all")}
= link_to project_milestones_path(@project, f: "all") do
All
.span9
%div.ui-box
%ul.well-list
= render @milestones
- if @milestones.present?
%li.bottom= paginate @milestones, theme: "gitlab"
- else
%li
%h3.nothing_here_message Nothing to show here
## Instruction:
Fix milestones list pagination style
## Code After:
= render "issues/head"
.milestones_content
%h3.page_title
Milestones
- if can? current_user, :admin_milestone, @project
= link_to new_project_milestone_path(@project), class: "pull-right btn btn-primary", title: "New Milestone" do
%i.icon-plus
New Milestone
%br
.row
.span3
%ul.nav.nav-pills.nav-stacked
%li{class: ("active" if (params[:f] == "active" || !params[:f]))}
= link_to project_milestones_path(@project, f: "active") do
Active
%li{class: ("active" if params[:f] == "closed")}
= link_to project_milestones_path(@project, f: "closed") do
Closed
%li{class: ("active" if params[:f] == "all")}
= link_to project_milestones_path(@project, f: "all") do
All
.span9
.ui-box
%ul.well-list
= render @milestones
- if @milestones.blank?
%li
%h3.nothing_here_message Nothing to show here
= paginate @milestones, theme: "gitlab"
| = render "issues/head"
.milestones_content
%h3.page_title
Milestones
- if can? current_user, :admin_milestone, @project
= link_to new_project_milestone_path(@project), class: "pull-right btn btn-primary", title: "New Milestone" do
%i.icon-plus
New Milestone
%br
.row
.span3
%ul.nav.nav-pills.nav-stacked
%li{class: ("active" if (params[:f] == "active" || !params[:f]))}
= link_to project_milestones_path(@project, f: "active") do
Active
%li{class: ("active" if params[:f] == "closed")}
= link_to project_milestones_path(@project, f: "closed") do
Closed
%li{class: ("active" if params[:f] == "all")}
= link_to project_milestones_path(@project, f: "all") do
All
.span9
- %div.ui-box
? ----
+ .ui-box
%ul.well-list
= render @milestones
- - if @milestones.present?
? ^^^^^ ^
+ - if @milestones.blank?
? ^^^ ^
- %li.bottom= paginate @milestones, theme: "gitlab"
- - else
%li
%h3.nothing_here_message Nothing to show here
+
+ = paginate @milestones, theme: "gitlab" | 8 | 0.25 | 4 | 4 |
d95c72b017da262d4303ee07b626645418825723 | devel/scripts/drop_action_dbs.sh | devel/scripts/drop_action_dbs.sh | mongo --eval 'db.action_d_b.drop() ; db.action_type_d_b.drop() ; db.action_execution_d_b.drop() ; db.live_action_d_b.drop()' st2
| mongo --eval 'db.action_d_b.drop() ; db.action_type_d_b.drop() ; db.action_execution_d_b.drop() ; db.live_action_d_b.drop()' st2
# Note: The actionrunner controller must be restarted after using this script.
# (Restarting the actionrunner controller has the side-effect of re-populating the actiontypes collection.)
| Remove TODO comments for issues already addressed | [STORM-267] Remove TODO comments for issues already addressed
| Shell | apache-2.0 | armab/st2,Plexxi/st2,nzlosh/st2,punalpatel/st2,grengojbo/st2,pixelrebel/st2,punalpatel/st2,jtopjian/st2,emedvedev/st2,nzlosh/st2,lakshmi-kannan/st2,tonybaloney/st2,peak6/st2,dennybaa/st2,jtopjian/st2,nzlosh/st2,Plexxi/st2,pixelrebel/st2,pinterb/st2,StackStorm/st2,armab/st2,StackStorm/st2,emedvedev/st2,peak6/st2,alfasin/st2,jtopjian/st2,pixelrebel/st2,lakshmi-kannan/st2,StackStorm/st2,armab/st2,peak6/st2,Plexxi/st2,grengojbo/st2,alfasin/st2,lakshmi-kannan/st2,Plexxi/st2,tonybaloney/st2,pinterb/st2,Itxaka/st2,tonybaloney/st2,dennybaa/st2,Itxaka/st2,alfasin/st2,StackStorm/st2,Itxaka/st2,pinterb/st2,nzlosh/st2,dennybaa/st2,grengojbo/st2,emedvedev/st2,punalpatel/st2 | shell | ## Code Before:
mongo --eval 'db.action_d_b.drop() ; db.action_type_d_b.drop() ; db.action_execution_d_b.drop() ; db.live_action_d_b.drop()' st2
## Instruction:
[STORM-267] Remove TODO comments for issues already addressed
## Code After:
mongo --eval 'db.action_d_b.drop() ; db.action_type_d_b.drop() ; db.action_execution_d_b.drop() ; db.live_action_d_b.drop()' st2
# Note: The actionrunner controller must be restarted after using this script.
# (Restarting the actionrunner controller has the side-effect of re-populating the actiontypes collection.)
| mongo --eval 'db.action_d_b.drop() ; db.action_type_d_b.drop() ; db.action_execution_d_b.drop() ; db.live_action_d_b.drop()' st2
+
+ # Note: The actionrunner controller must be restarted after using this script.
+ # (Restarting the actionrunner controller has the side-effect of re-populating the actiontypes collection.) | 3 | 3 | 3 | 0 |
a7119746a8e3f42ff98238e59e829b2c44c9c11d | server/controllers/datasets.js | server/controllers/datasets.js | /*
** Module dependencies
*/
var mongoose = require('mongoose');
var Record = mongoose.model('Record');
var async = require('async');
exports.search = function(req, res, next) {
function buildQuery() {
var query = Record.find().where('metadata.type').in(['dataset', 'series']);
if (req.query.q && req.query.q.length) {
query
.where({ $text: { $search: req.query.q, $language: 'french' }})
.select({ score: { $meta: 'textScore' } })
.sort({ score: { $meta: 'textScore' } });
}
if (req.query.opendata === 'true') {
query
.where('metadata.keywords')
.in(['donnée ouverte', 'données ouvertes', 'opendata']);
}
if (req.service) query.where('parentCatalog', req.service.id);
return query;
}
async.parallel({
results: function(callback) {
buildQuery().limit(20).exec(callback);
},
count: function(callback) {
buildQuery().count().exec(callback);
}
}, function(err, out) {
if (err) return next(err);
res.json(out);
});
}; | /*
** Module dependencies
*/
var mongoose = require('mongoose');
var Record = mongoose.model('Record');
var async = require('async');
exports.search = function(req, res, next) {
function buildQuery() {
var query = Record.find().where('metadata.type').in(['dataset', 'series']);
if (req.query.q && req.query.q.length) {
query.where({ $text: { $search: req.query.q, $language: 'french' }});
}
if (req.query.opendata === 'true') {
query
.where('metadata.keywords')
.in(['donnée ouverte', 'données ouvertes', 'opendata']);
}
if (req.service) query.where('parentCatalog', req.service.id);
return query;
}
async.parallel({
results: function(callback) {
buildQuery()
.select({ score: { $meta: 'textScore' } })
.sort({ score: { $meta: 'textScore' } })
.limit(20)
.exec(callback);
},
count: function(callback) {
buildQuery().count().exec(callback);
}
}, function(err, out) {
if (err) return next(err);
res.json(out);
});
}; | Fix issue when use text search and count | Fix issue when use text search and count
| JavaScript | agpl-3.0 | inspireteam/geogw,jdesboeufs/geogw | javascript | ## Code Before:
/*
** Module dependencies
*/
var mongoose = require('mongoose');
var Record = mongoose.model('Record');
var async = require('async');
exports.search = function(req, res, next) {
function buildQuery() {
var query = Record.find().where('metadata.type').in(['dataset', 'series']);
if (req.query.q && req.query.q.length) {
query
.where({ $text: { $search: req.query.q, $language: 'french' }})
.select({ score: { $meta: 'textScore' } })
.sort({ score: { $meta: 'textScore' } });
}
if (req.query.opendata === 'true') {
query
.where('metadata.keywords')
.in(['donnée ouverte', 'données ouvertes', 'opendata']);
}
if (req.service) query.where('parentCatalog', req.service.id);
return query;
}
async.parallel({
results: function(callback) {
buildQuery().limit(20).exec(callback);
},
count: function(callback) {
buildQuery().count().exec(callback);
}
}, function(err, out) {
if (err) return next(err);
res.json(out);
});
};
## Instruction:
Fix issue when use text search and count
## Code After:
/*
** Module dependencies
*/
var mongoose = require('mongoose');
var Record = mongoose.model('Record');
var async = require('async');
exports.search = function(req, res, next) {
function buildQuery() {
var query = Record.find().where('metadata.type').in(['dataset', 'series']);
if (req.query.q && req.query.q.length) {
query.where({ $text: { $search: req.query.q, $language: 'french' }});
}
if (req.query.opendata === 'true') {
query
.where('metadata.keywords')
.in(['donnée ouverte', 'données ouvertes', 'opendata']);
}
if (req.service) query.where('parentCatalog', req.service.id);
return query;
}
async.parallel({
results: function(callback) {
buildQuery()
.select({ score: { $meta: 'textScore' } })
.sort({ score: { $meta: 'textScore' } })
.limit(20)
.exec(callback);
},
count: function(callback) {
buildQuery().count().exec(callback);
}
}, function(err, out) {
if (err) return next(err);
res.json(out);
});
}; | /*
** Module dependencies
*/
var mongoose = require('mongoose');
var Record = mongoose.model('Record');
var async = require('async');
exports.search = function(req, res, next) {
function buildQuery() {
var query = Record.find().where('metadata.type').in(['dataset', 'series']);
if (req.query.q && req.query.q.length) {
- query
- .where({ $text: { $search: req.query.q, $language: 'french' }})
? ^^^^
+ query.where({ $text: { $search: req.query.q, $language: 'french' }});
? ^^^^^ +
- .select({ score: { $meta: 'textScore' } })
- .sort({ score: { $meta: 'textScore' } });
}
if (req.query.opendata === 'true') {
query
.where('metadata.keywords')
.in(['donnée ouverte', 'données ouvertes', 'opendata']);
}
if (req.service) query.where('parentCatalog', req.service.id);
return query;
}
async.parallel({
results: function(callback) {
- buildQuery().limit(20).exec(callback);
+ buildQuery()
+ .select({ score: { $meta: 'textScore' } })
+ .sort({ score: { $meta: 'textScore' } })
+ .limit(20)
+ .exec(callback);
},
count: function(callback) {
buildQuery().count().exec(callback);
}
}, function(err, out) {
if (err) return next(err);
res.json(out);
});
}; | 11 | 0.297297 | 6 | 5 |
76ab9d1c5897e9c6744cef4666d96a737636e1e4 | src/placeholders/TextRow.tsx | src/placeholders/TextRow.tsx | import * as React from 'react';
export type Props = {
maxHeight?: string | number,
invisible?: boolean,
className?: string,
color: string,
style?: React.CSSProperties,
lineSpacing?: string | number
}
export default class TextRow extends React.Component<Props> {
static defaultProps = {
lineSpacing: '0.7em'
}
render() {
const { className, maxHeight, color, lineSpacing, style } = this.props;
const defaultStyles = {
maxHeight,
width: '100%',
height: '1em',
backgroundColor: color,
marginTop: lineSpacing
};
const classes = ['text-row', className].filter(c => c).join(' ');
return (
<div
className={classes}
style={{ ...defaultStyles, ...style }}
/>
);
}
}
| import * as React from 'react';
export type Props = {
maxHeight?: string | number,
className?: string,
color: string,
style?: React.CSSProperties,
lineSpacing?: string | number
}
export default class TextRow extends React.Component<Props> {
static defaultProps = {
lineSpacing: '0.7em'
}
render() {
const { className, maxHeight, color, lineSpacing, style } = this.props;
const defaultStyles = {
maxHeight,
width: '100%',
height: '1em',
backgroundColor: color,
marginTop: lineSpacing
};
const classes = ['text-row', className].filter(c => c).join(' ');
return (
<div
className={classes}
style={{ ...defaultStyles, ...style }}
/>
);
}
}
| Remove unused prop from interface | Remove unused prop from interface
| TypeScript | mit | buildo/react-placeholder,buildo/react-placeholder,buildo/react-placeholder | typescript | ## Code Before:
import * as React from 'react';
export type Props = {
maxHeight?: string | number,
invisible?: boolean,
className?: string,
color: string,
style?: React.CSSProperties,
lineSpacing?: string | number
}
export default class TextRow extends React.Component<Props> {
static defaultProps = {
lineSpacing: '0.7em'
}
render() {
const { className, maxHeight, color, lineSpacing, style } = this.props;
const defaultStyles = {
maxHeight,
width: '100%',
height: '1em',
backgroundColor: color,
marginTop: lineSpacing
};
const classes = ['text-row', className].filter(c => c).join(' ');
return (
<div
className={classes}
style={{ ...defaultStyles, ...style }}
/>
);
}
}
## Instruction:
Remove unused prop from interface
## Code After:
import * as React from 'react';
export type Props = {
maxHeight?: string | number,
className?: string,
color: string,
style?: React.CSSProperties,
lineSpacing?: string | number
}
export default class TextRow extends React.Component<Props> {
static defaultProps = {
lineSpacing: '0.7em'
}
render() {
const { className, maxHeight, color, lineSpacing, style } = this.props;
const defaultStyles = {
maxHeight,
width: '100%',
height: '1em',
backgroundColor: color,
marginTop: lineSpacing
};
const classes = ['text-row', className].filter(c => c).join(' ');
return (
<div
className={classes}
style={{ ...defaultStyles, ...style }}
/>
);
}
}
| import * as React from 'react';
export type Props = {
maxHeight?: string | number,
- invisible?: boolean,
className?: string,
color: string,
style?: React.CSSProperties,
lineSpacing?: string | number
}
export default class TextRow extends React.Component<Props> {
static defaultProps = {
lineSpacing: '0.7em'
}
render() {
const { className, maxHeight, color, lineSpacing, style } = this.props;
const defaultStyles = {
maxHeight,
width: '100%',
height: '1em',
backgroundColor: color,
marginTop: lineSpacing
};
const classes = ['text-row', className].filter(c => c).join(' ');
return (
<div
className={classes}
style={{ ...defaultStyles, ...style }}
/>
);
}
} | 1 | 0.025641 | 0 | 1 |
966db25b262d1a753914ad105e0b0895293a4583 | bootstrap.bat | bootstrap.bat | @echo off
pushd %cd%
%~d0
cd %~dp0
echo Temporarily changing directory to %~dp0
if exist %USERPROFILE%\_vimrc goto GVIMRC
echo Installing _vimrc
echo set rtp+=%CD%\vim> %USERPROFILE%\_vimrc
echo source %CD%\vim\vimrc >> %USERPROFILE%\_vimrc
:GVIMRC
if exist %USERPROFILE%\_gvimrc goto END
echo Installing _gvimrc
echo source %CD%\vim\gvimrc > %USERPROFILE%\_gvimrc
:END
popd
| @echo off
pushd %cd%
%~d0
cd %~dp0
echo Temporarily changing directory to %~dp0
if exist %USERPROFILE%\_vimrc goto GVIMRC
echo Installing _vimrc
echo set rtp+=%CD%\vim> %USERPROFILE%\_vimrc
echo source %CD%\vim\vimrc >> %USERPROFILE%\_vimrc
:GVIMRC
if exist %USERPROFILE%\_gvimrc goto END
echo Installing _gvimrc
echo source %CD%\vim\gvimrc > %USERPROFILE%\_gvimrc
:END
echo Done!
popd
| Add log message for when the script is done. | Add log message for when the script is done.
| Batchfile | mit | tomku/dotfiles,tomku/dotfiles,tomku/dotfiles | batchfile | ## Code Before:
@echo off
pushd %cd%
%~d0
cd %~dp0
echo Temporarily changing directory to %~dp0
if exist %USERPROFILE%\_vimrc goto GVIMRC
echo Installing _vimrc
echo set rtp+=%CD%\vim> %USERPROFILE%\_vimrc
echo source %CD%\vim\vimrc >> %USERPROFILE%\_vimrc
:GVIMRC
if exist %USERPROFILE%\_gvimrc goto END
echo Installing _gvimrc
echo source %CD%\vim\gvimrc > %USERPROFILE%\_gvimrc
:END
popd
## Instruction:
Add log message for when the script is done.
## Code After:
@echo off
pushd %cd%
%~d0
cd %~dp0
echo Temporarily changing directory to %~dp0
if exist %USERPROFILE%\_vimrc goto GVIMRC
echo Installing _vimrc
echo set rtp+=%CD%\vim> %USERPROFILE%\_vimrc
echo source %CD%\vim\vimrc >> %USERPROFILE%\_vimrc
:GVIMRC
if exist %USERPROFILE%\_gvimrc goto END
echo Installing _gvimrc
echo source %CD%\vim\gvimrc > %USERPROFILE%\_gvimrc
:END
echo Done!
popd
| @echo off
pushd %cd%
%~d0
cd %~dp0
echo Temporarily changing directory to %~dp0
if exist %USERPROFILE%\_vimrc goto GVIMRC
echo Installing _vimrc
echo set rtp+=%CD%\vim> %USERPROFILE%\_vimrc
echo source %CD%\vim\vimrc >> %USERPROFILE%\_vimrc
:GVIMRC
if exist %USERPROFILE%\_gvimrc goto END
echo Installing _gvimrc
echo source %CD%\vim\gvimrc > %USERPROFILE%\_gvimrc
:END
+ echo Done!
popd
| 1 | 0.052632 | 1 | 0 |
5d245c8c2c4757b95c873477ed0c08852b583313 | spec/quality_spec.rb | spec/quality_spec.rb | require 'spec_helper'
describe 'Code Quality', :quality do
unless RUBY_VERSION < '1.9'
pending 'has no style-guide violations', :style do
require 'rubocop'
result = silence { Rubocop::CLI.new.run }
puts '[STYLE] style violations found. ' +
'Please run \'rubocop\' for a full report.' if result == 1
expect(result).to eq(0)
end
unless RUBY_PLATFORM =~ /java/
it 'has required minimum test coverage' do
expect(SimpleCov.result.covered_percent).to be >= COVERAGE_MIN
end
end
end
end
| require 'spec_helper'
describe 'Code Quality', :quality do
if RUBY_VERSION > '1.9' && RUBY_VERSION < '2.2'
pending 'has no style-guide violations', :style do
require 'rubocop'
result = silence { Rubocop::CLI.new.run }
puts '[STYLE] style violations found. ' +
'Please run \'rubocop\' for a full report.' if result == 1
expect(result).to eq(0)
end
unless RUBY_PLATFORM =~ /java/
it 'has required minimum test coverage' do
expect(SimpleCov.result.covered_percent).to be >= COVERAGE_MIN
end
end
end
end
| Fix quality spec on ruby head | Fix quality spec on ruby head
| Ruby | apache-2.0 | agis-/mongo-ruby-driver,ShanaLMoore/mongo-ruby-driver,namusyaka/mongo-ruby-driver,kay-kim/mongo-ruby-driver,brandonblack/mongo-ruby-driver,saghm/mongo-ruby-driver,0x00evil/mongo-ruby-driver,mongodb/mongo-ruby-driver,fairplace/mongo-ruby-driver,tommyb67/mongo-ruby-driver,wandenberg/mongo-ruby-driver,jonhyman/mongo-ruby-driver,mongodb/mongo-ruby-driver,mongodb/mongo-ruby-driver,fhwang/mongo-ruby-driver,aherlihy/mongo-ruby-driver,kay-kim/mongo-ruby-driver,AndyObtiva/mongo-ruby-driver,xronos-i-am/mongo-ruby-driver,saghm/mongo-ruby-driver,jonhyman/mongo-ruby-driver,estolfo/mongo-ruby-driver,estolfo/mongo-ruby-driver | ruby | ## Code Before:
require 'spec_helper'
describe 'Code Quality', :quality do
unless RUBY_VERSION < '1.9'
pending 'has no style-guide violations', :style do
require 'rubocop'
result = silence { Rubocop::CLI.new.run }
puts '[STYLE] style violations found. ' +
'Please run \'rubocop\' for a full report.' if result == 1
expect(result).to eq(0)
end
unless RUBY_PLATFORM =~ /java/
it 'has required minimum test coverage' do
expect(SimpleCov.result.covered_percent).to be >= COVERAGE_MIN
end
end
end
end
## Instruction:
Fix quality spec on ruby head
## Code After:
require 'spec_helper'
describe 'Code Quality', :quality do
if RUBY_VERSION > '1.9' && RUBY_VERSION < '2.2'
pending 'has no style-guide violations', :style do
require 'rubocop'
result = silence { Rubocop::CLI.new.run }
puts '[STYLE] style violations found. ' +
'Please run \'rubocop\' for a full report.' if result == 1
expect(result).to eq(0)
end
unless RUBY_PLATFORM =~ /java/
it 'has required minimum test coverage' do
expect(SimpleCov.result.covered_percent).to be >= COVERAGE_MIN
end
end
end
end
| require 'spec_helper'
describe 'Code Quality', :quality do
- unless RUBY_VERSION < '1.9'
+ if RUBY_VERSION > '1.9' && RUBY_VERSION < '2.2'
pending 'has no style-guide violations', :style do
require 'rubocop'
result = silence { Rubocop::CLI.new.run }
puts '[STYLE] style violations found. ' +
'Please run \'rubocop\' for a full report.' if result == 1
expect(result).to eq(0)
end
unless RUBY_PLATFORM =~ /java/
it 'has required minimum test coverage' do
expect(SimpleCov.result.covered_percent).to be >= COVERAGE_MIN
end
end
end
end | 2 | 0.1 | 1 | 1 |
e2ee129d34958cf0fe83427ebb937831ebea1e5d | src/utils/index.ts | src/utils/index.ts | export function getRows<T>(grid: T[]): T[][] {
const size = Math.sqrt(grid.length);
const copy = grid.concat([]);
return getArray(size).map(() => copy.splice(0, size));
}
export function getColumns<T>(grid: T[]): T[][] {
return getRows(transpose(grid));
}
export function getDiagonals<T>(grid: T[]): T[][] {
const size = Math.sqrt(grid.length);
const lesser = size - 1;
const last = grid.length - 1;
return [
grid.filter((x, i) => Math.floor(i / size) === i % size),
grid.filter((x, i) => i > 0 && i % lesser === 0 && i !== last)
];
}
function getArray(length: number): number[] {
return Array.apply(null, { length }).map(Number.call, Number);
}
export function transpose<T>(grid: Array<T>): Array<T> {
const size = Math.sqrt(grid.length);
return grid.map((x, i) => grid[Math.floor(i / size) + ((i % size) * size)]);
}
| export function getRows<T>(grid: T[]): T[][] {
const size = Math.sqrt(grid.length);
const copy = grid.concat([]);
return getArray(size).map(() => copy.splice(0, size));
}
export function getColumns<T>(grid: T[]): T[][] {
return getRows(transpose(grid));
}
export function getDiagonals<T>(grid: T[]): T[][] {
const size = Math.sqrt(grid.length);
const lesser = size - 1;
const last = grid.length - 1;
return [
grid.filter((x, i) => Math.floor(i / size) === i % size),
grid.filter((x, i) => i > 0 && i < last && i % lesser === 0)
];
}
function getArray(length: number): number[] {
return Array.apply(null, { length }).map(Number.call, Number);
}
export function transpose<T>(grid: Array<T>): Array<T> {
const size = Math.sqrt(grid.length);
return grid.map((x, i) => grid[Math.floor(i / size) + ((i % size) * size)]);
}
| Optimize filter condition to fail earlier | Optimize filter condition to fail earlier
| TypeScript | mit | artfuldev/tictactoe-ai,artfuldev/tictactoe-ai | typescript | ## Code Before:
export function getRows<T>(grid: T[]): T[][] {
const size = Math.sqrt(grid.length);
const copy = grid.concat([]);
return getArray(size).map(() => copy.splice(0, size));
}
export function getColumns<T>(grid: T[]): T[][] {
return getRows(transpose(grid));
}
export function getDiagonals<T>(grid: T[]): T[][] {
const size = Math.sqrt(grid.length);
const lesser = size - 1;
const last = grid.length - 1;
return [
grid.filter((x, i) => Math.floor(i / size) === i % size),
grid.filter((x, i) => i > 0 && i % lesser === 0 && i !== last)
];
}
function getArray(length: number): number[] {
return Array.apply(null, { length }).map(Number.call, Number);
}
export function transpose<T>(grid: Array<T>): Array<T> {
const size = Math.sqrt(grid.length);
return grid.map((x, i) => grid[Math.floor(i / size) + ((i % size) * size)]);
}
## Instruction:
Optimize filter condition to fail earlier
## Code After:
export function getRows<T>(grid: T[]): T[][] {
const size = Math.sqrt(grid.length);
const copy = grid.concat([]);
return getArray(size).map(() => copy.splice(0, size));
}
export function getColumns<T>(grid: T[]): T[][] {
return getRows(transpose(grid));
}
export function getDiagonals<T>(grid: T[]): T[][] {
const size = Math.sqrt(grid.length);
const lesser = size - 1;
const last = grid.length - 1;
return [
grid.filter((x, i) => Math.floor(i / size) === i % size),
grid.filter((x, i) => i > 0 && i < last && i % lesser === 0)
];
}
function getArray(length: number): number[] {
return Array.apply(null, { length }).map(Number.call, Number);
}
export function transpose<T>(grid: Array<T>): Array<T> {
const size = Math.sqrt(grid.length);
return grid.map((x, i) => grid[Math.floor(i / size) + ((i % size) * size)]);
}
| export function getRows<T>(grid: T[]): T[][] {
const size = Math.sqrt(grid.length);
const copy = grid.concat([]);
return getArray(size).map(() => copy.splice(0, size));
}
export function getColumns<T>(grid: T[]): T[][] {
return getRows(transpose(grid));
}
export function getDiagonals<T>(grid: T[]): T[][] {
const size = Math.sqrt(grid.length);
const lesser = size - 1;
const last = grid.length - 1;
return [
grid.filter((x, i) => Math.floor(i / size) === i % size),
- grid.filter((x, i) => i > 0 && i % lesser === 0 && i !== last)
? --------------
+ grid.filter((x, i) => i > 0 && i < last && i % lesser === 0)
? ++++++++++++
];
}
function getArray(length: number): number[] {
return Array.apply(null, { length }).map(Number.call, Number);
}
export function transpose<T>(grid: Array<T>): Array<T> {
const size = Math.sqrt(grid.length);
return grid.map((x, i) => grid[Math.floor(i / size) + ((i % size) * size)]);
} | 2 | 0.071429 | 1 | 1 |
2bb769b43f67105dd2adc85db11a73ec39d7ac1b | Source/corpus/modules/TagCloud.php | Source/corpus/modules/TagCloud.php | <?
if( !$shutup ) :
$tags = db::fetch('select tag, count(*) as c from categories_tags inner join categories using(categories_id) where `status` and `list` group by tag order by tag');
//print_r( $tags );
echo '<div class="TagCloudWrap">';
foreach( $tags as $tag ) {
echo '<a style="font-size: '. (($tag['c'] / 2) + .5) .'em" href="'. href('tags?tag=' . htmlE($tag['tag'])) .'">' . $tag['tag'] . '</a> ';
}
echo '</div>';
endif;
| <?
if( !$shutup ) :
$tags = db::fetch('select *
from
(
select
(@counter :=@counter + 1)& 1 as x,
w.*
FROM
(SELECT @counter := 0)v,
(
select
tag,
count(*)as c
from
categories_tags
inner join categories using(categories_id)
where
`status`
and `list`
group by
tag
order by
c
)w
)x
order by
x, if(x, - c, c), if(x, -CHAR_LENGTH(tag), CHAR_LENGTH(tag))');
//print_r( $tags );
echo '<div class="TagCloudWrap">';
foreach( $tags as $tag ) {
echo '<a style="font-size: '. number_format(($tag['c'] / 3) + .5, 3) .'em" href="'. href('tags?tag=' . urlencode($tag['tag'])) .'">' . $tag['tag'] . '</a> ';
}
echo '</div>';
endif;
| Tag cloud improvements from Donat Studios | Tag cloud improvements from Donat Studios
| PHP | mit | donatj/CorpusPHP,donatj/CorpusPHP,donatj/CorpusPHP,donatj/CorpusPHP | php | ## Code Before:
<?
if( !$shutup ) :
$tags = db::fetch('select tag, count(*) as c from categories_tags inner join categories using(categories_id) where `status` and `list` group by tag order by tag');
//print_r( $tags );
echo '<div class="TagCloudWrap">';
foreach( $tags as $tag ) {
echo '<a style="font-size: '. (($tag['c'] / 2) + .5) .'em" href="'. href('tags?tag=' . htmlE($tag['tag'])) .'">' . $tag['tag'] . '</a> ';
}
echo '</div>';
endif;
## Instruction:
Tag cloud improvements from Donat Studios
## Code After:
<?
if( !$shutup ) :
$tags = db::fetch('select *
from
(
select
(@counter :=@counter + 1)& 1 as x,
w.*
FROM
(SELECT @counter := 0)v,
(
select
tag,
count(*)as c
from
categories_tags
inner join categories using(categories_id)
where
`status`
and `list`
group by
tag
order by
c
)w
)x
order by
x, if(x, - c, c), if(x, -CHAR_LENGTH(tag), CHAR_LENGTH(tag))');
//print_r( $tags );
echo '<div class="TagCloudWrap">';
foreach( $tags as $tag ) {
echo '<a style="font-size: '. number_format(($tag['c'] / 3) + .5, 3) .'em" href="'. href('tags?tag=' . urlencode($tag['tag'])) .'">' . $tag['tag'] . '</a> ';
}
echo '</div>';
endif;
| <?
if( !$shutup ) :
- $tags = db::fetch('select tag, count(*) as c from categories_tags inner join categories using(categories_id) where `status` and `list` group by tag order by tag');
+ $tags = db::fetch('select *
+ from
+ (
+ select
+ (@counter :=@counter + 1)& 1 as x,
+ w.*
+ FROM
+ (SELECT @counter := 0)v,
+ (
+ select
+ tag,
+ count(*)as c
+ from
+ categories_tags
+ inner join categories using(categories_id)
+ where
+ `status`
+ and `list`
+ group by
+ tag
+ order by
+ c
+ )w
+ )x
+ order by
+ x, if(x, - c, c), if(x, -CHAR_LENGTH(tag), CHAR_LENGTH(tag))');
+
//print_r( $tags );
echo '<div class="TagCloudWrap">';
foreach( $tags as $tag ) {
- echo '<a style="font-size: '. (($tag['c'] / 2) + .5) .'em" href="'. href('tags?tag=' . htmlE($tag['tag'])) .'">' . $tag['tag'] . '</a> ';
? ^ ^^^ ^
+ echo '<a style="font-size: '. number_format(($tag['c'] / 3) + .5, 3) .'em" href="'. href('tags?tag=' . urlencode($tag['tag'])) .'">' . $tag['tag'] . '</a> ';
? +++++++++++++ ^ +++ ^^ ^^^^^^
}
echo '</div>';
endif; | 30 | 2.307692 | 28 | 2 |
9f788f3a2b7626318d0bdedca38986fc283f481f | src/test/rustdoc/const-generics/const-impl.rs | src/test/rustdoc/const-generics/const-impl.rs | // ignore-tidy-linelength
#![feature(const_generics)]
#![crate_name = "foo"]
pub enum Order {
Sorted,
Unsorted,
}
// @has foo/struct.VSet.html '//pre[@class="rust struct"]' 'pub struct VSet<T, const ORDER: Order>'
// @has foo/struct.VSet.html '//h3[@id="impl-Send"]/code' 'impl<const ORDER: Order, T> Send for VSet<T, ORDER>'
// @has foo/struct.VSet.html '//h3[@id="impl-Sync"]/code' 'impl<const ORDER: Order, T> Sync for VSet<T, ORDER>'
pub struct VSet<T, const ORDER: Order> {
inner: Vec<T>,
}
// @has foo/struct.VSet.html '//h3[@id="impl"]/code' 'impl<T> VSet<T, { Order::Sorted }>'
impl <T> VSet<T, {Order::Sorted}> {
pub fn new() -> Self {
Self { inner: Vec::new() }
}
}
// @has foo/struct.VSet.html '//h3[@id="impl-1"]/code' 'impl<T> VSet<T, { Order::Unsorted }>'
impl <T> VSet<T, {Order::Unsorted}> {
pub fn new() -> Self {
Self { inner: Vec::new() }
}
}
| // ignore-tidy-linelength
#![feature(const_generics)]
#![crate_name = "foo"]
#[derive(PartialEq, Eq)]
pub enum Order {
Sorted,
Unsorted,
}
// @has foo/struct.VSet.html '//pre[@class="rust struct"]' 'pub struct VSet<T, const ORDER: Order>'
// @has foo/struct.VSet.html '//h3[@id="impl-Send"]/code' 'impl<const ORDER: Order, T> Send for VSet<T, ORDER>'
// @has foo/struct.VSet.html '//h3[@id="impl-Sync"]/code' 'impl<const ORDER: Order, T> Sync for VSet<T, ORDER>'
pub struct VSet<T, const ORDER: Order> {
inner: Vec<T>,
}
// @has foo/struct.VSet.html '//h3[@id="impl"]/code' 'impl<T> VSet<T, { Order::Sorted }>'
impl <T> VSet<T, {Order::Sorted}> {
pub fn new() -> Self {
Self { inner: Vec::new() }
}
}
// @has foo/struct.VSet.html '//h3[@id="impl-1"]/code' 'impl<T> VSet<T, { Order::Unsorted }>'
impl <T> VSet<T, {Order::Unsorted}> {
pub fn new() -> Self {
Self { inner: Vec::new() }
}
}
| Fix rustdoc const generics test | Fix rustdoc const generics test
| Rust | apache-2.0 | aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust | rust | ## Code Before:
// ignore-tidy-linelength
#![feature(const_generics)]
#![crate_name = "foo"]
pub enum Order {
Sorted,
Unsorted,
}
// @has foo/struct.VSet.html '//pre[@class="rust struct"]' 'pub struct VSet<T, const ORDER: Order>'
// @has foo/struct.VSet.html '//h3[@id="impl-Send"]/code' 'impl<const ORDER: Order, T> Send for VSet<T, ORDER>'
// @has foo/struct.VSet.html '//h3[@id="impl-Sync"]/code' 'impl<const ORDER: Order, T> Sync for VSet<T, ORDER>'
pub struct VSet<T, const ORDER: Order> {
inner: Vec<T>,
}
// @has foo/struct.VSet.html '//h3[@id="impl"]/code' 'impl<T> VSet<T, { Order::Sorted }>'
impl <T> VSet<T, {Order::Sorted}> {
pub fn new() -> Self {
Self { inner: Vec::new() }
}
}
// @has foo/struct.VSet.html '//h3[@id="impl-1"]/code' 'impl<T> VSet<T, { Order::Unsorted }>'
impl <T> VSet<T, {Order::Unsorted}> {
pub fn new() -> Self {
Self { inner: Vec::new() }
}
}
## Instruction:
Fix rustdoc const generics test
## Code After:
// ignore-tidy-linelength
#![feature(const_generics)]
#![crate_name = "foo"]
#[derive(PartialEq, Eq)]
pub enum Order {
Sorted,
Unsorted,
}
// @has foo/struct.VSet.html '//pre[@class="rust struct"]' 'pub struct VSet<T, const ORDER: Order>'
// @has foo/struct.VSet.html '//h3[@id="impl-Send"]/code' 'impl<const ORDER: Order, T> Send for VSet<T, ORDER>'
// @has foo/struct.VSet.html '//h3[@id="impl-Sync"]/code' 'impl<const ORDER: Order, T> Sync for VSet<T, ORDER>'
pub struct VSet<T, const ORDER: Order> {
inner: Vec<T>,
}
// @has foo/struct.VSet.html '//h3[@id="impl"]/code' 'impl<T> VSet<T, { Order::Sorted }>'
impl <T> VSet<T, {Order::Sorted}> {
pub fn new() -> Self {
Self { inner: Vec::new() }
}
}
// @has foo/struct.VSet.html '//h3[@id="impl-1"]/code' 'impl<T> VSet<T, { Order::Unsorted }>'
impl <T> VSet<T, {Order::Unsorted}> {
pub fn new() -> Self {
Self { inner: Vec::new() }
}
}
| // ignore-tidy-linelength
#![feature(const_generics)]
#![crate_name = "foo"]
+ #[derive(PartialEq, Eq)]
pub enum Order {
Sorted,
Unsorted,
}
// @has foo/struct.VSet.html '//pre[@class="rust struct"]' 'pub struct VSet<T, const ORDER: Order>'
// @has foo/struct.VSet.html '//h3[@id="impl-Send"]/code' 'impl<const ORDER: Order, T> Send for VSet<T, ORDER>'
// @has foo/struct.VSet.html '//h3[@id="impl-Sync"]/code' 'impl<const ORDER: Order, T> Sync for VSet<T, ORDER>'
pub struct VSet<T, const ORDER: Order> {
inner: Vec<T>,
}
// @has foo/struct.VSet.html '//h3[@id="impl"]/code' 'impl<T> VSet<T, { Order::Sorted }>'
impl <T> VSet<T, {Order::Sorted}> {
pub fn new() -> Self {
Self { inner: Vec::new() }
}
}
// @has foo/struct.VSet.html '//h3[@id="impl-1"]/code' 'impl<T> VSet<T, { Order::Unsorted }>'
impl <T> VSet<T, {Order::Unsorted}> {
pub fn new() -> Self {
Self { inner: Vec::new() }
}
} | 1 | 0.032258 | 1 | 0 |
c6ed5d7b3a388ef7cb74657710497d604c7b0af7 | README.md | README.md |
Will accept any TCP connection and echo back a HTTP response with the
entire content of the incoming TCP connection.
The server makes no attempt to understand the incoming HTTP request
hence it doesn't know when the request is completed and therefore just
terminates the TCP connection 2 seconds after the first data packet.
## Installation
To setup a simple echo-server on Heroku just click this button:
[](https://heroku.com/deploy)
Alternatively, to install locally just run:
```
npm install http-echo-server -g
```
## Example usage
Just curl the URL of the app:
```
curl http://<heroku-app-name>.herokuapp.com
```
Alternatively - if installed locally - you can start the server using
the command `http-echo-server`, take note of the port it starts on and
then curl it:
```
curl http://localhost:<port>
```
## License
MIT
|
Will accept any TCP connection and echo back a HTTP response with the
entire content of the incoming TCP connection.
The server makes no attempt to understand the incoming HTTP request
hence it doesn't know when the request is completed and therefore just
terminates the TCP connection 2 seconds after the first data packet.
## Installation
To setup a simple echo-server on Heroku just click this button:
[](https://heroku.com/deploy)
*Note that the Heroku routing stack will proxy the incoming request and
add custom HTTP headers.*
Alternatively, to install locally just run:
```
npm install http-echo-server -g
```
## Example usage
Just curl the URL of the app:
```
curl http://<heroku-app-name>.herokuapp.com
```
Alternatively - if installed locally - you can start the server using
the command `http-echo-server`, take note of the port it starts on and
then curl it:
```
curl http://localhost:<port>
```
## License
MIT
| Add note about custom Heroku headers | Add note about custom Heroku headers
| Markdown | mit | watson/http-echo-server | markdown | ## Code Before:
Will accept any TCP connection and echo back a HTTP response with the
entire content of the incoming TCP connection.
The server makes no attempt to understand the incoming HTTP request
hence it doesn't know when the request is completed and therefore just
terminates the TCP connection 2 seconds after the first data packet.
## Installation
To setup a simple echo-server on Heroku just click this button:
[](https://heroku.com/deploy)
Alternatively, to install locally just run:
```
npm install http-echo-server -g
```
## Example usage
Just curl the URL of the app:
```
curl http://<heroku-app-name>.herokuapp.com
```
Alternatively - if installed locally - you can start the server using
the command `http-echo-server`, take note of the port it starts on and
then curl it:
```
curl http://localhost:<port>
```
## License
MIT
## Instruction:
Add note about custom Heroku headers
## Code After:
Will accept any TCP connection and echo back a HTTP response with the
entire content of the incoming TCP connection.
The server makes no attempt to understand the incoming HTTP request
hence it doesn't know when the request is completed and therefore just
terminates the TCP connection 2 seconds after the first data packet.
## Installation
To setup a simple echo-server on Heroku just click this button:
[](https://heroku.com/deploy)
*Note that the Heroku routing stack will proxy the incoming request and
add custom HTTP headers.*
Alternatively, to install locally just run:
```
npm install http-echo-server -g
```
## Example usage
Just curl the URL of the app:
```
curl http://<heroku-app-name>.herokuapp.com
```
Alternatively - if installed locally - you can start the server using
the command `http-echo-server`, take note of the port it starts on and
then curl it:
```
curl http://localhost:<port>
```
## License
MIT
|
Will accept any TCP connection and echo back a HTTP response with the
entire content of the incoming TCP connection.
The server makes no attempt to understand the incoming HTTP request
hence it doesn't know when the request is completed and therefore just
terminates the TCP connection 2 seconds after the first data packet.
## Installation
To setup a simple echo-server on Heroku just click this button:
[](https://heroku.com/deploy)
+
+ *Note that the Heroku routing stack will proxy the incoming request and
+ add custom HTTP headers.*
Alternatively, to install locally just run:
```
npm install http-echo-server -g
```
## Example usage
Just curl the URL of the app:
```
curl http://<heroku-app-name>.herokuapp.com
```
Alternatively - if installed locally - you can start the server using
the command `http-echo-server`, take note of the port it starts on and
then curl it:
```
curl http://localhost:<port>
```
## License
MIT | 3 | 0.076923 | 3 | 0 |
ce136ed6eac944eab631b429210816edd7da0e52 | app/scripts/controllers/Posts.js | app/scripts/controllers/Posts.js | 'use strict';
angular
.module('lwControllers')
.controller('Posts',
function($rootScope, $scope, $routeParams, $location, Article, Analytics, Admin) {
$rootScope.title = 'Posts — LilyMandarin';
Analytics.page();
$rootScope.tab = 'posts';
$scope.posts = [];
// Fetches and appends a new batch of posts
$scope.load = function() {
$scope.loadStatus = 'loading';
var params = {
categories: 'post',
count: 20
};
var length = $scope.posts.length;
if (length) {
params.validatedBefore = $scope.posts[length - 1].firstValidationTimeNano;
// Only get non-validated articles on the first load, otherwise they will end up
// duplicated!
params.validatedOnly = true;
} else {
params.validatedBefore = '0';
params.validatedOnly = !Admin;
}
Article.query(params, function(posts) {
// This is efficient because Angular will not recreate DOM elements for the
// already-appended posts in $scope.posts
$scope.posts = $scope.posts.concat(posts);
$scope.loadStatus = posts.length < params.count ? 'ended' : 'ready';
});
};
$scope.load();
}
); | 'use strict';
angular
.module('lwControllers')
.controller('Posts',
function($rootScope, $scope, $routeParams, $location, Article, Analytics, Admin) {
$rootScope.title = 'Posts — LilyMandarin';
Analytics.page();
$rootScope.tab = 'posts';
$scope.posts = [];
// Fetches and appends a new batch of posts
$scope.load = function() {
$scope.loadStatus = 'loading';
var params = {
categories: 'post',
count: 20
};
var length = $scope.posts.length;
if (!length) {
// First load
params.validatedBefore = '0';
params.validatedOnly = !Admin;
} else {
// Subsequent loads
params.validatedBefore = $scope.posts[length - 1].firstValidationTimeNano;
params.validatedOnly = true;
}
Article.query(params, function(posts) {
// This is efficient because Angular will not recreate DOM elements for the
// already-appended posts in $scope.posts
$scope.posts = $scope.posts.concat(posts);
if (posts.length < params.count ||
posts.length && !posts[posts.length - 1].validated) {
$scope.loadStatus = 'ended';
} else {
$scope.loadStatus = 'ready';
}
});
};
$scope.load();
}
); | Fix issue with "load more" button status | Fix issue with "load more" button status
| JavaScript | mit | peferron/lilymandarin-v1-web,peferron/lilymandarin-web,peferron/lilymandarin-v1-web,peferron/lilymandarin-web | javascript | ## Code Before:
'use strict';
angular
.module('lwControllers')
.controller('Posts',
function($rootScope, $scope, $routeParams, $location, Article, Analytics, Admin) {
$rootScope.title = 'Posts — LilyMandarin';
Analytics.page();
$rootScope.tab = 'posts';
$scope.posts = [];
// Fetches and appends a new batch of posts
$scope.load = function() {
$scope.loadStatus = 'loading';
var params = {
categories: 'post',
count: 20
};
var length = $scope.posts.length;
if (length) {
params.validatedBefore = $scope.posts[length - 1].firstValidationTimeNano;
// Only get non-validated articles on the first load, otherwise they will end up
// duplicated!
params.validatedOnly = true;
} else {
params.validatedBefore = '0';
params.validatedOnly = !Admin;
}
Article.query(params, function(posts) {
// This is efficient because Angular will not recreate DOM elements for the
// already-appended posts in $scope.posts
$scope.posts = $scope.posts.concat(posts);
$scope.loadStatus = posts.length < params.count ? 'ended' : 'ready';
});
};
$scope.load();
}
);
## Instruction:
Fix issue with "load more" button status
## Code After:
'use strict';
angular
.module('lwControllers')
.controller('Posts',
function($rootScope, $scope, $routeParams, $location, Article, Analytics, Admin) {
$rootScope.title = 'Posts — LilyMandarin';
Analytics.page();
$rootScope.tab = 'posts';
$scope.posts = [];
// Fetches and appends a new batch of posts
$scope.load = function() {
$scope.loadStatus = 'loading';
var params = {
categories: 'post',
count: 20
};
var length = $scope.posts.length;
if (!length) {
// First load
params.validatedBefore = '0';
params.validatedOnly = !Admin;
} else {
// Subsequent loads
params.validatedBefore = $scope.posts[length - 1].firstValidationTimeNano;
params.validatedOnly = true;
}
Article.query(params, function(posts) {
// This is efficient because Angular will not recreate DOM elements for the
// already-appended posts in $scope.posts
$scope.posts = $scope.posts.concat(posts);
if (posts.length < params.count ||
posts.length && !posts[posts.length - 1].validated) {
$scope.loadStatus = 'ended';
} else {
$scope.loadStatus = 'ready';
}
});
};
$scope.load();
}
); | 'use strict';
angular
.module('lwControllers')
.controller('Posts',
function($rootScope, $scope, $routeParams, $location, Article, Analytics, Admin) {
$rootScope.title = 'Posts — LilyMandarin';
Analytics.page();
$rootScope.tab = 'posts';
$scope.posts = [];
// Fetches and appends a new batch of posts
$scope.load = function() {
$scope.loadStatus = 'loading';
var params = {
categories: 'post',
count: 20
};
var length = $scope.posts.length;
- if (length) {
+ if (!length) {
? +
+ // First load
- params.validatedBefore = $scope.posts[length - 1].firstValidationTimeNano;
- // Only get non-validated articles on the first load, otherwise they will end up
- // duplicated!
- params.validatedOnly = true;
- } else {
params.validatedBefore = '0';
params.validatedOnly = !Admin;
+ } else {
+ // Subsequent loads
+ params.validatedBefore = $scope.posts[length - 1].firstValidationTimeNano;
+ params.validatedOnly = true;
}
Article.query(params, function(posts) {
// This is efficient because Angular will not recreate DOM elements for the
// already-appended posts in $scope.posts
$scope.posts = $scope.posts.concat(posts);
- $scope.loadStatus = posts.length < params.count ? 'ended' : 'ready';
+ if (posts.length < params.count ||
+ posts.length && !posts[posts.length - 1].validated) {
+ $scope.loadStatus = 'ended';
+ } else {
+ $scope.loadStatus = 'ready';
+ }
});
};
$scope.load();
}
); | 19 | 0.422222 | 12 | 7 |
f8db4d51dcbcc26d49e8e6c9efe9f8d251cddba9 | source/scripts/common.js | source/scripts/common.js | /*------------------------------------------------------------------------------
| common.js
|
| Application-wide utilities.
------------------------------------------------------------------------------*/
import $ from 'jquery/dist/jquery';
// Establish namespace. Change to match the name of your application.
const Css3Foundation = window.Css3Foundation ? window.Css3Foundation : {};
Css3Foundation.util = {
/*
** Workaround for MobileSafari zoom bug after orientation change.
** From: http://adactio.com/journal/4470/
*/
iosZoomWorkaround: () => {
const ua = navigator.userAgent;
if (ua.match(/iPhone/) || ua.match(/iPad/)) {
const viewportmeta = $('meta[name="viewport"]');
if (viewportmeta.length > 0) {
viewportmeta.attr(
'content',
'width=device-width, minimum-scale=1.0, maximum-scale=1.0'
);
$('body').bind('gesturestart', () => {
viewportmeta.attr(
'content',
'width=device-width, minimum-scale=0.25, maximum-scale=1.6'
);
});
}
}
},
};
$.extend(Css3Foundation, {
/*
** Override this to perform any application-wide initialization JavaScript. This should
** run on DOM ready for every page in the application, and resides in the main application
** JS namespace.
*/
commonInit: () => {
Css3Foundation.util.iosZoomWorkaround();
// Other stuff to do as soon as the DOM is ready
},
});
$(() => Css3Foundation.commonInit());
| /*------------------------------------------------------------------------------
| common.js
|
| Application-wide utilities.
------------------------------------------------------------------------------*/
import $ from 'jquery/dist/jquery';
// Establish namespace. Change to match the name of your application.
const Css3Foundation = window.Css3Foundation ? window.Css3Foundation : {};
Css3Foundation.util = {};
$.extend(Css3Foundation, {
/*
** Override this to perform any application-wide initialization JavaScript. This should
** run on DOM ready for every page in the application, and resides in the main application
** JS namespace.
*/
commonInit: () => {
// Other stuff to do as soon as the DOM is ready
},
});
$(() => Css3Foundation.commonInit());
| Remove ios zoom workaround—the bug has been fixed. | Remove ios zoom workaround—the bug has been fixed.
| JavaScript | apache-2.0 | ravasthi/css3-foundation,ravasthi/css3-foundation | javascript | ## Code Before:
/*------------------------------------------------------------------------------
| common.js
|
| Application-wide utilities.
------------------------------------------------------------------------------*/
import $ from 'jquery/dist/jquery';
// Establish namespace. Change to match the name of your application.
const Css3Foundation = window.Css3Foundation ? window.Css3Foundation : {};
Css3Foundation.util = {
/*
** Workaround for MobileSafari zoom bug after orientation change.
** From: http://adactio.com/journal/4470/
*/
iosZoomWorkaround: () => {
const ua = navigator.userAgent;
if (ua.match(/iPhone/) || ua.match(/iPad/)) {
const viewportmeta = $('meta[name="viewport"]');
if (viewportmeta.length > 0) {
viewportmeta.attr(
'content',
'width=device-width, minimum-scale=1.0, maximum-scale=1.0'
);
$('body').bind('gesturestart', () => {
viewportmeta.attr(
'content',
'width=device-width, minimum-scale=0.25, maximum-scale=1.6'
);
});
}
}
},
};
$.extend(Css3Foundation, {
/*
** Override this to perform any application-wide initialization JavaScript. This should
** run on DOM ready for every page in the application, and resides in the main application
** JS namespace.
*/
commonInit: () => {
Css3Foundation.util.iosZoomWorkaround();
// Other stuff to do as soon as the DOM is ready
},
});
$(() => Css3Foundation.commonInit());
## Instruction:
Remove ios zoom workaround—the bug has been fixed.
## Code After:
/*------------------------------------------------------------------------------
| common.js
|
| Application-wide utilities.
------------------------------------------------------------------------------*/
import $ from 'jquery/dist/jquery';
// Establish namespace. Change to match the name of your application.
const Css3Foundation = window.Css3Foundation ? window.Css3Foundation : {};
Css3Foundation.util = {};
$.extend(Css3Foundation, {
/*
** Override this to perform any application-wide initialization JavaScript. This should
** run on DOM ready for every page in the application, and resides in the main application
** JS namespace.
*/
commonInit: () => {
// Other stuff to do as soon as the DOM is ready
},
});
$(() => Css3Foundation.commonInit());
| /*------------------------------------------------------------------------------
| common.js
|
| Application-wide utilities.
------------------------------------------------------------------------------*/
import $ from 'jquery/dist/jquery';
// Establish namespace. Change to match the name of your application.
const Css3Foundation = window.Css3Foundation ? window.Css3Foundation : {};
- Css3Foundation.util = {
+ Css3Foundation.util = {};
? ++
- /*
- ** Workaround for MobileSafari zoom bug after orientation change.
- ** From: http://adactio.com/journal/4470/
- */
- iosZoomWorkaround: () => {
- const ua = navigator.userAgent;
- if (ua.match(/iPhone/) || ua.match(/iPad/)) {
- const viewportmeta = $('meta[name="viewport"]');
- if (viewportmeta.length > 0) {
- viewportmeta.attr(
- 'content',
- 'width=device-width, minimum-scale=1.0, maximum-scale=1.0'
- );
- $('body').bind('gesturestart', () => {
- viewportmeta.attr(
- 'content',
- 'width=device-width, minimum-scale=0.25, maximum-scale=1.6'
- );
- });
- }
- }
- },
- };
$.extend(Css3Foundation, {
/*
** Override this to perform any application-wide initialization JavaScript. This should
** run on DOM ready for every page in the application, and resides in the main application
** JS namespace.
*/
commonInit: () => {
- Css3Foundation.util.iosZoomWorkaround();
-
// Other stuff to do as soon as the DOM is ready
},
});
$(() => Css3Foundation.commonInit()); | 27 | 0.54 | 1 | 26 |
960692bddd99eba2e407806633ff60317fdcabd2 | templates/teaser-element.php | templates/teaser-element.php | <?php
global $wp_query;
$slider_or_image = '';
$page_parent_image = function_exists('get_field') ? get_field('header_image', $wp_query->post->post_parent) : '';
$page_parent_animation = function_exists('get_field') ? get_field('show_vobe_animation', $wp_query->post->post_parent) : '';
$page_google_map = function_exists('get_field') ? get_field('show_google_map', $wp_query->post->post_parent) : '';
if ( $page_parent_image ) {
$slider_or_image = wp_get_attachment_image( $page_parent_image, 'full' );
} else if ( is_front_page() ) {
$slider_or_image = do_shortcode( '[responsive_slider]' );
} else if ( $page_parent_animation ) {
$slider_or_image = get_template_part('templates/animation');
} else if ( $page_google_map ) {
$slider_or_image = get_option('plugin_options')['vobe_google_map_code'];
}
echo $slider_or_image;
?> | <?php
global $wp_query;
$slider_or_image = '';
$page_parent_image = function_exists('get_field') ? get_field('header_image', $wp_query->post->post_parent) : '';
$page_parent_animation = function_exists('get_field') ? get_field('show_vobe_animation', $wp_query->post->post_parent) : '';
$page_google_map = function_exists('get_field') ? get_field('show_google_map', $wp_query->post->post_parent) : '';
if ( $page_parent_image ) {
$slider_or_image = wp_get_attachment_image( $page_parent_image, 'full' );
} else if ( is_front_page() ) {
$slider_or_image = do_shortcode( '[responsive_slider]' );
} else if ( $page_parent_animation ) {
$slider_or_image = get_template_part('templates/animation');
} else if ( $page_google_map ) {
$options = $get_option('plugin_options');
$slider_or_image = $options['vobe_google_map_code'];
}
echo $slider_or_image;
?> | Fix teaser image for maps. | Fix teaser image for maps.
| PHP | mit | juliabode/vobe,juliabode/vobe,juliabode/vobe | php | ## Code Before:
<?php
global $wp_query;
$slider_or_image = '';
$page_parent_image = function_exists('get_field') ? get_field('header_image', $wp_query->post->post_parent) : '';
$page_parent_animation = function_exists('get_field') ? get_field('show_vobe_animation', $wp_query->post->post_parent) : '';
$page_google_map = function_exists('get_field') ? get_field('show_google_map', $wp_query->post->post_parent) : '';
if ( $page_parent_image ) {
$slider_or_image = wp_get_attachment_image( $page_parent_image, 'full' );
} else if ( is_front_page() ) {
$slider_or_image = do_shortcode( '[responsive_slider]' );
} else if ( $page_parent_animation ) {
$slider_or_image = get_template_part('templates/animation');
} else if ( $page_google_map ) {
$slider_or_image = get_option('plugin_options')['vobe_google_map_code'];
}
echo $slider_or_image;
?>
## Instruction:
Fix teaser image for maps.
## Code After:
<?php
global $wp_query;
$slider_or_image = '';
$page_parent_image = function_exists('get_field') ? get_field('header_image', $wp_query->post->post_parent) : '';
$page_parent_animation = function_exists('get_field') ? get_field('show_vobe_animation', $wp_query->post->post_parent) : '';
$page_google_map = function_exists('get_field') ? get_field('show_google_map', $wp_query->post->post_parent) : '';
if ( $page_parent_image ) {
$slider_or_image = wp_get_attachment_image( $page_parent_image, 'full' );
} else if ( is_front_page() ) {
$slider_or_image = do_shortcode( '[responsive_slider]' );
} else if ( $page_parent_animation ) {
$slider_or_image = get_template_part('templates/animation');
} else if ( $page_google_map ) {
$options = $get_option('plugin_options');
$slider_or_image = $options['vobe_google_map_code'];
}
echo $slider_or_image;
?> | <?php
global $wp_query;
$slider_or_image = '';
$page_parent_image = function_exists('get_field') ? get_field('header_image', $wp_query->post->post_parent) : '';
$page_parent_animation = function_exists('get_field') ? get_field('show_vobe_animation', $wp_query->post->post_parent) : '';
$page_google_map = function_exists('get_field') ? get_field('show_google_map', $wp_query->post->post_parent) : '';
if ( $page_parent_image ) {
$slider_or_image = wp_get_attachment_image( $page_parent_image, 'full' );
} else if ( is_front_page() ) {
$slider_or_image = do_shortcode( '[responsive_slider]' );
} else if ( $page_parent_animation ) {
$slider_or_image = get_template_part('templates/animation');
} else if ( $page_google_map ) {
+ $options = $get_option('plugin_options');
- $slider_or_image = get_option('plugin_options')['vobe_google_map_code'];
? ^^^^^^^^^^^^^^^^^^^ --
+ $slider_or_image = $options['vobe_google_map_code'];
? ^
}
echo $slider_or_image;
?> | 3 | 0.1 | 2 | 1 |
bb04098062f84462200468159510cc4b77cb9ea5 | lib/shared/catalina-sudo/sudo-askpass.osascript.js | lib/shared/catalina-sudo/sudo-askpass.osascript.js |
ObjC.import('stdlib')
const app = Application.currentApplication()
app.includeStandardAdditions = true
const result = app.displayDialog('balenaEtcher wants to make changes. Type your password to allow this.', {
defaultAnswer: '',
withIcon: 'stop',
buttons: ['Cancel', 'Ok'],
defaultButton: 'Ok',
hiddenAnswer: true,
})
if (result.buttonReturned === 'Ok') {
result.textReturned
} else {
$.exit(255)
}
|
ObjC.import('stdlib')
const app = Application.currentApplication()
app.includeStandardAdditions = true
const result = app.displayDialog('balenaEtcher needs privileged access in order to flash disks.\n\nType your password to allow this.', {
defaultAnswer: '',
withIcon: 'caution',
buttons: ['Cancel', 'Ok'],
defaultButton: 'Ok',
hiddenAnswer: true,
})
if (result.buttonReturned === 'Ok') {
result.textReturned
} else {
$.exit(255)
}
| Reword macOS Catalina askpass message | Reword macOS Catalina askpass message
Change-type: patch
Changelog-entry: Reword macOS Catalina askpass message
Signed-off-by: Lorenzo Alberto Maria Ambrosi <[email protected]>
| JavaScript | apache-2.0 | resin-io/etcher,resin-io/herostratus,resin-io/resin-etcher,resin-io/resin-etcher,resin-io/etcher,resin-io/herostratus,resin-io/etcher,resin-io/etcher,resin-io/etcher | javascript | ## Code Before:
ObjC.import('stdlib')
const app = Application.currentApplication()
app.includeStandardAdditions = true
const result = app.displayDialog('balenaEtcher wants to make changes. Type your password to allow this.', {
defaultAnswer: '',
withIcon: 'stop',
buttons: ['Cancel', 'Ok'],
defaultButton: 'Ok',
hiddenAnswer: true,
})
if (result.buttonReturned === 'Ok') {
result.textReturned
} else {
$.exit(255)
}
## Instruction:
Reword macOS Catalina askpass message
Change-type: patch
Changelog-entry: Reword macOS Catalina askpass message
Signed-off-by: Lorenzo Alberto Maria Ambrosi <[email protected]>
## Code After:
ObjC.import('stdlib')
const app = Application.currentApplication()
app.includeStandardAdditions = true
const result = app.displayDialog('balenaEtcher needs privileged access in order to flash disks.\n\nType your password to allow this.', {
defaultAnswer: '',
withIcon: 'caution',
buttons: ['Cancel', 'Ok'],
defaultButton: 'Ok',
hiddenAnswer: true,
})
if (result.buttonReturned === 'Ok') {
result.textReturned
} else {
$.exit(255)
}
|
ObjC.import('stdlib')
const app = Application.currentApplication()
app.includeStandardAdditions = true
- const result = app.displayDialog('balenaEtcher wants to make changes. Type your password to allow this.', {
? ^ ^^ ^ -------- ^
+ const result = app.displayDialog('balenaEtcher needs privileged access in order to flash disks.\n\nType your password to allow this.', {
? ^^^^^^^^^^^^^^^^^ +++++++ ^^^^^^ ^^ ++++++ ^^^^
defaultAnswer: '',
- withIcon: 'stop',
? ^ ^
+ withIcon: 'caution',
? ^^^ + ^
buttons: ['Cancel', 'Ok'],
defaultButton: 'Ok',
hiddenAnswer: true,
})
if (result.buttonReturned === 'Ok') {
result.textReturned
} else {
$.exit(255)
}
| 4 | 0.2 | 2 | 2 |
5de383e3989c51a878058877ae7009fe6cbb0235 | README.md | README.md | This is a TensorFlow implementation of an arbitrary order (>=2) Factorization Machine based on paper [Factorization Machines with libFM](http://dl.acm.org/citation.cfm?doid=2168752.2168771).
It supports:
* dense and sparse inputs
* different optimization methods
* logging via TensorBoard
# Prerequisites
* [scikit-learn](http://scikit-learn.org/stable/)
* [numpy](http://www.numpy.org/)
* [tensorflow 0.8](https://www.tensorflow.org/)
* [tqdm](https://github.com/tqdm/tqdm)
# Usage
The interface is the same as of Scikit-learn models. To train a 6-order FM model with rank=10 for 100 iterations with learning_rate=0.01 use the following sample
```python
from tffm import TFFMClassifier
model = TFFMClassifier(
order=6,
rank=10,
optimizer=tf.train.AdamOptimizer(learning_rate=0.01),
n_epochs=100,
batch_size=-1,
init_std=0.001,
input_type='dense'
)
model.fit(X_tr, y_tr, show_progress=True)
```
See `example.ipynb` for more details
| This is a TensorFlow implementation of an arbitrary order (>=2) Factorization Machine based on paper [Factorization Machines with libFM](http://dl.acm.org/citation.cfm?doid=2168752.2168771).
It supports:
* dense and sparse inputs
* different (gradient-based) optimization methods
* logging via TensorBoard
The inference time is linear with respect to the number of features.
# Dependencies
* [scikit-learn](http://scikit-learn.org/stable/)
* [numpy](http://www.numpy.org/)
* [tensorflow 0.8](https://www.tensorflow.org/)
* [tqdm](https://github.com/tqdm/tqdm)
# Usage
The interface is the same as of Scikit-learn models. To train a 6-order FM model with rank=10 for 100 iterations with learning_rate=0.01 use the following sample
```python
from tffm import TFFMClassifier
model = TFFMClassifier(
order=6,
rank=10,
optimizer=tf.train.AdamOptimizer(learning_rate=0.01),
n_epochs=100,
batch_size=-1,
init_std=0.001,
input_type='dense'
)
model.fit(X_tr, y_tr, show_progress=True)
```
See `example.ipynb` for more details
| Add inference complexity to Readme | Add inference complexity to Readme
| Markdown | mit | geffy/tffm | markdown | ## Code Before:
This is a TensorFlow implementation of an arbitrary order (>=2) Factorization Machine based on paper [Factorization Machines with libFM](http://dl.acm.org/citation.cfm?doid=2168752.2168771).
It supports:
* dense and sparse inputs
* different optimization methods
* logging via TensorBoard
# Prerequisites
* [scikit-learn](http://scikit-learn.org/stable/)
* [numpy](http://www.numpy.org/)
* [tensorflow 0.8](https://www.tensorflow.org/)
* [tqdm](https://github.com/tqdm/tqdm)
# Usage
The interface is the same as of Scikit-learn models. To train a 6-order FM model with rank=10 for 100 iterations with learning_rate=0.01 use the following sample
```python
from tffm import TFFMClassifier
model = TFFMClassifier(
order=6,
rank=10,
optimizer=tf.train.AdamOptimizer(learning_rate=0.01),
n_epochs=100,
batch_size=-1,
init_std=0.001,
input_type='dense'
)
model.fit(X_tr, y_tr, show_progress=True)
```
See `example.ipynb` for more details
## Instruction:
Add inference complexity to Readme
## Code After:
This is a TensorFlow implementation of an arbitrary order (>=2) Factorization Machine based on paper [Factorization Machines with libFM](http://dl.acm.org/citation.cfm?doid=2168752.2168771).
It supports:
* dense and sparse inputs
* different (gradient-based) optimization methods
* logging via TensorBoard
The inference time is linear with respect to the number of features.
# Dependencies
* [scikit-learn](http://scikit-learn.org/stable/)
* [numpy](http://www.numpy.org/)
* [tensorflow 0.8](https://www.tensorflow.org/)
* [tqdm](https://github.com/tqdm/tqdm)
# Usage
The interface is the same as of Scikit-learn models. To train a 6-order FM model with rank=10 for 100 iterations with learning_rate=0.01 use the following sample
```python
from tffm import TFFMClassifier
model = TFFMClassifier(
order=6,
rank=10,
optimizer=tf.train.AdamOptimizer(learning_rate=0.01),
n_epochs=100,
batch_size=-1,
init_std=0.001,
input_type='dense'
)
model.fit(X_tr, y_tr, show_progress=True)
```
See `example.ipynb` for more details
| - This is a TensorFlow implementation of an arbitrary order (>=2) Factorization Machine based on paper [Factorization Machines with libFM](http://dl.acm.org/citation.cfm?doid=2168752.2168771).
? -
+ This is a TensorFlow implementation of an arbitrary order (>=2) Factorization Machine based on paper [Factorization Machines with libFM](http://dl.acm.org/citation.cfm?doid=2168752.2168771).
It supports:
* dense and sparse inputs
- * different optimization methods
+ * different (gradient-based) optimization methods
? +++++++++++++++++
* logging via TensorBoard
+ The inference time is linear with respect to the number of features.
- # Prerequisites
+
+ # Dependencies
* [scikit-learn](http://scikit-learn.org/stable/)
* [numpy](http://www.numpy.org/)
* [tensorflow 0.8](https://www.tensorflow.org/)
* [tqdm](https://github.com/tqdm/tqdm)
# Usage
The interface is the same as of Scikit-learn models. To train a 6-order FM model with rank=10 for 100 iterations with learning_rate=0.01 use the following sample
```python
from tffm import TFFMClassifier
model = TFFMClassifier(
- order=6,
? -
+ order=6,
- rank=10,
? -
+ rank=10,
- optimizer=tf.train.AdamOptimizer(learning_rate=0.01),
? -
+ optimizer=tf.train.AdamOptimizer(learning_rate=0.01),
- n_epochs=100,
? -
+ n_epochs=100,
batch_size=-1,
init_std=0.001,
input_type='dense'
)
model.fit(X_tr, y_tr, show_progress=True)
```
See `example.ipynb` for more details | 16 | 0.516129 | 9 | 7 |
3337130e015fba1d04a53e8e3a7098f966792f5f | lib/gitlab/plugin.rb | lib/gitlab/plugin.rb | module Gitlab
module Plugin
def self.files
Dir.glob(Rails.root.join('plugins/*')).select do |entry|
File.file?(entry)
end
end
def self.execute_all_async(data)
files.each do |file|
PluginWorker.perform_async(file, data)
end
end
def self.execute(file, data)
# Prepare the hook subprocess. Attach a pipe to its stdin, and merge
# both its stdout and stderr into our own stdout.
stdin_reader, stdin_writer = IO.pipe
hook_pid = spawn({}, file, in: stdin_reader, err: :out)
stdin_reader.close
# Submit changes to the hook via its stdin.
begin
IO.copy_stream(StringIO.new(data.to_json), stdin_writer)
rescue Errno::EPIPE
# It is not an error if the hook does not consume all of its input.
end
# Close the pipe to let the hook know there is no further input.
stdin_writer.close
Process.wait(hook_pid)
$?.success?
end
end
end
| module Gitlab
module Plugin
def self.files
Dir.glob(Rails.root.join('plugins/*')).select do |entry|
File.file?(entry)
end
end
def self.execute_all_async(data)
files.each do |file|
PluginWorker.perform_async(file, data)
end
end
def self.execute(file, data)
_output, exit_status = Gitlab::Popen.popen([file]) do |stdin|
stdin.write(data.to_json)
end
exit_status.zero?
end
end
end
| Use Gitlab::Popen instead of spawn | Use Gitlab::Popen instead of spawn [ci skip]
Signed-off-by: Dmitriy Zaporozhets <[email protected]>
| Ruby | mit | stoplightio/gitlabhq,iiet/iiet-git,dreampet/gitlab,dreampet/gitlab,mmkassem/gitlabhq,axilleas/gitlabhq,iiet/iiet-git,mmkassem/gitlabhq,axilleas/gitlabhq,iiet/iiet-git,mmkassem/gitlabhq,jirutka/gitlabhq,stoplightio/gitlabhq,dreampet/gitlab,iiet/iiet-git,jirutka/gitlabhq,axilleas/gitlabhq,axilleas/gitlabhq,mmkassem/gitlabhq,jirutka/gitlabhq,jirutka/gitlabhq,dreampet/gitlab,stoplightio/gitlabhq,stoplightio/gitlabhq | ruby | ## Code Before:
module Gitlab
module Plugin
def self.files
Dir.glob(Rails.root.join('plugins/*')).select do |entry|
File.file?(entry)
end
end
def self.execute_all_async(data)
files.each do |file|
PluginWorker.perform_async(file, data)
end
end
def self.execute(file, data)
# Prepare the hook subprocess. Attach a pipe to its stdin, and merge
# both its stdout and stderr into our own stdout.
stdin_reader, stdin_writer = IO.pipe
hook_pid = spawn({}, file, in: stdin_reader, err: :out)
stdin_reader.close
# Submit changes to the hook via its stdin.
begin
IO.copy_stream(StringIO.new(data.to_json), stdin_writer)
rescue Errno::EPIPE
# It is not an error if the hook does not consume all of its input.
end
# Close the pipe to let the hook know there is no further input.
stdin_writer.close
Process.wait(hook_pid)
$?.success?
end
end
end
## Instruction:
Use Gitlab::Popen instead of spawn [ci skip]
Signed-off-by: Dmitriy Zaporozhets <[email protected]>
## Code After:
module Gitlab
module Plugin
def self.files
Dir.glob(Rails.root.join('plugins/*')).select do |entry|
File.file?(entry)
end
end
def self.execute_all_async(data)
files.each do |file|
PluginWorker.perform_async(file, data)
end
end
def self.execute(file, data)
_output, exit_status = Gitlab::Popen.popen([file]) do |stdin|
stdin.write(data.to_json)
end
exit_status.zero?
end
end
end
| module Gitlab
module Plugin
def self.files
Dir.glob(Rails.root.join('plugins/*')).select do |entry|
File.file?(entry)
end
end
def self.execute_all_async(data)
files.each do |file|
PluginWorker.perform_async(file, data)
end
end
def self.execute(file, data)
+ _output, exit_status = Gitlab::Popen.popen([file]) do |stdin|
+ stdin.write(data.to_json)
- # Prepare the hook subprocess. Attach a pipe to its stdin, and merge
- # both its stdout and stderr into our own stdout.
- stdin_reader, stdin_writer = IO.pipe
- hook_pid = spawn({}, file, in: stdin_reader, err: :out)
- stdin_reader.close
-
- # Submit changes to the hook via its stdin.
- begin
- IO.copy_stream(StringIO.new(data.to_json), stdin_writer)
- rescue Errno::EPIPE
- # It is not an error if the hook does not consume all of its input.
end
+ exit_status.zero?
- # Close the pipe to let the hook know there is no further input.
- stdin_writer.close
-
- Process.wait(hook_pid)
- $?.success?
end
end
end | 19 | 0.527778 | 3 | 16 |
daee1e359daceee1519474461c3575c74869fbef | .travis.yml | .travis.yml | language: c, python3
addons:
apt:
packages:
- re2c
install:
- git clone https://github.com/martine/ninja.git
- cd ninja
- ./configure.py --bootstrap
- export PATH=$(pwd):$PATH
- cd ..
cache:
directories:
- ninja
script:
- ninja --version
- make Posix
- make run-posix
| language: c, python3
addons:
apt:
packages:
- re2c
install:
- CURDIR = $(pwd)
- if [ ! -d "~/foss/ninja" ]: then
- mkdir ~/foss/ninja
- git clone https://github.com/martine/ninja.git ~/foss/ninja
- cd ~/foss/ninja
- ./configure.py --bootstrap
fi
- export PATH=$(pwd):$PATH
- cd $CURDIR
cache:
directories:
- ~/foss
script:
- ninja --version
- make Posix
- make run-posix
| Add conditional to an install script. | Add conditional to an install script.
Not sure this works, but we need to conditionally do install ninja.
In the future we may need to validate the version if it did get cached.
| YAML | bsd-2-clause | winksaville/baremetal-hi,winksaville/baremetal-hi | yaml | ## Code Before:
language: c, python3
addons:
apt:
packages:
- re2c
install:
- git clone https://github.com/martine/ninja.git
- cd ninja
- ./configure.py --bootstrap
- export PATH=$(pwd):$PATH
- cd ..
cache:
directories:
- ninja
script:
- ninja --version
- make Posix
- make run-posix
## Instruction:
Add conditional to an install script.
Not sure this works, but we need to conditionally do install ninja.
In the future we may need to validate the version if it did get cached.
## Code After:
language: c, python3
addons:
apt:
packages:
- re2c
install:
- CURDIR = $(pwd)
- if [ ! -d "~/foss/ninja" ]: then
- mkdir ~/foss/ninja
- git clone https://github.com/martine/ninja.git ~/foss/ninja
- cd ~/foss/ninja
- ./configure.py --bootstrap
fi
- export PATH=$(pwd):$PATH
- cd $CURDIR
cache:
directories:
- ~/foss
script:
- ninja --version
- make Posix
- make run-posix
| language: c, python3
addons:
apt:
packages:
- re2c
install:
+ - CURDIR = $(pwd)
+ - if [ ! -d "~/foss/ninja" ]: then
+ - mkdir ~/foss/ninja
- - git clone https://github.com/martine/ninja.git
+ - git clone https://github.com/martine/ninja.git ~/foss/ninja
? ++ +++++++++++++
- - cd ninja
+ - cd ~/foss/ninja
- - ./configure.py --bootstrap
+ - ./configure.py --bootstrap
? ++
+ fi
- export PATH=$(pwd):$PATH
- - cd ..
+ - cd $CURDIR
cache:
directories:
- - ninja
+ - ~/foss
script:
- ninja --version
- make Posix
- make run-posix | 14 | 0.636364 | 9 | 5 |
1d664125d10daad41e993748944b4ca01dbac67e | tools/test-languages.sh | tools/test-languages.sh |
function setup_directory {
SET_LANG=$1
shift
for BOOK_DIR in "$@" ; do
openstack-generate-docbook -l $SET_LANG -b $BOOK_DIR -r ./
done
}
function setup_lang {
SET_LANG=$1
shift
echo ""
echo "Setting up files for $SET_LANG"
echo "======================="
mkdir -p generated/$SET_LANG
cp pom.xml generated/$SET_LANG/pom.xml
}
function test_manuals {
SET_LANG=$1
shift
setup_lang $SET_LANG
for BOOK in "$@" ; do
echo "Building $BOOK for language $SET_LANG..."
setup_directory $SET_LANG $BOOK
openstack-doc-test --check-build -l $SET_LANG --only-book $BOOK
RET=$?
if [ "$RET" -eq "0" ] ; then
echo "... succeeded"
else
echo "... failed"
BUILD_FAIL=1
fi
done
}
function test_all {
test_manuals 'es' 'api-quick-start'
test_manuals 'fr' 'api-quick-start'
test_manuals 'ja' 'api-quick-start'
}
BUILD_FAIL=0
test_all
exit $BUILD_FAIL
|
function setup_directory {
SET_LANG=$1
shift
for BOOK_DIR in "$@" ; do
openstack-generate-docbook -l $SET_LANG -b $BOOK_DIR -r ./
done
}
function setup_lang {
SET_LANG=$1
shift
echo ""
echo "Setting up files for $SET_LANG"
echo "======================="
mkdir -p generated/$SET_LANG
cp pom.xml generated/$SET_LANG/pom.xml
}
function test_manuals {
SET_LANG=$1
shift
setup_lang $SET_LANG
for BOOK in "$@" ; do
echo "Building $BOOK for language $SET_LANG..."
setup_directory $SET_LANG $BOOK
openstack-doc-test --check-build -l $SET_LANG --only-book $BOOK
RET=$?
if [ "$RET" -eq "0" ] ; then
echo "... succeeded"
else
echo "... failed"
BUILD_FAIL=1
fi
done
}
function test_all {
test_manuals 'de' 'api-quick-start'
test_manuals 'es' 'api-quick-start'
test_manuals 'fr' 'api-quick-start'
test_manuals 'ja' 'api-quick-start'
}
BUILD_FAIL=0
test_all
exit $BUILD_FAIL
| Add test for German api-quick-start | Add test for German api-quick-start
The German file is now 100 % translated, so include it in testing.
Change-Id: I91ae5d8296c76f2df08b68cc139256410c33a358
| Shell | apache-2.0 | rackerlabs/api-site,dreamhost/api-site,dreamhost/api-site,dreamhost/api-site,Tesora/tesora-api-site,Tesora/tesora-api-site,rackerlabs/api-site,Tesora/tesora-api-site,Tesora/tesora-api-site,DonSchenck/api-site,openstack/api-site,Tesora/tesora-api-site,openstack/api-site,dreamhost/api-site,DonSchenck/api-site,dreamhost/api-site,openstack/api-site,dreamhost/api-site,Tesora/tesora-api-site,dreamhost/api-site,rackerlabs/api-site,Tesora/tesora-api-site,rackerlabs/api-site,DonSchenck/api-site,openstack/api-site,DonSchenck/api-site,DonSchenck/api-site | shell | ## Code Before:
function setup_directory {
SET_LANG=$1
shift
for BOOK_DIR in "$@" ; do
openstack-generate-docbook -l $SET_LANG -b $BOOK_DIR -r ./
done
}
function setup_lang {
SET_LANG=$1
shift
echo ""
echo "Setting up files for $SET_LANG"
echo "======================="
mkdir -p generated/$SET_LANG
cp pom.xml generated/$SET_LANG/pom.xml
}
function test_manuals {
SET_LANG=$1
shift
setup_lang $SET_LANG
for BOOK in "$@" ; do
echo "Building $BOOK for language $SET_LANG..."
setup_directory $SET_LANG $BOOK
openstack-doc-test --check-build -l $SET_LANG --only-book $BOOK
RET=$?
if [ "$RET" -eq "0" ] ; then
echo "... succeeded"
else
echo "... failed"
BUILD_FAIL=1
fi
done
}
function test_all {
test_manuals 'es' 'api-quick-start'
test_manuals 'fr' 'api-quick-start'
test_manuals 'ja' 'api-quick-start'
}
BUILD_FAIL=0
test_all
exit $BUILD_FAIL
## Instruction:
Add test for German api-quick-start
The German file is now 100 % translated, so include it in testing.
Change-Id: I91ae5d8296c76f2df08b68cc139256410c33a358
## Code After:
function setup_directory {
SET_LANG=$1
shift
for BOOK_DIR in "$@" ; do
openstack-generate-docbook -l $SET_LANG -b $BOOK_DIR -r ./
done
}
function setup_lang {
SET_LANG=$1
shift
echo ""
echo "Setting up files for $SET_LANG"
echo "======================="
mkdir -p generated/$SET_LANG
cp pom.xml generated/$SET_LANG/pom.xml
}
function test_manuals {
SET_LANG=$1
shift
setup_lang $SET_LANG
for BOOK in "$@" ; do
echo "Building $BOOK for language $SET_LANG..."
setup_directory $SET_LANG $BOOK
openstack-doc-test --check-build -l $SET_LANG --only-book $BOOK
RET=$?
if [ "$RET" -eq "0" ] ; then
echo "... succeeded"
else
echo "... failed"
BUILD_FAIL=1
fi
done
}
function test_all {
test_manuals 'de' 'api-quick-start'
test_manuals 'es' 'api-quick-start'
test_manuals 'fr' 'api-quick-start'
test_manuals 'ja' 'api-quick-start'
}
BUILD_FAIL=0
test_all
exit $BUILD_FAIL
|
function setup_directory {
SET_LANG=$1
shift
for BOOK_DIR in "$@" ; do
openstack-generate-docbook -l $SET_LANG -b $BOOK_DIR -r ./
done
}
function setup_lang {
SET_LANG=$1
shift
echo ""
echo "Setting up files for $SET_LANG"
echo "======================="
mkdir -p generated/$SET_LANG
cp pom.xml generated/$SET_LANG/pom.xml
}
function test_manuals {
SET_LANG=$1
shift
setup_lang $SET_LANG
for BOOK in "$@" ; do
echo "Building $BOOK for language $SET_LANG..."
setup_directory $SET_LANG $BOOK
openstack-doc-test --check-build -l $SET_LANG --only-book $BOOK
RET=$?
if [ "$RET" -eq "0" ] ; then
echo "... succeeded"
else
echo "... failed"
BUILD_FAIL=1
fi
done
}
function test_all {
+ test_manuals 'de' 'api-quick-start'
test_manuals 'es' 'api-quick-start'
test_manuals 'fr' 'api-quick-start'
test_manuals 'ja' 'api-quick-start'
}
BUILD_FAIL=0
test_all
exit $BUILD_FAIL | 1 | 0.020833 | 1 | 0 |
f8a33fb47fa5dfbc3ec1b3f286a2a3fb447d8ad7 | ci-scripts/tripleo-upstream/promote-hash.sh | ci-scripts/tripleo-upstream/promote-hash.sh | set -e
echo ======== PROMOTE HASH
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $SCRIPT_DIR/dlrnapi_venv.sh
trap deactivate_dlrnapi_venv EXIT
activate_dlrnapi_venv
source $WORKSPACE/hash_info.sh
if [ "$RELEASE" = "master" ]; then
COMMIT_HASH=3b718f3fecc866332ec0663fa77e758f8346ab93
DISTRO_HASH=4204ba89997cae739e41526b575027e333a2277d
fi
set -u
# Assign label to the specific hash using the DLRN API
dlrnapi --url $DLRNAPI_URL \
--username review_rdoproject_org \
repo-promote \
--commit-hash $COMMIT_HASH \
--distro-hash $DISTRO_HASH \
--promote-name $PROMOTE_NAME
echo ======== PROMOTE HASH COMPLETED
| set -e
echo ======== PROMOTE HASH
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $SCRIPT_DIR/dlrnapi_venv.sh
trap deactivate_dlrnapi_venv EXIT
activate_dlrnapi_venv
source $WORKSPACE/hash_info.sh
set -u
# Assign label to the specific hash using the DLRN API
dlrnapi --url $DLRNAPI_URL \
--username review_rdoproject_org \
repo-promote \
--commit-hash $COMMIT_HASH \
--distro-hash $DISTRO_HASH \
--promote-name $PROMOTE_NAME
echo ======== PROMOTE HASH COMPLETED
| Revert "tripleo: fix the pin" | Revert "tripleo: fix the pin"
This reverts commit 40516a810d7ad210dba84e863cbe595d47fe3b44.
Revert "temporarily pin master to a fixed hash"
This reverts commit beb889ff6ad79d83180dd63b41f0026217c1d412.
Change-Id: Ia78d546867f911816f2d200bc7c04e65eac70696
| Shell | apache-2.0 | rdo-infra/ci-config,redhat-openstack/rdo-infra,redhat-openstack/rdo-infra,rdo-infra/ci-config,rdo-infra/ci-config,rdo-infra/ci-config,redhat-openstack/rdo-infra,redhat-openstack/rdo-infra | shell | ## Code Before:
set -e
echo ======== PROMOTE HASH
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $SCRIPT_DIR/dlrnapi_venv.sh
trap deactivate_dlrnapi_venv EXIT
activate_dlrnapi_venv
source $WORKSPACE/hash_info.sh
if [ "$RELEASE" = "master" ]; then
COMMIT_HASH=3b718f3fecc866332ec0663fa77e758f8346ab93
DISTRO_HASH=4204ba89997cae739e41526b575027e333a2277d
fi
set -u
# Assign label to the specific hash using the DLRN API
dlrnapi --url $DLRNAPI_URL \
--username review_rdoproject_org \
repo-promote \
--commit-hash $COMMIT_HASH \
--distro-hash $DISTRO_HASH \
--promote-name $PROMOTE_NAME
echo ======== PROMOTE HASH COMPLETED
## Instruction:
Revert "tripleo: fix the pin"
This reverts commit 40516a810d7ad210dba84e863cbe595d47fe3b44.
Revert "temporarily pin master to a fixed hash"
This reverts commit beb889ff6ad79d83180dd63b41f0026217c1d412.
Change-Id: Ia78d546867f911816f2d200bc7c04e65eac70696
## Code After:
set -e
echo ======== PROMOTE HASH
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $SCRIPT_DIR/dlrnapi_venv.sh
trap deactivate_dlrnapi_venv EXIT
activate_dlrnapi_venv
source $WORKSPACE/hash_info.sh
set -u
# Assign label to the specific hash using the DLRN API
dlrnapi --url $DLRNAPI_URL \
--username review_rdoproject_org \
repo-promote \
--commit-hash $COMMIT_HASH \
--distro-hash $DISTRO_HASH \
--promote-name $PROMOTE_NAME
echo ======== PROMOTE HASH COMPLETED
| set -e
echo ======== PROMOTE HASH
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $SCRIPT_DIR/dlrnapi_venv.sh
trap deactivate_dlrnapi_venv EXIT
activate_dlrnapi_venv
source $WORKSPACE/hash_info.sh
- if [ "$RELEASE" = "master" ]; then
- COMMIT_HASH=3b718f3fecc866332ec0663fa77e758f8346ab93
- DISTRO_HASH=4204ba89997cae739e41526b575027e333a2277d
- fi
-
set -u
# Assign label to the specific hash using the DLRN API
dlrnapi --url $DLRNAPI_URL \
--username review_rdoproject_org \
repo-promote \
--commit-hash $COMMIT_HASH \
--distro-hash $DISTRO_HASH \
--promote-name $PROMOTE_NAME
echo ======== PROMOTE HASH COMPLETED | 5 | 0.178571 | 0 | 5 |
e91c65ae77e031d317ffe9ce36d86394ff4e3dda | homebrew/install.sh | homebrew/install.sh | if test ! $(which brew)
then
echo " Installing Homebrew for you."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Install homebrew packages
brew install brew-cask curl git htop-osx jenv lynx maven openssl rmtrash tree wget tig boot2docker docker \
Caskroom/cask/virtualbox Caskroom/cask/xmind --with-cocoa --srgb emacs Caskroom/cask/vagrant
exit 0
| if test ! $(which brew)
then
echo " Installing Homebrew for you."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Install homebrew packages
brew install brew-cask curl git htop-osx jenv lynx maven openssl rmtrash tree wget tig boot2docker docker \
Caskroom/cask/virtualbox Caskroom/cask/xmind --with-cocoa --srgb emacs Caskroom/cask/vagrant Caskroom/cask/intellij-idea-ce Caskroom/cask/sbt
exit 0
| Install IntelliJ IDEA CE + sbt | Install IntelliJ IDEA CE + sbt
| Shell | mit | nicokosi/dotfiles,nicokosi/dotfiles | shell | ## Code Before:
if test ! $(which brew)
then
echo " Installing Homebrew for you."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Install homebrew packages
brew install brew-cask curl git htop-osx jenv lynx maven openssl rmtrash tree wget tig boot2docker docker \
Caskroom/cask/virtualbox Caskroom/cask/xmind --with-cocoa --srgb emacs Caskroom/cask/vagrant
exit 0
## Instruction:
Install IntelliJ IDEA CE + sbt
## Code After:
if test ! $(which brew)
then
echo " Installing Homebrew for you."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Install homebrew packages
brew install brew-cask curl git htop-osx jenv lynx maven openssl rmtrash tree wget tig boot2docker docker \
Caskroom/cask/virtualbox Caskroom/cask/xmind --with-cocoa --srgb emacs Caskroom/cask/vagrant Caskroom/cask/intellij-idea-ce Caskroom/cask/sbt
exit 0
| if test ! $(which brew)
then
echo " Installing Homebrew for you."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Install homebrew packages
brew install brew-cask curl git htop-osx jenv lynx maven openssl rmtrash tree wget tig boot2docker docker \
- Caskroom/cask/virtualbox Caskroom/cask/xmind --with-cocoa --srgb emacs Caskroom/cask/vagrant
+ Caskroom/cask/virtualbox Caskroom/cask/xmind --with-cocoa --srgb emacs Caskroom/cask/vagrant Caskroom/cask/intellij-idea-ce Caskroom/cask/sbt
? +++++++++++++++++++++++++++++++++++++++++++++++++
exit 0 | 2 | 0.181818 | 1 | 1 |
70c052fb4faeafd3fa31fc3d030f70b5aed19b5c | src/internal/_curryN.js | src/internal/_curryN.js | var _arity = require('./_arity');
/**
* Internal curryN function.
*
* @private
* @category Function
* @param {Number} length The arity of the curried function.
* @return {array} An array of arguments received thus far.
* @param {Function} fn The function to curry.
*/
module.exports = function _curryN(length, received, fn) {
return function() {
var combined = [];
var argsIdx = 0;
var left = length;
var combinedIdx = 0;
while (combinedIdx < received.length || argsIdx < arguments.length) {
var result;
if (combinedIdx < received.length &&
(received[combinedIdx] == null ||
received[combinedIdx]['@@functional/placeholder'] !== true ||
argsIdx >= arguments.length)) {
result = received[combinedIdx];
} else {
result = arguments[argsIdx];
argsIdx += 1;
}
combined[combinedIdx] = result;
if (result == null || result['@@functional/placeholder'] !== true) {
left -= 1;
}
combinedIdx += 1;
}
return left <= 0 ? fn.apply(this, combined) : _arity(left, _curryN(length, combined, fn));
};
};
| var _arity = require('./_arity');
/**
* Internal curryN function.
*
* @private
* @category Function
* @param {Number} length The arity of the curried function.
* @param {Array} An array of arguments received thus far.
* @param {Function} fn The function to curry.
* @return {Function} The curried function.
*/
module.exports = function _curryN(length, received, fn) {
return function() {
var combined = [];
var argsIdx = 0;
var left = length;
var combinedIdx = 0;
while (combinedIdx < received.length || argsIdx < arguments.length) {
var result;
if (combinedIdx < received.length &&
(received[combinedIdx] == null ||
received[combinedIdx]['@@functional/placeholder'] !== true ||
argsIdx >= arguments.length)) {
result = received[combinedIdx];
} else {
result = arguments[argsIdx];
argsIdx += 1;
}
combined[combinedIdx] = result;
if (result == null || result['@@functional/placeholder'] !== true) {
left -= 1;
}
combinedIdx += 1;
}
return left <= 0 ? fn.apply(this, combined) : _arity(left, _curryN(length, combined, fn));
};
};
| Fix param/return documentation for internal curryN | Fix param/return documentation for internal curryN
fix(_curryN) fix capitalization in return type
| JavaScript | mit | jimf/ramda,arcseldon/ramda,maowug/ramda,kedashoe/ramda,asaf-romano/ramda,ccorcos/ramda,iofjuupasli/ramda,jimf/ramda,asaf-romano/ramda,besarthoxhaj/ramda,Bradcomp/ramda,davidchambers/ramda,ramda/ramda,svozza/ramda,arcseldon/ramda,maowug/ramda,Nigiss/ramda,CrossEye/ramda,angeloocana/ramda,angeloocana/ramda,Nigiss/ramda,ramda/ramda,TheLudd/ramda,jethrolarson/ramda,TheLudd/ramda,asaf-romano/ramda,Bradcomp/ramda,iofjuupasli/ramda,Nigiss/ramda,besarthoxhaj/ramda,ccorcos/ramda,CrossEye/ramda,jethrolarson/ramda,plynch/ramda,ramda/ramda,benperez/ramda,plynch/ramda,CrossEye/ramda,buzzdecafe/ramda,buzzdecafe/ramda,jethrolarson/ramda,paldepind/ramda,kedashoe/ramda,paldepind/ramda,svozza/ramda,davidchambers/ramda,benperez/ramda | javascript | ## Code Before:
var _arity = require('./_arity');
/**
* Internal curryN function.
*
* @private
* @category Function
* @param {Number} length The arity of the curried function.
* @return {array} An array of arguments received thus far.
* @param {Function} fn The function to curry.
*/
module.exports = function _curryN(length, received, fn) {
return function() {
var combined = [];
var argsIdx = 0;
var left = length;
var combinedIdx = 0;
while (combinedIdx < received.length || argsIdx < arguments.length) {
var result;
if (combinedIdx < received.length &&
(received[combinedIdx] == null ||
received[combinedIdx]['@@functional/placeholder'] !== true ||
argsIdx >= arguments.length)) {
result = received[combinedIdx];
} else {
result = arguments[argsIdx];
argsIdx += 1;
}
combined[combinedIdx] = result;
if (result == null || result['@@functional/placeholder'] !== true) {
left -= 1;
}
combinedIdx += 1;
}
return left <= 0 ? fn.apply(this, combined) : _arity(left, _curryN(length, combined, fn));
};
};
## Instruction:
Fix param/return documentation for internal curryN
fix(_curryN) fix capitalization in return type
## Code After:
var _arity = require('./_arity');
/**
* Internal curryN function.
*
* @private
* @category Function
* @param {Number} length The arity of the curried function.
* @param {Array} An array of arguments received thus far.
* @param {Function} fn The function to curry.
* @return {Function} The curried function.
*/
module.exports = function _curryN(length, received, fn) {
return function() {
var combined = [];
var argsIdx = 0;
var left = length;
var combinedIdx = 0;
while (combinedIdx < received.length || argsIdx < arguments.length) {
var result;
if (combinedIdx < received.length &&
(received[combinedIdx] == null ||
received[combinedIdx]['@@functional/placeholder'] !== true ||
argsIdx >= arguments.length)) {
result = received[combinedIdx];
} else {
result = arguments[argsIdx];
argsIdx += 1;
}
combined[combinedIdx] = result;
if (result == null || result['@@functional/placeholder'] !== true) {
left -= 1;
}
combinedIdx += 1;
}
return left <= 0 ? fn.apply(this, combined) : _arity(left, _curryN(length, combined, fn));
};
};
| var _arity = require('./_arity');
/**
* Internal curryN function.
*
* @private
* @category Function
* @param {Number} length The arity of the curried function.
- * @return {array} An array of arguments received thus far.
? ^^^^^ ^
+ * @param {Array} An array of arguments received thus far.
? ++ ^^ ^
* @param {Function} fn The function to curry.
+ * @return {Function} The curried function.
*/
module.exports = function _curryN(length, received, fn) {
return function() {
var combined = [];
var argsIdx = 0;
var left = length;
var combinedIdx = 0;
while (combinedIdx < received.length || argsIdx < arguments.length) {
var result;
if (combinedIdx < received.length &&
(received[combinedIdx] == null ||
received[combinedIdx]['@@functional/placeholder'] !== true ||
argsIdx >= arguments.length)) {
result = received[combinedIdx];
} else {
result = arguments[argsIdx];
argsIdx += 1;
}
combined[combinedIdx] = result;
if (result == null || result['@@functional/placeholder'] !== true) {
left -= 1;
}
combinedIdx += 1;
}
return left <= 0 ? fn.apply(this, combined) : _arity(left, _curryN(length, combined, fn));
};
}; | 3 | 0.078947 | 2 | 1 |
ded1b4bd322c0ef65caea3e01c497023f6be2115 | locale-theme/en/app.po | locale-theme/en/app.po | msgid ""
"First, type in the <strong>name of the UK public authority</strong> you'd \n"
" <br>like information from. <strong>By law, they have to respond</strong>\n"
" (<a href=\"%s\">why?</a>)."
msgstr ""
"First, type in the <strong>name of the public authority</strong> you'd \n"
" <br>like information from. <strong>By law, they have to respond</strong>\n"
" (<a href=\"%s\">why?</a>)."
msgid "Summary:"
msgstr "Subject:"
| msgid ""
"First, type in the <strong>name of the UK public authority</strong> you'd \n"
" <br>like information from. <strong>By law, they have to respond</strong>\n"
" (<a href=\"%s\">why?</a>)."
msgstr ""
"First, type in the <strong>name of the public authority</strong> you'd \n"
" <br>like information from. <strong>By law, they have to respond</strong>\n"
" (<a href=\"%s\">why?</a>)."
msgid "Summary:"
msgstr "Subject:"
#: app/views/layouts/default.rhtml:15
msgid "Make and browse Freedom of Information (FOI) requests"
msgstr "Make and browse access to information requests" | Remove FOI reference from site title | Remove FOI reference from site title
| Gettext Catalog | mit | mysociety/asktheeu-theme,crowbot/asktheeu-theme,mysociety/asktheeu-theme,access-info/asktheeu-theme | gettext-catalog | ## Code Before:
msgid ""
"First, type in the <strong>name of the UK public authority</strong> you'd \n"
" <br>like information from. <strong>By law, they have to respond</strong>\n"
" (<a href=\"%s\">why?</a>)."
msgstr ""
"First, type in the <strong>name of the public authority</strong> you'd \n"
" <br>like information from. <strong>By law, they have to respond</strong>\n"
" (<a href=\"%s\">why?</a>)."
msgid "Summary:"
msgstr "Subject:"
## Instruction:
Remove FOI reference from site title
## Code After:
msgid ""
"First, type in the <strong>name of the UK public authority</strong> you'd \n"
" <br>like information from. <strong>By law, they have to respond</strong>\n"
" (<a href=\"%s\">why?</a>)."
msgstr ""
"First, type in the <strong>name of the public authority</strong> you'd \n"
" <br>like information from. <strong>By law, they have to respond</strong>\n"
" (<a href=\"%s\">why?</a>)."
msgid "Summary:"
msgstr "Subject:"
#: app/views/layouts/default.rhtml:15
msgid "Make and browse Freedom of Information (FOI) requests"
msgstr "Make and browse access to information requests" | msgid ""
"First, type in the <strong>name of the UK public authority</strong> you'd \n"
" <br>like information from. <strong>By law, they have to respond</strong>\n"
" (<a href=\"%s\">why?</a>)."
msgstr ""
"First, type in the <strong>name of the public authority</strong> you'd \n"
" <br>like information from. <strong>By law, they have to respond</strong>\n"
" (<a href=\"%s\">why?</a>)."
msgid "Summary:"
msgstr "Subject:"
+ #: app/views/layouts/default.rhtml:15
+ msgid "Make and browse Freedom of Information (FOI) requests"
+ msgstr "Make and browse access to information requests" | 3 | 0.25 | 3 | 0 |
22acb2e3c304bc9d40c9804d1a2268d7c1290104 | pkgs/applications/virtualization/virtualbox/extpack.nix | pkgs/applications/virtualization/virtualbox/extpack.nix | {stdenv, fetchurl, lib}:
with lib;
let version = "5.2.22";
in
fetchurl rec {
name = "Oracle_VM_VirtualBox_Extension_Pack-${version}.vbox-extpack";
url = "https://download.virtualbox.org/virtualbox/${version}/${name}";
sha256 = "1vria59m7xr521hp2sakfihv8282xcfd5hl6dr1gbcjicmk514kp";
meta = {
description = "Oracle Extension pack for VirtualBox";
license = licenses.virtualbox-puel;
homepage = https://www.virtualbox.org/;
maintainers = with maintainers; [ flokli sander cdepillabout ];
platforms = [ "x86_64-linux" "i686-linux" ];
};
}
| {stdenv, fetchurl, lib}:
with lib;
let version = "5.2.22";
in
fetchurl rec {
name = "Oracle_VM_VirtualBox_Extension_Pack-${version}.vbox-extpack";
url = "https://download.virtualbox.org/virtualbox/${version}/${name}";
sha256 =
# Manually sha256sum the extensionPack file, must be hex!
# Thus do not use `nix-prefetch-url` but instead plain old `sha256sum`.
let value = "779250666551b2f5426e86c2d21ceb0209b46174536971611025f753535131ef";
in assert (builtins.stringLength value) == 64; value;
meta = {
description = "Oracle Extension pack for VirtualBox";
license = licenses.virtualbox-puel;
homepage = https://www.virtualbox.org/;
maintainers = with maintainers; [ flokli sander cdepillabout ];
platforms = [ "x86_64-linux" "i686-linux" ];
};
}
| Fix the sha256 to be hex. | vboxExtpack: Fix the sha256 to be hex.
It does not work if the sha256 is not hex, it fails because VBoxExtPackHelperApp requires to be given a hex hash.
See https://github.com/NixOS/nixpkgs/issues/34846 where the same problem was fixed some time ago.
| Nix | mit | NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs | nix | ## Code Before:
{stdenv, fetchurl, lib}:
with lib;
let version = "5.2.22";
in
fetchurl rec {
name = "Oracle_VM_VirtualBox_Extension_Pack-${version}.vbox-extpack";
url = "https://download.virtualbox.org/virtualbox/${version}/${name}";
sha256 = "1vria59m7xr521hp2sakfihv8282xcfd5hl6dr1gbcjicmk514kp";
meta = {
description = "Oracle Extension pack for VirtualBox";
license = licenses.virtualbox-puel;
homepage = https://www.virtualbox.org/;
maintainers = with maintainers; [ flokli sander cdepillabout ];
platforms = [ "x86_64-linux" "i686-linux" ];
};
}
## Instruction:
vboxExtpack: Fix the sha256 to be hex.
It does not work if the sha256 is not hex, it fails because VBoxExtPackHelperApp requires to be given a hex hash.
See https://github.com/NixOS/nixpkgs/issues/34846 where the same problem was fixed some time ago.
## Code After:
{stdenv, fetchurl, lib}:
with lib;
let version = "5.2.22";
in
fetchurl rec {
name = "Oracle_VM_VirtualBox_Extension_Pack-${version}.vbox-extpack";
url = "https://download.virtualbox.org/virtualbox/${version}/${name}";
sha256 =
# Manually sha256sum the extensionPack file, must be hex!
# Thus do not use `nix-prefetch-url` but instead plain old `sha256sum`.
let value = "779250666551b2f5426e86c2d21ceb0209b46174536971611025f753535131ef";
in assert (builtins.stringLength value) == 64; value;
meta = {
description = "Oracle Extension pack for VirtualBox";
license = licenses.virtualbox-puel;
homepage = https://www.virtualbox.org/;
maintainers = with maintainers; [ flokli sander cdepillabout ];
platforms = [ "x86_64-linux" "i686-linux" ];
};
}
| {stdenv, fetchurl, lib}:
with lib;
let version = "5.2.22";
in
fetchurl rec {
name = "Oracle_VM_VirtualBox_Extension_Pack-${version}.vbox-extpack";
url = "https://download.virtualbox.org/virtualbox/${version}/${name}";
- sha256 = "1vria59m7xr521hp2sakfihv8282xcfd5hl6dr1gbcjicmk514kp";
+ sha256 =
+ # Manually sha256sum the extensionPack file, must be hex!
+ # Thus do not use `nix-prefetch-url` but instead plain old `sha256sum`.
+ let value = "779250666551b2f5426e86c2d21ceb0209b46174536971611025f753535131ef";
+ in assert (builtins.stringLength value) == 64; value;
meta = {
description = "Oracle Extension pack for VirtualBox";
license = licenses.virtualbox-puel;
homepage = https://www.virtualbox.org/;
maintainers = with maintainers; [ flokli sander cdepillabout ];
platforms = [ "x86_64-linux" "i686-linux" ];
};
} | 6 | 0.315789 | 5 | 1 |
16c72b852c65981875f7554aba7502f09a2dec2e | app/controllers/feedback_controller.rb | app/controllers/feedback_controller.rb | class FeedbackController < ApplicationController
require 'zendesk_api'
layout 'full_width'
def feedback
@booking_feedback = BookingFeedbackForm.new(booking_feedback_params)
create_ticket if @booking_feedback.valid?
if request.xhr?
status = @booking_feedback.invalid? ? :bad_request : :ok
render partial: 'feedback/result',
status: status
end
end
private
def client
@client ||= ZendeskAPI::Client.new do |config|
config.url = 'https://pensionwise.zendesk.com/api/v2'
config.username = ENV.fetch('ZENDESK_API_USERNAME', '')
config.token = ENV.fetch('ZENDESK_API_TOKEN', '')
end
end
def create_ticket
return true if Rails.env.development? || Rails.env.test?
ZendeskAPI::Ticket.create!(
client,
subject: 'Online Booking feedback',
comment: {
value: feedback_comment
},
submitter_id: client.current_user.id
)
end
def booking_feedback_params
params
.fetch(:booking_feedback, {})
.permit(
:name,
:email,
:message
)
end
def feedback_comment
<<~eos
Name: #{@booking_feedback.name}
Email: #{@booking_feedback.email}
Message: #{@booking_feedback.message}
eos
end
end
| class FeedbackController < ApplicationController
require 'zendesk_api'
layout 'full_width'
def feedback
@booking_feedback = BookingFeedbackForm.new(booking_feedback_params)
create_ticket if @booking_feedback.valid?
if request.xhr?
status = @booking_feedback.invalid? ? :bad_request : :ok
render partial: 'feedback/result',
status: status
end
end
private
def client
@client ||= ZendeskAPI::Client.new do |config|
config.url = 'https://pensionwise.zendesk.com/api/v2'
config.username = ENV.fetch('ZENDESK_API_USERNAME', '')
config.token = ENV.fetch('ZENDESK_API_TOKEN', '')
end
end
def create_ticket
return true if Rails.env.development? || Rails.env.test?
ZendeskAPI::Ticket.create!(
client,
subject: 'Online Booking feedback',
comment: {
value: feedback_comment
},
submitter_id: client.current_user.id,
tags: %w(online_booking)
)
end
def booking_feedback_params
params
.fetch(:booking_feedback, {})
.permit(
:name,
:email,
:message
)
end
def feedback_comment
<<~eos
Name: #{@booking_feedback.name}
Email: #{@booking_feedback.email}
Message: #{@booking_feedback.message}
eos
end
end
| Tag tickets created from feedback form with `online_booking` | Tag tickets created from feedback form with `online_booking`
So the feedback can easily be identified in Zendesk.
| Ruby | mit | guidance-guarantee-programme/pension_guidance,guidance-guarantee-programme/pension_guidance,guidance-guarantee-programme/pension_guidance | ruby | ## Code Before:
class FeedbackController < ApplicationController
require 'zendesk_api'
layout 'full_width'
def feedback
@booking_feedback = BookingFeedbackForm.new(booking_feedback_params)
create_ticket if @booking_feedback.valid?
if request.xhr?
status = @booking_feedback.invalid? ? :bad_request : :ok
render partial: 'feedback/result',
status: status
end
end
private
def client
@client ||= ZendeskAPI::Client.new do |config|
config.url = 'https://pensionwise.zendesk.com/api/v2'
config.username = ENV.fetch('ZENDESK_API_USERNAME', '')
config.token = ENV.fetch('ZENDESK_API_TOKEN', '')
end
end
def create_ticket
return true if Rails.env.development? || Rails.env.test?
ZendeskAPI::Ticket.create!(
client,
subject: 'Online Booking feedback',
comment: {
value: feedback_comment
},
submitter_id: client.current_user.id
)
end
def booking_feedback_params
params
.fetch(:booking_feedback, {})
.permit(
:name,
:email,
:message
)
end
def feedback_comment
<<~eos
Name: #{@booking_feedback.name}
Email: #{@booking_feedback.email}
Message: #{@booking_feedback.message}
eos
end
end
## Instruction:
Tag tickets created from feedback form with `online_booking`
So the feedback can easily be identified in Zendesk.
## Code After:
class FeedbackController < ApplicationController
require 'zendesk_api'
layout 'full_width'
def feedback
@booking_feedback = BookingFeedbackForm.new(booking_feedback_params)
create_ticket if @booking_feedback.valid?
if request.xhr?
status = @booking_feedback.invalid? ? :bad_request : :ok
render partial: 'feedback/result',
status: status
end
end
private
def client
@client ||= ZendeskAPI::Client.new do |config|
config.url = 'https://pensionwise.zendesk.com/api/v2'
config.username = ENV.fetch('ZENDESK_API_USERNAME', '')
config.token = ENV.fetch('ZENDESK_API_TOKEN', '')
end
end
def create_ticket
return true if Rails.env.development? || Rails.env.test?
ZendeskAPI::Ticket.create!(
client,
subject: 'Online Booking feedback',
comment: {
value: feedback_comment
},
submitter_id: client.current_user.id,
tags: %w(online_booking)
)
end
def booking_feedback_params
params
.fetch(:booking_feedback, {})
.permit(
:name,
:email,
:message
)
end
def feedback_comment
<<~eos
Name: #{@booking_feedback.name}
Email: #{@booking_feedback.email}
Message: #{@booking_feedback.message}
eos
end
end
| class FeedbackController < ApplicationController
require 'zendesk_api'
layout 'full_width'
def feedback
@booking_feedback = BookingFeedbackForm.new(booking_feedback_params)
create_ticket if @booking_feedback.valid?
if request.xhr?
status = @booking_feedback.invalid? ? :bad_request : :ok
render partial: 'feedback/result',
status: status
end
end
private
def client
@client ||= ZendeskAPI::Client.new do |config|
config.url = 'https://pensionwise.zendesk.com/api/v2'
config.username = ENV.fetch('ZENDESK_API_USERNAME', '')
config.token = ENV.fetch('ZENDESK_API_TOKEN', '')
end
end
def create_ticket
return true if Rails.env.development? || Rails.env.test?
ZendeskAPI::Ticket.create!(
client,
subject: 'Online Booking feedback',
comment: {
value: feedback_comment
},
- submitter_id: client.current_user.id
+ submitter_id: client.current_user.id,
? +
+ tags: %w(online_booking)
)
end
def booking_feedback_params
params
.fetch(:booking_feedback, {})
.permit(
:name,
:email,
:message
)
end
def feedback_comment
<<~eos
Name: #{@booking_feedback.name}
Email: #{@booking_feedback.email}
Message: #{@booking_feedback.message}
eos
end
end | 3 | 0.05 | 2 | 1 |
ead2f795480ae7e671c93550e55cf9e106b2f306 | hubblestack_nova/pkgng_audit.py | hubblestack_nova/pkgng_audit.py | '''
Hubble Nova plugin for FreeBSD pkgng audit
:maintainer: HubbleStack
:maturity: 20160421
:platform: FreeBSD
:requires: SaltStack
'''
from __future__ import absolute_import
import logging
log = logging.getLogger(__name__)
__tags__ = None
def __virtual__():
if 'FreeBSD' not in __grains__['os']:
return False, 'This audit module only runs on FreeBSD'
global __tags__
__tags__ = ['freebsd-pkg-audit']
return True
def audit(tags, verbose=False):
'''
Run the pkg.audit command
'''
ret = {'Success': [], 'Failure': []}
salt_ret = __salt__['pkg.audit']()
if '0 problem(s)' not in salt_ret:
ret['Failure'].append(salt_ret)
else:
ret['Success'].append(salt_ret)
return ret
| '''
Hubble Nova plugin for FreeBSD pkgng audit
:maintainer: HubbleStack
:maturity: 20160421
:platform: FreeBSD
:requires: SaltStack
'''
from __future__ import absolute_import
import logging
log = logging.getLogger(__name__)
def __virtual__():
if 'FreeBSD' not in __grains__['os']:
return False, 'This audit module only runs on FreeBSD'
return True
def audit(data_list, tags, verbose=False):
'''
Run the pkg.audit command
'''
ret = {'Success': [], 'Failure': []}
__tags__ = []
for data in data_list:
if 'freebsd-pkg' in data:
__tags__ = ['freebsd-pkg-audit']
break
if not __tags__:
# No yaml data found, don't do any work
return ret
salt_ret = __salt__['pkg.audit']()
if '0 problem(s)' not in salt_ret:
ret['Failure'].append(salt_ret)
else:
ret['Success'].append(salt_ret)
return ret
| Update frebsd-pkg-audit to rely on yaml data and take data from hubble.py | Update frebsd-pkg-audit to rely on yaml data and take data from hubble.py
| Python | apache-2.0 | HubbleStack/Nova,avb76/Nova,SaltyCharles/Nova,cedwards/Nova | python | ## Code Before:
'''
Hubble Nova plugin for FreeBSD pkgng audit
:maintainer: HubbleStack
:maturity: 20160421
:platform: FreeBSD
:requires: SaltStack
'''
from __future__ import absolute_import
import logging
log = logging.getLogger(__name__)
__tags__ = None
def __virtual__():
if 'FreeBSD' not in __grains__['os']:
return False, 'This audit module only runs on FreeBSD'
global __tags__
__tags__ = ['freebsd-pkg-audit']
return True
def audit(tags, verbose=False):
'''
Run the pkg.audit command
'''
ret = {'Success': [], 'Failure': []}
salt_ret = __salt__['pkg.audit']()
if '0 problem(s)' not in salt_ret:
ret['Failure'].append(salt_ret)
else:
ret['Success'].append(salt_ret)
return ret
## Instruction:
Update frebsd-pkg-audit to rely on yaml data and take data from hubble.py
## Code After:
'''
Hubble Nova plugin for FreeBSD pkgng audit
:maintainer: HubbleStack
:maturity: 20160421
:platform: FreeBSD
:requires: SaltStack
'''
from __future__ import absolute_import
import logging
log = logging.getLogger(__name__)
def __virtual__():
if 'FreeBSD' not in __grains__['os']:
return False, 'This audit module only runs on FreeBSD'
return True
def audit(data_list, tags, verbose=False):
'''
Run the pkg.audit command
'''
ret = {'Success': [], 'Failure': []}
__tags__ = []
for data in data_list:
if 'freebsd-pkg' in data:
__tags__ = ['freebsd-pkg-audit']
break
if not __tags__:
# No yaml data found, don't do any work
return ret
salt_ret = __salt__['pkg.audit']()
if '0 problem(s)' not in salt_ret:
ret['Failure'].append(salt_ret)
else:
ret['Success'].append(salt_ret)
return ret
| '''
Hubble Nova plugin for FreeBSD pkgng audit
:maintainer: HubbleStack
:maturity: 20160421
:platform: FreeBSD
:requires: SaltStack
'''
from __future__ import absolute_import
import logging
log = logging.getLogger(__name__)
- __tags__ = None
-
def __virtual__():
if 'FreeBSD' not in __grains__['os']:
return False, 'This audit module only runs on FreeBSD'
- global __tags__
- __tags__ = ['freebsd-pkg-audit']
return True
- def audit(tags, verbose=False):
+ def audit(data_list, tags, verbose=False):
? +++++++++++
'''
Run the pkg.audit command
'''
ret = {'Success': [], 'Failure': []}
+
+ __tags__ = []
+ for data in data_list:
+ if 'freebsd-pkg' in data:
+ __tags__ = ['freebsd-pkg-audit']
+ break
+
+ if not __tags__:
+ # No yaml data found, don't do any work
+ return ret
salt_ret = __salt__['pkg.audit']()
if '0 problem(s)' not in salt_ret:
ret['Failure'].append(salt_ret)
else:
ret['Success'].append(salt_ret)
return ret | 16 | 0.432432 | 11 | 5 |
e9764f30a245653d40348b2288bc228c7a9c53cf | postgres-entry.sh | postgres-entry.sh | set -e
echo "CREATE USER '$OSM_USER';"
gosu postgres postgres --single -jE <<-EOL
CREATE USER "$OSM_USER";
EOL
echo "CREATE DATABASE '$OSM_DB';"
gosu postgres postgres --single -jE <<-EOL
CREATE DATABASE "$OSM_DB";
EOL
echo "GRANT ALL ON DATABASE '$OSM_DB' TO '$OSM_USER';"
gosu postgres postgres --single -jE <<-EOL
GRANT ALL ON DATABASE "$OSM_DB" TO "$OSM_USER";
EOL
# Postgis extension cannot be created in single user mode.
# So we will do it the kludge way by starting the server,
# updating the DB, then shutting down the server so the
# rest of the docker-postgres init scripts can finish.
echo "Starting postrges ..."
gosu postgres pg_ctl -w start
echo "CREATE EXTENSION postgis, hstore + ALTER TABLEs"
gosu postgres psql "$OSM_DB" <<-EOL
CREATE EXTENSION postgis;
CREATE EXTENSION hstore;
ALTER TABLE geometry_columns OWNER TO "$OSM_USER";
ALTER TABLE spatial_ref_sys OWNER TO "$OSM_USER";
EOL
echo "Stopping postgres ..."
gosu postgres pg_ctl stop
| set -e
echo "CREATE USER '$OSM_USER';"
gosu postgres psql <<-EOL
CREATE USER "$OSM_USER";
EOL
echo "CREATE DATABASE '$OSM_DB';"
gosu postgres psql <<-EOL
CREATE DATABASE "$OSM_DB";
EOL
echo "GRANT ALL ON DATABASE '$OSM_DB' TO '$OSM_USER';"
gosu postgres psql <<-EOL
GRANT ALL ON DATABASE "$OSM_DB" TO "$OSM_USER";
EOL
# Postgis extension cannot be created in single user mode.
# So we will do it the kludge way by starting the server,
# updating the DB, then shutting down the server so the
# rest of the docker-postgres init scripts can finish.
# echo "Starting postrges ..."
# gosu postgres pg_ctl -w start
echo "CREATE EXTENSION postgis, hstore + ALTER TABLEs"
gosu postgres psql "$OSM_DB" <<-EOL
CREATE EXTENSION postgis;
CREATE EXTENSION hstore;
ALTER TABLE geometry_columns OWNER TO "$OSM_USER";
ALTER TABLE spatial_ref_sys OWNER TO "$OSM_USER";
EOL
# echo "Stopping postgres ..."
# gosu postgres pg_ctl stop
| Stop using single user mode, when setting up database | Stop using single user mode, when setting up database | Shell | mit | sigita42/docker-postgres-osm | shell | ## Code Before:
set -e
echo "CREATE USER '$OSM_USER';"
gosu postgres postgres --single -jE <<-EOL
CREATE USER "$OSM_USER";
EOL
echo "CREATE DATABASE '$OSM_DB';"
gosu postgres postgres --single -jE <<-EOL
CREATE DATABASE "$OSM_DB";
EOL
echo "GRANT ALL ON DATABASE '$OSM_DB' TO '$OSM_USER';"
gosu postgres postgres --single -jE <<-EOL
GRANT ALL ON DATABASE "$OSM_DB" TO "$OSM_USER";
EOL
# Postgis extension cannot be created in single user mode.
# So we will do it the kludge way by starting the server,
# updating the DB, then shutting down the server so the
# rest of the docker-postgres init scripts can finish.
echo "Starting postrges ..."
gosu postgres pg_ctl -w start
echo "CREATE EXTENSION postgis, hstore + ALTER TABLEs"
gosu postgres psql "$OSM_DB" <<-EOL
CREATE EXTENSION postgis;
CREATE EXTENSION hstore;
ALTER TABLE geometry_columns OWNER TO "$OSM_USER";
ALTER TABLE spatial_ref_sys OWNER TO "$OSM_USER";
EOL
echo "Stopping postgres ..."
gosu postgres pg_ctl stop
## Instruction:
Stop using single user mode, when setting up database
## Code After:
set -e
echo "CREATE USER '$OSM_USER';"
gosu postgres psql <<-EOL
CREATE USER "$OSM_USER";
EOL
echo "CREATE DATABASE '$OSM_DB';"
gosu postgres psql <<-EOL
CREATE DATABASE "$OSM_DB";
EOL
echo "GRANT ALL ON DATABASE '$OSM_DB' TO '$OSM_USER';"
gosu postgres psql <<-EOL
GRANT ALL ON DATABASE "$OSM_DB" TO "$OSM_USER";
EOL
# Postgis extension cannot be created in single user mode.
# So we will do it the kludge way by starting the server,
# updating the DB, then shutting down the server so the
# rest of the docker-postgres init scripts can finish.
# echo "Starting postrges ..."
# gosu postgres pg_ctl -w start
echo "CREATE EXTENSION postgis, hstore + ALTER TABLEs"
gosu postgres psql "$OSM_DB" <<-EOL
CREATE EXTENSION postgis;
CREATE EXTENSION hstore;
ALTER TABLE geometry_columns OWNER TO "$OSM_USER";
ALTER TABLE spatial_ref_sys OWNER TO "$OSM_USER";
EOL
# echo "Stopping postgres ..."
# gosu postgres pg_ctl stop
| set -e
echo "CREATE USER '$OSM_USER';"
- gosu postgres postgres --single -jE <<-EOL
+ gosu postgres psql <<-EOL
CREATE USER "$OSM_USER";
EOL
echo "CREATE DATABASE '$OSM_DB';"
- gosu postgres postgres --single -jE <<-EOL
+ gosu postgres psql <<-EOL
CREATE DATABASE "$OSM_DB";
EOL
echo "GRANT ALL ON DATABASE '$OSM_DB' TO '$OSM_USER';"
- gosu postgres postgres --single -jE <<-EOL
+ gosu postgres psql <<-EOL
GRANT ALL ON DATABASE "$OSM_DB" TO "$OSM_USER";
EOL
# Postgis extension cannot be created in single user mode.
# So we will do it the kludge way by starting the server,
# updating the DB, then shutting down the server so the
# rest of the docker-postgres init scripts can finish.
- echo "Starting postrges ..."
+ # echo "Starting postrges ..."
? ++
- gosu postgres pg_ctl -w start
+ # gosu postgres pg_ctl -w start
? ++
echo "CREATE EXTENSION postgis, hstore + ALTER TABLEs"
gosu postgres psql "$OSM_DB" <<-EOL
CREATE EXTENSION postgis;
CREATE EXTENSION hstore;
ALTER TABLE geometry_columns OWNER TO "$OSM_USER";
ALTER TABLE spatial_ref_sys OWNER TO "$OSM_USER";
EOL
- echo "Stopping postgres ..."
+ # echo "Stopping postgres ..."
? ++
- gosu postgres pg_ctl stop
+ # gosu postgres pg_ctl stop
? ++
| 14 | 0.4 | 7 | 7 |
7db47ec61daca00ab5c0807b311087480dae59f5 | packages/li/libBF.yaml | packages/li/libBF.yaml | homepage: ''
changelog-type: markdown
hash: c2d03eb510d4cda999c5e7eb89967e4ee442437acbc9624fa62700a17b1d2109
test-bench-deps:
base: -any
libBF: -any
maintainer: [email protected]
synopsis: A binding to the libBF library.
changelog: |
# Revision history for libBF-hs
## 0.5.0 -- 2020-07-01
* First version. Released on an unsuspecting world.
basic-deps:
base: '>=4.12.0.0 && <5'
libBF: -any
deepseq: -any
all-versions:
- 0.5.0
author: Iavor Diatchki
latest: 0.5.0
description-type: haddock
description: |-
LibBF is a C library for working with arbitray precision
IEEE 754 floating point numbers.
license-name: MIT
| homepage: ''
changelog-type: markdown
hash: c906917a67fbe3806e7b1c3d5318d3731ddeac6397ef5b2ab29566747241dcda
test-bench-deps:
base: -any
libBF: -any
maintainer: [email protected]
synopsis: A binding to the libBF library.
changelog: |
# Revision history for libBF-hs
## 0.5.0 -- 2020-07-01
* First version. Released on an unsuspecting world.
basic-deps:
base: '>=4.12.0.0 && <5'
libBF: -any
deepseq: -any
all-versions:
- 0.5.1
author: Iavor Diatchki
latest: 0.5.1
description-type: haddock
description: |-
LibBF is a C library for working with arbitray precision
IEEE 754 floating point numbers.
license-name: MIT
| Update from Hackage at 2020-07-01T18:27:08Z | Update from Hackage at 2020-07-01T18:27:08Z
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: ''
changelog-type: markdown
hash: c2d03eb510d4cda999c5e7eb89967e4ee442437acbc9624fa62700a17b1d2109
test-bench-deps:
base: -any
libBF: -any
maintainer: [email protected]
synopsis: A binding to the libBF library.
changelog: |
# Revision history for libBF-hs
## 0.5.0 -- 2020-07-01
* First version. Released on an unsuspecting world.
basic-deps:
base: '>=4.12.0.0 && <5'
libBF: -any
deepseq: -any
all-versions:
- 0.5.0
author: Iavor Diatchki
latest: 0.5.0
description-type: haddock
description: |-
LibBF is a C library for working with arbitray precision
IEEE 754 floating point numbers.
license-name: MIT
## Instruction:
Update from Hackage at 2020-07-01T18:27:08Z
## Code After:
homepage: ''
changelog-type: markdown
hash: c906917a67fbe3806e7b1c3d5318d3731ddeac6397ef5b2ab29566747241dcda
test-bench-deps:
base: -any
libBF: -any
maintainer: [email protected]
synopsis: A binding to the libBF library.
changelog: |
# Revision history for libBF-hs
## 0.5.0 -- 2020-07-01
* First version. Released on an unsuspecting world.
basic-deps:
base: '>=4.12.0.0 && <5'
libBF: -any
deepseq: -any
all-versions:
- 0.5.1
author: Iavor Diatchki
latest: 0.5.1
description-type: haddock
description: |-
LibBF is a C library for working with arbitray precision
IEEE 754 floating point numbers.
license-name: MIT
| homepage: ''
changelog-type: markdown
- hash: c2d03eb510d4cda999c5e7eb89967e4ee442437acbc9624fa62700a17b1d2109
+ hash: c906917a67fbe3806e7b1c3d5318d3731ddeac6397ef5b2ab29566747241dcda
test-bench-deps:
base: -any
libBF: -any
maintainer: [email protected]
synopsis: A binding to the libBF library.
changelog: |
# Revision history for libBF-hs
## 0.5.0 -- 2020-07-01
* First version. Released on an unsuspecting world.
basic-deps:
base: '>=4.12.0.0 && <5'
libBF: -any
deepseq: -any
all-versions:
- - 0.5.0
? ^
+ - 0.5.1
? ^
author: Iavor Diatchki
- latest: 0.5.0
? ^
+ latest: 0.5.1
? ^
description-type: haddock
description: |-
LibBF is a C library for working with arbitray precision
IEEE 754 floating point numbers.
license-name: MIT | 6 | 0.222222 | 3 | 3 |
b26a9440fb61152f60a7fa1429847046df7d0c88 | .travis.yml | .travis.yml | language: ruby
rvm:
- "2.0.0"
# uncomment this line if your project needs to run something other than `rake`:
script: "bundle exec rspec spec && bundle exec guard-jasmine"
| language: ruby
rvm:
- "2.0.0"
# uncomment this line if your project needs to run something other than `rake`:
script: "bundle exec rspec spec && bundle exec guard-jasmine --server-timeout=60"
| Add timeout for jasmine specs | Add timeout for jasmine specs
| YAML | mit | clayton/tavernforum,clayton/tavernforum | yaml | ## Code Before:
language: ruby
rvm:
- "2.0.0"
# uncomment this line if your project needs to run something other than `rake`:
script: "bundle exec rspec spec && bundle exec guard-jasmine"
## Instruction:
Add timeout for jasmine specs
## Code After:
language: ruby
rvm:
- "2.0.0"
# uncomment this line if your project needs to run something other than `rake`:
script: "bundle exec rspec spec && bundle exec guard-jasmine --server-timeout=60"
| language: ruby
rvm:
- "2.0.0"
# uncomment this line if your project needs to run something other than `rake`:
- script: "bundle exec rspec spec && bundle exec guard-jasmine"
+ script: "bundle exec rspec spec && bundle exec guard-jasmine --server-timeout=60"
? ++++++++++++++++++++
| 2 | 0.4 | 1 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.