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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4ea01d8f6058e6c7d76f9f1bb5ee87c93b9c2ff9 | doc/INSTALL.md | doc/INSTALL.md | ```
# Python
[sudo] yum install Python-devel
# MySQL
[sudo] yum install MySQL-python
[sudo] yum install mysql-devel
# PIP
[sudo] yum install epel-release
[sudo] yum install python-pip
# gcc-c++
[sudo] yum install gcc-c++
```
#### On Mac OS X
```
# grep
brew install ggrep
# find
brew install findutils
```
#### Install Python Dependents
```
cd /path/to/cobra
[sudo] pip install -r requirements.txt
```
#### Config Cobra
```
cp config.example config
vim config
```
#### Start Cobra
```
python cobra.py start
``` | ```
# Python
[sudo] yum install Python-devel
# MySQL
[sudo] yum install MySQL-python
[sudo] yum install mysql-devel
# PIP
[sudo] yum install epel-release
[sudo] yum install python-pip
# gcc-c++
[sudo] yum install gcc-c++
```
#### On Mac OS X
On latest homebrew ggrep is moved to homebrew/dupes tap.
```
# grep
brew install homebrew/dupes/grep
# find
brew install findutils
```
#### Install Python Dependents
```
cd /path/to/cobra
[sudo] pip install -r requirements.txt
```
#### Config Cobra
```
cp config.example config
vim config
```
#### Start Cobra
```
python cobra.py start
```
| Update gnu grep install command | Update gnu grep install command | Markdown | mit | 40huo/cobra,braveghz/cobra,LiGhT1EsS/cobra,wufeifei/cobra,40huo/cobra,LiGhT1EsS/cobra,braveghz/cobra,40huo/cobra,LiGhT1EsS/cobra,wufeifei/cobra,wufeifei/cobra,40huo/cobra,wufeifei/cobra,braveghz/cobra,wufeifei/cobra,LiGhT1EsS/cobra,LiGhT1EsS/cobra,braveghz/cobra,braveghz/cobra,braveghz/cobra,wufeifei/cobra,40huo/cobra,40huo/cobra,LiGhT1EsS/cobra | markdown | ## Code Before:
```
# Python
[sudo] yum install Python-devel
# MySQL
[sudo] yum install MySQL-python
[sudo] yum install mysql-devel
# PIP
[sudo] yum install epel-release
[sudo] yum install python-pip
# gcc-c++
[sudo] yum install gcc-c++
```
#### On Mac OS X
```
# grep
brew install ggrep
# find
brew install findutils
```
#### Install Python Dependents
```
cd /path/to/cobra
[sudo] pip install -r requirements.txt
```
#### Config Cobra
```
cp config.example config
vim config
```
#### Start Cobra
```
python cobra.py start
```
## Instruction:
Update gnu grep install command
## Code After:
```
# Python
[sudo] yum install Python-devel
# MySQL
[sudo] yum install MySQL-python
[sudo] yum install mysql-devel
# PIP
[sudo] yum install epel-release
[sudo] yum install python-pip
# gcc-c++
[sudo] yum install gcc-c++
```
#### On Mac OS X
On latest homebrew ggrep is moved to homebrew/dupes tap.
```
# grep
brew install homebrew/dupes/grep
# find
brew install findutils
```
#### Install Python Dependents
```
cd /path/to/cobra
[sudo] pip install -r requirements.txt
```
#### Config Cobra
```
cp config.example config
vim config
```
#### Start Cobra
```
python cobra.py start
```
| ```
# Python
[sudo] yum install Python-devel
# MySQL
[sudo] yum install MySQL-python
[sudo] yum install mysql-devel
# PIP
[sudo] yum install epel-release
[sudo] yum install python-pip
# gcc-c++
[sudo] yum install gcc-c++
```
#### On Mac OS X
+
+ On latest homebrew ggrep is moved to homebrew/dupes tap.
+
```
# grep
- brew install ggrep
+ brew install homebrew/dupes/grep
# find
brew install findutils
```
#### Install Python Dependents
```
cd /path/to/cobra
[sudo] pip install -r requirements.txt
```
#### Config Cobra
```
cp config.example config
vim config
```
#### Start Cobra
```
python cobra.py start
``` | 5 | 0.121951 | 4 | 1 |
a0a8cce2a97aca0dae5fe7081963200b5a2e9b03 | .travis.yml | .travis.yml | language: python
os:
- linux
python:
- '3.6'
install:
- pip install pytest-pep8 pytest-cov
- pip install codecov
- pip install netaddr
- pip install -e .[tests]
script:
- pytest --pep8 -m pep8 cuckoo/
- PYTHONPATH=$PWD:$PYTHONPATH pytest --cov=./ tests/
after_success:
- codecov
| language: python
os:
- linux
python:
- '3.6'
install:
- pip install pytest-pep8 pytest-cov==2.6.1 pytest==3.3.0
- pip install codecov
- pip install netaddr
- pip install -e .[tests]
script:
- pytest --pep8 -m pep8 cuckoo/
- PYTHONPATH=$PWD:$PYTHONPATH pytest --cov=./ tests/
after_success:
- codecov
| Fix the version of pytest-cov and pytest to avoid conflicting version in Travis. | Fix the version of pytest-cov and pytest to avoid conflicting version in Travis.
| YAML | mit | huydhn/cuckoo-filter,huydhn/cuckoo-filter | yaml | ## Code Before:
language: python
os:
- linux
python:
- '3.6'
install:
- pip install pytest-pep8 pytest-cov
- pip install codecov
- pip install netaddr
- pip install -e .[tests]
script:
- pytest --pep8 -m pep8 cuckoo/
- PYTHONPATH=$PWD:$PYTHONPATH pytest --cov=./ tests/
after_success:
- codecov
## Instruction:
Fix the version of pytest-cov and pytest to avoid conflicting version in Travis.
## Code After:
language: python
os:
- linux
python:
- '3.6'
install:
- pip install pytest-pep8 pytest-cov==2.6.1 pytest==3.3.0
- pip install codecov
- pip install netaddr
- pip install -e .[tests]
script:
- pytest --pep8 -m pep8 cuckoo/
- PYTHONPATH=$PWD:$PYTHONPATH pytest --cov=./ tests/
after_success:
- codecov
| language: python
os:
- linux
python:
- '3.6'
install:
- - pip install pytest-pep8 pytest-cov
+ - pip install pytest-pep8 pytest-cov==2.6.1 pytest==3.3.0
? +++++++++++++++++++++
- pip install codecov
- pip install netaddr
- pip install -e .[tests]
script:
- pytest --pep8 -m pep8 cuckoo/
- PYTHONPATH=$PWD:$PYTHONPATH pytest --cov=./ tests/
after_success:
- codecov | 2 | 0.133333 | 1 | 1 |
14a7e9fc1890a03c29a0b2a068822252147b73a4 | src/_assets/common/_roadshow.scss | src/_assets/common/_roadshow.scss | @mixin roadshow {
& > div {
@extend .row, .py-5;
background-position-y: bottom;
background-position-x: center;
background-repeat: no-repeat;
background-size: 600px 1px;
border-bottom: 1px solid $gray-200;
}
& > div:nth-child(odd) {
div:nth-child(1) {
@extend .col-sm-6;
}
& > pre,
& > div:nth-child(2) {
@extend .col-sm-5, .ml-auto;
a {
display: block;
text-align: right;
}
}
}
& > div:nth-child(even) {
div:nth-child(1) {
@extend .col-sm-6, .order-2, .ml-auto;
}
& > pre,
& > div:nth-child(2) {
@extend .col-sm-5;
a {
display: block;
text-align: right;
}
}
}
img {
@extend .img-fluid, .rounded;
width: 100%;
border: 1px solid $gray-300;
}
h3,
h4 {
line-height: 2rem;
}
.enterprise h3:after, .enterprise h4:after {
@include enterprise-icon;
content: 'e';
}
}
| @mixin roadshow {
& > div {
@extend .row, .py-5;
background-position-y: bottom;
background-position-x: center;
background-repeat: no-repeat;
background-size: 600px 1px;
border-bottom: 1px solid $gray-200;
}
& > div:nth-child(odd) {
div:nth-child(1) {
@extend .col-sm-6;
}
& > pre,
& > div:nth-child(2) {
@extend .col-sm-5, .ml-auto;
a {
display: block;
text-align: right;
}
}
}
& > div:nth-child(even) {
div:nth-child(1) {
@extend .col-sm-6, .order-2, .ml-auto;
}
& > pre,
& > div:nth-child(2) {
@extend .col-sm-5;
a {
display: block;
text-align: right;
}
}
}
img {
@extend .img-fluid, .rounded;
width: 100%;
border: 1px solid $gray-300;
}
h3,
h4 {
line-height: 2rem;
.anchorjs-link {
display: none;
}
}
.enterprise h3:after, .enterprise h4:after {
@include enterprise-icon;
content: 'e';
}
}
| Remove anchor links on homepage | Remove anchor links on homepage
| SCSS | mit | ceolter/angular-grid,ceolter/angular-grid,ceolter/ag-grid,ceolter/ag-grid | scss | ## Code Before:
@mixin roadshow {
& > div {
@extend .row, .py-5;
background-position-y: bottom;
background-position-x: center;
background-repeat: no-repeat;
background-size: 600px 1px;
border-bottom: 1px solid $gray-200;
}
& > div:nth-child(odd) {
div:nth-child(1) {
@extend .col-sm-6;
}
& > pre,
& > div:nth-child(2) {
@extend .col-sm-5, .ml-auto;
a {
display: block;
text-align: right;
}
}
}
& > div:nth-child(even) {
div:nth-child(1) {
@extend .col-sm-6, .order-2, .ml-auto;
}
& > pre,
& > div:nth-child(2) {
@extend .col-sm-5;
a {
display: block;
text-align: right;
}
}
}
img {
@extend .img-fluid, .rounded;
width: 100%;
border: 1px solid $gray-300;
}
h3,
h4 {
line-height: 2rem;
}
.enterprise h3:after, .enterprise h4:after {
@include enterprise-icon;
content: 'e';
}
}
## Instruction:
Remove anchor links on homepage
## Code After:
@mixin roadshow {
& > div {
@extend .row, .py-5;
background-position-y: bottom;
background-position-x: center;
background-repeat: no-repeat;
background-size: 600px 1px;
border-bottom: 1px solid $gray-200;
}
& > div:nth-child(odd) {
div:nth-child(1) {
@extend .col-sm-6;
}
& > pre,
& > div:nth-child(2) {
@extend .col-sm-5, .ml-auto;
a {
display: block;
text-align: right;
}
}
}
& > div:nth-child(even) {
div:nth-child(1) {
@extend .col-sm-6, .order-2, .ml-auto;
}
& > pre,
& > div:nth-child(2) {
@extend .col-sm-5;
a {
display: block;
text-align: right;
}
}
}
img {
@extend .img-fluid, .rounded;
width: 100%;
border: 1px solid $gray-300;
}
h3,
h4 {
line-height: 2rem;
.anchorjs-link {
display: none;
}
}
.enterprise h3:after, .enterprise h4:after {
@include enterprise-icon;
content: 'e';
}
}
| @mixin roadshow {
& > div {
@extend .row, .py-5;
background-position-y: bottom;
background-position-x: center;
background-repeat: no-repeat;
background-size: 600px 1px;
border-bottom: 1px solid $gray-200;
}
& > div:nth-child(odd) {
div:nth-child(1) {
@extend .col-sm-6;
}
& > pre,
& > div:nth-child(2) {
@extend .col-sm-5, .ml-auto;
a {
display: block;
text-align: right;
}
}
}
& > div:nth-child(even) {
div:nth-child(1) {
@extend .col-sm-6, .order-2, .ml-auto;
}
& > pre,
& > div:nth-child(2) {
@extend .col-sm-5;
a {
display: block;
text-align: right;
}
}
}
img {
@extend .img-fluid, .rounded;
width: 100%;
border: 1px solid $gray-300;
}
h3,
h4 {
line-height: 2rem;
+
+ .anchorjs-link {
+ display: none;
+ }
}
.enterprise h3:after, .enterprise h4:after {
@include enterprise-icon;
content: 'e';
}
} | 4 | 0.071429 | 4 | 0 |
b8d022270a10d59cc895acafad4742ad61e3460c | server/routes/authRouter.js | server/routes/authRouter.js | var authRouter = require('express').Router();
var jwt = require('jwt-simple');
var auth = require('../lib/auth');
var User = require('../../db/models/User');
var Promise = require('bluebird');
var bcrypt = require('bcryptjs');
bcrypt.compare = Promise.promisify(bcrypt.compare);
authRouter.post('/login', function(req, res) {
var email = req.body.email;
var password = req.body.password;
if (!email || !password) {
res.status(400).send('Incomplete email/password');
return;
}
User.query().where('email', email)
.then(function(user) {
var user = user[0];
if (!user) {
throw 'Error: user does not exist';
} else {
return Promise.all([
bcrypt.compare(password, user.password),
user
]);
}
})
.spread(function(authenticated, user) {
if (!authenticated) {
throw 'Invalid password';
} else {
var payload = { id: user.id };
var token = jwt.encode(payload, auth.cfg.jwtSecret);
res.json({ token: token });
}
})
.catch(function(authError) {
res.status(401).send(authError);
})
.error(function(err) {
console.error('Auth server error: ', err);
res.status(500).send('Server error');
});
});
module.exports = authRouter; | var authRouter = require('express').Router();
var jwt = require('jwt-simple');
var auth = require('../lib/auth');
var User = require('../../db/models/User');
var Promise = require('bluebird');
var bcrypt = require('bcryptjs');
bcrypt.compare = Promise.promisify(bcrypt.compare);
authRouter.post('/login', function(req, res) {
var email = req.body.email;
var password = req.body.password;
if (!email || !password) {
res.status(400).send('Incomplete email/password');
return;
}
User.query().where('email', email)
.then(function(user) {
var user = user[0];
if (!user) {
throw 'Error: user does not exist';
} else {
return Promise.all([
bcrypt.compare(password, user.password),
user
]);
}
})
.spread(function(authenticated, user) {
if (!authenticated) {
throw 'Invalid password';
} else {
var payload = { id: user.id, exp: Math.round((Date.now() + 30 * 24 * 60 * 1000) / 1000) };
var token = jwt.encode(payload, auth.cfg.jwtSecret);
res.json({ token: token });
}
})
.catch(function(authError) {
res.status(401).send(authError);
})
.error(function(err) {
console.error('Auth server error: ', err);
res.status(500).send('Server error');
});
});
module.exports = authRouter;
| Set JWT expiration date to 30 days | Set JWT expiration date to 30 days
| JavaScript | mit | SillySalamanders/Reactivity,SillySalamanders/Reactivity | javascript | ## Code Before:
var authRouter = require('express').Router();
var jwt = require('jwt-simple');
var auth = require('../lib/auth');
var User = require('../../db/models/User');
var Promise = require('bluebird');
var bcrypt = require('bcryptjs');
bcrypt.compare = Promise.promisify(bcrypt.compare);
authRouter.post('/login', function(req, res) {
var email = req.body.email;
var password = req.body.password;
if (!email || !password) {
res.status(400).send('Incomplete email/password');
return;
}
User.query().where('email', email)
.then(function(user) {
var user = user[0];
if (!user) {
throw 'Error: user does not exist';
} else {
return Promise.all([
bcrypt.compare(password, user.password),
user
]);
}
})
.spread(function(authenticated, user) {
if (!authenticated) {
throw 'Invalid password';
} else {
var payload = { id: user.id };
var token = jwt.encode(payload, auth.cfg.jwtSecret);
res.json({ token: token });
}
})
.catch(function(authError) {
res.status(401).send(authError);
})
.error(function(err) {
console.error('Auth server error: ', err);
res.status(500).send('Server error');
});
});
module.exports = authRouter;
## Instruction:
Set JWT expiration date to 30 days
## Code After:
var authRouter = require('express').Router();
var jwt = require('jwt-simple');
var auth = require('../lib/auth');
var User = require('../../db/models/User');
var Promise = require('bluebird');
var bcrypt = require('bcryptjs');
bcrypt.compare = Promise.promisify(bcrypt.compare);
authRouter.post('/login', function(req, res) {
var email = req.body.email;
var password = req.body.password;
if (!email || !password) {
res.status(400).send('Incomplete email/password');
return;
}
User.query().where('email', email)
.then(function(user) {
var user = user[0];
if (!user) {
throw 'Error: user does not exist';
} else {
return Promise.all([
bcrypt.compare(password, user.password),
user
]);
}
})
.spread(function(authenticated, user) {
if (!authenticated) {
throw 'Invalid password';
} else {
var payload = { id: user.id, exp: Math.round((Date.now() + 30 * 24 * 60 * 1000) / 1000) };
var token = jwt.encode(payload, auth.cfg.jwtSecret);
res.json({ token: token });
}
})
.catch(function(authError) {
res.status(401).send(authError);
})
.error(function(err) {
console.error('Auth server error: ', err);
res.status(500).send('Server error');
});
});
module.exports = authRouter;
| var authRouter = require('express').Router();
var jwt = require('jwt-simple');
var auth = require('../lib/auth');
var User = require('../../db/models/User');
var Promise = require('bluebird');
var bcrypt = require('bcryptjs');
bcrypt.compare = Promise.promisify(bcrypt.compare);
authRouter.post('/login', function(req, res) {
var email = req.body.email;
var password = req.body.password;
if (!email || !password) {
res.status(400).send('Incomplete email/password');
return;
}
User.query().where('email', email)
.then(function(user) {
var user = user[0];
if (!user) {
throw 'Error: user does not exist';
} else {
return Promise.all([
bcrypt.compare(password, user.password),
user
]);
}
})
.spread(function(authenticated, user) {
if (!authenticated) {
throw 'Invalid password';
} else {
- var payload = { id: user.id };
+ var payload = { id: user.id, exp: Math.round((Date.now() + 30 * 24 * 60 * 1000) / 1000) };
var token = jwt.encode(payload, auth.cfg.jwtSecret);
res.json({ token: token });
}
})
.catch(function(authError) {
res.status(401).send(authError);
})
.error(function(err) {
console.error('Auth server error: ', err);
res.status(500).send('Server error');
});
});
module.exports = authRouter; | 2 | 0.042553 | 1 | 1 |
5077ace256d28f20ce0ddd088a57cac45bb3a156 | app/controllers/admin/venues_controller.rb | app/controllers/admin/venues_controller.rb | class Admin::VenuesController < AdminController
respond_to :html, :json
include SquashManyDuplicatesMixin # provides squash_many_duplicates
def index
@venues = Venue.non_duplicates
# ransack-compatible param-based search (might use real gem later if enough uses)
if params[:latitude_null].presence && params[:longitude_null].presence
@venues = @venues.where(:latitude => nil, :longitude => nil)
end
@venues = @venues.order(:title)
respond_with [:admin, @venues]
end
def duplicates
@venues = Venue.non_duplicates.order(:title)
@groupings = []
if params[:type] == 'matching_title'
@groupings = @venues.group_by(&:title)
elsif params[:type] == 'matching_lat_long'
@venues = @venues.where('latitude is not null and longitude is not null')
@groupings = @venues.group_by {|v| [v.latitude.to_s, v.longitude.to_s] }
end
@groupings = @groupings.reject {|k,v| v.size < 2 }
respond_with @groupings
end
end
| class Admin::VenuesController < AdminController
respond_to :html, :json
include SquashManyDuplicatesMixin # provides squash_many_duplicates
def index
@venues = Venue.non_duplicates
# ransack-compatible param-based search (might use real gem later if enough uses)
if params[:type] == 'missing_lat_long'
@venues = @venues.where('latitude is null or longitude is null')
end
@venues = @venues.order(:title)
respond_with [:admin, @venues]
end
def duplicates
@venues = Venue.non_duplicates.order(:title)
@groupings = []
if params[:type] == 'matching_title'
@groupings = @venues.group_by(&:title)
elsif params[:type] == 'matching_lat_long'
@venues = @venues.where('latitude is not null and longitude is not null')
@groupings = @venues.group_by {|v| [v.latitude.to_s, v.longitude.to_s] }
end
@groupings = @groupings.reject {|k,v| v.size < 2 }
respond_with @groupings
end
end
| Make venues index use params[:type], like events in admin view | Make venues index use params[:type], like events in admin view
| Ruby | mit | CorainChicago/ActivateHub,CorainChicago/ActivateHub,CorainChicago/ActivateHub,CorainChicago/ActivateHub | ruby | ## Code Before:
class Admin::VenuesController < AdminController
respond_to :html, :json
include SquashManyDuplicatesMixin # provides squash_many_duplicates
def index
@venues = Venue.non_duplicates
# ransack-compatible param-based search (might use real gem later if enough uses)
if params[:latitude_null].presence && params[:longitude_null].presence
@venues = @venues.where(:latitude => nil, :longitude => nil)
end
@venues = @venues.order(:title)
respond_with [:admin, @venues]
end
def duplicates
@venues = Venue.non_duplicates.order(:title)
@groupings = []
if params[:type] == 'matching_title'
@groupings = @venues.group_by(&:title)
elsif params[:type] == 'matching_lat_long'
@venues = @venues.where('latitude is not null and longitude is not null')
@groupings = @venues.group_by {|v| [v.latitude.to_s, v.longitude.to_s] }
end
@groupings = @groupings.reject {|k,v| v.size < 2 }
respond_with @groupings
end
end
## Instruction:
Make venues index use params[:type], like events in admin view
## Code After:
class Admin::VenuesController < AdminController
respond_to :html, :json
include SquashManyDuplicatesMixin # provides squash_many_duplicates
def index
@venues = Venue.non_duplicates
# ransack-compatible param-based search (might use real gem later if enough uses)
if params[:type] == 'missing_lat_long'
@venues = @venues.where('latitude is null or longitude is null')
end
@venues = @venues.order(:title)
respond_with [:admin, @venues]
end
def duplicates
@venues = Venue.non_duplicates.order(:title)
@groupings = []
if params[:type] == 'matching_title'
@groupings = @venues.group_by(&:title)
elsif params[:type] == 'matching_lat_long'
@venues = @venues.where('latitude is not null and longitude is not null')
@groupings = @venues.group_by {|v| [v.latitude.to_s, v.longitude.to_s] }
end
@groupings = @groupings.reject {|k,v| v.size < 2 }
respond_with @groupings
end
end
| class Admin::VenuesController < AdminController
respond_to :html, :json
include SquashManyDuplicatesMixin # provides squash_many_duplicates
def index
@venues = Venue.non_duplicates
# ransack-compatible param-based search (might use real gem later if enough uses)
- if params[:latitude_null].presence && params[:longitude_null].presence
+ if params[:type] == 'missing_lat_long'
- @venues = @venues.where(:latitude => nil, :longitude => nil)
? ^ ^^ ^ ^ ^ ^^ ^
+ @venues = @venues.where('latitude is null or longitude is null')
? ^ ^^ ^ ^ ^^^ ^^ ^ ++
end
@venues = @venues.order(:title)
respond_with [:admin, @venues]
end
def duplicates
@venues = Venue.non_duplicates.order(:title)
@groupings = []
if params[:type] == 'matching_title'
@groupings = @venues.group_by(&:title)
elsif params[:type] == 'matching_lat_long'
@venues = @venues.where('latitude is not null and longitude is not null')
@groupings = @venues.group_by {|v| [v.latitude.to_s, v.longitude.to_s] }
end
@groupings = @groupings.reject {|k,v| v.size < 2 }
respond_with @groupings
end
end | 4 | 0.111111 | 2 | 2 |
dc4a58aa084f7bfdd1709424facf6fa7c8b09e36 | app/routes/Home/Home.js | app/routes/Home/Home.js | /* @flow */
import React, { Component } from 'react';
import {
Text,
View,
Image
} from 'react-native';
import Button from '../../components/Button';
import images from '../../config/images';
import styles from './styles'
export class Home extends Component {
static navigationOptions = {
header: {visible: false},
};
render() {
const { navigate } = this.props.navigation;
return (
<View style={styles.container}>
<Image source={images.logo} style={styles.logo}/>
<View style={styles.buttons}>
<Button text="New Game" onPress={() => navigate("NewGame")}></Button>
<Button text="Continue Game" onPress={() => console.log("Continue Game button pressed!")}></Button>
<Button text="Settings" onPress={() => console.log("Settings button pressed!")}></Button>
</View>
</View>
);
}
};
| /* @flow */
import React, { Component } from 'react';
import {
Text,
View,
Image
} from 'react-native';
import Button from '../../components/Button';
import images from '../../config/images';
import styles from './styles'
import I18n from 'react-native-i18n'
export class Home extends Component {
static navigationOptions = {
header: {visible: false},
};
render() {
const { navigate } = this.props.navigation;
return (
<View style={styles.container}>
<Image source={images.logo} style={styles.logo}/>
<View style={styles.buttons}>
<Button text={I18n.t('newGame')} onPress={() => navigate("NewGame")}></Button>
<Button text={I18n.t('continueGame')} onPress={() => console.log("Continue Game button pressed!")}></Button>
<Button text={I18n.t('settings')} onPress={() => console.log("Settings button pressed!")}></Button>
</View>
</View>
);
}
};
I18n.fallbacks = true
I18n.translations = {
en: {
newGame: "New Game",
continueGame: "Continue Game",
settings: "Settings"
},
de: {
newGame: "Neues Spiel",
continueGame: "Spiel fortsetzen",
settings: "Einstellungen"
}
}
| Add i18n to home screen | Add i18n to home screen
| JavaScript | mit | iimog/x-party-game-app,iimog/x-party-game-app | javascript | ## Code Before:
/* @flow */
import React, { Component } from 'react';
import {
Text,
View,
Image
} from 'react-native';
import Button from '../../components/Button';
import images from '../../config/images';
import styles from './styles'
export class Home extends Component {
static navigationOptions = {
header: {visible: false},
};
render() {
const { navigate } = this.props.navigation;
return (
<View style={styles.container}>
<Image source={images.logo} style={styles.logo}/>
<View style={styles.buttons}>
<Button text="New Game" onPress={() => navigate("NewGame")}></Button>
<Button text="Continue Game" onPress={() => console.log("Continue Game button pressed!")}></Button>
<Button text="Settings" onPress={() => console.log("Settings button pressed!")}></Button>
</View>
</View>
);
}
};
## Instruction:
Add i18n to home screen
## Code After:
/* @flow */
import React, { Component } from 'react';
import {
Text,
View,
Image
} from 'react-native';
import Button from '../../components/Button';
import images from '../../config/images';
import styles from './styles'
import I18n from 'react-native-i18n'
export class Home extends Component {
static navigationOptions = {
header: {visible: false},
};
render() {
const { navigate } = this.props.navigation;
return (
<View style={styles.container}>
<Image source={images.logo} style={styles.logo}/>
<View style={styles.buttons}>
<Button text={I18n.t('newGame')} onPress={() => navigate("NewGame")}></Button>
<Button text={I18n.t('continueGame')} onPress={() => console.log("Continue Game button pressed!")}></Button>
<Button text={I18n.t('settings')} onPress={() => console.log("Settings button pressed!")}></Button>
</View>
</View>
);
}
};
I18n.fallbacks = true
I18n.translations = {
en: {
newGame: "New Game",
continueGame: "Continue Game",
settings: "Settings"
},
de: {
newGame: "Neues Spiel",
continueGame: "Spiel fortsetzen",
settings: "Einstellungen"
}
}
| /* @flow */
import React, { Component } from 'react';
import {
Text,
View,
Image
} from 'react-native';
import Button from '../../components/Button';
import images from '../../config/images';
import styles from './styles'
+ import I18n from 'react-native-i18n'
export class Home extends Component {
static navigationOptions = {
header: {visible: false},
};
render() {
const { navigate } = this.props.navigation;
return (
<View style={styles.container}>
<Image source={images.logo} style={styles.logo}/>
<View style={styles.buttons}>
- <Button text="New Game" onPress={() => navigate("NewGame")}></Button>
? ^^ - ^
+ <Button text={I18n.t('newGame')} onPress={() => navigate("NewGame")}></Button>
? ^^^^^^^^^^ ^^^
- <Button text="Continue Game" onPress={() => console.log("Continue Game button pressed!")}></Button>
? ^^ - ^
+ <Button text={I18n.t('continueGame')} onPress={() => console.log("Continue Game button pressed!")}></Button>
? ^^^^^^^^^^ ^^^
- <Button text="Settings" onPress={() => console.log("Settings button pressed!")}></Button>
? ^^ ^
+ <Button text={I18n.t('settings')} onPress={() => console.log("Settings button pressed!")}></Button>
? ^^^^^^^^^^ ^^^
</View>
</View>
);
}
};
+
+ I18n.fallbacks = true
+ I18n.translations = {
+ en: {
+ newGame: "New Game",
+ continueGame: "Continue Game",
+ settings: "Settings"
+ },
+ de: {
+ newGame: "Neues Spiel",
+ continueGame: "Spiel fortsetzen",
+ settings: "Einstellungen"
+ }
+ } | 21 | 0.7 | 18 | 3 |
9111434623835dd7e4476cee9676d2a864902f3c | server/src/main/java/me/izstas/rfs/server/service/PathService.java | server/src/main/java/me/izstas/rfs/server/service/PathService.java | package me.izstas.rfs.server.service;
import java.nio.file.Path;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
import me.izstas.rfs.server.config.security.RfsUserDetails;
@Service
public class PathService {
/**
* Makes sure the provided path is in the user's root.
* @throws BadPathException if the path is not the user's root
*/
public void validateUserPath(Path path) {
Path currentPath = path.toAbsolutePath();
Path rootPath = getUserRoot().toAbsolutePath();
do {
if (currentPath.equals(rootPath)) {
return;
}
}
while ((currentPath = currentPath.getParent()) != null);
// If we've reached this line, the provided path is not in the user's root
throw new BadPathException();
}
/**
* Resolves the provided path against the user's root and validates it with {@link #validateUserPath(Path)}.
*/
public Path resolveUserPath(String path) {
Path resolvedPath = getUserRoot().resolve(path);
validateUserPath(resolvedPath);
return resolvedPath;
}
private Path getUserRoot() {
return ((RfsUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal()).getRoot();
}
}
| package me.izstas.rfs.server.service;
import java.nio.file.Path;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
import me.izstas.rfs.server.config.security.RfsUserDetails;
@Service
public class PathService {
/**
* Makes sure the provided path is in the user's root.
* @throws BadPathException if the path is not the user's root
*/
public void validateUserPath(Path path) {
Path currentPath = path.toAbsolutePath().normalize();
Path rootPath = getUserRoot().toAbsolutePath().normalize();
do {
if (currentPath.equals(rootPath)) {
return;
}
}
while ((currentPath = currentPath.getParent()) != null);
// If we've reached this line, the provided path is not in the user's root
throw new BadPathException();
}
/**
* Resolves the provided path against the user's root and validates it with {@link #validateUserPath(Path)}.
*/
public Path resolveUserPath(String path) {
Path resolvedPath = getUserRoot().resolve(path);
validateUserPath(resolvedPath);
return resolvedPath;
}
private Path getUserRoot() {
return ((RfsUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal()).getRoot();
}
}
| Make sure to call normalize() on the path before validating | Make sure to call normalize() on the path before validating
| Java | mit | izstas/RFS | java | ## Code Before:
package me.izstas.rfs.server.service;
import java.nio.file.Path;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
import me.izstas.rfs.server.config.security.RfsUserDetails;
@Service
public class PathService {
/**
* Makes sure the provided path is in the user's root.
* @throws BadPathException if the path is not the user's root
*/
public void validateUserPath(Path path) {
Path currentPath = path.toAbsolutePath();
Path rootPath = getUserRoot().toAbsolutePath();
do {
if (currentPath.equals(rootPath)) {
return;
}
}
while ((currentPath = currentPath.getParent()) != null);
// If we've reached this line, the provided path is not in the user's root
throw new BadPathException();
}
/**
* Resolves the provided path against the user's root and validates it with {@link #validateUserPath(Path)}.
*/
public Path resolveUserPath(String path) {
Path resolvedPath = getUserRoot().resolve(path);
validateUserPath(resolvedPath);
return resolvedPath;
}
private Path getUserRoot() {
return ((RfsUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal()).getRoot();
}
}
## Instruction:
Make sure to call normalize() on the path before validating
## Code After:
package me.izstas.rfs.server.service;
import java.nio.file.Path;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
import me.izstas.rfs.server.config.security.RfsUserDetails;
@Service
public class PathService {
/**
* Makes sure the provided path is in the user's root.
* @throws BadPathException if the path is not the user's root
*/
public void validateUserPath(Path path) {
Path currentPath = path.toAbsolutePath().normalize();
Path rootPath = getUserRoot().toAbsolutePath().normalize();
do {
if (currentPath.equals(rootPath)) {
return;
}
}
while ((currentPath = currentPath.getParent()) != null);
// If we've reached this line, the provided path is not in the user's root
throw new BadPathException();
}
/**
* Resolves the provided path against the user's root and validates it with {@link #validateUserPath(Path)}.
*/
public Path resolveUserPath(String path) {
Path resolvedPath = getUserRoot().resolve(path);
validateUserPath(resolvedPath);
return resolvedPath;
}
private Path getUserRoot() {
return ((RfsUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal()).getRoot();
}
}
| package me.izstas.rfs.server.service;
import java.nio.file.Path;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
import me.izstas.rfs.server.config.security.RfsUserDetails;
@Service
public class PathService {
/**
* Makes sure the provided path is in the user's root.
* @throws BadPathException if the path is not the user's root
*/
public void validateUserPath(Path path) {
- Path currentPath = path.toAbsolutePath();
+ Path currentPath = path.toAbsolutePath().normalize();
? ++++++++++++
- Path rootPath = getUserRoot().toAbsolutePath();
+ Path rootPath = getUserRoot().toAbsolutePath().normalize();
? ++++++++++++
do {
if (currentPath.equals(rootPath)) {
return;
}
}
while ((currentPath = currentPath.getParent()) != null);
// If we've reached this line, the provided path is not in the user's root
throw new BadPathException();
}
/**
* Resolves the provided path against the user's root and validates it with {@link #validateUserPath(Path)}.
*/
public Path resolveUserPath(String path) {
Path resolvedPath = getUserRoot().resolve(path);
validateUserPath(resolvedPath);
return resolvedPath;
}
private Path getUserRoot() {
return ((RfsUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal()).getRoot();
}
} | 4 | 0.090909 | 2 | 2 |
034588397b3a70324af136d4105a05fd4935d805 | .travis.install.sh | .travis.install.sh |
function buildIt {
if [ -f "build.gradle" ]; then
./gradlew clean build publishToMavenLocal
else
mvn clean install
fi
}
function sortItAllOut {
if [[ -d $1 ]]; then
# Update the repo
echo -e "Checking repo \e[96m$1\e[0m for updates"
cd $1
git pull
buildIt
cd ..
else
# Clone the repo
echo -e "Cloning \e[96m$1\e[0m"
git clone https://github.com/gchq/$1.git
cd $1
buildIt
cd ..
fi
}
sortItAllOut event-logging
sortItAllOut hadoop-hdfs-shaded
sortItAllOut hadoop-common-shaded
sortItAllOut hbase-common-shaded
mysql -e 'CREATE DATABASE stroom;' |
function buildIt {
if [ -f "build.gradle" ]; then
./gradlew clean build publishToMavenLocal
else
mvn clean install
fi
}
function sortItAllOut {
if [[ -d $1 ]]; then
# Update the repo
echo -e "Checking repo \e[96m$1\e[0m for updates"
cd $1
git pull
buildIt
cd ..
else
# Clone the repo
echo -e "Cloning \e[96m$1\e[0m"
git clone https://github.com/gchq/$1.git
cd $1
buildIt
cd ..
fi
}
sortItAllOut event-logging
sortItAllOut hadoop-hdfs-shaded
sortItAllOut hadoop-common-shaded
sortItAllOut hbase-common-shaded
mysql -e 'CREATE DATABASE IF NOT EXISTS stroom;' | Add release config and table creation | Add release config and table creation
| Shell | apache-2.0 | gchq/stroom,gchq/stroom,gchq/stroom,gchq/stroom,gchq/stroom,gchq/stroom | shell | ## Code Before:
function buildIt {
if [ -f "build.gradle" ]; then
./gradlew clean build publishToMavenLocal
else
mvn clean install
fi
}
function sortItAllOut {
if [[ -d $1 ]]; then
# Update the repo
echo -e "Checking repo \e[96m$1\e[0m for updates"
cd $1
git pull
buildIt
cd ..
else
# Clone the repo
echo -e "Cloning \e[96m$1\e[0m"
git clone https://github.com/gchq/$1.git
cd $1
buildIt
cd ..
fi
}
sortItAllOut event-logging
sortItAllOut hadoop-hdfs-shaded
sortItAllOut hadoop-common-shaded
sortItAllOut hbase-common-shaded
mysql -e 'CREATE DATABASE stroom;'
## Instruction:
Add release config and table creation
## Code After:
function buildIt {
if [ -f "build.gradle" ]; then
./gradlew clean build publishToMavenLocal
else
mvn clean install
fi
}
function sortItAllOut {
if [[ -d $1 ]]; then
# Update the repo
echo -e "Checking repo \e[96m$1\e[0m for updates"
cd $1
git pull
buildIt
cd ..
else
# Clone the repo
echo -e "Cloning \e[96m$1\e[0m"
git clone https://github.com/gchq/$1.git
cd $1
buildIt
cd ..
fi
}
sortItAllOut event-logging
sortItAllOut hadoop-hdfs-shaded
sortItAllOut hadoop-common-shaded
sortItAllOut hbase-common-shaded
mysql -e 'CREATE DATABASE IF NOT EXISTS stroom;' |
function buildIt {
if [ -f "build.gradle" ]; then
./gradlew clean build publishToMavenLocal
else
mvn clean install
fi
}
function sortItAllOut {
if [[ -d $1 ]]; then
# Update the repo
echo -e "Checking repo \e[96m$1\e[0m for updates"
cd $1
git pull
buildIt
cd ..
else
# Clone the repo
echo -e "Cloning \e[96m$1\e[0m"
git clone https://github.com/gchq/$1.git
cd $1
buildIt
cd ..
fi
}
sortItAllOut event-logging
sortItAllOut hadoop-hdfs-shaded
sortItAllOut hadoop-common-shaded
sortItAllOut hbase-common-shaded
- mysql -e 'CREATE DATABASE stroom;'
+ mysql -e 'CREATE DATABASE IF NOT EXISTS stroom;'
? ++++++++++++++
| 2 | 0.054054 | 1 | 1 |
66f5ffeb8e40ce1da4e145ba421cf79d12b8a42d | app/views/questions/_question.html.erb | app/views/questions/_question.html.erb | <h4>
<%= link_to question.title, question_path(question) %>
<% if current_user == question.user %>
|
<%= link_to 'edit', edit_question_path(question) %>
|
<%= link_to 'delete', "/questions/#{question.id}/", method: :delete %>
<% end %>
</h4>
| <h4>
<% if logged_in? %>
<%= link_to "+", question_votes_path(question), method: :create %>
<%= "#{question.net_votes}" %>
<%= link_to "—", question_votes_path(question), method: :update %>
|
<% end %>
<%= link_to question.title, question_path(question) %>
<% if current_user == question.user %>
|
<%= link_to 'edit', edit_question_path(question) %>
|
<%= link_to 'delete', "/questions/#{question.id}/", method: :delete %>
<% end %>
</h4>
| Add views for voting and vote count | Add views for voting and vote count
| HTML+ERB | mit | nyc-copperheads-2016/Gold-Team-Stackoverflow,nyc-copperheads-2016/Gold-Team-Stackoverflow,nyc-copperheads-2016/Gold-Team-Stackoverflow | html+erb | ## Code Before:
<h4>
<%= link_to question.title, question_path(question) %>
<% if current_user == question.user %>
|
<%= link_to 'edit', edit_question_path(question) %>
|
<%= link_to 'delete', "/questions/#{question.id}/", method: :delete %>
<% end %>
</h4>
## Instruction:
Add views for voting and vote count
## Code After:
<h4>
<% if logged_in? %>
<%= link_to "+", question_votes_path(question), method: :create %>
<%= "#{question.net_votes}" %>
<%= link_to "—", question_votes_path(question), method: :update %>
|
<% end %>
<%= link_to question.title, question_path(question) %>
<% if current_user == question.user %>
|
<%= link_to 'edit', edit_question_path(question) %>
|
<%= link_to 'delete', "/questions/#{question.id}/", method: :delete %>
<% end %>
</h4>
| <h4>
+ <% if logged_in? %>
+ <%= link_to "+", question_votes_path(question), method: :create %>
+ <%= "#{question.net_votes}" %>
+ <%= link_to "—", question_votes_path(question), method: :update %>
+ |
+ <% end %>
<%= link_to question.title, question_path(question) %>
<% if current_user == question.user %>
|
<%= link_to 'edit', edit_question_path(question) %>
|
<%= link_to 'delete', "/questions/#{question.id}/", method: :delete %>
<% end %>
</h4> | 6 | 0.666667 | 6 | 0 |
854f30d91c56734aae02a977c14ca8a47a7d2e0e | src/client/modules/post/reducers/index.js | src/client/modules/post/reducers/index.js | const defaultState = {
comment: { id: null, content: '' }
};
export default function(state = defaultState, action) {
switch (action.type) {
case 'COMMENT_SELECT':
return {
...state,
comment: action.value
};
default:
return state;
}
}
| const defaultState = {
endCursor: '0',
comment: { id: null, content: '' }
};
export default function(state = defaultState, action) {
switch (action.type) {
case 'COMMENT_SELECT':
return {
...state,
comment: action.value
};
case 'POST_ENDCURSOR':
return {
...state,
endCursor: action.value
};
default:
return state;
}
}
| Rollback prematurely modified by mistake post reducers | Rollback prematurely modified by mistake post reducers
| JavaScript | mit | sysgears/apollo-universal-starter-kit,sysgears/apollo-universal-starter-kit,sysgears/apollo-universal-starter-kit,sysgears/apollo-universal-starter-kit,sysgears/apollo-fullstack-starter-kit | javascript | ## Code Before:
const defaultState = {
comment: { id: null, content: '' }
};
export default function(state = defaultState, action) {
switch (action.type) {
case 'COMMENT_SELECT':
return {
...state,
comment: action.value
};
default:
return state;
}
}
## Instruction:
Rollback prematurely modified by mistake post reducers
## Code After:
const defaultState = {
endCursor: '0',
comment: { id: null, content: '' }
};
export default function(state = defaultState, action) {
switch (action.type) {
case 'COMMENT_SELECT':
return {
...state,
comment: action.value
};
case 'POST_ENDCURSOR':
return {
...state,
endCursor: action.value
};
default:
return state;
}
}
| const defaultState = {
+ endCursor: '0',
comment: { id: null, content: '' }
};
export default function(state = defaultState, action) {
switch (action.type) {
case 'COMMENT_SELECT':
return {
...state,
comment: action.value
};
+ case 'POST_ENDCURSOR':
+ return {
+ ...state,
+ endCursor: action.value
+ };
+
default:
return state;
}
} | 7 | 0.4375 | 7 | 0 |
719037cf20ae17e5fba71136cad1db7e8a47f703 | spacy/lang/fi/examples.py | spacy/lang/fi/examples.py | from __future__ import unicode_literals
"""
Example sentences to test spaCy and its language models.
>>> from spacy.lang.tr.examples import sentences
>>> docs = nlp.pipe(sentences)
"""
sentences = [
"Apple harkitsee ostavansa startup-yrityksen UK:sta 1 miljardilla dollarilla."
"Itseajavat autot siirtävät vakuutusriskin valmistajille."
"San Francisco harkitsee jakelurobottien kieltämistä jalkakäytävillä."
"Lontoo on iso kaupunki Iso-Britanniassa."
]
| from __future__ import unicode_literals
"""
Example sentences to test spaCy and its language models.
>>> from spacy.lang.fi.examples import sentences
>>> docs = nlp.pipe(sentences)
"""
sentences = [
"Apple harkitsee ostavansa startup-yrityksen UK:sta 1 miljardilla dollarilla.",
"Itseajavat autot siirtävät vakuutusriskin valmistajille.",
"San Francisco harkitsee jakelurobottien kieltämistä jalkakäytävillä.",
"Lontoo on iso kaupunki Iso-Britanniassa."
]
| Update formatting and add missing commas | Update formatting and add missing commas | Python | mit | recognai/spaCy,explosion/spaCy,explosion/spaCy,recognai/spaCy,explosion/spaCy,aikramer2/spaCy,aikramer2/spaCy,recognai/spaCy,aikramer2/spaCy,spacy-io/spaCy,recognai/spaCy,recognai/spaCy,honnibal/spaCy,explosion/spaCy,spacy-io/spaCy,spacy-io/spaCy,honnibal/spaCy,spacy-io/spaCy,spacy-io/spaCy,aikramer2/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy,honnibal/spaCy,aikramer2/spaCy,honnibal/spaCy,aikramer2/spaCy,recognai/spaCy | python | ## Code Before:
from __future__ import unicode_literals
"""
Example sentences to test spaCy and its language models.
>>> from spacy.lang.tr.examples import sentences
>>> docs = nlp.pipe(sentences)
"""
sentences = [
"Apple harkitsee ostavansa startup-yrityksen UK:sta 1 miljardilla dollarilla."
"Itseajavat autot siirtävät vakuutusriskin valmistajille."
"San Francisco harkitsee jakelurobottien kieltämistä jalkakäytävillä."
"Lontoo on iso kaupunki Iso-Britanniassa."
]
## Instruction:
Update formatting and add missing commas
## Code After:
from __future__ import unicode_literals
"""
Example sentences to test spaCy and its language models.
>>> from spacy.lang.fi.examples import sentences
>>> docs = nlp.pipe(sentences)
"""
sentences = [
"Apple harkitsee ostavansa startup-yrityksen UK:sta 1 miljardilla dollarilla.",
"Itseajavat autot siirtävät vakuutusriskin valmistajille.",
"San Francisco harkitsee jakelurobottien kieltämistä jalkakäytävillä.",
"Lontoo on iso kaupunki Iso-Britanniassa."
]
| from __future__ import unicode_literals
"""
Example sentences to test spaCy and its language models.
- >>> from spacy.lang.tr.examples import sentences
? ^^
+ >>> from spacy.lang.fi.examples import sentences
? ^^
>>> docs = nlp.pipe(sentences)
"""
sentences = [
- "Apple harkitsee ostavansa startup-yrityksen UK:sta 1 miljardilla dollarilla."
+ "Apple harkitsee ostavansa startup-yrityksen UK:sta 1 miljardilla dollarilla.",
? ++++ +
- "Itseajavat autot siirtävät vakuutusriskin valmistajille."
+ "Itseajavat autot siirtävät vakuutusriskin valmistajille.",
? ++++ +
- "San Francisco harkitsee jakelurobottien kieltämistä jalkakäytävillä."
+ "San Francisco harkitsee jakelurobottien kieltämistä jalkakäytävillä.",
? ++++ +
- "Lontoo on iso kaupunki Iso-Britanniassa."
+ "Lontoo on iso kaupunki Iso-Britanniassa."
? ++++
] | 10 | 0.714286 | 5 | 5 |
a1c7765e84e5256faa54571f5e4eb342cea962bb | src/main/java/de/bmoth/app/ReplController.java | src/main/java/de/bmoth/app/ReplController.java | package de.bmoth.app;
/**
* Created by jessy on 19.05.17.
*/
public class ReplController {
}
| package de.bmoth.app;
import com.microsoft.z3.BoolExpr;
import com.microsoft.z3.Context;
import com.microsoft.z3.Model;
import com.microsoft.z3.Solver;
import de.bmoth.backend.FormulaToZ3Translator;
import de.bmoth.backend.SolutionFinder;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.TextArea;
import javafx.scene.input.KeyCode;
import java.net.URL;
import java.util.ResourceBundle;
import java.util.Set;
public class ReplController implements Initializable {
@FXML
TextArea replText = new TextArea();
private Context ctx;
private Solver s;
@Override
public void initialize(URL fxmlFileLocation, ResourceBundle resources) {
ctx = new Context();
s = ctx.mkSolver();
replText.setOnKeyPressed(keyEvent -> {
if (keyEvent.getCode() == KeyCode.ENTER) {
String[] predicate = replText.getText().split("\n");
String solution = processPredicate(predicate[predicate.length-1]);
replText.appendText(solution);
}
});
}
private String processPredicate(String predicate) {
ctx = new Context();
s = ctx.mkSolver();
BoolExpr constraint = FormulaToZ3Translator.translatePredicate(predicate, ctx);
SolutionFinder finder = new SolutionFinder(constraint, s, ctx);
Set<Model> solutions = finder.findSolutions(1);
if (solutions.size() == 0) {
return "\nUNSATISFIABLE";
} else {
return "\n" + solutions.toString();
}
}
}
| Read predicate and find one solution or return UNSATISFIABLE | Read predicate and find one solution or return UNSATISFIABLE
| Java | mit | hhu-stups/bmoth | java | ## Code Before:
package de.bmoth.app;
/**
* Created by jessy on 19.05.17.
*/
public class ReplController {
}
## Instruction:
Read predicate and find one solution or return UNSATISFIABLE
## Code After:
package de.bmoth.app;
import com.microsoft.z3.BoolExpr;
import com.microsoft.z3.Context;
import com.microsoft.z3.Model;
import com.microsoft.z3.Solver;
import de.bmoth.backend.FormulaToZ3Translator;
import de.bmoth.backend.SolutionFinder;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.TextArea;
import javafx.scene.input.KeyCode;
import java.net.URL;
import java.util.ResourceBundle;
import java.util.Set;
public class ReplController implements Initializable {
@FXML
TextArea replText = new TextArea();
private Context ctx;
private Solver s;
@Override
public void initialize(URL fxmlFileLocation, ResourceBundle resources) {
ctx = new Context();
s = ctx.mkSolver();
replText.setOnKeyPressed(keyEvent -> {
if (keyEvent.getCode() == KeyCode.ENTER) {
String[] predicate = replText.getText().split("\n");
String solution = processPredicate(predicate[predicate.length-1]);
replText.appendText(solution);
}
});
}
private String processPredicate(String predicate) {
ctx = new Context();
s = ctx.mkSolver();
BoolExpr constraint = FormulaToZ3Translator.translatePredicate(predicate, ctx);
SolutionFinder finder = new SolutionFinder(constraint, s, ctx);
Set<Model> solutions = finder.findSolutions(1);
if (solutions.size() == 0) {
return "\nUNSATISFIABLE";
} else {
return "\n" + solutions.toString();
}
}
}
| package de.bmoth.app;
- /**
- * Created by jessy on 19.05.17.
- */
- public class ReplController {
+ import com.microsoft.z3.BoolExpr;
+ import com.microsoft.z3.Context;
+ import com.microsoft.z3.Model;
+ import com.microsoft.z3.Solver;
+ import de.bmoth.backend.FormulaToZ3Translator;
+ import de.bmoth.backend.SolutionFinder;
+ import javafx.fxml.FXML;
+ import javafx.fxml.Initializable;
+ import javafx.scene.control.TextArea;
+ import javafx.scene.input.KeyCode;
+
+ import java.net.URL;
+ import java.util.ResourceBundle;
+ import java.util.Set;
+
+ public class ReplController implements Initializable {
+
+ @FXML
+ TextArea replText = new TextArea();
+
+ private Context ctx;
+ private Solver s;
+
+ @Override
+ public void initialize(URL fxmlFileLocation, ResourceBundle resources) {
+
+ ctx = new Context();
+ s = ctx.mkSolver();
+
+ replText.setOnKeyPressed(keyEvent -> {
+ if (keyEvent.getCode() == KeyCode.ENTER) {
+ String[] predicate = replText.getText().split("\n");
+ String solution = processPredicate(predicate[predicate.length-1]);
+ replText.appendText(solution);
+ }
+ });
+ }
+
+ private String processPredicate(String predicate) {
+ ctx = new Context();
+ s = ctx.mkSolver();
+ BoolExpr constraint = FormulaToZ3Translator.translatePredicate(predicate, ctx);
+ SolutionFinder finder = new SolutionFinder(constraint, s, ctx);
+ Set<Model> solutions = finder.findSolutions(1);
+ if (solutions.size() == 0) {
+ return "\nUNSATISFIABLE";
+ } else {
+ return "\n" + solutions.toString();
+ }
+ }
} | 54 | 7.714286 | 50 | 4 |
e5a397033c5720cd7d0ab321c05a8f1d12f4dc99 | tm/tmux_wrapper.py | tm/tmux_wrapper.py |
import subprocess
class SessionExists(Exception):
description = "Session already exists."
pass
class ServerConnectionError(Exception):
description = "tmux server is not currently running."
pass
class SessionDoesNotExist(Exception):
description = "Session does not exist."
pass
def command(command):
p = subprocess.Popen("tmux " + command,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=True)
return p.communicate()
def kill(session):
p = subprocess.Popen("tmux kill-session -t {}".format(session),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=True)
out, err = p.communicate()
if "session not found" in err:
raise SessionDoesNotExist(session)
if "failed to connect to server" in err:
raise ServerConnectionError()
def list():
p = subprocess.Popen("tmux ls",
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=True)
out, err = p.communicate()
if "failed to connect to server" in err:
raise ServerConnectionError()
return out
def create(session):
p = subprocess.Popen("tmux new -s {}".format(session),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=True)
out, err = p.communicate()
if "duplicate session" in err:
raise SessionExists(session)
def attach(session):
p = subprocess.Popen("tmux attach-session -t {}".format(session),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=True)
out, err = p.communicate()
if "no sessions" in err:
raise SessionDoesNotExist(session)
def create_or_attach(session):
create(session)
except SessionExists:
attach(session)
|
import subprocess
class SessionExists(Exception):
description = "Session already exists."
pass
class ServerConnectionError(Exception):
description = "tmux server is not currently running."
pass
class SessionDoesNotExist(Exception):
description = "Session does not exist."
pass
def command(command):
p = subprocess.Popen("tmux " + command,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=True)
return p.communicate()
def kill(session):
out, err = command("kill-session -t {}".format(session))
if "session not found" in err:
raise SessionDoesNotExist(session)
if "failed to connect to server" in err:
raise ServerConnectionError()
def list():
out, err = command("ls")
if "failed to connect to server" in err:
raise ServerConnectionError()
return out
def create(session):
out, err = command("new -s {}".format(session))
if "duplicate session" in err:
raise SessionExists(session)
def attach(session):
out, err = command("attach-session -t {}".format(session))
if "no sessions" in err:
raise SessionDoesNotExist(session)
def create_or_attach(session):
try:
create(session)
except SessionExists:
attach(session)
| Use raw command method to run all commands in wrapper | Use raw command method to run all commands in wrapper
| Python | mit | ethanal/tm | python | ## Code Before:
import subprocess
class SessionExists(Exception):
description = "Session already exists."
pass
class ServerConnectionError(Exception):
description = "tmux server is not currently running."
pass
class SessionDoesNotExist(Exception):
description = "Session does not exist."
pass
def command(command):
p = subprocess.Popen("tmux " + command,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=True)
return p.communicate()
def kill(session):
p = subprocess.Popen("tmux kill-session -t {}".format(session),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=True)
out, err = p.communicate()
if "session not found" in err:
raise SessionDoesNotExist(session)
if "failed to connect to server" in err:
raise ServerConnectionError()
def list():
p = subprocess.Popen("tmux ls",
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=True)
out, err = p.communicate()
if "failed to connect to server" in err:
raise ServerConnectionError()
return out
def create(session):
p = subprocess.Popen("tmux new -s {}".format(session),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=True)
out, err = p.communicate()
if "duplicate session" in err:
raise SessionExists(session)
def attach(session):
p = subprocess.Popen("tmux attach-session -t {}".format(session),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=True)
out, err = p.communicate()
if "no sessions" in err:
raise SessionDoesNotExist(session)
def create_or_attach(session):
create(session)
except SessionExists:
attach(session)
## Instruction:
Use raw command method to run all commands in wrapper
## Code After:
import subprocess
class SessionExists(Exception):
description = "Session already exists."
pass
class ServerConnectionError(Exception):
description = "tmux server is not currently running."
pass
class SessionDoesNotExist(Exception):
description = "Session does not exist."
pass
def command(command):
p = subprocess.Popen("tmux " + command,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=True)
return p.communicate()
def kill(session):
out, err = command("kill-session -t {}".format(session))
if "session not found" in err:
raise SessionDoesNotExist(session)
if "failed to connect to server" in err:
raise ServerConnectionError()
def list():
out, err = command("ls")
if "failed to connect to server" in err:
raise ServerConnectionError()
return out
def create(session):
out, err = command("new -s {}".format(session))
if "duplicate session" in err:
raise SessionExists(session)
def attach(session):
out, err = command("attach-session -t {}".format(session))
if "no sessions" in err:
raise SessionDoesNotExist(session)
def create_or_attach(session):
try:
create(session)
except SessionExists:
attach(session)
|
import subprocess
class SessionExists(Exception):
description = "Session already exists."
pass
class ServerConnectionError(Exception):
description = "tmux server is not currently running."
pass
class SessionDoesNotExist(Exception):
description = "Session does not exist."
pass
def command(command):
p = subprocess.Popen("tmux " + command,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=True)
return p.communicate()
def kill(session):
+ out, err = command("kill-session -t {}".format(session))
- p = subprocess.Popen("tmux kill-session -t {}".format(session),
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- shell=True)
- out, err = p.communicate()
if "session not found" in err:
raise SessionDoesNotExist(session)
if "failed to connect to server" in err:
raise ServerConnectionError()
def list():
- p = subprocess.Popen("tmux ls",
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- shell=True)
- out, err = p.communicate()
? -- ^ ^^^^^
+ out, err = command("ls")
? ^ ^ ++++
if "failed to connect to server" in err:
raise ServerConnectionError()
return out
def create(session):
+ out, err = command("new -s {}".format(session))
- p = subprocess.Popen("tmux new -s {}".format(session),
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- shell=True)
- out, err = p.communicate()
if "duplicate session" in err:
raise SessionExists(session)
def attach(session):
+ out, err = command("attach-session -t {}".format(session))
- p = subprocess.Popen("tmux attach-session -t {}".format(session),
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- shell=True)
- out, err = p.communicate()
if "no sessions" in err:
raise SessionDoesNotExist(session)
def create_or_attach(session):
-
+ try:
create(session)
except SessionExists:
attach(session)
| 26 | 0.333333 | 5 | 21 |
9198b462adbc03144cb61713b3046ffb171e476c | ng2-components/ng2-alfresco-datatable/src/components/pagination/pagination.component.html | ng2-components/ng2-alfresco-datatable/src/components/pagination/pagination.component.html | <div *ngIf="provider" class="mdl-paging">
<span class="mdl-paging__per-page">
<span class="mdl-paging__per-page-label">Rows per page:</span>
<span class="mdl-paging__per-page-value">{{pageSize}}</span>
<button alfresco-mdl-button id="pageSizePicker" class="mdl-button--icon mdl-paging__per-page-dropdown">
<i class="material-icons">arrow_drop_down</i>
</button>
<ul alfresco-mdl-menu for="pageSizePicker" class="mdl-menu--bottom-right">
<li *ngFor="let size of supportedPageSizes"
tabindex="-1" [attr.data-value]="size" class="mdl-menu__item"
(click)="setPageSize(size)">
<span>{{size}}</span>
</li>
</ul>
</span>
<span class="mdl-paging__count">{{summary}}</span>
<button (click)="showPrevPage()"
[disabled]="!prevPageAvail"
alfresco-mdl-button class="mdl-button--icon mdl-paging__prev">
<i class="material-icons">keyboard_arrow_left</i>
</button>
<button (click)="showNextPage()"
[disabled]="!nextPageAvail"
alfresco-mdl-button class="mdl-button--icon mdl-paging__next">
<i class="material-icons">keyboard_arrow_right</i>
</button>
</div>
| <div *ngIf="provider" class="mdl-paging">
<span class="mdl-paging__per-page">
<span class="mdl-paging__per-page-label" >Rows per page:</span>
<span class="mdl-paging__per-page-value" [attr.data-automation-id]="'rows_per_page_' + pageSize">{{pageSize}}</span>
<button alfresco-mdl-button id="pageSizePicker" class="mdl-button--icon mdl-paging__per-page-dropdown">
<i class="material-icons">arrow_drop_down</i>
</button>
<ul alfresco-mdl-menu for="pageSizePicker" class="mdl-menu--bottom-right">
<li *ngFor="let size of supportedPageSizes"
tabindex="-1" [attr.data-value]="size" class="mdl-menu__item"
(click)="setPageSize(size)">
<span>{{size}}</span>
</li>
</ul>
</span>
<span class="mdl-paging__count">{{summary}}</span>
<button (click)="showPrevPage()"
[disabled]="!prevPageAvail"
alfresco-mdl-button class="mdl-button--icon mdl-paging__prev" [attr.data-automation-id]="prev_page">
<i class="material-icons">keyboard_arrow_left</i>
</button>
<button (click)="showNextPage()"
[disabled]="!nextPageAvail"
alfresco-mdl-button class="mdl-button--icon mdl-paging__next" [attr.data-automation-id]="next_page">
<i class="material-icons">keyboard_arrow_right</i>
</button>
</div>
| Add data automation ids for pagination | Add data automation ids for pagination
| HTML | apache-2.0 | Alfresco/alfresco-ng2-components,Alfresco/alfresco-ng2-components,Alfresco/alfresco-ng2-components,Alfresco/alfresco-ng2-components | html | ## Code Before:
<div *ngIf="provider" class="mdl-paging">
<span class="mdl-paging__per-page">
<span class="mdl-paging__per-page-label">Rows per page:</span>
<span class="mdl-paging__per-page-value">{{pageSize}}</span>
<button alfresco-mdl-button id="pageSizePicker" class="mdl-button--icon mdl-paging__per-page-dropdown">
<i class="material-icons">arrow_drop_down</i>
</button>
<ul alfresco-mdl-menu for="pageSizePicker" class="mdl-menu--bottom-right">
<li *ngFor="let size of supportedPageSizes"
tabindex="-1" [attr.data-value]="size" class="mdl-menu__item"
(click)="setPageSize(size)">
<span>{{size}}</span>
</li>
</ul>
</span>
<span class="mdl-paging__count">{{summary}}</span>
<button (click)="showPrevPage()"
[disabled]="!prevPageAvail"
alfresco-mdl-button class="mdl-button--icon mdl-paging__prev">
<i class="material-icons">keyboard_arrow_left</i>
</button>
<button (click)="showNextPage()"
[disabled]="!nextPageAvail"
alfresco-mdl-button class="mdl-button--icon mdl-paging__next">
<i class="material-icons">keyboard_arrow_right</i>
</button>
</div>
## Instruction:
Add data automation ids for pagination
## Code After:
<div *ngIf="provider" class="mdl-paging">
<span class="mdl-paging__per-page">
<span class="mdl-paging__per-page-label" >Rows per page:</span>
<span class="mdl-paging__per-page-value" [attr.data-automation-id]="'rows_per_page_' + pageSize">{{pageSize}}</span>
<button alfresco-mdl-button id="pageSizePicker" class="mdl-button--icon mdl-paging__per-page-dropdown">
<i class="material-icons">arrow_drop_down</i>
</button>
<ul alfresco-mdl-menu for="pageSizePicker" class="mdl-menu--bottom-right">
<li *ngFor="let size of supportedPageSizes"
tabindex="-1" [attr.data-value]="size" class="mdl-menu__item"
(click)="setPageSize(size)">
<span>{{size}}</span>
</li>
</ul>
</span>
<span class="mdl-paging__count">{{summary}}</span>
<button (click)="showPrevPage()"
[disabled]="!prevPageAvail"
alfresco-mdl-button class="mdl-button--icon mdl-paging__prev" [attr.data-automation-id]="prev_page">
<i class="material-icons">keyboard_arrow_left</i>
</button>
<button (click)="showNextPage()"
[disabled]="!nextPageAvail"
alfresco-mdl-button class="mdl-button--icon mdl-paging__next" [attr.data-automation-id]="next_page">
<i class="material-icons">keyboard_arrow_right</i>
</button>
</div>
| <div *ngIf="provider" class="mdl-paging">
<span class="mdl-paging__per-page">
- <span class="mdl-paging__per-page-label">Rows per page:</span>
+ <span class="mdl-paging__per-page-label" >Rows per page:</span>
? +
- <span class="mdl-paging__per-page-value">{{pageSize}}</span>
+ <span class="mdl-paging__per-page-value" [attr.data-automation-id]="'rows_per_page_' + pageSize">{{pageSize}}</span>
<button alfresco-mdl-button id="pageSizePicker" class="mdl-button--icon mdl-paging__per-page-dropdown">
<i class="material-icons">arrow_drop_down</i>
</button>
<ul alfresco-mdl-menu for="pageSizePicker" class="mdl-menu--bottom-right">
<li *ngFor="let size of supportedPageSizes"
tabindex="-1" [attr.data-value]="size" class="mdl-menu__item"
(click)="setPageSize(size)">
<span>{{size}}</span>
</li>
</ul>
</span>
<span class="mdl-paging__count">{{summary}}</span>
<button (click)="showPrevPage()"
[disabled]="!prevPageAvail"
- alfresco-mdl-button class="mdl-button--icon mdl-paging__prev">
+ alfresco-mdl-button class="mdl-button--icon mdl-paging__prev" [attr.data-automation-id]="prev_page">
? ++++++++++++++++++++++++++++++++++++++
<i class="material-icons">keyboard_arrow_left</i>
</button>
<button (click)="showNextPage()"
[disabled]="!nextPageAvail"
- alfresco-mdl-button class="mdl-button--icon mdl-paging__next">
+ alfresco-mdl-button class="mdl-button--icon mdl-paging__next" [attr.data-automation-id]="next_page">
? ++++++++++++++++++++++++++++++++++++++
<i class="material-icons">keyboard_arrow_right</i>
</button>
</div> | 8 | 0.296296 | 4 | 4 |
0bd1865730106d2573acb04d95b23290e935f4c4 | util.py | util.py | from math import sin, cos, asin, sqrt
def hav(lona, lonb, lata, latb):
# ported from latlontools
# assume latitude and longitudes are in radians
diff_lat = lata - latb
diff_lon = lona - lonb
a = sin(diff_lat/2)**2 + cos(lona) * cos(latb) * sin(diff_lon/2)**2
c = 2 * asin(sqrt(a))
r = 6371 # radius of earth in km
return c * r | from math import sin, cos, asin, sqrt
def hav(lonlata, lonlatb):
# ported from latlontools
# assume latitude and longitudes are in radians
lona = lonlata[0]
lata = lonlata[1]
lonb = lonlatb[0]
latb = lonlatb[1]
diff_lat = lata - latb
diff_lon = lona - lonb
a = sin(diff_lat/2)**2 + cos(lona) * cos(latb) * sin(diff_lon/2)**2
c = 2 * asin(sqrt(a))
r = 6371 # radius of earth in km
return c * r | Change call signature of hav to 2 pairs | Change call signature of hav to 2 pairs
| Python | bsd-3-clause | LemonPi/Pathtreker,LemonPi/Pathtreker,LemonPi/Pathtreker | python | ## Code Before:
from math import sin, cos, asin, sqrt
def hav(lona, lonb, lata, latb):
# ported from latlontools
# assume latitude and longitudes are in radians
diff_lat = lata - latb
diff_lon = lona - lonb
a = sin(diff_lat/2)**2 + cos(lona) * cos(latb) * sin(diff_lon/2)**2
c = 2 * asin(sqrt(a))
r = 6371 # radius of earth in km
return c * r
## Instruction:
Change call signature of hav to 2 pairs
## Code After:
from math import sin, cos, asin, sqrt
def hav(lonlata, lonlatb):
# ported from latlontools
# assume latitude and longitudes are in radians
lona = lonlata[0]
lata = lonlata[1]
lonb = lonlatb[0]
latb = lonlatb[1]
diff_lat = lata - latb
diff_lon = lona - lonb
a = sin(diff_lat/2)**2 + cos(lona) * cos(latb) * sin(diff_lon/2)**2
c = 2 * asin(sqrt(a))
r = 6371 # radius of earth in km
return c * r | from math import sin, cos, asin, sqrt
- def hav(lona, lonb, lata, latb):
? ---------
+ def hav(lonlata, lonlatb):
? +++
# ported from latlontools
# assume latitude and longitudes are in radians
+ lona = lonlata[0]
+ lata = lonlata[1]
+
+ lonb = lonlatb[0]
+ latb = lonlatb[1]
+
diff_lat = lata - latb
diff_lon = lona - lonb
a = sin(diff_lat/2)**2 + cos(lona) * cos(latb) * sin(diff_lon/2)**2
c = 2 * asin(sqrt(a))
r = 6371 # radius of earth in km
return c * r | 8 | 0.666667 | 7 | 1 |
a77ebb1160542a49a52e8bcd3191148361a948ac | src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/media.html | src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/media.html | <div ng-controller="Umbraco.PropertyEditors.Grid.MediaController">
<div class="umb-editor-placeholder" ng-click="setImage()" ng-if="control.value === null">
<i class="icon icon-picture"></i>
<div ng-id="!control.$inserted" class="help-text"><localize key="grid_clickToInsertImage">Click to insert image</localize></div>
</div>
<div ng-if="control.value">
<img
ng-if="url"
ng-click="setImage()"
ng-src="{{url}}"
class="fullSizeImage" />
<input type="text" class="caption" ng-model="control.value.caption" localize="placeholder" placeholder="@grid_placeholderImageCaption" />
</div>
<umb-overlay
ng-if="mediaPickerOverlay.show"
model="mediaPickerOverlay"
view="mediaPickerOverlay.view"
position="right">
</umb-overlay>
</div>
| <div ng-controller="Umbraco.PropertyEditors.Grid.MediaController">
<div class="umb-editor-placeholder" ng-click="setImage()" ng-if="control.value === null">
<i class="icon icon-picture"></i>
<div ng-id="!control.$inserted" class="help-text"><localize key="grid_clickToInsertImage">Click to insert image</localize></div>
</div>
<div ng-if="control.value">
<img
ng-if="url"
ng-click="setImage()"
ng-src="{{url}}?width=800&upscale=false"
class="fullSizeImage" />
<input type="text" class="caption" ng-model="control.value.caption" localize="placeholder" placeholder="@grid_placeholderImageCaption" />
</div>
<umb-overlay
ng-if="mediaPickerOverlay.show"
model="mediaPickerOverlay"
view="mediaPickerOverlay.view"
position="right">
</umb-overlay>
</div>
| Add max resolution for the Image editor in Grid Layouts to avoid performance hit when using high res images. | Add max resolution for the Image editor in Grid Layouts to avoid performance hit when using high res images.
| HTML | mit | PeteDuncanson/Umbraco-CMS,marcemarc/Umbraco-CMS,aaronpowell/Umbraco-CMS,mittonp/Umbraco-CMS,lars-erik/Umbraco-CMS,aaronpowell/Umbraco-CMS,rasmuseeg/Umbraco-CMS,Phosworks/Umbraco-CMS,romanlytvyn/Umbraco-CMS,rasmusfjord/Umbraco-CMS,tompipe/Umbraco-CMS,hfloyd/Umbraco-CMS,base33/Umbraco-CMS,robertjf/Umbraco-CMS,hfloyd/Umbraco-CMS,WebCentrum/Umbraco-CMS,rustyswayne/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,tcmorris/Umbraco-CMS,lars-erik/Umbraco-CMS,Phosworks/Umbraco-CMS,sargin48/Umbraco-CMS,leekelleher/Umbraco-CMS,gavinfaux/Umbraco-CMS,leekelleher/Umbraco-CMS,mittonp/Umbraco-CMS,tcmorris/Umbraco-CMS,gkonings/Umbraco-CMS,robertjf/Umbraco-CMS,gavinfaux/Umbraco-CMS,gkonings/Umbraco-CMS,umbraco/Umbraco-CMS,tcmorris/Umbraco-CMS,robertjf/Umbraco-CMS,abryukhov/Umbraco-CMS,Phosworks/Umbraco-CMS,romanlytvyn/Umbraco-CMS,NikRimington/Umbraco-CMS,NikRimington/Umbraco-CMS,aadfPT/Umbraco-CMS,romanlytvyn/Umbraco-CMS,arknu/Umbraco-CMS,marcemarc/Umbraco-CMS,rustyswayne/Umbraco-CMS,kasperhhk/Umbraco-CMS,base33/Umbraco-CMS,umbraco/Umbraco-CMS,kasperhhk/Umbraco-CMS,kasperhhk/Umbraco-CMS,lars-erik/Umbraco-CMS,mattbrailsford/Umbraco-CMS,jchurchley/Umbraco-CMS,hfloyd/Umbraco-CMS,gavinfaux/Umbraco-CMS,PeteDuncanson/Umbraco-CMS,abryukhov/Umbraco-CMS,aadfPT/Umbraco-CMS,gkonings/Umbraco-CMS,hfloyd/Umbraco-CMS,dawoe/Umbraco-CMS,TimoPerplex/Umbraco-CMS,robertjf/Umbraco-CMS,arknu/Umbraco-CMS,TimoPerplex/Umbraco-CMS,abryukhov/Umbraco-CMS,rustyswayne/Umbraco-CMS,tompipe/Umbraco-CMS,marcemarc/Umbraco-CMS,tcmorris/Umbraco-CMS,gkonings/Umbraco-CMS,bjarnef/Umbraco-CMS,abjerner/Umbraco-CMS,mattbrailsford/Umbraco-CMS,base33/Umbraco-CMS,aadfPT/Umbraco-CMS,jchurchley/Umbraco-CMS,dawoe/Umbraco-CMS,abjerner/Umbraco-CMS,KevinJump/Umbraco-CMS,mittonp/Umbraco-CMS,romanlytvyn/Umbraco-CMS,bjarnef/Umbraco-CMS,neilgaietto/Umbraco-CMS,WebCentrum/Umbraco-CMS,rasmuseeg/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,PeteDuncanson/Umbraco-CMS,WebCentrum/Umbraco-CMS,JeffreyPerplex/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,arknu/Umbraco-CMS,JeffreyPerplex/Umbraco-CMS,tcmorris/Umbraco-CMS,dawoe/Umbraco-CMS,rustyswayne/Umbraco-CMS,sargin48/Umbraco-CMS,sargin48/Umbraco-CMS,marcemarc/Umbraco-CMS,kgiszewski/Umbraco-CMS,kasperhhk/Umbraco-CMS,umbraco/Umbraco-CMS,Phosworks/Umbraco-CMS,gavinfaux/Umbraco-CMS,KevinJump/Umbraco-CMS,mattbrailsford/Umbraco-CMS,rustyswayne/Umbraco-CMS,gavinfaux/Umbraco-CMS,rasmusfjord/Umbraco-CMS,tcmorris/Umbraco-CMS,KevinJump/Umbraco-CMS,neilgaietto/Umbraco-CMS,dawoe/Umbraco-CMS,robertjf/Umbraco-CMS,TimoPerplex/Umbraco-CMS,leekelleher/Umbraco-CMS,kgiszewski/Umbraco-CMS,tompipe/Umbraco-CMS,mittonp/Umbraco-CMS,lars-erik/Umbraco-CMS,mittonp/Umbraco-CMS,hfloyd/Umbraco-CMS,umbraco/Umbraco-CMS,kgiszewski/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,bjarnef/Umbraco-CMS,aaronpowell/Umbraco-CMS,TimoPerplex/Umbraco-CMS,Phosworks/Umbraco-CMS,nul800sebastiaan/Umbraco-CMS,madsoulswe/Umbraco-CMS,KevinJump/Umbraco-CMS,sargin48/Umbraco-CMS,neilgaietto/Umbraco-CMS,TimoPerplex/Umbraco-CMS,jchurchley/Umbraco-CMS,kasperhhk/Umbraco-CMS,gkonings/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,rasmusfjord/Umbraco-CMS,lars-erik/Umbraco-CMS,madsoulswe/Umbraco-CMS,romanlytvyn/Umbraco-CMS,nul800sebastiaan/Umbraco-CMS,madsoulswe/Umbraco-CMS,rasmusfjord/Umbraco-CMS,NikRimington/Umbraco-CMS,nul800sebastiaan/Umbraco-CMS,leekelleher/Umbraco-CMS,rasmuseeg/Umbraco-CMS,arknu/Umbraco-CMS,sargin48/Umbraco-CMS,neilgaietto/Umbraco-CMS,mattbrailsford/Umbraco-CMS,JeffreyPerplex/Umbraco-CMS,leekelleher/Umbraco-CMS,bjarnef/Umbraco-CMS,KevinJump/Umbraco-CMS,dawoe/Umbraco-CMS,abjerner/Umbraco-CMS,rasmusfjord/Umbraco-CMS,abjerner/Umbraco-CMS,neilgaietto/Umbraco-CMS,marcemarc/Umbraco-CMS,abryukhov/Umbraco-CMS | html | ## Code Before:
<div ng-controller="Umbraco.PropertyEditors.Grid.MediaController">
<div class="umb-editor-placeholder" ng-click="setImage()" ng-if="control.value === null">
<i class="icon icon-picture"></i>
<div ng-id="!control.$inserted" class="help-text"><localize key="grid_clickToInsertImage">Click to insert image</localize></div>
</div>
<div ng-if="control.value">
<img
ng-if="url"
ng-click="setImage()"
ng-src="{{url}}"
class="fullSizeImage" />
<input type="text" class="caption" ng-model="control.value.caption" localize="placeholder" placeholder="@grid_placeholderImageCaption" />
</div>
<umb-overlay
ng-if="mediaPickerOverlay.show"
model="mediaPickerOverlay"
view="mediaPickerOverlay.view"
position="right">
</umb-overlay>
</div>
## Instruction:
Add max resolution for the Image editor in Grid Layouts to avoid performance hit when using high res images.
## Code After:
<div ng-controller="Umbraco.PropertyEditors.Grid.MediaController">
<div class="umb-editor-placeholder" ng-click="setImage()" ng-if="control.value === null">
<i class="icon icon-picture"></i>
<div ng-id="!control.$inserted" class="help-text"><localize key="grid_clickToInsertImage">Click to insert image</localize></div>
</div>
<div ng-if="control.value">
<img
ng-if="url"
ng-click="setImage()"
ng-src="{{url}}?width=800&upscale=false"
class="fullSizeImage" />
<input type="text" class="caption" ng-model="control.value.caption" localize="placeholder" placeholder="@grid_placeholderImageCaption" />
</div>
<umb-overlay
ng-if="mediaPickerOverlay.show"
model="mediaPickerOverlay"
view="mediaPickerOverlay.view"
position="right">
</umb-overlay>
</div>
| <div ng-controller="Umbraco.PropertyEditors.Grid.MediaController">
<div class="umb-editor-placeholder" ng-click="setImage()" ng-if="control.value === null">
<i class="icon icon-picture"></i>
<div ng-id="!control.$inserted" class="help-text"><localize key="grid_clickToInsertImage">Click to insert image</localize></div>
</div>
<div ng-if="control.value">
<img
ng-if="url"
ng-click="setImage()"
- ng-src="{{url}}"
+ ng-src="{{url}}?width=800&upscale=false"
class="fullSizeImage" />
<input type="text" class="caption" ng-model="control.value.caption" localize="placeholder" placeholder="@grid_placeholderImageCaption" />
</div>
<umb-overlay
ng-if="mediaPickerOverlay.show"
model="mediaPickerOverlay"
view="mediaPickerOverlay.view"
position="right">
</umb-overlay>
</div> | 2 | 0.083333 | 1 | 1 |
1039516b805d860319827dce0a866ed71be2716f | sitenco/static/css/shared.css | sitenco/static/css/shared.css | /* HTML5 elements for older browsers */
header, article, section, figure, aside, footer {
display: block;
}
a {
text-decoration: none;
}
#rss {
background: black url(rss.png) -1px 1px no-repeat;
border-radius: 6px;
color: transparent;
display: block;
font-size:0;
height: 32px;
outline: 0;
padding: 0;
width: 32px;
}
article footer {
font-size: 0.8em;
opacity: 0.7;
padding-left: 20px;
}
article footer div {
padding: 0.2em;
}
article footer div > a:first-child {
margin-right: 0.5em;
}
article footer div > * {
display: inline;
}
.ref {
font-size: x-small;
vertical-align: top;
}
| /* HTML5 elements for older browsers */
header, article, section, figure, aside, footer {
display: block;
}
a {
text-decoration: none;
}
#rss {
background: black url(rss.png) -1px 1px no-repeat;
border-radius: 6px;
color: transparent;
display: block;
font-size:0;
height: 32px;
outline: 0;
padding: 0;
width: 32px;
}
article footer {
font-size: 0.8em;
opacity: 0.7;
padding-left: 20px;
}
article footer div {
padding: 0.2em;
}
article footer div > a:first-child {
margin-right: 0.5em;
}
article footer div > * {
display: inline;
}
.ref {
font-size: x-small;
vertical-align: top;
}
@media print {
body > nav > *, body > footer {
display: none;
}
html, body, body {
background: none !important;
}
.highlight {
page-break-inside: avoid;
}
}
| Add some print media CSS | Add some print media CSS
| CSS | bsd-3-clause | Kozea/sitenco | css | ## Code Before:
/* HTML5 elements for older browsers */
header, article, section, figure, aside, footer {
display: block;
}
a {
text-decoration: none;
}
#rss {
background: black url(rss.png) -1px 1px no-repeat;
border-radius: 6px;
color: transparent;
display: block;
font-size:0;
height: 32px;
outline: 0;
padding: 0;
width: 32px;
}
article footer {
font-size: 0.8em;
opacity: 0.7;
padding-left: 20px;
}
article footer div {
padding: 0.2em;
}
article footer div > a:first-child {
margin-right: 0.5em;
}
article footer div > * {
display: inline;
}
.ref {
font-size: x-small;
vertical-align: top;
}
## Instruction:
Add some print media CSS
## Code After:
/* HTML5 elements for older browsers */
header, article, section, figure, aside, footer {
display: block;
}
a {
text-decoration: none;
}
#rss {
background: black url(rss.png) -1px 1px no-repeat;
border-radius: 6px;
color: transparent;
display: block;
font-size:0;
height: 32px;
outline: 0;
padding: 0;
width: 32px;
}
article footer {
font-size: 0.8em;
opacity: 0.7;
padding-left: 20px;
}
article footer div {
padding: 0.2em;
}
article footer div > a:first-child {
margin-right: 0.5em;
}
article footer div > * {
display: inline;
}
.ref {
font-size: x-small;
vertical-align: top;
}
@media print {
body > nav > *, body > footer {
display: none;
}
html, body, body {
background: none !important;
}
.highlight {
page-break-inside: avoid;
}
}
| /* HTML5 elements for older browsers */
header, article, section, figure, aside, footer {
display: block;
}
a {
text-decoration: none;
}
#rss {
background: black url(rss.png) -1px 1px no-repeat;
border-radius: 6px;
color: transparent;
display: block;
font-size:0;
height: 32px;
outline: 0;
padding: 0;
width: 32px;
}
article footer {
font-size: 0.8em;
opacity: 0.7;
padding-left: 20px;
}
article footer div {
padding: 0.2em;
}
article footer div > a:first-child {
margin-right: 0.5em;
}
article footer div > * {
display: inline;
}
.ref {
font-size: x-small;
vertical-align: top;
}
+
+ @media print {
+ body > nav > *, body > footer {
+ display: none;
+ }
+ html, body, body {
+ background: none !important;
+ }
+ .highlight {
+ page-break-inside: avoid;
+ }
+ } | 12 | 0.27907 | 12 | 0 |
d12be22b5427a1433dd2ff7b1d2f97951d2b9c0f | pycon/migrations/0002_remove_old_google_openid_auths.py | pycon/migrations/0002_remove_old_google_openid_auths.py | from __future__ import unicode_literals
"""
Google OpenID auth has been turned off, so any associations that
users had to their Google accounts via Google OpenID are now useless.
Just remove them.
"""
from django.db import migrations
def no_op(apps, schema_editor):
pass
def remove_old_google_openid_auths(apps, schema_editor):
UserSocialAuth = apps.get_model('social_auth', 'UserSocialAuth')
db_alias = schema_editor.connection.alias
UserSocialAuth.objects.using(db_alias).filter(provider='google').delete()
class Migration(migrations.Migration):
dependencies = [
('pycon', '0001_initial'),
('social_auth', '0001_initial'),
]
operations = [
migrations.RunPython(remove_old_google_openid_auths, no_op),
]
| from __future__ import unicode_literals
"""
Google OpenID auth has been turned off, so any associations that
users had to their Google accounts via Google OpenID are now useless.
Just remove them.
"""
from django.db import migrations
def no_op(apps, schema_editor):
pass
def remove_old_google_openid_auths(apps, schema_editor):
UserSocialAuth = apps.get_model('social_auth', 'UserSocialAuth')
db_alias = schema_editor.connection.alias
UserSocialAuth.objects.using(db_alias).filter(provider='google').delete()
class Migration(migrations.Migration):
dependencies = [
('pycon', '0001_initial'),
]
operations = [
migrations.RunPython(remove_old_google_openid_auths, no_op),
]
| Undo premature fix for dependency | Undo premature fix for dependency
| Python | bsd-3-clause | Diwahars/pycon,PyCon/pycon,njl/pycon,njl/pycon,njl/pycon,PyCon/pycon,Diwahars/pycon,Diwahars/pycon,PyCon/pycon,PyCon/pycon,Diwahars/pycon,njl/pycon | python | ## Code Before:
from __future__ import unicode_literals
"""
Google OpenID auth has been turned off, so any associations that
users had to their Google accounts via Google OpenID are now useless.
Just remove them.
"""
from django.db import migrations
def no_op(apps, schema_editor):
pass
def remove_old_google_openid_auths(apps, schema_editor):
UserSocialAuth = apps.get_model('social_auth', 'UserSocialAuth')
db_alias = schema_editor.connection.alias
UserSocialAuth.objects.using(db_alias).filter(provider='google').delete()
class Migration(migrations.Migration):
dependencies = [
('pycon', '0001_initial'),
('social_auth', '0001_initial'),
]
operations = [
migrations.RunPython(remove_old_google_openid_auths, no_op),
]
## Instruction:
Undo premature fix for dependency
## Code After:
from __future__ import unicode_literals
"""
Google OpenID auth has been turned off, so any associations that
users had to their Google accounts via Google OpenID are now useless.
Just remove them.
"""
from django.db import migrations
def no_op(apps, schema_editor):
pass
def remove_old_google_openid_auths(apps, schema_editor):
UserSocialAuth = apps.get_model('social_auth', 'UserSocialAuth')
db_alias = schema_editor.connection.alias
UserSocialAuth.objects.using(db_alias).filter(provider='google').delete()
class Migration(migrations.Migration):
dependencies = [
('pycon', '0001_initial'),
]
operations = [
migrations.RunPython(remove_old_google_openid_auths, no_op),
]
| from __future__ import unicode_literals
"""
Google OpenID auth has been turned off, so any associations that
users had to their Google accounts via Google OpenID are now useless.
Just remove them.
"""
from django.db import migrations
def no_op(apps, schema_editor):
pass
def remove_old_google_openid_auths(apps, schema_editor):
UserSocialAuth = apps.get_model('social_auth', 'UserSocialAuth')
db_alias = schema_editor.connection.alias
UserSocialAuth.objects.using(db_alias).filter(provider='google').delete()
class Migration(migrations.Migration):
dependencies = [
('pycon', '0001_initial'),
- ('social_auth', '0001_initial'),
]
operations = [
migrations.RunPython(remove_old_google_openid_auths, no_op),
] | 1 | 0.03125 | 0 | 1 |
c808b695331fed39bb4e000f1c2170d2df484e34 | elm/IVFinal/App/Layout.elm | elm/IVFinal/App/Layout.elm | module IVFinal.App.Layout exposing (..)
import Html as H exposing (Html)
import Html.Attributes as HA
import Svg as S exposing (Svg)
import Svg.Attributes as SA
-- CSS is really confusing.
wrapper : List (Html msg) -> Html msg
wrapper contents =
H.div
[ HA.style [ ("margin", "4em")
, ("width", "600px")
, ("display", "flex")
]
]
contents
canvas : List (Svg msg) -> Html msg
canvas contents =
H.div []
[ S.svg
[ SA.version "1.1"
, SA.width "200"
, SA.height "600"
]
contents
]
form : List (Html msg) -> Html msg
form contents =
H.div [] contents
| module IVFinal.App.Layout exposing (..)
import Html as H exposing (Html)
import Html.Attributes as HA
import Svg as S exposing (Svg)
import Svg.Attributes as SA
wrapper : List (Html msg) -> Html msg
wrapper contents =
H.div
[ HA.style [ ("margin", "4em")
, ("width", "600px")
]
]
[ H.div
[ HA.style [("display", "flex")]
]
contents
, H.div []
boilerplate
]
canvas : List (Svg msg) -> Html msg
canvas contents =
H.div []
[ S.svg
[ SA.version "1.1"
, SA.width "200"
, SA.height "400"
]
contents
]
form : List (Html msg) -> Html msg
form contents =
H.div [] contents
boilerplate =
[ H.p []
[ H.text
"""
This example is derived from an app used to teach
students of veterinary medicine. They calculate the
appropriate drip rate and time (based on information
given to them by an instructor), then use the app to see
if the ending fluid level is what they expected.
"""
]
, H.p []
[ H.text "Here are some interesting values to try: "
, H.ul []
[ H.li [] [H.text "Drip rate of 2 for 5 hours."]
, H.li [] [H.text "Drip rate of 13 for 5 hours, 30 minutes."]
, H.li [] [H.text "Drip rate of 5 for 16 hours."]
]
]
]
| Add explanatory text at the bottom | Add explanatory text at the bottom | Elm | mit | marick/static-fp | elm | ## Code Before:
module IVFinal.App.Layout exposing (..)
import Html as H exposing (Html)
import Html.Attributes as HA
import Svg as S exposing (Svg)
import Svg.Attributes as SA
-- CSS is really confusing.
wrapper : List (Html msg) -> Html msg
wrapper contents =
H.div
[ HA.style [ ("margin", "4em")
, ("width", "600px")
, ("display", "flex")
]
]
contents
canvas : List (Svg msg) -> Html msg
canvas contents =
H.div []
[ S.svg
[ SA.version "1.1"
, SA.width "200"
, SA.height "600"
]
contents
]
form : List (Html msg) -> Html msg
form contents =
H.div [] contents
## Instruction:
Add explanatory text at the bottom
## Code After:
module IVFinal.App.Layout exposing (..)
import Html as H exposing (Html)
import Html.Attributes as HA
import Svg as S exposing (Svg)
import Svg.Attributes as SA
wrapper : List (Html msg) -> Html msg
wrapper contents =
H.div
[ HA.style [ ("margin", "4em")
, ("width", "600px")
]
]
[ H.div
[ HA.style [("display", "flex")]
]
contents
, H.div []
boilerplate
]
canvas : List (Svg msg) -> Html msg
canvas contents =
H.div []
[ S.svg
[ SA.version "1.1"
, SA.width "200"
, SA.height "400"
]
contents
]
form : List (Html msg) -> Html msg
form contents =
H.div [] contents
boilerplate =
[ H.p []
[ H.text
"""
This example is derived from an app used to teach
students of veterinary medicine. They calculate the
appropriate drip rate and time (based on information
given to them by an instructor), then use the app to see
if the ending fluid level is what they expected.
"""
]
, H.p []
[ H.text "Here are some interesting values to try: "
, H.ul []
[ H.li [] [H.text "Drip rate of 2 for 5 hours."]
, H.li [] [H.text "Drip rate of 13 for 5 hours, 30 minutes."]
, H.li [] [H.text "Drip rate of 5 for 16 hours."]
]
]
]
| module IVFinal.App.Layout exposing (..)
import Html as H exposing (Html)
import Html.Attributes as HA
import Svg as S exposing (Svg)
import Svg.Attributes as SA
- -- CSS is really confusing.
-
wrapper : List (Html msg) -> Html msg
wrapper contents =
H.div
[ HA.style [ ("margin", "4em")
, ("width", "600px")
- , ("display", "flex")
]
]
+ [ H.div
+ [ HA.style [("display", "flex")]
+ ]
- contents
+ contents
? ++++
+ , H.div []
+ boilerplate
+ ]
canvas : List (Svg msg) -> Html msg
canvas contents =
H.div []
[ S.svg
[ SA.version "1.1"
, SA.width "200"
- , SA.height "600"
? ^
+ , SA.height "400"
? ^
]
contents
]
form : List (Html msg) -> Html msg
form contents =
H.div [] contents
+
+
+ boilerplate =
+ [ H.p []
+ [ H.text
+ """
+ This example is derived from an app used to teach
+ students of veterinary medicine. They calculate the
+ appropriate drip rate and time (based on information
+ given to them by an instructor), then use the app to see
+ if the ending fluid level is what they expected.
+ """
+ ]
+ , H.p []
+ [ H.text "Here are some interesting values to try: "
+ , H.ul []
+ [ H.li [] [H.text "Drip rate of 2 for 5 hours."]
+ , H.li [] [H.text "Drip rate of 13 for 5 hours, 30 minutes."]
+ , H.li [] [H.text "Drip rate of 5 for 16 hours."]
+ ]
+ ]
+ ] | 35 | 1.060606 | 30 | 5 |
485b5949d08898e370ad3acfeeddd5b3eba905e8 | spec/views/users/index_spec.rb | spec/views/users/index_spec.rb | require 'spec_helper'
describe "/users" do
fixtures :users, :events
it "should not include admin column by default" do
assigns[:users] = [users(:aaron), users(:quentin)]
render '/users/index'
response.should_not have_selector(".admin", :content => "admin")
end
it "should include admin column when admin is logged in" do
login_as(:aaron)
assigns[:users] = [users(:aaron), users(:quentin)]
render '/users/index'
response.should have_selector(".admin", :content => "admin")
end
end
| require 'spec_helper'
describe "users/index.html.erb" do
fixtures :users, :events
it "should not include admin column by default" do
assigns[:users] = [users(:aaron), users(:quentin)]
render '/users/index'
response.should_not have_selector(".admin", :content => "admin")
end
it "should include admin column when admin is logged in" do
login_as(:aaron)
assigns[:users] = [users(:aaron), users(:quentin)]
render '/users/index'
response.should have_selector(".admin", :content => "admin")
end
end
| Use template path in users/index view spec | Use template path in users/index view spec
| Ruby | mit | mynameisfashanu/openconferenceware,mynameisfashanu/openconferenceware,osbridge/openconferenceware,osbridge/openconferenceware,mynameisfashanu/openconferenceware,ondrocks/openconferenceware,osbridge/openconferenceware,mynameisfashanu/openconferenceware,osbridge/openconferenceware,ondrocks/openconferenceware,ondrocks/openconferenceware,ondrocks/openconferenceware | ruby | ## Code Before:
require 'spec_helper'
describe "/users" do
fixtures :users, :events
it "should not include admin column by default" do
assigns[:users] = [users(:aaron), users(:quentin)]
render '/users/index'
response.should_not have_selector(".admin", :content => "admin")
end
it "should include admin column when admin is logged in" do
login_as(:aaron)
assigns[:users] = [users(:aaron), users(:quentin)]
render '/users/index'
response.should have_selector(".admin", :content => "admin")
end
end
## Instruction:
Use template path in users/index view spec
## Code After:
require 'spec_helper'
describe "users/index.html.erb" do
fixtures :users, :events
it "should not include admin column by default" do
assigns[:users] = [users(:aaron), users(:quentin)]
render '/users/index'
response.should_not have_selector(".admin", :content => "admin")
end
it "should include admin column when admin is logged in" do
login_as(:aaron)
assigns[:users] = [users(:aaron), users(:quentin)]
render '/users/index'
response.should have_selector(".admin", :content => "admin")
end
end
| require 'spec_helper'
- describe "/users" do
+ describe "users/index.html.erb" do
fixtures :users, :events
it "should not include admin column by default" do
assigns[:users] = [users(:aaron), users(:quentin)]
render '/users/index'
response.should_not have_selector(".admin", :content => "admin")
end
it "should include admin column when admin is logged in" do
login_as(:aaron)
assigns[:users] = [users(:aaron), users(:quentin)]
render '/users/index'
response.should have_selector(".admin", :content => "admin")
end
end | 2 | 0.1 | 1 | 1 |
b41be5f2697fc39bf90d445a50042cb9d8157bf1 | README.md | README.md |
[](https://travis-ci.org/Justin Yu/SwiftyDictionary)
[](http://cocoapods.org/pods/SwiftyDictionary)
[](http://cocoapods.org/pods/SwiftyDictionary)
[](http://cocoapods.org/pods/SwiftyDictionary)
## Usage
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
## Installation
SwiftyDictionary is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod "SwiftyDictionary"
```
## Author
Justin Yu, justin.v.yu@gmail.com
## License
SwiftyDictionary is available under the MIT license. See the LICENSE file for more info.
|
[](https://travis-ci.org/Justin Yu/SwiftyDictionary)
[](http://cocoapods.org/pods/SwiftyDictionary)
[](http://cocoapods.org/pods/SwiftyDictionary)
[](http://cocoapods.org/pods/SwiftyDictionary)
## Usage
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
This pod depends on Alamofire.
## Installation
SwiftyDictionary is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod "SwiftyDictionary"
```
## Quickstart
The basic features of this pod are the Dictionary and Thesaurus classes.
## Todo
- [ ] Dictionary
- [ ] Get definitions (array of all possible definitions)
- [ ] Get part of speech as an array for different definitions
- [ ] Get a sample sentence
- [ ] Thesaurus
- [ ] Get all synonyms (regardless of different definitions)
- [ ] Get all synonyms as an array of arrays of synonyms (accounting for different definitions)
## Author
Justin Yu, justin.v.yu@gmail.com
## License
SwiftyDictionary is available under the MIT license. See the LICENSE file for more info.
| Add todo list to readme | Add todo list to readme
| Markdown | mit | justinvyu/SwiftyDictionary,justinvyu/SwiftyDictionary,justinvyu/SwiftyDictionary | markdown | ## Code Before:
[](https://travis-ci.org/Justin Yu/SwiftyDictionary)
[](http://cocoapods.org/pods/SwiftyDictionary)
[](http://cocoapods.org/pods/SwiftyDictionary)
[](http://cocoapods.org/pods/SwiftyDictionary)
## Usage
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
## Installation
SwiftyDictionary is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod "SwiftyDictionary"
```
## Author
Justin Yu, justin.v.yu@gmail.com
## License
SwiftyDictionary is available under the MIT license. See the LICENSE file for more info.
## Instruction:
Add todo list to readme
## Code After:
[](https://travis-ci.org/Justin Yu/SwiftyDictionary)
[](http://cocoapods.org/pods/SwiftyDictionary)
[](http://cocoapods.org/pods/SwiftyDictionary)
[](http://cocoapods.org/pods/SwiftyDictionary)
## Usage
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
This pod depends on Alamofire.
## Installation
SwiftyDictionary is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod "SwiftyDictionary"
```
## Quickstart
The basic features of this pod are the Dictionary and Thesaurus classes.
## Todo
- [ ] Dictionary
- [ ] Get definitions (array of all possible definitions)
- [ ] Get part of speech as an array for different definitions
- [ ] Get a sample sentence
- [ ] Thesaurus
- [ ] Get all synonyms (regardless of different definitions)
- [ ] Get all synonyms as an array of arrays of synonyms (accounting for different definitions)
## Author
Justin Yu, justin.v.yu@gmail.com
## License
SwiftyDictionary is available under the MIT license. See the LICENSE file for more info.
|
[](https://travis-ci.org/Justin Yu/SwiftyDictionary)
[](http://cocoapods.org/pods/SwiftyDictionary)
[](http://cocoapods.org/pods/SwiftyDictionary)
[](http://cocoapods.org/pods/SwiftyDictionary)
## Usage
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
+ This pod depends on Alamofire.
+
## Installation
SwiftyDictionary is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod "SwiftyDictionary"
```
+ ## Quickstart
+
+ The basic features of this pod are the Dictionary and Thesaurus classes.
+
+ ## Todo
+
+ - [ ] Dictionary
+ - [ ] Get definitions (array of all possible definitions)
+ - [ ] Get part of speech as an array for different definitions
+ - [ ] Get a sample sentence
+ - [ ] Thesaurus
+ - [ ] Get all synonyms (regardless of different definitions)
+ - [ ] Get all synonyms as an array of arrays of synonyms (accounting for different definitions)
+
## Author
Justin Yu, justin.v.yu@gmail.com
## License
SwiftyDictionary is available under the MIT license. See the LICENSE file for more info. | 16 | 0.571429 | 16 | 0 |
79674ad67d2f4a20d4d14974b40b5b6c8d0b1c6e | SwiftPlusPlus/iOS/UITableView+EasyRegister.swift | SwiftPlusPlus/iOS/UITableView+EasyRegister.swift | //
// DequableTableViewCell.swift
// HDS Work Order
//
// Created by Andrew J Wagner on 3/20/16.
// Copyright © 2016 Housing Data Systems. All rights reserved.
//
import UIKit
extension UITableView {
public func registerCellWithType(type: UITableViewCell.Type) {
let nibName = self.nibNameFromType(type)
let nib = UINib(nibName: nibName, bundle: nil)
self.registerNib(nib, forCellReuseIdentifier: nibName)
}
public func dequeueCell<CellType: UITableViewCell>() -> CellType {
let identifier = self.nibNameFromType(CellType.self)
return self.dequeueReusableCellWithIdentifier(identifier) as! CellType
}
public func nibNameFromType(type: UITableViewCell.Type) -> String {
let fullClassName = NSStringFromClass(type)
return fullClassName.componentsSeparatedByString(".")[1]
}
}
| //
// DequableTableViewCell.swift
// HDS Work Order
//
// Created by Andrew J Wagner on 3/20/16.
// Copyright © 2016 Housing Data Systems. All rights reserved.
//
import UIKit
extension UITableView {
public func registerCellWithType(type: UITableViewCell.Type) {
let nibName = self.nibNameFromType(type)
let bundle = NSBundle(forClass: type)
let nib = UINib(nibName: nibName, bundle: bundle)
self.registerNib(nib, forCellReuseIdentifier: nibName)
}
public func dequeueCell<CellType: UITableViewCell>() -> CellType {
let identifier = self.nibNameFromType(CellType.self)
return self.dequeueReusableCellWithIdentifier(identifier) as! CellType
}
public func nibNameFromType(type: UITableViewCell.Type) -> String {
let fullClassName = NSStringFromClass(type)
return fullClassName.componentsSeparatedByString(".")[1]
}
}
| Allow easily registering table view cells from any bundle | [NF] Allow easily registering table view cells from any bundle
| Swift | mit | drewag/Swiftlier,drewag/Swiftlier | swift | ## Code Before:
//
// DequableTableViewCell.swift
// HDS Work Order
//
// Created by Andrew J Wagner on 3/20/16.
// Copyright © 2016 Housing Data Systems. All rights reserved.
//
import UIKit
extension UITableView {
public func registerCellWithType(type: UITableViewCell.Type) {
let nibName = self.nibNameFromType(type)
let nib = UINib(nibName: nibName, bundle: nil)
self.registerNib(nib, forCellReuseIdentifier: nibName)
}
public func dequeueCell<CellType: UITableViewCell>() -> CellType {
let identifier = self.nibNameFromType(CellType.self)
return self.dequeueReusableCellWithIdentifier(identifier) as! CellType
}
public func nibNameFromType(type: UITableViewCell.Type) -> String {
let fullClassName = NSStringFromClass(type)
return fullClassName.componentsSeparatedByString(".")[1]
}
}
## Instruction:
[NF] Allow easily registering table view cells from any bundle
## Code After:
//
// DequableTableViewCell.swift
// HDS Work Order
//
// Created by Andrew J Wagner on 3/20/16.
// Copyright © 2016 Housing Data Systems. All rights reserved.
//
import UIKit
extension UITableView {
public func registerCellWithType(type: UITableViewCell.Type) {
let nibName = self.nibNameFromType(type)
let bundle = NSBundle(forClass: type)
let nib = UINib(nibName: nibName, bundle: bundle)
self.registerNib(nib, forCellReuseIdentifier: nibName)
}
public func dequeueCell<CellType: UITableViewCell>() -> CellType {
let identifier = self.nibNameFromType(CellType.self)
return self.dequeueReusableCellWithIdentifier(identifier) as! CellType
}
public func nibNameFromType(type: UITableViewCell.Type) -> String {
let fullClassName = NSStringFromClass(type)
return fullClassName.componentsSeparatedByString(".")[1]
}
}
| //
// DequableTableViewCell.swift
// HDS Work Order
//
// Created by Andrew J Wagner on 3/20/16.
// Copyright © 2016 Housing Data Systems. All rights reserved.
//
import UIKit
extension UITableView {
public func registerCellWithType(type: UITableViewCell.Type) {
let nibName = self.nibNameFromType(type)
+ let bundle = NSBundle(forClass: type)
- let nib = UINib(nibName: nibName, bundle: nil)
? ^
+ let nib = UINib(nibName: nibName, bundle: bundle)
? ++ ^ +
self.registerNib(nib, forCellReuseIdentifier: nibName)
}
public func dequeueCell<CellType: UITableViewCell>() -> CellType {
let identifier = self.nibNameFromType(CellType.self)
return self.dequeueReusableCellWithIdentifier(identifier) as! CellType
}
public func nibNameFromType(type: UITableViewCell.Type) -> String {
let fullClassName = NSStringFromClass(type)
return fullClassName.componentsSeparatedByString(".")[1]
}
} | 3 | 0.111111 | 2 | 1 |
214ab39232ff0249a5c5f77741343eb03fdda113 | README.md | README.md |

Ruby Version 2.4.1
Rails Version 5.1.3
# Database set-up
* enter in CL:
```script
createuser --createdb --login -P go-tournament-manager
```
* add these username and password to config/database.yml:
```ruby
default: &default
adapter: postgresql
encoding: unicode
host: localhost
> username: go-tournament-manager
> password: go-tournament-manager
pool: ENV.fetch("RAILS_MAX_THREADS") { 5 }
```
* enter in CL:
````script
bin/rails db:set-up
bin/rails db:migrate```
````
|

Ruby Version 2.4.1
Rails Version 5.1.3
# Database set-up
* enter in CL:
```script
createuser --createdb --login -P go-tournament-manager
```
* add these username and password to config/database.yml:
```ruby
default: &default
adapter: postgresql
encoding: unicode
host: localhost
> username: go-tournament-manager
> password: go-tournament-manager
pool: ENV.fetch("RAILS_MAX_THREADS") { 5 }
```
* enter in CL:
````script
bin/rails db:set-up
bin/rails db:migrate```
````
| Fix relative link to screenshot | Fix relative link to screenshot
| Markdown | mit | compostbrain/go-tournament-manager,compostbrain/go-tournament-manager,compostbrain/go-tournament-manager,compostbrain/go-tournament-manager | markdown | ## Code Before:

Ruby Version 2.4.1
Rails Version 5.1.3
# Database set-up
* enter in CL:
```script
createuser --createdb --login -P go-tournament-manager
```
* add these username and password to config/database.yml:
```ruby
default: &default
adapter: postgresql
encoding: unicode
host: localhost
> username: go-tournament-manager
> password: go-tournament-manager
pool: ENV.fetch("RAILS_MAX_THREADS") { 5 }
```
* enter in CL:
````script
bin/rails db:set-up
bin/rails db:migrate```
````
## Instruction:
Fix relative link to screenshot
## Code After:

Ruby Version 2.4.1
Rails Version 5.1.3
# Database set-up
* enter in CL:
```script
createuser --createdb --login -P go-tournament-manager
```
* add these username and password to config/database.yml:
```ruby
default: &default
adapter: postgresql
encoding: unicode
host: localhost
> username: go-tournament-manager
> password: go-tournament-manager
pool: ENV.fetch("RAILS_MAX_THREADS") { 5 }
```
* enter in CL:
````script
bin/rails db:set-up
bin/rails db:migrate```
````
|
- 
+ 
? + +++++++++++++++++++++++
Ruby Version 2.4.1
Rails Version 5.1.3
# Database set-up
* enter in CL:
```script
createuser --createdb --login -P go-tournament-manager
```
* add these username and password to config/database.yml:
```ruby
default: &default
adapter: postgresql
encoding: unicode
host: localhost
> username: go-tournament-manager
> password: go-tournament-manager
pool: ENV.fetch("RAILS_MAX_THREADS") { 5 }
```
* enter in CL:
````script
bin/rails db:set-up
bin/rails db:migrate```
```` | 2 | 0.0625 | 1 | 1 |
aa397eccd4b3a92cc14667c942cb3a9ee3cda0e3 | src/Event/SignInEvent.php | src/Event/SignInEvent.php | <?php
namespace Passengers\Event;
use Cake\Event\Event;
use Cake\Event\EventListenerInterface;
use Cake\Controller\Component\AuthComponent;
use Cake\Core\Configure;
use Cake\Core\Plugin;
use Cake\ORM\Association;
use Cake\ORM\Tableregistry;
class SignInEvent implements EventListenerInterface {
public function implementedEvents()
{
return array(
'Controller.Users.beforeSignIn' => array(
'callable' => 'beforeUsersControllerSignIn',
),
);
}
public function beforeUsersControllerSignIn(Event $event)
{
$controller = $event->subject();
$active = true;
if($controller->request->is('post')){
if($controller->request->data('username') || $controller->request->data('email')) {
$active = $controller->Users->find('all', [
'conditions' => [
'Users.active' => true,
'OR' => [
'Users.email' => $controller->request->data('email'),
'Users.username' => $controller->request->data('username')
]
]
])->count();
}
}
if(!$active){
$event->stopPropagation();
return __d('passengers', 'Sorry, but your account has been not activated yet.');
}
}
}
| <?php
namespace Passengers\Event;
use Cake\Event\Event;
use Cake\Event\EventListenerInterface;
use Cake\Controller\Component\AuthComponent;
use Cake\Core\Configure;
use Cake\Core\Plugin;
use Cake\ORM\Association;
use Cake\ORM\Tableregistry;
class SignInEvent implements EventListenerInterface {
public function implementedEvents()
{
return array(
'Controller.Users.beforeSignIn' => array(
'callable' => 'beforeUsersControllerSignIn',
),
);
}
public function beforeUsersControllerSignIn(Event $event)
{
$controller = $event->subject();
$active = true;
if($controller->request->is('post')){
$userName = '';
if ($controller->request->data('username'))
$userName = $controller->request->data('username');
if ($controller->request->data('email'))
$userName = $controller->request->data('email');
if($userName) {
$active = $controller->Users->find('all', [
'conditions' => [
'Users.active' => true,
'OR' => [
'Users.email' => $userName,
'Users.username' => $userName
]
]
])->count();
}
}
if(!$active){
$event->stopPropagation();
return __d('passengers', 'Sorry, but your account has been not activated yet.');
}
}
}
| Fix check user is active by email or username | Fix check user is active by email or username
| PHP | mit | mindforce/cakephp-passengers | php | ## Code Before:
<?php
namespace Passengers\Event;
use Cake\Event\Event;
use Cake\Event\EventListenerInterface;
use Cake\Controller\Component\AuthComponent;
use Cake\Core\Configure;
use Cake\Core\Plugin;
use Cake\ORM\Association;
use Cake\ORM\Tableregistry;
class SignInEvent implements EventListenerInterface {
public function implementedEvents()
{
return array(
'Controller.Users.beforeSignIn' => array(
'callable' => 'beforeUsersControllerSignIn',
),
);
}
public function beforeUsersControllerSignIn(Event $event)
{
$controller = $event->subject();
$active = true;
if($controller->request->is('post')){
if($controller->request->data('username') || $controller->request->data('email')) {
$active = $controller->Users->find('all', [
'conditions' => [
'Users.active' => true,
'OR' => [
'Users.email' => $controller->request->data('email'),
'Users.username' => $controller->request->data('username')
]
]
])->count();
}
}
if(!$active){
$event->stopPropagation();
return __d('passengers', 'Sorry, but your account has been not activated yet.');
}
}
}
## Instruction:
Fix check user is active by email or username
## Code After:
<?php
namespace Passengers\Event;
use Cake\Event\Event;
use Cake\Event\EventListenerInterface;
use Cake\Controller\Component\AuthComponent;
use Cake\Core\Configure;
use Cake\Core\Plugin;
use Cake\ORM\Association;
use Cake\ORM\Tableregistry;
class SignInEvent implements EventListenerInterface {
public function implementedEvents()
{
return array(
'Controller.Users.beforeSignIn' => array(
'callable' => 'beforeUsersControllerSignIn',
),
);
}
public function beforeUsersControllerSignIn(Event $event)
{
$controller = $event->subject();
$active = true;
if($controller->request->is('post')){
$userName = '';
if ($controller->request->data('username'))
$userName = $controller->request->data('username');
if ($controller->request->data('email'))
$userName = $controller->request->data('email');
if($userName) {
$active = $controller->Users->find('all', [
'conditions' => [
'Users.active' => true,
'OR' => [
'Users.email' => $userName,
'Users.username' => $userName
]
]
])->count();
}
}
if(!$active){
$event->stopPropagation();
return __d('passengers', 'Sorry, but your account has been not activated yet.');
}
}
}
| <?php
namespace Passengers\Event;
use Cake\Event\Event;
use Cake\Event\EventListenerInterface;
use Cake\Controller\Component\AuthComponent;
use Cake\Core\Configure;
use Cake\Core\Plugin;
use Cake\ORM\Association;
use Cake\ORM\Tableregistry;
class SignInEvent implements EventListenerInterface {
public function implementedEvents()
{
return array(
'Controller.Users.beforeSignIn' => array(
'callable' => 'beforeUsersControllerSignIn',
),
);
}
public function beforeUsersControllerSignIn(Event $event)
{
$controller = $event->subject();
$active = true;
if($controller->request->is('post')){
- if($controller->request->data('username') || $controller->request->data('email')) {
+ $userName = '';
+ if ($controller->request->data('username'))
+ $userName = $controller->request->data('username');
+ if ($controller->request->data('email'))
+ $userName = $controller->request->data('email');
+ if($userName) {
$active = $controller->Users->find('all', [
'conditions' => [
'Users.active' => true,
'OR' => [
- 'Users.email' => $controller->request->data('email'),
+ 'Users.email' => $userName,
- 'Users.username' => $controller->request->data('username')
? --------------------------- ^ --
+ 'Users.username' => $userName
? ^
]
]
])->count();
}
}
if(!$active){
$event->stopPropagation();
return __d('passengers', 'Sorry, but your account has been not activated yet.');
}
}
} | 11 | 0.23913 | 8 | 3 |
dca8ae9d6565884c06a0d742ee6475d98d6c55d6 | src/components/orders-v3/completed-orders/completed-orders-tpl.html | src/components/orders-v3/completed-orders/completed-orders-tpl.html | <div>
<div ng-repeat="order in orders">
Table: {{order.tableId}} -
<button type="button" ng-click="deliverOrder({tableId:order.tableId})">Deliver</button>
<table class="table table-striped">
<thead>
<tr>
<th>Description</th>
<th>Qty</th>
<th>Total</th>
<th>x</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in order.items">
<td>{{item.description}}</td>
<td>{{item.qty}}</td>
<td>{{item.total | currency}}</td>
<td>
<button type="button" ng-click="addItemToOrder(
{tableId:order.tableId,
menuItemId:item.menuId})">+</button>
<button type="button" ng-click="removeItemFromOrder({tableId:order.tableId, menuItemId:item.menuId})">-</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
| <div>
<div ng-repeat="order in orders">
Table: {{order.tableId}} -
<button type="button" ng-click="deliverOrder({tableId:order.tableId})">Deliver</button>
<table class="table table-striped">
<thead>
<tr>
<th>Description</th>
<th>Qty</th>
<th>Total</th>
<th>x</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in order.items">
<td>{{item.description}}</td>
<td>{{item.qty}}</td>
<td>{{item.total | currency}}</td>
<td>
<add-item
on-add-item-to-order="addItemToOrder(
{tableId:order.tableId,
menuItemId:item.menuId})"></add-item>
<remove-item
on-remove-item-from-order="removeItemFromOrder({tableId:order.tableId, menuItemId:item.menuId})">
</remove-item>
</td>
</tr>
</tbody>
</table>
</div>
</div>
| Refactor completed orders to use add-item/remove-item | Refactor completed orders to use add-item/remove-item
| HTML | bsd-2-clause | e-schultz/ng-summit-redux,e-schultz/ng-summit-redux | html | ## Code Before:
<div>
<div ng-repeat="order in orders">
Table: {{order.tableId}} -
<button type="button" ng-click="deliverOrder({tableId:order.tableId})">Deliver</button>
<table class="table table-striped">
<thead>
<tr>
<th>Description</th>
<th>Qty</th>
<th>Total</th>
<th>x</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in order.items">
<td>{{item.description}}</td>
<td>{{item.qty}}</td>
<td>{{item.total | currency}}</td>
<td>
<button type="button" ng-click="addItemToOrder(
{tableId:order.tableId,
menuItemId:item.menuId})">+</button>
<button type="button" ng-click="removeItemFromOrder({tableId:order.tableId, menuItemId:item.menuId})">-</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
## Instruction:
Refactor completed orders to use add-item/remove-item
## Code After:
<div>
<div ng-repeat="order in orders">
Table: {{order.tableId}} -
<button type="button" ng-click="deliverOrder({tableId:order.tableId})">Deliver</button>
<table class="table table-striped">
<thead>
<tr>
<th>Description</th>
<th>Qty</th>
<th>Total</th>
<th>x</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in order.items">
<td>{{item.description}}</td>
<td>{{item.qty}}</td>
<td>{{item.total | currency}}</td>
<td>
<add-item
on-add-item-to-order="addItemToOrder(
{tableId:order.tableId,
menuItemId:item.menuId})"></add-item>
<remove-item
on-remove-item-from-order="removeItemFromOrder({tableId:order.tableId, menuItemId:item.menuId})">
</remove-item>
</td>
</tr>
</tbody>
</table>
</div>
</div>
| <div>
<div ng-repeat="order in orders">
Table: {{order.tableId}} -
<button type="button" ng-click="deliverOrder({tableId:order.tableId})">Deliver</button>
<table class="table table-striped">
<thead>
<tr>
<th>Description</th>
<th>Qty</th>
<th>Total</th>
<th>x</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in order.items">
<td>{{item.description}}</td>
<td>{{item.qty}}</td>
<td>{{item.total | currency}}</td>
<td>
- <button type="button" ng-click="addItemToOrder(
+ <add-item
+ on-add-item-to-order="addItemToOrder(
{tableId:order.tableId,
- menuItemId:item.menuId})">+</button>
? - ^^ ^^^
+ menuItemId:item.menuId})"></add-item>
? ^^^^^ ^^
+ <remove-item
- <button type="button" ng-click="removeItemFromOrder({tableId:order.tableId, menuItemId:item.menuId})">-</button>
? ^^^^^ ^ -- ^^^^^^ ^^^^^ ^^^^^ ----------
+ on-remove-item-from-order="removeItemFromOrder({tableId:order.tableId, menuItemId:item.menuId})">
? ^^^^ ^^^^^^^^^ ^^^^ ^ ^^^^^
+ </remove-item>
+
</td>
</tr>
</tbody>
</table>
</div>
</div> | 10 | 0.344828 | 7 | 3 |
81cf0dddad3e555ef4d01a827f385a9a459186f2 | app/views/renalware/shared/documents/_blood_group_input.html.slim | app/views/renalware/shared/documents/_blood_group_input.html.slim | = f.simple_fields_for attribute, f.object.send(attribute) do |fd|
= fd.input :value, label: f.object.class.human_attribute_name(attribute)
| = f.simple_fields_for attribute, f.object.send(attribute) do |fd|
= fd.input :value, label: f.object.class.human_attribute_name(attribute),
input_html: { class: "small-input" }
| Make blood group input smaller | Make blood group input smaller
| Slim | mit | airslie/renalware-core,airslie/renalware-core,airslie/renalware-core,airslie/renalware-core | slim | ## Code Before:
= f.simple_fields_for attribute, f.object.send(attribute) do |fd|
= fd.input :value, label: f.object.class.human_attribute_name(attribute)
## Instruction:
Make blood group input smaller
## Code After:
= f.simple_fields_for attribute, f.object.send(attribute) do |fd|
= fd.input :value, label: f.object.class.human_attribute_name(attribute),
input_html: { class: "small-input" }
| = f.simple_fields_for attribute, f.object.send(attribute) do |fd|
- = fd.input :value, label: f.object.class.human_attribute_name(attribute)
+ = fd.input :value, label: f.object.class.human_attribute_name(attribute),
? +
+ input_html: { class: "small-input" } | 3 | 1.5 | 2 | 1 |
75606e2b13a29a5d68894eda86dbede8292fb0c8 | website/project/taxonomies/__init__.py | website/project/taxonomies/__init__.py | from modularodm import fields
from framework.mongo import (
ObjectId,
StoredObject,
utils as mongo_utils
)
from website.util import api_v2_url
@mongo_utils.unique_on(['text'])
class Subject(StoredObject):
_id = fields.StringField(primary=True, default=lambda: str(ObjectId()))
text = fields.StringField(required=True)
parents = fields.ForeignField('subject', list=True)
@property
def absolute_api_v2_url(self):
return api_v2_url('taxonomies/{}/'.format(self._id))
def get_absolute_url(self):
return self.absolute_api_v2_url
| import pymongo
from modularodm import fields
from framework.mongo import (
ObjectId,
StoredObject,
utils as mongo_utils
)
from website.util import api_v2_url
@mongo_utils.unique_on(['text'])
class Subject(StoredObject):
__indices__ = [
{
'unique': True,
'key_or_list': [
('text', pymongo.DESCENDING),
]
}
]
_id = fields.StringField(primary=True, default=lambda: str(ObjectId()))
text = fields.StringField(required=True)
parents = fields.ForeignField('subject', list=True)
@property
def absolute_api_v2_url(self):
return api_v2_url('taxonomies/{}/'.format(self._id))
def get_absolute_url(self):
return self.absolute_api_v2_url
| Add unique index on the subject model for @chrisseto | Add unique index on the subject model for @chrisseto
| Python | apache-2.0 | hmoco/osf.io,alexschiller/osf.io,CenterForOpenScience/osf.io,Johnetordoff/osf.io,HalcyonChimera/osf.io,baylee-d/osf.io,aaxelb/osf.io,samchrisinger/osf.io,HalcyonChimera/osf.io,CenterForOpenScience/osf.io,cslzchen/osf.io,cwisecarver/osf.io,Johnetordoff/osf.io,crcresearch/osf.io,chrisseto/osf.io,alexschiller/osf.io,aaxelb/osf.io,emetsger/osf.io,Johnetordoff/osf.io,erinspace/osf.io,erinspace/osf.io,sloria/osf.io,mfraezz/osf.io,mfraezz/osf.io,rdhyee/osf.io,brianjgeiger/osf.io,saradbowman/osf.io,mluo613/osf.io,TomBaxter/osf.io,baylee-d/osf.io,samchrisinger/osf.io,mluo613/osf.io,icereval/osf.io,chrisseto/osf.io,caseyrollins/osf.io,sloria/osf.io,laurenrevere/osf.io,cwisecarver/osf.io,binoculars/osf.io,adlius/osf.io,caseyrollins/osf.io,samchrisinger/osf.io,saradbowman/osf.io,monikagrabowska/osf.io,mattclark/osf.io,mluo613/osf.io,binoculars/osf.io,alexschiller/osf.io,alexschiller/osf.io,TomBaxter/osf.io,sloria/osf.io,monikagrabowska/osf.io,aaxelb/osf.io,laurenrevere/osf.io,chrisseto/osf.io,chrisseto/osf.io,emetsger/osf.io,acshi/osf.io,adlius/osf.io,brianjgeiger/osf.io,icereval/osf.io,binoculars/osf.io,CenterForOpenScience/osf.io,cwisecarver/osf.io,leb2dg/osf.io,felliott/osf.io,felliott/osf.io,aaxelb/osf.io,HalcyonChimera/osf.io,caseyrollins/osf.io,chennan47/osf.io,caneruguz/osf.io,monikagrabowska/osf.io,mattclark/osf.io,caneruguz/osf.io,erinspace/osf.io,pattisdr/osf.io,cslzchen/osf.io,icereval/osf.io,acshi/osf.io,mluo613/osf.io,cslzchen/osf.io,mfraezz/osf.io,felliott/osf.io,emetsger/osf.io,hmoco/osf.io,HalcyonChimera/osf.io,Nesiehr/osf.io,laurenrevere/osf.io,crcresearch/osf.io,cslzchen/osf.io,hmoco/osf.io,Nesiehr/osf.io,rdhyee/osf.io,acshi/osf.io,acshi/osf.io,Johnetordoff/osf.io,TomBaxter/osf.io,mluo613/osf.io,crcresearch/osf.io,Nesiehr/osf.io,emetsger/osf.io,leb2dg/osf.io,samchrisinger/osf.io,acshi/osf.io,Nesiehr/osf.io,adlius/osf.io,brianjgeiger/osf.io,leb2dg/osf.io,rdhyee/osf.io,felliott/osf.io,brianjgeiger/osf.io,alexschiller/osf.io,caneruguz/osf.io,pattisdr/osf.io,adlius/osf.io,chennan47/osf.io,mfraezz/osf.io,baylee-d/osf.io,caneruguz/osf.io,chennan47/osf.io,monikagrabowska/osf.io,monikagrabowska/osf.io,leb2dg/osf.io,rdhyee/osf.io,hmoco/osf.io,cwisecarver/osf.io,CenterForOpenScience/osf.io,pattisdr/osf.io,mattclark/osf.io | python | ## Code Before:
from modularodm import fields
from framework.mongo import (
ObjectId,
StoredObject,
utils as mongo_utils
)
from website.util import api_v2_url
@mongo_utils.unique_on(['text'])
class Subject(StoredObject):
_id = fields.StringField(primary=True, default=lambda: str(ObjectId()))
text = fields.StringField(required=True)
parents = fields.ForeignField('subject', list=True)
@property
def absolute_api_v2_url(self):
return api_v2_url('taxonomies/{}/'.format(self._id))
def get_absolute_url(self):
return self.absolute_api_v2_url
## Instruction:
Add unique index on the subject model for @chrisseto
## Code After:
import pymongo
from modularodm import fields
from framework.mongo import (
ObjectId,
StoredObject,
utils as mongo_utils
)
from website.util import api_v2_url
@mongo_utils.unique_on(['text'])
class Subject(StoredObject):
__indices__ = [
{
'unique': True,
'key_or_list': [
('text', pymongo.DESCENDING),
]
}
]
_id = fields.StringField(primary=True, default=lambda: str(ObjectId()))
text = fields.StringField(required=True)
parents = fields.ForeignField('subject', list=True)
@property
def absolute_api_v2_url(self):
return api_v2_url('taxonomies/{}/'.format(self._id))
def get_absolute_url(self):
return self.absolute_api_v2_url
| + import pymongo
from modularodm import fields
from framework.mongo import (
ObjectId,
StoredObject,
utils as mongo_utils
)
from website.util import api_v2_url
@mongo_utils.unique_on(['text'])
class Subject(StoredObject):
+
+ __indices__ = [
+ {
+ 'unique': True,
+ 'key_or_list': [
+ ('text', pymongo.DESCENDING),
+ ]
+ }
+ ]
+
_id = fields.StringField(primary=True, default=lambda: str(ObjectId()))
text = fields.StringField(required=True)
parents = fields.ForeignField('subject', list=True)
@property
def absolute_api_v2_url(self):
return api_v2_url('taxonomies/{}/'.format(self._id))
def get_absolute_url(self):
return self.absolute_api_v2_url | 11 | 0.5 | 11 | 0 |
adf821a39271131ef5ba4116b29ec38a6a3b13db | lib/countdown.js | lib/countdown.js | 'use strict';
(function() {
var root = this;
var Countdown = function(duration, onTick, onComplete){
this.secondsLeft = duration;
var tick = function() {
if (this.secondsLeft > 0) {
onTick(this.secondsLeft);
this.secondsLeft -= 1;
} else {
clearInterval(this.interval);
onComplete();
}
}
//setting the interval, by call tick and passing through this via a self-calling function wrap
this.interval = setInterval(
(function(self){
return function() { tick.call(self) }
})(this),1000
);
}
Countdown.prototype.abort = function() {
clearInterval(this.interval);
}
if (typeof exports !== 'undefined') module.exports = exports = Countdown;
else root.Countdown = Countdown;
}).call(this);
| 'use strict';
(function() {
var root = this;
var Countdown = function(duration, onTick, onComplete){
this.secondsLeft = duration;
var tick = function() {
if (this.secondsLeft > 0) {
onTick(this.secondsLeft);
this.secondsLeft -= 1;
} else {
clearInterval(this.interval);
onComplete();
}
}
// First tick.
tick.call(this);
// Setting the interval, by call tick and passing through this via a self-calling function wrap.
this.interval = setInterval(
(function(self){
return function() { tick.call(self) }
})(this), 1000
);
}
Countdown.prototype.abort = function() {
clearInterval(this.interval);
}
if (typeof exports !== 'undefined') module.exports = exports = Countdown;
else root.Countdown = Countdown;
}).call(this);
| Fix a bug related to the first tick not being called | Fix a bug related to the first tick not being called
| JavaScript | mit | gumroad/countdown.js | javascript | ## Code Before:
'use strict';
(function() {
var root = this;
var Countdown = function(duration, onTick, onComplete){
this.secondsLeft = duration;
var tick = function() {
if (this.secondsLeft > 0) {
onTick(this.secondsLeft);
this.secondsLeft -= 1;
} else {
clearInterval(this.interval);
onComplete();
}
}
//setting the interval, by call tick and passing through this via a self-calling function wrap
this.interval = setInterval(
(function(self){
return function() { tick.call(self) }
})(this),1000
);
}
Countdown.prototype.abort = function() {
clearInterval(this.interval);
}
if (typeof exports !== 'undefined') module.exports = exports = Countdown;
else root.Countdown = Countdown;
}).call(this);
## Instruction:
Fix a bug related to the first tick not being called
## Code After:
'use strict';
(function() {
var root = this;
var Countdown = function(duration, onTick, onComplete){
this.secondsLeft = duration;
var tick = function() {
if (this.secondsLeft > 0) {
onTick(this.secondsLeft);
this.secondsLeft -= 1;
} else {
clearInterval(this.interval);
onComplete();
}
}
// First tick.
tick.call(this);
// Setting the interval, by call tick and passing through this via a self-calling function wrap.
this.interval = setInterval(
(function(self){
return function() { tick.call(self) }
})(this), 1000
);
}
Countdown.prototype.abort = function() {
clearInterval(this.interval);
}
if (typeof exports !== 'undefined') module.exports = exports = Countdown;
else root.Countdown = Countdown;
}).call(this);
| 'use strict';
(function() {
var root = this;
var Countdown = function(duration, onTick, onComplete){
this.secondsLeft = duration;
var tick = function() {
if (this.secondsLeft > 0) {
onTick(this.secondsLeft);
this.secondsLeft -= 1;
} else {
clearInterval(this.interval);
onComplete();
}
}
+
+ // First tick.
+ tick.call(this);
+
- //setting the interval, by call tick and passing through this via a self-calling function wrap
? ^
+ // Setting the interval, by call tick and passing through this via a self-calling function wrap.
? ^^ +
this.interval = setInterval(
(function(self){
return function() { tick.call(self) }
- })(this),1000
+ })(this), 1000
? +
);
}
Countdown.prototype.abort = function() {
clearInterval(this.interval);
}
if (typeof exports !== 'undefined') module.exports = exports = Countdown;
else root.Countdown = Countdown;
}).call(this); | 8 | 0.25 | 6 | 2 |
1c6bc00afa2b57808df4e01c9e5d23a4b1e8beda | scalajs/src/main/scala/example/ScalaJSExample.scala | scalajs/src/main/scala/example/ScalaJSExample.scala | package example
import scala.scalajs.js
import js.Dynamic.{ global => g }
import shared.SharedMessages
object ScalaJSExample extends js.JSApp {
def main(): Unit = {
g.document.getElementById("scalajsShoutOut").textContent = SharedMessages.itWorks
}
/** Computes the square of an integer.
* This demonstrates unit testing.
*/
def square(x: Int): Int = x*x
}
| package example
import scala.scalajs.js
import org.scalajs.dom
import shared.SharedMessages
object ScalaJSExample extends js.JSApp {
def main(): Unit = {
dom.document.getElementById("scalajsShoutOut").textContent = SharedMessages.itWorks
}
/** Computes the square of an integer.
* This demonstrates unit testing.
*/
def square(x: Int): Int = x*x
}
| Use the scalajs dom library | Use the scalajs dom library
| Scala | apache-2.0 | vmunier/play-with-scalajs-example,vmunier/play-with-scalajs-example | scala | ## Code Before:
package example
import scala.scalajs.js
import js.Dynamic.{ global => g }
import shared.SharedMessages
object ScalaJSExample extends js.JSApp {
def main(): Unit = {
g.document.getElementById("scalajsShoutOut").textContent = SharedMessages.itWorks
}
/** Computes the square of an integer.
* This demonstrates unit testing.
*/
def square(x: Int): Int = x*x
}
## Instruction:
Use the scalajs dom library
## Code After:
package example
import scala.scalajs.js
import org.scalajs.dom
import shared.SharedMessages
object ScalaJSExample extends js.JSApp {
def main(): Unit = {
dom.document.getElementById("scalajsShoutOut").textContent = SharedMessages.itWorks
}
/** Computes the square of an integer.
* This demonstrates unit testing.
*/
def square(x: Int): Int = x*x
}
| package example
import scala.scalajs.js
- import js.Dynamic.{ global => g }
+ import org.scalajs.dom
import shared.SharedMessages
object ScalaJSExample extends js.JSApp {
def main(): Unit = {
- g.document.getElementById("scalajsShoutOut").textContent = SharedMessages.itWorks
? ^
+ dom.document.getElementById("scalajsShoutOut").textContent = SharedMessages.itWorks
? ^^^
}
/** Computes the square of an integer.
* This demonstrates unit testing.
*/
def square(x: Int): Int = x*x
} | 4 | 0.25 | 2 | 2 |
ffc74b51310f958a37b20d355292b24b7c7072bf | src/menu/bookmarks/components/Bookmarks/index.tsx | src/menu/bookmarks/components/Bookmarks/index.tsx | import { observer } from 'mobx-react';
import { hot } from 'react-hot-loader';
import React from 'react';
import AppStore from '../../../../app/store';
import Store from '../../store';
import db from '../../../../shared/models/app-database';
import Item from '../Item';
import TreeBar from '../TreeBar';
import { Content, Items } from './styles';
@observer
class Bookmarks extends React.Component {
public componentDidMount() {
this.loadBookmarks();
}
public loadBookmarks = async () => {
const bookmarks = await db.bookmarks.toArray();
db.favicons.each(favicon => {
if (AppStore.favicons[favicon.url] == null && favicon.favicon.byteLength !== 0) {
AppStore.favicons[favicon.url] = window.URL.createObjectURL(new Blob([favicon.favicon]));
}
});
Store.bookmarks = bookmarks;
Store.goTo(-1);
};
public render() {
return (
<React.Fragment>
<TreeBar />
<Content>
{Store.bookmarks.length > 0 && (
<Items>
{Store.bookmarks.map(data => {
if (data.parent === Store.currentTree) {
return <Item data={data} key={data.id} />;
}
return null;
})}
</Items>
)}
</Content>
</React.Fragment>
);
}
}
export default hot(module)(Bookmarks);
| import { observer } from 'mobx-react';
import { hot } from 'react-hot-loader';
import React from 'react';
import AppStore from '../../../../app/store';
import Store from '../../store';
import db from '../../../../shared/models/app-database';
import Item from '../Item';
import TreeBar from '../TreeBar';
import { Content, Items } from './styles';
@observer
class Bookmarks extends React.Component {
public componentDidMount() {
this.loadBookmarks();
}
public loadBookmarks = async () => {
const bookmarks = await db.bookmarks.toArray();
db.favicons.each(favicon => {
if (AppStore.favicons[favicon.url] == null && favicon.favicon.byteLength !== 0) {
AppStore.favicons[favicon.url] = window.URL.createObjectURL(new Blob([favicon.favicon]));
}
});
Store.bookmarks = bookmarks;
Store.goTo(-1);
};
public render() {
const items = Store.bookmarks.filter(r => r.parent === Store.currentTree);
return (
<React.Fragment>
<TreeBar />
<Content>
{items.length > 0 && (
<Items>
{items.map(data => <Item data={data} key={data.id} />)}
</Items>
)}
</Content>
</React.Fragment>
);
}
}
export default hot(module)(Bookmarks);
| Fix empty container in bookmarks | Fix empty container in bookmarks
| TypeScript | apache-2.0 | Nersent/Wexond,Nersent/Wexond | typescript | ## Code Before:
import { observer } from 'mobx-react';
import { hot } from 'react-hot-loader';
import React from 'react';
import AppStore from '../../../../app/store';
import Store from '../../store';
import db from '../../../../shared/models/app-database';
import Item from '../Item';
import TreeBar from '../TreeBar';
import { Content, Items } from './styles';
@observer
class Bookmarks extends React.Component {
public componentDidMount() {
this.loadBookmarks();
}
public loadBookmarks = async () => {
const bookmarks = await db.bookmarks.toArray();
db.favicons.each(favicon => {
if (AppStore.favicons[favicon.url] == null && favicon.favicon.byteLength !== 0) {
AppStore.favicons[favicon.url] = window.URL.createObjectURL(new Blob([favicon.favicon]));
}
});
Store.bookmarks = bookmarks;
Store.goTo(-1);
};
public render() {
return (
<React.Fragment>
<TreeBar />
<Content>
{Store.bookmarks.length > 0 && (
<Items>
{Store.bookmarks.map(data => {
if (data.parent === Store.currentTree) {
return <Item data={data} key={data.id} />;
}
return null;
})}
</Items>
)}
</Content>
</React.Fragment>
);
}
}
export default hot(module)(Bookmarks);
## Instruction:
Fix empty container in bookmarks
## Code After:
import { observer } from 'mobx-react';
import { hot } from 'react-hot-loader';
import React from 'react';
import AppStore from '../../../../app/store';
import Store from '../../store';
import db from '../../../../shared/models/app-database';
import Item from '../Item';
import TreeBar from '../TreeBar';
import { Content, Items } from './styles';
@observer
class Bookmarks extends React.Component {
public componentDidMount() {
this.loadBookmarks();
}
public loadBookmarks = async () => {
const bookmarks = await db.bookmarks.toArray();
db.favicons.each(favicon => {
if (AppStore.favicons[favicon.url] == null && favicon.favicon.byteLength !== 0) {
AppStore.favicons[favicon.url] = window.URL.createObjectURL(new Blob([favicon.favicon]));
}
});
Store.bookmarks = bookmarks;
Store.goTo(-1);
};
public render() {
const items = Store.bookmarks.filter(r => r.parent === Store.currentTree);
return (
<React.Fragment>
<TreeBar />
<Content>
{items.length > 0 && (
<Items>
{items.map(data => <Item data={data} key={data.id} />)}
</Items>
)}
</Content>
</React.Fragment>
);
}
}
export default hot(module)(Bookmarks);
| import { observer } from 'mobx-react';
import { hot } from 'react-hot-loader';
import React from 'react';
import AppStore from '../../../../app/store';
import Store from '../../store';
import db from '../../../../shared/models/app-database';
import Item from '../Item';
import TreeBar from '../TreeBar';
import { Content, Items } from './styles';
@observer
class Bookmarks extends React.Component {
public componentDidMount() {
this.loadBookmarks();
}
public loadBookmarks = async () => {
const bookmarks = await db.bookmarks.toArray();
db.favicons.each(favicon => {
if (AppStore.favicons[favicon.url] == null && favicon.favicon.byteLength !== 0) {
AppStore.favicons[favicon.url] = window.URL.createObjectURL(new Blob([favicon.favicon]));
}
});
Store.bookmarks = bookmarks;
Store.goTo(-1);
};
public render() {
+ const items = Store.bookmarks.filter(r => r.parent === Store.currentTree);
+
return (
<React.Fragment>
<TreeBar />
<Content>
- {Store.bookmarks.length > 0 && (
? ^ -- ----- ---
+ {items.length > 0 && (
? ^
<Items>
- {Store.bookmarks.map(data => {
- if (data.parent === Store.currentTree) {
- return <Item data={data} key={data.id} />;
? ^^^^^^^^^ ^
+ {items.map(data => <Item data={data} key={data.id} />)}
? +++++++++++++++ ^^ ^^
- }
- return null;
- })}
</Items>
)}
</Content>
</React.Fragment>
);
}
}
export default hot(module)(Bookmarks); | 11 | 0.215686 | 4 | 7 |
a336e38f794557c43d75bf2342a6bce75b148a1a | packages/de/dependent-sum-aeson-orphans.yaml | packages/de/dependent-sum-aeson-orphans.yaml | homepage: ''
changelog-type: ''
hash: b04231a3a7a3d49b499d3f97073547cb0ec068be9669eca1cf5e32c383142bc5
test-bench-deps: {}
maintainer: maintainer@obsidian.systems
synopsis: JSON instances for DSum, DMap, and Some
changelog: ''
basic-deps:
dependent-sum: '>=0.7 && <0.8'
constraints-extras: '>=0.3.0 && <0.4'
base: '>=4.9 && <4.14'
dependent-map: '>=0.3 && <0.5'
constraints: '>=0.10.1 && <0.13'
some: '>=1 && <1.1'
aeson: '>=1.2 && <1.5'
all-versions:
- 0.1.0.0
- 0.2.0.0
- 0.2.1.0
- 0.3.0.0
author: Obsidian Systems
latest: 0.3.0.0
description-type: haddock
description: JSON instances for DSum, DMap, and Some.
license-name: BSD-3-Clause
| homepage: ''
changelog-type: ''
hash: 5b21cf661fd2a0867fc2696a608aaee2c63add5bda9db2a0a018f008831232cc
test-bench-deps: {}
maintainer: maintainer@obsidian.systems
synopsis: JSON instances for DSum, DMap, and Some
changelog: ''
basic-deps:
dependent-sum: '>=0.7 && <0.8'
constraints-extras: '>=0.3.0 && <0.4'
base: '>=4.9 && <4.15'
dependent-map: '>=0.3 && <0.5'
constraints: '>=0.10.1 && <0.14'
some: '>=1 && <1.1'
aeson: '>=1.2 && <1.6'
all-versions:
- 0.1.0.0
- 0.2.0.0
- 0.2.1.0
- 0.3.0.0
author: Obsidian Systems
latest: 0.3.0.0
description-type: haddock
description: JSON instances for DSum, DMap, and Some.
license-name: BSD-3-Clause
| Update from Hackage at 2021-04-15T21:13:06Z | Update from Hackage at 2021-04-15T21:13:06Z
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: ''
changelog-type: ''
hash: b04231a3a7a3d49b499d3f97073547cb0ec068be9669eca1cf5e32c383142bc5
test-bench-deps: {}
maintainer: maintainer@obsidian.systems
synopsis: JSON instances for DSum, DMap, and Some
changelog: ''
basic-deps:
dependent-sum: '>=0.7 && <0.8'
constraints-extras: '>=0.3.0 && <0.4'
base: '>=4.9 && <4.14'
dependent-map: '>=0.3 && <0.5'
constraints: '>=0.10.1 && <0.13'
some: '>=1 && <1.1'
aeson: '>=1.2 && <1.5'
all-versions:
- 0.1.0.0
- 0.2.0.0
- 0.2.1.0
- 0.3.0.0
author: Obsidian Systems
latest: 0.3.0.0
description-type: haddock
description: JSON instances for DSum, DMap, and Some.
license-name: BSD-3-Clause
## Instruction:
Update from Hackage at 2021-04-15T21:13:06Z
## Code After:
homepage: ''
changelog-type: ''
hash: 5b21cf661fd2a0867fc2696a608aaee2c63add5bda9db2a0a018f008831232cc
test-bench-deps: {}
maintainer: maintainer@obsidian.systems
synopsis: JSON instances for DSum, DMap, and Some
changelog: ''
basic-deps:
dependent-sum: '>=0.7 && <0.8'
constraints-extras: '>=0.3.0 && <0.4'
base: '>=4.9 && <4.15'
dependent-map: '>=0.3 && <0.5'
constraints: '>=0.10.1 && <0.14'
some: '>=1 && <1.1'
aeson: '>=1.2 && <1.6'
all-versions:
- 0.1.0.0
- 0.2.0.0
- 0.2.1.0
- 0.3.0.0
author: Obsidian Systems
latest: 0.3.0.0
description-type: haddock
description: JSON instances for DSum, DMap, and Some.
license-name: BSD-3-Clause
| homepage: ''
changelog-type: ''
- hash: b04231a3a7a3d49b499d3f97073547cb0ec068be9669eca1cf5e32c383142bc5
+ hash: 5b21cf661fd2a0867fc2696a608aaee2c63add5bda9db2a0a018f008831232cc
test-bench-deps: {}
maintainer: maintainer@obsidian.systems
synopsis: JSON instances for DSum, DMap, and Some
changelog: ''
basic-deps:
dependent-sum: '>=0.7 && <0.8'
constraints-extras: '>=0.3.0 && <0.4'
- base: '>=4.9 && <4.14'
? ^
+ base: '>=4.9 && <4.15'
? ^
dependent-map: '>=0.3 && <0.5'
- constraints: '>=0.10.1 && <0.13'
? ^
+ constraints: '>=0.10.1 && <0.14'
? ^
some: '>=1 && <1.1'
- aeson: '>=1.2 && <1.5'
? ^
+ aeson: '>=1.2 && <1.6'
? ^
all-versions:
- 0.1.0.0
- 0.2.0.0
- 0.2.1.0
- 0.3.0.0
author: Obsidian Systems
latest: 0.3.0.0
description-type: haddock
description: JSON instances for DSum, DMap, and Some.
license-name: BSD-3-Clause | 8 | 0.32 | 4 | 4 |
e53715c6ee7896d459a46c810480b12dc7a6b5ad | tg/dottednames/jinja_lookup.py | tg/dottednames/jinja_lookup.py | """Genshi template loader that supports dotted names."""
from os.path import exists, getmtime
from jinja2.exceptions import TemplateNotFound
from jinja2.loaders import FileSystemLoader
from tg import config
class JinjaTemplateLoader(FileSystemLoader):
"""Jinja template loader supporting dotted filenames. Based on Genshi Loader
"""
template_extension = '.jinja'
def get_source(self, environment, template):
# Check if dottedname
if not template.endswith(self.template_extension):
# Get the actual filename from dotted finder
finder = config['pylons.app_globals'].dotted_filename_finder
template = finder.get_dotted_filename(
template_name=template,
template_extension=self.template_extension)
else:
return FileSystemLoader.get_source(self, environment, template)
# Check if the template exists
if not exists(template):
raise TemplateNotFound(template)
# Get modification time
mtime = getmtime(template)
# Read the source
fd = file(template)
try:
source = fd.read().decode('utf-8')
finally:
fd.close()
return source, template, lambda: mtime == getmtime(template)
| """Genshi template loader that supports dotted names."""
from os.path import exists, getmtime
from jinja2.exceptions import TemplateNotFound
from jinja2.loaders import FileSystemLoader
from tg import config
class JinjaTemplateLoader(FileSystemLoader):
"""Jinja template loader supporting dotted filenames. Based on Genshi Loader
"""
template_extension = '.jinja'
def get_source(self, environment, template):
# Check if dottedname
if not template.endswith(self.template_extension):
# Get the actual filename from dotted finder
finder = config['tg.app_globals'].dotted_filename_finder
template = finder.get_dotted_filename(
template_name=template,
template_extension=self.template_extension)
else:
return FileSystemLoader.get_source(self, environment, template)
# Check if the template exists
if not exists(template):
raise TemplateNotFound(template)
# Get modification time
mtime = getmtime(template)
# Read the source
fd = open(template, 'rb')
try:
source = fd.read().decode('utf-8')
finally:
fd.close()
return source, template, lambda: mtime == getmtime(template)
| Fix jinja loader on Py3 | Fix jinja loader on Py3
| Python | mit | lucius-feng/tg2,lucius-feng/tg2 | python | ## Code Before:
"""Genshi template loader that supports dotted names."""
from os.path import exists, getmtime
from jinja2.exceptions import TemplateNotFound
from jinja2.loaders import FileSystemLoader
from tg import config
class JinjaTemplateLoader(FileSystemLoader):
"""Jinja template loader supporting dotted filenames. Based on Genshi Loader
"""
template_extension = '.jinja'
def get_source(self, environment, template):
# Check if dottedname
if not template.endswith(self.template_extension):
# Get the actual filename from dotted finder
finder = config['pylons.app_globals'].dotted_filename_finder
template = finder.get_dotted_filename(
template_name=template,
template_extension=self.template_extension)
else:
return FileSystemLoader.get_source(self, environment, template)
# Check if the template exists
if not exists(template):
raise TemplateNotFound(template)
# Get modification time
mtime = getmtime(template)
# Read the source
fd = file(template)
try:
source = fd.read().decode('utf-8')
finally:
fd.close()
return source, template, lambda: mtime == getmtime(template)
## Instruction:
Fix jinja loader on Py3
## Code After:
"""Genshi template loader that supports dotted names."""
from os.path import exists, getmtime
from jinja2.exceptions import TemplateNotFound
from jinja2.loaders import FileSystemLoader
from tg import config
class JinjaTemplateLoader(FileSystemLoader):
"""Jinja template loader supporting dotted filenames. Based on Genshi Loader
"""
template_extension = '.jinja'
def get_source(self, environment, template):
# Check if dottedname
if not template.endswith(self.template_extension):
# Get the actual filename from dotted finder
finder = config['tg.app_globals'].dotted_filename_finder
template = finder.get_dotted_filename(
template_name=template,
template_extension=self.template_extension)
else:
return FileSystemLoader.get_source(self, environment, template)
# Check if the template exists
if not exists(template):
raise TemplateNotFound(template)
# Get modification time
mtime = getmtime(template)
# Read the source
fd = open(template, 'rb')
try:
source = fd.read().decode('utf-8')
finally:
fd.close()
return source, template, lambda: mtime == getmtime(template)
| """Genshi template loader that supports dotted names."""
from os.path import exists, getmtime
from jinja2.exceptions import TemplateNotFound
from jinja2.loaders import FileSystemLoader
from tg import config
class JinjaTemplateLoader(FileSystemLoader):
"""Jinja template loader supporting dotted filenames. Based on Genshi Loader
"""
template_extension = '.jinja'
def get_source(self, environment, template):
# Check if dottedname
if not template.endswith(self.template_extension):
# Get the actual filename from dotted finder
- finder = config['pylons.app_globals'].dotted_filename_finder
? ^^^^^^
+ finder = config['tg.app_globals'].dotted_filename_finder
? ^^
template = finder.get_dotted_filename(
template_name=template,
template_extension=self.template_extension)
else:
return FileSystemLoader.get_source(self, environment, template)
# Check if the template exists
if not exists(template):
raise TemplateNotFound(template)
# Get modification time
mtime = getmtime(template)
# Read the source
- fd = file(template)
? ^^^
+ fd = open(template, 'rb')
? ^^ + ++++++
try:
source = fd.read().decode('utf-8')
finally:
fd.close()
return source, template, lambda: mtime == getmtime(template)
| 4 | 0.088889 | 2 | 2 |
6df98cfc3bc3157a0ce94fced6ab2dd4c753c88b | app/views/form.xml | app/views/form.xml | <Alloy>
<Window title="Add Product" onOpen="windowOpened">
<RightNavButton platform="!android">
<Button onClick="saveBtnClicked">Save</Button>
</RightNavButton>
<ScrollView>
<TextField hintText="Title" id="title"/>
<TextField hintText="Product type" id="typeCode"/>
<TextField hintText="Bank" id="bankCode"/>
<TextField hintText="Period number" id="periodNumber"/>
<TextField hintText="Period type" id="periodType"/>
<TextField hintText="End Date" id="EndDate"/>
<TextField hintText="Last Payment Date" id="lastPaymentDate"/>
</ScrollView>
</Window>
</Alloy>
| <Alloy>
<Window title="Add Product" onOpen="windowOpened">
<RightNavButton platform="!android">
<Button onClick="saveBtnClicked">Save</Button>
</RightNavButton>
<Menu platform="android">
<MenuItem onClick="saveBtnClicked" showAsAction="Ti.Android.SHOW_AS_ACTION_ALWAYS" title="Save"/>
</Menu>
<ScrollView>
<TextField hintText="Title" id="title"/>
<TextField hintText="Product type" id="typeCode"/>
<TextField hintText="Bank" id="bankCode"/>
<TextField hintText="Period number" id="periodNumber"/>
<TextField hintText="Period type" id="periodType"/>
<TextField hintText="End Date" id="EndDate"/>
<TextField hintText="Last Payment Date" id="lastPaymentDate"/>
</ScrollView>
</Window>
</Alloy>
| Add menu item for Android support | Add menu item for Android support
| XML | mit | App3ad/bo7,App3ad/bo7 | xml | ## Code Before:
<Alloy>
<Window title="Add Product" onOpen="windowOpened">
<RightNavButton platform="!android">
<Button onClick="saveBtnClicked">Save</Button>
</RightNavButton>
<ScrollView>
<TextField hintText="Title" id="title"/>
<TextField hintText="Product type" id="typeCode"/>
<TextField hintText="Bank" id="bankCode"/>
<TextField hintText="Period number" id="periodNumber"/>
<TextField hintText="Period type" id="periodType"/>
<TextField hintText="End Date" id="EndDate"/>
<TextField hintText="Last Payment Date" id="lastPaymentDate"/>
</ScrollView>
</Window>
</Alloy>
## Instruction:
Add menu item for Android support
## Code After:
<Alloy>
<Window title="Add Product" onOpen="windowOpened">
<RightNavButton platform="!android">
<Button onClick="saveBtnClicked">Save</Button>
</RightNavButton>
<Menu platform="android">
<MenuItem onClick="saveBtnClicked" showAsAction="Ti.Android.SHOW_AS_ACTION_ALWAYS" title="Save"/>
</Menu>
<ScrollView>
<TextField hintText="Title" id="title"/>
<TextField hintText="Product type" id="typeCode"/>
<TextField hintText="Bank" id="bankCode"/>
<TextField hintText="Period number" id="periodNumber"/>
<TextField hintText="Period type" id="periodType"/>
<TextField hintText="End Date" id="EndDate"/>
<TextField hintText="Last Payment Date" id="lastPaymentDate"/>
</ScrollView>
</Window>
</Alloy>
| <Alloy>
<Window title="Add Product" onOpen="windowOpened">
<RightNavButton platform="!android">
<Button onClick="saveBtnClicked">Save</Button>
</RightNavButton>
+ <Menu platform="android">
+ <MenuItem onClick="saveBtnClicked" showAsAction="Ti.Android.SHOW_AS_ACTION_ALWAYS" title="Save"/>
+ </Menu>
<ScrollView>
<TextField hintText="Title" id="title"/>
<TextField hintText="Product type" id="typeCode"/>
<TextField hintText="Bank" id="bankCode"/>
<TextField hintText="Period number" id="periodNumber"/>
<TextField hintText="Period type" id="periodType"/>
<TextField hintText="End Date" id="EndDate"/>
<TextField hintText="Last Payment Date" id="lastPaymentDate"/>
</ScrollView>
</Window>
</Alloy> | 3 | 0.1875 | 3 | 0 |
f769d36029d672a1407db4b537f4efa2afa256aa | README.rst | README.rst | Package alignak_backend_client
==============================
.. image:: https://travis-ci.org/Alignak-monitoring-contrib/alignak-backend-client.svg?branch=master
:target: https://travis-ci.org/Alignak-monitoring-contrib/alignak-backend-client
.. image:: https://coveralls.io/repos/Alignak-monitoring-contrib/alignak-backend-client/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/Alignak-monitoring-contrib/alignak-backend-client?branch=master
Alignak backend client
This package contains a Python class to use for interactions with Alignak backend REST API.
| Alignak Backend client
======================
*Python client for Alignak Backend*
Build status (stable release)
----------------------------------------
.. image:: https://travis-ci.org/Alignak-monitoring-contrib/alignak-backend-client.svg?branch=master
:target: https://travis-ci.org/Alignak-monitoring-contrib/alignak-backend-client
.. image:: https://coveralls.io/repos/Alignak-monitoring-contrib/alignak-backend-client/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/Alignak-monitoring-contrib/alignak-backend-client?branch=master
Build status (development release)
----------------------------------------
.. image:: https://travis-ci.org/Alignak-monitoring-contrib/alignak-backend-client.svg?branch=develop
:target: https://travis-ci.org/Alignak-monitoring-contrib/alignak-backend-client
.. image:: https://coveralls.io/repos/Alignak-monitoring-contrib/alignak-backend-client/badge.svg?branch=develop&service=github
:target: https://coveralls.io/github/Alignak-monitoring-contrib/alignak-backend-client?branch=develop
Documentation
----------------------------------------
The Backend class is commented.
Bugs, issues and contributing
----------------------------------------
Please report any issue using the project GitHub repository: <https://github.com/Alignak-monitoring-contrib/alignak-backend-client/issues>`_.
License
----------------------------------------
Alignak Backend client is available under the `GPL version 3 <http://opensource.org/licenses/GPL-3.0>`_.
Package alignak_backend_client
==============================
.. image:: https://travis-ci.org/Alignak-monitoring-contrib/alignak-backend-client.svg?branch=master
:target: https://travis-ci.org/Alignak-monitoring-contrib/alignak-backend-client
.. image:: https://coveralls.io/repos/Alignak-monitoring-contrib/alignak-backend-client/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/Alignak-monitoring-contrib/alignak-backend-client?branch=master
Alignak backend client
This package contains a Python class to use for interactions with Alignak backend REST API.
| Update readme for Travis badges | Update readme for Travis badges
| reStructuredText | agpl-3.0 | Alignak-monitoring-contrib/alignak-backend-client,Alignak-monitoring-contrib/alignak-backend-client,Alignak-monitoring-contrib/alignakbackend-api-client,Alignak-monitoring-contrib/alignakbackend-api-client | restructuredtext | ## Code Before:
Package alignak_backend_client
==============================
.. image:: https://travis-ci.org/Alignak-monitoring-contrib/alignak-backend-client.svg?branch=master
:target: https://travis-ci.org/Alignak-monitoring-contrib/alignak-backend-client
.. image:: https://coveralls.io/repos/Alignak-monitoring-contrib/alignak-backend-client/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/Alignak-monitoring-contrib/alignak-backend-client?branch=master
Alignak backend client
This package contains a Python class to use for interactions with Alignak backend REST API.
## Instruction:
Update readme for Travis badges
## Code After:
Alignak Backend client
======================
*Python client for Alignak Backend*
Build status (stable release)
----------------------------------------
.. image:: https://travis-ci.org/Alignak-monitoring-contrib/alignak-backend-client.svg?branch=master
:target: https://travis-ci.org/Alignak-monitoring-contrib/alignak-backend-client
.. image:: https://coveralls.io/repos/Alignak-monitoring-contrib/alignak-backend-client/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/Alignak-monitoring-contrib/alignak-backend-client?branch=master
Build status (development release)
----------------------------------------
.. image:: https://travis-ci.org/Alignak-monitoring-contrib/alignak-backend-client.svg?branch=develop
:target: https://travis-ci.org/Alignak-monitoring-contrib/alignak-backend-client
.. image:: https://coveralls.io/repos/Alignak-monitoring-contrib/alignak-backend-client/badge.svg?branch=develop&service=github
:target: https://coveralls.io/github/Alignak-monitoring-contrib/alignak-backend-client?branch=develop
Documentation
----------------------------------------
The Backend class is commented.
Bugs, issues and contributing
----------------------------------------
Please report any issue using the project GitHub repository: <https://github.com/Alignak-monitoring-contrib/alignak-backend-client/issues>`_.
License
----------------------------------------
Alignak Backend client is available under the `GPL version 3 <http://opensource.org/licenses/GPL-3.0>`_.
Package alignak_backend_client
==============================
.. image:: https://travis-ci.org/Alignak-monitoring-contrib/alignak-backend-client.svg?branch=master
:target: https://travis-ci.org/Alignak-monitoring-contrib/alignak-backend-client
.. image:: https://coveralls.io/repos/Alignak-monitoring-contrib/alignak-backend-client/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/Alignak-monitoring-contrib/alignak-backend-client?branch=master
Alignak backend client
This package contains a Python class to use for interactions with Alignak backend REST API.
| + Alignak Backend client
+ ======================
+
+ *Python client for Alignak Backend*
+
+ Build status (stable release)
+ ----------------------------------------
+
+ .. image:: https://travis-ci.org/Alignak-monitoring-contrib/alignak-backend-client.svg?branch=master
+ :target: https://travis-ci.org/Alignak-monitoring-contrib/alignak-backend-client
+
+ .. image:: https://coveralls.io/repos/Alignak-monitoring-contrib/alignak-backend-client/badge.svg?branch=master&service=github
+ :target: https://coveralls.io/github/Alignak-monitoring-contrib/alignak-backend-client?branch=master
+
+
+ Build status (development release)
+ ----------------------------------------
+
+ .. image:: https://travis-ci.org/Alignak-monitoring-contrib/alignak-backend-client.svg?branch=develop
+ :target: https://travis-ci.org/Alignak-monitoring-contrib/alignak-backend-client
+
+ .. image:: https://coveralls.io/repos/Alignak-monitoring-contrib/alignak-backend-client/badge.svg?branch=develop&service=github
+ :target: https://coveralls.io/github/Alignak-monitoring-contrib/alignak-backend-client?branch=develop
+
+
+
+ Documentation
+ ----------------------------------------
+
+ The Backend class is commented.
+
+
+ Bugs, issues and contributing
+ ----------------------------------------
+
+ Please report any issue using the project GitHub repository: <https://github.com/Alignak-monitoring-contrib/alignak-backend-client/issues>`_.
+
+
+ License
+ ----------------------------------------
+
+ Alignak Backend client is available under the `GPL version 3 <http://opensource.org/licenses/GPL-3.0>`_.
+
+
+
+
Package alignak_backend_client
==============================
.. image:: https://travis-ci.org/Alignak-monitoring-contrib/alignak-backend-client.svg?branch=master
:target: https://travis-ci.org/Alignak-monitoring-contrib/alignak-backend-client
-
+
.. image:: https://coveralls.io/repos/Alignak-monitoring-contrib/alignak-backend-client/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/Alignak-monitoring-contrib/alignak-backend-client?branch=master
Alignak backend client
This package contains a Python class to use for interactions with Alignak backend REST API. | 48 | 3.692308 | 47 | 1 |
39956d95962f07cb6cb70765942392633cfa713f | examples/sensors/ultrasounds/HCSR04/HCSR04.ino | examples/sensors/ultrasounds/HCSR04/HCSR04.ino |
const int TRIGGER_PIN = 6; //D6
const int ECHO_PIN = 7; //D7
SR04 front(TRIGGER_PIN, ECHO_PIN, 10);
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println(front.getDistance());
delay(100);
}
|
const int TRIGGER_PIN = 6; //D6
const int ECHO_PIN = 7; //D7
const unsigned int MAX_DISTANCE = 100;
SR04 front(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println(front.getDistance());
delay(100);
}
| Adjust max sensor distance to something more suitable | Adjust max sensor distance to something more suitable
| Arduino | mit | platisd/smartcar_shield,platisd/smartcar_shield | arduino | ## Code Before:
const int TRIGGER_PIN = 6; //D6
const int ECHO_PIN = 7; //D7
SR04 front(TRIGGER_PIN, ECHO_PIN, 10);
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println(front.getDistance());
delay(100);
}
## Instruction:
Adjust max sensor distance to something more suitable
## Code After:
const int TRIGGER_PIN = 6; //D6
const int ECHO_PIN = 7; //D7
const unsigned int MAX_DISTANCE = 100;
SR04 front(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println(front.getDistance());
delay(100);
}
|
const int TRIGGER_PIN = 6; //D6
const int ECHO_PIN = 7; //D7
+ const unsigned int MAX_DISTANCE = 100;
- SR04 front(TRIGGER_PIN, ECHO_PIN, 10);
? ^^
+ SR04 front(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);
? ^^^^^^^^^^^^
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println(front.getDistance());
delay(100);
}
| 3 | 0.2 | 2 | 1 |
b2192bd9923f6dd4d7ac64e47e395df27f11d045 | package.json | package.json | {
"name": "snyk-report",
"version": "0.0.2",
"description": "Assists in generating human readable snyk reports for CI integration",
"main": "lib/report.js",
"scripts": {
"start": "node script/example.js",
"lint": "node_modules/.bin/make-up lib script",
"ci": "npm run lint"
},
"author": "James Hooker <james.hooker@holidayextras.com>",
"repository": {
"type": "git",
"url": "git://github.com:holidayextras/snyk-report.git"
},
"license": "MIT",
"dependencies": {
"colours": "^0.6.0-2",
"moment": "2.10.6",
"snyk": "1.1.1"
},
"devDependencies": {
"assert": "1.3.0",
"chai": "^3.4.1",
"dirty-chai": "^1.2.2",
"make-up": "5.4.0",
"mocha": "2.3.3",
"sinon": "1.17.2",
"sinon-chai": "^2.8.0"
}
}
| {
"name": "snyk-report",
"version": "0.0.2",
"description": "Assists in generating human readable snyk reports for CI integration",
"main": "lib/report.js",
"scripts": {
"start": "node script/example.js",
"lint": "node_modules/.bin/make-up lib script",
"ci": "npm run lint && npm test",
"test": "node_modules/.bin/mocha test/unit/testReport.js"
},
"author": "James Hooker <james.hooker@holidayextras.com>",
"repository": {
"type": "git",
"url": "git://github.com:holidayextras/snyk-report.git"
},
"license": "MIT",
"dependencies": {
"colours": "^0.6.0-2",
"moment": "2.10.6",
"snyk": "1.1.1"
},
"devDependencies": {
"assert": "1.3.0",
"chai": "^3.4.1",
"dirty-chai": "^1.2.2",
"make-up": "5.4.0",
"mocha": "2.3.3",
"sinon": "1.17.2",
"sinon-chai": "^2.8.0"
}
}
| Add tests to ci build | Add tests to ci build
| JSON | mit | holidayextras/snyk-report | json | ## Code Before:
{
"name": "snyk-report",
"version": "0.0.2",
"description": "Assists in generating human readable snyk reports for CI integration",
"main": "lib/report.js",
"scripts": {
"start": "node script/example.js",
"lint": "node_modules/.bin/make-up lib script",
"ci": "npm run lint"
},
"author": "James Hooker <james.hooker@holidayextras.com>",
"repository": {
"type": "git",
"url": "git://github.com:holidayextras/snyk-report.git"
},
"license": "MIT",
"dependencies": {
"colours": "^0.6.0-2",
"moment": "2.10.6",
"snyk": "1.1.1"
},
"devDependencies": {
"assert": "1.3.0",
"chai": "^3.4.1",
"dirty-chai": "^1.2.2",
"make-up": "5.4.0",
"mocha": "2.3.3",
"sinon": "1.17.2",
"sinon-chai": "^2.8.0"
}
}
## Instruction:
Add tests to ci build
## Code After:
{
"name": "snyk-report",
"version": "0.0.2",
"description": "Assists in generating human readable snyk reports for CI integration",
"main": "lib/report.js",
"scripts": {
"start": "node script/example.js",
"lint": "node_modules/.bin/make-up lib script",
"ci": "npm run lint && npm test",
"test": "node_modules/.bin/mocha test/unit/testReport.js"
},
"author": "James Hooker <james.hooker@holidayextras.com>",
"repository": {
"type": "git",
"url": "git://github.com:holidayextras/snyk-report.git"
},
"license": "MIT",
"dependencies": {
"colours": "^0.6.0-2",
"moment": "2.10.6",
"snyk": "1.1.1"
},
"devDependencies": {
"assert": "1.3.0",
"chai": "^3.4.1",
"dirty-chai": "^1.2.2",
"make-up": "5.4.0",
"mocha": "2.3.3",
"sinon": "1.17.2",
"sinon-chai": "^2.8.0"
}
}
| {
"name": "snyk-report",
"version": "0.0.2",
"description": "Assists in generating human readable snyk reports for CI integration",
"main": "lib/report.js",
"scripts": {
"start": "node script/example.js",
"lint": "node_modules/.bin/make-up lib script",
- "ci": "npm run lint"
+ "ci": "npm run lint && npm test",
? ++++++++++++ +
+ "test": "node_modules/.bin/mocha test/unit/testReport.js"
},
"author": "James Hooker <james.hooker@holidayextras.com>",
"repository": {
"type": "git",
"url": "git://github.com:holidayextras/snyk-report.git"
},
"license": "MIT",
"dependencies": {
"colours": "^0.6.0-2",
"moment": "2.10.6",
"snyk": "1.1.1"
},
"devDependencies": {
"assert": "1.3.0",
"chai": "^3.4.1",
"dirty-chai": "^1.2.2",
"make-up": "5.4.0",
"mocha": "2.3.3",
"sinon": "1.17.2",
"sinon-chai": "^2.8.0"
}
} | 3 | 0.096774 | 2 | 1 |
0f3369a02a6386d8bfb895de09faa9b1c168715d | src/app/components/msp/common/consent-modal/i18n/data/en/index.js | src/app/components/msp/common/consent-modal/i18n/data/en/index.js | module.exports = {
title: 'Information collection notice',
body: 'The information in this application is collected by the Ministry of Health under section 26(a) of the Freedom of Information and Protection of Privacy Act and will be used to determine eligibility for provincial health care benefits in BC and administer Premium Assistance. Should you have any questions about the collection of this personal information please <a href="http://www2.gov.bc.ca/gov/content/health/health-drug-coverage/msp/bc-residents-contact-us" target="_blank">contact Health Insurance of BC</a> <i class="fa fa-external-link" aria-hidden="true"></i>.',
agreeLabel: 'I have read and understand the information above and would like to continue to apply for MSP',
continueButton: 'Continue'
}
| module.exports = {
title: 'Information collection notice',
body: '<p>The data you enter on this form is saved locally to the computer or device you are using. The data will be deleted when you close the web browser you are using or after your submit your application.</p><p>The information in this application is collected by the Ministry of Health under section 26(a) of the Freedom of Information and Protection of Privacy Act and will be used to determine eligibility for provincial health care benefits in BC and administer Premium Assistance. Should you have any questions about the collection of this personal information please <a href="http://www2.gov.bc.ca/gov/content/health/health-drug-coverage/msp/bc-residents-contact-us" target="_blank">contact Health Insurance of BC</a> <i class="fa fa-external-link" aria-hidden="true"></i>.</p>',
agreeLabel: 'I have read and understand the information above and would like to continue to apply for MSP',
continueButton: 'Continue'
}
| Add info re: data saving | Add info re: data saving | JavaScript | apache-2.0 | bcgov/MyGovBC-MSP,bcgov/MyGovBC-MSP,bcgov/MyGovBC-MSP,bcgov/MyGovBC-MSP | javascript | ## Code Before:
module.exports = {
title: 'Information collection notice',
body: 'The information in this application is collected by the Ministry of Health under section 26(a) of the Freedom of Information and Protection of Privacy Act and will be used to determine eligibility for provincial health care benefits in BC and administer Premium Assistance. Should you have any questions about the collection of this personal information please <a href="http://www2.gov.bc.ca/gov/content/health/health-drug-coverage/msp/bc-residents-contact-us" target="_blank">contact Health Insurance of BC</a> <i class="fa fa-external-link" aria-hidden="true"></i>.',
agreeLabel: 'I have read and understand the information above and would like to continue to apply for MSP',
continueButton: 'Continue'
}
## Instruction:
Add info re: data saving
## Code After:
module.exports = {
title: 'Information collection notice',
body: '<p>The data you enter on this form is saved locally to the computer or device you are using. The data will be deleted when you close the web browser you are using or after your submit your application.</p><p>The information in this application is collected by the Ministry of Health under section 26(a) of the Freedom of Information and Protection of Privacy Act and will be used to determine eligibility for provincial health care benefits in BC and administer Premium Assistance. Should you have any questions about the collection of this personal information please <a href="http://www2.gov.bc.ca/gov/content/health/health-drug-coverage/msp/bc-residents-contact-us" target="_blank">contact Health Insurance of BC</a> <i class="fa fa-external-link" aria-hidden="true"></i>.</p>',
agreeLabel: 'I have read and understand the information above and would like to continue to apply for MSP',
continueButton: 'Continue'
}
| module.exports = {
title: 'Information collection notice',
- body: 'The information in this application is collected by the Ministry of Health under section 26(a) of the Freedom of Information and Protection of Privacy Act and will be used to determine eligibility for provincial health care benefits in BC and administer Premium Assistance. Should you have any questions about the collection of this personal information please <a href="http://www2.gov.bc.ca/gov/content/health/health-drug-coverage/msp/bc-residents-contact-us" target="_blank">contact Health Insurance of BC</a> <i class="fa fa-external-link" aria-hidden="true"></i>.',
+ body: '<p>The data you enter on this form is saved locally to the computer or device you are using. The data will be deleted when you close the web browser you are using or after your submit your application.</p><p>The information in this application is collected by the Ministry of Health under section 26(a) of the Freedom of Information and Protection of Privacy Act and will be used to determine eligibility for provincial health care benefits in BC and administer Premium Assistance. Should you have any questions about the collection of this personal information please <a href="http://www2.gov.bc.ca/gov/content/health/health-drug-coverage/msp/bc-residents-contact-us" target="_blank">contact Health Insurance of BC</a> <i class="fa fa-external-link" aria-hidden="true"></i>.</p>',
? ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++
agreeLabel: 'I have read and understand the information above and would like to continue to apply for MSP',
continueButton: 'Continue'
} | 2 | 0.285714 | 1 | 1 |
f8b0a25c279de515b1487e667b524cf095e8ed89 | build.sbt | build.sbt | organization := "io.reactivex"
name := "rxscala"
lazy val root = project in file(".")
lazy val examples = project in file("examples") dependsOn root
scalacOptions := Seq("-feature", "-unchecked", "-deprecation", "-encoding", "utf8")
scalaVersion := "2.11.2"
crossScalaVersions := Seq("2.10.4", "2.11.2")
libraryDependencies ++= Seq(
"io.reactivex" % "rxjava" % "1.0.0-rc.3",
"org.mockito" % "mockito-core" % "1.9.5" % "test",
"junit" % "junit" % "4.11" % "test",
"org.scalatest" %% "scalatest" % "2.2.2" % "test")
| organization := "io.reactivex"
name := "rxscala"
lazy val root = project in file(".")
lazy val examples = project in file("examples") dependsOn (root % "test->test;compile->compile")
scalacOptions in ThisBuild := Seq("-feature", "-unchecked", "-deprecation", "-encoding", "utf8")
scalaVersion in ThisBuild := "2.11.2"
crossScalaVersions in ThisBuild := Seq("2.10.4", "2.11.2")
libraryDependencies ++= Seq(
"io.reactivex" % "rxjava" % "1.0.0-rc.3",
"org.mockito" % "mockito-core" % "1.9.5" % "test",
"junit" % "junit" % "4.11" % "test",
"org.scalatest" %% "scalatest" % "2.2.2" % "test")
| Fix basic examples project setup. | Fix basic examples project setup.
| Scala | apache-2.0 | zhongdj/RxScala,TracyLu/RxScala,joohnnie/RxScala,samuelgruetter/RxScala,jbripley/RxScala,ReactiveX/RxScala,jbripley/RxScala,hermanbanken/RxScala,samuelgruetter/RxScala,hermanbanken/RxScala,zjrstar/RxScala | scala | ## Code Before:
organization := "io.reactivex"
name := "rxscala"
lazy val root = project in file(".")
lazy val examples = project in file("examples") dependsOn root
scalacOptions := Seq("-feature", "-unchecked", "-deprecation", "-encoding", "utf8")
scalaVersion := "2.11.2"
crossScalaVersions := Seq("2.10.4", "2.11.2")
libraryDependencies ++= Seq(
"io.reactivex" % "rxjava" % "1.0.0-rc.3",
"org.mockito" % "mockito-core" % "1.9.5" % "test",
"junit" % "junit" % "4.11" % "test",
"org.scalatest" %% "scalatest" % "2.2.2" % "test")
## Instruction:
Fix basic examples project setup.
## Code After:
organization := "io.reactivex"
name := "rxscala"
lazy val root = project in file(".")
lazy val examples = project in file("examples") dependsOn (root % "test->test;compile->compile")
scalacOptions in ThisBuild := Seq("-feature", "-unchecked", "-deprecation", "-encoding", "utf8")
scalaVersion in ThisBuild := "2.11.2"
crossScalaVersions in ThisBuild := Seq("2.10.4", "2.11.2")
libraryDependencies ++= Seq(
"io.reactivex" % "rxjava" % "1.0.0-rc.3",
"org.mockito" % "mockito-core" % "1.9.5" % "test",
"junit" % "junit" % "4.11" % "test",
"org.scalatest" %% "scalatest" % "2.2.2" % "test")
| organization := "io.reactivex"
name := "rxscala"
lazy val root = project in file(".")
- lazy val examples = project in file("examples") dependsOn root
+ lazy val examples = project in file("examples") dependsOn (root % "test->test;compile->compile")
? + +++++++++++++++++++++++++++++++++
- scalacOptions := Seq("-feature", "-unchecked", "-deprecation", "-encoding", "utf8")
+ scalacOptions in ThisBuild := Seq("-feature", "-unchecked", "-deprecation", "-encoding", "utf8")
? +++++++++++++
- scalaVersion := "2.11.2"
+ scalaVersion in ThisBuild := "2.11.2"
? +++++++++++++
- crossScalaVersions := Seq("2.10.4", "2.11.2")
+ crossScalaVersions in ThisBuild := Seq("2.10.4", "2.11.2")
? +++++++++++++
libraryDependencies ++= Seq(
"io.reactivex" % "rxjava" % "1.0.0-rc.3",
"org.mockito" % "mockito-core" % "1.9.5" % "test",
"junit" % "junit" % "4.11" % "test",
"org.scalatest" %% "scalatest" % "2.2.2" % "test") | 8 | 0.421053 | 4 | 4 |
856348319ab64aac5890e2f233d650d9c5359f50 | lib/rspec/core/formatters/text_mate_formatter.rb | lib/rspec/core/formatters/text_mate_formatter.rb | require 'rspec/core/formatters/html_formatter'
module RSpec
module Core
module Formatters
# Formats backtraces so they're clickable by TextMate
class TextMateFormatter < HtmlFormatter
def backtrace_line(line)
if line = super(line)
line.sub!(/([^:]*\.rb):(\d*)/) do
"<a href=\"txmt://open?url=file://#{File.expand_path($1)}&line=#{$2}\">#{$1}:#{$2}</a> "
end
end
end
end
end
end
end
| require 'rspec/core/formatters/html_formatter'
module RSpec
module Core
module Formatters
# Formats backtraces so they're clickable by TextMate
class TextMateFormatter < HtmlFormatter
def backtrace_line(line)
if line = super(line)
line.sub!(/([^:]*\.e?rb):(\d*)/) do
"<a href=\"txmt://open?url=file://#{File.expand_path($1)}&line=#{$2}\">#{$1}:#{$2}</a> "
end
line
end
end
end
end
end
end
| Support stack traces with erb files in them and also show all lines from stack trace even when it's not a ruby file. Just don't link files which aren't ruby files. | Support stack traces with erb files in them and also show all lines from stack trace even when it's not a ruby file. Just don't link files which aren't ruby files.
- Closes #155.
| Ruby | mit | SoldierCoder/rspec-core,SoldierCoder/rspec-core,rkh/rspec-core,avantcredit/rspec-core,AlexKVal/rspec-core,mrkn/rspec-core,rspec/rspec-core,urbanautomaton/rspec-core,arronmabrey/rspec-core,a-suenami/rspec-core,avantcredit/rspec-core,r7kamura/rspec-core,leg100/rspec-core,SoldierCoder/rspec-core,eugeneius/rspec-core,arronmabrey/rspec-core,irfanah/rspec-core,pandabrand/rspec-core,xmik/rspec-core,pandabrand/rspec-core,rkh/rspec-core,yaoshipu/rspec-core,yaoshipu/rspec-core,leg100/rspec-core,behnaaz/rspec-core,urbanautomaton/rspec-core,xmik/rspec-core,edwardpark/rspec-core,edwardpark/rspec-core,slawosz/rspec-core,urbanautomaton/rspec-core,dg-ratiodata/rspec-core,leg100/rspec-core,danascheider/rspec-core,eugeneius/rspec-core,h4ck3rm1k3/rspec-core,maclover7/rspec-core,Teino1978-Corp/Teino1978-Corp-rspec-core,iguchi1124/rspec-core,dg-ratiodata/rspec-core,rspec/rspec-core,h4ck3rm1k3/rspec-core,rkh/rspec-core,iguchi1124/rspec-core,irfanah/rspec-core,xmik/rspec-core,a-suenami/rspec-core,azbshiri/rspec-core,azbshiri/rspec-core,a-suenami/rspec-core,Teino1978-Corp/Teino1978-Corp-rspec-core,arronmabrey/rspec-core,dg-ratiodata/rspec-core,yaoshipu/rspec-core,danascheider/rspec-core,azbshiri/rspec-core,edwardpark/rspec-core,maclover7/rspec-core,r7kamura/rspec-core,behnaaz/rspec-core,danascheider/rspec-core,h4ck3rm1k3/rspec-core,mrkn/rspec-core,irfanah/rspec-core,travis-repos/rspec-core,iguchi1124/rspec-core,eugeneius/rspec-core,Teino1978-Corp/Teino1978-Corp-rspec-core,behnaaz/rspec-core,rspec/rspec-core,avantcredit/rspec-core,pandabrand/rspec-core,maclover7/rspec-core | ruby | ## Code Before:
require 'rspec/core/formatters/html_formatter'
module RSpec
module Core
module Formatters
# Formats backtraces so they're clickable by TextMate
class TextMateFormatter < HtmlFormatter
def backtrace_line(line)
if line = super(line)
line.sub!(/([^:]*\.rb):(\d*)/) do
"<a href=\"txmt://open?url=file://#{File.expand_path($1)}&line=#{$2}\">#{$1}:#{$2}</a> "
end
end
end
end
end
end
end
## Instruction:
Support stack traces with erb files in them and also show all lines from stack trace even when it's not a ruby file. Just don't link files which aren't ruby files.
- Closes #155.
## Code After:
require 'rspec/core/formatters/html_formatter'
module RSpec
module Core
module Formatters
# Formats backtraces so they're clickable by TextMate
class TextMateFormatter < HtmlFormatter
def backtrace_line(line)
if line = super(line)
line.sub!(/([^:]*\.e?rb):(\d*)/) do
"<a href=\"txmt://open?url=file://#{File.expand_path($1)}&line=#{$2}\">#{$1}:#{$2}</a> "
end
line
end
end
end
end
end
end
| require 'rspec/core/formatters/html_formatter'
module RSpec
module Core
module Formatters
# Formats backtraces so they're clickable by TextMate
class TextMateFormatter < HtmlFormatter
def backtrace_line(line)
if line = super(line)
- line.sub!(/([^:]*\.rb):(\d*)/) do
+ line.sub!(/([^:]*\.e?rb):(\d*)/) do
? ++
"<a href=\"txmt://open?url=file://#{File.expand_path($1)}&line=#{$2}\">#{$1}:#{$2}</a> "
end
+
+ line
end
end
end
end
end
end | 4 | 0.222222 | 3 | 1 |
352733c40828555aaaee1ca23d43c8ac6436a3d4 | src/System/OS.hs | src/System/OS.hs | {-# Language BlockArguments #-}
{-# Language DerivingStrategies #-}
{-# Language GeneralisedNewtypeDeriving #-}
-----------------------------------------------------------------------------
-- |
-- Module : System.OS
-- Copyright : (c) ChaosGroup, 2020
-- License : MIT
--
-- Maintainer : daniel.taskoff@gmail.com
-- Stability : experimental
--
-- Get the name of the current operating system.
-----------------------------------------------------------------------------
module System.OS
(
-- * 'OS'
OS, os
) where
import Foreign.C.String (CWString, peekCWString)
import Foreign.Marshal.Alloc (free)
import System.IO.Unsafe (unsafePerformIO)
-- | The name of the current operating system.
newtype OS = OS String
deriving newtype Show
-- | Get the name of the current operating system.
os :: OS
os = unsafePerformIO do
-- unsafePerformIO and NOINLINE guarantee that c_getOS won't be called more than once
os' <- c_getOS
res <- peekCWString os'
free os'
pure $ OS res
{-# NOINLINE os #-}
foreign import ccall safe "getOS"
c_getOS :: IO CWString
| {-# Language BlockArguments #-}
{-# Language DerivingStrategies #-}
{-# Language GeneralisedNewtypeDeriving #-}
-----------------------------------------------------------------------------
-- |
-- Module : System.OS
-- Copyright : (c) ChaosGroup, 2020
-- License : MIT
--
-- Maintainer : daniel.taskoff@gmail.com
-- Stability : experimental
--
-- Get the name of the current operating system.
-----------------------------------------------------------------------------
module System.OS
(
-- * 'OS'
OS, os
) where
import Foreign.C.String (CWString, peekCWString)
import Foreign.Marshal.Alloc (free)
import Foreign.Ptr (nullPtr)
import System.IO.Unsafe (unsafePerformIO)
-- | The name of the current operating system.
newtype OS = OS String
deriving newtype Show
-- | Try to get the name of the current operating system.
os :: Maybe OS
os = unsafePerformIO do
-- unsafePerformIO and NOINLINE guarantee that c_getOS won't be called more than once
osptr <- c_getOS
if osptr == nullPtr
then pure Nothing
else do
res <- peekCWString osptr
free osptr
pure $ Just $ OS res
{-# NOINLINE os #-}
foreign import ccall safe "getOS"
c_getOS :: IO CWString
| Make os a Maybe, because of null pointers | Make os a Maybe, because of null pointers
| Haskell | mit | ChaosGroup/system-info | haskell | ## Code Before:
{-# Language BlockArguments #-}
{-# Language DerivingStrategies #-}
{-# Language GeneralisedNewtypeDeriving #-}
-----------------------------------------------------------------------------
-- |
-- Module : System.OS
-- Copyright : (c) ChaosGroup, 2020
-- License : MIT
--
-- Maintainer : daniel.taskoff@gmail.com
-- Stability : experimental
--
-- Get the name of the current operating system.
-----------------------------------------------------------------------------
module System.OS
(
-- * 'OS'
OS, os
) where
import Foreign.C.String (CWString, peekCWString)
import Foreign.Marshal.Alloc (free)
import System.IO.Unsafe (unsafePerformIO)
-- | The name of the current operating system.
newtype OS = OS String
deriving newtype Show
-- | Get the name of the current operating system.
os :: OS
os = unsafePerformIO do
-- unsafePerformIO and NOINLINE guarantee that c_getOS won't be called more than once
os' <- c_getOS
res <- peekCWString os'
free os'
pure $ OS res
{-# NOINLINE os #-}
foreign import ccall safe "getOS"
c_getOS :: IO CWString
## Instruction:
Make os a Maybe, because of null pointers
## Code After:
{-# Language BlockArguments #-}
{-# Language DerivingStrategies #-}
{-# Language GeneralisedNewtypeDeriving #-}
-----------------------------------------------------------------------------
-- |
-- Module : System.OS
-- Copyright : (c) ChaosGroup, 2020
-- License : MIT
--
-- Maintainer : daniel.taskoff@gmail.com
-- Stability : experimental
--
-- Get the name of the current operating system.
-----------------------------------------------------------------------------
module System.OS
(
-- * 'OS'
OS, os
) where
import Foreign.C.String (CWString, peekCWString)
import Foreign.Marshal.Alloc (free)
import Foreign.Ptr (nullPtr)
import System.IO.Unsafe (unsafePerformIO)
-- | The name of the current operating system.
newtype OS = OS String
deriving newtype Show
-- | Try to get the name of the current operating system.
os :: Maybe OS
os = unsafePerformIO do
-- unsafePerformIO and NOINLINE guarantee that c_getOS won't be called more than once
osptr <- c_getOS
if osptr == nullPtr
then pure Nothing
else do
res <- peekCWString osptr
free osptr
pure $ Just $ OS res
{-# NOINLINE os #-}
foreign import ccall safe "getOS"
c_getOS :: IO CWString
| {-# Language BlockArguments #-}
{-# Language DerivingStrategies #-}
{-# Language GeneralisedNewtypeDeriving #-}
-----------------------------------------------------------------------------
-- |
-- Module : System.OS
-- Copyright : (c) ChaosGroup, 2020
-- License : MIT
--
-- Maintainer : daniel.taskoff@gmail.com
-- Stability : experimental
--
-- Get the name of the current operating system.
-----------------------------------------------------------------------------
module System.OS
(
-- * 'OS'
OS, os
) where
import Foreign.C.String (CWString, peekCWString)
import Foreign.Marshal.Alloc (free)
+ import Foreign.Ptr (nullPtr)
import System.IO.Unsafe (unsafePerformIO)
-- | The name of the current operating system.
newtype OS = OS String
deriving newtype Show
- -- | Get the name of the current operating system.
? ^
+ -- | Try to get the name of the current operating system.
? ^^^^^^^^
- os :: OS
+ os :: Maybe OS
os = unsafePerformIO do
-- unsafePerformIO and NOINLINE guarantee that c_getOS won't be called more than once
- os' <- c_getOS
? ^
+ osptr <- c_getOS
? ^^^
+ if osptr == nullPtr
+ then pure Nothing
+ else do
- res <- peekCWString os'
? ^
+ res <- peekCWString osptr
? ++ ^^^
- free os'
? ^
+ free osptr
? ++ ^^^
- pure $ OS res
+ pure $ Just $ OS res
? ++ +++++++
{-# NOINLINE os #-}
foreign import ccall safe "getOS"
c_getOS :: IO CWString | 16 | 0.380952 | 10 | 6 |
e25f2c8b118e66caca8b6d5a1198c82461a32214 | wtsclient/src/manifest.json | wtsclient/src/manifest.json | {
"display": [
"fullscreen"
],
"icons": [{
"sizes": "512x512",
"src": "images/icon512.png"
}],
"name": "WTS Client",
"orientation": "any",
"start_url": "http://wts.crosswalk-project.org",
"xwalk_description": "Web Testing Service",
"xwalk_version": "0.1"
}
| {
"display": [
"fullscreen"
],
"icons": [{
"sizes": "512x512",
"src": "images/icon512.png"
}],
"name": "Web Test Client",
"orientation": "any",
"start_url": "http://wts.crosswalk-project.org",
"xwalk_description": "Web Test Client Application",
"xwalk_version": "0.1"
}
| Change the client name to Web Test Client. | Change the client name to Web Test Client.
| JSON | bsd-3-clause | BruceDai/web-testing-service,hgl888/web-testing-service,kaixinjxq/web-testing-service,kaixinjxq/web-testing-service,hgl888/web-testing-service,crosswalk-project/web-testing-service,yugang/web-testing-service,kaixinjxq/web-testing-service,crosswalk-project/web-testing-service,crosswalk-project/web-testing-service,haoxli/web-testing-service,hgl888/web-testing-service,haoxli/web-testing-service,BruceDai/web-testing-service,yugang/web-testing-service,hgl888/web-testing-service,BruceDai/web-testing-service,kaixinjxq/web-testing-service,yugang/web-testing-service,haoxli/web-testing-service,haoxli/web-testing-service,BruceDai/web-testing-service,yugang/web-testing-service,haoxli/web-testing-service,crosswalk-project/web-testing-service,yugang/web-testing-service,BruceDai/web-testing-service,yugang/web-testing-service,hgl888/web-testing-service,kaixinjxq/web-testing-service,kaixinjxq/web-testing-service,BruceDai/web-testing-service,crosswalk-project/web-testing-service | json | ## Code Before:
{
"display": [
"fullscreen"
],
"icons": [{
"sizes": "512x512",
"src": "images/icon512.png"
}],
"name": "WTS Client",
"orientation": "any",
"start_url": "http://wts.crosswalk-project.org",
"xwalk_description": "Web Testing Service",
"xwalk_version": "0.1"
}
## Instruction:
Change the client name to Web Test Client.
## Code After:
{
"display": [
"fullscreen"
],
"icons": [{
"sizes": "512x512",
"src": "images/icon512.png"
}],
"name": "Web Test Client",
"orientation": "any",
"start_url": "http://wts.crosswalk-project.org",
"xwalk_description": "Web Test Client Application",
"xwalk_version": "0.1"
}
| {
"display": [
"fullscreen"
],
"icons": [{
"sizes": "512x512",
"src": "images/icon512.png"
}],
- "name": "WTS Client",
? ^
+ "name": "Web Test Client",
? +++ ^^^
"orientation": "any",
"start_url": "http://wts.crosswalk-project.org",
- "xwalk_description": "Web Testing Service",
? ^ ^^^^ ^
+ "xwalk_description": "Web Test Client Application",
? +++ + ^ ^^^^ ^^^^^
"xwalk_version": "0.1"
} | 4 | 0.285714 | 2 | 2 |
db57332c3f942c2c409de06ef4cbad622b907379 | source/manual/ssh-from-vm.html.md | source/manual/ssh-from-vm.html.md | ---
owner_slack: "#2ndline"
title: SSH into GOV.UK servers from the VM
section: Development VM
layout: manual_layout
parent: "/manual.html"
last_reviewed_on: 2017-09-27
review_in: 6 months
---
You will need to either forward your publickey from the host machine to the
VM or have your VM publickey added to your [user manifest][user-manifests].
To confirm your key has been forwarded to the development vm you can run:
```shell
vagrant ssh # ssh onto vm
ssh-add -L # list key and location on host machine
```
Things to check if it doesn't work:
- **Can you SSH directly onto the jumpbox?**
`ssh jumpbox.integration.publishing.service.gov.uk` If not, check your ssh
version and config.
- **Do you get a permission denied error?** Make sure you're in the
user list in the [govuk-secrets repo](https://github.com/alphagov/govuk-secrets/tree/master/puppet/hieradata)
for production access, or the [govuk-puppet repo](https://github.com/alphagov/govuk-puppet/tree/master/hieradata)
for access to other environments.
- **Are you connecting from outside Aviation House?** You'll need to
connect to the Aviation House VPN first; SSH connections are
restricted to the Aviation House IP addresses.
| ---
owner_slack: "#2ndline"
title: SSH into GOV.UK servers from the VM
section: Development VM
layout: manual_layout
parent: "/manual.html"
last_reviewed_on: 2017-09-27
review_in: 6 months
---
You will need to either forward your publickey from the host machine to the
VM or have your VM publickey added to your [user manifest][user-manifests].
[user-manifests]: https://docs.publishing.service.gov.uk/manual/get-started.html#3-create-a-user-in-integration-and-ci
To confirm your key has been forwarded to the development vm you can run:
```shell
vagrant ssh # ssh onto vm
ssh-add -L # list key and location on host machine
```
Things to check if it doesn't work:
- **Can you SSH directly onto the jumpbox?**
`ssh jumpbox.integration.publishing.service.gov.uk` If not, check your ssh
version and config.
- **Do you get a permission denied error?** Make sure you're in the
user list in the [govuk-secrets repo](https://github.com/alphagov/govuk-secrets/tree/master/puppet/hieradata)
for production access, or the [govuk-puppet repo](https://github.com/alphagov/govuk-puppet/tree/master/hieradata)
for access to other environments.
- **Are you connecting from outside Aviation House?** You'll need to
connect to the Aviation House VPN first; SSH connections are
restricted to the Aviation House IP addresses.
| Fix missing link about user manifests | Fix missing link about user manifests
The section in the getting started guide was the best bit of
documentation I could find on this...
| Markdown | mit | alphagov/govuk-developer-docs,alphagov/govuk-developer-docs,alphagov/govuk-developer-docs,alphagov/govuk-developer-docs | markdown | ## Code Before:
---
owner_slack: "#2ndline"
title: SSH into GOV.UK servers from the VM
section: Development VM
layout: manual_layout
parent: "/manual.html"
last_reviewed_on: 2017-09-27
review_in: 6 months
---
You will need to either forward your publickey from the host machine to the
VM or have your VM publickey added to your [user manifest][user-manifests].
To confirm your key has been forwarded to the development vm you can run:
```shell
vagrant ssh # ssh onto vm
ssh-add -L # list key and location on host machine
```
Things to check if it doesn't work:
- **Can you SSH directly onto the jumpbox?**
`ssh jumpbox.integration.publishing.service.gov.uk` If not, check your ssh
version and config.
- **Do you get a permission denied error?** Make sure you're in the
user list in the [govuk-secrets repo](https://github.com/alphagov/govuk-secrets/tree/master/puppet/hieradata)
for production access, or the [govuk-puppet repo](https://github.com/alphagov/govuk-puppet/tree/master/hieradata)
for access to other environments.
- **Are you connecting from outside Aviation House?** You'll need to
connect to the Aviation House VPN first; SSH connections are
restricted to the Aviation House IP addresses.
## Instruction:
Fix missing link about user manifests
The section in the getting started guide was the best bit of
documentation I could find on this...
## Code After:
---
owner_slack: "#2ndline"
title: SSH into GOV.UK servers from the VM
section: Development VM
layout: manual_layout
parent: "/manual.html"
last_reviewed_on: 2017-09-27
review_in: 6 months
---
You will need to either forward your publickey from the host machine to the
VM or have your VM publickey added to your [user manifest][user-manifests].
[user-manifests]: https://docs.publishing.service.gov.uk/manual/get-started.html#3-create-a-user-in-integration-and-ci
To confirm your key has been forwarded to the development vm you can run:
```shell
vagrant ssh # ssh onto vm
ssh-add -L # list key and location on host machine
```
Things to check if it doesn't work:
- **Can you SSH directly onto the jumpbox?**
`ssh jumpbox.integration.publishing.service.gov.uk` If not, check your ssh
version and config.
- **Do you get a permission denied error?** Make sure you're in the
user list in the [govuk-secrets repo](https://github.com/alphagov/govuk-secrets/tree/master/puppet/hieradata)
for production access, or the [govuk-puppet repo](https://github.com/alphagov/govuk-puppet/tree/master/hieradata)
for access to other environments.
- **Are you connecting from outside Aviation House?** You'll need to
connect to the Aviation House VPN first; SSH connections are
restricted to the Aviation House IP addresses.
| ---
owner_slack: "#2ndline"
title: SSH into GOV.UK servers from the VM
section: Development VM
layout: manual_layout
parent: "/manual.html"
last_reviewed_on: 2017-09-27
review_in: 6 months
---
You will need to either forward your publickey from the host machine to the
VM or have your VM publickey added to your [user manifest][user-manifests].
+
+ [user-manifests]: https://docs.publishing.service.gov.uk/manual/get-started.html#3-create-a-user-in-integration-and-ci
To confirm your key has been forwarded to the development vm you can run:
```shell
vagrant ssh # ssh onto vm
ssh-add -L # list key and location on host machine
```
Things to check if it doesn't work:
- **Can you SSH directly onto the jumpbox?**
`ssh jumpbox.integration.publishing.service.gov.uk` If not, check your ssh
version and config.
- **Do you get a permission denied error?** Make sure you're in the
user list in the [govuk-secrets repo](https://github.com/alphagov/govuk-secrets/tree/master/puppet/hieradata)
for production access, or the [govuk-puppet repo](https://github.com/alphagov/govuk-puppet/tree/master/hieradata)
for access to other environments.
- **Are you connecting from outside Aviation House?** You'll need to
connect to the Aviation House VPN first; SSH connections are
restricted to the Aviation House IP addresses. | 2 | 0.064516 | 2 | 0 |
c42ffd4ef188cbf8567d959c9a651eea800f2064 | database/migrations/2018_05_10_131820_match_page_and_article_schema.php | database/migrations/2018_05_10_131820_match_page_and_article_schema.php | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class MatchPageAndArticleSchema extends Migration
{
private $tables = [
'generic_pages',
'press_releases',
'research_guides',
'educator_resources',
'digital_catalogs',
'printed_catalogs',
];
public function up()
{
foreach( $this->tables as $tableName )
{
Schema::table($tableName, function (Blueprint $table) {
$table->dropColumn('image_url');
$table->string('imgix_uuid')->nullable()->after('text');
$table->renameColumn('text', 'copy');
});
}
}
public function down()
{
foreach( $this->tables as $tableName )
{
Schema::table($tableName, function (Blueprint $table) {
$table->dropColumn('imgix_uuid');
$table->string('image_url')->nullable()->after('copy');
$table->renameColumn('copy', 'text');
});
}
}
}
| <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class MatchPageAndArticleSchema extends Migration
{
private $tables = [
'generic_pages',
'press_releases',
'research_guides',
'educator_resources',
'digital_catalogs',
'printed_catalogs',
];
public function up()
{
foreach( $this->tables as $tableName )
{
Schema::table($tableName, function (Blueprint $table) {
$table->dropColumn('image_url');
$table->string('imgix_uuid')->nullable()->after('text');
});
Schema::table($tableName, function (Blueprint $table) {
$table->renameColumn('text', 'copy');
});
}
}
public function down()
{
foreach( $this->tables as $tableName )
{
Schema::table($tableName, function (Blueprint $table) {
$table->dropColumn('imgix_uuid');
$table->string('image_url')->nullable()->after('copy');
});
Schema::table($tableName, function (Blueprint $table) {
$table->renameColumn('copy', 'text');
});
}
}
}
| Fix recent migration for SQLite | Fix recent migration for SQLite
BadMethodCallException: SQLite doesn't support multiple calls to
dropColumn / renameColumn in a single modification.
| PHP | agpl-3.0 | art-institute-of-chicago/data-aggregator,art-institute-of-chicago/data-aggregator,art-institute-of-chicago/data-aggregator | php | ## Code Before:
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class MatchPageAndArticleSchema extends Migration
{
private $tables = [
'generic_pages',
'press_releases',
'research_guides',
'educator_resources',
'digital_catalogs',
'printed_catalogs',
];
public function up()
{
foreach( $this->tables as $tableName )
{
Schema::table($tableName, function (Blueprint $table) {
$table->dropColumn('image_url');
$table->string('imgix_uuid')->nullable()->after('text');
$table->renameColumn('text', 'copy');
});
}
}
public function down()
{
foreach( $this->tables as $tableName )
{
Schema::table($tableName, function (Blueprint $table) {
$table->dropColumn('imgix_uuid');
$table->string('image_url')->nullable()->after('copy');
$table->renameColumn('copy', 'text');
});
}
}
}
## Instruction:
Fix recent migration for SQLite
BadMethodCallException: SQLite doesn't support multiple calls to
dropColumn / renameColumn in a single modification.
## Code After:
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class MatchPageAndArticleSchema extends Migration
{
private $tables = [
'generic_pages',
'press_releases',
'research_guides',
'educator_resources',
'digital_catalogs',
'printed_catalogs',
];
public function up()
{
foreach( $this->tables as $tableName )
{
Schema::table($tableName, function (Blueprint $table) {
$table->dropColumn('image_url');
$table->string('imgix_uuid')->nullable()->after('text');
});
Schema::table($tableName, function (Blueprint $table) {
$table->renameColumn('text', 'copy');
});
}
}
public function down()
{
foreach( $this->tables as $tableName )
{
Schema::table($tableName, function (Blueprint $table) {
$table->dropColumn('imgix_uuid');
$table->string('image_url')->nullable()->after('copy');
});
Schema::table($tableName, function (Blueprint $table) {
$table->renameColumn('copy', 'text');
});
}
}
}
| <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class MatchPageAndArticleSchema extends Migration
{
private $tables = [
'generic_pages',
'press_releases',
'research_guides',
'educator_resources',
'digital_catalogs',
'printed_catalogs',
];
public function up()
{
foreach( $this->tables as $tableName )
{
+
Schema::table($tableName, function (Blueprint $table) {
$table->dropColumn('image_url');
$table->string('imgix_uuid')->nullable()->after('text');
+
+ });
+
+ Schema::table($tableName, function (Blueprint $table) {
$table->renameColumn('text', 'copy');
});
+
}
}
public function down()
{
foreach( $this->tables as $tableName )
{
+
Schema::table($tableName, function (Blueprint $table) {
$table->dropColumn('imgix_uuid');
$table->string('image_url')->nullable()->after('copy');
+ });
+
+ Schema::table($tableName, function (Blueprint $table) {
$table->renameColumn('copy', 'text');
});
+
}
}
} | 11 | 0.234043 | 11 | 0 |
5a7e13fe68bf93a45a582115a3faa7b28edede86 | .travis.yml | .travis.yml | language: php
php:
- "5.5"
before_install:
- sudo pecl install mongo
- php -d extension=mongo.so
before_script:
- composer install
script: vendor/bin/phpunit
notifications:
email:
- krishnanunni@suyati.com
- nmohanan@suyati.com
- tkannippoyil@suyati.com | language: php
php:
- "5.5"
before_install:
- sudo apt-get install php-pear php5-dev
- sudo pecl install mongo
- php -d extension=mongo.so
before_script:
- composer install
script: vendor/bin/phpunit
notifications:
email:
- krishnanunni@suyati.com
- nmohanan@suyati.com
- tkannippoyil@suyati.com | Configure Travis to Install PECL | Configure Travis to Install PECL
| YAML | mit | suyati/mongologue | yaml | ## Code Before:
language: php
php:
- "5.5"
before_install:
- sudo pecl install mongo
- php -d extension=mongo.so
before_script:
- composer install
script: vendor/bin/phpunit
notifications:
email:
- krishnanunni@suyati.com
- nmohanan@suyati.com
- tkannippoyil@suyati.com
## Instruction:
Configure Travis to Install PECL
## Code After:
language: php
php:
- "5.5"
before_install:
- sudo apt-get install php-pear php5-dev
- sudo pecl install mongo
- php -d extension=mongo.so
before_script:
- composer install
script: vendor/bin/phpunit
notifications:
email:
- krishnanunni@suyati.com
- nmohanan@suyati.com
- tkannippoyil@suyati.com | language: php
php:
- "5.5"
before_install:
+ - sudo apt-get install php-pear php5-dev
- sudo pecl install mongo
- php -d extension=mongo.so
before_script:
- composer install
script: vendor/bin/phpunit
notifications:
email:
- krishnanunni@suyati.com
- nmohanan@suyati.com
- tkannippoyil@suyati.com | 1 | 0.058824 | 1 | 0 |
9f911b9d43fb3e537f2249366ff304790fa0a096 | build-debian.sh | build-debian.sh |
BUILD_OSNAME="debian"
BUILD_OSTYPE="Debian_64"
# last 'STABLE' version
BOX="debian-7.8.0-amd64"
ISO_URL="http://mirror.i3d.net/pub/debian-cd/7.8.0/amd64/iso-cd/debian-7.8.0-amd64-netinst.iso"
ISO_MD5="a91fba5001cf0fbccb44a7ae38c63b6e"
./build.sh ${BUILD_OSNAME} ${BUILD_OSTYPE} ${BOX} ${ISO_URL} ${ISO_MD5}
|
BUILD_OSNAME="debian"
BUILD_OSTYPE="Debian_64"
# last 'STABLE' version
BOX="debian-8.0.0-amd64"
ISO_URL="http://cdimage.debian.org/debian-cd/8.0.0/amd64/iso-cd/debian-8.0.0-amd64-netinst.iso"
ISO_MD5="d9209f355449fe13db3963571b1f52d4"
./build.sh ${BUILD_OSNAME} ${BUILD_OSTYPE} ${BOX} ${ISO_URL} ${ISO_MD5}
| Change url for version 8.0.0 to unofficial Debian mirror | Change url for version 8.0.0 to unofficial Debian mirror
| Shell | mit | kraksoft/vagrant-box,nvtkaszpir/vagrant-box | shell | ## Code Before:
BUILD_OSNAME="debian"
BUILD_OSTYPE="Debian_64"
# last 'STABLE' version
BOX="debian-7.8.0-amd64"
ISO_URL="http://mirror.i3d.net/pub/debian-cd/7.8.0/amd64/iso-cd/debian-7.8.0-amd64-netinst.iso"
ISO_MD5="a91fba5001cf0fbccb44a7ae38c63b6e"
./build.sh ${BUILD_OSNAME} ${BUILD_OSTYPE} ${BOX} ${ISO_URL} ${ISO_MD5}
## Instruction:
Change url for version 8.0.0 to unofficial Debian mirror
## Code After:
BUILD_OSNAME="debian"
BUILD_OSTYPE="Debian_64"
# last 'STABLE' version
BOX="debian-8.0.0-amd64"
ISO_URL="http://cdimage.debian.org/debian-cd/8.0.0/amd64/iso-cd/debian-8.0.0-amd64-netinst.iso"
ISO_MD5="d9209f355449fe13db3963571b1f52d4"
./build.sh ${BUILD_OSNAME} ${BUILD_OSTYPE} ${BOX} ${ISO_URL} ${ISO_MD5}
|
BUILD_OSNAME="debian"
BUILD_OSTYPE="Debian_64"
# last 'STABLE' version
- BOX="debian-7.8.0-amd64"
? ^ ^
+ BOX="debian-8.0.0-amd64"
? ^ ^
- ISO_URL="http://mirror.i3d.net/pub/debian-cd/7.8.0/amd64/iso-cd/debian-7.8.0-amd64-netinst.iso"
? ^^ ^^^^^^^^^^^^ ^ ^ ^ ^
+ ISO_URL="http://cdimage.debian.org/debian-cd/8.0.0/amd64/iso-cd/debian-8.0.0-amd64-netinst.iso"
? +++ +++++++ ^^^ ^ ^ ^ ^ ^
- ISO_MD5="a91fba5001cf0fbccb44a7ae38c63b6e"
+ ISO_MD5="d9209f355449fe13db3963571b1f52d4"
./build.sh ${BUILD_OSNAME} ${BUILD_OSTYPE} ${BOX} ${ISO_URL} ${ISO_MD5} | 6 | 0.6 | 3 | 3 |
54aa5464304b2d145da64f132e7ebba5ac4ef8b8 | README.md | README.md |
[Kubernetes](https://github.com/kubernetes/kubernetes) is awesome, but setting up a cluster is very complicated and the docs are not very clear and consistent at this point. This repository contains artifacts created by using the official "kube-up.sh" script from the official Kubernetes v1.0.4 distribution to create a cluster on AWS. I found that no amount of reading and re-reading the docs was as clear as just seeing the results and inspecting files and processes myself. This information should be useful to anyone who wants to create a Kubernetes cluster from scratch and wants to see both the big picture and the details of all the components and configuration that are required.
## Included files
* kube-up.out: The shell output of running the official kube-up.sh script.
* local_kubeconfig.yml: The kubeconfig file placed on your local system at ~/.kube/config, used by `kubectl` to control the cluster remotely.
* master: The files placed on the filesystem of the Kubernetes master server. Note that /mnt/master-pd/srv/kubernetes is linked at /srv/kubernetes and referred to with that path in the various configuration files.
* master_units.txt: The systemd units Kubernetes runs on the master server.
* node: The files placed on the filesystem of all the Kubernetes node servers.
* node_units.txt: The systemd units Kubernetes runs on all the node servers.
## License
[MIT](http://opensource.org/licenses/MIT)
|
[Kubernetes](https://github.com/kubernetes/kubernetes) is awesome, but setting up a cluster is very complicated and the docs are not very clear and consistent at this point. This repository contains artifacts created by using the official "kube-up.sh" script from the official Kubernetes v1.0.4 distribution to create a cluster on AWS. I found that no amount of reading and re-reading the docs was as clear as just seeing the results and inspecting files and processes myself. This information should be useful to anyone who wants to create a Kubernetes cluster from scratch and wants to see both the big picture and the details of all the components and configuration that are required.
## Included files
* kube-up.out: The shell output of running the official kube-up.sh script.
* local_kubeconfig.yml: The kubeconfig file placed on your local system at ~/.kube/config, used by `kubectl` to control the cluster remotely.
* master: The files placed on the filesystem of the Kubernetes master server. Note that /mnt/master-pd is an extra attached EBS volume. /mnt/master-pd/srv/kubernetes is linked at /srv/kubernetes and referred to with that path in the various configuration files.
* master_units.txt: The systemd units Kubernetes runs on the master server.
* node: The files placed on the filesystem of all the Kubernetes node servers.
* node_units.txt: The systemd units Kubernetes runs on all the node servers.
## License
[MIT](http://opensource.org/licenses/MIT)
| Clarify that /mnt/master-pd is an EBS volume. | Clarify that /mnt/master-pd is an EBS volume.
| Markdown | mit | jimmycuadra/kube-up-artifacts,jimmycuadra/kube-up | markdown | ## Code Before:
[Kubernetes](https://github.com/kubernetes/kubernetes) is awesome, but setting up a cluster is very complicated and the docs are not very clear and consistent at this point. This repository contains artifacts created by using the official "kube-up.sh" script from the official Kubernetes v1.0.4 distribution to create a cluster on AWS. I found that no amount of reading and re-reading the docs was as clear as just seeing the results and inspecting files and processes myself. This information should be useful to anyone who wants to create a Kubernetes cluster from scratch and wants to see both the big picture and the details of all the components and configuration that are required.
## Included files
* kube-up.out: The shell output of running the official kube-up.sh script.
* local_kubeconfig.yml: The kubeconfig file placed on your local system at ~/.kube/config, used by `kubectl` to control the cluster remotely.
* master: The files placed on the filesystem of the Kubernetes master server. Note that /mnt/master-pd/srv/kubernetes is linked at /srv/kubernetes and referred to with that path in the various configuration files.
* master_units.txt: The systemd units Kubernetes runs on the master server.
* node: The files placed on the filesystem of all the Kubernetes node servers.
* node_units.txt: The systemd units Kubernetes runs on all the node servers.
## License
[MIT](http://opensource.org/licenses/MIT)
## Instruction:
Clarify that /mnt/master-pd is an EBS volume.
## Code After:
[Kubernetes](https://github.com/kubernetes/kubernetes) is awesome, but setting up a cluster is very complicated and the docs are not very clear and consistent at this point. This repository contains artifacts created by using the official "kube-up.sh" script from the official Kubernetes v1.0.4 distribution to create a cluster on AWS. I found that no amount of reading and re-reading the docs was as clear as just seeing the results and inspecting files and processes myself. This information should be useful to anyone who wants to create a Kubernetes cluster from scratch and wants to see both the big picture and the details of all the components and configuration that are required.
## Included files
* kube-up.out: The shell output of running the official kube-up.sh script.
* local_kubeconfig.yml: The kubeconfig file placed on your local system at ~/.kube/config, used by `kubectl` to control the cluster remotely.
* master: The files placed on the filesystem of the Kubernetes master server. Note that /mnt/master-pd is an extra attached EBS volume. /mnt/master-pd/srv/kubernetes is linked at /srv/kubernetes and referred to with that path in the various configuration files.
* master_units.txt: The systemd units Kubernetes runs on the master server.
* node: The files placed on the filesystem of all the Kubernetes node servers.
* node_units.txt: The systemd units Kubernetes runs on all the node servers.
## License
[MIT](http://opensource.org/licenses/MIT)
|
[Kubernetes](https://github.com/kubernetes/kubernetes) is awesome, but setting up a cluster is very complicated and the docs are not very clear and consistent at this point. This repository contains artifacts created by using the official "kube-up.sh" script from the official Kubernetes v1.0.4 distribution to create a cluster on AWS. I found that no amount of reading and re-reading the docs was as clear as just seeing the results and inspecting files and processes myself. This information should be useful to anyone who wants to create a Kubernetes cluster from scratch and wants to see both the big picture and the details of all the components and configuration that are required.
## Included files
* kube-up.out: The shell output of running the official kube-up.sh script.
* local_kubeconfig.yml: The kubeconfig file placed on your local system at ~/.kube/config, used by `kubectl` to control the cluster remotely.
- * master: The files placed on the filesystem of the Kubernetes master server. Note that /mnt/master-pd/srv/kubernetes is linked at /srv/kubernetes and referred to with that path in the various configuration files.
+ * master: The files placed on the filesystem of the Kubernetes master server. Note that /mnt/master-pd is an extra attached EBS volume. /mnt/master-pd/srv/kubernetes is linked at /srv/kubernetes and referred to with that path in the various configuration files.
? ++++++++++++++++++++++++++++++++++++++++++++++++
* master_units.txt: The systemd units Kubernetes runs on the master server.
* node: The files placed on the filesystem of all the Kubernetes node servers.
* node_units.txt: The systemd units Kubernetes runs on all the node servers.
## License
[MIT](http://opensource.org/licenses/MIT) | 2 | 0.133333 | 1 | 1 |
b7c01914f9507cc467e8a1681b75c0954d58ad45 | app/views/games/_edit_buttons.html.erb | app/views/games/_edit_buttons.html.erb | <!-- EDIT BUTTONS -->
<% show_stats ||= false %>
<% if user_signed_in? %>
<div class="edit-buttons">
<% if current_user.owns?(game) || current_user.admin? %>
<% if show_stats %>
<a href="<%= stats_game_path(game) %>" class="pull-right">
<button class="btn btn-light">
Stats
</button>
</a>
<a href="" class="pull-right">
<button class="btn btn-light">
Scores
</button>
</a>
<% end %>
<% if current_user.can_download?(game) %>
<a href="<%= @game.download_url %>" class="btn btn-light">Download this game</a>
<% end %>
<a href="<%= edit_game_path(game) %>">
<button class="btn btn-success">
Edit
</button>
</a>
<a href="<%= confirm_destroy_game_path(game) %>">
<button class="btn btn-danger" type="button">
Delete
</button>
</a>
<% end %>
</div>
<% end %>
| <!-- EDIT BUTTONS -->
<% show_stats ||= false %>
<% if user_signed_in? %>
<div class="edit-buttons">
<% if current_user.owns?(game) || current_user.admin? %>
<% if show_stats %>
<a href="<%= stats_game_path(game) %>" class="pull-right">
<button class="btn btn-light">
Stats
</button>
</a>
<a href="<%= scores_game_path(game) %>" class="pull-right">
<button class="btn btn-light">
Scores
</button>
</a>
<% end %>
<% if current_user.can_download?(game) %>
<a href="<%= @game.download_url %>" class="btn btn-light">Download this game</a>
<% end %>
<a href="<%= edit_game_path(game) %>">
<button class="btn btn-success">
Edit
</button>
</a>
<a href="<%= confirm_destroy_game_path(game) %>">
<button class="btn btn-danger" type="button">
Delete
</button>
</a>
<% end %>
</div>
<% end %>
| Fix link to scores page. | Fix link to scores page.
| HTML+ERB | mit | winnitron/winnitron_reborn,winnitron/winnitron_reborn,winnitron/winnitron_reborn | html+erb | ## Code Before:
<!-- EDIT BUTTONS -->
<% show_stats ||= false %>
<% if user_signed_in? %>
<div class="edit-buttons">
<% if current_user.owns?(game) || current_user.admin? %>
<% if show_stats %>
<a href="<%= stats_game_path(game) %>" class="pull-right">
<button class="btn btn-light">
Stats
</button>
</a>
<a href="" class="pull-right">
<button class="btn btn-light">
Scores
</button>
</a>
<% end %>
<% if current_user.can_download?(game) %>
<a href="<%= @game.download_url %>" class="btn btn-light">Download this game</a>
<% end %>
<a href="<%= edit_game_path(game) %>">
<button class="btn btn-success">
Edit
</button>
</a>
<a href="<%= confirm_destroy_game_path(game) %>">
<button class="btn btn-danger" type="button">
Delete
</button>
</a>
<% end %>
</div>
<% end %>
## Instruction:
Fix link to scores page.
## Code After:
<!-- EDIT BUTTONS -->
<% show_stats ||= false %>
<% if user_signed_in? %>
<div class="edit-buttons">
<% if current_user.owns?(game) || current_user.admin? %>
<% if show_stats %>
<a href="<%= stats_game_path(game) %>" class="pull-right">
<button class="btn btn-light">
Stats
</button>
</a>
<a href="<%= scores_game_path(game) %>" class="pull-right">
<button class="btn btn-light">
Scores
</button>
</a>
<% end %>
<% if current_user.can_download?(game) %>
<a href="<%= @game.download_url %>" class="btn btn-light">Download this game</a>
<% end %>
<a href="<%= edit_game_path(game) %>">
<button class="btn btn-success">
Edit
</button>
</a>
<a href="<%= confirm_destroy_game_path(game) %>">
<button class="btn btn-danger" type="button">
Delete
</button>
</a>
<% end %>
</div>
<% end %>
| <!-- EDIT BUTTONS -->
<% show_stats ||= false %>
<% if user_signed_in? %>
<div class="edit-buttons">
<% if current_user.owns?(game) || current_user.admin? %>
<% if show_stats %>
<a href="<%= stats_game_path(game) %>" class="pull-right">
<button class="btn btn-light">
Stats
</button>
</a>
- <a href="" class="pull-right">
+ <a href="<%= scores_game_path(game) %>" class="pull-right">
<button class="btn btn-light">
Scores
</button>
</a>
<% end %>
<% if current_user.can_download?(game) %>
<a href="<%= @game.download_url %>" class="btn btn-light">Download this game</a>
<% end %>
<a href="<%= edit_game_path(game) %>">
<button class="btn btn-success">
Edit
</button>
</a>
<a href="<%= confirm_destroy_game_path(game) %>">
<button class="btn btn-danger" type="button">
Delete
</button>
</a>
<% end %>
</div>
<% end %> | 2 | 0.047619 | 1 | 1 |
b5fbf86718834c590edd3d3f6f6b818d57351b72 | templates/client.conf.erb | templates/client.conf.erb | Client {
Name = <%= @clientcert %>-fd
Address = <%= @clientcert %>
FDPort = <%= @port %>
Catalog = MyCatalog
Password = "<%= @password %>"
File Retention = <%= @file_retention %>
Job Retention = <%= @job_retention %>
AutoPrune = <%= @autoprune %>
}
| Client {
Name = <%= @clientcert %>-fd
Address = <%= @listen_address %>
FDPort = <%= @port %>
Catalog = MyCatalog
Password = "<%= @password %>"
File Retention = <%= @file_retention %>
Job Retention = <%= @job_retention %>
AutoPrune = <%= @autoprune %>
}
| Use the address from the export | Use the address from the export
| HTML+ERB | apache-2.0 | avisi/puppet-bacula,jhooyberghs/puppet-bacula,avisi/puppet-bacula,jhooyberghs/puppet-bacula,jhooyberghs/puppet-bacula,SoftcomInc/puppet-bacula,xaque208/puppet-bacula,SoftcomInc/puppet-bacula,SoftcomInc/puppet-bacula | html+erb | ## Code Before:
Client {
Name = <%= @clientcert %>-fd
Address = <%= @clientcert %>
FDPort = <%= @port %>
Catalog = MyCatalog
Password = "<%= @password %>"
File Retention = <%= @file_retention %>
Job Retention = <%= @job_retention %>
AutoPrune = <%= @autoprune %>
}
## Instruction:
Use the address from the export
## Code After:
Client {
Name = <%= @clientcert %>-fd
Address = <%= @listen_address %>
FDPort = <%= @port %>
Catalog = MyCatalog
Password = "<%= @password %>"
File Retention = <%= @file_retention %>
Job Retention = <%= @job_retention %>
AutoPrune = <%= @autoprune %>
}
| Client {
Name = <%= @clientcert %>-fd
- Address = <%= @clientcert %>
? - ^^ ^^
+ Address = <%= @listen_address %>
? ++ ^^^^^ ^^
FDPort = <%= @port %>
Catalog = MyCatalog
Password = "<%= @password %>"
File Retention = <%= @file_retention %>
Job Retention = <%= @job_retention %>
AutoPrune = <%= @autoprune %>
}
| 2 | 0.181818 | 1 | 1 |
4641e2a05de38767f98714a7fea1e46a6a43f710 | src/components/class-component.php | src/components/class-component.php | <?php
namespace Xu\Components;
use Xu\Foundation\Foundation;
/**
* Component class.
*/
abstract class Component {
/**
* xu instance.
*
* @var \Xu\Foundation\Xu
*/
protected $xu;
/**
* Create a new component instance.
*
* @param \Xu\Foundation\Foundation $xu
*/
public function __construct( Foundation $xu ) {
$this->xu = $xu;
}
/**
* Bootstrap the component.
*
* @codeCoverageIgnore
*/
public function bootstrap() {
}
/**
* Return the given object. Useful for chaining.
*
* @param mixed $obj
*
* @return mixed
*/
protected function with( $obj ) {
return $obj;
}
}
| <?php
namespace Xu\Components;
use Xu\Contracts\Foundation\Foundation as FoundationContract;
/**
* Component class.
*/
abstract class Component {
/**
* xu instance.
*
* @var \Xu\Contracts\Foundation\Foundation
*/
protected $xu;
/**
* Create a new component instance.
*
* @param \Xu\Contracts\Foundation\Foundation $xu
*/
public function __construct( FoundationContract $xu ) {
$this->xu = $xu;
}
/**
* Bootstrap the component.
*
* @codeCoverageIgnore
*/
public function bootstrap() {
}
/**
* Return the given object. Useful for chaining.
*
* @param mixed $obj
*
* @return mixed
*/
protected function with( $obj ) {
return $obj;
}
}
| Update component class to take foundation contract | Update component class to take foundation contract
| PHP | mit | wp-xu/xu,wp-xu/framework | php | ## Code Before:
<?php
namespace Xu\Components;
use Xu\Foundation\Foundation;
/**
* Component class.
*/
abstract class Component {
/**
* xu instance.
*
* @var \Xu\Foundation\Xu
*/
protected $xu;
/**
* Create a new component instance.
*
* @param \Xu\Foundation\Foundation $xu
*/
public function __construct( Foundation $xu ) {
$this->xu = $xu;
}
/**
* Bootstrap the component.
*
* @codeCoverageIgnore
*/
public function bootstrap() {
}
/**
* Return the given object. Useful for chaining.
*
* @param mixed $obj
*
* @return mixed
*/
protected function with( $obj ) {
return $obj;
}
}
## Instruction:
Update component class to take foundation contract
## Code After:
<?php
namespace Xu\Components;
use Xu\Contracts\Foundation\Foundation as FoundationContract;
/**
* Component class.
*/
abstract class Component {
/**
* xu instance.
*
* @var \Xu\Contracts\Foundation\Foundation
*/
protected $xu;
/**
* Create a new component instance.
*
* @param \Xu\Contracts\Foundation\Foundation $xu
*/
public function __construct( FoundationContract $xu ) {
$this->xu = $xu;
}
/**
* Bootstrap the component.
*
* @codeCoverageIgnore
*/
public function bootstrap() {
}
/**
* Return the given object. Useful for chaining.
*
* @param mixed $obj
*
* @return mixed
*/
protected function with( $obj ) {
return $obj;
}
}
| <?php
namespace Xu\Components;
- use Xu\Foundation\Foundation;
+ use Xu\Contracts\Foundation\Foundation as FoundationContract;
/**
* Component class.
*/
abstract class Component {
/**
* xu instance.
*
- * @var \Xu\Foundation\Xu
+ * @var \Xu\Contracts\Foundation\Foundation
*/
protected $xu;
/**
* Create a new component instance.
*
- * @param \Xu\Foundation\Foundation $xu
+ * @param \Xu\Contracts\Foundation\Foundation $xu
? ++++++++++
*/
- public function __construct( Foundation $xu ) {
+ public function __construct( FoundationContract $xu ) {
? ++++++++
$this->xu = $xu;
}
/**
* Bootstrap the component.
*
* @codeCoverageIgnore
*/
public function bootstrap() {
}
/**
* Return the given object. Useful for chaining.
*
* @param mixed $obj
*
* @return mixed
*/
protected function with( $obj ) {
return $obj;
}
} | 8 | 0.170213 | 4 | 4 |
54d78b8a4117282a026571f6e83011be794f5d00 | docs/linux.rst | docs/linux.rst | Gaphor on Linux
===============
Examples of Gaphor and Gaphas RPM spec files can be found in `PLD Linux <https://www.pld-linux.org/>`_
`repository <https://github.com/pld-linux/>`_:
* https://github.com/pld-linux/python-gaphas
* https://github.com/pld-linux/gaphor
Please, do not hesitate to contact us if you need help to create a Linux package
for Gaphor or Gaphas.
Dependencies
------------
Gaphor depends on Zope libraries:
* component
* interface
and:
* gaphas (of course :)
* pygtk
Above Zope modules require
* deferredimport
* deprecation
* event
* proxy
* testing
| Gaphor on Linux
===============
Examples of Gaphor and Gaphas RPM spec files can be found in `PLD Linux <https://www.pld-linux.org/>`_
`repository <https://github.com/pld-linux/>`_:
* https://github.com/pld-linux/python-gaphas
* https://github.com/pld-linux/gaphor
Please, do not hesitate to contact us if you need help to create a Linux package
for Gaphor or Gaphas.
Development Environment
-----------------------
To setup a development environment with Linux, you first need the latest
stable version of Python. In order to get the latest stable version, we
recommend that you install `pyenv <https://github.com/pyenv/pyenv>`_.
Install the pyenv `prerequisites <https://github.com/pyenv/pyenv/wiki/Common-build-problems#prerequisites>`_
first, and then install pyenv:
$ curl https://pyenv.run | bash
Make sure you follow the instruction at the end of the installation script
to install the commands in your shell's rc file. Finally install the latest
version of Python by executing:
$ pyenv install 3.x.x
Where 3.x.x is replaced by the latest stable version of Python.
Next install the Gaphor prerequisites by installing the gobject introspection
and cairo build dependencies, for example in Ubuntu execute:
$ sudo apt-get install -y python3-dev python3-gi python3-gi-cairo
gir1.2-gtk-3.0 libgirepository1.0-dev libcairo2-dev
`Clone the repository <https://help.github.com/en/articles/cloning-a-repository>`_.
$ cd gaphor
$ source ./venv
$ poetry run gaphor
| Update development environment instructions for Linux | Update development environment instructions for Linux
Signed-off-by: Dan Yeaw <2591e5f46f28d303f9dc027d475a5c60d8dea17a@yeaw.me>
| reStructuredText | lgpl-2.1 | amolenaar/gaphor,amolenaar/gaphor | restructuredtext | ## Code Before:
Gaphor on Linux
===============
Examples of Gaphor and Gaphas RPM spec files can be found in `PLD Linux <https://www.pld-linux.org/>`_
`repository <https://github.com/pld-linux/>`_:
* https://github.com/pld-linux/python-gaphas
* https://github.com/pld-linux/gaphor
Please, do not hesitate to contact us if you need help to create a Linux package
for Gaphor or Gaphas.
Dependencies
------------
Gaphor depends on Zope libraries:
* component
* interface
and:
* gaphas (of course :)
* pygtk
Above Zope modules require
* deferredimport
* deprecation
* event
* proxy
* testing
## Instruction:
Update development environment instructions for Linux
Signed-off-by: Dan Yeaw <2591e5f46f28d303f9dc027d475a5c60d8dea17a@yeaw.me>
## Code After:
Gaphor on Linux
===============
Examples of Gaphor and Gaphas RPM spec files can be found in `PLD Linux <https://www.pld-linux.org/>`_
`repository <https://github.com/pld-linux/>`_:
* https://github.com/pld-linux/python-gaphas
* https://github.com/pld-linux/gaphor
Please, do not hesitate to contact us if you need help to create a Linux package
for Gaphor or Gaphas.
Development Environment
-----------------------
To setup a development environment with Linux, you first need the latest
stable version of Python. In order to get the latest stable version, we
recommend that you install `pyenv <https://github.com/pyenv/pyenv>`_.
Install the pyenv `prerequisites <https://github.com/pyenv/pyenv/wiki/Common-build-problems#prerequisites>`_
first, and then install pyenv:
$ curl https://pyenv.run | bash
Make sure you follow the instruction at the end of the installation script
to install the commands in your shell's rc file. Finally install the latest
version of Python by executing:
$ pyenv install 3.x.x
Where 3.x.x is replaced by the latest stable version of Python.
Next install the Gaphor prerequisites by installing the gobject introspection
and cairo build dependencies, for example in Ubuntu execute:
$ sudo apt-get install -y python3-dev python3-gi python3-gi-cairo
gir1.2-gtk-3.0 libgirepository1.0-dev libcairo2-dev
`Clone the repository <https://help.github.com/en/articles/cloning-a-repository>`_.
$ cd gaphor
$ source ./venv
$ poetry run gaphor
| Gaphor on Linux
===============
Examples of Gaphor and Gaphas RPM spec files can be found in `PLD Linux <https://www.pld-linux.org/>`_
`repository <https://github.com/pld-linux/>`_:
* https://github.com/pld-linux/python-gaphas
* https://github.com/pld-linux/gaphor
Please, do not hesitate to contact us if you need help to create a Linux package
for Gaphor or Gaphas.
- Dependencies
- ------------
+ Development Environment
+ -----------------------
+ To setup a development environment with Linux, you first need the latest
+ stable version of Python. In order to get the latest stable version, we
+ recommend that you install `pyenv <https://github.com/pyenv/pyenv>`_.
+ Install the pyenv `prerequisites <https://github.com/pyenv/pyenv/wiki/Common-build-problems#prerequisites>`_
+ first, and then install pyenv:
- Gaphor depends on Zope libraries:
- * component
- * interface
- and:
- * gaphas (of course :)
- * pygtk
- Above Zope modules require
- * deferredimport
- * deprecation
- * event
- * proxy
- * testing
+
+ $ curl https://pyenv.run | bash
+
+
+ Make sure you follow the instruction at the end of the installation script
+ to install the commands in your shell's rc file. Finally install the latest
+ version of Python by executing:
+
+ $ pyenv install 3.x.x
+
+ Where 3.x.x is replaced by the latest stable version of Python.
+
+ Next install the Gaphor prerequisites by installing the gobject introspection
+ and cairo build dependencies, for example in Ubuntu execute:
+
+
+ $ sudo apt-get install -y python3-dev python3-gi python3-gi-cairo
+ gir1.2-gtk-3.0 libgirepository1.0-dev libcairo2-dev
+
+ `Clone the repository <https://help.github.com/en/articles/cloning-a-repository>`_.
+
+ $ cd gaphor
+ $ source ./venv
+ $ poetry run gaphor | 45 | 1.607143 | 31 | 14 |
10733eaab06fdb8964d5c7cd620a45a314eee47c | manual_tests/ny_restaurants.r | manual_tests/ny_restaurants.r | library(mongoplyr)
conn <- mongo(db = "mongoplyr_tests", collection = "restaurants")
MongoPipeline() %>%
match(.borough == "Manhattan" & .cuisine == "Pizza") %>%
execute(conn) -> pizzaPlacesInManhattan
MongoPipeline() %>%
group(by = .list(cuisine = .cuisine, borough = .borough), count = .sum(1)) %>%
execute(conn) -> cuisineFrequencyByBorough
boroughs <- c("Manhattan", "Staten Island", "Bronx", "Queens", "Brooklyn")
getRandomNYBorough <- function()
{
sample(boroughs, 1)
}
getNYBoroughByIndex <- function(i)
{
boroughs[[i]]
}
MongoPipeline() %>%
match(.borough == getRandomNYBorough()) %>%
execute(conn) -> restaurantsInRandomBorough
MongoPipeline() %>%
match(.borough == getNYBoroughByIndex(5)) %>%
execute(conn) -> restaurantsInBrooklynByIndex
| library(mongoplyr)
conn <- mongo(db = "mongoplyr_tests", collection = "restaurants")
MongoPipeline() %>%
match(.borough == "Manhattan" & .cuisine == "Pizza") %>%
execute(conn) -> pizzaPlacesInManhattan
MongoPipeline() %>%
group(by = .list(cuisine = .cuisine, borough = .borough), count = .sum(1)) %>%
execute(conn) -> cuisineFrequencyByBorough
boroughs <- c("Manhattan", "Staten Island", "Bronx", "Queens", "Brooklyn")
getRandomNYBorough <- function()
{
sample(boroughs, 1)
}
getNYBoroughByIndex <- function(i)
{
boroughs[[i]]
}
MongoPipeline() %>%
match(.borough == getRandomNYBorough()) %>%
execute(conn) -> restaurantsInRandomBorough
MongoPipeline() %>%
match(.borough == getNYBoroughByIndex(5)) %>%
execute(conn) -> restaurantsInBrooklynByIndex
| Fix tabs/spaces in example file | Fix tabs/spaces in example file
| R | mit | returnString/mongoplyr,returnString/mongoplyr | r | ## Code Before:
library(mongoplyr)
conn <- mongo(db = "mongoplyr_tests", collection = "restaurants")
MongoPipeline() %>%
match(.borough == "Manhattan" & .cuisine == "Pizza") %>%
execute(conn) -> pizzaPlacesInManhattan
MongoPipeline() %>%
group(by = .list(cuisine = .cuisine, borough = .borough), count = .sum(1)) %>%
execute(conn) -> cuisineFrequencyByBorough
boroughs <- c("Manhattan", "Staten Island", "Bronx", "Queens", "Brooklyn")
getRandomNYBorough <- function()
{
sample(boroughs, 1)
}
getNYBoroughByIndex <- function(i)
{
boroughs[[i]]
}
MongoPipeline() %>%
match(.borough == getRandomNYBorough()) %>%
execute(conn) -> restaurantsInRandomBorough
MongoPipeline() %>%
match(.borough == getNYBoroughByIndex(5)) %>%
execute(conn) -> restaurantsInBrooklynByIndex
## Instruction:
Fix tabs/spaces in example file
## Code After:
library(mongoplyr)
conn <- mongo(db = "mongoplyr_tests", collection = "restaurants")
MongoPipeline() %>%
match(.borough == "Manhattan" & .cuisine == "Pizza") %>%
execute(conn) -> pizzaPlacesInManhattan
MongoPipeline() %>%
group(by = .list(cuisine = .cuisine, borough = .borough), count = .sum(1)) %>%
execute(conn) -> cuisineFrequencyByBorough
boroughs <- c("Manhattan", "Staten Island", "Bronx", "Queens", "Brooklyn")
getRandomNYBorough <- function()
{
sample(boroughs, 1)
}
getNYBoroughByIndex <- function(i)
{
boroughs[[i]]
}
MongoPipeline() %>%
match(.borough == getRandomNYBorough()) %>%
execute(conn) -> restaurantsInRandomBorough
MongoPipeline() %>%
match(.borough == getNYBoroughByIndex(5)) %>%
execute(conn) -> restaurantsInBrooklynByIndex
| library(mongoplyr)
conn <- mongo(db = "mongoplyr_tests", collection = "restaurants")
MongoPipeline() %>%
- match(.borough == "Manhattan" & .cuisine == "Pizza") %>%
? ^^
+ match(.borough == "Manhattan" & .cuisine == "Pizza") %>%
? ^
- execute(conn) -> pizzaPlacesInManhattan
? ^^
+ execute(conn) -> pizzaPlacesInManhattan
? ^
MongoPipeline() %>%
- group(by = .list(cuisine = .cuisine, borough = .borough), count = .sum(1)) %>%
? ^^
+ group(by = .list(cuisine = .cuisine, borough = .borough), count = .sum(1)) %>%
? ^
- execute(conn) -> cuisineFrequencyByBorough
? ^^
+ execute(conn) -> cuisineFrequencyByBorough
? ^
boroughs <- c("Manhattan", "Staten Island", "Bronx", "Queens", "Brooklyn")
getRandomNYBorough <- function()
{
- sample(boroughs, 1)
? ^^
+ sample(boroughs, 1)
? ^
}
getNYBoroughByIndex <- function(i)
{
boroughs[[i]]
}
MongoPipeline() %>%
- match(.borough == getRandomNYBorough()) %>%
? ^^
+ match(.borough == getRandomNYBorough()) %>%
? ^
- execute(conn) -> restaurantsInRandomBorough
? ^^
+ execute(conn) -> restaurantsInRandomBorough
? ^
MongoPipeline() %>%
- match(.borough == getNYBoroughByIndex(5)) %>%
? ^^
+ match(.borough == getNYBoroughByIndex(5)) %>%
? ^
- execute(conn) -> restaurantsInBrooklynByIndex
? ^^
+ execute(conn) -> restaurantsInBrooklynByIndex
? ^
| 18 | 0.580645 | 9 | 9 |
f6640d28e09979825b63abb619da29bf17ca4819 | test/CodeGen/ubsan-null.c | test/CodeGen/ubsan-null.c | // RUN: %clang_cc1 -fsanitize=null -emit-llvm %s -o - | FileCheck %s
struct A {
int a[2];
int b;
};
// CHECK-LABEL: @f1
int *f1() {
// CHECK-NOT: __ubsan_handle_type_mismatch
// CHECK: ret
// CHECK-SAME: getelementptr inbounds (%struct.A, %struct.A* null, i32 0, i32 1)
return &((struct A *)0)->b;
}
// CHECK-LABEL: @f2
int f2() {
// CHECK: __ubsan_handle_type_mismatch
// CHECK: load
// CHECK-SAME: getelementptr inbounds (%struct.A, %struct.A* null, i32 0, i32 1)
// CHECK: ret
return ((struct A *)0)->b;
}
| // RUN: %clang_cc1 -fsanitize=null -emit-llvm %s -o - | FileCheck %s
struct A {
int a[2];
int b;
};
// CHECK-LABEL: @f1
int *f1() {
// CHECK-NOT: __ubsan_handle_type_mismatch
// CHECK: ret
// CHECK-SAME: getelementptr inbounds (%struct.A, %struct.A* null, i32 0, i32 1)
return &((struct A *)0)->b;
}
| Make a test compatible with r300508 | [ubsan] Make a test compatible with r300508
| C | apache-2.0 | apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang | c | ## Code Before:
// RUN: %clang_cc1 -fsanitize=null -emit-llvm %s -o - | FileCheck %s
struct A {
int a[2];
int b;
};
// CHECK-LABEL: @f1
int *f1() {
// CHECK-NOT: __ubsan_handle_type_mismatch
// CHECK: ret
// CHECK-SAME: getelementptr inbounds (%struct.A, %struct.A* null, i32 0, i32 1)
return &((struct A *)0)->b;
}
// CHECK-LABEL: @f2
int f2() {
// CHECK: __ubsan_handle_type_mismatch
// CHECK: load
// CHECK-SAME: getelementptr inbounds (%struct.A, %struct.A* null, i32 0, i32 1)
// CHECK: ret
return ((struct A *)0)->b;
}
## Instruction:
[ubsan] Make a test compatible with r300508
## Code After:
// RUN: %clang_cc1 -fsanitize=null -emit-llvm %s -o - | FileCheck %s
struct A {
int a[2];
int b;
};
// CHECK-LABEL: @f1
int *f1() {
// CHECK-NOT: __ubsan_handle_type_mismatch
// CHECK: ret
// CHECK-SAME: getelementptr inbounds (%struct.A, %struct.A* null, i32 0, i32 1)
return &((struct A *)0)->b;
}
| // RUN: %clang_cc1 -fsanitize=null -emit-llvm %s -o - | FileCheck %s
struct A {
int a[2];
int b;
};
// CHECK-LABEL: @f1
int *f1() {
// CHECK-NOT: __ubsan_handle_type_mismatch
// CHECK: ret
// CHECK-SAME: getelementptr inbounds (%struct.A, %struct.A* null, i32 0, i32 1)
return &((struct A *)0)->b;
}
-
- // CHECK-LABEL: @f2
- int f2() {
- // CHECK: __ubsan_handle_type_mismatch
- // CHECK: load
- // CHECK-SAME: getelementptr inbounds (%struct.A, %struct.A* null, i32 0, i32 1)
- // CHECK: ret
- return ((struct A *)0)->b;
- } | 9 | 0.391304 | 0 | 9 |
7f444a4bc172e88fe0e0466d4103189c4b8d32dc | js/main.js | js/main.js | var tabs = document.querySelectorAll('.tab');
var allPanels = document.querySelectorAll(".schedule");
function activateTab(tab) {
//remove active de todas as outras tabs
tabs.forEach(function(tab) {
tab.classList.remove('active');
});
//adiciona active em t
tab.classList.add('active');
}
function openCourse(item, day) {
for(var i=0;i<allPanels.length;i++){
allPanels[i].style.display = 'none';
}
document.getElementById(day).style.display = 'block';
activateTab(item);
}
function initMap() {
var myLatlng = {lat: -23.482069, lng: -47.425131};
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 15,
center: myLatlng,
scrollwheel: false,
});
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: 'Click to zoom'
});
map.addListener('center_changed', function() {
// 3 seconds after the center of the map has changed, pan back to the
// marker.
window.setTimeout(function() {
map.panTo(marker.getPosition());
}, 3000);
});
marker.addListener('click', function() {
map.setZoom(8);
map.setCenter(marker.getPosition());
});
}
| var tabs = document.querySelectorAll('.tab');
var allPanels = document.querySelectorAll(".schedule");
function activateTab(tab) {
//remove active de todas as outras tabs
for (i = 0; i < tabs.length; ++i) {
tabs[i].classList.remove('active');
}
//adiciona active em t
tab.classList.add('active');
}
function openCourse(item, day) {
for(var i=0;i<allPanels.length;i++){
allPanels[i].style.display = 'none';
}
document.getElementById(day).style.display = 'block';
activateTab(item);
}
function initMap() {
var myLatlng = {lat: -23.482069, lng: -47.425131};
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 15,
center: myLatlng,
scrollwheel: false,
});
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: 'Click to zoom'
});
map.addListener('center_changed', function() {
// 3 seconds after the center of the map has changed, pan back to the
// marker.
window.setTimeout(function() {
map.panTo(marker.getPosition());
}, 3000);
});
marker.addListener('click', function() {
map.setZoom(8);
map.setCenter(marker.getPosition());
});
}
| Fix timeline tabs to work on mozilla (for instead of forEach to nodelist) | Fix timeline tabs to work on mozilla (for instead of forEach to nodelist)
| JavaScript | cc0-1.0 | FatecSorocaba/semana-da-tecnologia,FatecSorocaba/semana-da-tecnologia | javascript | ## Code Before:
var tabs = document.querySelectorAll('.tab');
var allPanels = document.querySelectorAll(".schedule");
function activateTab(tab) {
//remove active de todas as outras tabs
tabs.forEach(function(tab) {
tab.classList.remove('active');
});
//adiciona active em t
tab.classList.add('active');
}
function openCourse(item, day) {
for(var i=0;i<allPanels.length;i++){
allPanels[i].style.display = 'none';
}
document.getElementById(day).style.display = 'block';
activateTab(item);
}
function initMap() {
var myLatlng = {lat: -23.482069, lng: -47.425131};
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 15,
center: myLatlng,
scrollwheel: false,
});
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: 'Click to zoom'
});
map.addListener('center_changed', function() {
// 3 seconds after the center of the map has changed, pan back to the
// marker.
window.setTimeout(function() {
map.panTo(marker.getPosition());
}, 3000);
});
marker.addListener('click', function() {
map.setZoom(8);
map.setCenter(marker.getPosition());
});
}
## Instruction:
Fix timeline tabs to work on mozilla (for instead of forEach to nodelist)
## Code After:
var tabs = document.querySelectorAll('.tab');
var allPanels = document.querySelectorAll(".schedule");
function activateTab(tab) {
//remove active de todas as outras tabs
for (i = 0; i < tabs.length; ++i) {
tabs[i].classList.remove('active');
}
//adiciona active em t
tab.classList.add('active');
}
function openCourse(item, day) {
for(var i=0;i<allPanels.length;i++){
allPanels[i].style.display = 'none';
}
document.getElementById(day).style.display = 'block';
activateTab(item);
}
function initMap() {
var myLatlng = {lat: -23.482069, lng: -47.425131};
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 15,
center: myLatlng,
scrollwheel: false,
});
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: 'Click to zoom'
});
map.addListener('center_changed', function() {
// 3 seconds after the center of the map has changed, pan back to the
// marker.
window.setTimeout(function() {
map.panTo(marker.getPosition());
}, 3000);
});
marker.addListener('click', function() {
map.setZoom(8);
map.setCenter(marker.getPosition());
});
}
| var tabs = document.querySelectorAll('.tab');
var allPanels = document.querySelectorAll(".schedule");
function activateTab(tab) {
//remove active de todas as outras tabs
- tabs.forEach(function(tab) {
+ for (i = 0; i < tabs.length; ++i) {
- tab.classList.remove('active');
+ tabs[i].classList.remove('active');
? ++++
- });
? --
+ }
//adiciona active em t
tab.classList.add('active');
}
function openCourse(item, day) {
for(var i=0;i<allPanels.length;i++){
allPanels[i].style.display = 'none';
}
document.getElementById(day).style.display = 'block';
activateTab(item);
}
function initMap() {
var myLatlng = {lat: -23.482069, lng: -47.425131};
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 15,
center: myLatlng,
scrollwheel: false,
});
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: 'Click to zoom'
});
map.addListener('center_changed', function() {
// 3 seconds after the center of the map has changed, pan back to the
// marker.
window.setTimeout(function() {
map.panTo(marker.getPosition());
}, 3000);
});
marker.addListener('click', function() {
map.setZoom(8);
map.setCenter(marker.getPosition());
});
} | 6 | 0.12766 | 3 | 3 |
3bd4f91934381d4a11da86d44f34798ef623aa9c | src/test/groovy/org/kt3k/gradle/plugin/coveralls/domain/ServiceInfoTest.groovy | src/test/groovy/org/kt3k/gradle/plugin/coveralls/domain/ServiceInfoTest.groovy | package org.kt3k.gradle.plugin.coveralls.domain
import org.junit.Test
import static org.junit.Assert.*
class ServiceInfoTest {
@Test
void testConstructor() {
ServiceInfo serviceInfo = new ServiceInfo('x-ci', '1729', 'ABCDEF')
assertNotNull serviceInfo
assertEquals 'x-ci', serviceInfo.serviceName
assertEquals '1729', serviceInfo.serviceJobId
assertEquals 'ABCDEF', serviceInfo.repoToken
}
}
| package org.kt3k.gradle.plugin.coveralls.domain
import org.junit.Test
import static org.junit.Assert.*
class ServiceInfoTest {
@Test
void testConstructor() {
ServiceInfo serviceInfo = new ServiceInfo('x-ci', '1729', 'ABCDEF')
assertNotNull serviceInfo
assertEquals 'x-ci', serviceInfo.serviceName
assertEquals '1729', serviceInfo.serviceJobId
assertEquals 'ABCDEF', serviceInfo.repoToken
}
@Test
void testEquals() {
assertEquals new ServiceInfo("a", "b", "c", "d", "e", "f"), new ServiceInfo("a", "b", "c", "d", "e", "f")
assertNotEquals new ServiceInfo("a", "b", "c", "d", "e", "f"), new ServiceInfo("_", "b", "c", "d", "e", "f")
assertNotEquals new ServiceInfo("a", "b", "c", "d", "e", "f"), new ServiceInfo("a", "_", "c", "d", "e", "f")
assertNotEquals new ServiceInfo("a", "b", "c", "d", "e", "f"), new ServiceInfo("a", "b", "_", "d", "e", "f")
assertNotEquals new ServiceInfo("a", "b", "c", "d", "e", "f"), new ServiceInfo("a", "b", "c", "_", "e", "f")
assertNotEquals new ServiceInfo("a", "b", "c", "d", "e", "f"), new ServiceInfo("a", "b", "c", "d", "_", "f")
assertNotEquals new ServiceInfo("a", "b", "c", "d", "e", "f"), new ServiceInfo("a", "b", "c", "d", "e", "_")
}
@Test
void testHashCode() {
ServiceInfo serviceInfo = new ServiceInfo("a", "b", "c", "d", "e", "f")
assertNotNull serviceInfo.hashCode()
assertTrue serviceInfo.hashCode().toString().isInteger()
}
}
| Add the tests of equals and hashCode of ServiceInfo | Add the tests of equals and hashCode of ServiceInfo
| Groovy | mit | kt3k/coveralls-gradle-plugin | groovy | ## Code Before:
package org.kt3k.gradle.plugin.coveralls.domain
import org.junit.Test
import static org.junit.Assert.*
class ServiceInfoTest {
@Test
void testConstructor() {
ServiceInfo serviceInfo = new ServiceInfo('x-ci', '1729', 'ABCDEF')
assertNotNull serviceInfo
assertEquals 'x-ci', serviceInfo.serviceName
assertEquals '1729', serviceInfo.serviceJobId
assertEquals 'ABCDEF', serviceInfo.repoToken
}
}
## Instruction:
Add the tests of equals and hashCode of ServiceInfo
## Code After:
package org.kt3k.gradle.plugin.coveralls.domain
import org.junit.Test
import static org.junit.Assert.*
class ServiceInfoTest {
@Test
void testConstructor() {
ServiceInfo serviceInfo = new ServiceInfo('x-ci', '1729', 'ABCDEF')
assertNotNull serviceInfo
assertEquals 'x-ci', serviceInfo.serviceName
assertEquals '1729', serviceInfo.serviceJobId
assertEquals 'ABCDEF', serviceInfo.repoToken
}
@Test
void testEquals() {
assertEquals new ServiceInfo("a", "b", "c", "d", "e", "f"), new ServiceInfo("a", "b", "c", "d", "e", "f")
assertNotEquals new ServiceInfo("a", "b", "c", "d", "e", "f"), new ServiceInfo("_", "b", "c", "d", "e", "f")
assertNotEquals new ServiceInfo("a", "b", "c", "d", "e", "f"), new ServiceInfo("a", "_", "c", "d", "e", "f")
assertNotEquals new ServiceInfo("a", "b", "c", "d", "e", "f"), new ServiceInfo("a", "b", "_", "d", "e", "f")
assertNotEquals new ServiceInfo("a", "b", "c", "d", "e", "f"), new ServiceInfo("a", "b", "c", "_", "e", "f")
assertNotEquals new ServiceInfo("a", "b", "c", "d", "e", "f"), new ServiceInfo("a", "b", "c", "d", "_", "f")
assertNotEquals new ServiceInfo("a", "b", "c", "d", "e", "f"), new ServiceInfo("a", "b", "c", "d", "e", "_")
}
@Test
void testHashCode() {
ServiceInfo serviceInfo = new ServiceInfo("a", "b", "c", "d", "e", "f")
assertNotNull serviceInfo.hashCode()
assertTrue serviceInfo.hashCode().toString().isInteger()
}
}
| package org.kt3k.gradle.plugin.coveralls.domain
import org.junit.Test
import static org.junit.Assert.*
class ServiceInfoTest {
@Test
void testConstructor() {
ServiceInfo serviceInfo = new ServiceInfo('x-ci', '1729', 'ABCDEF')
assertNotNull serviceInfo
assertEquals 'x-ci', serviceInfo.serviceName
assertEquals '1729', serviceInfo.serviceJobId
assertEquals 'ABCDEF', serviceInfo.repoToken
}
+
+ @Test
+ void testEquals() {
+ assertEquals new ServiceInfo("a", "b", "c", "d", "e", "f"), new ServiceInfo("a", "b", "c", "d", "e", "f")
+ assertNotEquals new ServiceInfo("a", "b", "c", "d", "e", "f"), new ServiceInfo("_", "b", "c", "d", "e", "f")
+ assertNotEquals new ServiceInfo("a", "b", "c", "d", "e", "f"), new ServiceInfo("a", "_", "c", "d", "e", "f")
+ assertNotEquals new ServiceInfo("a", "b", "c", "d", "e", "f"), new ServiceInfo("a", "b", "_", "d", "e", "f")
+ assertNotEquals new ServiceInfo("a", "b", "c", "d", "e", "f"), new ServiceInfo("a", "b", "c", "_", "e", "f")
+ assertNotEquals new ServiceInfo("a", "b", "c", "d", "e", "f"), new ServiceInfo("a", "b", "c", "d", "_", "f")
+ assertNotEquals new ServiceInfo("a", "b", "c", "d", "e", "f"), new ServiceInfo("a", "b", "c", "d", "e", "_")
+ }
+
+
+ @Test
+ void testHashCode() {
+ ServiceInfo serviceInfo = new ServiceInfo("a", "b", "c", "d", "e", "f")
+
+ assertNotNull serviceInfo.hashCode()
+ assertTrue serviceInfo.hashCode().toString().isInteger()
+ }
+
} | 21 | 1.166667 | 21 | 0 |
b8386212826701131e3c5aaaadef726df97f6646 | api/serializers.py | api/serializers.py | from __future__ import unicode_literals
from django.contrib.auth.models import User
from rest_framework import serializers
from core.models import Timesheet, Task, Entry
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('id', 'url', 'username',)
class TimesheetSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Timesheet
fields = ('id', 'url', 'name',)
class TaskSerializer(serializers.HyperlinkedModelSerializer):
timesheet_details = TimesheetSerializer(source='timesheet', read_only=True)
class Meta:
model = Task
fields = ('id', 'url', 'timesheet', 'timesheet_details', 'name',)
class EntrySerializer(serializers.HyperlinkedModelSerializer):
task_details = TaskSerializer(source='task', read_only=True)
user_details = UserSerializer(source='user', read_only=True)
class Meta:
model = Entry
fields = ('id', 'url', 'task', 'task_details', 'user', 'user_details',
'date', 'duration', 'note',)
| from __future__ import unicode_literals
from django.contrib.auth.models import User
from rest_framework import serializers
from core.models import Timesheet, Task, Entry
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('id', 'url', 'username',)
class TimesheetSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Timesheet
fields = ('id', 'url', 'name', 'complete',)
class TaskSerializer(serializers.HyperlinkedModelSerializer):
timesheet_details = TimesheetSerializer(source='timesheet', read_only=True)
class Meta:
model = Task
fields = ('id', 'url', 'timesheet', 'timesheet_details', 'name',
'complete',)
class EntrySerializer(serializers.HyperlinkedModelSerializer):
task_details = TaskSerializer(source='task', read_only=True)
user_details = UserSerializer(source='user', read_only=True)
class Meta:
model = Entry
fields = ('id', 'url', 'task', 'task_details', 'user', 'user_details',
'date', 'duration', 'note',)
| Add complete field to task and timesheet api | Add complete field to task and timesheet api
| Python | bsd-2-clause | Leahelisabeth/timestrap,overshard/timestrap,cdubz/timestrap,Leahelisabeth/timestrap,overshard/timestrap,muhleder/timestrap,Leahelisabeth/timestrap,cdubz/timestrap,overshard/timestrap,muhleder/timestrap,cdubz/timestrap,muhleder/timestrap,Leahelisabeth/timestrap | python | ## Code Before:
from __future__ import unicode_literals
from django.contrib.auth.models import User
from rest_framework import serializers
from core.models import Timesheet, Task, Entry
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('id', 'url', 'username',)
class TimesheetSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Timesheet
fields = ('id', 'url', 'name',)
class TaskSerializer(serializers.HyperlinkedModelSerializer):
timesheet_details = TimesheetSerializer(source='timesheet', read_only=True)
class Meta:
model = Task
fields = ('id', 'url', 'timesheet', 'timesheet_details', 'name',)
class EntrySerializer(serializers.HyperlinkedModelSerializer):
task_details = TaskSerializer(source='task', read_only=True)
user_details = UserSerializer(source='user', read_only=True)
class Meta:
model = Entry
fields = ('id', 'url', 'task', 'task_details', 'user', 'user_details',
'date', 'duration', 'note',)
## Instruction:
Add complete field to task and timesheet api
## Code After:
from __future__ import unicode_literals
from django.contrib.auth.models import User
from rest_framework import serializers
from core.models import Timesheet, Task, Entry
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('id', 'url', 'username',)
class TimesheetSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Timesheet
fields = ('id', 'url', 'name', 'complete',)
class TaskSerializer(serializers.HyperlinkedModelSerializer):
timesheet_details = TimesheetSerializer(source='timesheet', read_only=True)
class Meta:
model = Task
fields = ('id', 'url', 'timesheet', 'timesheet_details', 'name',
'complete',)
class EntrySerializer(serializers.HyperlinkedModelSerializer):
task_details = TaskSerializer(source='task', read_only=True)
user_details = UserSerializer(source='user', read_only=True)
class Meta:
model = Entry
fields = ('id', 'url', 'task', 'task_details', 'user', 'user_details',
'date', 'duration', 'note',)
| from __future__ import unicode_literals
from django.contrib.auth.models import User
from rest_framework import serializers
from core.models import Timesheet, Task, Entry
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('id', 'url', 'username',)
class TimesheetSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Timesheet
- fields = ('id', 'url', 'name',)
+ fields = ('id', 'url', 'name', 'complete',)
? ++++++++++++
class TaskSerializer(serializers.HyperlinkedModelSerializer):
timesheet_details = TimesheetSerializer(source='timesheet', read_only=True)
class Meta:
model = Task
- fields = ('id', 'url', 'timesheet', 'timesheet_details', 'name',)
? -
+ fields = ('id', 'url', 'timesheet', 'timesheet_details', 'name',
+ 'complete',)
class EntrySerializer(serializers.HyperlinkedModelSerializer):
task_details = TaskSerializer(source='task', read_only=True)
user_details = UserSerializer(source='user', read_only=True)
class Meta:
model = Entry
fields = ('id', 'url', 'task', 'task_details', 'user', 'user_details',
'date', 'duration', 'note',) | 5 | 0.135135 | 3 | 2 |
1cb856c12c45aa00ac297093603c5f68186f9fc6 | app/Jobs/Job.php | app/Jobs/Job.php | <?php
namespace App\Jobs;
use Illuminate\Bus\Queueable;
abstract class Job
{
/*
|--------------------------------------------------------------------------
| Queueable Jobs
|--------------------------------------------------------------------------
|
| This job base class provides a central location to place any logic that
| is shared across all of your jobs. The trait included with the class
| provides access to the "queueOn" and "delay" queue helper methods.
|
*/
use Queueable;
}
| <?php
namespace App\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
abstract class Job implements ShouldQueue
{
/*
|--------------------------------------------------------------------------
| Queueable Jobs
|--------------------------------------------------------------------------
|
| This job base class provides a central location to place any logic that
| is shared across all of your jobs. The trait included with the class
| provides access to the "queueOn" and "delay" queue helper methods.
|
*/
use Queueable;
}
| Set jobs to be queued | Set jobs to be queued
| PHP | mit | OParl/dev-website,OParl/dev-website,OParl/dev-website | php | ## Code Before:
<?php
namespace App\Jobs;
use Illuminate\Bus\Queueable;
abstract class Job
{
/*
|--------------------------------------------------------------------------
| Queueable Jobs
|--------------------------------------------------------------------------
|
| This job base class provides a central location to place any logic that
| is shared across all of your jobs. The trait included with the class
| provides access to the "queueOn" and "delay" queue helper methods.
|
*/
use Queueable;
}
## Instruction:
Set jobs to be queued
## Code After:
<?php
namespace App\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
abstract class Job implements ShouldQueue
{
/*
|--------------------------------------------------------------------------
| Queueable Jobs
|--------------------------------------------------------------------------
|
| This job base class provides a central location to place any logic that
| is shared across all of your jobs. The trait included with the class
| provides access to the "queueOn" and "delay" queue helper methods.
|
*/
use Queueable;
}
| <?php
namespace App\Jobs;
use Illuminate\Bus\Queueable;
+ use Illuminate\Contracts\Queue\ShouldQueue;
- abstract class Job
+ abstract class Job implements ShouldQueue
{
/*
|--------------------------------------------------------------------------
| Queueable Jobs
|--------------------------------------------------------------------------
|
| This job base class provides a central location to place any logic that
| is shared across all of your jobs. The trait included with the class
| provides access to the "queueOn" and "delay" queue helper methods.
|
*/
use Queueable;
} | 3 | 0.15 | 2 | 1 |
2e591f0d9a137c2d71af2d250aefc480fe255a45 | lib/brightbox-cli/commands/firewall-policies-list.rb | lib/brightbox-cli/commands/firewall-policies-list.rb | module Brightbox
desc 'List Firewall Policies'
arg_name '[firewall-policy-id...]'
command [:list] do |c|
c.action do |global_options,options,args|
if args.empty?
lbs = FirewallPolicy.find(:all)
else
lbs = FirewallPolicy.find_or_call(args) do |id|
warn "Couldn't find firewall policy #{id}"
end
end
render_table(lbs, global_options)
end
end
end
| module Brightbox
desc 'List Firewall Policies'
arg_name '[firewall-policy-id...]'
command [:list] do |c|
c.action do |global_options,options,args|
if args.empty?
firewall_policies = FirewallPolicy.find(:all)
else
firewall_policies = FirewallPolicy.find_or_call(args) do |id|
warn "Couldn't find firewall policy #{id}"
end
end
render_table(firewall_policies, global_options)
end
end
end
| Rename variable lbs to firewall_policies | Rename variable lbs to firewall_policies
| Ruby | mit | brightbox/brightbox-cli,brightbox/brightbox-cli | ruby | ## Code Before:
module Brightbox
desc 'List Firewall Policies'
arg_name '[firewall-policy-id...]'
command [:list] do |c|
c.action do |global_options,options,args|
if args.empty?
lbs = FirewallPolicy.find(:all)
else
lbs = FirewallPolicy.find_or_call(args) do |id|
warn "Couldn't find firewall policy #{id}"
end
end
render_table(lbs, global_options)
end
end
end
## Instruction:
Rename variable lbs to firewall_policies
## Code After:
module Brightbox
desc 'List Firewall Policies'
arg_name '[firewall-policy-id...]'
command [:list] do |c|
c.action do |global_options,options,args|
if args.empty?
firewall_policies = FirewallPolicy.find(:all)
else
firewall_policies = FirewallPolicy.find_or_call(args) do |id|
warn "Couldn't find firewall policy #{id}"
end
end
render_table(firewall_policies, global_options)
end
end
end
| module Brightbox
desc 'List Firewall Policies'
arg_name '[firewall-policy-id...]'
command [:list] do |c|
c.action do |global_options,options,args|
if args.empty?
- lbs = FirewallPolicy.find(:all)
? ^
+ firewall_policies = FirewallPolicy.find(:all)
? ++++++ ^^^^^^^^^
else
- lbs = FirewallPolicy.find_or_call(args) do |id|
? ^
+ firewall_policies = FirewallPolicy.find_or_call(args) do |id|
? ++++++ ^^^^^^^^^
warn "Couldn't find firewall policy #{id}"
end
end
- render_table(lbs, global_options)
? ^
+ render_table(firewall_policies, global_options)
? ++++++ ^^^^^^^^^
end
end
end | 6 | 0.333333 | 3 | 3 |
1ed492fa1aba6fce4a874a5fb5dc3e7d13fba7b2 | karma.conf.coffee | karma.conf.coffee | module.exports = (config) ->
config.set
basePath: ''
frameworks: [ 'jasmine' ]
files: [
'public/vendor/zepto-1.1.4.js'
'public/site.js'
'spec/**/*.coffee'
]
exclude: []
preprocessors: {
'**/*.coffee': ['coffee']
}
reporters: [ 'progress' ]
port: 9876
colors: true
logLevel: config.LOG_INFO
autoWatch: true
browsers: [
'Chrome'
]
singleRun: false
| module.exports = (config) ->
config.set
basePath: ''
frameworks: [ 'jasmine' ]
files: [
'public/vendor/zepto-1.1.4.js'
'spec/**/*.coffee'
]
exclude: []
preprocessors: {
'**/*.coffee': ['coffee']
}
reporters: [ 'progress' ]
port: 9876
colors: true
logLevel: config.LOG_INFO
autoWatch: true
browsers: [
'Chrome'
]
singleRun: false
| Revert "re-run tests on changes in site.js" | Revert "re-run tests on changes in site.js"
This reverts commit 89e3a3d26be72fc3d49a89fc8cbc75abf73999ce.
| CoffeeScript | mit | ePages-de/site,ePages-de/site,ePages-de/site | coffeescript | ## Code Before:
module.exports = (config) ->
config.set
basePath: ''
frameworks: [ 'jasmine' ]
files: [
'public/vendor/zepto-1.1.4.js'
'public/site.js'
'spec/**/*.coffee'
]
exclude: []
preprocessors: {
'**/*.coffee': ['coffee']
}
reporters: [ 'progress' ]
port: 9876
colors: true
logLevel: config.LOG_INFO
autoWatch: true
browsers: [
'Chrome'
]
singleRun: false
## Instruction:
Revert "re-run tests on changes in site.js"
This reverts commit 89e3a3d26be72fc3d49a89fc8cbc75abf73999ce.
## Code After:
module.exports = (config) ->
config.set
basePath: ''
frameworks: [ 'jasmine' ]
files: [
'public/vendor/zepto-1.1.4.js'
'spec/**/*.coffee'
]
exclude: []
preprocessors: {
'**/*.coffee': ['coffee']
}
reporters: [ 'progress' ]
port: 9876
colors: true
logLevel: config.LOG_INFO
autoWatch: true
browsers: [
'Chrome'
]
singleRun: false
| module.exports = (config) ->
config.set
basePath: ''
frameworks: [ 'jasmine' ]
files: [
'public/vendor/zepto-1.1.4.js'
- 'public/site.js'
'spec/**/*.coffee'
]
exclude: []
preprocessors: {
'**/*.coffee': ['coffee']
}
reporters: [ 'progress' ]
port: 9876
colors: true
logLevel: config.LOG_INFO
autoWatch: true
browsers: [
'Chrome'
]
singleRun: false | 1 | 0.045455 | 0 | 1 |
21b7c0e71afd14484adfb100d6da432ec49bb6d7 | app/src/ui/lib/bytes.ts | app/src/ui/lib/bytes.ts | import { round } from './round'
/**
* Number sign display mode
*/
export const enum Sign {
Normal,
Forced,
}
/**
* Display bytes in human readable format like:
* 23GB
* -43B
* It's also possible to force sign in order to get the
* plus sign in case of positive numbers like:
* +23GB
* -43B
*/
export const formatBytes = (
bytes: number,
signType: Sign = Sign.Normal,
decimals = 0
) => {
if (!Number.isFinite(bytes)) {
return 'Unknown'
}
const sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB']
const sizeIndex = Math.floor(Math.log(Math.abs(bytes)) / Math.log(1024))
const sign = signType === Sign.Forced && bytes > 0 ? '+' : ''
return `${sign}${value}${sizes[sizeIndex]}`
const value = round(bytes / Math.pow(1024, sizeIndex), decimals)
}
| import { round } from './round'
/**
* Number sign display mode
*/
export const enum Sign {
Normal,
Forced,
}
/**
* Display bytes in human readable format like:
* 23GB
* -43B
* It's also possible to force sign in order to get the
* plus sign in case of positive numbers like:
* +23GB
* -43B
*/
export const formatBytes = (
bytes: number,
signType: Sign = Sign.Normal,
decimals = 0
) => {
if (!Number.isFinite(bytes)) {
return 'Unknown'
}
const sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB']
const sizeIndex = Math.floor(Math.log(Math.abs(bytes)) / Math.log(1024))
const sign = signType === Sign.Forced && bytes > 0 ? '+' : ''
const value = round(bytes / Math.pow(1024, sizeIndex), decimals)
return `${sign}${value} ${sizes[sizeIndex]}`
}
| Add a space between unit and number | Add a space between unit and number
| TypeScript | mit | artivilla/desktop,artivilla/desktop,artivilla/desktop,kactus-io/kactus,artivilla/desktop,j-f1/forked-desktop,say25/desktop,j-f1/forked-desktop,desktop/desktop,kactus-io/kactus,say25/desktop,j-f1/forked-desktop,shiftkey/desktop,shiftkey/desktop,j-f1/forked-desktop,shiftkey/desktop,desktop/desktop,desktop/desktop,shiftkey/desktop,kactus-io/kactus,say25/desktop,kactus-io/kactus,desktop/desktop,say25/desktop | typescript | ## Code Before:
import { round } from './round'
/**
* Number sign display mode
*/
export const enum Sign {
Normal,
Forced,
}
/**
* Display bytes in human readable format like:
* 23GB
* -43B
* It's also possible to force sign in order to get the
* plus sign in case of positive numbers like:
* +23GB
* -43B
*/
export const formatBytes = (
bytes: number,
signType: Sign = Sign.Normal,
decimals = 0
) => {
if (!Number.isFinite(bytes)) {
return 'Unknown'
}
const sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB']
const sizeIndex = Math.floor(Math.log(Math.abs(bytes)) / Math.log(1024))
const sign = signType === Sign.Forced && bytes > 0 ? '+' : ''
return `${sign}${value}${sizes[sizeIndex]}`
const value = round(bytes / Math.pow(1024, sizeIndex), decimals)
}
## Instruction:
Add a space between unit and number
## Code After:
import { round } from './round'
/**
* Number sign display mode
*/
export const enum Sign {
Normal,
Forced,
}
/**
* Display bytes in human readable format like:
* 23GB
* -43B
* It's also possible to force sign in order to get the
* plus sign in case of positive numbers like:
* +23GB
* -43B
*/
export const formatBytes = (
bytes: number,
signType: Sign = Sign.Normal,
decimals = 0
) => {
if (!Number.isFinite(bytes)) {
return 'Unknown'
}
const sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB']
const sizeIndex = Math.floor(Math.log(Math.abs(bytes)) / Math.log(1024))
const sign = signType === Sign.Forced && bytes > 0 ? '+' : ''
const value = round(bytes / Math.pow(1024, sizeIndex), decimals)
return `${sign}${value} ${sizes[sizeIndex]}`
}
| import { round } from './round'
/**
* Number sign display mode
*/
export const enum Sign {
Normal,
Forced,
}
/**
* Display bytes in human readable format like:
* 23GB
* -43B
* It's also possible to force sign in order to get the
* plus sign in case of positive numbers like:
* +23GB
* -43B
*/
export const formatBytes = (
bytes: number,
signType: Sign = Sign.Normal,
decimals = 0
) => {
if (!Number.isFinite(bytes)) {
return 'Unknown'
}
const sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB']
const sizeIndex = Math.floor(Math.log(Math.abs(bytes)) / Math.log(1024))
const sign = signType === Sign.Forced && bytes > 0 ? '+' : ''
- return `${sign}${value}${sizes[sizeIndex]}`
const value = round(bytes / Math.pow(1024, sizeIndex), decimals)
+ return `${sign}${value} ${sizes[sizeIndex]}`
} | 2 | 0.060606 | 1 | 1 |
c35adc6fd525929ccf79c855243a4074a126c8c1 | setup/install_npm_packages.sh | setup/install_npm_packages.sh |
source ~/dotfiles/setup/header.sh
# Load in environment variables for brew, nvm, node, etc.
source ~/dotfiles/terminal/bash/exports.sh
echo "Installing npm packages..."
preload_npm_pkg_list
install_npm_pkg gulp-cli
install_npm_pkg eslint
install_npm_pkg @typescript-eslint/parser
install_npm_pkg @typescript-eslint/eslint-plugin
install_npm_pkg http-server
install_npm_pkg gatsby-cli
install_npm_pkg grunt-cli
install_npm_pkg vsce
install_npm_pkg typescript
install_npm_pkg ts-node
install_npm_pkg esbuild
install_npm_pkg npm-check-updates
install_npm_pkg netlify-cli
install_node_version 12.16.3 --reinstall-packages-from=default
|
source ~/dotfiles/setup/header.sh
# Load in environment variables for brew, nvm, node, etc.
source ~/dotfiles/terminal/bash/exports.sh
# Load nvm so that the node and npm commands are available
source ~/dotfiles/terminal/bash/load_nvm.sh
echo "Installing npm packages..."
preload_npm_pkg_list
install_npm_pkg gulp-cli
install_npm_pkg eslint
install_npm_pkg @typescript-eslint/parser
install_npm_pkg @typescript-eslint/eslint-plugin
install_npm_pkg http-server
install_npm_pkg gatsby-cli
install_npm_pkg grunt-cli
install_npm_pkg vsce
install_npm_pkg typescript
install_npm_pkg ts-node
install_npm_pkg esbuild
install_npm_pkg npm-check-updates
install_npm_pkg netlify-cli
install_node_version 12.16.3 --reinstall-packages-from=default
| Fix bug where npm package installer could not find npm | Fix bug where npm package installer could not find npm
| Shell | mit | caleb531/dotfiles,caleb531/dotfiles,caleb531/dotfiles,caleb531/dotfiles | shell | ## Code Before:
source ~/dotfiles/setup/header.sh
# Load in environment variables for brew, nvm, node, etc.
source ~/dotfiles/terminal/bash/exports.sh
echo "Installing npm packages..."
preload_npm_pkg_list
install_npm_pkg gulp-cli
install_npm_pkg eslint
install_npm_pkg @typescript-eslint/parser
install_npm_pkg @typescript-eslint/eslint-plugin
install_npm_pkg http-server
install_npm_pkg gatsby-cli
install_npm_pkg grunt-cli
install_npm_pkg vsce
install_npm_pkg typescript
install_npm_pkg ts-node
install_npm_pkg esbuild
install_npm_pkg npm-check-updates
install_npm_pkg netlify-cli
install_node_version 12.16.3 --reinstall-packages-from=default
## Instruction:
Fix bug where npm package installer could not find npm
## Code After:
source ~/dotfiles/setup/header.sh
# Load in environment variables for brew, nvm, node, etc.
source ~/dotfiles/terminal/bash/exports.sh
# Load nvm so that the node and npm commands are available
source ~/dotfiles/terminal/bash/load_nvm.sh
echo "Installing npm packages..."
preload_npm_pkg_list
install_npm_pkg gulp-cli
install_npm_pkg eslint
install_npm_pkg @typescript-eslint/parser
install_npm_pkg @typescript-eslint/eslint-plugin
install_npm_pkg http-server
install_npm_pkg gatsby-cli
install_npm_pkg grunt-cli
install_npm_pkg vsce
install_npm_pkg typescript
install_npm_pkg ts-node
install_npm_pkg esbuild
install_npm_pkg npm-check-updates
install_npm_pkg netlify-cli
install_node_version 12.16.3 --reinstall-packages-from=default
|
source ~/dotfiles/setup/header.sh
# Load in environment variables for brew, nvm, node, etc.
source ~/dotfiles/terminal/bash/exports.sh
+ # Load nvm so that the node and npm commands are available
+ source ~/dotfiles/terminal/bash/load_nvm.sh
echo "Installing npm packages..."
preload_npm_pkg_list
install_npm_pkg gulp-cli
install_npm_pkg eslint
install_npm_pkg @typescript-eslint/parser
install_npm_pkg @typescript-eslint/eslint-plugin
install_npm_pkg http-server
install_npm_pkg gatsby-cli
install_npm_pkg grunt-cli
install_npm_pkg vsce
install_npm_pkg typescript
install_npm_pkg ts-node
install_npm_pkg esbuild
install_npm_pkg npm-check-updates
install_npm_pkg netlify-cli
install_node_version 12.16.3 --reinstall-packages-from=default | 2 | 0.086957 | 2 | 0 |
efcbc34561db43aaabf53ad42aaf7f6bf462b1c7 | app/services/metrics/content_distribution_metrics.rb | app/services/metrics/content_distribution_metrics.rb | module Metrics
class ContentDistributionMetrics
def count_content_per_level
counts_by_level.each_with_index do |count, level|
Metrics.statsd.gauge("content_tagged.level_#{level + 1}", count)
end
end
def average_tagging_depth
sum = counts_by_level.sum.to_f
avg_depth = counts_by_level.to_enum.with_index(1).reduce(0.0) do |result, (count, level)|
result + (count.to_f / sum) * level
end
Metrics.statsd.gauge("average_tagging_depth", avg_depth)
end
private
def counts_by_level
@counts_by_level ||= Taxonomy::TaxonomyQuery.new.taxons_per_level.map do |taxons|
taxon_contend_ids = taxons.map { |h| h['content_id'] }
Taxonomy::TaxonomyQuery.new.content_tagged_to_taxons(taxon_contend_ids).size
end
end
end
end
| module Metrics
class ContentDistributionMetrics
def count_content_per_level
counts_by_level.each_with_index do |count, level|
Metrics.statsd.gauge("level_#{level + 1}.content_tagged", count)
end
end
def average_tagging_depth
sum = counts_by_level.sum.to_f
avg_depth = counts_by_level.to_enum.with_index(1).reduce(0.0) do |result, (count, level)|
result + (count.to_f / sum) * level
end
Metrics.statsd.gauge("average_tagging_depth", avg_depth)
end
private
def counts_by_level
@counts_by_level ||= Taxonomy::TaxonomyQuery.new.taxons_per_level.map do |taxons|
taxon_contend_ids = taxons.map { |h| h['content_id'] }
Taxonomy::TaxonomyQuery.new.content_tagged_to_taxons(taxon_contend_ids).size
end
end
end
end
| Switch around the content_tagged metrics | Switch around the content_tagged metrics
Use level_N.content_tagged, rather than content_tagged.level_N as the
former is a bit clearer.
| Ruby | mit | alphagov/content-tagger,alphagov/content-tagger,alphagov/content-tagger | ruby | ## Code Before:
module Metrics
class ContentDistributionMetrics
def count_content_per_level
counts_by_level.each_with_index do |count, level|
Metrics.statsd.gauge("content_tagged.level_#{level + 1}", count)
end
end
def average_tagging_depth
sum = counts_by_level.sum.to_f
avg_depth = counts_by_level.to_enum.with_index(1).reduce(0.0) do |result, (count, level)|
result + (count.to_f / sum) * level
end
Metrics.statsd.gauge("average_tagging_depth", avg_depth)
end
private
def counts_by_level
@counts_by_level ||= Taxonomy::TaxonomyQuery.new.taxons_per_level.map do |taxons|
taxon_contend_ids = taxons.map { |h| h['content_id'] }
Taxonomy::TaxonomyQuery.new.content_tagged_to_taxons(taxon_contend_ids).size
end
end
end
end
## Instruction:
Switch around the content_tagged metrics
Use level_N.content_tagged, rather than content_tagged.level_N as the
former is a bit clearer.
## Code After:
module Metrics
class ContentDistributionMetrics
def count_content_per_level
counts_by_level.each_with_index do |count, level|
Metrics.statsd.gauge("level_#{level + 1}.content_tagged", count)
end
end
def average_tagging_depth
sum = counts_by_level.sum.to_f
avg_depth = counts_by_level.to_enum.with_index(1).reduce(0.0) do |result, (count, level)|
result + (count.to_f / sum) * level
end
Metrics.statsd.gauge("average_tagging_depth", avg_depth)
end
private
def counts_by_level
@counts_by_level ||= Taxonomy::TaxonomyQuery.new.taxons_per_level.map do |taxons|
taxon_contend_ids = taxons.map { |h| h['content_id'] }
Taxonomy::TaxonomyQuery.new.content_tagged_to_taxons(taxon_contend_ids).size
end
end
end
end
| module Metrics
class ContentDistributionMetrics
def count_content_per_level
counts_by_level.each_with_index do |count, level|
- Metrics.statsd.gauge("content_tagged.level_#{level + 1}", count)
? ---------------
+ Metrics.statsd.gauge("level_#{level + 1}.content_tagged", count)
? +++++++++++++++
end
end
def average_tagging_depth
sum = counts_by_level.sum.to_f
avg_depth = counts_by_level.to_enum.with_index(1).reduce(0.0) do |result, (count, level)|
result + (count.to_f / sum) * level
end
Metrics.statsd.gauge("average_tagging_depth", avg_depth)
end
private
def counts_by_level
@counts_by_level ||= Taxonomy::TaxonomyQuery.new.taxons_per_level.map do |taxons|
taxon_contend_ids = taxons.map { |h| h['content_id'] }
Taxonomy::TaxonomyQuery.new.content_tagged_to_taxons(taxon_contend_ids).size
end
end
end
end | 2 | 0.076923 | 1 | 1 |
3c0a480ed3d792a77cd7747922dc03cd19b46907 | scripts/gen_sample_output.sh | scripts/gen_sample_output.sh |
set -e
JSON="${1?}"
LOGVAR="${2?}"
OUTPUT="${3?}"
ENABLE=$(grep ENABLE "${JSON?}" | sed -e 's/"//g' -e 's/ //g' -e 's/:.*//')
cp "${JSON?}" ~/.local/share/vulkan/implicit_layer.d
printf -v "${ENABLE?}" "1"
printf -v "${LOGVAR?}" "${OUTPUT?}"
export "${ENABLE?}"
export "${LOGVAR?}"
vkcube --c 10
|
set -e
JSON="${1?}"
LOGVAR="${2?}"
OUTPUT="${3?}"
ENABLE=$(jq -r '.layer.enable_environment | keys[0]' "${JSON?}")
NAME=$(jq -r .layer.name "${JSON?}")
export "${ENABLE?}"=1
export "${LOGVAR?}"="${OUTPUT?}"
export VK_LAYER_PATH=$(dirname ${JSON?})
export VK_INSTANCE_LAYERS=${NAME?}
vkcube --c 10
| Use environment variables to load the layer under test. | Use environment variables to load the layer under test.
Set VK_LAYER_PATH and VK_INSTANCE_LAYERS, instead of modifying the
user's ~/.local/share/vulkan/implicit_layer.d.
Also use jq to extract needed values from the manifest json file,
instead of regexps.
| Shell | apache-2.0 | google/vulkan-performance-layers,google/vulkan-performance-layers,google/vulkan-performance-layers | shell | ## Code Before:
set -e
JSON="${1?}"
LOGVAR="${2?}"
OUTPUT="${3?}"
ENABLE=$(grep ENABLE "${JSON?}" | sed -e 's/"//g' -e 's/ //g' -e 's/:.*//')
cp "${JSON?}" ~/.local/share/vulkan/implicit_layer.d
printf -v "${ENABLE?}" "1"
printf -v "${LOGVAR?}" "${OUTPUT?}"
export "${ENABLE?}"
export "${LOGVAR?}"
vkcube --c 10
## Instruction:
Use environment variables to load the layer under test.
Set VK_LAYER_PATH and VK_INSTANCE_LAYERS, instead of modifying the
user's ~/.local/share/vulkan/implicit_layer.d.
Also use jq to extract needed values from the manifest json file,
instead of regexps.
## Code After:
set -e
JSON="${1?}"
LOGVAR="${2?}"
OUTPUT="${3?}"
ENABLE=$(jq -r '.layer.enable_environment | keys[0]' "${JSON?}")
NAME=$(jq -r .layer.name "${JSON?}")
export "${ENABLE?}"=1
export "${LOGVAR?}"="${OUTPUT?}"
export VK_LAYER_PATH=$(dirname ${JSON?})
export VK_INSTANCE_LAYERS=${NAME?}
vkcube --c 10
|
set -e
JSON="${1?}"
LOGVAR="${2?}"
OUTPUT="${3?}"
+ ENABLE=$(jq -r '.layer.enable_environment | keys[0]' "${JSON?}")
+ NAME=$(jq -r .layer.name "${JSON?}")
+
- ENABLE=$(grep ENABLE "${JSON?}" | sed -e 's/"//g' -e 's/ //g' -e 's/:.*//')
- cp "${JSON?}" ~/.local/share/vulkan/implicit_layer.d
- printf -v "${ENABLE?}" "1"
- printf -v "${LOGVAR?}" "${OUTPUT?}"
- export "${ENABLE?}"
+ export "${ENABLE?}"=1
? ++
- export "${LOGVAR?}"
+ export "${LOGVAR?}"="${OUTPUT?}"
+ export VK_LAYER_PATH=$(dirname ${JSON?})
+ export VK_INSTANCE_LAYERS=${NAME?}
vkcube --c 10 | 13 | 0.928571 | 7 | 6 |
f4fb52f26a6a99521b2aedf80901884362389e3d | requirements_test.txt | requirements_test.txt | coverage
coveralls
django-nose
pep8==1.5.7
flake8
httpretty
mock
nose-exclude
nose-testconfig
selenium
tox
git+https://github.com/openstack/bandit.git # PyPi version is out of date
| coverage
coveralls
django-nose
pep8==1.5.7
flake8
httpretty
mock
nose-exclude
nose-testconfig
selenium
tox
bandit
| Move bandit install back to PyPi rather than using GitHub install. | Move bandit install back to PyPi rather than using GitHub install.
| Text | cc0-1.0 | eregs/regulations-site,18F/regulations-site,eregs/regulations-site,18F/regulations-site,eregs/regulations-site,18F/regulations-site,eregs/regulations-site,18F/regulations-site | text | ## Code Before:
coverage
coveralls
django-nose
pep8==1.5.7
flake8
httpretty
mock
nose-exclude
nose-testconfig
selenium
tox
git+https://github.com/openstack/bandit.git # PyPi version is out of date
## Instruction:
Move bandit install back to PyPi rather than using GitHub install.
## Code After:
coverage
coveralls
django-nose
pep8==1.5.7
flake8
httpretty
mock
nose-exclude
nose-testconfig
selenium
tox
bandit
| coverage
coveralls
django-nose
pep8==1.5.7
flake8
httpretty
mock
nose-exclude
nose-testconfig
selenium
tox
- git+https://github.com/openstack/bandit.git # PyPi version is out of date
+ bandit | 2 | 0.166667 | 1 | 1 |
3cad6c7d3da8da616c309b2583a52cc44060744f | package.json | package.json | {
"name": "@reasonml-community/react-native",
"version": "0.3.0",
"scripts": {
"build": "bsb -make-world",
"start": "bsb -make-world -w",
"clean": "bsb -clean-world",
"test": "exit 0"
},
"license": "MIT",
"keywords": [
"reason",
"reasonml",
"bucklescript",
"react-native"
],
"author": "",
"repository": {
"type": "git",
"url": "https://github.com/reasonml-community/bs-react-native.git"
},
"devDependencies": {
"bs-platform": "^2.0.0"
},
"peerDependencies": {
"reason-react": "^0.2.4",
"react-native": "^0.46.0"
}
}
| {
"name": "@reasonml-community/react-native",
"version": "0.3.0",
"scripts": {
"build": "bsb -make-world",
"start": "bsb -make-world -w",
"clean": "bsb -clean-world",
"test": "exit 0"
},
"license": "MIT",
"keywords": [
"reason",
"reasonml",
"bucklescript",
"react-native"
],
"author": "",
"repository": {
"type": "git",
"url": "https://github.com/reasonml-community/bs-react-native.git"
},
"devDependencies": {
"bs-platform": "^2.0.0",
"reason-react": "^0.2.4"
},
"peerDependencies": {
"reason-react": "^0.2.4",
"react-native": "^0.46.0"
}
}
| Add back react-reason as devDep | Add back react-reason as devDep
Otherwise, you clone the repo, do npm/yarn install and don't have the dep, so running "npm run build" fails.
That's what is happening in #98
Current master works probably because of travis cache on node_modules.
To prevent this issue not being seens, we should take a decision for a lock file. See #104 | JSON | mit | BuckleTypes/bs-react-native,reasonml-community/bs-react-native,reasonml-community/bs-react-native | json | ## Code Before:
{
"name": "@reasonml-community/react-native",
"version": "0.3.0",
"scripts": {
"build": "bsb -make-world",
"start": "bsb -make-world -w",
"clean": "bsb -clean-world",
"test": "exit 0"
},
"license": "MIT",
"keywords": [
"reason",
"reasonml",
"bucklescript",
"react-native"
],
"author": "",
"repository": {
"type": "git",
"url": "https://github.com/reasonml-community/bs-react-native.git"
},
"devDependencies": {
"bs-platform": "^2.0.0"
},
"peerDependencies": {
"reason-react": "^0.2.4",
"react-native": "^0.46.0"
}
}
## Instruction:
Add back react-reason as devDep
Otherwise, you clone the repo, do npm/yarn install and don't have the dep, so running "npm run build" fails.
That's what is happening in #98
Current master works probably because of travis cache on node_modules.
To prevent this issue not being seens, we should take a decision for a lock file. See #104
## Code After:
{
"name": "@reasonml-community/react-native",
"version": "0.3.0",
"scripts": {
"build": "bsb -make-world",
"start": "bsb -make-world -w",
"clean": "bsb -clean-world",
"test": "exit 0"
},
"license": "MIT",
"keywords": [
"reason",
"reasonml",
"bucklescript",
"react-native"
],
"author": "",
"repository": {
"type": "git",
"url": "https://github.com/reasonml-community/bs-react-native.git"
},
"devDependencies": {
"bs-platform": "^2.0.0",
"reason-react": "^0.2.4"
},
"peerDependencies": {
"reason-react": "^0.2.4",
"react-native": "^0.46.0"
}
}
| {
"name": "@reasonml-community/react-native",
"version": "0.3.0",
"scripts": {
"build": "bsb -make-world",
"start": "bsb -make-world -w",
"clean": "bsb -clean-world",
"test": "exit 0"
},
"license": "MIT",
"keywords": [
"reason",
"reasonml",
"bucklescript",
"react-native"
],
"author": "",
"repository": {
"type": "git",
"url": "https://github.com/reasonml-community/bs-react-native.git"
},
"devDependencies": {
- "bs-platform": "^2.0.0"
+ "bs-platform": "^2.0.0",
? +
+ "reason-react": "^0.2.4"
},
"peerDependencies": {
"reason-react": "^0.2.4",
"react-native": "^0.46.0"
}
} | 3 | 0.103448 | 2 | 1 |
01f704816d71288252e8ee9833ba418d8597d52c | .drone.yml | .drone.yml | build:
image: python:2.7
commands:
- sleep 5
- pip install -r requirements.txt
- pip install .
- nosetests -v
compose:
postgres:
image: postgres:9.4
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
| build:
image: python:2.7
commands:
- sleep 5
- mkdir /test
- pip install -r requirements.txt
- pip install .
- nosetests -v
compose:
postgres:
image: postgres:9.4
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
| Make test dir for output file | Make test dir for output file
| YAML | mit | vokal/pg-table-markdown,projectweekend/pg-table-markdown | yaml | ## Code Before:
build:
image: python:2.7
commands:
- sleep 5
- pip install -r requirements.txt
- pip install .
- nosetests -v
compose:
postgres:
image: postgres:9.4
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
## Instruction:
Make test dir for output file
## Code After:
build:
image: python:2.7
commands:
- sleep 5
- mkdir /test
- pip install -r requirements.txt
- pip install .
- nosetests -v
compose:
postgres:
image: postgres:9.4
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
| build:
image: python:2.7
commands:
- sleep 5
+ - mkdir /test
- pip install -r requirements.txt
- pip install .
- nosetests -v
compose:
postgres:
image: postgres:9.4
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres | 1 | 0.076923 | 1 | 0 |
57f5a406fa214b4e5c9447436417cc4814742bcd | nanoislands.styl | nanoislands.styl | @import "vars/colors.styl"
@import "vars/layout.styl"
@import "blocks/button/button.styl"
@import "blocks/popup/popup.styl"
@import "blocks/radio-button/radio-button.styl"
@import "blocks/select/select.styl"
@import "blocks/checkbox/checkbox.styl"
@import "blocks/icon/icon.styl"
IMG
border: 0;
._hidden
display: none !important
._link
color: #22C
cursor: pointer
transition: color .15s ease-out
a._link
text-decoration: none
._link:hover
color: #D00
._link_outer
color: #070
| @import "vars/colors.styl"
@import "vars/layout.styl"
@import "blocks/button/button.styl"
@import "blocks/popup/popup.styl"
@import "blocks/radio-button/radio-button.styl"
@import "blocks/select/select.styl"
@import "blocks/checkbox/checkbox.styl"
@import "blocks/icon/icon.styl"
IMG
border: 0;
._hidden
display: none;
._link
color: #22C
cursor: pointer
transition: color .15s ease-out
a._link
text-decoration: none
._link:hover
color: #D00
._link_outer
color: #070
| Revert "Hidden class is more important" | Revert "Hidden class is more important"
This reverts commit 3740cc4701e584dbf23461bc75b7702ba1857c3a.
| Stylus | mit | yandex-ui/nanoislands,yandex-ui/nanoislands,iEgit/nanoislands,iEgit/nanoislands | stylus | ## Code Before:
@import "vars/colors.styl"
@import "vars/layout.styl"
@import "blocks/button/button.styl"
@import "blocks/popup/popup.styl"
@import "blocks/radio-button/radio-button.styl"
@import "blocks/select/select.styl"
@import "blocks/checkbox/checkbox.styl"
@import "blocks/icon/icon.styl"
IMG
border: 0;
._hidden
display: none !important
._link
color: #22C
cursor: pointer
transition: color .15s ease-out
a._link
text-decoration: none
._link:hover
color: #D00
._link_outer
color: #070
## Instruction:
Revert "Hidden class is more important"
This reverts commit 3740cc4701e584dbf23461bc75b7702ba1857c3a.
## Code After:
@import "vars/colors.styl"
@import "vars/layout.styl"
@import "blocks/button/button.styl"
@import "blocks/popup/popup.styl"
@import "blocks/radio-button/radio-button.styl"
@import "blocks/select/select.styl"
@import "blocks/checkbox/checkbox.styl"
@import "blocks/icon/icon.styl"
IMG
border: 0;
._hidden
display: none;
._link
color: #22C
cursor: pointer
transition: color .15s ease-out
a._link
text-decoration: none
._link:hover
color: #D00
._link_outer
color: #070
| @import "vars/colors.styl"
@import "vars/layout.styl"
@import "blocks/button/button.styl"
@import "blocks/popup/popup.styl"
@import "blocks/radio-button/radio-button.styl"
@import "blocks/select/select.styl"
@import "blocks/checkbox/checkbox.styl"
@import "blocks/icon/icon.styl"
IMG
border: 0;
._hidden
- display: none !important
+ display: none;
+
._link
color: #22C
cursor: pointer
transition: color .15s ease-out
a._link
text-decoration: none
._link:hover
color: #D00
._link_outer
color: #070 | 3 | 0.1 | 2 | 1 |
ac931b6cbe658281fbdd5aa0864ad052cfc9194e | tests/Domain/Stock/StockTest.php | tests/Domain/Stock/StockTest.php | <?php
namespace MageTitans\Workshop\Domain\Stock;
use PHPUnit\Framework\TestCase;
final class StockTest extends TestCase
{
public function testGetInStock()
{
$stock = new Stock(
false,
0
);
$this->assertFalse($stock->getInStock());
}
} | <?php
namespace MageTitans\Workshop\Domain\Stock;
use PHPUnit\Framework\TestCase;
final class StockTest extends TestCase
{
/**
* @dataProvider getInStockProvider
*/
public function testGetInStock($inStock, $expectedInStock)
{
$stock = new Stock(
$inStock,
100
);
$this->assertEquals($expectedInStock, $stock->getInStock());
}
public function getInStockProvider()
{
return [
[true, true],
[false, false],
[1, 1],
[0, 0]
];
}
/**
* @dataProvider getStockLevelProvider
*/
public function testGetStockLevel($stockLevel, $expectedStockLevel)
{
$stock = new Stock(
true,
$stockLevel
);
$this->assertEquals($expectedStockLevel, $stock->getStockLevel());
}
public function getStockLevelProvider()
{
return [
[300, 300],
[20, 20],
[0, 0],
[5, 5]
];
}
} | Test both functions in the stock object | Test both functions in the stock object
| PHP | mit | dmanners/mage-titans-it | php | ## Code Before:
<?php
namespace MageTitans\Workshop\Domain\Stock;
use PHPUnit\Framework\TestCase;
final class StockTest extends TestCase
{
public function testGetInStock()
{
$stock = new Stock(
false,
0
);
$this->assertFalse($stock->getInStock());
}
}
## Instruction:
Test both functions in the stock object
## Code After:
<?php
namespace MageTitans\Workshop\Domain\Stock;
use PHPUnit\Framework\TestCase;
final class StockTest extends TestCase
{
/**
* @dataProvider getInStockProvider
*/
public function testGetInStock($inStock, $expectedInStock)
{
$stock = new Stock(
$inStock,
100
);
$this->assertEquals($expectedInStock, $stock->getInStock());
}
public function getInStockProvider()
{
return [
[true, true],
[false, false],
[1, 1],
[0, 0]
];
}
/**
* @dataProvider getStockLevelProvider
*/
public function testGetStockLevel($stockLevel, $expectedStockLevel)
{
$stock = new Stock(
true,
$stockLevel
);
$this->assertEquals($expectedStockLevel, $stock->getStockLevel());
}
public function getStockLevelProvider()
{
return [
[300, 300],
[20, 20],
[0, 0],
[5, 5]
];
}
} | <?php
namespace MageTitans\Workshop\Domain\Stock;
use PHPUnit\Framework\TestCase;
final class StockTest extends TestCase
{
- public function testGetInStock()
+ /**
+ * @dataProvider getInStockProvider
+ */
+ public function testGetInStock($inStock, $expectedInStock)
{
$stock = new Stock(
- false,
+ $inStock,
- 0
+ 100
? + +
);
- $this->assertFalse($stock->getInStock());
? ^ ^
+ $this->assertEquals($expectedInStock, $stock->getInStock());
? ^^^ ++ ^^^^^^^^^^^^^^^^
+ }
+
+ public function getInStockProvider()
+ {
+ return [
+ [true, true],
+ [false, false],
+ [1, 1],
+ [0, 0]
+ ];
+ }
+
+ /**
+ * @dataProvider getStockLevelProvider
+ */
+ public function testGetStockLevel($stockLevel, $expectedStockLevel)
+ {
+ $stock = new Stock(
+ true,
+ $stockLevel
+ );
+ $this->assertEquals($expectedStockLevel, $stock->getStockLevel());
+ }
+
+ public function getStockLevelProvider()
+ {
+ return [
+ [300, 300],
+ [20, 20],
+ [0, 0],
+ [5, 5]
+ ];
}
} | 43 | 2.529412 | 39 | 4 |
52151abd6e7a779d938cb299f55b89cef5f008a2 | rfid.rb | rfid.rb | require 'revdev'
require 'pry'
LEFT_SHIFT = 42
ENTER = 28
KEYPRESS = :EV_KEY
KEYDOWN = 1
TIME_FORMAT = '%d.%m.%y %H:%M:%S'
def line_format(buffer)
"#{buffer}; #{Time.now.strftime(TIME_FORMAT)}\n"
end
def key_value(input)
input.hr_code.to_s.gsub('KEY_','')
end
def read_loop(evdev, file)
p "Listening on #{evdev.file.path}, writing to #{file.path} ... "
buffer = ''
loop do
input = evdev.read_input_event
if KEYPRESS == input.hr_type && KEYDOWN == input.value
case input.code
when LEFT_SHIFT
buffer = ''
when ENTER
line = line_format(buffer)
file << line
p "WRITE: #{line}"
else
buffer << key_value(input)
end
end
end
end
def main
include Revdev
evdev = EventDevice.new('/dev/input/event22')
evdev.grab
file = File.open('checkpoint_0.txt','at')
file.sync = true
trap "INT" do
puts "# recieved :INT - exiting!"
evdev.ungrab
file.close
exit true
end
read_loop(evdev, file)
end
main | require 'revdev'
require 'pry'
require "optparse"
USAGE=<<__EOF
usage:
ruby #{$0} event_device output_file
read from event_device and output to file
example:
#{$0} /dev/input/event5 /var/www/nginx/serve/file.txt
__EOF
LEFT_SHIFT = 42
ENTER = 28
KEYPRESS = :EV_KEY
KEYDOWN = 1
TIME_FORMAT = '%d.%m.%y %H:%M:%S'
def line_format(buffer)
"#{buffer}; #{Time.now.strftime(TIME_FORMAT)}\n"
end
def key_value(input)
input.hr_code.to_s.gsub('KEY_','')
end
def read_loop(evdev, file)
p "Listening on #{evdev.file.path}, writing to #{file.path} ... "
buffer = ''
loop do
input = evdev.read_input_event
if KEYPRESS == input.hr_type && KEYDOWN == input.value
case input.code
when LEFT_SHIFT
buffer = ''
when ENTER
line = line_format(buffer)
file << line
p "WRITE: #{line}"
else
buffer << key_value(input)
end
end
end
end
def main
include Revdev
STDOUT.sync = true
if ARGV.length == 0
puts USAGE
exit false
end
evdev = EventDevice.new(ARGV[0])
evdev.grab
file = File.open(ARGV[1],'at')
file.sync = true
trap "INT" do
puts "# recieved :INT - exiting!"
evdev.ungrab
file.close
exit true
end
read_loop(evdev, file)
end
main | Make the script work with arguments | Make the script work with arguments
| Ruby | mit | bikezilla/24hMTB_rfid,bikezilla/24hMTB_rfid | ruby | ## Code Before:
require 'revdev'
require 'pry'
LEFT_SHIFT = 42
ENTER = 28
KEYPRESS = :EV_KEY
KEYDOWN = 1
TIME_FORMAT = '%d.%m.%y %H:%M:%S'
def line_format(buffer)
"#{buffer}; #{Time.now.strftime(TIME_FORMAT)}\n"
end
def key_value(input)
input.hr_code.to_s.gsub('KEY_','')
end
def read_loop(evdev, file)
p "Listening on #{evdev.file.path}, writing to #{file.path} ... "
buffer = ''
loop do
input = evdev.read_input_event
if KEYPRESS == input.hr_type && KEYDOWN == input.value
case input.code
when LEFT_SHIFT
buffer = ''
when ENTER
line = line_format(buffer)
file << line
p "WRITE: #{line}"
else
buffer << key_value(input)
end
end
end
end
def main
include Revdev
evdev = EventDevice.new('/dev/input/event22')
evdev.grab
file = File.open('checkpoint_0.txt','at')
file.sync = true
trap "INT" do
puts "# recieved :INT - exiting!"
evdev.ungrab
file.close
exit true
end
read_loop(evdev, file)
end
main
## Instruction:
Make the script work with arguments
## Code After:
require 'revdev'
require 'pry'
require "optparse"
USAGE=<<__EOF
usage:
ruby #{$0} event_device output_file
read from event_device and output to file
example:
#{$0} /dev/input/event5 /var/www/nginx/serve/file.txt
__EOF
LEFT_SHIFT = 42
ENTER = 28
KEYPRESS = :EV_KEY
KEYDOWN = 1
TIME_FORMAT = '%d.%m.%y %H:%M:%S'
def line_format(buffer)
"#{buffer}; #{Time.now.strftime(TIME_FORMAT)}\n"
end
def key_value(input)
input.hr_code.to_s.gsub('KEY_','')
end
def read_loop(evdev, file)
p "Listening on #{evdev.file.path}, writing to #{file.path} ... "
buffer = ''
loop do
input = evdev.read_input_event
if KEYPRESS == input.hr_type && KEYDOWN == input.value
case input.code
when LEFT_SHIFT
buffer = ''
when ENTER
line = line_format(buffer)
file << line
p "WRITE: #{line}"
else
buffer << key_value(input)
end
end
end
end
def main
include Revdev
STDOUT.sync = true
if ARGV.length == 0
puts USAGE
exit false
end
evdev = EventDevice.new(ARGV[0])
evdev.grab
file = File.open(ARGV[1],'at')
file.sync = true
trap "INT" do
puts "# recieved :INT - exiting!"
evdev.ungrab
file.close
exit true
end
read_loop(evdev, file)
end
main | require 'revdev'
require 'pry'
+ require "optparse"
+
+ USAGE=<<__EOF
+ usage:
+ ruby #{$0} event_device output_file
+
+ read from event_device and output to file
+
+ example:
+ #{$0} /dev/input/event5 /var/www/nginx/serve/file.txt
+ __EOF
LEFT_SHIFT = 42
ENTER = 28
KEYPRESS = :EV_KEY
KEYDOWN = 1
TIME_FORMAT = '%d.%m.%y %H:%M:%S'
def line_format(buffer)
"#{buffer}; #{Time.now.strftime(TIME_FORMAT)}\n"
end
def key_value(input)
input.hr_code.to_s.gsub('KEY_','')
end
def read_loop(evdev, file)
p "Listening on #{evdev.file.path}, writing to #{file.path} ... "
buffer = ''
loop do
input = evdev.read_input_event
if KEYPRESS == input.hr_type && KEYDOWN == input.value
case input.code
when LEFT_SHIFT
buffer = ''
when ENTER
line = line_format(buffer)
file << line
p "WRITE: #{line}"
else
buffer << key_value(input)
end
end
end
end
def main
include Revdev
+ STDOUT.sync = true
- evdev = EventDevice.new('/dev/input/event22')
+ if ARGV.length == 0
+ puts USAGE
+ exit false
+ end
+
+ evdev = EventDevice.new(ARGV[0])
evdev.grab
- file = File.open('checkpoint_0.txt','at')
+ file = File.open(ARGV[1],'at')
file.sync = true
trap "INT" do
puts "# recieved :INT - exiting!"
evdev.ungrab
file.close
exit true
end
read_loop(evdev, file)
end
main | 21 | 0.344262 | 19 | 2 |
09a3b79f4c98a5f608b8309383f9ffc25a1aefb9 | src/main/java/infra/config/WebMvcConfig.java | src/main/java/infra/config/WebMvcConfig.java | package infra.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
@Configuration
@EnableWebMvc
public class WebMvcConfig extends WebMvcConfigurerAdapter {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/**").addResourceLocations("/static/app/");
}
}
| package infra.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.mvc.WebContentInterceptor;
@Configuration
@EnableWebMvc
public class WebMvcConfig extends WebMvcConfigurerAdapter {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/**").addResourceLocations("/static/app/");
}
@Bean
public WebContentInterceptor webContentInterceptor() {
WebContentInterceptor interceptor = new WebContentInterceptor();
interceptor.setUseCacheControlHeader(true);
interceptor.setUseExpiresHeader(true);
interceptor.setCacheSeconds(31556926);
return interceptor;
}
}
| Add WebContentInterceptor in Spring MVC config | Add WebContentInterceptor in Spring MVC config
| Java | apache-2.0 | AgileSpirit/SmartSession,AgileSpirit/SmartSession | java | ## Code Before:
package infra.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
@Configuration
@EnableWebMvc
public class WebMvcConfig extends WebMvcConfigurerAdapter {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/**").addResourceLocations("/static/app/");
}
}
## Instruction:
Add WebContentInterceptor in Spring MVC config
## Code After:
package infra.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.mvc.WebContentInterceptor;
@Configuration
@EnableWebMvc
public class WebMvcConfig extends WebMvcConfigurerAdapter {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/**").addResourceLocations("/static/app/");
}
@Bean
public WebContentInterceptor webContentInterceptor() {
WebContentInterceptor interceptor = new WebContentInterceptor();
interceptor.setUseCacheControlHeader(true);
interceptor.setUseExpiresHeader(true);
interceptor.setCacheSeconds(31556926);
return interceptor;
}
}
| package infra.config;
+ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+ import org.springframework.web.servlet.mvc.WebContentInterceptor;
@Configuration
@EnableWebMvc
public class WebMvcConfig extends WebMvcConfigurerAdapter {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/**").addResourceLocations("/static/app/");
}
+ @Bean
+ public WebContentInterceptor webContentInterceptor() {
+ WebContentInterceptor interceptor = new WebContentInterceptor();
+ interceptor.setUseCacheControlHeader(true);
+ interceptor.setUseExpiresHeader(true);
+ interceptor.setCacheSeconds(31556926);
+ return interceptor;
+ }
+
} | 11 | 0.647059 | 11 | 0 |
2aef0de4cbf54e19148900b8e046a5a076ccb854 | .gitlab-ci.yml | .gitlab-ci.yml | image: ubuntu:14.04
before_script:
- apt-get update -y
- apt-get -y install gcc-mingw-w64 python cmake libxi-dev g++ libgl1-mesa-dev libglu1-mesa-dev zip git golang
- mkdir -p /data/gopath
- GOPATH=/data/gopath go get github.com/c4milo/github-release
stages:
- build
build:
stage: build
script:
- cd linux_out
- ./build
- cd ../x86_64-w64-mingw32_out
- ./build
- cd ..
- mkdir -p out/bin/Linux
- cp $(find linux_out/install -type f) out/bin/Linux/
- mkdir -p out/bin/Windows
- cp $(find x86_64-w64-mingw32_out/install -type f) out/bin/Windows/
- cd out
- zip get_image.zip $(find . -type f)
- GOPATH=/data/gopath PATH=/data/gopath/bin:$PATH GITHUB_TOKEN=$GITHUB_RELEASES_API_KEY github-release paulthomson/get-image v-${CI_BUILD_REF} ${CI_BUILD_REF} $(echo -e "Automated build.\n$(git log --graph -n 3 --abbrev-commit --pretty='format:%h - %s <%an>')")
| image: ubuntu:14.04
before_script:
- apt-get update -y
- apt-get -y install gcc-mingw-w64 python cmake libxi-dev g++ libgl1-mesa-dev libglu1-mesa-dev zip git golang
- mkdir -p /data/gopath
- GOPATH=/data/gopath go get github.com/c4milo/github-release
stages:
- build
build:
stage: build
script:
- cd linux_out
- ./build
- cd ../x86_64-w64-mingw32_out
- ./build
- cd ..
- mkdir -p out/bin/Linux
- cp $(find linux_out/install -type f) out/bin/Linux/
- mkdir -p out/bin/Windows
- cp $(find x86_64-w64-mingw32_out/install -type f) out/bin/Windows/
- cd out
- zip get_image.zip $(find . -type f)
- GOPATH=/data/gopath PATH=/data/gopath/bin:$PATH GITHUB_TOKEN=$GITHUB_RELEASES_API_KEY github-release paulthomson/get-image v-${CI_BUILD_REF} ${CI_BUILD_REF} "$(echo -e "Automated build.\n$(git log --graph -n 3 --abbrev-commit --pretty='format:%h - %s <%an>')")" get_image.zip
| Fix message and files uploaded. | Ci: Fix message and files uploaded.
| YAML | mit | paulthomson/get-image,paulthomson/get-image | yaml | ## Code Before:
image: ubuntu:14.04
before_script:
- apt-get update -y
- apt-get -y install gcc-mingw-w64 python cmake libxi-dev g++ libgl1-mesa-dev libglu1-mesa-dev zip git golang
- mkdir -p /data/gopath
- GOPATH=/data/gopath go get github.com/c4milo/github-release
stages:
- build
build:
stage: build
script:
- cd linux_out
- ./build
- cd ../x86_64-w64-mingw32_out
- ./build
- cd ..
- mkdir -p out/bin/Linux
- cp $(find linux_out/install -type f) out/bin/Linux/
- mkdir -p out/bin/Windows
- cp $(find x86_64-w64-mingw32_out/install -type f) out/bin/Windows/
- cd out
- zip get_image.zip $(find . -type f)
- GOPATH=/data/gopath PATH=/data/gopath/bin:$PATH GITHUB_TOKEN=$GITHUB_RELEASES_API_KEY github-release paulthomson/get-image v-${CI_BUILD_REF} ${CI_BUILD_REF} $(echo -e "Automated build.\n$(git log --graph -n 3 --abbrev-commit --pretty='format:%h - %s <%an>')")
## Instruction:
Ci: Fix message and files uploaded.
## Code After:
image: ubuntu:14.04
before_script:
- apt-get update -y
- apt-get -y install gcc-mingw-w64 python cmake libxi-dev g++ libgl1-mesa-dev libglu1-mesa-dev zip git golang
- mkdir -p /data/gopath
- GOPATH=/data/gopath go get github.com/c4milo/github-release
stages:
- build
build:
stage: build
script:
- cd linux_out
- ./build
- cd ../x86_64-w64-mingw32_out
- ./build
- cd ..
- mkdir -p out/bin/Linux
- cp $(find linux_out/install -type f) out/bin/Linux/
- mkdir -p out/bin/Windows
- cp $(find x86_64-w64-mingw32_out/install -type f) out/bin/Windows/
- cd out
- zip get_image.zip $(find . -type f)
- GOPATH=/data/gopath PATH=/data/gopath/bin:$PATH GITHUB_TOKEN=$GITHUB_RELEASES_API_KEY github-release paulthomson/get-image v-${CI_BUILD_REF} ${CI_BUILD_REF} "$(echo -e "Automated build.\n$(git log --graph -n 3 --abbrev-commit --pretty='format:%h - %s <%an>')")" get_image.zip
| image: ubuntu:14.04
before_script:
- apt-get update -y
- apt-get -y install gcc-mingw-w64 python cmake libxi-dev g++ libgl1-mesa-dev libglu1-mesa-dev zip git golang
- mkdir -p /data/gopath
- GOPATH=/data/gopath go get github.com/c4milo/github-release
stages:
- build
build:
stage: build
script:
- cd linux_out
- ./build
- cd ../x86_64-w64-mingw32_out
- ./build
- cd ..
- mkdir -p out/bin/Linux
- cp $(find linux_out/install -type f) out/bin/Linux/
- mkdir -p out/bin/Windows
- cp $(find x86_64-w64-mingw32_out/install -type f) out/bin/Windows/
- cd out
- zip get_image.zip $(find . -type f)
- - GOPATH=/data/gopath PATH=/data/gopath/bin:$PATH GITHUB_TOKEN=$GITHUB_RELEASES_API_KEY github-release paulthomson/get-image v-${CI_BUILD_REF} ${CI_BUILD_REF} $(echo -e "Automated build.\n$(git log --graph -n 3 --abbrev-commit --pretty='format:%h - %s <%an>')")
+ - GOPATH=/data/gopath PATH=/data/gopath/bin:$PATH GITHUB_TOKEN=$GITHUB_RELEASES_API_KEY github-release paulthomson/get-image v-${CI_BUILD_REF} ${CI_BUILD_REF} "$(echo -e "Automated build.\n$(git log --graph -n 3 --abbrev-commit --pretty='format:%h - %s <%an>')")" get_image.zip
? + +++++++++++++++
| 2 | 0.074074 | 1 | 1 |
a80b3a719cb92e8e896df3d3d83e853db8e98c60 | lib/tasks/travis.rake | lib/tasks/travis.rake | task :travis => %w[check db:drop db:migrate spec:all js:test js:lint spec:coverage:ensure]
| task :travis => %w[
check
db:drop
db:migrate
tmp:create
spec:all
js:test
js:lint
spec:coverage:ensure
]
| Create tmp dirs on Travis. | Create tmp dirs on Travis.
| Ruby | bsd-3-clause | holderdeord/hdo-site,holderdeord/hdo-site,holderdeord/hdo-site,holderdeord/hdo-site | ruby | ## Code Before:
task :travis => %w[check db:drop db:migrate spec:all js:test js:lint spec:coverage:ensure]
## Instruction:
Create tmp dirs on Travis.
## Code After:
task :travis => %w[
check
db:drop
db:migrate
tmp:create
spec:all
js:test
js:lint
spec:coverage:ensure
]
| - task :travis => %w[check db:drop db:migrate spec:all js:test js:lint spec:coverage:ensure]
+ task :travis => %w[
+ check
+ db:drop
+ db:migrate
+ tmp:create
+ spec:all
+ js:test
+ js:lint
+ spec:coverage:ensure
+ ]
| 11 | 5.5 | 10 | 1 |
0c4d4ba31c95d41d8d51f78f9e77f64f9672ecc0 | app/views/events/_podium_category.html.erb | app/views/events/_podium_category.html.erb | <div class="podium-category">
<thead>
<tr>
<th><%= category.name %></th>
<th>Name</th>
<th>Category</th>
<th>From</th>
</tr>
</thead>
<tbody>
<% if category.efforts.present? %>
<% category.efforts.each_with_index do |effort, i| %>
<tr>
<td><%= (i + 1).ordinalize %></td>
<td><%= effort.full_name %></td>
<td><%= effort.bio_historic %></td>
<td><%= effort.flexible_geolocation %></td>
</tr>
<% end %>
<% else %>
<tr><td></td><td><strong>[No efforts in this category]</strong></td></tr>
<% end %>
<tr>
<td><br/></td>
</tr>
</tbody>
</div>
| <div class="podium-category">
<thead>
<tr>
<th><%= category.name %></th>
<th>Time</th>
<th>Name</th>
<th>Category</th>
<th>From</th>
</tr>
</thead>
<tbody>
<% if category.efforts.present? %>
<% category.efforts.each_with_index do |effort, i| %>
<tr>
<td><%= (i + 1).ordinalize %></td>
<td><%= time_format_hhmmss(effort.final_time) %></td>
<td><%= effort.full_name %></td>
<td><%= effort.bio_historic %></td>
<td><%= effort.flexible_geolocation %></td>
</tr>
<% end %>
<% else %>
<tr><td></td><td></td><td><strong>[Empty category]</strong></td></tr>
<% end %>
<tr>
<td><br/></td>
</tr>
</tbody>
</div>
| Add Time column to events/podium view. | Add Time column to events/podium view.
| HTML+ERB | mit | SplitTime/OpenSplitTime,SplitTime/OpenSplitTime,SplitTime/OpenSplitTime | html+erb | ## Code Before:
<div class="podium-category">
<thead>
<tr>
<th><%= category.name %></th>
<th>Name</th>
<th>Category</th>
<th>From</th>
</tr>
</thead>
<tbody>
<% if category.efforts.present? %>
<% category.efforts.each_with_index do |effort, i| %>
<tr>
<td><%= (i + 1).ordinalize %></td>
<td><%= effort.full_name %></td>
<td><%= effort.bio_historic %></td>
<td><%= effort.flexible_geolocation %></td>
</tr>
<% end %>
<% else %>
<tr><td></td><td><strong>[No efforts in this category]</strong></td></tr>
<% end %>
<tr>
<td><br/></td>
</tr>
</tbody>
</div>
## Instruction:
Add Time column to events/podium view.
## Code After:
<div class="podium-category">
<thead>
<tr>
<th><%= category.name %></th>
<th>Time</th>
<th>Name</th>
<th>Category</th>
<th>From</th>
</tr>
</thead>
<tbody>
<% if category.efforts.present? %>
<% category.efforts.each_with_index do |effort, i| %>
<tr>
<td><%= (i + 1).ordinalize %></td>
<td><%= time_format_hhmmss(effort.final_time) %></td>
<td><%= effort.full_name %></td>
<td><%= effort.bio_historic %></td>
<td><%= effort.flexible_geolocation %></td>
</tr>
<% end %>
<% else %>
<tr><td></td><td></td><td><strong>[Empty category]</strong></td></tr>
<% end %>
<tr>
<td><br/></td>
</tr>
</tbody>
</div>
| <div class="podium-category">
<thead>
<tr>
<th><%= category.name %></th>
+ <th>Time</th>
<th>Name</th>
<th>Category</th>
<th>From</th>
</tr>
</thead>
<tbody>
<% if category.efforts.present? %>
<% category.efforts.each_with_index do |effort, i| %>
<tr>
<td><%= (i + 1).ordinalize %></td>
+ <td><%= time_format_hhmmss(effort.final_time) %></td>
<td><%= effort.full_name %></td>
<td><%= effort.bio_historic %></td>
<td><%= effort.flexible_geolocation %></td>
</tr>
<% end %>
<% else %>
- <tr><td></td><td><strong>[No efforts in this category]</strong></td></tr>
? ^^^^^^^^ ^^^^^^^^^
+ <tr><td></td><td></td><td><strong>[Empty category]</strong></td></tr>
? +++++++++ ^^^ ^
<% end %>
<tr>
<td><br/></td>
</tr>
</tbody>
</div> | 4 | 0.148148 | 3 | 1 |
cc5e5a5dea8dcc7aef730b08aa29e4c4381b7933 | lib/tasks/panopticon.rake | lib/tasks/panopticon.rake | require 'ostruct'
namespace :panopticon do
desc "Register application metadata with panopticon"
task :register => :environment do
require 'gds_api/panopticon'
logger = GdsApi::Base.logger = Logger.new(STDERR).tap { |l| l.level = Logger::INFO }
logger.info "Registering with panopticon..."
registerer = GdsApi::Panopticon::Registerer.new(owning_app: "businesssupportfinder")
record = OpenStruct.new(
slug: APP_SLUG,
title: "Business finance and support finder",
description: "Find business finance, support, grants and loans backed by the government.",
need_id: "B1017",
prefixes: [APP_SLUG],
state: "live",
indexable_content: "Business finance and support finder")
registerer.register(record)
end
end
| require 'ostruct'
namespace :panopticon do
desc "Register application metadata with panopticon"
task :register => :environment do
require 'gds_api/panopticon'
logger = GdsApi::Base.logger = Logger.new(STDERR).tap { |l| l.level = Logger::INFO }
logger.info "Registering with panopticon..."
registerer = GdsApi::Panopticon::Registerer.new(owning_app: "businesssupportfinder")
record = OpenStruct.new(
slug: APP_SLUG,
title: "Business finance and support finder",
description: "Find business finance, support, grants and loans backed by the government.",
need_id: "B1017",
paths: [],
prefixes: ["/#{APP_SLUG}"],
state: "live",
indexable_content: "Business finance and support finder")
registerer.register(record)
end
end
| Update registered routes to match new scheme. | Update registered routes to match new scheme.
They should now be full paths, not just slugs.
| Ruby | mit | alphagov/business-support-finder,alphagov/business-support-finder,alphagov/business-support-finder,alphagov/business-support-finder | ruby | ## Code Before:
require 'ostruct'
namespace :panopticon do
desc "Register application metadata with panopticon"
task :register => :environment do
require 'gds_api/panopticon'
logger = GdsApi::Base.logger = Logger.new(STDERR).tap { |l| l.level = Logger::INFO }
logger.info "Registering with panopticon..."
registerer = GdsApi::Panopticon::Registerer.new(owning_app: "businesssupportfinder")
record = OpenStruct.new(
slug: APP_SLUG,
title: "Business finance and support finder",
description: "Find business finance, support, grants and loans backed by the government.",
need_id: "B1017",
prefixes: [APP_SLUG],
state: "live",
indexable_content: "Business finance and support finder")
registerer.register(record)
end
end
## Instruction:
Update registered routes to match new scheme.
They should now be full paths, not just slugs.
## Code After:
require 'ostruct'
namespace :panopticon do
desc "Register application metadata with panopticon"
task :register => :environment do
require 'gds_api/panopticon'
logger = GdsApi::Base.logger = Logger.new(STDERR).tap { |l| l.level = Logger::INFO }
logger.info "Registering with panopticon..."
registerer = GdsApi::Panopticon::Registerer.new(owning_app: "businesssupportfinder")
record = OpenStruct.new(
slug: APP_SLUG,
title: "Business finance and support finder",
description: "Find business finance, support, grants and loans backed by the government.",
need_id: "B1017",
paths: [],
prefixes: ["/#{APP_SLUG}"],
state: "live",
indexable_content: "Business finance and support finder")
registerer.register(record)
end
end
| require 'ostruct'
namespace :panopticon do
desc "Register application metadata with panopticon"
task :register => :environment do
require 'gds_api/panopticon'
logger = GdsApi::Base.logger = Logger.new(STDERR).tap { |l| l.level = Logger::INFO }
logger.info "Registering with panopticon..."
registerer = GdsApi::Panopticon::Registerer.new(owning_app: "businesssupportfinder")
record = OpenStruct.new(
slug: APP_SLUG,
title: "Business finance and support finder",
description: "Find business finance, support, grants and loans backed by the government.",
need_id: "B1017",
+ paths: [],
- prefixes: [APP_SLUG],
+ prefixes: ["/#{APP_SLUG}"],
? ++++ ++
state: "live",
indexable_content: "Business finance and support finder")
registerer.register(record)
end
end | 3 | 0.136364 | 2 | 1 |
321a821db88cf08888f8e03cb2fc124470423306 | test/test_camera.cc | test/test_camera.cc |
TEST(Test_Camera, ConstructorFromMatrices)
{
Camera expected;
Camera camera(expected.getViewMatrix(), expected.getProjectionMatrix(),
expected.getOrigin());
EXPECT_Vector3f_NEAR(expected.getPosition(), camera.getPosition(), 1e-5f);
EXPECT_NEAR(expected.getRadius(), camera.getRadius(), 1e-5f);
// just to recalculate the view matrix from the angles and test them
camera.changeAzimuth(0);
EXPECT_Matrix4f_NEAR(expected.getViewMatrix(), camera.getViewMatrix(), 1e-5f);
}
|
TEST(Test_Camera, ConstructorFromMatricesWithDefaultValues)
{
Camera expected;
Camera camera(expected.getViewMatrix(), expected.getProjectionMatrix(),
expected.getOrigin());
EXPECT_Vector3f_NEAR(expected.getPosition(), camera.getPosition(), 1e-5f);
EXPECT_NEAR(expected.getRadius(), camera.getRadius(), 1e-5f);
// just to recalculate the view matrix from the angles and test them
camera.changeAzimuth(0);
EXPECT_Matrix4f_NEAR(expected.getViewMatrix(), camera.getViewMatrix(), 1e-5f);
EXPECT_Matrix4f_NEAR(expected.getProjectionMatrix(),
camera.getProjectionMatrix(), 1e-5f);
EXPECT_Vector3f_NEAR(expected.getPosition(), camera.getPosition(), 1e-5f);
}
TEST(Test_Camera, ConstructorFromMatricesAfterRotation)
{
Camera expected;
expected.changeAzimuth(M_PI * 0.25f);
Camera camera(expected.getViewMatrix(), expected.getProjectionMatrix(),
expected.getOrigin());
EXPECT_Vector3f_NEAR(expected.getPosition(), camera.getPosition(), 1e-5f);
EXPECT_NEAR(expected.getRadius(), camera.getRadius(), 1e-5f);
// just to recalculate the view matrix from the angles and test them
camera.changeAzimuth(0);
EXPECT_Matrix4f_NEAR(expected.getViewMatrix(), camera.getViewMatrix(), 1e-5f);
EXPECT_Matrix4f_NEAR(expected.getProjectionMatrix(),
camera.getProjectionMatrix(), 1e-5f);
EXPECT_Vector3f_NEAR(expected.getPosition(), camera.getPosition(), 1e-5f);
}
| Extend first camera test and add another one. | Extend first camera test and add another one.
With a changed camera.
| C++ | mit | Christof/voly-labeller,Christof/voly-labeller,Christof/voly-labeller,Christof/voly-labeller | c++ | ## Code Before:
TEST(Test_Camera, ConstructorFromMatrices)
{
Camera expected;
Camera camera(expected.getViewMatrix(), expected.getProjectionMatrix(),
expected.getOrigin());
EXPECT_Vector3f_NEAR(expected.getPosition(), camera.getPosition(), 1e-5f);
EXPECT_NEAR(expected.getRadius(), camera.getRadius(), 1e-5f);
// just to recalculate the view matrix from the angles and test them
camera.changeAzimuth(0);
EXPECT_Matrix4f_NEAR(expected.getViewMatrix(), camera.getViewMatrix(), 1e-5f);
}
## Instruction:
Extend first camera test and add another one.
With a changed camera.
## Code After:
TEST(Test_Camera, ConstructorFromMatricesWithDefaultValues)
{
Camera expected;
Camera camera(expected.getViewMatrix(), expected.getProjectionMatrix(),
expected.getOrigin());
EXPECT_Vector3f_NEAR(expected.getPosition(), camera.getPosition(), 1e-5f);
EXPECT_NEAR(expected.getRadius(), camera.getRadius(), 1e-5f);
// just to recalculate the view matrix from the angles and test them
camera.changeAzimuth(0);
EXPECT_Matrix4f_NEAR(expected.getViewMatrix(), camera.getViewMatrix(), 1e-5f);
EXPECT_Matrix4f_NEAR(expected.getProjectionMatrix(),
camera.getProjectionMatrix(), 1e-5f);
EXPECT_Vector3f_NEAR(expected.getPosition(), camera.getPosition(), 1e-5f);
}
TEST(Test_Camera, ConstructorFromMatricesAfterRotation)
{
Camera expected;
expected.changeAzimuth(M_PI * 0.25f);
Camera camera(expected.getViewMatrix(), expected.getProjectionMatrix(),
expected.getOrigin());
EXPECT_Vector3f_NEAR(expected.getPosition(), camera.getPosition(), 1e-5f);
EXPECT_NEAR(expected.getRadius(), camera.getRadius(), 1e-5f);
// just to recalculate the view matrix from the angles and test them
camera.changeAzimuth(0);
EXPECT_Matrix4f_NEAR(expected.getViewMatrix(), camera.getViewMatrix(), 1e-5f);
EXPECT_Matrix4f_NEAR(expected.getProjectionMatrix(),
camera.getProjectionMatrix(), 1e-5f);
EXPECT_Vector3f_NEAR(expected.getPosition(), camera.getPosition(), 1e-5f);
}
|
- TEST(Test_Camera, ConstructorFromMatrices)
+ TEST(Test_Camera, ConstructorFromMatricesWithDefaultValues)
? +++++++++++++++++
{
Camera expected;
Camera camera(expected.getViewMatrix(), expected.getProjectionMatrix(),
expected.getOrigin());
-
EXPECT_Vector3f_NEAR(expected.getPosition(), camera.getPosition(), 1e-5f);
EXPECT_NEAR(expected.getRadius(), camera.getRadius(), 1e-5f);
// just to recalculate the view matrix from the angles and test them
camera.changeAzimuth(0);
EXPECT_Matrix4f_NEAR(expected.getViewMatrix(), camera.getViewMatrix(), 1e-5f);
+ EXPECT_Matrix4f_NEAR(expected.getProjectionMatrix(),
+ camera.getProjectionMatrix(), 1e-5f);
+ EXPECT_Vector3f_NEAR(expected.getPosition(), camera.getPosition(), 1e-5f);
}
+
+ TEST(Test_Camera, ConstructorFromMatricesAfterRotation)
+ {
+ Camera expected;
+ expected.changeAzimuth(M_PI * 0.25f);
+
+ Camera camera(expected.getViewMatrix(), expected.getProjectionMatrix(),
+ expected.getOrigin());
+
+ EXPECT_Vector3f_NEAR(expected.getPosition(), camera.getPosition(), 1e-5f);
+ EXPECT_NEAR(expected.getRadius(), camera.getRadius(), 1e-5f);
+
+ // just to recalculate the view matrix from the angles and test them
+ camera.changeAzimuth(0);
+
+ EXPECT_Matrix4f_NEAR(expected.getViewMatrix(), camera.getViewMatrix(), 1e-5f);
+ EXPECT_Matrix4f_NEAR(expected.getProjectionMatrix(),
+ camera.getProjectionMatrix(), 1e-5f);
+ EXPECT_Vector3f_NEAR(expected.getPosition(), camera.getPosition(), 1e-5f);
+ }
+ | 27 | 1.588235 | 25 | 2 |
386ba02d9116a5ab0661a20ce3406029ebfb965e | README.md | README.md |
Converts sfz instruments into Bitwig Studio multisample instruments.
The Bitwig multisample format is more basic than sfz. Features that are unique to sfz will be lost in the conversion process.
## Usage
python sf2bitwig.py file.sfz
## Dependencies
* docopt
|
Converts sfz instruments into Bitwig Studio multisample instruments.
The Bitwig multisample format is more basic than sfz. Features that are unique to sfz will be lost in the conversion process.
## Usage
python sf2bitwig.py file.sfz
## Dependencies
* docopt
## Tested SFZ files
[VS Chamber Orchestra: Community Edition](https://github.com/sgossner/VSCO-2-CE)
* No issues found
[Sonatina Symphonic Orchestra](http://sso.mattiaswestlund.net/download.html)
* Some .sfz cause issues on case sensitive file systems (easy to fix by hand)
* Some .sfz have regions with missing pitch_keycenter opcode (causes region to play out of tune, can be fixed by hand)
| Add list of tested SFZ files | Add list of tested SFZ files
| Markdown | mit | davem2/sfz2bitwig | markdown | ## Code Before:
Converts sfz instruments into Bitwig Studio multisample instruments.
The Bitwig multisample format is more basic than sfz. Features that are unique to sfz will be lost in the conversion process.
## Usage
python sf2bitwig.py file.sfz
## Dependencies
* docopt
## Instruction:
Add list of tested SFZ files
## Code After:
Converts sfz instruments into Bitwig Studio multisample instruments.
The Bitwig multisample format is more basic than sfz. Features that are unique to sfz will be lost in the conversion process.
## Usage
python sf2bitwig.py file.sfz
## Dependencies
* docopt
## Tested SFZ files
[VS Chamber Orchestra: Community Edition](https://github.com/sgossner/VSCO-2-CE)
* No issues found
[Sonatina Symphonic Orchestra](http://sso.mattiaswestlund.net/download.html)
* Some .sfz cause issues on case sensitive file systems (easy to fix by hand)
* Some .sfz have regions with missing pitch_keycenter opcode (causes region to play out of tune, can be fixed by hand)
|
Converts sfz instruments into Bitwig Studio multisample instruments.
The Bitwig multisample format is more basic than sfz. Features that are unique to sfz will be lost in the conversion process.
-
## Usage
python sf2bitwig.py file.sfz
## Dependencies
* docopt
+ ## Tested SFZ files
+
+ [VS Chamber Orchestra: Community Edition](https://github.com/sgossner/VSCO-2-CE)
+ * No issues found
+
+ [Sonatina Symphonic Orchestra](http://sso.mattiaswestlund.net/download.html)
+ * Some .sfz cause issues on case sensitive file systems (easy to fix by hand)
+ * Some .sfz have regions with missing pitch_keycenter opcode (causes region to play out of tune, can be fixed by hand) | 9 | 0.75 | 8 | 1 |
78eb4c16ebf10c35d408ac73cb91477fbd3a1144 | src/index.ts | src/index.ts | export interface Result {
matches: boolean;
}
export interface VisualRegressionTester {
check: (name: string) => Promise<Result>;
}
export interface Browser {
takeScreenshot: () => Promise<string>;
}
export interface FileSystem {
read: (name: string) => Promise<string>;
write: (name: string) => Promise<string>;
}
export default class Mugshot implements VisualRegressionTester {
private browser: Browser;
private fs: FileSystem;
constructor(browser: Browser, storage: FileSystem) {
this.browser = browser;
this.fs = storage;
}
check = async (name: string) => {
const screenshot = await this.browser.takeScreenshot();
const base = await this.fs.read(name);
return Promise.resolve({ matches: screenshot === base });
};
}
| export interface Result {
matches: boolean;
}
export interface VisualRegressionTester {
check: (name: string) => Promise<Result>;
}
export interface Browser {
// https://w3c.github.io/webdriver/#take-screenshot
takeScreenshot: () => Promise<string>;
}
export interface FileSystem {
read: (name: string) => Promise<string>;
write: (name: string) => Promise<string>;
}
export default class Mugshot implements VisualRegressionTester {
private browser: Browser;
private fs: FileSystem;
constructor(browser: Browser, storage: FileSystem) {
this.browser = browser;
this.fs = storage;
}
check = async (name: string) => {
const screenshot = await this.browser.takeScreenshot();
const base = await this.fs.read(name);
return Promise.resolve({ matches: screenshot === base });
};
}
| Add link to webdriver spec | Add link to webdriver spec
| TypeScript | mit | uberVU/mugshot,uberVU/mugshot | typescript | ## Code Before:
export interface Result {
matches: boolean;
}
export interface VisualRegressionTester {
check: (name: string) => Promise<Result>;
}
export interface Browser {
takeScreenshot: () => Promise<string>;
}
export interface FileSystem {
read: (name: string) => Promise<string>;
write: (name: string) => Promise<string>;
}
export default class Mugshot implements VisualRegressionTester {
private browser: Browser;
private fs: FileSystem;
constructor(browser: Browser, storage: FileSystem) {
this.browser = browser;
this.fs = storage;
}
check = async (name: string) => {
const screenshot = await this.browser.takeScreenshot();
const base = await this.fs.read(name);
return Promise.resolve({ matches: screenshot === base });
};
}
## Instruction:
Add link to webdriver spec
## Code After:
export interface Result {
matches: boolean;
}
export interface VisualRegressionTester {
check: (name: string) => Promise<Result>;
}
export interface Browser {
// https://w3c.github.io/webdriver/#take-screenshot
takeScreenshot: () => Promise<string>;
}
export interface FileSystem {
read: (name: string) => Promise<string>;
write: (name: string) => Promise<string>;
}
export default class Mugshot implements VisualRegressionTester {
private browser: Browser;
private fs: FileSystem;
constructor(browser: Browser, storage: FileSystem) {
this.browser = browser;
this.fs = storage;
}
check = async (name: string) => {
const screenshot = await this.browser.takeScreenshot();
const base = await this.fs.read(name);
return Promise.resolve({ matches: screenshot === base });
};
}
| export interface Result {
matches: boolean;
}
export interface VisualRegressionTester {
check: (name: string) => Promise<Result>;
}
export interface Browser {
+ // https://w3c.github.io/webdriver/#take-screenshot
takeScreenshot: () => Promise<string>;
}
export interface FileSystem {
read: (name: string) => Promise<string>;
write: (name: string) => Promise<string>;
}
export default class Mugshot implements VisualRegressionTester {
private browser: Browser;
private fs: FileSystem;
constructor(browser: Browser, storage: FileSystem) {
this.browser = browser;
this.fs = storage;
}
check = async (name: string) => {
const screenshot = await this.browser.takeScreenshot();
const base = await this.fs.read(name);
return Promise.resolve({ matches: screenshot === base });
};
} | 1 | 0.029412 | 1 | 0 |
96793a56ca6b94f1e6d8c5fd97701c0bb7ed877e | install/genirack/nodetypeB.xml | install/genirack/nodetypeB.xml | <nodetype>
<attribute name="node_type"> <value>dl360</value></attribute>
<attribute name="attr_string_adminmfs_osid"> <value>emulab-ops,FREEBSD-MFS</value></attribute>
<attribute name="attr_string_default_osid"> <value>emulab-ops,UBUNTU14-64-STD</value></attribute>
<attribute name="attr_string_delay_osid"> <value>emulab-ops,FBSD82-STD</value></attribute>
<attribute name="attr_string_diskloadmfs_osid"> <value>emulab-ops,FRISBEE-MFS</value></attribute>
<attribute name="attr_string_jail_osid"> <value>emulab-ops,FEDORA15-STD</value></attribute>
<attribute name="attr_string_default_imageid"> <value>emulab-ops:FBSD82-STD,emulab-ops:FEDORA15-STD</value></attribute>
</nodetype>
| <nodetype>
<attribute name="node_type"> <value>dl360</value></attribute>
<attribute name="attr_string_adminmfs_osid"> <value>emulab-ops,FREEBSD-MFS</value></attribute>
<attribute name="attr_string_default_osid"> <value>emulab-ops,UBUNTU14-64-STD</value></attribute>
<attribute name="attr_string_delay_osid"> <value>emulab-ops,FBSD82-STD</value></attribute>
<attribute name="attr_string_diskloadmfs_osid"> <value>emulab-ops,FRISBEE-MFS</value></attribute>
<attribute name="attr_string_jail_osid"> <value>emulab-ops,FEDORA15-STD</value></attribute>
<attribute name="attr_string_default_imageid"> <value>emulab-ops:UBUNTU14-64-STD</value></attribute>
</nodetype>
| Set default image to UBUNTU14-64-STD. | Set default image to UBUNTU14-64-STD.
| XML | agpl-3.0 | nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome | xml | ## Code Before:
<nodetype>
<attribute name="node_type"> <value>dl360</value></attribute>
<attribute name="attr_string_adminmfs_osid"> <value>emulab-ops,FREEBSD-MFS</value></attribute>
<attribute name="attr_string_default_osid"> <value>emulab-ops,UBUNTU14-64-STD</value></attribute>
<attribute name="attr_string_delay_osid"> <value>emulab-ops,FBSD82-STD</value></attribute>
<attribute name="attr_string_diskloadmfs_osid"> <value>emulab-ops,FRISBEE-MFS</value></attribute>
<attribute name="attr_string_jail_osid"> <value>emulab-ops,FEDORA15-STD</value></attribute>
<attribute name="attr_string_default_imageid"> <value>emulab-ops:FBSD82-STD,emulab-ops:FEDORA15-STD</value></attribute>
</nodetype>
## Instruction:
Set default image to UBUNTU14-64-STD.
## Code After:
<nodetype>
<attribute name="node_type"> <value>dl360</value></attribute>
<attribute name="attr_string_adminmfs_osid"> <value>emulab-ops,FREEBSD-MFS</value></attribute>
<attribute name="attr_string_default_osid"> <value>emulab-ops,UBUNTU14-64-STD</value></attribute>
<attribute name="attr_string_delay_osid"> <value>emulab-ops,FBSD82-STD</value></attribute>
<attribute name="attr_string_diskloadmfs_osid"> <value>emulab-ops,FRISBEE-MFS</value></attribute>
<attribute name="attr_string_jail_osid"> <value>emulab-ops,FEDORA15-STD</value></attribute>
<attribute name="attr_string_default_imageid"> <value>emulab-ops:UBUNTU14-64-STD</value></attribute>
</nodetype>
| <nodetype>
<attribute name="node_type"> <value>dl360</value></attribute>
<attribute name="attr_string_adminmfs_osid"> <value>emulab-ops,FREEBSD-MFS</value></attribute>
<attribute name="attr_string_default_osid"> <value>emulab-ops,UBUNTU14-64-STD</value></attribute>
<attribute name="attr_string_delay_osid"> <value>emulab-ops,FBSD82-STD</value></attribute>
<attribute name="attr_string_diskloadmfs_osid"> <value>emulab-ops,FRISBEE-MFS</value></attribute>
<attribute name="attr_string_jail_osid"> <value>emulab-ops,FEDORA15-STD</value></attribute>
- <attribute name="attr_string_default_imageid"> <value>emulab-ops:FBSD82-STD,emulab-ops:FEDORA15-STD</value></attribute>
? ^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
+ <attribute name="attr_string_default_imageid"> <value>emulab-ops:UBUNTU14-64-STD</value></attribute>
? ^ ^^^^^^ ^^
</nodetype> | 2 | 0.222222 | 1 | 1 |
6bf5b70bac76062aebe35c1951a23590710f902c | app/scripts/ripple.js | app/scripts/ripple.js | (function () {
document.addEventListener('mousedown', function (event) {
if (event.target && event.target.className.indexOf('ripple') !== -1) {
let $div = document.createElement('div'),
btnRect = event.target.getBoundingClientRect(),
height = event.target.clientHeight,
xPos = event.pageX - (btnRect.left + window.pageXOffset),
yPos = event.pageY - (btnRect.top + window.pageYOffset);
$div.className = 'ripple-effect';
$div.style.height = `${height}px`;
//noinspection JSSuspiciousNameCombination
$div.style.width = `${height}px`;
$div.style.top = `${yPos - (height / 2)}px`;
$div.style.left = `${xPos - (height / 2)}px`;
event.target.appendChild($div);
window.setTimeout(() => event.target.removeChild($div), 2000);
}
});
})();
| (function () {
document.addEventListener('mousedown', function (event) {
if (event.target &&
event.target.className &&
event.target.className.indexOf &&
event.target.className.indexOf('ripple') !== -1) {
let $div = document.createElement('div'),
btnRect = event.target.getBoundingClientRect(),
height = event.target.clientHeight,
xPos = event.pageX - (btnRect.left + window.pageXOffset),
yPos = event.pageY - (btnRect.top + window.pageYOffset);
$div.className = 'ripple-effect';
$div.style.height = `${height}px`;
//noinspection JSSuspiciousNameCombination
$div.style.width = `${height}px`;
$div.style.top = `${yPos - (height / 2)}px`;
$div.style.left = `${xPos - (height / 2)}px`;
event.target.appendChild($div);
window.setTimeout(() => event.target.removeChild($div), 2000);
}
});
})();
| Fix for error when clicking on browser market share pie charts | Fix for error when clicking on browser market share pie charts
| JavaScript | mit | NOtherDev/whatwebcando,NOtherDev/whatwebcando,NOtherDev/whatwebcando | javascript | ## Code Before:
(function () {
document.addEventListener('mousedown', function (event) {
if (event.target && event.target.className.indexOf('ripple') !== -1) {
let $div = document.createElement('div'),
btnRect = event.target.getBoundingClientRect(),
height = event.target.clientHeight,
xPos = event.pageX - (btnRect.left + window.pageXOffset),
yPos = event.pageY - (btnRect.top + window.pageYOffset);
$div.className = 'ripple-effect';
$div.style.height = `${height}px`;
//noinspection JSSuspiciousNameCombination
$div.style.width = `${height}px`;
$div.style.top = `${yPos - (height / 2)}px`;
$div.style.left = `${xPos - (height / 2)}px`;
event.target.appendChild($div);
window.setTimeout(() => event.target.removeChild($div), 2000);
}
});
})();
## Instruction:
Fix for error when clicking on browser market share pie charts
## Code After:
(function () {
document.addEventListener('mousedown', function (event) {
if (event.target &&
event.target.className &&
event.target.className.indexOf &&
event.target.className.indexOf('ripple') !== -1) {
let $div = document.createElement('div'),
btnRect = event.target.getBoundingClientRect(),
height = event.target.clientHeight,
xPos = event.pageX - (btnRect.left + window.pageXOffset),
yPos = event.pageY - (btnRect.top + window.pageYOffset);
$div.className = 'ripple-effect';
$div.style.height = `${height}px`;
//noinspection JSSuspiciousNameCombination
$div.style.width = `${height}px`;
$div.style.top = `${yPos - (height / 2)}px`;
$div.style.left = `${xPos - (height / 2)}px`;
event.target.appendChild($div);
window.setTimeout(() => event.target.removeChild($div), 2000);
}
});
})();
| (function () {
document.addEventListener('mousedown', function (event) {
+ if (event.target &&
+ event.target.className &&
+ event.target.className.indexOf &&
- if (event.target && event.target.className.indexOf('ripple') !== -1) {
? -- ----------------
+ event.target.className.indexOf('ripple') !== -1) {
let $div = document.createElement('div'),
btnRect = event.target.getBoundingClientRect(),
height = event.target.clientHeight,
xPos = event.pageX - (btnRect.left + window.pageXOffset),
yPos = event.pageY - (btnRect.top + window.pageYOffset);
$div.className = 'ripple-effect';
$div.style.height = `${height}px`;
//noinspection JSSuspiciousNameCombination
$div.style.width = `${height}px`;
$div.style.top = `${yPos - (height / 2)}px`;
$div.style.left = `${xPos - (height / 2)}px`;
event.target.appendChild($div);
window.setTimeout(() => event.target.removeChild($div), 2000);
}
});
})(); | 5 | 0.208333 | 4 | 1 |
66a1fb19aadfcf90d5627b36755d700291cef4b4 | py/desisurvey/test/test_rules.py | py/desisurvey/test/test_rules.py | import unittest
import numpy as np
import desisurvey.tiles
from desisurvey.test.base import Tester
from desisurvey.rules import Rules
class TestRules(Tester):
def test_rules(self):
rules = Rules()
tiles = desisurvey.tiles.get_tiles()
completed = np.ones(tiles.ntiles, bool)
rules.apply(completed)
completed[:] = False
rules.apply(completed)
gen = np.random.RandomState(123)
for i in range(10):
completed[gen.choice(tiles.ntiles, tiles.ntiles // 10, replace=False)] = True
rules.apply(completed)
def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)
| import unittest
import numpy as np
import desisurvey.tiles
from desisurvey.test.base import Tester
from desisurvey.rules import Rules
class TestRules(Tester):
def test_rules(self):
rules = Rules('rules-layers.yaml')
tiles = desisurvey.tiles.get_tiles()
completed = np.ones(tiles.ntiles, bool)
rules.apply(completed)
completed[:] = False
rules.apply(completed)
gen = np.random.RandomState(123)
for i in range(10):
completed[gen.choice(tiles.ntiles, tiles.ntiles // 10, replace=False)] = True
rules.apply(completed)
def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)
| Use simpler rules file for testing with tiles subset | Use simpler rules file for testing with tiles subset
| Python | bsd-3-clause | desihub/desisurvey,desihub/desisurvey | python | ## Code Before:
import unittest
import numpy as np
import desisurvey.tiles
from desisurvey.test.base import Tester
from desisurvey.rules import Rules
class TestRules(Tester):
def test_rules(self):
rules = Rules()
tiles = desisurvey.tiles.get_tiles()
completed = np.ones(tiles.ntiles, bool)
rules.apply(completed)
completed[:] = False
rules.apply(completed)
gen = np.random.RandomState(123)
for i in range(10):
completed[gen.choice(tiles.ntiles, tiles.ntiles // 10, replace=False)] = True
rules.apply(completed)
def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)
## Instruction:
Use simpler rules file for testing with tiles subset
## Code After:
import unittest
import numpy as np
import desisurvey.tiles
from desisurvey.test.base import Tester
from desisurvey.rules import Rules
class TestRules(Tester):
def test_rules(self):
rules = Rules('rules-layers.yaml')
tiles = desisurvey.tiles.get_tiles()
completed = np.ones(tiles.ntiles, bool)
rules.apply(completed)
completed[:] = False
rules.apply(completed)
gen = np.random.RandomState(123)
for i in range(10):
completed[gen.choice(tiles.ntiles, tiles.ntiles // 10, replace=False)] = True
rules.apply(completed)
def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)
| import unittest
import numpy as np
import desisurvey.tiles
from desisurvey.test.base import Tester
from desisurvey.rules import Rules
class TestRules(Tester):
def test_rules(self):
- rules = Rules()
+ rules = Rules('rules-layers.yaml')
tiles = desisurvey.tiles.get_tiles()
completed = np.ones(tiles.ntiles, bool)
rules.apply(completed)
completed[:] = False
rules.apply(completed)
gen = np.random.RandomState(123)
for i in range(10):
completed[gen.choice(tiles.ntiles, tiles.ntiles // 10, replace=False)] = True
rules.apply(completed)
def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__) | 2 | 0.066667 | 1 | 1 |
47b6829473a5644d3388ab4a42ade1c7853c19af | src/events/GitDeployed.php | src/events/GitDeployed.php | <?php
namespace Orphans\GitDeploy\Events;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class GitDeployed
{
use SerializesModels;
public $commits;
/**
* Create a new event instance.
*
* @param Order $order
* @return void
*/
public function __construct($commits)
{
$this->commits = $commits;
}
/**
* Get the channels the event should be broadcast on.
*
* @return array
*/
public function broadcastOn()
{
return [];
}
} | <?php
namespace Orphans\GitDeploy\Events;
use Illuminate\Queue\SerializesModels;
class GitDeployed
{
use SerializesModels;
public $commits;
/**
* Create a new event instance.
*
* @param Order $order
* @return void
*/
public function __construct($commits)
{
$this->commits = $commits;
}
} | Remove boardcast again, not needed. | Remove boardcast again, not needed.
| PHP | mit | orphans/git-deploy-laravel,orphans/git-deploy-laravel | php | ## Code Before:
<?php
namespace Orphans\GitDeploy\Events;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class GitDeployed
{
use SerializesModels;
public $commits;
/**
* Create a new event instance.
*
* @param Order $order
* @return void
*/
public function __construct($commits)
{
$this->commits = $commits;
}
/**
* Get the channels the event should be broadcast on.
*
* @return array
*/
public function broadcastOn()
{
return [];
}
}
## Instruction:
Remove boardcast again, not needed.
## Code After:
<?php
namespace Orphans\GitDeploy\Events;
use Illuminate\Queue\SerializesModels;
class GitDeployed
{
use SerializesModels;
public $commits;
/**
* Create a new event instance.
*
* @param Order $order
* @return void
*/
public function __construct($commits)
{
$this->commits = $commits;
}
} | <?php
namespace Orphans\GitDeploy\Events;
use Illuminate\Queue\SerializesModels;
- use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class GitDeployed
{
use SerializesModels;
public $commits;
/**
* Create a new event instance.
*
* @param Order $order
* @return void
*/
public function __construct($commits)
{
$this->commits = $commits;
}
- /**
- * Get the channels the event should be broadcast on.
- *
- * @return array
- */
- public function broadcastOn()
- {
- return [];
- }
} | 10 | 0.294118 | 0 | 10 |
d0096a5f6d425af7ff74d4dda44d2c2c9d0c3faf | omf/init.fish | omf/init.fish | set -gx BROWSER open
set -gx EDITOR vim
set -gx PAGER less
set -gx MANPAGER $PAGER
# fish greeting
set -gx fish_greeting ""
## LOCALE
set -gx LC_ALL en_US.UTF-8
set -gx LANG en_US.UTF-8
## ALIASES
# navigation
alias .. "cd .."
alias ... "cd ../.."
alias .... "cd ../../.."
# ls
alias l "ls -F"
alias la "ls -AF"
alias ll "ls -lF"
alias lla "ls -AlF"
alias lal lla
# apps
alias a atom
alias bo bower
alias bu bundler
alias d docker
alias g git
alias gu gulp
alias ra rails
# GEMS
if test -d ~/.gem/ruby/2.3.0/bin
set -gx PATH $PATH ~/.gem/ruby/2.3.0/bin
end
| set -gx BROWSER open
set -gx EDITOR vim
set -gx PAGER less
set -gx MANPAGER $PAGER
# fish greeting
set -gx fish_greeting ""
# thefuck
thefuck --alias | source
## LOCALE
set -gx LC_ALL en_US.UTF-8
set -gx LANG en_US.UTF-8
## ALIASES
# navigation
alias .. "cd .."
alias ... "cd ../.."
alias .... "cd ../../.."
# ls
alias l "ls -F"
alias la "ls -AF"
alias ll "ls -lF"
alias lla "ls -AlF"
alias lal lla
# apps
alias a atom
alias bo bower
alias bu bundler
alias d docker
alias g git
alias gu gulp
alias ra rails
# GEMS
if test -d ~/.gem/ruby/2.3.0/bin
set -gx PATH $PATH ~/.gem/ruby/2.3.0/bin
end
# NODE
if which yarn > /dev/null
set -gx PATH $PATH (yarn global bin)
end
# ANDROID
set -gx JAVA_HOME /Library/Java/Home
set -gx ANDROID_HOME /usr/local/opt/android-sdk
# PIP
if test -d ~/.local/bin
set -gx PATH $PATH ~/.local/bin
end
| Add missing paths and thefuck | Add missing paths and thefuck
| fish | mit | chuckeles/dotfiles | fish | ## Code Before:
set -gx BROWSER open
set -gx EDITOR vim
set -gx PAGER less
set -gx MANPAGER $PAGER
# fish greeting
set -gx fish_greeting ""
## LOCALE
set -gx LC_ALL en_US.UTF-8
set -gx LANG en_US.UTF-8
## ALIASES
# navigation
alias .. "cd .."
alias ... "cd ../.."
alias .... "cd ../../.."
# ls
alias l "ls -F"
alias la "ls -AF"
alias ll "ls -lF"
alias lla "ls -AlF"
alias lal lla
# apps
alias a atom
alias bo bower
alias bu bundler
alias d docker
alias g git
alias gu gulp
alias ra rails
# GEMS
if test -d ~/.gem/ruby/2.3.0/bin
set -gx PATH $PATH ~/.gem/ruby/2.3.0/bin
end
## Instruction:
Add missing paths and thefuck
## Code After:
set -gx BROWSER open
set -gx EDITOR vim
set -gx PAGER less
set -gx MANPAGER $PAGER
# fish greeting
set -gx fish_greeting ""
# thefuck
thefuck --alias | source
## LOCALE
set -gx LC_ALL en_US.UTF-8
set -gx LANG en_US.UTF-8
## ALIASES
# navigation
alias .. "cd .."
alias ... "cd ../.."
alias .... "cd ../../.."
# ls
alias l "ls -F"
alias la "ls -AF"
alias ll "ls -lF"
alias lla "ls -AlF"
alias lal lla
# apps
alias a atom
alias bo bower
alias bu bundler
alias d docker
alias g git
alias gu gulp
alias ra rails
# GEMS
if test -d ~/.gem/ruby/2.3.0/bin
set -gx PATH $PATH ~/.gem/ruby/2.3.0/bin
end
# NODE
if which yarn > /dev/null
set -gx PATH $PATH (yarn global bin)
end
# ANDROID
set -gx JAVA_HOME /Library/Java/Home
set -gx ANDROID_HOME /usr/local/opt/android-sdk
# PIP
if test -d ~/.local/bin
set -gx PATH $PATH ~/.local/bin
end
| set -gx BROWSER open
set -gx EDITOR vim
set -gx PAGER less
set -gx MANPAGER $PAGER
# fish greeting
set -gx fish_greeting ""
+
+ # thefuck
+ thefuck --alias | source
## LOCALE
set -gx LC_ALL en_US.UTF-8
set -gx LANG en_US.UTF-8
## ALIASES
# navigation
alias .. "cd .."
alias ... "cd ../.."
alias .... "cd ../../.."
# ls
alias l "ls -F"
alias la "ls -AF"
alias ll "ls -lF"
alias lla "ls -AlF"
alias lal lla
# apps
alias a atom
alias bo bower
alias bu bundler
alias d docker
alias g git
alias gu gulp
alias ra rails
# GEMS
if test -d ~/.gem/ruby/2.3.0/bin
set -gx PATH $PATH ~/.gem/ruby/2.3.0/bin
end
+ # NODE
+
+ if which yarn > /dev/null
+ set -gx PATH $PATH (yarn global bin)
+ end
+
+ # ANDROID
+
+ set -gx JAVA_HOME /Library/Java/Home
+ set -gx ANDROID_HOME /usr/local/opt/android-sdk
+
+ # PIP
+
+ if test -d ~/.local/bin
+ set -gx PATH $PATH ~/.local/bin
+ end
+ | 20 | 0.47619 | 20 | 0 |
0b741c89ea19759f25526256ee039707cb423cef | aldryn_faq/tests/test_menu.py | aldryn_faq/tests/test_menu.py |
from __future__ import unicode_literals
from aldryn_faq.menu import FaqCategoryMenu
from django.utils.translation import (
get_language_from_request,
)
from .test_base import AldrynFaqTest, CMSRequestBasedTest
class TestMenu(AldrynFaqTest, CMSRequestBasedTest):
def test_get_nodes(self):
# Test that the EN version of the menu has only category1 and is shown
# in English.
request = self.get_page_request(None, self.user, '/en/')
menu = FaqCategoryMenu()
category1 = self.reload(self.category1, 'en')
self.assertEqualItems(
[menuitem.title for menuitem in menu.get_nodes(request)],
[category1.name]
)
# Test that the DE version has 2 categories and that they are shown in
# German.
request = self.get_page_request(None, self.user, '/de/')
menu = FaqCategoryMenu()
category1 = self.reload(self.category1, 'de')
category2 = self.reload(self.category2, 'de')
nodes = menu.get_nodes(request)
self.assertEqualItems(
[menuitem.title for menuitem in nodes],
[category1.name, category2.name]
)
|
from __future__ import unicode_literals
from aldryn_faq.menu import FaqCategoryMenu
from .test_base import AldrynFaqTest, CMSRequestBasedTest
class TestMenu(AldrynFaqTest, CMSRequestBasedTest):
def test_get_nodes(self):
# Test that the EN version of the menu has only category1 and its
# question1, and is shown in English.
request = self.get_page_request(None, self.user, '/en/')
menu = FaqCategoryMenu()
category1 = self.reload(self.category1, 'en')
question1 = self.reload(self.question1, 'en')
self.assertEqualItems(
[menuitem.title for menuitem in menu.get_nodes(request)],
[category1.name, question1.title]
)
# Test that the DE version has 2 categories and their questions that
# they are shown in German.
request = self.get_page_request(None, self.user, '/de/')
menu = FaqCategoryMenu()
nodes = menu.get_nodes(request)
self.assertEqualItems(
[menuitem.title for menuitem in nodes],
[self.category1.name, self.category2.name, self.question1.title,
self.question2.title]
)
| Fix tests to now include the questions, which are now in the menu | Fix tests to now include the questions, which are now in the menu
| Python | bsd-3-clause | czpython/aldryn-faq,czpython/aldryn-faq,czpython/aldryn-faq,czpython/aldryn-faq | python | ## Code Before:
from __future__ import unicode_literals
from aldryn_faq.menu import FaqCategoryMenu
from django.utils.translation import (
get_language_from_request,
)
from .test_base import AldrynFaqTest, CMSRequestBasedTest
class TestMenu(AldrynFaqTest, CMSRequestBasedTest):
def test_get_nodes(self):
# Test that the EN version of the menu has only category1 and is shown
# in English.
request = self.get_page_request(None, self.user, '/en/')
menu = FaqCategoryMenu()
category1 = self.reload(self.category1, 'en')
self.assertEqualItems(
[menuitem.title for menuitem in menu.get_nodes(request)],
[category1.name]
)
# Test that the DE version has 2 categories and that they are shown in
# German.
request = self.get_page_request(None, self.user, '/de/')
menu = FaqCategoryMenu()
category1 = self.reload(self.category1, 'de')
category2 = self.reload(self.category2, 'de')
nodes = menu.get_nodes(request)
self.assertEqualItems(
[menuitem.title for menuitem in nodes],
[category1.name, category2.name]
)
## Instruction:
Fix tests to now include the questions, which are now in the menu
## Code After:
from __future__ import unicode_literals
from aldryn_faq.menu import FaqCategoryMenu
from .test_base import AldrynFaqTest, CMSRequestBasedTest
class TestMenu(AldrynFaqTest, CMSRequestBasedTest):
def test_get_nodes(self):
# Test that the EN version of the menu has only category1 and its
# question1, and is shown in English.
request = self.get_page_request(None, self.user, '/en/')
menu = FaqCategoryMenu()
category1 = self.reload(self.category1, 'en')
question1 = self.reload(self.question1, 'en')
self.assertEqualItems(
[menuitem.title for menuitem in menu.get_nodes(request)],
[category1.name, question1.title]
)
# Test that the DE version has 2 categories and their questions that
# they are shown in German.
request = self.get_page_request(None, self.user, '/de/')
menu = FaqCategoryMenu()
nodes = menu.get_nodes(request)
self.assertEqualItems(
[menuitem.title for menuitem in nodes],
[self.category1.name, self.category2.name, self.question1.title,
self.question2.title]
)
|
from __future__ import unicode_literals
from aldryn_faq.menu import FaqCategoryMenu
+
- from django.utils.translation import (
- get_language_from_request,
- )
from .test_base import AldrynFaqTest, CMSRequestBasedTest
class TestMenu(AldrynFaqTest, CMSRequestBasedTest):
def test_get_nodes(self):
- # Test that the EN version of the menu has only category1 and is shown
? ------
+ # Test that the EN version of the menu has only category1 and its
? +
- # in English.
+ # question1, and is shown in English.
request = self.get_page_request(None, self.user, '/en/')
menu = FaqCategoryMenu()
category1 = self.reload(self.category1, 'en')
+ question1 = self.reload(self.question1, 'en')
self.assertEqualItems(
[menuitem.title for menuitem in menu.get_nodes(request)],
- [category1.name]
+ [category1.name, question1.title]
? +++++++++++++++++
)
- # Test that the DE version has 2 categories and that they are shown in
? ^ --- ^^^^^^^^^^^
+ # Test that the DE version has 2 categories and their questions that
? ^^^^^^^^ ++++ ^
- # German.
+ # they are shown in German.
request = self.get_page_request(None, self.user, '/de/')
menu = FaqCategoryMenu()
- category1 = self.reload(self.category1, 'de')
- category2 = self.reload(self.category2, 'de')
nodes = menu.get_nodes(request)
self.assertEqualItems(
[menuitem.title for menuitem in nodes],
- [category1.name, category2.name]
+ [self.category1.name, self.category2.name, self.question1.title,
+ self.question2.title]
) | 20 | 0.588235 | 9 | 11 |
ac1e7cbbfb50cfd769631798f176b8868adeb22c | node/package.json | node/package.json | {
"name": "confdis",
"version": "0.0.1",
"description": "A JSON based configuration management tool backed by Redis",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": "",
"dependencies": {
"redis": "0.8.3"
},
"devDependencies": {
"mocha": "1.9.0"
},
"keywords": [
"redis",
"json",
"configuration",
"management",
"distributed"
],
"author": "Jamie Paton <jamiep@activestate.com>",
"license": "ActiveState"
}
| {
"name": "confdis",
"version": "0.0.1",
"description": "A JSON based configuration management tool backed by Redis",
"main": "index.js",
"scripts": {
"test": "make"
},
"repository": "",
"dependencies": {
"redis": "0.8.3"
},
"devDependencies": {
"mocha": "1.9.0"
},
"keywords": [
"redis",
"json",
"configuration",
"management",
"distributed"
],
"author": "Jamie Paton <jamiep@activestate.com>",
"license": "ActiveState"
}
| Allow '$ npm test' to work | Allow '$ npm test' to work
| JSON | apache-2.0 | hpcloud/confdis,ActiveState/confdis,ActiveState/confdis,hpcloud/confdis,ActiveState/confdis,hpcloud/confdis | json | ## Code Before:
{
"name": "confdis",
"version": "0.0.1",
"description": "A JSON based configuration management tool backed by Redis",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": "",
"dependencies": {
"redis": "0.8.3"
},
"devDependencies": {
"mocha": "1.9.0"
},
"keywords": [
"redis",
"json",
"configuration",
"management",
"distributed"
],
"author": "Jamie Paton <jamiep@activestate.com>",
"license": "ActiveState"
}
## Instruction:
Allow '$ npm test' to work
## Code After:
{
"name": "confdis",
"version": "0.0.1",
"description": "A JSON based configuration management tool backed by Redis",
"main": "index.js",
"scripts": {
"test": "make"
},
"repository": "",
"dependencies": {
"redis": "0.8.3"
},
"devDependencies": {
"mocha": "1.9.0"
},
"keywords": [
"redis",
"json",
"configuration",
"management",
"distributed"
],
"author": "Jamie Paton <jamiep@activestate.com>",
"license": "ActiveState"
}
| {
"name": "confdis",
"version": "0.0.1",
"description": "A JSON based configuration management tool backed by Redis",
"main": "index.js",
"scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
+ "test": "make"
},
"repository": "",
"dependencies": {
"redis": "0.8.3"
},
"devDependencies": {
"mocha": "1.9.0"
},
"keywords": [
"redis",
"json",
"configuration",
"management",
"distributed"
],
"author": "Jamie Paton <jamiep@activestate.com>",
"license": "ActiveState"
} | 2 | 0.08 | 1 | 1 |
b220663566f7fd4c44b32780dee69536a0baef39 | server/utils/Util.js | server/utils/Util.js | /**
* Utility class
*/
export default class Util {
/**
* Creates request configuration based on an url and go config
*
* @param {string} url The url to create configuration for
* @param {GoConfig} config Go configuration
* @param {boolean} json True if expected response is json
*
* @return {Object} Request configuration
*/
static createRequestOptions(url, config, json = false, headers = {}) {
const options = {
uri: url,
rejectUnauthorized: false,
json: json,
headers: headers
};
if (config.user && config.password) {
options.auth = {
user: config.user,
pass: config.password
}
}
return options;
}
}
| /**
* Utility class
*/
export default class Util {
/**
* Creates request configuration based on an url and go config
*
* @param {string} url The url to create configuration for
* @param {GoConfig} config Go configuration
* @param {boolean} json True if expected response is json
*
* @return {Object} Request configuration
*/
static createRequestOptions(url, config, json = false, headers = {}) {
const options = {
uri: url,
rejectUnauthorized: false,
json: json,
headers: headers,
jar: true
};
if (config.user && config.password) {
options.auth = {
user: config.user,
pass: config.password
}
}
return options;
}
}
| Enable cookie jar for better performance | Enable cookie jar for better performance
| JavaScript | mit | karmats/gocd-dashboard,karmats/gocd-monitor,karmats/gocd-monitor,karmats/gocd-dashboard | javascript | ## Code Before:
/**
* Utility class
*/
export default class Util {
/**
* Creates request configuration based on an url and go config
*
* @param {string} url The url to create configuration for
* @param {GoConfig} config Go configuration
* @param {boolean} json True if expected response is json
*
* @return {Object} Request configuration
*/
static createRequestOptions(url, config, json = false, headers = {}) {
const options = {
uri: url,
rejectUnauthorized: false,
json: json,
headers: headers
};
if (config.user && config.password) {
options.auth = {
user: config.user,
pass: config.password
}
}
return options;
}
}
## Instruction:
Enable cookie jar for better performance
## Code After:
/**
* Utility class
*/
export default class Util {
/**
* Creates request configuration based on an url and go config
*
* @param {string} url The url to create configuration for
* @param {GoConfig} config Go configuration
* @param {boolean} json True if expected response is json
*
* @return {Object} Request configuration
*/
static createRequestOptions(url, config, json = false, headers = {}) {
const options = {
uri: url,
rejectUnauthorized: false,
json: json,
headers: headers,
jar: true
};
if (config.user && config.password) {
options.auth = {
user: config.user,
pass: config.password
}
}
return options;
}
}
| /**
* Utility class
*/
export default class Util {
/**
* Creates request configuration based on an url and go config
*
* @param {string} url The url to create configuration for
* @param {GoConfig} config Go configuration
* @param {boolean} json True if expected response is json
*
* @return {Object} Request configuration
*/
static createRequestOptions(url, config, json = false, headers = {}) {
const options = {
uri: url,
rejectUnauthorized: false,
json: json,
- headers: headers
+ headers: headers,
? +
+ jar: true
};
if (config.user && config.password) {
options.auth = {
user: config.user,
pass: config.password
}
}
return options;
}
} | 3 | 0.096774 | 2 | 1 |
78dc5e0bf28f592c4251562a36579617587604d5 | index.html | index.html | ---
layout: page
title: Articles
description: "You are violating code 431.322.12 of the Internet Privacy Act signed by Bill Clinton in 1995 and that means that you can NOT threaten me."
tags: [ImageCFG, Lapdock, Atrix Lapdock, Lapdock 500, RNS-510, Video In Motion, UnofficialDDNS]
---
{% for post in site.posts %}
<ul class="post-list">
<li><article itemscope itemtype="http://schema.org/BlogPosting" itemprop="blogPost"><a href="{{ site.url }}{{ post.url }}">{{ post.title }}<span class="entry-date"><time datetime="{{ post.date | date_to_xmlschema }}" itemprop="datePublished">{{ post.date | date: "%B %d, %Y" }}</time></span></a></article></li>
</ul>
{% endfor %}
| ---
layout: page
title: Articles
description: "You are violating code 431.322.12 of the Internet Privacy Act signed by Bill Clinton in 1995 and that means that you can NOT threaten me."
tags: [ImageCFG, Lapdock, Atrix Lapdock, Lapdock 500, RNS-510, Video In Motion, UnofficialDDNS]
---
{% assign posts = '' %}
{% for post in site.posts %}
{% if post.modified %}{% assign date = post.modified %}{% else %}{% assign date = post.date|date:"%Y-%m-%d" %}{% endif %}
{% if post.tags contains 'top-content' %}{% capture title %}<strong>{{ post.title }}</strong>{% endcapture %}{% else %}{% assign title = post.title %}{% endif %}
{% capture posts %}{{ posts }}~~~~~~{{ date }}~~~~{{ title }}~~~~{{ post.url }}~~~~{{ post.date|date_to_xmlschema }}{% endcapture %}
{% endfor %}
{% assign sorted_posts = posts|split:'~~~~~~'|sort %}
{% for post in sorted_posts reversed offset:1 %}
{% assign post_split = post|split:'~~~~' %}
{% assign post_date = post_split[0] %}
{% assign post_title = post_split[1] %}
{% assign post_url = post_split[2] %}
{% assign post_date_xml = post_split[3] %}
<ul class="post-list">
<li>
<article itemscope itemtype="http://schema.org/BlogPosting" itemprop="blogPost">
<a href="{{ site.url }}{{ post_url }}">{{ post_title }}<span class="entry-date"><time datetime="{{ post_date_xml }}" itemprop="datePublished">{{ post_date|date:'%B %d, %Y' }}</time></span></a>
</article>
</li>
</ul>
{% endfor %}
| Index page now sorts articles by modified date. | Index page now sorts articles by modified date.
I wanted articles listed on my front page to be sorted by modified date
instead of original date, so posts that I update would show up at the
top instead of be forever at the bottom. I had to implement this in a
way I don't really like but had to, since Liquid is pretty basic. I've
also made it bold entries that have the top-content tag so they would
stick out more.
| HTML | bsd-2-clause | Robpol86/robpol86.com | html | ## Code Before:
---
layout: page
title: Articles
description: "You are violating code 431.322.12 of the Internet Privacy Act signed by Bill Clinton in 1995 and that means that you can NOT threaten me."
tags: [ImageCFG, Lapdock, Atrix Lapdock, Lapdock 500, RNS-510, Video In Motion, UnofficialDDNS]
---
{% for post in site.posts %}
<ul class="post-list">
<li><article itemscope itemtype="http://schema.org/BlogPosting" itemprop="blogPost"><a href="{{ site.url }}{{ post.url }}">{{ post.title }}<span class="entry-date"><time datetime="{{ post.date | date_to_xmlschema }}" itemprop="datePublished">{{ post.date | date: "%B %d, %Y" }}</time></span></a></article></li>
</ul>
{% endfor %}
## Instruction:
Index page now sorts articles by modified date.
I wanted articles listed on my front page to be sorted by modified date
instead of original date, so posts that I update would show up at the
top instead of be forever at the bottom. I had to implement this in a
way I don't really like but had to, since Liquid is pretty basic. I've
also made it bold entries that have the top-content tag so they would
stick out more.
## Code After:
---
layout: page
title: Articles
description: "You are violating code 431.322.12 of the Internet Privacy Act signed by Bill Clinton in 1995 and that means that you can NOT threaten me."
tags: [ImageCFG, Lapdock, Atrix Lapdock, Lapdock 500, RNS-510, Video In Motion, UnofficialDDNS]
---
{% assign posts = '' %}
{% for post in site.posts %}
{% if post.modified %}{% assign date = post.modified %}{% else %}{% assign date = post.date|date:"%Y-%m-%d" %}{% endif %}
{% if post.tags contains 'top-content' %}{% capture title %}<strong>{{ post.title }}</strong>{% endcapture %}{% else %}{% assign title = post.title %}{% endif %}
{% capture posts %}{{ posts }}~~~~~~{{ date }}~~~~{{ title }}~~~~{{ post.url }}~~~~{{ post.date|date_to_xmlschema }}{% endcapture %}
{% endfor %}
{% assign sorted_posts = posts|split:'~~~~~~'|sort %}
{% for post in sorted_posts reversed offset:1 %}
{% assign post_split = post|split:'~~~~' %}
{% assign post_date = post_split[0] %}
{% assign post_title = post_split[1] %}
{% assign post_url = post_split[2] %}
{% assign post_date_xml = post_split[3] %}
<ul class="post-list">
<li>
<article itemscope itemtype="http://schema.org/BlogPosting" itemprop="blogPost">
<a href="{{ site.url }}{{ post_url }}">{{ post_title }}<span class="entry-date"><time datetime="{{ post_date_xml }}" itemprop="datePublished">{{ post_date|date:'%B %d, %Y' }}</time></span></a>
</article>
</li>
</ul>
{% endfor %}
| ---
layout: page
title: Articles
description: "You are violating code 431.322.12 of the Internet Privacy Act signed by Bill Clinton in 1995 and that means that you can NOT threaten me."
tags: [ImageCFG, Lapdock, Atrix Lapdock, Lapdock 500, RNS-510, Video In Motion, UnofficialDDNS]
---
+ {% assign posts = '' %}
{% for post in site.posts %}
+ {% if post.modified %}{% assign date = post.modified %}{% else %}{% assign date = post.date|date:"%Y-%m-%d" %}{% endif %}
+ {% if post.tags contains 'top-content' %}{% capture title %}<strong>{{ post.title }}</strong>{% endcapture %}{% else %}{% assign title = post.title %}{% endif %}
+ {% capture posts %}{{ posts }}~~~~~~{{ date }}~~~~{{ title }}~~~~{{ post.url }}~~~~{{ post.date|date_to_xmlschema }}{% endcapture %}
+ {% endfor %}
+ {% assign sorted_posts = posts|split:'~~~~~~'|sort %}
+
+ {% for post in sorted_posts reversed offset:1 %}
+ {% assign post_split = post|split:'~~~~' %}
+ {% assign post_date = post_split[0] %}
+ {% assign post_title = post_split[1] %}
+ {% assign post_url = post_split[2] %}
+ {% assign post_date_xml = post_split[3] %}
<ul class="post-list">
- <li><article itemscope itemtype="http://schema.org/BlogPosting" itemprop="blogPost"><a href="{{ site.url }}{{ post.url }}">{{ post.title }}<span class="entry-date"><time datetime="{{ post.date | date_to_xmlschema }}" itemprop="datePublished">{{ post.date | date: "%B %d, %Y" }}</time></span></a></article></li>
+ <li>
+ <article itemscope itemtype="http://schema.org/BlogPosting" itemprop="blogPost">
+ <a href="{{ site.url }}{{ post_url }}">{{ post_title }}<span class="entry-date"><time datetime="{{ post_date_xml }}" itemprop="datePublished">{{ post_date|date:'%B %d, %Y' }}</time></span></a>
+ </article>
+ </li>
</ul>
{% endfor %} | 19 | 1.583333 | 18 | 1 |
39d8eaec4ca823fee7873051df717f2309aa34e6 | proposals/integrating-an-open-source-js-cdn-with-npm.md | proposals/integrating-an-open-source-js-cdn-with-npm.md |
* Name : Ryan Kirkman
* Twitter : [@ryan_kirkman](https://twitter.com/ryan_kirkman)
* GitHub : [ryankirkman](https://github.com/ryankirkman)
## Abstract
Scaling our ability to maintain cdnjs (an open source JavaScript CDN) with three maintainers has proved a challenge. With 36 pull requests from 22 individual authors touching 1,590 files and adding over one million lines of code in the last week alone, we realized manual maintenance was not going to cut it - it was time for some tooling.
Enter NPM. Our dream solution was keeping cdnjs in sync with NPM for specific projects that want to be hosted on cdnjs, so this is exactly what we set out to build.
We now have a completely automated update process that enables libraries available on cdnjs to sync with NPM for fast, automatic updates.
In this talk I will cover:
* A brief history of cdnjs
* How we implemented the NPM auto update tool in Node.js
* How we plan to expand our tooling in the future to enable automated library updating via git tags
## Speaker Bio

Ryan Kirkman is the co-founder of [cdnjs](http://cdnjs.com) and a software developer at [Sauce Labs](http://saucelabs.com) originally from Australia. |
* Name : Ryan Kirkman
* Twitter : [@ryan_kirkman](https://twitter.com/ryan_kirkman)
* GitHub : [ryankirkman](https://github.com/ryankirkman)
## Abstract
Scaling our ability to maintain cdnjs (an open source JavaScript CDN) with three maintainers has proved a challenge. With 36 pull requests from 22 individual authors touching 1,590 files and adding over one million lines of code in the last week alone, we realized manual maintenance was not going to cut it - it was time for some tooling.
Enter npm. Our dream solution was keeping cdnjs in sync with npm for specific projects that want to be hosted on cdnjs, so this is exactly what we set out to build.
We now have a completely automated update process that enables libraries available on cdnjs to sync with npm for fast, automatic updates.
In this talk I will cover:
* A brief history of cdnjs
* How we implemented the npm auto update tool in Node.js
* How we plan to expand our tooling in the future to enable automated library updating via git tags
## Speaker Bio

Ryan Kirkman is the co-founder of [cdnjs](http://cdnjs.com) and a software developer at [Sauce Labs](http://saucelabs.com) originally from Australia. | Use npm instead of NPM - thanks for the tip @rockbot :) | Use npm instead of NPM - thanks for the tip @rockbot :)
| Markdown | mit | cascadiajs/2014.cascadiajs.com,modulexcite/2014.cascadiajs.com,modulexcite/2014.cascadiajs.com | markdown | ## Code Before:
* Name : Ryan Kirkman
* Twitter : [@ryan_kirkman](https://twitter.com/ryan_kirkman)
* GitHub : [ryankirkman](https://github.com/ryankirkman)
## Abstract
Scaling our ability to maintain cdnjs (an open source JavaScript CDN) with three maintainers has proved a challenge. With 36 pull requests from 22 individual authors touching 1,590 files and adding over one million lines of code in the last week alone, we realized manual maintenance was not going to cut it - it was time for some tooling.
Enter NPM. Our dream solution was keeping cdnjs in sync with NPM for specific projects that want to be hosted on cdnjs, so this is exactly what we set out to build.
We now have a completely automated update process that enables libraries available on cdnjs to sync with NPM for fast, automatic updates.
In this talk I will cover:
* A brief history of cdnjs
* How we implemented the NPM auto update tool in Node.js
* How we plan to expand our tooling in the future to enable automated library updating via git tags
## Speaker Bio

Ryan Kirkman is the co-founder of [cdnjs](http://cdnjs.com) and a software developer at [Sauce Labs](http://saucelabs.com) originally from Australia.
## Instruction:
Use npm instead of NPM - thanks for the tip @rockbot :)
## Code After:
* Name : Ryan Kirkman
* Twitter : [@ryan_kirkman](https://twitter.com/ryan_kirkman)
* GitHub : [ryankirkman](https://github.com/ryankirkman)
## Abstract
Scaling our ability to maintain cdnjs (an open source JavaScript CDN) with three maintainers has proved a challenge. With 36 pull requests from 22 individual authors touching 1,590 files and adding over one million lines of code in the last week alone, we realized manual maintenance was not going to cut it - it was time for some tooling.
Enter npm. Our dream solution was keeping cdnjs in sync with npm for specific projects that want to be hosted on cdnjs, so this is exactly what we set out to build.
We now have a completely automated update process that enables libraries available on cdnjs to sync with npm for fast, automatic updates.
In this talk I will cover:
* A brief history of cdnjs
* How we implemented the npm auto update tool in Node.js
* How we plan to expand our tooling in the future to enable automated library updating via git tags
## Speaker Bio

Ryan Kirkman is the co-founder of [cdnjs](http://cdnjs.com) and a software developer at [Sauce Labs](http://saucelabs.com) originally from Australia. |
* Name : Ryan Kirkman
* Twitter : [@ryan_kirkman](https://twitter.com/ryan_kirkman)
* GitHub : [ryankirkman](https://github.com/ryankirkman)
## Abstract
Scaling our ability to maintain cdnjs (an open source JavaScript CDN) with three maintainers has proved a challenge. With 36 pull requests from 22 individual authors touching 1,590 files and adding over one million lines of code in the last week alone, we realized manual maintenance was not going to cut it - it was time for some tooling.
- Enter NPM. Our dream solution was keeping cdnjs in sync with NPM for specific projects that want to be hosted on cdnjs, so this is exactly what we set out to build.
? ^^^ ^^^
+ Enter npm. Our dream solution was keeping cdnjs in sync with npm for specific projects that want to be hosted on cdnjs, so this is exactly what we set out to build.
? ^^^ ^^^
- We now have a completely automated update process that enables libraries available on cdnjs to sync with NPM for fast, automatic updates.
? ^^^
+ We now have a completely automated update process that enables libraries available on cdnjs to sync with npm for fast, automatic updates.
? ^^^
In this talk I will cover:
* A brief history of cdnjs
- * How we implemented the NPM auto update tool in Node.js
? ^^^
+ * How we implemented the npm auto update tool in Node.js
? ^^^
* How we plan to expand our tooling in the future to enable automated library updating via git tags
## Speaker Bio

Ryan Kirkman is the co-founder of [cdnjs](http://cdnjs.com) and a software developer at [Sauce Labs](http://saucelabs.com) originally from Australia. | 6 | 0.26087 | 3 | 3 |
5cc071958aa63f46ec7f3708648f80a8424c661b | Lib/compositor/cmap.py | Lib/compositor/cmap.py |
def extractCMAP(ttFont):
cmap = {}
cmapIDs = [(3, 10), (0, 3), (3, 1)]
for i in range(len(cmapIDs)):
if ttFont["cmap"].getcmap(*cmapIDs[i]):
cmap = ttFont["cmap"].getcmap(*cmapIDs[i]).cmap
break
if not cmap:
from compositor.error import CompositorError
raise CompositorError("Found neither CMAP (3, 10), (0, 3), nor (3, 1) in font.")
return cmap
def reverseCMAP(cmap):
reversed = {}
for value, name in cmap.items():
if name not in reversed:
reversed[name] = []
reversed[name].append(value)
return reversed
|
def extractCMAP(ttFont):
for platformID, encodingID in [(3, 10), (0, 3), (3, 1)]:
cmapSubtable = ttFont["cmap"].getcmap(platformID, encodingID)
if cmapSubtable is not None:
return cmapSubtable.cmap
from compositor.error import CompositorError
raise CompositorError("Found neither CMAP (3, 10), (0, 3), nor (3, 1) in font.")
def reverseCMAP(cmap):
reversed = {}
for value, name in cmap.items():
if name not in reversed:
reversed[name] = []
reversed[name].append(value)
return reversed
| Make the code more compact | Make the code more compact
| Python | mit | typesupply/compositor,anthrotype/compositor,anthrotype/compositor,typesupply/compositor | python | ## Code Before:
def extractCMAP(ttFont):
cmap = {}
cmapIDs = [(3, 10), (0, 3), (3, 1)]
for i in range(len(cmapIDs)):
if ttFont["cmap"].getcmap(*cmapIDs[i]):
cmap = ttFont["cmap"].getcmap(*cmapIDs[i]).cmap
break
if not cmap:
from compositor.error import CompositorError
raise CompositorError("Found neither CMAP (3, 10), (0, 3), nor (3, 1) in font.")
return cmap
def reverseCMAP(cmap):
reversed = {}
for value, name in cmap.items():
if name not in reversed:
reversed[name] = []
reversed[name].append(value)
return reversed
## Instruction:
Make the code more compact
## Code After:
def extractCMAP(ttFont):
for platformID, encodingID in [(3, 10), (0, 3), (3, 1)]:
cmapSubtable = ttFont["cmap"].getcmap(platformID, encodingID)
if cmapSubtable is not None:
return cmapSubtable.cmap
from compositor.error import CompositorError
raise CompositorError("Found neither CMAP (3, 10), (0, 3), nor (3, 1) in font.")
def reverseCMAP(cmap):
reversed = {}
for value, name in cmap.items():
if name not in reversed:
reversed[name] = []
reversed[name].append(value)
return reversed
|
def extractCMAP(ttFont):
+ for platformID, encodingID in [(3, 10), (0, 3), (3, 1)]:
+ cmapSubtable = ttFont["cmap"].getcmap(platformID, encodingID)
+ if cmapSubtable is not None:
+ return cmapSubtable.cmap
- cmap = {}
- cmapIDs = [(3, 10), (0, 3), (3, 1)]
- for i in range(len(cmapIDs)):
- if ttFont["cmap"].getcmap(*cmapIDs[i]):
- cmap = ttFont["cmap"].getcmap(*cmapIDs[i]).cmap
- break
- if not cmap:
- from compositor.error import CompositorError
? ----
+ from compositor.error import CompositorError
- raise CompositorError("Found neither CMAP (3, 10), (0, 3), nor (3, 1) in font.")
? ----
+ raise CompositorError("Found neither CMAP (3, 10), (0, 3), nor (3, 1) in font.")
- return cmap
def reverseCMAP(cmap):
reversed = {}
for value, name in cmap.items():
if name not in reversed:
reversed[name] = []
reversed[name].append(value)
return reversed | 16 | 0.8 | 6 | 10 |
b2112b0bc67d4e9ef80265e17a14d85d74f67972 | README.md | README.md |
[](https://travis-ci.org/at15/forum-search)
[](https://www.codacy.com/app/at15/forum-search)
爬取论坛数据, 存储在hadoop中, 进行分词和索引, 提供web界面用于搜索
## 文档
- [传送门](doc)
## 组成
项目主要分成以下几个部分
- crawler 按时爬取论坛数据
- uploader 将爬虫爬到的数据上传到hdfs
- indexer 分词, 生成索引, 存储到hdfs(?hbase)中
- manager 调度crawler, uploader, indexer
- manager ui, 显示crawler, uploader, indexer的状态
- search api 提供搜索的restful api
- search ui 提供搜索界面
### 各部分的细节
- crawler 待定
- uploader 调用hadoop的api上传
- indexer 在map reduce里进行分词和索引
- manger 和 search 使用 dropwizard
- ui 部分为spa(单页应用), 通过ajax调用api, api设置CORS |
[](https://travis-ci.org/at15/forum-search)
[](https://www.codacy.com/app/at15/forum-search)
[](https://codecov.io/github/at15/forum-search?branch=master)

爬取论坛数据, 存储在hadoop中, 进行分词和索引, 提供web界面用于搜索
## 文档
- [传送门](doc)
## 组成
项目主要分成以下几个部分
- crawler 按时爬取论坛数据
- uploader 将爬虫爬到的数据上传到hdfs
- indexer 分词, 生成索引, 存储到hdfs(?hbase)中
- manager 调度crawler, uploader, indexer
- manager ui, 显示crawler, uploader, indexer的状态
- search api 提供搜索的restful api
- search ui 提供搜索界面
### 各部分的细节
- crawler 待定
- uploader 调用hadoop的api上传
- indexer 在map reduce里进行分词和索引
- manger 和 search 使用 dropwizard
- ui 部分为spa(单页应用), 通过ajax调用api, api设置CORS | Add badage for codecov test coverage | Add badage for codecov test coverage
| Markdown | mit | at15/forum-search,at15/forum-search | markdown | ## Code Before:
[](https://travis-ci.org/at15/forum-search)
[](https://www.codacy.com/app/at15/forum-search)
爬取论坛数据, 存储在hadoop中, 进行分词和索引, 提供web界面用于搜索
## 文档
- [传送门](doc)
## 组成
项目主要分成以下几个部分
- crawler 按时爬取论坛数据
- uploader 将爬虫爬到的数据上传到hdfs
- indexer 分词, 生成索引, 存储到hdfs(?hbase)中
- manager 调度crawler, uploader, indexer
- manager ui, 显示crawler, uploader, indexer的状态
- search api 提供搜索的restful api
- search ui 提供搜索界面
### 各部分的细节
- crawler 待定
- uploader 调用hadoop的api上传
- indexer 在map reduce里进行分词和索引
- manger 和 search 使用 dropwizard
- ui 部分为spa(单页应用), 通过ajax调用api, api设置CORS
## Instruction:
Add badage for codecov test coverage
## Code After:
[](https://travis-ci.org/at15/forum-search)
[](https://www.codacy.com/app/at15/forum-search)
[](https://codecov.io/github/at15/forum-search?branch=master)

爬取论坛数据, 存储在hadoop中, 进行分词和索引, 提供web界面用于搜索
## 文档
- [传送门](doc)
## 组成
项目主要分成以下几个部分
- crawler 按时爬取论坛数据
- uploader 将爬虫爬到的数据上传到hdfs
- indexer 分词, 生成索引, 存储到hdfs(?hbase)中
- manager 调度crawler, uploader, indexer
- manager ui, 显示crawler, uploader, indexer的状态
- search api 提供搜索的restful api
- search ui 提供搜索界面
### 各部分的细节
- crawler 待定
- uploader 调用hadoop的api上传
- indexer 在map reduce里进行分词和索引
- manger 和 search 使用 dropwizard
- ui 部分为spa(单页应用), 通过ajax调用api, api设置CORS |
[](https://travis-ci.org/at15/forum-search)
[](https://www.codacy.com/app/at15/forum-search)
+ [](https://codecov.io/github/at15/forum-search?branch=master)
+ 
爬取论坛数据, 存储在hadoop中, 进行分词和索引, 提供web界面用于搜索
## 文档
- [传送门](doc)
## 组成
项目主要分成以下几个部分
- crawler 按时爬取论坛数据
- uploader 将爬虫爬到的数据上传到hdfs
- indexer 分词, 生成索引, 存储到hdfs(?hbase)中
- manager 调度crawler, uploader, indexer
- manager ui, 显示crawler, uploader, indexer的状态
- search api 提供搜索的restful api
- search ui 提供搜索界面
### 各部分的细节
- crawler 待定
- uploader 调用hadoop的api上传
- indexer 在map reduce里进行分词和索引
- manger 和 search 使用 dropwizard
- ui 部分为spa(单页应用), 通过ajax调用api, api设置CORS | 2 | 0.068966 | 2 | 0 |
ac2d61a9732f20f960d787287beeccd4a641bafe | .idea/ant.xml | .idea/ant.xml | <?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AntConfiguration">
<defaultAnt bundledAnt="true" />
<buildFile url="file://$PROJECT_DIR$/sandbox/localCloud/build.xml">
<additionalClassPath />
<antReference projectDefault="true" />
<customJdkName value="" />
<maximumHeapSize value="128" />
<maximumStackSize value="2" />
<properties />
</buildFile>
<buildFile url="file://$PROJECT_DIR$/sandbox/localCloud-build.xml">
<additionalClassPath />
<antReference projectDefault="true" />
<customJdkName value="" />
<maximumHeapSize value="128" />
<maximumStackSize value="2" />
<properties />
</buildFile>
</component>
</project>
| <?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AntConfiguration">
<defaultAnt bundledAnt="true" />
<buildFile url="file://$PROJECT_DIR$/sandbox/localCloud/build.xml">
<additionalClassPath />
<antReference projectDefault="true" />
<customJdkName value="" />
<maximumHeapSize value="128" />
<maximumStackSize value="2" />
<properties />
<executeOn event="afterCompilation" target="enhance" />
</buildFile>
<buildFile url="file://$PROJECT_DIR$/sandbox/localCloud-build.xml">
<additionalClassPath />
<antReference projectDefault="true" />
<customJdkName value="" />
<maximumHeapSize value="128" />
<maximumStackSize value="2" />
<properties />
</buildFile>
</component>
</project>
| Fix local cloud build in IntelliJ | Fix local cloud build in IntelliJ
git-svn-id: e7d6bde23f017c9ff4efd468d79d66def666766b@11981 eae3c2d3-9b19-0410-a86e-396b6ccb6ab3
| XML | lgpl-2.1 | spotbugs/spotbugs,spotbugs/spotbugs,KengoTODA/spotbugs,johnscancella/spotbugs,sewe/spotbugs,sewe/spotbugs,KengoTODA/spotbugs,spotbugs/spotbugs,sewe/spotbugs,spotbugs/spotbugs,spotbugs/spotbugs,KengoTODA/spotbugs,johnscancella/spotbugs,johnscancella/spotbugs,sewe/spotbugs,johnscancella/spotbugs,KengoTODA/spotbugs | xml | ## Code Before:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AntConfiguration">
<defaultAnt bundledAnt="true" />
<buildFile url="file://$PROJECT_DIR$/sandbox/localCloud/build.xml">
<additionalClassPath />
<antReference projectDefault="true" />
<customJdkName value="" />
<maximumHeapSize value="128" />
<maximumStackSize value="2" />
<properties />
</buildFile>
<buildFile url="file://$PROJECT_DIR$/sandbox/localCloud-build.xml">
<additionalClassPath />
<antReference projectDefault="true" />
<customJdkName value="" />
<maximumHeapSize value="128" />
<maximumStackSize value="2" />
<properties />
</buildFile>
</component>
</project>
## Instruction:
Fix local cloud build in IntelliJ
git-svn-id: e7d6bde23f017c9ff4efd468d79d66def666766b@11981 eae3c2d3-9b19-0410-a86e-396b6ccb6ab3
## Code After:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AntConfiguration">
<defaultAnt bundledAnt="true" />
<buildFile url="file://$PROJECT_DIR$/sandbox/localCloud/build.xml">
<additionalClassPath />
<antReference projectDefault="true" />
<customJdkName value="" />
<maximumHeapSize value="128" />
<maximumStackSize value="2" />
<properties />
<executeOn event="afterCompilation" target="enhance" />
</buildFile>
<buildFile url="file://$PROJECT_DIR$/sandbox/localCloud-build.xml">
<additionalClassPath />
<antReference projectDefault="true" />
<customJdkName value="" />
<maximumHeapSize value="128" />
<maximumStackSize value="2" />
<properties />
</buildFile>
</component>
</project>
| <?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AntConfiguration">
<defaultAnt bundledAnt="true" />
<buildFile url="file://$PROJECT_DIR$/sandbox/localCloud/build.xml">
<additionalClassPath />
<antReference projectDefault="true" />
<customJdkName value="" />
<maximumHeapSize value="128" />
<maximumStackSize value="2" />
<properties />
+ <executeOn event="afterCompilation" target="enhance" />
</buildFile>
<buildFile url="file://$PROJECT_DIR$/sandbox/localCloud-build.xml">
<additionalClassPath />
<antReference projectDefault="true" />
<customJdkName value="" />
<maximumHeapSize value="128" />
<maximumStackSize value="2" />
<properties />
</buildFile>
</component>
</project>
| 1 | 0.043478 | 1 | 0 |
57c0da5070bb9ed45e4ac0ddf212307df2046c6e | examples/list_issues.rs | examples/list_issues.rs |
extern crate gitlab_api as gitlab;
use std::env;
#[macro_use]
extern crate log;
extern crate env_logger;
use gitlab::GitLab;
// use gitlab::Pagination;
use gitlab::issues;
fn main() {
env_logger::init().unwrap();
info!("starting up");
let hostname = match env::var("GITLAB_HOSTNAME") {
Ok(val) => val,
Err(_) => {
let default = String::from("gitlab.com");
println!("Please set environment variable 'GITLAB_HOSTNAME'. Using default '{}'.",
default);
default
}
};
let token = match env::var("GITLAB_TOKEN") {
Ok(val) => val,
Err(_) => {
panic!("Please set environment variable 'GITLAB_TOKEN'. Take it from \
http://{}/profile/account",
hostname);
}
};
let gl = GitLab::new_https(&hostname, &token);
let issues = gl.issues(issues::Listing::new()).unwrap();
println!("issues: {:?}", issues);
let listing = issues::Listing::new().state(issues::ListingState::Opened).clone();
let opened_issues = gl.issues(listing).unwrap();
println!("opened_issues: {:?}", opened_issues);
let listing = issues::Listing::new().state(issues::ListingState::Closed).clone();
let closed_issues = gl.issues(listing).unwrap();
println!("closed_issues: {:?}", closed_issues);
}
|
extern crate gitlab_api as gitlab;
use std::env;
#[macro_use]
extern crate log;
extern crate env_logger;
use gitlab::GitLab;
// use gitlab::Pagination;
use gitlab::issues;
fn main() {
env_logger::init().unwrap();
info!("starting up");
let hostname = match env::var("GITLAB_HOSTNAME") {
Ok(val) => val,
Err(_) => {
let default = String::from("gitlab.com");
println!("Please set environment variable 'GITLAB_HOSTNAME'. Using default '{}'.",
default);
default
}
};
let token = match env::var("GITLAB_TOKEN") {
Ok(val) => val,
Err(_) => {
panic!("Please set environment variable 'GITLAB_TOKEN'. Take it from \
http://{}/profile/account",
hostname);
}
};
let gl = GitLab::new_https(&hostname, &token);
let issues = gl.issues(issues::Listing::new()).unwrap();
println!("issues: {:?}", issues);
let listing = issues::Listing::new().state(issues::ListingState::Opened).clone();
let opened_issues = gl.issues(listing).unwrap();
println!("opened_issues: {:?}", opened_issues);
let listing = issues::Listing::new().state(issues::ListingState::Closed).clone();
let closed_issues = gl.issues(listing).unwrap();
println!("closed_issues: {:?}", closed_issues);
let listing = issues::single::Listing::new(142, 739);
let issue = gl.issue(listing).unwrap();
println!("issue: {:?}", issue);
}
| Add single listing to issue example. | Add single listing to issue example.
| Rust | apache-2.0 | nbigaouette/gitlab-api-rs,nbigaouette/gitlab-api-rs | rust | ## Code Before:
extern crate gitlab_api as gitlab;
use std::env;
#[macro_use]
extern crate log;
extern crate env_logger;
use gitlab::GitLab;
// use gitlab::Pagination;
use gitlab::issues;
fn main() {
env_logger::init().unwrap();
info!("starting up");
let hostname = match env::var("GITLAB_HOSTNAME") {
Ok(val) => val,
Err(_) => {
let default = String::from("gitlab.com");
println!("Please set environment variable 'GITLAB_HOSTNAME'. Using default '{}'.",
default);
default
}
};
let token = match env::var("GITLAB_TOKEN") {
Ok(val) => val,
Err(_) => {
panic!("Please set environment variable 'GITLAB_TOKEN'. Take it from \
http://{}/profile/account",
hostname);
}
};
let gl = GitLab::new_https(&hostname, &token);
let issues = gl.issues(issues::Listing::new()).unwrap();
println!("issues: {:?}", issues);
let listing = issues::Listing::new().state(issues::ListingState::Opened).clone();
let opened_issues = gl.issues(listing).unwrap();
println!("opened_issues: {:?}", opened_issues);
let listing = issues::Listing::new().state(issues::ListingState::Closed).clone();
let closed_issues = gl.issues(listing).unwrap();
println!("closed_issues: {:?}", closed_issues);
}
## Instruction:
Add single listing to issue example.
## Code After:
extern crate gitlab_api as gitlab;
use std::env;
#[macro_use]
extern crate log;
extern crate env_logger;
use gitlab::GitLab;
// use gitlab::Pagination;
use gitlab::issues;
fn main() {
env_logger::init().unwrap();
info!("starting up");
let hostname = match env::var("GITLAB_HOSTNAME") {
Ok(val) => val,
Err(_) => {
let default = String::from("gitlab.com");
println!("Please set environment variable 'GITLAB_HOSTNAME'. Using default '{}'.",
default);
default
}
};
let token = match env::var("GITLAB_TOKEN") {
Ok(val) => val,
Err(_) => {
panic!("Please set environment variable 'GITLAB_TOKEN'. Take it from \
http://{}/profile/account",
hostname);
}
};
let gl = GitLab::new_https(&hostname, &token);
let issues = gl.issues(issues::Listing::new()).unwrap();
println!("issues: {:?}", issues);
let listing = issues::Listing::new().state(issues::ListingState::Opened).clone();
let opened_issues = gl.issues(listing).unwrap();
println!("opened_issues: {:?}", opened_issues);
let listing = issues::Listing::new().state(issues::ListingState::Closed).clone();
let closed_issues = gl.issues(listing).unwrap();
println!("closed_issues: {:?}", closed_issues);
let listing = issues::single::Listing::new(142, 739);
let issue = gl.issue(listing).unwrap();
println!("issue: {:?}", issue);
}
|
extern crate gitlab_api as gitlab;
use std::env;
#[macro_use]
extern crate log;
extern crate env_logger;
use gitlab::GitLab;
// use gitlab::Pagination;
use gitlab::issues;
fn main() {
env_logger::init().unwrap();
info!("starting up");
let hostname = match env::var("GITLAB_HOSTNAME") {
Ok(val) => val,
Err(_) => {
let default = String::from("gitlab.com");
println!("Please set environment variable 'GITLAB_HOSTNAME'. Using default '{}'.",
default);
default
}
};
let token = match env::var("GITLAB_TOKEN") {
Ok(val) => val,
Err(_) => {
panic!("Please set environment variable 'GITLAB_TOKEN'. Take it from \
http://{}/profile/account",
hostname);
}
};
let gl = GitLab::new_https(&hostname, &token);
let issues = gl.issues(issues::Listing::new()).unwrap();
println!("issues: {:?}", issues);
let listing = issues::Listing::new().state(issues::ListingState::Opened).clone();
let opened_issues = gl.issues(listing).unwrap();
println!("opened_issues: {:?}", opened_issues);
let listing = issues::Listing::new().state(issues::ListingState::Closed).clone();
let closed_issues = gl.issues(listing).unwrap();
println!("closed_issues: {:?}", closed_issues);
+
+ let listing = issues::single::Listing::new(142, 739);
+ let issue = gl.issue(listing).unwrap();
+ println!("issue: {:?}", issue);
} | 4 | 0.081633 | 4 | 0 |
9725a12aa691489d34cac3385f3c22ff5cc1ec81 | config.yml | config.yml | services:
- id: tsp-mooc-db
completeName: Relational Database
port: 8080
stack:
- containerName: tsp-moocdb-postgres
image: fmonniot/tsp-moocdb-postgres:latest
- containerName: tsp-moocdb-web
image: fmonniot/tsp-moocdb-web:latest
ports:
- "8080:80"
links:
- tsp-moocdb-postgres
- id: tsp-mooc-overview
completeName: TSP MOOC Overview
stack:
- containerName: tsp-mooc-overview
image: tsp-mooc-overview
| services:
- id: tsp-mooc-db
completeName: Relational Database
port: 8080
stack:
- containerName: tsp-moocdb-postgres
image: fmonniot/tsp-moocdb-postgres:latest
- containerName: tsp-moocdb-web
image: fmonniot/tsp-moocdb-web:latest
ports:
- "8080:80"
links:
- tsp-moocdb-postgres
- id: nginx
completeName: Nginx demo
port: 8081
stack:
- containerName: nginx-demo
image: nginx:latest
ports:
- "8081:80"
- id: tsp-mooc-overview
completeName: TSP MOOC Overview
stack:
- containerName: tsp-mooc-overview
image: tsp-mooc-overview
| Add nginx demo as services | Add nginx demo as services
| YAML | mit | pfe-asr-2014/tsp-mooc-overview,pfe-asr-2014/tsp-mooc-overview | yaml | ## Code Before:
services:
- id: tsp-mooc-db
completeName: Relational Database
port: 8080
stack:
- containerName: tsp-moocdb-postgres
image: fmonniot/tsp-moocdb-postgres:latest
- containerName: tsp-moocdb-web
image: fmonniot/tsp-moocdb-web:latest
ports:
- "8080:80"
links:
- tsp-moocdb-postgres
- id: tsp-mooc-overview
completeName: TSP MOOC Overview
stack:
- containerName: tsp-mooc-overview
image: tsp-mooc-overview
## Instruction:
Add nginx demo as services
## Code After:
services:
- id: tsp-mooc-db
completeName: Relational Database
port: 8080
stack:
- containerName: tsp-moocdb-postgres
image: fmonniot/tsp-moocdb-postgres:latest
- containerName: tsp-moocdb-web
image: fmonniot/tsp-moocdb-web:latest
ports:
- "8080:80"
links:
- tsp-moocdb-postgres
- id: nginx
completeName: Nginx demo
port: 8081
stack:
- containerName: nginx-demo
image: nginx:latest
ports:
- "8081:80"
- id: tsp-mooc-overview
completeName: TSP MOOC Overview
stack:
- containerName: tsp-mooc-overview
image: tsp-mooc-overview
| services:
- id: tsp-mooc-db
completeName: Relational Database
port: 8080
stack:
- containerName: tsp-moocdb-postgres
image: fmonniot/tsp-moocdb-postgres:latest
- containerName: tsp-moocdb-web
image: fmonniot/tsp-moocdb-web:latest
ports:
- "8080:80"
links:
- tsp-moocdb-postgres
+ - id: nginx
+ completeName: Nginx demo
+ port: 8081
+ stack:
+ - containerName: nginx-demo
+ image: nginx:latest
+ ports:
+ - "8081:80"
- id: tsp-mooc-overview
completeName: TSP MOOC Overview
stack:
- containerName: tsp-mooc-overview
image: tsp-mooc-overview | 8 | 0.444444 | 8 | 0 |
a0ac24d9ec07c4fd102ee2e6b2786a4ed01a016d | README.md | README.md |
Podio Platform JavaScript SDK for NodeJS and the browser
## Tests
PhantomJS:
```sh
$ grunt
```
Node:
```sh
$ jasmine-node test
```
## Documentation
You will find a detailed documentation at [http://podio.github.io/platformJS/](http://podio.github.io/platformJS/)
|
Podio Platform JavaScript SDK for NodeJS and the browser
## Installation
```
npm install git+ssh://git@github.com:podio/platformJS.git --save
```
## Use in NodeJS applications
```
var PlatformJS = require('PlatformJS');
```
## Use in browser applications
If you are using and AMD/CommonJS compatible module loader you can require the module:
```
var PlatformJS = require('PlatformJS');
```
If you are not using a loader, browserify PlatformJS like this:
```
npm install -g browserify
browserify lib/PlatformJS.js -s PlatformJS > dist/PlatformJS.js
```
and include `dist/PlatformJS.js` using a `<script>` tag.
## Tests
PhantomJS:
```sh
$ grunt
```
Node:
```sh
$ jasmine-node test
```
## Documentation
You will find a detailed documentation at [http://podio.github.io/platformJS/](http://podio.github.io/platformJS/)
| Add some info to the readme about how to compile a distribution with browserify. | Add some info to the readme about how to compile a distribution with browserify.
| Markdown | mit | shelsonjava/podio-js,podio/podio-js | markdown | ## Code Before:
Podio Platform JavaScript SDK for NodeJS and the browser
## Tests
PhantomJS:
```sh
$ grunt
```
Node:
```sh
$ jasmine-node test
```
## Documentation
You will find a detailed documentation at [http://podio.github.io/platformJS/](http://podio.github.io/platformJS/)
## Instruction:
Add some info to the readme about how to compile a distribution with browserify.
## Code After:
Podio Platform JavaScript SDK for NodeJS and the browser
## Installation
```
npm install git+ssh://git@github.com:podio/platformJS.git --save
```
## Use in NodeJS applications
```
var PlatformJS = require('PlatformJS');
```
## Use in browser applications
If you are using and AMD/CommonJS compatible module loader you can require the module:
```
var PlatformJS = require('PlatformJS');
```
If you are not using a loader, browserify PlatformJS like this:
```
npm install -g browserify
browserify lib/PlatformJS.js -s PlatformJS > dist/PlatformJS.js
```
and include `dist/PlatformJS.js` using a `<script>` tag.
## Tests
PhantomJS:
```sh
$ grunt
```
Node:
```sh
$ jasmine-node test
```
## Documentation
You will find a detailed documentation at [http://podio.github.io/platformJS/](http://podio.github.io/platformJS/)
|
Podio Platform JavaScript SDK for NodeJS and the browser
+
+ ## Installation
+
+ ```
+ npm install git+ssh://git@github.com:podio/platformJS.git --save
+ ```
+
+ ## Use in NodeJS applications
+
+ ```
+ var PlatformJS = require('PlatformJS');
+ ```
+
+ ## Use in browser applications
+
+ If you are using and AMD/CommonJS compatible module loader you can require the module:
+
+ ```
+ var PlatformJS = require('PlatformJS');
+ ```
+
+ If you are not using a loader, browserify PlatformJS like this:
+
+ ```
+ npm install -g browserify
+
+ browserify lib/PlatformJS.js -s PlatformJS > dist/PlatformJS.js
+ ```
+
+ and include `dist/PlatformJS.js` using a `<script>` tag.
## Tests
PhantomJS:
```sh
$ grunt
```
Node:
```sh
$ jasmine-node test
```
## Documentation
You will find a detailed documentation at [http://podio.github.io/platformJS/](http://podio.github.io/platformJS/) | 30 | 1.5 | 30 | 0 |
a1ffe0fc20179e31c198ef408fca85bc37a9ed47 | benchmarks/DNN/blocks/vggBlock/compile_and_run_mkldnn.sh | benchmarks/DNN/blocks/vggBlock/compile_and_run_mkldnn.sh |
source ../../../configure_paths.sh
echo
echo "MKLDNN VGG"
g++ -std=c++11 -fopenmp -I${MKL_PREFIX}/include -L${MKL_PREFIX}/lib vgg_block_generator_mkldnn.cpp -lmkldnn -o vggBlock_mkldnn_result
./vggBlock_mkldnn_result
|
source ../../../configure_paths.sh
echo
echo "MKLDNN VGG"
g++ -std=c++11 -I${MKL_PREFIX}/include -L${MKL_PREFIX}/lib vgg_block_generator_mkldnn.cpp -lmkldnn -o vggBlock_mkldnn_result
./vggBlock_mkldnn_result
| Remove -fopenmp from MKL DNN compilation command | Remove -fopenmp from MKL DNN compilation command
| Shell | mit | rbaghdadi/tiramisu,rbaghdadi/COLi,rbaghdadi/COLi,rbaghdadi/tiramisu,rbaghdadi/tiramisu,rbaghdadi/tiramisu,rbaghdadi/ISIR,rbaghdadi/ISIR | shell | ## Code Before:
source ../../../configure_paths.sh
echo
echo "MKLDNN VGG"
g++ -std=c++11 -fopenmp -I${MKL_PREFIX}/include -L${MKL_PREFIX}/lib vgg_block_generator_mkldnn.cpp -lmkldnn -o vggBlock_mkldnn_result
./vggBlock_mkldnn_result
## Instruction:
Remove -fopenmp from MKL DNN compilation command
## Code After:
source ../../../configure_paths.sh
echo
echo "MKLDNN VGG"
g++ -std=c++11 -I${MKL_PREFIX}/include -L${MKL_PREFIX}/lib vgg_block_generator_mkldnn.cpp -lmkldnn -o vggBlock_mkldnn_result
./vggBlock_mkldnn_result
|
source ../../../configure_paths.sh
-
echo
echo "MKLDNN VGG"
+
- g++ -std=c++11 -fopenmp -I${MKL_PREFIX}/include -L${MKL_PREFIX}/lib vgg_block_generator_mkldnn.cpp -lmkldnn -o vggBlock_mkldnn_result
? ---------
+ g++ -std=c++11 -I${MKL_PREFIX}/include -L${MKL_PREFIX}/lib vgg_block_generator_mkldnn.cpp -lmkldnn -o vggBlock_mkldnn_result
./vggBlock_mkldnn_result | 4 | 0.5 | 2 | 2 |
df52bf506fdb6754d51c2320108bcd832a0dfc02 | django_twilio_sms/admin.py | django_twilio_sms/admin.py | from django.contrib import admin
from .models import *
class MessageAdmin(admin.ModelAdmin):
list_display = ('to_phone_number', 'from_phone_number', 'status', 'date_sent')
list_display_links = list_display
list_filter = ('status', 'date_sent')
date_hierarchy = 'date_sent'
ordering = ('-date_sent', )
class ResponseAdmin(admin.ModelAdmin):
list_display = ('action', 'active', 'body', 'date_updated')
list_display_links = list_display
list_filter = ('action', 'active')
class AccountAdmin(admin.ModelAdmin):
list_display = ('friendly_name', 'owner_account_sid', 'account_type', 'status', 'date_updated')
list_display_links = list_display
admin.site.register(Message, MessageAdmin)
admin.site.register(Response, ResponseAdmin)
admin.site.register(Account, AccountAdmin)
| from django.contrib import admin
from .models import *
class MessageAdmin(admin.ModelAdmin):
list_display = ('to_phone_number', 'from_phone_number', 'status', 'direction', 'date_sent')
list_display_links = list_display
list_filter = ('status', 'direction', 'date_sent')
date_hierarchy = 'date_sent'
ordering = ('-date_sent', )
class ResponseAdmin(admin.ModelAdmin):
list_display = ('action', 'active', 'body', 'date_updated')
list_display_links = list_display
list_filter = ('action', 'active')
class AccountAdmin(admin.ModelAdmin):
list_display = ('friendly_name', 'owner_account_sid', 'account_type', 'status', 'date_updated')
list_display_links = list_display
admin.site.register(Message, MessageAdmin)
admin.site.register(Response, ResponseAdmin)
admin.site.register(Account, AccountAdmin)
| Add direction to Message listing | Add direction to Message listing
| Python | bsd-3-clause | cfc603/django-twilio-sms-models | python | ## Code Before:
from django.contrib import admin
from .models import *
class MessageAdmin(admin.ModelAdmin):
list_display = ('to_phone_number', 'from_phone_number', 'status', 'date_sent')
list_display_links = list_display
list_filter = ('status', 'date_sent')
date_hierarchy = 'date_sent'
ordering = ('-date_sent', )
class ResponseAdmin(admin.ModelAdmin):
list_display = ('action', 'active', 'body', 'date_updated')
list_display_links = list_display
list_filter = ('action', 'active')
class AccountAdmin(admin.ModelAdmin):
list_display = ('friendly_name', 'owner_account_sid', 'account_type', 'status', 'date_updated')
list_display_links = list_display
admin.site.register(Message, MessageAdmin)
admin.site.register(Response, ResponseAdmin)
admin.site.register(Account, AccountAdmin)
## Instruction:
Add direction to Message listing
## Code After:
from django.contrib import admin
from .models import *
class MessageAdmin(admin.ModelAdmin):
list_display = ('to_phone_number', 'from_phone_number', 'status', 'direction', 'date_sent')
list_display_links = list_display
list_filter = ('status', 'direction', 'date_sent')
date_hierarchy = 'date_sent'
ordering = ('-date_sent', )
class ResponseAdmin(admin.ModelAdmin):
list_display = ('action', 'active', 'body', 'date_updated')
list_display_links = list_display
list_filter = ('action', 'active')
class AccountAdmin(admin.ModelAdmin):
list_display = ('friendly_name', 'owner_account_sid', 'account_type', 'status', 'date_updated')
list_display_links = list_display
admin.site.register(Message, MessageAdmin)
admin.site.register(Response, ResponseAdmin)
admin.site.register(Account, AccountAdmin)
| from django.contrib import admin
from .models import *
class MessageAdmin(admin.ModelAdmin):
- list_display = ('to_phone_number', 'from_phone_number', 'status', 'date_sent')
+ list_display = ('to_phone_number', 'from_phone_number', 'status', 'direction', 'date_sent')
? +++++++++++++
list_display_links = list_display
- list_filter = ('status', 'date_sent')
+ list_filter = ('status', 'direction', 'date_sent')
? +++++++++++++
date_hierarchy = 'date_sent'
ordering = ('-date_sent', )
class ResponseAdmin(admin.ModelAdmin):
list_display = ('action', 'active', 'body', 'date_updated')
list_display_links = list_display
list_filter = ('action', 'active')
class AccountAdmin(admin.ModelAdmin):
list_display = ('friendly_name', 'owner_account_sid', 'account_type', 'status', 'date_updated')
list_display_links = list_display
admin.site.register(Message, MessageAdmin)
admin.site.register(Response, ResponseAdmin)
admin.site.register(Account, AccountAdmin) | 4 | 0.153846 | 2 | 2 |
ce6c492620d9408a432f5b7c04a437ec812788ac | doc/FORMAT.md | doc/FORMAT.md |
- Info format will be `JSON`. Something like (but without whitespace):
```
[
{"pgbackrest":{"format":6,"version":<pgbackrest version>,"repo-id":<base32 * 16>,id:<base32 * 16>}},
{"content":...},
{"checksum":<sha(1/256)hash>}
]
```
## Manifest
- Save **all** options instead of the piecemeal saves that are done now. These options are for informational purposes only so it would be fine to save them in a KeyValue or JSON blob.
- Store default sections before file/link/path sections to avoid two passes on load.
- Format backup labels using gmtime().
|
- Info format will be `JSON`. Something like (but without whitespace):
```
[
{"pgbackrest":{"format":6,"version":<pgbackrest version>,"repo-id":<base32 * 16>,id:<base32 * 16>}},
{"content":...},
{"checksum":<sha(1/256)hash>}
]
```
## Manifest
- Save **all** options instead of the piecemeal saves that are done now. These options are for informational purposes only so it would be fine to save them in a KeyValue or JSON blob.
- Store default sections before file/link/path sections to avoid two passes on load.
- Format backup labels using gmtime().
## Options
- Disable symlinks by default on `posix` repos. This is a convenience feature for manual access to the repo and it makes more sense to make it optional.
| Add notes about optional symlinks to repo format 6 design. | Add notes about optional symlinks to repo format 6 design.
| Markdown | mit | pgbackrest/pgbackrest,pgmasters/backrest,pgbackrest/pgbackrest,pgbackrest/pgbackrest,pgmasters/backrest | markdown | ## Code Before:
- Info format will be `JSON`. Something like (but without whitespace):
```
[
{"pgbackrest":{"format":6,"version":<pgbackrest version>,"repo-id":<base32 * 16>,id:<base32 * 16>}},
{"content":...},
{"checksum":<sha(1/256)hash>}
]
```
## Manifest
- Save **all** options instead of the piecemeal saves that are done now. These options are for informational purposes only so it would be fine to save them in a KeyValue or JSON blob.
- Store default sections before file/link/path sections to avoid two passes on load.
- Format backup labels using gmtime().
## Instruction:
Add notes about optional symlinks to repo format 6 design.
## Code After:
- Info format will be `JSON`. Something like (but without whitespace):
```
[
{"pgbackrest":{"format":6,"version":<pgbackrest version>,"repo-id":<base32 * 16>,id:<base32 * 16>}},
{"content":...},
{"checksum":<sha(1/256)hash>}
]
```
## Manifest
- Save **all** options instead of the piecemeal saves that are done now. These options are for informational purposes only so it would be fine to save them in a KeyValue or JSON blob.
- Store default sections before file/link/path sections to avoid two passes on load.
- Format backup labels using gmtime().
## Options
- Disable symlinks by default on `posix` repos. This is a convenience feature for manual access to the repo and it makes more sense to make it optional.
|
- Info format will be `JSON`. Something like (but without whitespace):
```
[
{"pgbackrest":{"format":6,"version":<pgbackrest version>,"repo-id":<base32 * 16>,id:<base32 * 16>}},
{"content":...},
{"checksum":<sha(1/256)hash>}
]
```
## Manifest
- Save **all** options instead of the piecemeal saves that are done now. These options are for informational purposes only so it would be fine to save them in a KeyValue or JSON blob.
- Store default sections before file/link/path sections to avoid two passes on load.
- Format backup labels using gmtime().
+
+ ## Options
+
+ - Disable symlinks by default on `posix` repos. This is a convenience feature for manual access to the repo and it makes more sense to make it optional. | 4 | 0.235294 | 4 | 0 |
4f6e03bdf80d2e412ce733b17987130869d561a7 | app/assets/stylesheets/repositories.css.scss | app/assets/stylesheets/repositories.css.scss | @import "leaflet";
#map {
height: 40em;
}
| @import "leaflet";
#map {
height: 40em;
}
.table th {
text-align: left
}
| Change table header text alignment to left | Change table header text alignment to left
I just overwrote the text alignment for Bootstrap's table header text
alignment. This commit changes it from center to left. If this does not
make sense for all tables I am going to create a class-specific rule.
Signed-off-by: Konrad Reiche <4ff0213f56e2082fcd8c882d04c546881c579ce4@gmail.com>
| SCSS | mit | platzhirsch/metadata-census | scss | ## Code Before:
@import "leaflet";
#map {
height: 40em;
}
## Instruction:
Change table header text alignment to left
I just overwrote the text alignment for Bootstrap's table header text
alignment. This commit changes it from center to left. If this does not
make sense for all tables I am going to create a class-specific rule.
Signed-off-by: Konrad Reiche <4ff0213f56e2082fcd8c882d04c546881c579ce4@gmail.com>
## Code After:
@import "leaflet";
#map {
height: 40em;
}
.table th {
text-align: left
}
| @import "leaflet";
#map {
height: 40em;
}
+
+ .table th {
+ text-align: left
+ } | 4 | 0.8 | 4 | 0 |
1d1e1b58213683722e08dd5da5d2980cf1b701f8 | .travis.yml | .travis.yml | language: ruby
sudo: false
cache: bundler
install:
- bundle install --retry=3
script:
- bundle exec rubocop
- bundle exec foodcritic -f any -t ~FC023 .
| language: ruby
sudo: false
cache: bundler
install:
- bundle install --retry=3
script:
- bundle exec rubocop
- bundle exec foodcritic
| Stop excluding FC203 foodcritic error | Travis: Stop excluding FC203 foodcritic error
| YAML | apache-2.0 | osuosl-cookbooks/python-webapp | yaml | ## Code Before:
language: ruby
sudo: false
cache: bundler
install:
- bundle install --retry=3
script:
- bundle exec rubocop
- bundle exec foodcritic -f any -t ~FC023 .
## Instruction:
Travis: Stop excluding FC203 foodcritic error
## Code After:
language: ruby
sudo: false
cache: bundler
install:
- bundle install --retry=3
script:
- bundle exec rubocop
- bundle exec foodcritic
| language: ruby
sudo: false
cache: bundler
install:
- bundle install --retry=3
script:
- bundle exec rubocop
- - bundle exec foodcritic -f any -t ~FC023 .
+ - bundle exec foodcritic | 2 | 0.25 | 1 | 1 |
792d2fcfa8afef4daea87cd8a405a4fccd604534 | core/src/forplay/core/Platform.java | core/src/forplay/core/Platform.java | /**
* Copyright 2010 The ForPlay Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package forplay.core;
/**
* Generic platform interface. New platforms are defined as implementations of this interface.
*/
public interface Platform {
Audio audio();
Graphics graphics();
AssetManager assetManager();
Json json();
Keyboard keyboard();
Log log();
Net net();
Pointer pointer();
/**
* Return the mouse if it is supported, or null otherwise.
*
* @return the mouse if it is supported, or null otherwise.
*/
Mouse mouse();
Storage storage();
Analytics analytics();
float random();
void run(Game game);
double time();
RegularExpression regularExpression();
void openURL(String url);
}
| /**
* Copyright 2010 The ForPlay Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package forplay.core;
/**
* Generic platform interface. New platforms are defined as implementations of this interface.
*/
public interface Platform {
Audio audio();
Graphics graphics();
AssetManager assetManager();
Json json();
Keyboard keyboard();
Log log();
Net net();
Pointer pointer();
Mouse mouse();
Storage storage();
Analytics analytics();
float random();
void run(Game game);
double time();
RegularExpression regularExpression();
void openURL(String url);
}
| Remove useless comment about returning a null mouse. Access mouse through ForPlay.mouse(). | Remove useless comment about returning a null mouse. Access mouse through ForPlay.mouse().
git-svn-id: 53b953c7be2d47dd5cb9b5c1ab101a1158da7762@77 a6a9a2b1-fcd7-f629-9329-86f1cfbb9621
| Java | apache-2.0 | pyricau/forplay-clone-pyricau,pyricau/forplay-clone-pyricau,pyricau/forplay-clone-pyricau | java | ## Code Before:
/**
* Copyright 2010 The ForPlay Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package forplay.core;
/**
* Generic platform interface. New platforms are defined as implementations of this interface.
*/
public interface Platform {
Audio audio();
Graphics graphics();
AssetManager assetManager();
Json json();
Keyboard keyboard();
Log log();
Net net();
Pointer pointer();
/**
* Return the mouse if it is supported, or null otherwise.
*
* @return the mouse if it is supported, or null otherwise.
*/
Mouse mouse();
Storage storage();
Analytics analytics();
float random();
void run(Game game);
double time();
RegularExpression regularExpression();
void openURL(String url);
}
## Instruction:
Remove useless comment about returning a null mouse. Access mouse through ForPlay.mouse().
git-svn-id: 53b953c7be2d47dd5cb9b5c1ab101a1158da7762@77 a6a9a2b1-fcd7-f629-9329-86f1cfbb9621
## Code After:
/**
* Copyright 2010 The ForPlay Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package forplay.core;
/**
* Generic platform interface. New platforms are defined as implementations of this interface.
*/
public interface Platform {
Audio audio();
Graphics graphics();
AssetManager assetManager();
Json json();
Keyboard keyboard();
Log log();
Net net();
Pointer pointer();
Mouse mouse();
Storage storage();
Analytics analytics();
float random();
void run(Game game);
double time();
RegularExpression regularExpression();
void openURL(String url);
}
| /**
* Copyright 2010 The ForPlay Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package forplay.core;
/**
* Generic platform interface. New platforms are defined as implementations of this interface.
*/
public interface Platform {
Audio audio();
Graphics graphics();
AssetManager assetManager();
Json json();
Keyboard keyboard();
Log log();
Net net();
Pointer pointer();
- /**
- * Return the mouse if it is supported, or null otherwise.
- *
- * @return the mouse if it is supported, or null otherwise.
- */
Mouse mouse();
Storage storage();
Analytics analytics();
float random();
void run(Game game);
double time();
RegularExpression regularExpression();
void openURL(String url);
} | 5 | 0.084746 | 0 | 5 |
b06093268dd6fc485daab14afc1e1d9c5f9736ec | README.md | README.md | [](https://travis-ci.org/darrenleeweber/rdf-resource) [](https://gemnasium.com/darrenleeweber/rdf-resource) [](http://badge.fury.io/rb/rdf-resource)
# rdf-resource
A utility for working with RDF resources and vocabularies
It uses RDF.rb and several RDF::Vocab, with options for
caching RDF resources.
See https://github.com/sul-dlss/rdf-resource/blob/master/lib/rdf-resource/resource.rb
| [](https://travis-ci.org/darrenleeweber/rdf-resource) [](http://badge.fury.io/rb/rdf-resource)
# rdf-resource
A utility for working with RDF resources and vocabularies
It uses RDF.rb and several RDF::Vocab, with options for
caching RDF resources.
See https://github.com/sul-dlss/rdf-resource/blob/master/lib/rdf-resource/resource.rb
| Remove gemnasium badge - replace service with dependabot | Remove gemnasium badge - replace service with dependabot
| Markdown | apache-2.0 | sul-dlss/rdf-resource,sul-dlss/rdf-resource | markdown | ## Code Before:
[](https://travis-ci.org/darrenleeweber/rdf-resource) [](https://gemnasium.com/darrenleeweber/rdf-resource) [](http://badge.fury.io/rb/rdf-resource)
# rdf-resource
A utility for working with RDF resources and vocabularies
It uses RDF.rb and several RDF::Vocab, with options for
caching RDF resources.
See https://github.com/sul-dlss/rdf-resource/blob/master/lib/rdf-resource/resource.rb
## Instruction:
Remove gemnasium badge - replace service with dependabot
## Code After:
[](https://travis-ci.org/darrenleeweber/rdf-resource) [](http://badge.fury.io/rb/rdf-resource)
# rdf-resource
A utility for working with RDF resources and vocabularies
It uses RDF.rb and several RDF::Vocab, with options for
caching RDF resources.
See https://github.com/sul-dlss/rdf-resource/blob/master/lib/rdf-resource/resource.rb
| - [](https://travis-ci.org/darrenleeweber/rdf-resource) [](https://gemnasium.com/darrenleeweber/rdf-resource) [](http://badge.fury.io/rb/rdf-resource)
? ---------------------------------------------------------------------------------------------------------------------------------
+ [](https://travis-ci.org/darrenleeweber/rdf-resource) [](http://badge.fury.io/rb/rdf-resource)
# rdf-resource
A utility for working with RDF resources and vocabularies
It uses RDF.rb and several RDF::Vocab, with options for
caching RDF resources.
See https://github.com/sul-dlss/rdf-resource/blob/master/lib/rdf-resource/resource.rb | 2 | 0.222222 | 1 | 1 |
f8ba3a678bd30525d41c2f34466aadda0d37412a | src/CrudGenerator/MetaData/DataObject/MetaDataColumnDataObjectCollection.php | src/CrudGenerator/MetaData/DataObject/MetaDataColumnDataObjectCollection.php | <?php
namespace CrudGenerator\MetaData\DataObject;
use ArrayObject;
use CrudGenerator\MetaData\MetaDataColumnDataObject;
class MetaDataColumnDataObjectCollection extends ArrayObject
{
}
| <?php
namespace CrudGenerator\MetaData\DataObject;
use ArrayObject;
class MetaDataColumnDataObjectCollection extends ArrayObject
{
}
| Delete a use statement who were not used | Delete a use statement who were not used
| PHP | mit | fezfez/codeGenerator,fezfez/codeGenerator | php | ## Code Before:
<?php
namespace CrudGenerator\MetaData\DataObject;
use ArrayObject;
use CrudGenerator\MetaData\MetaDataColumnDataObject;
class MetaDataColumnDataObjectCollection extends ArrayObject
{
}
## Instruction:
Delete a use statement who were not used
## Code After:
<?php
namespace CrudGenerator\MetaData\DataObject;
use ArrayObject;
class MetaDataColumnDataObjectCollection extends ArrayObject
{
}
| <?php
namespace CrudGenerator\MetaData\DataObject;
use ArrayObject;
- use CrudGenerator\MetaData\MetaDataColumnDataObject;
-
class MetaDataColumnDataObjectCollection extends ArrayObject
{
} | 2 | 0.166667 | 0 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.