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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
822ccad5510b0e8d7c91f6d674d1611edc7d6b07 | lib/pinguin/checks/http.rb | lib/pinguin/checks/http.rb | require 'pinguin/success'
require 'pinguin/failure'
require 'net/http'
module Pinguin
module Checks
class HTTP
attr_reader :url
attr_reader :response_code
attr_reader :follow_redirects
alias follow_redirects? follow_redirects
attr_reader :redirect_limit
def initialize(options={})
@url = options.fetch('url')
response_code_spec = options.fetch('response_code', '2xx').to_s
@response_code = /\A#{response_code_spec.gsub('x', '.')}\z/
@follow_redirects = options.fetch('follow_redirects', true)
@redirect_limit = options.fetch('redirect_limit', 5)
freeze
end
def check
tries = 0
uri = URI.parse(url)
loop do
tries += 1
response = _http(uri).request(_request(uri))
if response_code =~ response.code
return Success.new
else
if response.code.start_with?('3') && follow_redirects? && tries < redirect_limit+1
uri = URI.parse(response['Location'])
next
else
return Failure.new
end
end
end
end
def _request(uri)
request = Net::HTTP::Get.new(uri.request_uri)
end
def _http(uri)
http = Net::HTTP.new(uri.host, uri.port)
end
end
end
end
| require 'pinguin/success'
require 'pinguin/failure'
require 'net/http'
module Pinguin
module Checks
class HTTP
attr_reader :url
attr_reader :response_code
attr_reader :follow_redirects
alias follow_redirects? follow_redirects
attr_reader :redirect_limit
def initialize(options={})
@url = options.fetch('url')
@response_code = options.fetch('response_code', '2xx')
@follow_redirects = options.fetch('follow_redirects', true)
@redirect_limit = options.fetch('redirect_limit', 5)
freeze
end
def check
tries = 0
uri = URI.parse(url)
loop do
tries += 1
response = _http(uri).request(_request(uri))
if _response_code_spec =~ response.code
return Success.new
else
if response.code.start_with?('3') && follow_redirects? && tries < redirect_limit+1
uri = URI.parse(response['Location'])
next
else
return Failure.new
end
end
end
end
def _request(uri)
request = Net::HTTP::Get.new(uri.request_uri)
end
def _http(uri)
http = Net::HTTP.new(uri.host, uri.port)
end
def _response_code_spec
/\A#{response_code.to_s.gsub('x', '.')}\z/
end
end
end
end
| Move response code regexp building out of the constructor | Move response code regexp building out of the constructor
| Ruby | mit | michaelfairley/pinguin | ruby | ## Code Before:
require 'pinguin/success'
require 'pinguin/failure'
require 'net/http'
module Pinguin
module Checks
class HTTP
attr_reader :url
attr_reader :response_code
attr_reader :follow_redirects
alias follow_redirects? follow_redirects
attr_reader :redirect_limit
def initialize(options={})
@url = options.fetch('url')
response_code_spec = options.fetch('response_code', '2xx').to_s
@response_code = /\A#{response_code_spec.gsub('x', '.')}\z/
@follow_redirects = options.fetch('follow_redirects', true)
@redirect_limit = options.fetch('redirect_limit', 5)
freeze
end
def check
tries = 0
uri = URI.parse(url)
loop do
tries += 1
response = _http(uri).request(_request(uri))
if response_code =~ response.code
return Success.new
else
if response.code.start_with?('3') && follow_redirects? && tries < redirect_limit+1
uri = URI.parse(response['Location'])
next
else
return Failure.new
end
end
end
end
def _request(uri)
request = Net::HTTP::Get.new(uri.request_uri)
end
def _http(uri)
http = Net::HTTP.new(uri.host, uri.port)
end
end
end
end
## Instruction:
Move response code regexp building out of the constructor
## Code After:
require 'pinguin/success'
require 'pinguin/failure'
require 'net/http'
module Pinguin
module Checks
class HTTP
attr_reader :url
attr_reader :response_code
attr_reader :follow_redirects
alias follow_redirects? follow_redirects
attr_reader :redirect_limit
def initialize(options={})
@url = options.fetch('url')
@response_code = options.fetch('response_code', '2xx')
@follow_redirects = options.fetch('follow_redirects', true)
@redirect_limit = options.fetch('redirect_limit', 5)
freeze
end
def check
tries = 0
uri = URI.parse(url)
loop do
tries += 1
response = _http(uri).request(_request(uri))
if _response_code_spec =~ response.code
return Success.new
else
if response.code.start_with?('3') && follow_redirects? && tries < redirect_limit+1
uri = URI.parse(response['Location'])
next
else
return Failure.new
end
end
end
end
def _request(uri)
request = Net::HTTP::Get.new(uri.request_uri)
end
def _http(uri)
http = Net::HTTP.new(uri.host, uri.port)
end
def _response_code_spec
/\A#{response_code.to_s.gsub('x', '.')}\z/
end
end
end
end
| require 'pinguin/success'
require 'pinguin/failure'
require 'net/http'
module Pinguin
module Checks
class HTTP
attr_reader :url
attr_reader :response_code
attr_reader :follow_redirects
alias follow_redirects? follow_redirects
attr_reader :redirect_limit
def initialize(options={})
@url = options.fetch('url')
- response_code_spec = options.fetch('response_code', '2xx').to_s
? ----- -----
+ @response_code = options.fetch('response_code', '2xx')
? +
- @response_code = /\A#{response_code_spec.gsub('x', '.')}\z/
@follow_redirects = options.fetch('follow_redirects', true)
@redirect_limit = options.fetch('redirect_limit', 5)
freeze
end
def check
tries = 0
uri = URI.parse(url)
loop do
tries += 1
response = _http(uri).request(_request(uri))
- if response_code =~ response.code
+ if _response_code_spec =~ response.code
? + +++++
return Success.new
else
if response.code.start_with?('3') && follow_redirects? && tries < redirect_limit+1
uri = URI.parse(response['Location'])
next
else
return Failure.new
end
end
end
end
def _request(uri)
request = Net::HTTP::Get.new(uri.request_uri)
end
def _http(uri)
http = Net::HTTP.new(uri.host, uri.port)
end
+
+ def _response_code_spec
+ /\A#{response_code.to_s.gsub('x', '.')}\z/
+ end
end
end
end | 9 | 0.166667 | 6 | 3 |
e3a2fd7c060f201911485028c7d8218c626828bc | src/core/Iterable.pm | src/core/Iterable.pm | my class Iterable {
# Has parent Cool declared in BOOTSTRAP
method elems() { self.list.elems }
method infinite() { Mu }
method item($self:) { $self }
method Int() { self.elems }
method Num() { self.elems.Num }
multi method Numeric(Iterable:D:) { self.elems }
multi method Str(Iterable:D:) { self.list.Str }
}
| my class Iterable {
# Has parent Cool declared in BOOTSTRAP
method elems() { self.list.elems }
method infinite() { Mu }
method item($self:) { $self }
method fmt($format = '%s', $separator = ' ') {
self.list.fmt($format, $separator)
}
method Int() { self.elems }
method Num() { self.elems.Num }
multi method Numeric(Iterable:D:) { self.elems }
multi method Str(Iterable:D:) { self.list.Str }
}
| Make (1..10).fmt(...) work again; masak++ for noting it. | Make (1..10).fmt(...) work again; masak++ for noting it.
| Perl | artistic-2.0 | pmurias/rakudo,dwarring/rakudo,rakudo/rakudo,MasterDuke17/rakudo,softmoth/rakudo,jonathanstowe/rakudo,samcv/rakudo,rakudo/rakudo,nunorc/rakudo,salortiz/rakudo,ugexe/rakudo,laben/rakudo,sjn/rakudo,salortiz/rakudo,sergot/rakudo,nbrown/rakudo,MasterDuke17/rakudo,dankogai/rakudo,ungrim97/rakudo,skids/rakudo,laben/rakudo,nunorc/rakudo,zostay/rakudo,Leont/rakudo,paultcochrane/rakudo,raydiak/rakudo,ab5tract/rakudo,tony-o/deb-rakudodaily,raydiak/rakudo,pmurias/rakudo,tony-o/deb-rakudodaily,ab5tract/rakudo,softmoth/rakudo,lucasbuchala/rakudo,nbrown/rakudo,sjn/rakudo,niner/rakudo,tbrowder/rakudo,ugexe/rakudo,ab5tract/rakudo,tbrowder/rakudo,tony-o/rakudo,sergot/rakudo,LLFourn/rakudo,niner/rakudo,paultcochrane/rakudo,nunorc/rakudo,samcv/rakudo,softmoth/rakudo,usev6/rakudo,Gnouc/rakudo,LLFourn/rakudo,sjn/rakudo,rakudo/rakudo,salortiz/rakudo,labster/rakudo,samcv/rakudo,softmoth/rakudo,dwarring/rakudo,sjn/rakudo,Leont/rakudo,raydiak/rakudo,tony-o/deb-rakudodaily,dankogai/rakudo,tony-o/rakudo,LLFourn/rakudo,azawawi/rakudo,cognominal/rakudo,Gnouc/rakudo,labster/rakudo,dwarring/rakudo,tony-o/rakudo,lucasbuchala/rakudo,MasterDuke17/rakudo,MasterDuke17/rakudo,awwaiid/rakudo,salortiz/rakudo,lucasbuchala/rakudo,paultcochrane/rakudo,retupmoca/rakudo,nbrown/rakudo,Gnouc/rakudo,teodozjan/rakudo,tony-o/rakudo,tony-o/deb-rakudodaily,b2gills/rakudo,niner/rakudo,azawawi/rakudo,cognominal/rakudo,sergot/rakudo,awwaiid/rakudo,azawawi/rakudo,rjbs/rakudo,softmoth/rakudo,teodozjan/rakudo,MasterDuke17/rakudo,zhuomingliang/rakudo,zostay/rakudo,usev6/rakudo,ab5tract/rakudo,nbrown/rakudo,b2gills/rakudo,dwarring/rakudo,teodozjan/rakudo,raydiak/rakudo,lucasbuchala/rakudo,retupmoca/rakudo,tbrowder/rakudo,ab5tract/rakudo,niner/rakudo,skids/rakudo,dankogai/rakudo,sergot/rakudo,awwaiid/rakudo,lucasbuchala/rakudo,zostay/rakudo,samcv/rakudo,dankogai/rakudo,paultcochrane/rakudo,cognominal/rakudo,awwaiid/rakudo,zhuomingliang/rakudo,tbrowder/rakudo,Gnouc/rakudo,labster/rakudo,tony-o/deb-rakudodaily,tbrowder/rakudo,tony-o/deb-rakudodaily,labster/rakudo,skids/rakudo,laben/rakudo,sjn/rakudo,b2gills/rakudo,cygx/rakudo,pmurias/rakudo,Gnouc/rakudo,jonathanstowe/rakudo,retupmoca/rakudo,Gnouc/rakudo,rjbs/rakudo,ungrim97/rakudo,nunorc/rakudo,ungrim97/rakudo,rakudo/rakudo,Leont/rakudo,b2gills/rakudo,jonathanstowe/rakudo,teodozjan/rakudo,tony-o/rakudo,salortiz/rakudo,salortiz/rakudo,rakudo/rakudo,cygx/rakudo,nbrown/rakudo,skids/rakudo,ugexe/rakudo,zostay/rakudo,cognominal/rakudo,pmurias/rakudo,ungrim97/rakudo,cygx/rakudo,rakudo/rakudo,cygx/rakudo,ugexe/rakudo,labster/rakudo,usev6/rakudo,nbrown/rakudo,awwaiid/rakudo,ugexe/rakudo,skids/rakudo,MasterDuke17/rakudo,Leont/rakudo,paultcochrane/rakudo,zhuomingliang/rakudo,LLFourn/rakudo,usev6/rakudo,tony-o/deb-rakudodaily,jonathanstowe/rakudo,jonathanstowe/rakudo,zhuomingliang/rakudo,LLFourn/rakudo,rjbs/rakudo,cygx/rakudo,tony-o/rakudo,laben/rakudo,dankogai/rakudo,labster/rakudo,retupmoca/rakudo,azawawi/rakudo,azawawi/rakudo,samcv/rakudo,usev6/rakudo,b2gills/rakudo,cognominal/rakudo,ungrim97/rakudo,tbrowder/rakudo | perl | ## Code Before:
my class Iterable {
# Has parent Cool declared in BOOTSTRAP
method elems() { self.list.elems }
method infinite() { Mu }
method item($self:) { $self }
method Int() { self.elems }
method Num() { self.elems.Num }
multi method Numeric(Iterable:D:) { self.elems }
multi method Str(Iterable:D:) { self.list.Str }
}
## Instruction:
Make (1..10).fmt(...) work again; masak++ for noting it.
## Code After:
my class Iterable {
# Has parent Cool declared in BOOTSTRAP
method elems() { self.list.elems }
method infinite() { Mu }
method item($self:) { $self }
method fmt($format = '%s', $separator = ' ') {
self.list.fmt($format, $separator)
}
method Int() { self.elems }
method Num() { self.elems.Num }
multi method Numeric(Iterable:D:) { self.elems }
multi method Str(Iterable:D:) { self.list.Str }
}
| my class Iterable {
# Has parent Cool declared in BOOTSTRAP
method elems() { self.list.elems }
method infinite() { Mu }
method item($self:) { $self }
+
+ method fmt($format = '%s', $separator = ' ') {
+ self.list.fmt($format, $separator)
+ }
method Int() { self.elems }
method Num() { self.elems.Num }
multi method Numeric(Iterable:D:) { self.elems }
multi method Str(Iterable:D:) { self.list.Str }
} | 4 | 0.333333 | 4 | 0 |
ee39190e60259337f51bd1be680c481184f3d37a | dev-with-windows-terminal/Microsoft.Powershell_profile.ps1 | dev-with-windows-terminal/Microsoft.Powershell_profile.ps1 | function Test-Installed
{
$Name = $args[0]
Get-Module -ListAvailable -Name $Name
}
if (Test-Installed posh-git) {
Import-Module posh-git
}
if (Test-Installed oh-my-posh) {
Import-Module oh-my-posh
}
if (Test-Installed Get-ChildItemColor) {
Import-Module Get-ChildItemColor
}
if (Test-Installed pwsh-handy-helpers) {
Import-Module pwsh-handy-helpers
}
#
# Set Oh-my-posh theme
#
Set-Theme Agnoster
#
# Import Chocolatey profile
#
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path $ChocolateyProfile) {
Import-Module "$ChocolateyProfile"
}
#
# Directory traversal shortcuts
#
for($i = 1; $i -le 5; $i++) {
$u = "".PadLeft($i,"u")
$d = $u.Replace("u","../")
Invoke-Expression "function $u { push-location $d }"
} | function Test-Installed
{
$Name = $args[0]
Get-Module -ListAvailable -Name $Name
}
if (Test-Installed PSReadLine) {
Import-Module PSReadLine
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward
}
if (Test-Installed posh-git) {
Import-Module posh-git
}
if (Test-Installed oh-my-posh) {
Import-Module oh-my-posh
}
if (Test-Installed Get-ChildItemColor) {
Import-Module Get-ChildItemColor
}
if (Test-Installed pwsh-handy-helpers) {
Import-Module pwsh-handy-helpers
}
#
# Set Oh-my-posh theme
#
Set-Theme Agnoster
#
# Import Chocolatey profile
#
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path $ChocolateyProfile) {
Import-Module "$ChocolateyProfile"
}
#
# Directory traversal shortcuts
#
for($i = 1; $i -le 5; $i++) {
$u = "".PadLeft($i,"u")
$d = $u.Replace("u","../")
Invoke-Expression "function $u { push-location $d }"
} | Add bash-like autocomplete features using PSReadline | feat: Add bash-like autocomplete features using PSReadline
| PowerShell | mit | jhwohlgemuth/techtonic-env,jhwohlgemuth/techtonic-datastore,jhwohlgemuth/techtonic-env,jhwohlgemuth/techtonic-datastore | powershell | ## Code Before:
function Test-Installed
{
$Name = $args[0]
Get-Module -ListAvailable -Name $Name
}
if (Test-Installed posh-git) {
Import-Module posh-git
}
if (Test-Installed oh-my-posh) {
Import-Module oh-my-posh
}
if (Test-Installed Get-ChildItemColor) {
Import-Module Get-ChildItemColor
}
if (Test-Installed pwsh-handy-helpers) {
Import-Module pwsh-handy-helpers
}
#
# Set Oh-my-posh theme
#
Set-Theme Agnoster
#
# Import Chocolatey profile
#
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path $ChocolateyProfile) {
Import-Module "$ChocolateyProfile"
}
#
# Directory traversal shortcuts
#
for($i = 1; $i -le 5; $i++) {
$u = "".PadLeft($i,"u")
$d = $u.Replace("u","../")
Invoke-Expression "function $u { push-location $d }"
}
## Instruction:
feat: Add bash-like autocomplete features using PSReadline
## Code After:
function Test-Installed
{
$Name = $args[0]
Get-Module -ListAvailable -Name $Name
}
if (Test-Installed PSReadLine) {
Import-Module PSReadLine
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward
}
if (Test-Installed posh-git) {
Import-Module posh-git
}
if (Test-Installed oh-my-posh) {
Import-Module oh-my-posh
}
if (Test-Installed Get-ChildItemColor) {
Import-Module Get-ChildItemColor
}
if (Test-Installed pwsh-handy-helpers) {
Import-Module pwsh-handy-helpers
}
#
# Set Oh-my-posh theme
#
Set-Theme Agnoster
#
# Import Chocolatey profile
#
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path $ChocolateyProfile) {
Import-Module "$ChocolateyProfile"
}
#
# Directory traversal shortcuts
#
for($i = 1; $i -le 5; $i++) {
$u = "".PadLeft($i,"u")
$d = $u.Replace("u","../")
Invoke-Expression "function $u { push-location $d }"
} | function Test-Installed
{
$Name = $args[0]
Get-Module -ListAvailable -Name $Name
+ }
+ if (Test-Installed PSReadLine) {
+ Import-Module PSReadLine
+ Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
+ Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
+ Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward
}
if (Test-Installed posh-git) {
Import-Module posh-git
}
if (Test-Installed oh-my-posh) {
Import-Module oh-my-posh
}
if (Test-Installed Get-ChildItemColor) {
Import-Module Get-ChildItemColor
}
if (Test-Installed pwsh-handy-helpers) {
Import-Module pwsh-handy-helpers
}
#
# Set Oh-my-posh theme
#
Set-Theme Agnoster
#
# Import Chocolatey profile
#
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path $ChocolateyProfile) {
Import-Module "$ChocolateyProfile"
}
#
# Directory traversal shortcuts
#
for($i = 1; $i -le 5; $i++) {
$u = "".PadLeft($i,"u")
$d = $u.Replace("u","../")
Invoke-Expression "function $u { push-location $d }"
} | 6 | 0.166667 | 6 | 0 |
5355fcba5b20cb0c2379f57084438e74c0bd43f2 | app/controllers/articles_controller.rb | app/controllers/articles_controller.rb | class ArticlesController < ApplicationController
before_filter :authenticate_user!, only: [:destroy]
def index
@articles = Article.search(params[:search])
end
def show
@article = ArticleDecorator.new(find_article_by_params)
end
def new
@article = Article.new
end
def create
@article = Article.new(article_params)
@article.author = current_user
redirect_to @article if @article.save
end
def edit
@article = find_article_by_params
end
def update
@article = find_article_by_params
@article.author = @article.author || current_user
redirect_to @article if @article.update_attributes(article_params)
end
def destroy
@article = find_article_by_params
redirect_to articles_url if @article.destroy
end
private
def article_params
params.require(:article).permit(:title, :content)
end
def find_article_by_params
Article.find(params[:id])
end
end
| class ArticlesController < ApplicationController
before_filter :authenticate_user!, except: [:index]
def index
@articles = Article.search(params[:search])
end
def show
@article = ArticleDecorator.new(find_article_by_params)
end
def new
@article = Article.new
end
def create
@article = Article.new(article_params)
@article.author = current_user
redirect_to @article if @article.save
end
def edit
@article = find_article_by_params
end
def update
@article = find_article_by_params
@article.author = @article.author || current_user
redirect_to @article if @article.update_attributes(article_params)
end
def destroy
@article = find_article_by_params
redirect_to articles_url if @article.destroy
end
private
def article_params
params.require(:article).permit(:title, :content)
end
def find_article_by_params
Article.find(params[:id])
end
end
| Add authentication to everything except the index. | Add authentication to everything except the index.
| Ruby | mit | liufffan/orientation,ferdinandrosario/orientation,twinn/orientation,cmckni3/orientation,orientation/orientation,liufffan/orientation,codio/orientation,orientation/orientation,hashrocket/orientation,friism/orientation,IZEA/orientation,friism/orientation,splicers/orientation,Scripted/orientation,Scripted/orientation,robomc/orientation,ferdinandrosario/orientation,jefmathiot/orientation,cmckni3/orientation,robomc/orientation,splicers/orientation,hashrocket/orientation,codeschool/orientation,codeschool/orientation,orientation/orientation,orientation/orientation,smashingboxes/orientation,IZEA/orientation,twinn/orientation,codeschool/orientation,LogicalBricks/orientation,codio/orientation,splicers/orientation,cmckni3/orientation,jefmathiot/orientation,LogicalBricks/orientation,Scripted/orientation,smashingboxes/orientation | ruby | ## Code Before:
class ArticlesController < ApplicationController
before_filter :authenticate_user!, only: [:destroy]
def index
@articles = Article.search(params[:search])
end
def show
@article = ArticleDecorator.new(find_article_by_params)
end
def new
@article = Article.new
end
def create
@article = Article.new(article_params)
@article.author = current_user
redirect_to @article if @article.save
end
def edit
@article = find_article_by_params
end
def update
@article = find_article_by_params
@article.author = @article.author || current_user
redirect_to @article if @article.update_attributes(article_params)
end
def destroy
@article = find_article_by_params
redirect_to articles_url if @article.destroy
end
private
def article_params
params.require(:article).permit(:title, :content)
end
def find_article_by_params
Article.find(params[:id])
end
end
## Instruction:
Add authentication to everything except the index.
## Code After:
class ArticlesController < ApplicationController
before_filter :authenticate_user!, except: [:index]
def index
@articles = Article.search(params[:search])
end
def show
@article = ArticleDecorator.new(find_article_by_params)
end
def new
@article = Article.new
end
def create
@article = Article.new(article_params)
@article.author = current_user
redirect_to @article if @article.save
end
def edit
@article = find_article_by_params
end
def update
@article = find_article_by_params
@article.author = @article.author || current_user
redirect_to @article if @article.update_attributes(article_params)
end
def destroy
@article = find_article_by_params
redirect_to articles_url if @article.destroy
end
private
def article_params
params.require(:article).permit(:title, :content)
end
def find_article_by_params
Article.find(params[:id])
end
end
| class ArticlesController < ApplicationController
- before_filter :authenticate_user!, only: [:destroy]
? ^^^^ ^^^^^
+ before_filter :authenticate_user!, except: [:index]
? ^^^^^^ ++ ^
def index
@articles = Article.search(params[:search])
end
def show
@article = ArticleDecorator.new(find_article_by_params)
end
def new
@article = Article.new
end
def create
@article = Article.new(article_params)
@article.author = current_user
redirect_to @article if @article.save
end
def edit
@article = find_article_by_params
end
def update
@article = find_article_by_params
@article.author = @article.author || current_user
redirect_to @article if @article.update_attributes(article_params)
end
def destroy
@article = find_article_by_params
- redirect_to articles_url if @article.destroy
? --
+ redirect_to articles_url if @article.destroy
end
private
def article_params
- params.require(:article).permit(:title, :content)
? ----
+ params.require(:article).permit(:title, :content)
end
def find_article_by_params
Article.find(params[:id])
end
end | 6 | 0.130435 | 3 | 3 |
139b8184b95be8af4558c172243bc0c6c9d35ffc | projects/stylesheet/cheat-sheet.css | projects/stylesheet/cheat-sheet.css | body {
margin: 0;
height: 100%;
width: 100%;
}
h1, footer {
background-color: #000;
color: #fff;
margin: 0;
padding-top: 20px;
padding-bottom: 20px;
}
h1 {
text-align: center;
}
h1, h2, span {
text-transform: uppercase;
}
h2 {
background-color: #000;
color: #fff;
text-align: center;
}
span {
color: blue;
}
footer{
padding-left: 20px;
}
#columns {
columns: 2;
-webkit-columns: 2;
-moz-columns: 2;
padding-bottom: 30px;
}
.column-1 {
width: 50%;
height: 1000px;
padding: 30px;
margin-left: 50px;
}
.column-2 {
width: 50%;
height: 1000px;
padding: 30px;
}
.query-statement {
background-color: grey;
}
| /*Base Rules*/
body {
margin: 0;
height: 100%;
width: 100%;
}
h1, footer {
background-color: #000;
color: #fff;
margin: 0;
padding-top: 20px;
padding-bottom: 20px;
}
h1 {
text-align: center;
}
h1, h2, span {
text-transform: uppercase;
}
h2 {
background-color: #000;
color: #fff;
text-align: center;
}
span {
color: blue;
}
footer{
padding-left: 20px;
}
/*Module Rules*/
#columns {
columns: 2;
-webkit-columns: 2;
-moz-columns: 2;
padding-bottom: 30px;
}
.column-1 {
width: 50%;
height: 1000px;
padding: 30px;
margin-left: 50px;
}
.column-2 {
width: 50%;
height: 1000px;
padding: 30px;
}
| Add style rules to css sheet | Add style rules to css sheet
| CSS | mit | nchambe2/nchambe2.github.io | css | ## Code Before:
body {
margin: 0;
height: 100%;
width: 100%;
}
h1, footer {
background-color: #000;
color: #fff;
margin: 0;
padding-top: 20px;
padding-bottom: 20px;
}
h1 {
text-align: center;
}
h1, h2, span {
text-transform: uppercase;
}
h2 {
background-color: #000;
color: #fff;
text-align: center;
}
span {
color: blue;
}
footer{
padding-left: 20px;
}
#columns {
columns: 2;
-webkit-columns: 2;
-moz-columns: 2;
padding-bottom: 30px;
}
.column-1 {
width: 50%;
height: 1000px;
padding: 30px;
margin-left: 50px;
}
.column-2 {
width: 50%;
height: 1000px;
padding: 30px;
}
.query-statement {
background-color: grey;
}
## Instruction:
Add style rules to css sheet
## Code After:
/*Base Rules*/
body {
margin: 0;
height: 100%;
width: 100%;
}
h1, footer {
background-color: #000;
color: #fff;
margin: 0;
padding-top: 20px;
padding-bottom: 20px;
}
h1 {
text-align: center;
}
h1, h2, span {
text-transform: uppercase;
}
h2 {
background-color: #000;
color: #fff;
text-align: center;
}
span {
color: blue;
}
footer{
padding-left: 20px;
}
/*Module Rules*/
#columns {
columns: 2;
-webkit-columns: 2;
-moz-columns: 2;
padding-bottom: 30px;
}
.column-1 {
width: 50%;
height: 1000px;
padding: 30px;
margin-left: 50px;
}
.column-2 {
width: 50%;
height: 1000px;
padding: 30px;
}
| + /*Base Rules*/
body {
margin: 0;
height: 100%;
width: 100%;
}
h1, footer {
background-color: #000;
color: #fff;
margin: 0;
padding-top: 20px;
padding-bottom: 20px;
}
h1 {
text-align: center;
}
h1, h2, span {
text-transform: uppercase;
}
h2 {
background-color: #000;
color: #fff;
text-align: center;
}
span {
color: blue;
}
footer{
padding-left: 20px;
}
+ /*Module Rules*/
#columns {
columns: 2;
-webkit-columns: 2;
-moz-columns: 2;
padding-bottom: 30px;
}
.column-1 {
width: 50%;
height: 1000px;
padding: 30px;
margin-left: 50px;
}
.column-2 {
width: 50%;
height: 1000px;
padding: 30px;
}
- .query-statement {
- background-color: grey;
- }
| 5 | 0.083333 | 2 | 3 |
ca37730b454b966c4d7f4a1fdbf440e8305e058c | .travis.yml | .travis.yml | language: elixir
elixir:
- 1.0.5
- 1.1.1
otp_release:
- 17.5
- 18.1
after_script:
- mix deps.get --only docs
- MIX_ENV=docs mix inch.report
| language: elixir
elixir:
- 1.1.1
- 1.2.0
otp_release:
- 18.1
after_script:
- mix deps.get --only docs
- MIX_ENV=docs mix inch.report
| Add the new Elixir 1.2 to run tests against it | Add the new Elixir 1.2 to run tests against it
| YAML | mit | philss/floki,philss/floki | yaml | ## Code Before:
language: elixir
elixir:
- 1.0.5
- 1.1.1
otp_release:
- 17.5
- 18.1
after_script:
- mix deps.get --only docs
- MIX_ENV=docs mix inch.report
## Instruction:
Add the new Elixir 1.2 to run tests against it
## Code After:
language: elixir
elixir:
- 1.1.1
- 1.2.0
otp_release:
- 18.1
after_script:
- mix deps.get --only docs
- MIX_ENV=docs mix inch.report
| language: elixir
elixir:
- - 1.0.5
- 1.1.1
+ - 1.2.0
otp_release:
- - 17.5
- 18.1
after_script:
- mix deps.get --only docs
- MIX_ENV=docs mix inch.report | 3 | 0.272727 | 1 | 2 |
c533835365c9186559f302d1ee59e6a15f202efd | test/integration/setup_teardown.coffee | test/integration/setup_teardown.coffee | require './setup_teardown'
cleaner = require '../cleaner'
{wd40, browser} = require 'wd40'
base_url = process.env.CU_TEST_URL ? 'http://localhost:3001'
login_url = "#{base_url}/login"
logout_url = "#{base_url}/logout"
before (done) ->
console.log "[scraperwiki global before]"
cleaner.clear_and_set_fixtures ->
console.log "Cleared and set fixtures"
wd40.init ->
browser.get login_url, done
after (done) ->
console.log "[scraperwiki global after]"
browser.quit done
# done() | require './setup_teardown'
{parallel} = require 'async'
cleaner = require '../cleaner'
{wd40, browser} = require 'wd40'
base_url = process.env.CU_TEST_URL ? 'http://localhost:3001'
login_url = "#{base_url}/login"
logout_url = "#{base_url}/logout"
before (done) ->
console.log "[scraperwiki global before]"
parallel [
(cb) ->
cleaner.clear_and_set_fixtures ->
cb()
(cb) ->
wd40.init ->
browser.get base_url, ->
cb()
], done
after (done) ->
console.log "[scraperwiki global after]"
browser.quit done
| Initialize browser and database in parallel | Initialize browser and database in parallel
| CoffeeScript | agpl-3.0 | scraperwiki/custard,scraperwiki/custard,scraperwiki/custard | coffeescript | ## Code Before:
require './setup_teardown'
cleaner = require '../cleaner'
{wd40, browser} = require 'wd40'
base_url = process.env.CU_TEST_URL ? 'http://localhost:3001'
login_url = "#{base_url}/login"
logout_url = "#{base_url}/logout"
before (done) ->
console.log "[scraperwiki global before]"
cleaner.clear_and_set_fixtures ->
console.log "Cleared and set fixtures"
wd40.init ->
browser.get login_url, done
after (done) ->
console.log "[scraperwiki global after]"
browser.quit done
# done()
## Instruction:
Initialize browser and database in parallel
## Code After:
require './setup_teardown'
{parallel} = require 'async'
cleaner = require '../cleaner'
{wd40, browser} = require 'wd40'
base_url = process.env.CU_TEST_URL ? 'http://localhost:3001'
login_url = "#{base_url}/login"
logout_url = "#{base_url}/logout"
before (done) ->
console.log "[scraperwiki global before]"
parallel [
(cb) ->
cleaner.clear_and_set_fixtures ->
cb()
(cb) ->
wd40.init ->
browser.get base_url, ->
cb()
], done
after (done) ->
console.log "[scraperwiki global after]"
browser.quit done
| require './setup_teardown'
+ {parallel} = require 'async'
cleaner = require '../cleaner'
{wd40, browser} = require 'wd40'
base_url = process.env.CU_TEST_URL ? 'http://localhost:3001'
login_url = "#{base_url}/login"
logout_url = "#{base_url}/logout"
before (done) ->
console.log "[scraperwiki global before]"
+
+ parallel [
+ (cb) ->
- cleaner.clear_and_set_fixtures ->
+ cleaner.clear_and_set_fixtures ->
? ++++
- console.log "Cleared and set fixtures"
+ cb()
+ (cb) ->
- wd40.init ->
+ wd40.init ->
? ++
- browser.get login_url, done
? ^^^^^ ^^^^
+ browser.get base_url, ->
? ++ ^^^^ ^^
+ cb()
+ ], done
after (done) ->
console.log "[scraperwiki global after]"
browser.quit done
- # done() | 16 | 0.842105 | 11 | 5 |
babfc82613508e619e5debf044e68eaeae03ba11 | lib/node_modules/@stdlib/math/base/dist/degenerate/logcdf/lib/logcdf.js | lib/node_modules/@stdlib/math/base/dist/degenerate/logcdf/lib/logcdf.js | 'use strict';
// MODULES //
var isnan = require( '@stdlib/math/base/utils/is-nan' );
var NINF = require( '@stdlib/math/constants/float64-ninf' );
// MAIN //
/**
* Evaluates the logarithm of the cumulative distribution function (CDF) for a degenerate distribution with a point mass at `mu`.
*
* @param {number} x - input value
* @param {number} mu - constant value of distribution
* @returns {Probability} evaluated logarithm of cumulative distribution function
*
* @example
* var y = logcdf( 2.0, 3.0 );
* // returns Number.NEGATIVE_INFINITY
* @example
* var y = logcdf( 4.0, 3.0 );
* // returns 0
* @example
* var y = logcdf( 3.0, 3.0 );
* // returns 0
* @example
* var y = logcdf( NaN, 0.0 );
* // returns NaN
* @example
* var y = logcdf( 0.0, NaN );
* // returns NaN
*/
function logcdf( x, mu ) {
if ( isnan( x ) || isnan( mu ) ) {
return NaN;
}
return x < mu ? NINF : 0.0;
} // end FUNCTION logcdf()
// EXPORTS //
module.exports = logcdf;
| 'use strict';
// MODULES //
var isnan = require( '@stdlib/math/base/utils/is-nan' );
var NINF = require( '@stdlib/math/constants/float64-ninf' );
// MAIN //
/**
* Evaluates the natural logarithm of the cumulative distribution function (logCDF) for a degenerate distribution with mean `mu`.
*
* @param {number} x - input value
* @param {number} mu - constant value of distribution
* @returns {number} natural logarithm of cumulative distribution function
*
* @example
* var y = logcdf( 2.0, 3.0 );
* // returns Number.NEGATIVE_INFINITY
* @example
* var y = logcdf( 4.0, 3.0 );
* // returns 0.0
* @example
* var y = logcdf( 3.0, 3.0 );
* // returns 0.0
* @example
* var y = logcdf( NaN, 0.0 );
* // returns NaN
* @example
* var y = logcdf( 0.0, NaN );
* // returns NaN
*/
function logcdf( x, mu ) {
if ( isnan( x ) || isnan( mu ) ) {
return NaN;
}
return ( x < mu ) ? NINF : 0.0;
} // end FUNCTION logcdf()
// EXPORTS //
module.exports = logcdf;
| Fix return type and add decimal points | Fix return type and add decimal points
| JavaScript | apache-2.0 | stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib | javascript | ## Code Before:
'use strict';
// MODULES //
var isnan = require( '@stdlib/math/base/utils/is-nan' );
var NINF = require( '@stdlib/math/constants/float64-ninf' );
// MAIN //
/**
* Evaluates the logarithm of the cumulative distribution function (CDF) for a degenerate distribution with a point mass at `mu`.
*
* @param {number} x - input value
* @param {number} mu - constant value of distribution
* @returns {Probability} evaluated logarithm of cumulative distribution function
*
* @example
* var y = logcdf( 2.0, 3.0 );
* // returns Number.NEGATIVE_INFINITY
* @example
* var y = logcdf( 4.0, 3.0 );
* // returns 0
* @example
* var y = logcdf( 3.0, 3.0 );
* // returns 0
* @example
* var y = logcdf( NaN, 0.0 );
* // returns NaN
* @example
* var y = logcdf( 0.0, NaN );
* // returns NaN
*/
function logcdf( x, mu ) {
if ( isnan( x ) || isnan( mu ) ) {
return NaN;
}
return x < mu ? NINF : 0.0;
} // end FUNCTION logcdf()
// EXPORTS //
module.exports = logcdf;
## Instruction:
Fix return type and add decimal points
## Code After:
'use strict';
// MODULES //
var isnan = require( '@stdlib/math/base/utils/is-nan' );
var NINF = require( '@stdlib/math/constants/float64-ninf' );
// MAIN //
/**
* Evaluates the natural logarithm of the cumulative distribution function (logCDF) for a degenerate distribution with mean `mu`.
*
* @param {number} x - input value
* @param {number} mu - constant value of distribution
* @returns {number} natural logarithm of cumulative distribution function
*
* @example
* var y = logcdf( 2.0, 3.0 );
* // returns Number.NEGATIVE_INFINITY
* @example
* var y = logcdf( 4.0, 3.0 );
* // returns 0.0
* @example
* var y = logcdf( 3.0, 3.0 );
* // returns 0.0
* @example
* var y = logcdf( NaN, 0.0 );
* // returns NaN
* @example
* var y = logcdf( 0.0, NaN );
* // returns NaN
*/
function logcdf( x, mu ) {
if ( isnan( x ) || isnan( mu ) ) {
return NaN;
}
return ( x < mu ) ? NINF : 0.0;
} // end FUNCTION logcdf()
// EXPORTS //
module.exports = logcdf;
| 'use strict';
// MODULES //
var isnan = require( '@stdlib/math/base/utils/is-nan' );
var NINF = require( '@stdlib/math/constants/float64-ninf' );
// MAIN //
/**
- * Evaluates the logarithm of the cumulative distribution function (CDF) for a degenerate distribution with a point mass at `mu`.
? ---- ---------
+ * Evaluates the natural logarithm of the cumulative distribution function (logCDF) for a degenerate distribution with mean `mu`.
? ++++++++ +++ ++
*
* @param {number} x - input value
* @param {number} mu - constant value of distribution
- * @returns {Probability} evaluated logarithm of cumulative distribution function
? ^ --------- ^^ -----
+ * @returns {number} natural logarithm of cumulative distribution function
? ^^^^^ ^^^^^
*
* @example
* var y = logcdf( 2.0, 3.0 );
* // returns Number.NEGATIVE_INFINITY
* @example
* var y = logcdf( 4.0, 3.0 );
- * // returns 0
+ * // returns 0.0
? ++
* @example
* var y = logcdf( 3.0, 3.0 );
- * // returns 0
+ * // returns 0.0
? ++
* @example
* var y = logcdf( NaN, 0.0 );
* // returns NaN
* @example
* var y = logcdf( 0.0, NaN );
* // returns NaN
*/
function logcdf( x, mu ) {
if ( isnan( x ) || isnan( mu ) ) {
return NaN;
}
- return x < mu ? NINF : 0.0;
+ return ( x < mu ) ? NINF : 0.0;
? ++ ++
} // end FUNCTION logcdf()
// EXPORTS //
module.exports = logcdf; | 10 | 0.227273 | 5 | 5 |
758786dcb98fa66ecf212e94150aec86fbee5850 | version-history.rst | version-history.rst | Version History
---------------
0.9.3: 2015/05/28
- Minor documentation fixes.
0.9.2: 2015/05/28
- Added Sphinx configuration and updated docstrings to work better
with Sphinx.
0.9.1: 2014/02/03
- New name.
0.9: 2014/02/03
- Initial release.
| Version History
---------------
1.0: 2015/12/16
- The module has been renamed from ``trie`` to ``pygtrie``. This
could break current users but see documentation for how to quickly
upgrade your scripts.
- Added ``traverse`` method which goes through the nodes of the trie
preserving structure of the tree. This is a depth-first traversal
which can be used to search for elements or translate a trie into
a different tree structure.
- Minor documentation fixes.
0.9.3: 2015/05/28
- Minor documentation fixes.
0.9.2: 2015/05/28
- Added Sphinx configuration and updated docstrings to work better
with Sphinx.
0.9.1: 2014/02/03
- New name.
0.9: 2014/02/03
- Initial release.
| Make it a 1.0 release; add notes in to version history. | Make it a 1.0 release; add notes in to version history.
| reStructuredText | apache-2.0 | google/pygtrie,pombredanne/pygtrie | restructuredtext | ## Code Before:
Version History
---------------
0.9.3: 2015/05/28
- Minor documentation fixes.
0.9.2: 2015/05/28
- Added Sphinx configuration and updated docstrings to work better
with Sphinx.
0.9.1: 2014/02/03
- New name.
0.9: 2014/02/03
- Initial release.
## Instruction:
Make it a 1.0 release; add notes in to version history.
## Code After:
Version History
---------------
1.0: 2015/12/16
- The module has been renamed from ``trie`` to ``pygtrie``. This
could break current users but see documentation for how to quickly
upgrade your scripts.
- Added ``traverse`` method which goes through the nodes of the trie
preserving structure of the tree. This is a depth-first traversal
which can be used to search for elements or translate a trie into
a different tree structure.
- Minor documentation fixes.
0.9.3: 2015/05/28
- Minor documentation fixes.
0.9.2: 2015/05/28
- Added Sphinx configuration and updated docstrings to work better
with Sphinx.
0.9.1: 2014/02/03
- New name.
0.9: 2014/02/03
- Initial release.
| Version History
---------------
+
+ 1.0: 2015/12/16
+
+ - The module has been renamed from ``trie`` to ``pygtrie``. This
+ could break current users but see documentation for how to quickly
+ upgrade your scripts.
+
+ - Added ``traverse`` method which goes through the nodes of the trie
+ preserving structure of the tree. This is a depth-first traversal
+ which can be used to search for elements or translate a trie into
+ a different tree structure.
+
+ - Minor documentation fixes.
0.9.3: 2015/05/28
- Minor documentation fixes.
0.9.2: 2015/05/28
- Added Sphinx configuration and updated docstrings to work better
with Sphinx.
0.9.1: 2014/02/03
- New name.
0.9: 2014/02/03
- Initial release. | 13 | 0.684211 | 13 | 0 |
94cbfc1941f54d341307b30cc2396bdaf1294956 | templates/pages/home.hbs | templates/pages/home.hbs | <div class="home-page">
<div class="row">
<div class="col-lg-6">Content separated</div>
<div class="col-lg-6">In two equally wide columns</div>
</div>
<hr/>
<div class="row">
<div class="col-lg-3">Different</div>
<div class="col-lg-4">Column</div>
<div class="col-lg-5">Widths</div>
</div>
</div>
| <div class="home-page">
<div class="row">
<div class="col-xs-12 col-sm-6">Content separated</div>
<div class="col-xs-12 col-sm-6">In two equally wide columns</div>
</div>
<hr/>
<div class="row">
<div class="col-xs-12 col-sm-3">Different</div>
<div class="col-xs-12 col-sm-4">Column</div>
<div class="col-xs-12 col-sm-5">Widths</div>
</div>
</div>
| Add more example responsive column definitions | Add more example responsive column definitions
| Handlebars | mit | lxanders/node-express-base,lxanders/node-express-base | handlebars | ## Code Before:
<div class="home-page">
<div class="row">
<div class="col-lg-6">Content separated</div>
<div class="col-lg-6">In two equally wide columns</div>
</div>
<hr/>
<div class="row">
<div class="col-lg-3">Different</div>
<div class="col-lg-4">Column</div>
<div class="col-lg-5">Widths</div>
</div>
</div>
## Instruction:
Add more example responsive column definitions
## Code After:
<div class="home-page">
<div class="row">
<div class="col-xs-12 col-sm-6">Content separated</div>
<div class="col-xs-12 col-sm-6">In two equally wide columns</div>
</div>
<hr/>
<div class="row">
<div class="col-xs-12 col-sm-3">Different</div>
<div class="col-xs-12 col-sm-4">Column</div>
<div class="col-xs-12 col-sm-5">Widths</div>
</div>
</div>
| <div class="home-page">
<div class="row">
- <div class="col-lg-6">Content separated</div>
? ^
+ <div class="col-xs-12 col-sm-6">Content separated</div>
? ++++++++ ^^^
- <div class="col-lg-6">In two equally wide columns</div>
? ^
+ <div class="col-xs-12 col-sm-6">In two equally wide columns</div>
? ++++++++ ^^^
</div>
<hr/>
<div class="row">
- <div class="col-lg-3">Different</div>
? ^
+ <div class="col-xs-12 col-sm-3">Different</div>
? ++++++++ ^^^
- <div class="col-lg-4">Column</div>
? ^
+ <div class="col-xs-12 col-sm-4">Column</div>
? ++++++++ ^^^
- <div class="col-lg-5">Widths</div>
? ^
+ <div class="col-xs-12 col-sm-5">Widths</div>
? ++++++++ ^^^
</div>
</div> | 10 | 0.833333 | 5 | 5 |
1489cf3b4d94bdaf945ae4a635c99b0d21b8e873 | src/npm/ForeverMonitor.hx | src/npm/ForeverMonitor.hx | package npm;
import npm.forever.ForeverOptions;
@:jsRequire("forever-monitor", "Monitor")
extern class ForeverMonitor {
function new(scriptPath : String, ?options : ForeverOptions);
function on(event : String, callback : ?Dynamic -> Void): Void;
function start() : Void;
}
| package npm;
import haxe.Constraints.Function;
import npm.forever.ForeverOptions;
@:jsRequire("forever-monitor", "Monitor")
extern class ForeverMonitor {
function new(scriptPath : String, ?options : ForeverOptions);
function on(event : String, callback : Function): Void;
function start() : Void;
}
| Change forever callback to haxe.Constraints.Function | Change forever callback to haxe.Constraints.Function
| Haxe | mit | abedev/npm,abedev/npm | haxe | ## Code Before:
package npm;
import npm.forever.ForeverOptions;
@:jsRequire("forever-monitor", "Monitor")
extern class ForeverMonitor {
function new(scriptPath : String, ?options : ForeverOptions);
function on(event : String, callback : ?Dynamic -> Void): Void;
function start() : Void;
}
## Instruction:
Change forever callback to haxe.Constraints.Function
## Code After:
package npm;
import haxe.Constraints.Function;
import npm.forever.ForeverOptions;
@:jsRequire("forever-monitor", "Monitor")
extern class ForeverMonitor {
function new(scriptPath : String, ?options : ForeverOptions);
function on(event : String, callback : Function): Void;
function start() : Void;
}
| package npm;
+ import haxe.Constraints.Function;
import npm.forever.ForeverOptions;
@:jsRequire("forever-monitor", "Monitor")
extern class ForeverMonitor {
function new(scriptPath : String, ?options : ForeverOptions);
- function on(event : String, callback : ?Dynamic -> Void): Void;
? ^^^ ^^ ------ ^^
+ function on(event : String, callback : Function): Void;
? ^^ ^^ ^
function start() : Void;
} | 3 | 0.25 | 2 | 1 |
128f043dad7061a2663293ddb669117338d8248d | build/template/function.blade.php | build/template/function.blade.php | {!! '<?'.'php' !!}
declare(strict_types=1);
namespace phln\{{$ns}};
use function phln\fn\curry;
use const phln\fn\nil;
const {{$name}} = '\\phln\\{{$ns}}\\𝑓{{$name}}';
function {{$name}}()
{
return curry({{$name}});
}
function 𝑓{{$name}}()
{
}
| {!! '<?'.'php' !!}
declare(strict_types=1);
namespace phln\{{$ns}};
use function phln\fn\curry;
use const phln\fn\nil;
const {{$name}} = '\\phln\\{{$ns}}\\{{$name}}';
const 𝑓{{$name}} = '\\phln\\{{$ns}}\\𝑓{{$name}}';
function {{$name}}()
{
return curry(𝑓{{$name}});
}
function 𝑓{{$name}}()
{
}
| Add new const to function template | Add new const to function template
| PHP | mit | baethon/phln,baethon/phln,baethon/phln | php | ## Code Before:
{!! '<?'.'php' !!}
declare(strict_types=1);
namespace phln\{{$ns}};
use function phln\fn\curry;
use const phln\fn\nil;
const {{$name}} = '\\phln\\{{$ns}}\\𝑓{{$name}}';
function {{$name}}()
{
return curry({{$name}});
}
function 𝑓{{$name}}()
{
}
## Instruction:
Add new const to function template
## Code After:
{!! '<?'.'php' !!}
declare(strict_types=1);
namespace phln\{{$ns}};
use function phln\fn\curry;
use const phln\fn\nil;
const {{$name}} = '\\phln\\{{$ns}}\\{{$name}}';
const 𝑓{{$name}} = '\\phln\\{{$ns}}\\𝑓{{$name}}';
function {{$name}}()
{
return curry(𝑓{{$name}});
}
function 𝑓{{$name}}()
{
}
| {!! '<?'.'php' !!}
declare(strict_types=1);
namespace phln\{{$ns}};
use function phln\fn\curry;
use const phln\fn\nil;
+ const {{$name}} = '\\phln\\{{$ns}}\\{{$name}}';
- const {{$name}} = '\\phln\\{{$ns}}\\𝑓{{$name}}';
+ const 𝑓{{$name}} = '\\phln\\{{$ns}}\\𝑓{{$name}}';
? +
function {{$name}}()
{
- return curry({{$name}});
+ return curry(𝑓{{$name}});
? +
}
function 𝑓{{$name}}()
{
} | 5 | 0.277778 | 3 | 2 |
45c45bf58b2eb86dcb0edaf37f5e0e6fcbea369a | src/sagas/loadUserSessions.js | src/sagas/loadUserSessions.js | // @flow
import firebase from '@firebase/app'
import '@firebase/database'
import '@firebase/auth'
import { call, put, takeEvery } from 'redux-saga/effects'
import { hydrateUserData } from 'actions'
import type { UserDataState } from 'reducers/user/data'
type GetUserDataFunction = () => Promise<?UserDataState>
export function* loadSessions(
getCurrentUserData: GetUserDataFunction
): Generator<*, *, *> {
const data: ?UserDataState = yield call(getCurrentUserData)
if (data) {
yield put(hydrateUserData(data))
}
}
export default function* loadSessionWatcher(
getCurrentUserData: GetUserDataFunction
): Generator<*, *, *> {
// Wait for user auth to complete
yield takeEvery('USER_LOGGED_IN', loadSessions, getCurrentUserData)
}
| // @flow
import firebase from '@firebase/app'
import '@firebase/database'
import '@firebase/auth'
import { call, put, takeEvery } from 'redux-saga/effects'
import { hydrateUserData } from 'actions'
import { USER_LOGGED_IN } from 'actions/types'
import type { UserDataState } from 'reducers/user/data'
type GetUserDataFunction = () => Promise<?UserDataState>
export function* loadSessions(
getCurrentUserData: GetUserDataFunction
): Generator<*, *, *> {
const data: ?UserDataState = yield call(getCurrentUserData)
if (data) {
yield put(hydrateUserData(data))
}
}
export default function* loadSessionWatcher(
getCurrentUserData: GetUserDataFunction
): Generator<*, *, *> {
// Wait for user auth to complete
yield takeEvery(USER_LOGGED_IN, loadSessions, getCurrentUserData)
}
| Fix action literal in saga. | style(sagas): Fix action literal in saga.
| JavaScript | mit | jsonnull/aleamancer,jsonnull/aleamancer | javascript | ## Code Before:
// @flow
import firebase from '@firebase/app'
import '@firebase/database'
import '@firebase/auth'
import { call, put, takeEvery } from 'redux-saga/effects'
import { hydrateUserData } from 'actions'
import type { UserDataState } from 'reducers/user/data'
type GetUserDataFunction = () => Promise<?UserDataState>
export function* loadSessions(
getCurrentUserData: GetUserDataFunction
): Generator<*, *, *> {
const data: ?UserDataState = yield call(getCurrentUserData)
if (data) {
yield put(hydrateUserData(data))
}
}
export default function* loadSessionWatcher(
getCurrentUserData: GetUserDataFunction
): Generator<*, *, *> {
// Wait for user auth to complete
yield takeEvery('USER_LOGGED_IN', loadSessions, getCurrentUserData)
}
## Instruction:
style(sagas): Fix action literal in saga.
## Code After:
// @flow
import firebase from '@firebase/app'
import '@firebase/database'
import '@firebase/auth'
import { call, put, takeEvery } from 'redux-saga/effects'
import { hydrateUserData } from 'actions'
import { USER_LOGGED_IN } from 'actions/types'
import type { UserDataState } from 'reducers/user/data'
type GetUserDataFunction = () => Promise<?UserDataState>
export function* loadSessions(
getCurrentUserData: GetUserDataFunction
): Generator<*, *, *> {
const data: ?UserDataState = yield call(getCurrentUserData)
if (data) {
yield put(hydrateUserData(data))
}
}
export default function* loadSessionWatcher(
getCurrentUserData: GetUserDataFunction
): Generator<*, *, *> {
// Wait for user auth to complete
yield takeEvery(USER_LOGGED_IN, loadSessions, getCurrentUserData)
}
| // @flow
import firebase from '@firebase/app'
import '@firebase/database'
import '@firebase/auth'
import { call, put, takeEvery } from 'redux-saga/effects'
import { hydrateUserData } from 'actions'
+ import { USER_LOGGED_IN } from 'actions/types'
import type { UserDataState } from 'reducers/user/data'
type GetUserDataFunction = () => Promise<?UserDataState>
export function* loadSessions(
getCurrentUserData: GetUserDataFunction
): Generator<*, *, *> {
const data: ?UserDataState = yield call(getCurrentUserData)
if (data) {
yield put(hydrateUserData(data))
}
}
export default function* loadSessionWatcher(
getCurrentUserData: GetUserDataFunction
): Generator<*, *, *> {
// Wait for user auth to complete
- yield takeEvery('USER_LOGGED_IN', loadSessions, getCurrentUserData)
? - -
+ yield takeEvery(USER_LOGGED_IN, loadSessions, getCurrentUserData)
} | 3 | 0.115385 | 2 | 1 |
c82067997cf5c2661b7b61877b0045ef5600dab6 | attributes/exabgp.rb | attributes/exabgp.rb | default[:exabgp][:local_as] = 0
default[:exabgp][:peer_as] = 0
default[:exabgp][:community] = [0]
default[:exabgp][:hold_time] = 20
default[:exabgp][:ipv4][:neighbor] = '127.0.0.1'
default[:exabgp][:ipv4][:anycast] = '127.0.0.1'
default[:exabgp][:ipv6][:neighbor] = nil
default[:exabgp][:ipv6][:anycast] = '::1'
default[:exabgp][:source_version] = 'master'
default[:exabgp][:bin_path] = '/usr/local/bin/exabgp'
default[:exabgp][:watchdog_flag_file] = '/tmp/exabgp-announce'
| default[:exabgp][:local_as] = 12345
default[:exabgp][:peer_as] = 12345
default[:exabgp][:community] = [0]
default[:exabgp][:hold_time] = 20
default[:exabgp][:ipv4][:neighbor] = '127.0.0.1'
default[:exabgp][:ipv4][:anycast] = '127.0.0.1'
default[:exabgp][:ipv6][:neighbor] = nil
default[:exabgp][:ipv6][:anycast] = '::1'
default[:exabgp][:source_version] = 'master'
default[:exabgp][:bin_path] = '/usr/local/bin/exabgp'
default[:exabgp][:watchdog_flag_file] = '/tmp/exabgp-announce'
| Put something other than 0 for local and peer as | Put something other than 0 for local and peer as
This will allow it to fully start up for now.
| Ruby | apache-2.0 | vinted/exabgp-cookbook,hostinger/exabgp-cookbook,vinted/exabgp-cookbook,aetrion/exabgp-cookbook,aetrion/exabgp-cookbook,hostinger/exabgp-cookbook,hostinger/exabgp-cookbook,vinted/exabgp-cookbook,aetrion/exabgp-cookbook | ruby | ## Code Before:
default[:exabgp][:local_as] = 0
default[:exabgp][:peer_as] = 0
default[:exabgp][:community] = [0]
default[:exabgp][:hold_time] = 20
default[:exabgp][:ipv4][:neighbor] = '127.0.0.1'
default[:exabgp][:ipv4][:anycast] = '127.0.0.1'
default[:exabgp][:ipv6][:neighbor] = nil
default[:exabgp][:ipv6][:anycast] = '::1'
default[:exabgp][:source_version] = 'master'
default[:exabgp][:bin_path] = '/usr/local/bin/exabgp'
default[:exabgp][:watchdog_flag_file] = '/tmp/exabgp-announce'
## Instruction:
Put something other than 0 for local and peer as
This will allow it to fully start up for now.
## Code After:
default[:exabgp][:local_as] = 12345
default[:exabgp][:peer_as] = 12345
default[:exabgp][:community] = [0]
default[:exabgp][:hold_time] = 20
default[:exabgp][:ipv4][:neighbor] = '127.0.0.1'
default[:exabgp][:ipv4][:anycast] = '127.0.0.1'
default[:exabgp][:ipv6][:neighbor] = nil
default[:exabgp][:ipv6][:anycast] = '::1'
default[:exabgp][:source_version] = 'master'
default[:exabgp][:bin_path] = '/usr/local/bin/exabgp'
default[:exabgp][:watchdog_flag_file] = '/tmp/exabgp-announce'
| - default[:exabgp][:local_as] = 0
? ^
+ default[:exabgp][:local_as] = 12345
? ^^^^^
- default[:exabgp][:peer_as] = 0
? ^
+ default[:exabgp][:peer_as] = 12345
? ^^^^^
default[:exabgp][:community] = [0]
default[:exabgp][:hold_time] = 20
default[:exabgp][:ipv4][:neighbor] = '127.0.0.1'
default[:exabgp][:ipv4][:anycast] = '127.0.0.1'
default[:exabgp][:ipv6][:neighbor] = nil
default[:exabgp][:ipv6][:anycast] = '::1'
default[:exabgp][:source_version] = 'master'
default[:exabgp][:bin_path] = '/usr/local/bin/exabgp'
default[:exabgp][:watchdog_flag_file] = '/tmp/exabgp-announce' | 4 | 0.25 | 2 | 2 |
229c1c2e74c43a5bd5a9eef00013074116331942 | app/controllers/api/users_controller.rb | app/controllers/api/users_controller.rb | class Api::UsersController < Api::BaseController
def index
@users = User.all
@users = @users.where(id: params[:users]) if params[:users]
render json: {users: @users.as_json(only: [:id, :name, :email])}
end
end
| class Api::UsersController < Api::BaseController
def index
@users = User.all
@users = @users.where(id: params[:ids]) if params[:ids]
@users = @users.where(email: params[:emails]) if params[:emails]
render json: {users: @users.as_json(only: [:id, :name, :email, :image_url])}
end
end | Add email filter for users api | Add email filter for users api
| Ruby | agpl-3.0 | mumuki/mumuki-laboratory,mumuki/mumuki-laboratory,mumuki/mumuki-laboratory,mumuki/mumuki-laboratory | ruby | ## Code Before:
class Api::UsersController < Api::BaseController
def index
@users = User.all
@users = @users.where(id: params[:users]) if params[:users]
render json: {users: @users.as_json(only: [:id, :name, :email])}
end
end
## Instruction:
Add email filter for users api
## Code After:
class Api::UsersController < Api::BaseController
def index
@users = User.all
@users = @users.where(id: params[:ids]) if params[:ids]
@users = @users.where(email: params[:emails]) if params[:emails]
render json: {users: @users.as_json(only: [:id, :name, :email, :image_url])}
end
end | class Api::UsersController < Api::BaseController
def index
@users = User.all
- @users = @users.where(id: params[:users]) if params[:users]
? ^^^^ ^^^^
+ @users = @users.where(id: params[:ids]) if params[:ids]
? ^^ ^^
+ @users = @users.where(email: params[:emails]) if params[:emails]
- render json: {users: @users.as_json(only: [:id, :name, :email])}
+ render json: {users: @users.as_json(only: [:id, :name, :email, :image_url])}
? ++++++++++++
end
end | 5 | 0.714286 | 3 | 2 |
c0b65297f2317d38a37ef1bb7351d406c0090ffd | app/assets/stylesheets/scripts.css.scss | app/assets/stylesheets/scripts.css.scss | // Place all the styles related to the scripts controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
body {
background: black;
color: white;
margin: 0;
padding: 0;
font-family: monospace;
}
h1 {
color: white;
}
a {
color: white;
}
.controls {
opacity: 0.8;
padding: 10px;
background: rgba(255, 255, 255, 0.2);
position: fixed;
right: 0;
bottom: 0;
.slider {
height: 5px;
width: 200px;
margin-right: 10px;
display: inline-block;
a {
height: 13px;
}
}
}
| // Place all the styles related to the scripts controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
body {
background: black;
color: white;
margin: 0;
padding: 0;
font-family: monospace;
white-space: nowrap;
}
h1 {
color: white;
}
a {
color: white;
}
.controls {
opacity: 0.8;
padding: 10px;
background: rgba(255, 255, 255, 0.2);
position: fixed;
right: 0;
bottom: 0;
.slider {
height: 5px;
width: 200px;
margin-right: 10px;
display: inline-block;
a {
height: 13px;
}
}
}
| Fix display on wide fonts | Fix display on wide fonts
| SCSS | mit | kyokley/showterm.io,codemiller/openshift-showterm,kyokley/showterm.io,aaronmehar/showterm.io,ConradIrwin/showterm.io,asharpe/showterm.io,aaronmehar/showterm.io,asharpe/showterm.io,codemiller/openshift-showterm,ConradIrwin/showterm.io,aaronmehar/showterm.io,codemiller/openshift-showterm,ConradIrwin/showterm.io,kyokley/showterm.io,ConradIrwin/showterm.io,asharpe/showterm.io,aaronmehar/showterm.io,asharpe/showterm.io,kyokley/showterm.io | scss | ## Code Before:
// Place all the styles related to the scripts controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
body {
background: black;
color: white;
margin: 0;
padding: 0;
font-family: monospace;
}
h1 {
color: white;
}
a {
color: white;
}
.controls {
opacity: 0.8;
padding: 10px;
background: rgba(255, 255, 255, 0.2);
position: fixed;
right: 0;
bottom: 0;
.slider {
height: 5px;
width: 200px;
margin-right: 10px;
display: inline-block;
a {
height: 13px;
}
}
}
## Instruction:
Fix display on wide fonts
## Code After:
// Place all the styles related to the scripts controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
body {
background: black;
color: white;
margin: 0;
padding: 0;
font-family: monospace;
white-space: nowrap;
}
h1 {
color: white;
}
a {
color: white;
}
.controls {
opacity: 0.8;
padding: 10px;
background: rgba(255, 255, 255, 0.2);
position: fixed;
right: 0;
bottom: 0;
.slider {
height: 5px;
width: 200px;
margin-right: 10px;
display: inline-block;
a {
height: 13px;
}
}
}
| // Place all the styles related to the scripts controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
body {
background: black;
color: white;
margin: 0;
padding: 0;
font-family: monospace;
+ white-space: nowrap;
}
h1 {
color: white;
}
a {
color: white;
}
.controls {
opacity: 0.8;
padding: 10px;
background: rgba(255, 255, 255, 0.2);
position: fixed;
right: 0;
bottom: 0;
.slider {
height: 5px;
width: 200px;
margin-right: 10px;
display: inline-block;
a {
height: 13px;
}
}
} | 1 | 0.026316 | 1 | 0 |
d8b13dcb884046ee43d54fcf27f1bbfd0ff3263a | sentrylogs/parsers/__init__.py | sentrylogs/parsers/__init__.py | import tailer # same functionality as UNIX tail in python
from ..helpers import send_message
class Parser(object):
"""Abstract base class for any parser"""
def __init__(self, filepath):
self.filepath = filepath
self.logger = self.__doc__.strip()
self.message = None
self.extended_message = None
self.params = None
self.site = None
def follow_tail(self):
"""
Read (tail and follow) the log file, parse entries and send messages
to Sentry using Raven.
"""
for line in tailer.follow(open(self.filepath)):
self.message = None
self.extended_message = None
self.params = None
self.site = None
self.parse(line)
send_message(self.message,
self.extended_message,
self.params,
self.site,
self.logger)
def parse(self, line):
"""
Parse a line of a log file. Must be overridden by the subclass.
The implementation must set these properties:
- ``message`` (string)
- ``extended_message`` (string)
- ``params`` (list of string)
- ``site`` (string)
"""
raise NotImplementedError('parse() method must set: '
'message, extended_message, params, site')
| import tailer # same functionality as UNIX tail in python
from ..helpers import send_message
try:
(FileNotFoundError, PermissionError)
except NameError: # Python 2.7
FileNotFoundError = IOError # pylint: disable=redefined-builtin
PermissionError = IOError # pylint: disable=redefined-builtin
class Parser(object):
"""Abstract base class for any parser"""
def __init__(self, filepath):
self.filepath = filepath
self.logger = self.__doc__.strip()
self.message = None
self.extended_message = None
self.params = None
self.site = None
def follow_tail(self):
"""
Read (tail and follow) the log file, parse entries and send messages
to Sentry using Raven.
"""
try:
logfile = open(self.filepath)
except (FileNotFoundError, PermissionError) as err:
exit("Error: Can't read logfile %s (%s)" % (self.filepath, err))
for line in tailer.follow(logfile):
self.message = None
self.extended_message = None
self.params = None
self.site = None
self.parse(line)
send_message(self.message,
self.extended_message,
self.params,
self.site,
self.logger)
def parse(self, line):
"""
Parse a line of a log file. Must be overridden by the subclass.
The implementation must set these properties:
- ``message`` (string)
- ``extended_message`` (string)
- ``params`` (list of string)
- ``site`` (string)
"""
raise NotImplementedError('parse() method must set: '
'message, extended_message, params, site')
| Handle FileNotFound and Permission errors gracefully | Handle FileNotFound and Permission errors gracefully
| Python | bsd-3-clause | bittner/sentrylogs,mdgart/sentrylogs | python | ## Code Before:
import tailer # same functionality as UNIX tail in python
from ..helpers import send_message
class Parser(object):
"""Abstract base class for any parser"""
def __init__(self, filepath):
self.filepath = filepath
self.logger = self.__doc__.strip()
self.message = None
self.extended_message = None
self.params = None
self.site = None
def follow_tail(self):
"""
Read (tail and follow) the log file, parse entries and send messages
to Sentry using Raven.
"""
for line in tailer.follow(open(self.filepath)):
self.message = None
self.extended_message = None
self.params = None
self.site = None
self.parse(line)
send_message(self.message,
self.extended_message,
self.params,
self.site,
self.logger)
def parse(self, line):
"""
Parse a line of a log file. Must be overridden by the subclass.
The implementation must set these properties:
- ``message`` (string)
- ``extended_message`` (string)
- ``params`` (list of string)
- ``site`` (string)
"""
raise NotImplementedError('parse() method must set: '
'message, extended_message, params, site')
## Instruction:
Handle FileNotFound and Permission errors gracefully
## Code After:
import tailer # same functionality as UNIX tail in python
from ..helpers import send_message
try:
(FileNotFoundError, PermissionError)
except NameError: # Python 2.7
FileNotFoundError = IOError # pylint: disable=redefined-builtin
PermissionError = IOError # pylint: disable=redefined-builtin
class Parser(object):
"""Abstract base class for any parser"""
def __init__(self, filepath):
self.filepath = filepath
self.logger = self.__doc__.strip()
self.message = None
self.extended_message = None
self.params = None
self.site = None
def follow_tail(self):
"""
Read (tail and follow) the log file, parse entries and send messages
to Sentry using Raven.
"""
try:
logfile = open(self.filepath)
except (FileNotFoundError, PermissionError) as err:
exit("Error: Can't read logfile %s (%s)" % (self.filepath, err))
for line in tailer.follow(logfile):
self.message = None
self.extended_message = None
self.params = None
self.site = None
self.parse(line)
send_message(self.message,
self.extended_message,
self.params,
self.site,
self.logger)
def parse(self, line):
"""
Parse a line of a log file. Must be overridden by the subclass.
The implementation must set these properties:
- ``message`` (string)
- ``extended_message`` (string)
- ``params`` (list of string)
- ``site`` (string)
"""
raise NotImplementedError('parse() method must set: '
'message, extended_message, params, site')
| import tailer # same functionality as UNIX tail in python
from ..helpers import send_message
+
+ try:
+ (FileNotFoundError, PermissionError)
+ except NameError: # Python 2.7
+ FileNotFoundError = IOError # pylint: disable=redefined-builtin
+ PermissionError = IOError # pylint: disable=redefined-builtin
class Parser(object):
"""Abstract base class for any parser"""
def __init__(self, filepath):
self.filepath = filepath
self.logger = self.__doc__.strip()
self.message = None
self.extended_message = None
self.params = None
self.site = None
def follow_tail(self):
"""
Read (tail and follow) the log file, parse entries and send messages
to Sentry using Raven.
"""
+ try:
+ logfile = open(self.filepath)
+ except (FileNotFoundError, PermissionError) as err:
+ exit("Error: Can't read logfile %s (%s)" % (self.filepath, err))
+
- for line in tailer.follow(open(self.filepath)):
? ^^^^^^^^^ -----
+ for line in tailer.follow(logfile):
? + ^
self.message = None
self.extended_message = None
self.params = None
self.site = None
self.parse(line)
send_message(self.message,
self.extended_message,
self.params,
self.site,
self.logger)
def parse(self, line):
"""
Parse a line of a log file. Must be overridden by the subclass.
The implementation must set these properties:
- ``message`` (string)
- ``extended_message`` (string)
- ``params`` (list of string)
- ``site`` (string)
"""
raise NotImplementedError('parse() method must set: '
'message, extended_message, params, site') | 13 | 0.282609 | 12 | 1 |
59badfa50d645ac64c70fc6a0c2f7fe826999a1f | xpath.gemspec | xpath.gemspec | lib = File.expand_path('lib', File.dirname(__FILE__))
$:.unshift lib unless $:.include?(lib)
require 'xpath/version'
Gem::Specification.new do |s|
s.name = "xpath"
s.rubyforge_project = "xpath"
s.version = XPath::VERSION
s.authors = ["Jonas Nicklas"]
s.email = ["jonas.nicklas@gmail.com"]
s.description = "XPath is a Ruby DSL for generating XPath expressions"
s.files = Dir.glob("{lib,spec}/**/*") + %w(README.md)
s.extra_rdoc_files = ["README.md"]
s.homepage = "http://github.com/jnicklas/xpath"
s.rdoc_options = ["--main", "README.md"]
s.require_paths = ["lib"]
s.rubygems_version = "1.3.6"
s.summary = "Generate XPath expressions from Ruby"
s.add_dependency("nokogiri", ["~> 1.3"])
s.add_development_dependency("rspec", ["~> 2.0"])
s.add_development_dependency("yard", [">= 0.5.8"])
s.add_development_dependency("rake")
if File.exist?("gem-private_key.pem")
s.signing_key = 'gem-private_key.pem'
end
s.cert_chain = ['gem-public_cert.pem']
end
| lib = File.expand_path('lib', File.dirname(__FILE__))
$:.unshift lib unless $:.include?(lib)
require 'xpath/version'
Gem::Specification.new do |s|
s.name = "xpath"
s.rubyforge_project = "xpath"
s.version = XPath::VERSION
s.authors = ["Jonas Nicklas"]
s.email = ["jonas.nicklas@gmail.com"]
s.description = "XPath is a Ruby DSL for generating XPath expressions"
s.license = "MIT"
s.files = Dir.glob("{lib,spec}/**/*") + %w(README.md)
s.extra_rdoc_files = ["README.md"]
s.homepage = "http://github.com/jnicklas/xpath"
s.rdoc_options = ["--main", "README.md"]
s.require_paths = ["lib"]
s.rubygems_version = "1.3.6"
s.summary = "Generate XPath expressions from Ruby"
s.add_dependency("nokogiri", ["~> 1.3"])
s.add_development_dependency("rspec", ["~> 2.0"])
s.add_development_dependency("yard", [">= 0.5.8"])
s.add_development_dependency("rake")
if File.exist?("gem-private_key.pem")
s.signing_key = 'gem-private_key.pem'
end
s.cert_chain = ['gem-public_cert.pem']
end
| Document project license in gemspec | Document project license in gemspec | Ruby | mit | teamcapybara/xpath | ruby | ## Code Before:
lib = File.expand_path('lib', File.dirname(__FILE__))
$:.unshift lib unless $:.include?(lib)
require 'xpath/version'
Gem::Specification.new do |s|
s.name = "xpath"
s.rubyforge_project = "xpath"
s.version = XPath::VERSION
s.authors = ["Jonas Nicklas"]
s.email = ["jonas.nicklas@gmail.com"]
s.description = "XPath is a Ruby DSL for generating XPath expressions"
s.files = Dir.glob("{lib,spec}/**/*") + %w(README.md)
s.extra_rdoc_files = ["README.md"]
s.homepage = "http://github.com/jnicklas/xpath"
s.rdoc_options = ["--main", "README.md"]
s.require_paths = ["lib"]
s.rubygems_version = "1.3.6"
s.summary = "Generate XPath expressions from Ruby"
s.add_dependency("nokogiri", ["~> 1.3"])
s.add_development_dependency("rspec", ["~> 2.0"])
s.add_development_dependency("yard", [">= 0.5.8"])
s.add_development_dependency("rake")
if File.exist?("gem-private_key.pem")
s.signing_key = 'gem-private_key.pem'
end
s.cert_chain = ['gem-public_cert.pem']
end
## Instruction:
Document project license in gemspec
## Code After:
lib = File.expand_path('lib', File.dirname(__FILE__))
$:.unshift lib unless $:.include?(lib)
require 'xpath/version'
Gem::Specification.new do |s|
s.name = "xpath"
s.rubyforge_project = "xpath"
s.version = XPath::VERSION
s.authors = ["Jonas Nicklas"]
s.email = ["jonas.nicklas@gmail.com"]
s.description = "XPath is a Ruby DSL for generating XPath expressions"
s.license = "MIT"
s.files = Dir.glob("{lib,spec}/**/*") + %w(README.md)
s.extra_rdoc_files = ["README.md"]
s.homepage = "http://github.com/jnicklas/xpath"
s.rdoc_options = ["--main", "README.md"]
s.require_paths = ["lib"]
s.rubygems_version = "1.3.6"
s.summary = "Generate XPath expressions from Ruby"
s.add_dependency("nokogiri", ["~> 1.3"])
s.add_development_dependency("rspec", ["~> 2.0"])
s.add_development_dependency("yard", [">= 0.5.8"])
s.add_development_dependency("rake")
if File.exist?("gem-private_key.pem")
s.signing_key = 'gem-private_key.pem'
end
s.cert_chain = ['gem-public_cert.pem']
end
| lib = File.expand_path('lib', File.dirname(__FILE__))
$:.unshift lib unless $:.include?(lib)
require 'xpath/version'
Gem::Specification.new do |s|
s.name = "xpath"
s.rubyforge_project = "xpath"
s.version = XPath::VERSION
s.authors = ["Jonas Nicklas"]
s.email = ["jonas.nicklas@gmail.com"]
s.description = "XPath is a Ruby DSL for generating XPath expressions"
+ s.license = "MIT"
s.files = Dir.glob("{lib,spec}/**/*") + %w(README.md)
s.extra_rdoc_files = ["README.md"]
s.homepage = "http://github.com/jnicklas/xpath"
s.rdoc_options = ["--main", "README.md"]
s.require_paths = ["lib"]
s.rubygems_version = "1.3.6"
s.summary = "Generate XPath expressions from Ruby"
s.add_dependency("nokogiri", ["~> 1.3"])
s.add_development_dependency("rspec", ["~> 2.0"])
s.add_development_dependency("yard", [">= 0.5.8"])
s.add_development_dependency("rake")
if File.exist?("gem-private_key.pem")
s.signing_key = 'gem-private_key.pem'
end
s.cert_chain = ['gem-public_cert.pem']
end | 1 | 0.029412 | 1 | 0 |
13664bf72b50ab96c106585839adff4402126ce4 | src/main/java/sg/ncl/service/AppConfig.java | src/main/java/sg/ncl/service/AppConfig.java | package sg.ncl.service;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
/**
* @author Christopher Zhong
*/
@Configuration("sg.ncl.service.AppConfig")
@Import({sg.ncl.service.user.AppConfig.class, sg.ncl.service.team.AppConfig.class, sg.ncl.service.version.AppConfig.class})
public class AppConfig {
}
| package sg.ncl.service;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import sg.ncl.service.experiment.*;
/**
* @author Christopher Zhong
*/
@Configuration("sg.ncl.service.AppConfig")
@Import({sg.ncl.service.authentication.AppConfig.class,
sg.ncl.service.experiment.AppConfig.class,
sg.ncl.service.realization.AppConfig.class,
sg.ncl.service.user.AppConfig.class,
sg.ncl.service.team.AppConfig.class,
sg.ncl.service.version.AppConfig.class})
public class AppConfig {
}
| Add missing services to root project (DEV-100) | Add missing services to root project (DEV-100)
| Java | apache-2.0 | nus-ncl/services-in-one,nus-ncl/services-in-one | java | ## Code Before:
package sg.ncl.service;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
/**
* @author Christopher Zhong
*/
@Configuration("sg.ncl.service.AppConfig")
@Import({sg.ncl.service.user.AppConfig.class, sg.ncl.service.team.AppConfig.class, sg.ncl.service.version.AppConfig.class})
public class AppConfig {
}
## Instruction:
Add missing services to root project (DEV-100)
## Code After:
package sg.ncl.service;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import sg.ncl.service.experiment.*;
/**
* @author Christopher Zhong
*/
@Configuration("sg.ncl.service.AppConfig")
@Import({sg.ncl.service.authentication.AppConfig.class,
sg.ncl.service.experiment.AppConfig.class,
sg.ncl.service.realization.AppConfig.class,
sg.ncl.service.user.AppConfig.class,
sg.ncl.service.team.AppConfig.class,
sg.ncl.service.version.AppConfig.class})
public class AppConfig {
}
| package sg.ncl.service;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
+ import sg.ncl.service.experiment.*;
/**
* @author Christopher Zhong
*/
@Configuration("sg.ncl.service.AppConfig")
- @Import({sg.ncl.service.user.AppConfig.class, sg.ncl.service.team.AppConfig.class, sg.ncl.service.version.AppConfig.class})
+ @Import({sg.ncl.service.authentication.AppConfig.class,
+ sg.ncl.service.experiment.AppConfig.class,
+ sg.ncl.service.realization.AppConfig.class,
+ sg.ncl.service.user.AppConfig.class,
+ sg.ncl.service.team.AppConfig.class,
+ sg.ncl.service.version.AppConfig.class})
public class AppConfig {
} | 8 | 0.666667 | 7 | 1 |
a2772cd98479db1e8db2e9e4736cce196a0c157a | examples/listdir.cpp | examples/listdir.cpp |
int main(int argc, char** argv){
cout << "Example" <<endl;
Filesystem fs;
if ( argc == 1 )
fs.listdir(".");
else
fs.listdir( argv[1] );
cout << fs;
return 0;
}
|
using namespace std;
int main(int argc, char** argv){
cout << "Example" <<endl;
Filesystem fs;
if ( argc == 1 )
fs.listdir(".");
else
fs.listdir( argv[1] );
cout << fs;
return 0;
}
| Put the using namespace std in the cpp files | Put the using namespace std in the cpp files
| C++ | lgpl-2.1 | bombark/TiSys,bombark/TiSys | c++ | ## Code Before:
int main(int argc, char** argv){
cout << "Example" <<endl;
Filesystem fs;
if ( argc == 1 )
fs.listdir(".");
else
fs.listdir( argv[1] );
cout << fs;
return 0;
}
## Instruction:
Put the using namespace std in the cpp files
## Code After:
using namespace std;
int main(int argc, char** argv){
cout << "Example" <<endl;
Filesystem fs;
if ( argc == 1 )
fs.listdir(".");
else
fs.listdir( argv[1] );
cout << fs;
return 0;
}
| +
+ using namespace std;
int main(int argc, char** argv){
cout << "Example" <<endl;
Filesystem fs;
if ( argc == 1 )
fs.listdir(".");
else
fs.listdir( argv[1] );
cout << fs;
return 0;
} | 2 | 0.142857 | 2 | 0 |
dd560298a5fd6d4227fe6edb7a84f007b5466fae | app/frontend/javascripts/app.js.coffee | app/frontend/javascripts/app.js.coffee | window.App ||= {}
App.Visualization = require './visualization.js'
App.Story = require './story.js'
App.Trix = require 'script!trix'
$(document).ready ->
$body = $('body')
# visualizations
if $body.hasClass 'visualizations'
# /visualizations/:id
# /visualizations/:id/edit
appVisualization = new App.Visualization $('body').data('visualization-id'), $body.hasClass('edit')
appVisualization.render()
$( window ).resize appVisualization.resize
# stories
else if $body.hasClass 'stories'
# /stories/:id
# /stories/:id/edit
appStory = new App.Story $('body').data('story-id'), $('body').data('visualization-id'), $body.hasClass('edit')
appStory.render()
$( window ).resize appStory.resize
# Activate tooltips
$('[data-toggle="tooltip"]').tooltip()
# Setup select-all checkbox in Chapter new/edit
$('#relations_select_all').change (e) ->
$('.table tbody input[type=checkbox]').prop 'checked', $(this).prop('checked')
# Add file input feedback
# based on http://www.abeautifulsite.net/whipping-file-inputs-into-shape-with-bootstrap-3/
$(document).on 'change', '.btn-file :file', () ->
label = $(this).val().replace(/\\/g, '/').replace(/.*\//, '')
$(this).parent().siblings('.btn-file-output').html label
| window.App ||= {}
App.Visualization = require './visualization.js'
App.Story = require './story.js'
App.Trix = require 'script!trix'
$(document).ready ->
$body = $('body')
# visualizations
if $body.hasClass('visualizations') and ($body.hasClass('show') or $body.hasClass('edit'))
# /visualizations/:id
# /visualizations/:id/edit
appVisualization = new App.Visualization $('body').data('visualization-id'), $body.hasClass('edit')
appVisualization.render()
$( window ).resize appVisualization.resize
# stories
else if $body.hasClass('stories') and ($body.hasClass('show') or $body.hasClass('edit'))
# /stories/:id
# /stories/:id/edit
appStory = new App.Story $('body').data('story-id'), $('body').data('visualization-id'), $body.hasClass('edit')
appStory.render()
$( window ).resize appStory.resize
# Activate tooltips
$('[data-toggle="tooltip"]').tooltip()
# Setup select-all checkbox in Chapter new/edit
$('#relations_select_all').change (e) ->
$('.table tbody input[type=checkbox]').prop 'checked', $(this).prop('checked')
# Add file input feedback
# based on http://www.abeautifulsite.net/whipping-file-inputs-into-shape-with-bootstrap-3/
$(document).on 'change', '.btn-file :file', () ->
label = $(this).val().replace(/\\/g, '/').replace(/.*\//, '')
$(this).parent().siblings('.btn-file-output').html label
| Fix body class check to avoid initialize Visualization or Story classes in templates different to show or edit | Fix body class check to avoid initialize Visualization or Story classes in templates different to show or edit
| CoffeeScript | agpl-3.0 | civio/onodo,civio/onodo,civio/onodo,civio/onodo | coffeescript | ## Code Before:
window.App ||= {}
App.Visualization = require './visualization.js'
App.Story = require './story.js'
App.Trix = require 'script!trix'
$(document).ready ->
$body = $('body')
# visualizations
if $body.hasClass 'visualizations'
# /visualizations/:id
# /visualizations/:id/edit
appVisualization = new App.Visualization $('body').data('visualization-id'), $body.hasClass('edit')
appVisualization.render()
$( window ).resize appVisualization.resize
# stories
else if $body.hasClass 'stories'
# /stories/:id
# /stories/:id/edit
appStory = new App.Story $('body').data('story-id'), $('body').data('visualization-id'), $body.hasClass('edit')
appStory.render()
$( window ).resize appStory.resize
# Activate tooltips
$('[data-toggle="tooltip"]').tooltip()
# Setup select-all checkbox in Chapter new/edit
$('#relations_select_all').change (e) ->
$('.table tbody input[type=checkbox]').prop 'checked', $(this).prop('checked')
# Add file input feedback
# based on http://www.abeautifulsite.net/whipping-file-inputs-into-shape-with-bootstrap-3/
$(document).on 'change', '.btn-file :file', () ->
label = $(this).val().replace(/\\/g, '/').replace(/.*\//, '')
$(this).parent().siblings('.btn-file-output').html label
## Instruction:
Fix body class check to avoid initialize Visualization or Story classes in templates different to show or edit
## Code After:
window.App ||= {}
App.Visualization = require './visualization.js'
App.Story = require './story.js'
App.Trix = require 'script!trix'
$(document).ready ->
$body = $('body')
# visualizations
if $body.hasClass('visualizations') and ($body.hasClass('show') or $body.hasClass('edit'))
# /visualizations/:id
# /visualizations/:id/edit
appVisualization = new App.Visualization $('body').data('visualization-id'), $body.hasClass('edit')
appVisualization.render()
$( window ).resize appVisualization.resize
# stories
else if $body.hasClass('stories') and ($body.hasClass('show') or $body.hasClass('edit'))
# /stories/:id
# /stories/:id/edit
appStory = new App.Story $('body').data('story-id'), $('body').data('visualization-id'), $body.hasClass('edit')
appStory.render()
$( window ).resize appStory.resize
# Activate tooltips
$('[data-toggle="tooltip"]').tooltip()
# Setup select-all checkbox in Chapter new/edit
$('#relations_select_all').change (e) ->
$('.table tbody input[type=checkbox]').prop 'checked', $(this).prop('checked')
# Add file input feedback
# based on http://www.abeautifulsite.net/whipping-file-inputs-into-shape-with-bootstrap-3/
$(document).on 'change', '.btn-file :file', () ->
label = $(this).val().replace(/\\/g, '/').replace(/.*\//, '')
$(this).parent().siblings('.btn-file-output').html label
| window.App ||= {}
App.Visualization = require './visualization.js'
App.Story = require './story.js'
App.Trix = require 'script!trix'
$(document).ready ->
$body = $('body')
# visualizations
- if $body.hasClass 'visualizations'
+ if $body.hasClass('visualizations') and ($body.hasClass('show') or $body.hasClass('edit'))
# /visualizations/:id
# /visualizations/:id/edit
appVisualization = new App.Visualization $('body').data('visualization-id'), $body.hasClass('edit')
appVisualization.render()
$( window ).resize appVisualization.resize
# stories
- else if $body.hasClass 'stories'
+ else if $body.hasClass('stories') and ($body.hasClass('show') or $body.hasClass('edit'))
# /stories/:id
# /stories/:id/edit
appStory = new App.Story $('body').data('story-id'), $('body').data('visualization-id'), $body.hasClass('edit')
appStory.render()
$( window ).resize appStory.resize
# Activate tooltips
$('[data-toggle="tooltip"]').tooltip()
# Setup select-all checkbox in Chapter new/edit
$('#relations_select_all').change (e) ->
$('.table tbody input[type=checkbox]').prop 'checked', $(this).prop('checked')
# Add file input feedback
# based on http://www.abeautifulsite.net/whipping-file-inputs-into-shape-with-bootstrap-3/
$(document).on 'change', '.btn-file :file', () ->
label = $(this).val().replace(/\\/g, '/').replace(/.*\//, '')
$(this).parent().siblings('.btn-file-output').html label | 4 | 0.108108 | 2 | 2 |
4ee131a1d9d6a5df1ce60fbe00518bcd4d9e75ac | vim/ftplugin/python.vim | vim/ftplugin/python.vim | setlocal makeprg=flake8\ %
setlocal errorformat=%f:%l:%c:\ %m
setlocal foldmethod=indent
| setlocal makeprg=flake8\ %
setlocal errorformat=%f:%l:%c:\ %m
setlocal foldmethod=indent
setlocal formatprg=autopep8\ -
| Use autopep8 for Python formatting. | vim: Use autopep8 for Python formatting.
| VimL | mit | folixg/dot-files | viml | ## Code Before:
setlocal makeprg=flake8\ %
setlocal errorformat=%f:%l:%c:\ %m
setlocal foldmethod=indent
## Instruction:
vim: Use autopep8 for Python formatting.
## Code After:
setlocal makeprg=flake8\ %
setlocal errorformat=%f:%l:%c:\ %m
setlocal foldmethod=indent
setlocal formatprg=autopep8\ -
| setlocal makeprg=flake8\ %
setlocal errorformat=%f:%l:%c:\ %m
setlocal foldmethod=indent
+ setlocal formatprg=autopep8\ - | 1 | 0.333333 | 1 | 0 |
0bb48610b506a4d53963b111ae9ae582fcd47694 | python/resources/icon-robots.txt | python/resources/icon-robots.txt | skip: lafs
skip: pycharm_core*
| skip: lafs
skip: PyCharmCore*
skip: pycharm_core*
| Revert "PY-32670 Don't ignore PyCharm app icons" | Revert "PY-32670 Don't ignore PyCharm app icons"
This reverts commit 90745c83
| Text | apache-2.0 | allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community | text | ## Code Before:
skip: lafs
skip: pycharm_core*
## Instruction:
Revert "PY-32670 Don't ignore PyCharm app icons"
This reverts commit 90745c83
## Code After:
skip: lafs
skip: PyCharmCore*
skip: pycharm_core*
| skip: lafs
+ skip: PyCharmCore*
skip: pycharm_core* | 1 | 0.5 | 1 | 0 |
d27b96dadb4616cc8d1652504eee0d21209f73d1 | lib/bookyt_pos/railtie.rb | lib/bookyt_pos/railtie.rb | require 'bookyt_pos'
require 'rails'
module BookytPos
class Railtie < Rails::Engine
initializer :after_initialize do
Bookyt::Engine.register_engine 'bookyt_pos'
end
end
end
| require 'bookyt_pos'
require 'rails'
module BookytPos
class Railtie < Rails::Engine
initializer :after_initialize do |app|
app.config.bookyt.engines << 'bookyt_pos'
end
end
end
| Use app.config.bookyt.engines to register engines with bookyt. | Use app.config.bookyt.engines to register engines with bookyt.
| Ruby | mit | huerlisi/bookyt_salary,huerlisi/bookyt_pos,huerlisi/bookyt_pos,silvermind/bookyt_salary,huerlisi/bookyt_salary,silvermind/bookyt_salary,huerlisi/bookyt_pos,huerlisi/bookyt_stock,silvermind/bookyt_salary,huerlisi/bookyt_salary,huerlisi/bookyt_stock | ruby | ## Code Before:
require 'bookyt_pos'
require 'rails'
module BookytPos
class Railtie < Rails::Engine
initializer :after_initialize do
Bookyt::Engine.register_engine 'bookyt_pos'
end
end
end
## Instruction:
Use app.config.bookyt.engines to register engines with bookyt.
## Code After:
require 'bookyt_pos'
require 'rails'
module BookytPos
class Railtie < Rails::Engine
initializer :after_initialize do |app|
app.config.bookyt.engines << 'bookyt_pos'
end
end
end
| require 'bookyt_pos'
require 'rails'
module BookytPos
class Railtie < Rails::Engine
- initializer :after_initialize do
+ initializer :after_initialize do |app|
? ++++++
- Bookyt::Engine.register_engine 'bookyt_pos'
+ app.config.bookyt.engines << 'bookyt_pos'
end
end
end | 4 | 0.4 | 2 | 2 |
79b381f22cbc24d09e84e7c02b45f4c8cb9ed27f | iExtra/Classes/Extensions/Collection_Shuffle.swift | iExtra/Classes/Extensions/Collection_Shuffle.swift | //
// MutableCollection_Shuffle.swift
// Created by Nate Cook on 2016-12-13.
// Copyright © 2016 Nate Cook. All rights reserved.
//
// Link: http://stackoverflow.com/questions/24026510/how-do-i-shuffle-an-array-in-swift
//
import Foundation
public extension MutableCollection where Indices.Iterator.Element == Index {
public mutating func shuffle() {
let c = count
guard c > 1 else { return }
for (firstUnshuffled , unshuffledCount) in zip(indices, stride(from: c, to: 1, by: -1)) {
let d: IndexDistance = numericCast(arc4random_uniform(numericCast(unshuffledCount)))
guard d != 0 else { continue }
let i = index(firstUnshuffled, offsetBy: d)
self.swapAt(firstUnshuffled, i)
}
}
}
public extension Sequence {
public func shuffled() -> [Iterator.Element] {
var result = Array(self)
result.shuffle()
return result
}
}
| //
// MutableCollection_Shuffle.swift
// Created by Nate Cook on 2016-12-13.
// Copyright © 2016 Nate Cook. All rights reserved.
//
// Link: http://stackoverflow.com/questions/24026510/how-do-i-shuffle-an-array-in-swift
//
import Foundation
public extension MutableCollection {
public mutating func shuffle() {
let c = count
guard c > 1 else { return }
for (firstUnshuffled , unshuffledCount) in zip(indices, stride(from: c, to: 1, by: -1)) {
let d: IndexDistance = numericCast(arc4random_uniform(numericCast(unshuffledCount)))
guard d != 0 else { continue }
let i = index(firstUnshuffled, offsetBy: d)
self.swapAt(firstUnshuffled, i)
}
}
}
public extension Sequence {
public func shuffled() -> [Iterator.Element] {
var result = Array(self)
result.shuffle()
return result
}
}
| Remove now redundant shuffle where clause | Remove now redundant shuffle where clause
| Swift | mit | danielsaidi/iExtra,danielsaidi/iExtra,danielsaidi/iExtra | swift | ## Code Before:
//
// MutableCollection_Shuffle.swift
// Created by Nate Cook on 2016-12-13.
// Copyright © 2016 Nate Cook. All rights reserved.
//
// Link: http://stackoverflow.com/questions/24026510/how-do-i-shuffle-an-array-in-swift
//
import Foundation
public extension MutableCollection where Indices.Iterator.Element == Index {
public mutating func shuffle() {
let c = count
guard c > 1 else { return }
for (firstUnshuffled , unshuffledCount) in zip(indices, stride(from: c, to: 1, by: -1)) {
let d: IndexDistance = numericCast(arc4random_uniform(numericCast(unshuffledCount)))
guard d != 0 else { continue }
let i = index(firstUnshuffled, offsetBy: d)
self.swapAt(firstUnshuffled, i)
}
}
}
public extension Sequence {
public func shuffled() -> [Iterator.Element] {
var result = Array(self)
result.shuffle()
return result
}
}
## Instruction:
Remove now redundant shuffle where clause
## Code After:
//
// MutableCollection_Shuffle.swift
// Created by Nate Cook on 2016-12-13.
// Copyright © 2016 Nate Cook. All rights reserved.
//
// Link: http://stackoverflow.com/questions/24026510/how-do-i-shuffle-an-array-in-swift
//
import Foundation
public extension MutableCollection {
public mutating func shuffle() {
let c = count
guard c > 1 else { return }
for (firstUnshuffled , unshuffledCount) in zip(indices, stride(from: c, to: 1, by: -1)) {
let d: IndexDistance = numericCast(arc4random_uniform(numericCast(unshuffledCount)))
guard d != 0 else { continue }
let i = index(firstUnshuffled, offsetBy: d)
self.swapAt(firstUnshuffled, i)
}
}
}
public extension Sequence {
public func shuffled() -> [Iterator.Element] {
var result = Array(self)
result.shuffle()
return result
}
}
| //
// MutableCollection_Shuffle.swift
// Created by Nate Cook on 2016-12-13.
// Copyright © 2016 Nate Cook. All rights reserved.
//
// Link: http://stackoverflow.com/questions/24026510/how-do-i-shuffle-an-array-in-swift
//
import Foundation
- public extension MutableCollection where Indices.Iterator.Element == Index {
+ public extension MutableCollection {
public mutating func shuffle() {
let c = count
guard c > 1 else { return }
for (firstUnshuffled , unshuffledCount) in zip(indices, stride(from: c, to: 1, by: -1)) {
let d: IndexDistance = numericCast(arc4random_uniform(numericCast(unshuffledCount)))
guard d != 0 else { continue }
let i = index(firstUnshuffled, offsetBy: d)
self.swapAt(firstUnshuffled, i)
}
}
}
public extension Sequence {
public func shuffled() -> [Iterator.Element] {
var result = Array(self)
result.shuffle()
return result
}
} | 2 | 0.0625 | 1 | 1 |
abf3f9d87828d7159c3c04a46b5e6630a6af43b7 | app/scripts/services/resources-service.js | app/scripts/services/resources-service.js | 'use strict';
(function() {
angular.module('ncsaas')
.service('resourcesService', ['RawResource', 'currentStateService', '$q', resourcesService]);
function resourcesService(RawResource, currentStateService, $q) {
var vm = this;
vm.getResourcesList = getResourcesList;
vm.getRawResourcesList = getRawResourcesList;
function getRawResourcesList() {
return RawResource.query();
}
function getResourcesList() {
var deferred = $q.defer();
currentStateService.getCustomer().then(function(response){
var customerName = response.name;
var resources = RawResource.query({customer_name: customerName});
deferred.resolve(resources);
}, function(err){
deferred.reject(err);
});
return deferred.promise;
}
}
})();
(function() {
angular.module('ncsaas')
.factory('RawResource', ['ENV', '$resource', RawResource]);
function RawResource(ENV, $resource) {
return $resource(
ENV.apiEndpoint + 'api/resources/', {},
{
update: {
method: 'PUT'
}
}
);
}
})();
| 'use strict';
(function() {
angular.module('ncsaas')
.service('resourcesService', ['RawResource', 'currentStateService', '$q', resourcesService]);
function resourcesService(RawResource, currentStateService, $q) {
var vm = this;
vm.getResourcesList = getResourcesList;
vm.getRawResourcesList = getRawResourcesList;
function getRawResourcesList() {
return RawResource.query();
}
function getResourcesList() {
var deferred = $q.defer();
currentStateService.getCustomer().then(function(response){
var customerName = response.name;
var resources = RawResource.query({customer_name: customerName});
deferred.resolve(resources);
}, function(err){
deferred.reject(err);
});
return deferred.promise;
}
}
})();
(function() {
angular.module('ncsaas')
.factory('RawResource', ['ENV', '$resource', RawResource]);
function RawResource(ENV, $resource) {
return $resource(
ENV.apiEndpoint + 'api/resources/', {},
{
}
);
}
})();
| Remove method update from RawResource service | Remove method update from RawResource service
| JavaScript | mit | opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport | javascript | ## Code Before:
'use strict';
(function() {
angular.module('ncsaas')
.service('resourcesService', ['RawResource', 'currentStateService', '$q', resourcesService]);
function resourcesService(RawResource, currentStateService, $q) {
var vm = this;
vm.getResourcesList = getResourcesList;
vm.getRawResourcesList = getRawResourcesList;
function getRawResourcesList() {
return RawResource.query();
}
function getResourcesList() {
var deferred = $q.defer();
currentStateService.getCustomer().then(function(response){
var customerName = response.name;
var resources = RawResource.query({customer_name: customerName});
deferred.resolve(resources);
}, function(err){
deferred.reject(err);
});
return deferred.promise;
}
}
})();
(function() {
angular.module('ncsaas')
.factory('RawResource', ['ENV', '$resource', RawResource]);
function RawResource(ENV, $resource) {
return $resource(
ENV.apiEndpoint + 'api/resources/', {},
{
update: {
method: 'PUT'
}
}
);
}
})();
## Instruction:
Remove method update from RawResource service
## Code After:
'use strict';
(function() {
angular.module('ncsaas')
.service('resourcesService', ['RawResource', 'currentStateService', '$q', resourcesService]);
function resourcesService(RawResource, currentStateService, $q) {
var vm = this;
vm.getResourcesList = getResourcesList;
vm.getRawResourcesList = getRawResourcesList;
function getRawResourcesList() {
return RawResource.query();
}
function getResourcesList() {
var deferred = $q.defer();
currentStateService.getCustomer().then(function(response){
var customerName = response.name;
var resources = RawResource.query({customer_name: customerName});
deferred.resolve(resources);
}, function(err){
deferred.reject(err);
});
return deferred.promise;
}
}
})();
(function() {
angular.module('ncsaas')
.factory('RawResource', ['ENV', '$resource', RawResource]);
function RawResource(ENV, $resource) {
return $resource(
ENV.apiEndpoint + 'api/resources/', {},
{
}
);
}
})();
| 'use strict';
(function() {
angular.module('ncsaas')
.service('resourcesService', ['RawResource', 'currentStateService', '$q', resourcesService]);
function resourcesService(RawResource, currentStateService, $q) {
var vm = this;
vm.getResourcesList = getResourcesList;
vm.getRawResourcesList = getRawResourcesList;
function getRawResourcesList() {
return RawResource.query();
}
function getResourcesList() {
var deferred = $q.defer();
currentStateService.getCustomer().then(function(response){
var customerName = response.name;
var resources = RawResource.query({customer_name: customerName});
deferred.resolve(resources);
}, function(err){
deferred.reject(err);
});
return deferred.promise;
}
}
})();
(function() {
angular.module('ncsaas')
.factory('RawResource', ['ENV', '$resource', RawResource]);
function RawResource(ENV, $resource) {
return $resource(
ENV.apiEndpoint + 'api/resources/', {},
{
- update: {
- method: 'PUT'
- }
}
);
}
})(); | 3 | 0.068182 | 0 | 3 |
be2d50b11edcb865b507078dced8a7d837290dad | templates/system/modules/cool-profile-page/themes/base/css/style.css | templates/system/modules/cool-profile-page/themes/base/css/style.css | /*
* Author: Pierre-Henry Soria <hello@ph7cms.com>
* Copyright: (c) 2018, Pierre-Henry Soria. All Rights Reserved.
* License: GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
*/
h2 {
text-transform: uppercase;
text-decoration: underline;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.profile-section {
padding-bottom: 4rem;
}
.profile-section::after {
position: absolute;
left: 40px;
right: 40px;
content: '';
padding-bottom: 4rem;
border-bottom: 1px solid #ddd;
}
.chat, .message, .friend, .heart {
font-size: 80px;
line-height: 100px;
}
.chat {
color: #ff4000;
}
.message {
color: #45c000;
}
.friend {
color: #2b65f8;
}
.heart {
color: #F06;
}
| /*
* Author: Pierre-Henry Soria <hello@ph7cms.com>
* Copyright: (c) 2018, Pierre-Henry Soria. All Rights Reserved.
* License: GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
*/
h2 {
text-transform: uppercase;
text-decoration: underline;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.profile-section {
padding-bottom: 4rem;
}
.profile-section::after {
position: absolute;
left: 40px;
right: 40px;
content: '';
padding-bottom: 2rem;
border-bottom: 1px solid #ddd;
}
.chat, .message, .friend, .heart {
font-size: 80px;
line-height: 100px;
}
.chat {
color: #ff4000;
}
.message {
color: #45c000;
}
.friend {
color: #2b65f8;
}
.heart {
color: #F06;
}
.bottom {
float: none !important;
}
| Fix "picture"/"video" sections on profile page | Fix "picture"/"video" sections on profile page
(better design style + fix button not linkable)
| CSS | mit | pH7Software/pH7-Social-Dating-CMS,pH7Software/pH7-Social-Dating-CMS,pH7Software/pH7-Social-Dating-CMS,pH7Software/pH7-Social-Dating-CMS | css | ## Code Before:
/*
* Author: Pierre-Henry Soria <hello@ph7cms.com>
* Copyright: (c) 2018, Pierre-Henry Soria. All Rights Reserved.
* License: GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
*/
h2 {
text-transform: uppercase;
text-decoration: underline;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.profile-section {
padding-bottom: 4rem;
}
.profile-section::after {
position: absolute;
left: 40px;
right: 40px;
content: '';
padding-bottom: 4rem;
border-bottom: 1px solid #ddd;
}
.chat, .message, .friend, .heart {
font-size: 80px;
line-height: 100px;
}
.chat {
color: #ff4000;
}
.message {
color: #45c000;
}
.friend {
color: #2b65f8;
}
.heart {
color: #F06;
}
## Instruction:
Fix "picture"/"video" sections on profile page
(better design style + fix button not linkable)
## Code After:
/*
* Author: Pierre-Henry Soria <hello@ph7cms.com>
* Copyright: (c) 2018, Pierre-Henry Soria. All Rights Reserved.
* License: GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
*/
h2 {
text-transform: uppercase;
text-decoration: underline;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.profile-section {
padding-bottom: 4rem;
}
.profile-section::after {
position: absolute;
left: 40px;
right: 40px;
content: '';
padding-bottom: 2rem;
border-bottom: 1px solid #ddd;
}
.chat, .message, .friend, .heart {
font-size: 80px;
line-height: 100px;
}
.chat {
color: #ff4000;
}
.message {
color: #45c000;
}
.friend {
color: #2b65f8;
}
.heart {
color: #F06;
}
.bottom {
float: none !important;
}
| /*
* Author: Pierre-Henry Soria <hello@ph7cms.com>
* Copyright: (c) 2018, Pierre-Henry Soria. All Rights Reserved.
* License: GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
*/
h2 {
text-transform: uppercase;
text-decoration: underline;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.profile-section {
padding-bottom: 4rem;
}
.profile-section::after {
position: absolute;
left: 40px;
right: 40px;
content: '';
- padding-bottom: 4rem;
? ^
+ padding-bottom: 2rem;
? ^
border-bottom: 1px solid #ddd;
}
.chat, .message, .friend, .heart {
font-size: 80px;
line-height: 100px;
}
.chat {
color: #ff4000;
}
.message {
color: #45c000;
}
.friend {
color: #2b65f8;
}
.heart {
color: #F06;
}
+
+ .bottom {
+ float: none !important;
+ } | 6 | 0.130435 | 5 | 1 |
fe44fbc0e4a8a9c34f4bc069a36e7ad1d701bce1 | rails/rails-notes.md | rails/rails-notes.md |
**Prerequisites**
Rails requires Ruby version 2.5.0 or later, SQLite3, and [yarn].
```sh
# This may take a few minutes if it is the first time installing.
gem install rails
```
## Uncategorized
**Generate New App**
```sh
rails new {app_name}
# E.g.
rails new blog
```
**Generate a Controller**
```sh
rails generate controller {Controller_name} {action_name}
# E.g.
rails generate controller Example index
```
[yarn]: https://yarnpkg.com/
|
**Prerequisites**
Rails requires Ruby version 2.5.0 or later, [SQLite3], and [yarn].
**Installing SQLite3 on Windows**
I haven't found complete instructions on how to install SQLite3 on Windows that works with the `sqlite3` Ruby gem.
1) Goto https://www.sqlite.org/download.html
a) From the "Source Code" section, download the `sqlite-amalgamation` zip file.
b) From the "Precompiled Binaries for Windows" section
i) Download one of the two `sqlite-dll` zip files based on your system's architecture.
ii) Download the `sqlite-tools` zip file.
2) Create a destination directory for the contents of SQLite 3 zip files.
3) Upzip all the zip files.
4) Copy all the contents of each of the zip files to the destination directory.
5) Add this destination directory to your PATH.
As of Oct 11th, 2019, the destination directory should have the following files:
- shell.c
- sqlite3.c
- sqlite3.h
- sqlite3ext.h
- sqlite3.def
- sqlite3.dll
- sqldiff.exe
- sqlite3.exe
- sqlite3_analyzer.exe
Now that the .c and .h files are available to the `sqlite3` Ruby gem, it should be able to compile a version for itself to use. (I am not sure why it just doesn't use the DLL.)
```sh
# This may take a few minutes if it is the first time installing.
gem install rails
```
## Uncategorized
**Generate New App**
```sh
rails new {app_name}
# E.g.
rails new blog
```
**Generate a Controller**
```sh
rails generate controller {Controller_name} {action_name}
# E.g.
rails generate controller Example index
```
[sqlite3]: https://www.sqlite.org/
[yarn]: https://yarnpkg.com/
| Add an Installing SQLite3 on Windows Section | Add an Installing SQLite3 on Windows Section | Markdown | mit | dhurlburtusa/shortcuts,dhurlburtusa/shortcuts | markdown | ## Code Before:
**Prerequisites**
Rails requires Ruby version 2.5.0 or later, SQLite3, and [yarn].
```sh
# This may take a few minutes if it is the first time installing.
gem install rails
```
## Uncategorized
**Generate New App**
```sh
rails new {app_name}
# E.g.
rails new blog
```
**Generate a Controller**
```sh
rails generate controller {Controller_name} {action_name}
# E.g.
rails generate controller Example index
```
[yarn]: https://yarnpkg.com/
## Instruction:
Add an Installing SQLite3 on Windows Section
## Code After:
**Prerequisites**
Rails requires Ruby version 2.5.0 or later, [SQLite3], and [yarn].
**Installing SQLite3 on Windows**
I haven't found complete instructions on how to install SQLite3 on Windows that works with the `sqlite3` Ruby gem.
1) Goto https://www.sqlite.org/download.html
a) From the "Source Code" section, download the `sqlite-amalgamation` zip file.
b) From the "Precompiled Binaries for Windows" section
i) Download one of the two `sqlite-dll` zip files based on your system's architecture.
ii) Download the `sqlite-tools` zip file.
2) Create a destination directory for the contents of SQLite 3 zip files.
3) Upzip all the zip files.
4) Copy all the contents of each of the zip files to the destination directory.
5) Add this destination directory to your PATH.
As of Oct 11th, 2019, the destination directory should have the following files:
- shell.c
- sqlite3.c
- sqlite3.h
- sqlite3ext.h
- sqlite3.def
- sqlite3.dll
- sqldiff.exe
- sqlite3.exe
- sqlite3_analyzer.exe
Now that the .c and .h files are available to the `sqlite3` Ruby gem, it should be able to compile a version for itself to use. (I am not sure why it just doesn't use the DLL.)
```sh
# This may take a few minutes if it is the first time installing.
gem install rails
```
## Uncategorized
**Generate New App**
```sh
rails new {app_name}
# E.g.
rails new blog
```
**Generate a Controller**
```sh
rails generate controller {Controller_name} {action_name}
# E.g.
rails generate controller Example index
```
[sqlite3]: https://www.sqlite.org/
[yarn]: https://yarnpkg.com/
|
**Prerequisites**
- Rails requires Ruby version 2.5.0 or later, SQLite3, and [yarn].
+ Rails requires Ruby version 2.5.0 or later, [SQLite3], and [yarn].
? + +
+
+ **Installing SQLite3 on Windows**
+
+ I haven't found complete instructions on how to install SQLite3 on Windows that works with the `sqlite3` Ruby gem.
+
+ 1) Goto https://www.sqlite.org/download.html
+ a) From the "Source Code" section, download the `sqlite-amalgamation` zip file.
+ b) From the "Precompiled Binaries for Windows" section
+ i) Download one of the two `sqlite-dll` zip files based on your system's architecture.
+ ii) Download the `sqlite-tools` zip file.
+ 2) Create a destination directory for the contents of SQLite 3 zip files.
+ 3) Upzip all the zip files.
+ 4) Copy all the contents of each of the zip files to the destination directory.
+ 5) Add this destination directory to your PATH.
+
+ As of Oct 11th, 2019, the destination directory should have the following files:
+ - shell.c
+ - sqlite3.c
+ - sqlite3.h
+ - sqlite3ext.h
+ - sqlite3.def
+ - sqlite3.dll
+ - sqldiff.exe
+ - sqlite3.exe
+ - sqlite3_analyzer.exe
+
+ Now that the .c and .h files are available to the `sqlite3` Ruby gem, it should be able to compile a version for itself to use. (I am not sure why it just doesn't use the DLL.)
```sh
# This may take a few minutes if it is the first time installing.
gem install rails
```
## Uncategorized
**Generate New App**
```sh
rails new {app_name}
# E.g.
rails new blog
```
**Generate a Controller**
```sh
rails generate controller {Controller_name} {action_name}
# E.g.
rails generate controller Example index
```
-
+ [sqlite3]: https://www.sqlite.org/
[yarn]: https://yarnpkg.com/ | 31 | 1 | 29 | 2 |
7910858928829f6ef6f542c0764783490b128456 | README.md | README.md |
A Basic jQuery plugin that renders a form into the specified target, geocoding
input and displaying results from Sunlight's Congress and Open States APIs.
## Usage:
**To add to your page:**
1. Link jQuery and `dist/jquery.findyourrep-pack.min.js` on your page (in that order).
2. Call `findYourRep()` on an element:
```javascript
$('.myDiv').findYourRep({
apikey: 'your-key'
});
```
**To build & contribute:**
1. Clone this repo
2. Install Node.js if you don't have it
3. Run `npm install && bower install && grunt demo`
## Options:
Passed as a javascript object to the constructor, just like any jQ plugin.
- `apikey`: Your Sunlight Labs API key (required)
- `apis`: A comma-delimited list of apis to query.
For U.S. Congress only, use `apis: 'congress'`
For U.S. and State Legislatures, use `apis: 'congress, openstates'`
Default is `'congress, openstates'`.
- `title`: The title of the widget. Default is 'Find Your Representatives'
- `text`: The text that displays above the textarea for the user's address.
Default is 'Enter your address to see who represents you.'
- `action`: The text of the button that finds your reps. Default is 'Go!'
## TODO:
- Add some CSS
## License:
BSD3 |
A Basic jQuery plugin that renders a form into the specified target, geocoding
input and displaying results from Sunlight's Congress and Open States APIs.
## Usage:
**To add to your page:**
1. Link jQuery and `dist/jquery.findyourrep-pack.min.js` on your page (in that order).
2. Call `findYourRep()` on an element:
```javascript
$('.myDiv').findYourRep({
apikey: 'your-key'
});
```
**To build & contribute:**
1. Clone this repo
2. Install Node.js if you don't have it
3. Run `npm install && bower install && grunt demo`
## Options:
Passed as a javascript object to the constructor, just like any jQ plugin.
- `apikey`: Your Sunlight Labs API key (required)
- `apis`: A comma-delimited list of apis to query.
For U.S. Congress only, use `apis: 'congress'`
For U.S. and State Legislatures, use `apis: 'congress, openstates'`
Default is `'congress, openstates'`.
- `title`: The title of the widget. Default is 'Find Your Representatives'
- `text`: The text that displays above the textarea for the user's address.
Default is 'Enter your address to see who represents you.'
- `action`: The text of the button that finds your reps. Default is 'Go!'
## License:
BSD3 | Remove css task from readme | Remove css task from readme | Markdown | bsd-3-clause | phillipadsmith/jquery-findyourrep,sunlightlabs/jquery-findyourrep,phillipadsmith/jquery-findyourrep | markdown | ## Code Before:
A Basic jQuery plugin that renders a form into the specified target, geocoding
input and displaying results from Sunlight's Congress and Open States APIs.
## Usage:
**To add to your page:**
1. Link jQuery and `dist/jquery.findyourrep-pack.min.js` on your page (in that order).
2. Call `findYourRep()` on an element:
```javascript
$('.myDiv').findYourRep({
apikey: 'your-key'
});
```
**To build & contribute:**
1. Clone this repo
2. Install Node.js if you don't have it
3. Run `npm install && bower install && grunt demo`
## Options:
Passed as a javascript object to the constructor, just like any jQ plugin.
- `apikey`: Your Sunlight Labs API key (required)
- `apis`: A comma-delimited list of apis to query.
For U.S. Congress only, use `apis: 'congress'`
For U.S. and State Legislatures, use `apis: 'congress, openstates'`
Default is `'congress, openstates'`.
- `title`: The title of the widget. Default is 'Find Your Representatives'
- `text`: The text that displays above the textarea for the user's address.
Default is 'Enter your address to see who represents you.'
- `action`: The text of the button that finds your reps. Default is 'Go!'
## TODO:
- Add some CSS
## License:
BSD3
## Instruction:
Remove css task from readme
## Code After:
A Basic jQuery plugin that renders a form into the specified target, geocoding
input and displaying results from Sunlight's Congress and Open States APIs.
## Usage:
**To add to your page:**
1. Link jQuery and `dist/jquery.findyourrep-pack.min.js` on your page (in that order).
2. Call `findYourRep()` on an element:
```javascript
$('.myDiv').findYourRep({
apikey: 'your-key'
});
```
**To build & contribute:**
1. Clone this repo
2. Install Node.js if you don't have it
3. Run `npm install && bower install && grunt demo`
## Options:
Passed as a javascript object to the constructor, just like any jQ plugin.
- `apikey`: Your Sunlight Labs API key (required)
- `apis`: A comma-delimited list of apis to query.
For U.S. Congress only, use `apis: 'congress'`
For U.S. and State Legislatures, use `apis: 'congress, openstates'`
Default is `'congress, openstates'`.
- `title`: The title of the widget. Default is 'Find Your Representatives'
- `text`: The text that displays above the textarea for the user's address.
Default is 'Enter your address to see who represents you.'
- `action`: The text of the button that finds your reps. Default is 'Go!'
## License:
BSD3 |
A Basic jQuery plugin that renders a form into the specified target, geocoding
input and displaying results from Sunlight's Congress and Open States APIs.
## Usage:
**To add to your page:**
1. Link jQuery and `dist/jquery.findyourrep-pack.min.js` on your page (in that order).
2. Call `findYourRep()` on an element:
```javascript
$('.myDiv').findYourRep({
apikey: 'your-key'
});
```
**To build & contribute:**
1. Clone this repo
2. Install Node.js if you don't have it
3. Run `npm install && bower install && grunt demo`
## Options:
Passed as a javascript object to the constructor, just like any jQ plugin.
- `apikey`: Your Sunlight Labs API key (required)
- `apis`: A comma-delimited list of apis to query.
For U.S. Congress only, use `apis: 'congress'`
For U.S. and State Legislatures, use `apis: 'congress, openstates'`
Default is `'congress, openstates'`.
- `title`: The title of the widget. Default is 'Find Your Representatives'
- `text`: The text that displays above the textarea for the user's address.
Default is 'Enter your address to see who represents you.'
- `action`: The text of the button that finds your reps. Default is 'Go!'
- ## TODO:
-
- - Add some CSS
-
## License:
BSD3 | 4 | 0.090909 | 0 | 4 |
b54680b7f51cb1e3f1a203e2951b7bc45a971b67 | app/controllers/coronavirus_landing_page_controller.rb | app/controllers/coronavirus_landing_page_controller.rb | class CoronavirusLandingPageController < ApplicationController
skip_before_action :set_expiry
before_action -> { set_expiry(5.minutes) }
def show
@content_item = content_item.to_hash
breadcrumbs = [{ title: "Home", url: "/", is_page_parent: true }]
render "show", locals: { breadcrumbs: breadcrumbs, details: presenter,
special_announcement: special_announcement }
end
def business
@content_item = content_item.to_hash
breadcrumbs = [
{ title: "Home", url: "/" },
{ title: "Coronavirus (COVID-19)", url: "/coronavirus", is_page_parent: true },
]
render "business", locals: {
breadcrumbs: breadcrumbs,
details: business_presenter,
}
end
private
def content_item
ContentItem.find!(request.path)
end
def presenter
CoronavirusLandingPagePresenter.new(@content_item)
end
def special_announcement
SpecialAnnouncementPresenter.new(@content_item)
end
def business_presenter
BusinessSupportPagePresenter.new(@content_item)
end
end
| class CoronavirusLandingPageController < ApplicationController
skip_before_action :set_expiry
before_action -> { set_expiry(5.minutes) }
def show
@content_item = content_item.to_hash
breadcrumbs = [{ title: "Home", url: "/", is_page_parent: true }]
render "show", locals: { breadcrumbs: breadcrumbs, details: presenter,
special_announcement: special_announcement }
end
def business
@content_item = content_item.to_hash
breadcrumbs = [{ title: "Home", url: "/" }]
render "business", locals: {
breadcrumbs: breadcrumbs,
details: business_presenter,
}
end
private
def content_item
ContentItem.find!(request.path)
end
def presenter
CoronavirusLandingPagePresenter.new(@content_item)
end
def special_announcement
SpecialAnnouncementPresenter.new(@content_item)
end
def business_presenter
BusinessSupportPagePresenter.new(@content_item)
end
end
| Remove additional link in business breadcrumbs | Remove additional link in business breadcrumbs
| Ruby | mit | alphagov/collections,alphagov/collections,alphagov/collections,alphagov/collections | ruby | ## Code Before:
class CoronavirusLandingPageController < ApplicationController
skip_before_action :set_expiry
before_action -> { set_expiry(5.minutes) }
def show
@content_item = content_item.to_hash
breadcrumbs = [{ title: "Home", url: "/", is_page_parent: true }]
render "show", locals: { breadcrumbs: breadcrumbs, details: presenter,
special_announcement: special_announcement }
end
def business
@content_item = content_item.to_hash
breadcrumbs = [
{ title: "Home", url: "/" },
{ title: "Coronavirus (COVID-19)", url: "/coronavirus", is_page_parent: true },
]
render "business", locals: {
breadcrumbs: breadcrumbs,
details: business_presenter,
}
end
private
def content_item
ContentItem.find!(request.path)
end
def presenter
CoronavirusLandingPagePresenter.new(@content_item)
end
def special_announcement
SpecialAnnouncementPresenter.new(@content_item)
end
def business_presenter
BusinessSupportPagePresenter.new(@content_item)
end
end
## Instruction:
Remove additional link in business breadcrumbs
## Code After:
class CoronavirusLandingPageController < ApplicationController
skip_before_action :set_expiry
before_action -> { set_expiry(5.minutes) }
def show
@content_item = content_item.to_hash
breadcrumbs = [{ title: "Home", url: "/", is_page_parent: true }]
render "show", locals: { breadcrumbs: breadcrumbs, details: presenter,
special_announcement: special_announcement }
end
def business
@content_item = content_item.to_hash
breadcrumbs = [{ title: "Home", url: "/" }]
render "business", locals: {
breadcrumbs: breadcrumbs,
details: business_presenter,
}
end
private
def content_item
ContentItem.find!(request.path)
end
def presenter
CoronavirusLandingPagePresenter.new(@content_item)
end
def special_announcement
SpecialAnnouncementPresenter.new(@content_item)
end
def business_presenter
BusinessSupportPagePresenter.new(@content_item)
end
end
| class CoronavirusLandingPageController < ApplicationController
skip_before_action :set_expiry
before_action -> { set_expiry(5.minutes) }
def show
@content_item = content_item.to_hash
breadcrumbs = [{ title: "Home", url: "/", is_page_parent: true }]
render "show", locals: { breadcrumbs: breadcrumbs, details: presenter,
special_announcement: special_announcement }
end
def business
@content_item = content_item.to_hash
- breadcrumbs = [
- { title: "Home", url: "/" },
? ^
+ breadcrumbs = [{ title: "Home", url: "/" }]
? +++++++++++ + + ^
- { title: "Coronavirus (COVID-19)", url: "/coronavirus", is_page_parent: true },
- ]
render "business", locals: {
breadcrumbs: breadcrumbs,
details: business_presenter,
}
end
private
def content_item
ContentItem.find!(request.path)
end
def presenter
CoronavirusLandingPagePresenter.new(@content_item)
end
def special_announcement
SpecialAnnouncementPresenter.new(@content_item)
end
def business_presenter
BusinessSupportPagePresenter.new(@content_item)
end
end | 5 | 0.121951 | 1 | 4 |
94b6b97dc1e706a6560092aa29cbe4e21f052924 | froide/account/apps.py | froide/account/apps.py | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class AccountConfig(AppConfig):
name = 'froide.account'
verbose_name = _("Account")
def ready(self):
from froide.bounce.signals import user_email_bounced
user_email_bounced.connect(deactivate_user_after_bounce)
def deactivate_user_after_bounce(sender, bounce, should_deactivate=False, **kwargs):
if not should_deactivate:
return
if not bounce.user:
return
bounce.user.deactivate()
| from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
from django.urls import reverse
from .menu import menu_registry, MenuItem
class AccountConfig(AppConfig):
name = 'froide.account'
verbose_name = _("Account")
def ready(self):
from froide.bounce.signals import user_email_bounced
user_email_bounced.connect(deactivate_user_after_bounce)
menu_registry.register(get_settings_menu_item)
menu_registry.register(get_request_menu_item)
def deactivate_user_after_bounce(sender, bounce, should_deactivate=False, **kwargs):
if not should_deactivate:
return
if not bounce.user:
return
bounce.user.deactivate()
def get_request_menu_item(request):
return MenuItem(
section='before_request', order=999,
url=reverse('account-show'),
label=_('My requests')
)
def get_settings_menu_item(request):
return MenuItem(
section='after_settings', order=-1,
url=reverse('account-settings'),
label=_('Settings')
)
| Make settings and requests menu items | Make settings and requests menu items | Python | mit | fin/froide,fin/froide,fin/froide,stefanw/froide,stefanw/froide,fin/froide,stefanw/froide,stefanw/froide,stefanw/froide | python | ## Code Before:
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class AccountConfig(AppConfig):
name = 'froide.account'
verbose_name = _("Account")
def ready(self):
from froide.bounce.signals import user_email_bounced
user_email_bounced.connect(deactivate_user_after_bounce)
def deactivate_user_after_bounce(sender, bounce, should_deactivate=False, **kwargs):
if not should_deactivate:
return
if not bounce.user:
return
bounce.user.deactivate()
## Instruction:
Make settings and requests menu items
## Code After:
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
from django.urls import reverse
from .menu import menu_registry, MenuItem
class AccountConfig(AppConfig):
name = 'froide.account'
verbose_name = _("Account")
def ready(self):
from froide.bounce.signals import user_email_bounced
user_email_bounced.connect(deactivate_user_after_bounce)
menu_registry.register(get_settings_menu_item)
menu_registry.register(get_request_menu_item)
def deactivate_user_after_bounce(sender, bounce, should_deactivate=False, **kwargs):
if not should_deactivate:
return
if not bounce.user:
return
bounce.user.deactivate()
def get_request_menu_item(request):
return MenuItem(
section='before_request', order=999,
url=reverse('account-show'),
label=_('My requests')
)
def get_settings_menu_item(request):
return MenuItem(
section='after_settings', order=-1,
url=reverse('account-settings'),
label=_('Settings')
)
| from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
+ from django.urls import reverse
+
+ from .menu import menu_registry, MenuItem
class AccountConfig(AppConfig):
name = 'froide.account'
verbose_name = _("Account")
def ready(self):
from froide.bounce.signals import user_email_bounced
user_email_bounced.connect(deactivate_user_after_bounce)
+ menu_registry.register(get_settings_menu_item)
+ menu_registry.register(get_request_menu_item)
+
def deactivate_user_after_bounce(sender, bounce, should_deactivate=False, **kwargs):
if not should_deactivate:
return
if not bounce.user:
return
bounce.user.deactivate()
+
+
+ def get_request_menu_item(request):
+ return MenuItem(
+ section='before_request', order=999,
+ url=reverse('account-show'),
+ label=_('My requests')
+ )
+
+
+ def get_settings_menu_item(request):
+ return MenuItem(
+ section='after_settings', order=-1,
+ url=reverse('account-settings'),
+ label=_('Settings')
+ ) | 22 | 1.1 | 22 | 0 |
b41344eee01c1c70358208cec07ccd29482a6de7 | _pages/links.md | _pages/links.md | ---
layout: page
title: Links
permalink: /links/
published: true
---
- KenOoKamiHoro ([https://blog.yoitsu.moe/](https://blog.yoitsu.moe/)) - 约伊兹的萌狼乡手札
~~俗稱萌狼,喜歡吃人~~ 😋
- Bekcpear(iYI) ([https://https://nifume.com/](https://nifume.com/)) - 未墨轻梅
Dalao x1 Get√
- FiveYellowMice ([https://fiveyellowmice.com](https://fiveyellowmice.com)) - FiveYellowMice's Blog
也就是五黃鼠,也被叫做皇叔 XD
- LetITFly ([https://bbs.letitfly.me](https://bbs.letitfly.me)) - LetITFly BBS
~~原 MAT BBS~~致力于让 Android 的使用体验更好。
If you want to share link with me, please comment below~
| ---
layout: page
title: Links
permalink: /links/
published: true
---
- KenOoKamiHoro ([blog.yoitsu.moe/](https://blog.yoitsu.moe/)) - 约伊兹的萌狼乡手札
~~俗稱萌狼,喜歡吃人~~ 😋
- Bekcpear(iYI) ([nifume.com/](https://nifume.com/)) - 未墨轻梅
Dalao x1 Get√
- FiveYellowMice ([fiveyellowmice.com](https://fiveyellowmice.com)) - FiveYellowMice's Blog
也就是五黃鼠,也被叫做皇叔 XD
- LetITFly ([bbs.letitfly.me](https://bbs.letitfly.me)) - LetITFly BBS
~~原 MAT BBS~~致力于让 Android 的使用体验更好。
- wwyqianqian ([wwyqianqian.github.io/](https://wwyqianqian.github.io/)) - WWY‘s Blog
好耶是千千!
If you want to share link with me, please comment below~
| Add link to @wwyqianqian 's blog. | Add link to @wwyqianqian 's blog.
| Markdown | mit | RedL0tus/Way_to_be_vegetable,RedL0tus/Way_to_be_vegetable,RedL0tus/Way_to_be_vegetable,RedL0tus/Way_to_be_vegetable | markdown | ## Code Before:
---
layout: page
title: Links
permalink: /links/
published: true
---
- KenOoKamiHoro ([https://blog.yoitsu.moe/](https://blog.yoitsu.moe/)) - 约伊兹的萌狼乡手札
~~俗稱萌狼,喜歡吃人~~ 😋
- Bekcpear(iYI) ([https://https://nifume.com/](https://nifume.com/)) - 未墨轻梅
Dalao x1 Get√
- FiveYellowMice ([https://fiveyellowmice.com](https://fiveyellowmice.com)) - FiveYellowMice's Blog
也就是五黃鼠,也被叫做皇叔 XD
- LetITFly ([https://bbs.letitfly.me](https://bbs.letitfly.me)) - LetITFly BBS
~~原 MAT BBS~~致力于让 Android 的使用体验更好。
If you want to share link with me, please comment below~
## Instruction:
Add link to @wwyqianqian 's blog.
## Code After:
---
layout: page
title: Links
permalink: /links/
published: true
---
- KenOoKamiHoro ([blog.yoitsu.moe/](https://blog.yoitsu.moe/)) - 约伊兹的萌狼乡手札
~~俗稱萌狼,喜歡吃人~~ 😋
- Bekcpear(iYI) ([nifume.com/](https://nifume.com/)) - 未墨轻梅
Dalao x1 Get√
- FiveYellowMice ([fiveyellowmice.com](https://fiveyellowmice.com)) - FiveYellowMice's Blog
也就是五黃鼠,也被叫做皇叔 XD
- LetITFly ([bbs.letitfly.me](https://bbs.letitfly.me)) - LetITFly BBS
~~原 MAT BBS~~致力于让 Android 的使用体验更好。
- wwyqianqian ([wwyqianqian.github.io/](https://wwyqianqian.github.io/)) - WWY‘s Blog
好耶是千千!
If you want to share link with me, please comment below~
| ---
layout: page
title: Links
permalink: /links/
published: true
---
- - KenOoKamiHoro ([https://blog.yoitsu.moe/](https://blog.yoitsu.moe/)) - 约伊兹的萌狼乡手札
? --------
+ - KenOoKamiHoro ([blog.yoitsu.moe/](https://blog.yoitsu.moe/)) - 约伊兹的萌狼乡手札
- ~~俗稱萌狼,喜歡吃人~~ 😋
+ ~~俗稱萌狼,喜歡吃人~~ 😋
? +
- - Bekcpear(iYI) ([https://https://nifume.com/](https://nifume.com/)) - 未墨轻梅
? ----------------
+ - Bekcpear(iYI) ([nifume.com/](https://nifume.com/)) - 未墨轻梅
- Dalao x1 Get√
+ Dalao x1 Get√
? +
- - FiveYellowMice ([https://fiveyellowmice.com](https://fiveyellowmice.com)) - FiveYellowMice's Blog
? --------
+ - FiveYellowMice ([fiveyellowmice.com](https://fiveyellowmice.com)) - FiveYellowMice's Blog
- 也就是五黃鼠,也被叫做皇叔 XD
+ 也就是五黃鼠,也被叫做皇叔 XD
? +
- - LetITFly ([https://bbs.letitfly.me](https://bbs.letitfly.me)) - LetITFly BBS
? --------
+ - LetITFly ([bbs.letitfly.me](https://bbs.letitfly.me)) - LetITFly BBS
- ~~原 MAT BBS~~致力于让 Android 的使用体验更好。
+ ~~原 MAT BBS~~致力于让 Android 的使用体验更好。
? +
+
+ - wwyqianqian ([wwyqianqian.github.io/](https://wwyqianqian.github.io/)) - WWY‘s Blog
+ 好耶是千千!
If you want to share link with me, please comment below~ | 19 | 0.95 | 11 | 8 |
25db61d490ccdbe17bee0f2d91f0934ee9d2e3b9 | lib/mina/unicorn/tasks.rb | lib/mina/unicorn/tasks.rb | require "mina/bundler"
require "mina/deploy"
require "mina/unicorn/utility"
namespace :unicorn do
include Mina::Unicorn::Utility
# Following recommendations from http://unicorn.bogomips.org/unicorn_1.html#rack-environment
set :unicorn_env, -> { fetch(:rails_env) == "development" ? "development" : "deployment" }
set :unicorn_config, -> { "#{fetch(:current_path)}/config/unicorn.rb" }
set :unicorn_pid, -> { "#{fetch(:current_path)}/tmp/pids/unicorn.pid" }
set :unicorn_cmd, -> { "#{fetch(:bundle_prefix)} unicorn" }
set :unicorn_restart_sleep_time, -> { 2 }
set :bundle_gemfile, -> { "#{fetch(:current_path)}/Gemfile" }
desc "Start Unicorn master process"
task start: :environment do
command start_unicorn
end
desc "Stop Unicorn"
task stop: :environment do
command kill_unicorn("QUIT")
end
desc "Immediately shutdown Unicorn"
task shutdown: :environment do
command kill_unicorn("TERM")
end
desc "Restart unicorn service"
task restart: :environment do
command restart_unicorn
end
end
| require "mina/bundler"
require "mina/deploy"
require "mina/unicorn/utility"
namespace :unicorn do
include Mina::Unicorn::Utility
# Following recommendations from http://unicorn.bogomips.org/unicorn_1.html#rack-environment
set :unicorn_env, -> { fetch(:rails_env) == "development" ? "development" : "deployment" }
set :unicorn_config, -> { "#{fetch(:current_path)}/config/unicorn.rb" }
set :unicorn_pid, -> { "#{fetch(:current_path)}/tmp/pids/unicorn.pid" }
set :unicorn_cmd, -> { "#{fetch(:bundle_prefix, "#{fetch(:bundle_bin)} exec")} unicorn" }
set :unicorn_restart_sleep_time, -> { 2 }
set :bundle_gemfile, -> { "#{fetch(:current_path)}/Gemfile" }
desc "Start Unicorn master process"
task start: :environment do
command start_unicorn
end
desc "Stop Unicorn"
task stop: :environment do
command kill_unicorn("QUIT")
end
desc "Immediately shutdown Unicorn"
task shutdown: :environment do
command kill_unicorn("TERM")
end
desc "Restart unicorn service"
task restart: :environment do
command restart_unicorn
end
end
| Use bundle_prefix for unicorn_cmd if available | Use bundle_prefix for unicorn_cmd if available
Commit 7cc5272 removed mina/rails dependency, so 'bundle_prefix' could not be
set. Use it if available, otherwise default to 'bundle exec'.
| Ruby | mit | scarfacedeb/mina-unicorn | ruby | ## Code Before:
require "mina/bundler"
require "mina/deploy"
require "mina/unicorn/utility"
namespace :unicorn do
include Mina::Unicorn::Utility
# Following recommendations from http://unicorn.bogomips.org/unicorn_1.html#rack-environment
set :unicorn_env, -> { fetch(:rails_env) == "development" ? "development" : "deployment" }
set :unicorn_config, -> { "#{fetch(:current_path)}/config/unicorn.rb" }
set :unicorn_pid, -> { "#{fetch(:current_path)}/tmp/pids/unicorn.pid" }
set :unicorn_cmd, -> { "#{fetch(:bundle_prefix)} unicorn" }
set :unicorn_restart_sleep_time, -> { 2 }
set :bundle_gemfile, -> { "#{fetch(:current_path)}/Gemfile" }
desc "Start Unicorn master process"
task start: :environment do
command start_unicorn
end
desc "Stop Unicorn"
task stop: :environment do
command kill_unicorn("QUIT")
end
desc "Immediately shutdown Unicorn"
task shutdown: :environment do
command kill_unicorn("TERM")
end
desc "Restart unicorn service"
task restart: :environment do
command restart_unicorn
end
end
## Instruction:
Use bundle_prefix for unicorn_cmd if available
Commit 7cc5272 removed mina/rails dependency, so 'bundle_prefix' could not be
set. Use it if available, otherwise default to 'bundle exec'.
## Code After:
require "mina/bundler"
require "mina/deploy"
require "mina/unicorn/utility"
namespace :unicorn do
include Mina::Unicorn::Utility
# Following recommendations from http://unicorn.bogomips.org/unicorn_1.html#rack-environment
set :unicorn_env, -> { fetch(:rails_env) == "development" ? "development" : "deployment" }
set :unicorn_config, -> { "#{fetch(:current_path)}/config/unicorn.rb" }
set :unicorn_pid, -> { "#{fetch(:current_path)}/tmp/pids/unicorn.pid" }
set :unicorn_cmd, -> { "#{fetch(:bundle_prefix, "#{fetch(:bundle_bin)} exec")} unicorn" }
set :unicorn_restart_sleep_time, -> { 2 }
set :bundle_gemfile, -> { "#{fetch(:current_path)}/Gemfile" }
desc "Start Unicorn master process"
task start: :environment do
command start_unicorn
end
desc "Stop Unicorn"
task stop: :environment do
command kill_unicorn("QUIT")
end
desc "Immediately shutdown Unicorn"
task shutdown: :environment do
command kill_unicorn("TERM")
end
desc "Restart unicorn service"
task restart: :environment do
command restart_unicorn
end
end
| require "mina/bundler"
require "mina/deploy"
require "mina/unicorn/utility"
namespace :unicorn do
include Mina::Unicorn::Utility
# Following recommendations from http://unicorn.bogomips.org/unicorn_1.html#rack-environment
set :unicorn_env, -> { fetch(:rails_env) == "development" ? "development" : "deployment" }
set :unicorn_config, -> { "#{fetch(:current_path)}/config/unicorn.rb" }
set :unicorn_pid, -> { "#{fetch(:current_path)}/tmp/pids/unicorn.pid" }
- set :unicorn_cmd, -> { "#{fetch(:bundle_prefix)} unicorn" }
+ set :unicorn_cmd, -> { "#{fetch(:bundle_prefix, "#{fetch(:bundle_bin)} exec")} unicorn" }
? ++++++++++++++++++++++++++++++
set :unicorn_restart_sleep_time, -> { 2 }
set :bundle_gemfile, -> { "#{fetch(:current_path)}/Gemfile" }
desc "Start Unicorn master process"
task start: :environment do
command start_unicorn
end
desc "Stop Unicorn"
task stop: :environment do
command kill_unicorn("QUIT")
end
desc "Immediately shutdown Unicorn"
task shutdown: :environment do
command kill_unicorn("TERM")
end
desc "Restart unicorn service"
task restart: :environment do
command restart_unicorn
end
end | 2 | 0.057143 | 1 | 1 |
b1fec5f51a9ca57331bcc0c80e9b92e93537f393 | muzicast/web/templates/admin/index.html | muzicast/web/templates/admin/index.html | {% from "util.html" import stylesheet, script %}
{% from "admin/blocks.html" import stop_muzicast, admin_password, collection_directories_browser %}
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
{{ stylesheet('admin.css') }}
{{ script('jquery-1.4.2.js') }}
<title>Muzicast: Settings</title>
</head>
<body>
<div id="main">
<h1>Muzicast Administration</h1>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
<ul class="flashes">
{% for category, message in messages %}
<li class="{{ category }}">{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
{% block body %}{% endblock %}
<div class="section" id="stop-muzicast-div">
{{ stop_muzicast() }}
</div>
<div class="section" id="admin-password-div">
{{ admin_password(first_run) }}
</div>
<div class="section" id="collection-div">
{{ collection_directories_browser() }}
</div>
</div>
</body>
</html>
| {% from "util.html" import stylesheet, script %}
{% from "admin/blocks.html" import stop_muzicast, admin_password, collection_directories_browser %}
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
{{ stylesheet('admin.css') }}
{{ script('jquery-1.4.2.js') }}
<title>Muzicast: Settings</title>
</head>
<body>
<div id="main">
<p><a href="{{ url_for('.main.index') }}">« Back to Music</a></p>
<h1>Muzicast Administration</h1>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
<ul class="flashes">
{% for category, message in messages %}
<li class="{{ category }}">{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
{% block body %}{% endblock %}
<div class="section" id="stop-muzicast-div">
{{ stop_muzicast() }}
</div>
<div class="section" id="admin-password-div">
{{ admin_password(first_run) }}
</div>
<div class="section" id="collection-div">
{{ collection_directories_browser() }}
</div>
</div>
</body>
</html>
| Add link back to music page for admin | Add link back to music page for admin
| HTML | mit | nikhilm/muzicast,nikhilm/muzicast | html | ## Code Before:
{% from "util.html" import stylesheet, script %}
{% from "admin/blocks.html" import stop_muzicast, admin_password, collection_directories_browser %}
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
{{ stylesheet('admin.css') }}
{{ script('jquery-1.4.2.js') }}
<title>Muzicast: Settings</title>
</head>
<body>
<div id="main">
<h1>Muzicast Administration</h1>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
<ul class="flashes">
{% for category, message in messages %}
<li class="{{ category }}">{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
{% block body %}{% endblock %}
<div class="section" id="stop-muzicast-div">
{{ stop_muzicast() }}
</div>
<div class="section" id="admin-password-div">
{{ admin_password(first_run) }}
</div>
<div class="section" id="collection-div">
{{ collection_directories_browser() }}
</div>
</div>
</body>
</html>
## Instruction:
Add link back to music page for admin
## Code After:
{% from "util.html" import stylesheet, script %}
{% from "admin/blocks.html" import stop_muzicast, admin_password, collection_directories_browser %}
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
{{ stylesheet('admin.css') }}
{{ script('jquery-1.4.2.js') }}
<title>Muzicast: Settings</title>
</head>
<body>
<div id="main">
<p><a href="{{ url_for('.main.index') }}">« Back to Music</a></p>
<h1>Muzicast Administration</h1>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
<ul class="flashes">
{% for category, message in messages %}
<li class="{{ category }}">{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
{% block body %}{% endblock %}
<div class="section" id="stop-muzicast-div">
{{ stop_muzicast() }}
</div>
<div class="section" id="admin-password-div">
{{ admin_password(first_run) }}
</div>
<div class="section" id="collection-div">
{{ collection_directories_browser() }}
</div>
</div>
</body>
</html>
| {% from "util.html" import stylesheet, script %}
{% from "admin/blocks.html" import stop_muzicast, admin_password, collection_directories_browser %}
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
{{ stylesheet('admin.css') }}
{{ script('jquery-1.4.2.js') }}
<title>Muzicast: Settings</title>
</head>
<body>
<div id="main">
+ <p><a href="{{ url_for('.main.index') }}">« Back to Music</a></p>
<h1>Muzicast Administration</h1>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
<ul class="flashes">
{% for category, message in messages %}
<li class="{{ category }}">{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
{% block body %}{% endblock %}
<div class="section" id="stop-muzicast-div">
{{ stop_muzicast() }}
</div>
<div class="section" id="admin-password-div">
{{ admin_password(first_run) }}
</div>
<div class="section" id="collection-div">
{{ collection_directories_browser() }}
</div>
</div>
</body>
</html> | 1 | 0.027778 | 1 | 0 |
4788e280f5ce2953792b4cb09f302e128d145a10 | app/views/users/description/champs/_drop_down_list.html.haml | app/views/users/description/champs/_drop_down_list.html.haml | - if champ.drop_down_list && champ.drop_down_list.options.any?
= select_tag("champs['#{champ.id}']",
options_for_select(champ.drop_down_list.options, selected: champ.drop_down_list.selected_options(champ),
disabled: champ.drop_down_list.disabled_options),
multiple: champ.drop_down_list.multiple,
class: champ.drop_down_list.multiple ? 'select2' : nil)
| - if champ.drop_down_list && champ.drop_down_list.options.any?
= select_tag("champs['#{champ.id}']",
options_for_select(champ.drop_down_list.options,
selected: champ.drop_down_list.selected_options(champ),
disabled: champ.drop_down_list.disabled_options),
multiple: champ.drop_down_list.multiple,
class: champ.drop_down_list.multiple ? 'select2' : nil)
| Fix the indentation in the drop down list template | Fix the indentation in the drop down list template | Haml | agpl-3.0 | sgmap/tps,sgmap/tps,sgmap/tps | haml | ## Code Before:
- if champ.drop_down_list && champ.drop_down_list.options.any?
= select_tag("champs['#{champ.id}']",
options_for_select(champ.drop_down_list.options, selected: champ.drop_down_list.selected_options(champ),
disabled: champ.drop_down_list.disabled_options),
multiple: champ.drop_down_list.multiple,
class: champ.drop_down_list.multiple ? 'select2' : nil)
## Instruction:
Fix the indentation in the drop down list template
## Code After:
- if champ.drop_down_list && champ.drop_down_list.options.any?
= select_tag("champs['#{champ.id}']",
options_for_select(champ.drop_down_list.options,
selected: champ.drop_down_list.selected_options(champ),
disabled: champ.drop_down_list.disabled_options),
multiple: champ.drop_down_list.multiple,
class: champ.drop_down_list.multiple ? 'select2' : nil)
| - if champ.drop_down_list && champ.drop_down_list.options.any?
- = select_tag("champs['#{champ.id}']",
? --
+ = select_tag("champs['#{champ.id}']",
- options_for_select(champ.drop_down_list.options, selected: champ.drop_down_list.selected_options(champ),
- disabled: champ.drop_down_list.disabled_options),
+ options_for_select(champ.drop_down_list.options,
+ selected: champ.drop_down_list.selected_options(champ),
+ disabled: champ.drop_down_list.disabled_options),
- multiple: champ.drop_down_list.multiple,
? -------------------
+ multiple: champ.drop_down_list.multiple,
- class: champ.drop_down_list.multiple ? 'select2' : nil)
? -------------------
+ class: champ.drop_down_list.multiple ? 'select2' : nil) | 11 | 1.833333 | 6 | 5 |
ab916e2101e1db70855137df66d3249395028a05 | app/routes/unsubscribes.rb | app/routes/unsubscribes.rb | module Citygram::Routes
class Unsubscribes < Sinatra::Base
FILTER_WORDS = %w(CANCEL QUIT STOP UNSUBSCRIBE)
FILTER_WORD_REGEXP = Regexp.union(FILTER_WORDS.map{|w| /^#{w}/i })
username = ENV.fetch('BASIC_AUTH_USERNAME')
password = ENV.fetch('BASIC_AUTH_PASSWORD')
use Rack::Auth::Basic, 'Restricted Area' do |u, p|
u == username && p == password
end
post '/unsubscribes' do
if FILTER_WORD_REGEXP === params['Body']
phone_number = Phoner::Phone.parse(params['From']).to_s
Subscription.where(phone_number: phone_number, unsubscribed_at: nil).update(unsubscribed_at: DateTime.now)
end
200
end
end
end
| module Citygram::Routes
class Unsubscribes < Sinatra::Base
FILTER_WORDS = %w(CANCEL QUIT STOP UNSUBSCRIBE)
FILTER_WORD_REGEXP = Regexp.union(FILTER_WORDS.map{|w| /^#{w}/i })
username = ENV.fetch('BASIC_AUTH_USERNAME')
password = ENV.fetch('BASIC_AUTH_PASSWORD')
use Rack::Auth::Basic, 'Restricted Area' do |u, p|
u == username && p == password
end
post '/unsubscribes' do
if FILTER_WORD_REGEXP === params['Body']
phone_number = Phoner::Phone.parse(params['From']).to_s
Subscription.active.where(phone_number: phone_number).update(unsubscribed_at: DateTime.now)
end
200
end
end
end
| Use dataset method for clarity | Use dataset method for clarity
| Ruby | mit | shravan20084312/citygram,BetaNYC/citygram-nyc,elberdev/citygram-nyc,elberdev/citygram-nyc,beetz12/citygram,beetz12/citygram,beetz12/citygram,codefortulsa/citygram,BetaNYC/citygram-nyc,codefortulsa/citygram,chriswhong/citygram,shravan20084312/citygram,codeforamerica/citygram,codefortulsa/citygram,shravan20084312/citygram,chriswhong/citygram,openchattanooga/citygram,elberdev/citygram-nyc,openchattanooga/citygram,codeforamerica/citygram,BetaNYC/citygram-nyc,codeforamerica/citygram,BetaNYC/citygram-nyc,codeforamerica/citygram | ruby | ## Code Before:
module Citygram::Routes
class Unsubscribes < Sinatra::Base
FILTER_WORDS = %w(CANCEL QUIT STOP UNSUBSCRIBE)
FILTER_WORD_REGEXP = Regexp.union(FILTER_WORDS.map{|w| /^#{w}/i })
username = ENV.fetch('BASIC_AUTH_USERNAME')
password = ENV.fetch('BASIC_AUTH_PASSWORD')
use Rack::Auth::Basic, 'Restricted Area' do |u, p|
u == username && p == password
end
post '/unsubscribes' do
if FILTER_WORD_REGEXP === params['Body']
phone_number = Phoner::Phone.parse(params['From']).to_s
Subscription.where(phone_number: phone_number, unsubscribed_at: nil).update(unsubscribed_at: DateTime.now)
end
200
end
end
end
## Instruction:
Use dataset method for clarity
## Code After:
module Citygram::Routes
class Unsubscribes < Sinatra::Base
FILTER_WORDS = %w(CANCEL QUIT STOP UNSUBSCRIBE)
FILTER_WORD_REGEXP = Regexp.union(FILTER_WORDS.map{|w| /^#{w}/i })
username = ENV.fetch('BASIC_AUTH_USERNAME')
password = ENV.fetch('BASIC_AUTH_PASSWORD')
use Rack::Auth::Basic, 'Restricted Area' do |u, p|
u == username && p == password
end
post '/unsubscribes' do
if FILTER_WORD_REGEXP === params['Body']
phone_number = Phoner::Phone.parse(params['From']).to_s
Subscription.active.where(phone_number: phone_number).update(unsubscribed_at: DateTime.now)
end
200
end
end
end
| module Citygram::Routes
class Unsubscribes < Sinatra::Base
FILTER_WORDS = %w(CANCEL QUIT STOP UNSUBSCRIBE)
FILTER_WORD_REGEXP = Regexp.union(FILTER_WORDS.map{|w| /^#{w}/i })
username = ENV.fetch('BASIC_AUTH_USERNAME')
password = ENV.fetch('BASIC_AUTH_PASSWORD')
use Rack::Auth::Basic, 'Restricted Area' do |u, p|
u == username && p == password
end
post '/unsubscribes' do
if FILTER_WORD_REGEXP === params['Body']
phone_number = Phoner::Phone.parse(params['From']).to_s
- Subscription.where(phone_number: phone_number, unsubscribed_at: nil).update(unsubscribed_at: DateTime.now)
? ----------------------
+ Subscription.active.where(phone_number: phone_number).update(unsubscribed_at: DateTime.now)
? +++++++
end
200
end
end
end | 2 | 0.095238 | 1 | 1 |
b544eada89c7d0bb54280bac776fe62dd0b1cc91 | static/locales/pt-BR/messages.properties | static/locales/pt-BR/messages.properties | navigation-title=Pontoon Introdução
navigation-what=O quê
navigation-how=Como
navigation-more=Mais
navigation-developers=Desenvolvedores
# Header
upper-title=Pontoon por Mozilla
headline-1=Localize a web.
# What
what-title=O que é o Pontoon?
space=Veja as limitações espaciais
# How
how-title=COMO FUNCIONA?
profit=saiba mais
# More
# Developers
developers-title=eNVOLVA-SE
# Footer
author=Feito por Mozilla
join-us=Junte-se a nós
| navigation-what=O quê
navigation-how=Como
navigation-more=Mais
navigation-developers=Desenvolvedores
# Header
headline-1=Localize a web.
# What
what-title=O que é o Pontoon?
space=Veja as limitações espaciais
# How
# More
# Developers
# Footer
| Update Portuguese (pt-BR) localization of Pontoon Intro. | Pontoon: Update Portuguese (pt-BR) localization of Pontoon Intro.
| INI | bsd-3-clause | m8ttyB/pontoon-intro,jotes/pontoon-intro,mathjazz/pontoon-intro,Osmose/pontoon-intro,m8ttyB/pontoon-intro,Osmose/pontoon-intro,mathjazz/pontoon-intro,jotes/pontoon-intro,mathjazz/pontoon-intro,Osmose/pontoon-intro,m8ttyB/pontoon-intro,jotes/pontoon-intro | ini | ## Code Before:
navigation-title=Pontoon Introdução
navigation-what=O quê
navigation-how=Como
navigation-more=Mais
navigation-developers=Desenvolvedores
# Header
upper-title=Pontoon por Mozilla
headline-1=Localize a web.
# What
what-title=O que é o Pontoon?
space=Veja as limitações espaciais
# How
how-title=COMO FUNCIONA?
profit=saiba mais
# More
# Developers
developers-title=eNVOLVA-SE
# Footer
author=Feito por Mozilla
join-us=Junte-se a nós
## Instruction:
Pontoon: Update Portuguese (pt-BR) localization of Pontoon Intro.
## Code After:
navigation-what=O quê
navigation-how=Como
navigation-more=Mais
navigation-developers=Desenvolvedores
# Header
headline-1=Localize a web.
# What
what-title=O que é o Pontoon?
space=Veja as limitações espaciais
# How
# More
# Developers
# Footer
| - navigation-title=Pontoon Introdução
navigation-what=O quê
navigation-how=Como
navigation-more=Mais
navigation-developers=Desenvolvedores
# Header
- upper-title=Pontoon por Mozilla
headline-1=Localize a web.
# What
what-title=O que é o Pontoon?
space=Veja as limitações espaciais
# How
- how-title=COMO FUNCIONA?
- profit=saiba mais
# More
# Developers
- developers-title=eNVOLVA-SE
# Footer
- author=Feito por Mozilla
- join-us=Junte-se a nós
| 7 | 0.259259 | 0 | 7 |
9b3d4fd09170424ac46892c8814c3be82cd83690 | spec/fabricators/sponsor_fabricator.rb | spec/fabricators/sponsor_fabricator.rb | avatars = [
"https://dl.dropboxusercontent.com/u/108831317/pug1.png",
"https://dl.dropboxusercontent.com/u/108831317/pug2.png",
"https://dl.dropboxusercontent.com/u/108831317/pug3.png",
"https://dl.dropboxusercontent.com/u/108831317/pug4.png" ]
Fabricator(:sponsor) do
name { Faker::Name.name }
website { "http://#{Faker::Internet.domain_name}" }
avatar { avatars.sample }
address
email { Faker::Internet.email }
contact_first_name { Faker::Name.first_name }
contact_surname { Faker::Name.last_name }
end
| avatars = [
"https://placekitten.com/200/101",
"https://placekitten.com/200/102",
"https://placekitten.com/200/103",
"https://placekitten.com/200/104"
]
Fabricator(:sponsor) do
name { Faker::Name.name }
website { "http://#{Faker::Internet.domain_name}" }
avatar { avatars.sample }
address
email { Faker::Internet.email }
contact_first_name { Faker::Name.first_name }
contact_surname { Faker::Name.last_name }
end
| Use placekitten instead of dropbox pugs :dog: | Use placekitten instead of dropbox pugs :dog:
| Ruby | mit | despo/planner,despo/planner,codebar/planner,matyikriszta/planner,matyikriszta/planner,spike01/planner,spike01/planner,codebar/planner,laszpio/planner,despo/planner,despo/planner,codebar/planner,matyikriszta/planner,laszpio/planner,laszpio/planner,laszpio/planner,spike01/planner,spike01/planner,codebar/planner | ruby | ## Code Before:
avatars = [
"https://dl.dropboxusercontent.com/u/108831317/pug1.png",
"https://dl.dropboxusercontent.com/u/108831317/pug2.png",
"https://dl.dropboxusercontent.com/u/108831317/pug3.png",
"https://dl.dropboxusercontent.com/u/108831317/pug4.png" ]
Fabricator(:sponsor) do
name { Faker::Name.name }
website { "http://#{Faker::Internet.domain_name}" }
avatar { avatars.sample }
address
email { Faker::Internet.email }
contact_first_name { Faker::Name.first_name }
contact_surname { Faker::Name.last_name }
end
## Instruction:
Use placekitten instead of dropbox pugs :dog:
## Code After:
avatars = [
"https://placekitten.com/200/101",
"https://placekitten.com/200/102",
"https://placekitten.com/200/103",
"https://placekitten.com/200/104"
]
Fabricator(:sponsor) do
name { Faker::Name.name }
website { "http://#{Faker::Internet.domain_name}" }
avatar { avatars.sample }
address
email { Faker::Internet.email }
contact_first_name { Faker::Name.first_name }
contact_surname { Faker::Name.last_name }
end
| avatars = [
- "https://dl.dropboxusercontent.com/u/108831317/pug1.png",
- "https://dl.dropboxusercontent.com/u/108831317/pug2.png",
- "https://dl.dropboxusercontent.com/u/108831317/pug3.png",
- "https://dl.dropboxusercontent.com/u/108831317/pug4.png" ]
+ "https://placekitten.com/200/101",
+ "https://placekitten.com/200/102",
+ "https://placekitten.com/200/103",
+ "https://placekitten.com/200/104"
+ ]
Fabricator(:sponsor) do
name { Faker::Name.name }
website { "http://#{Faker::Internet.domain_name}" }
avatar { avatars.sample }
address
email { Faker::Internet.email }
contact_first_name { Faker::Name.first_name }
contact_surname { Faker::Name.last_name }
end | 9 | 0.6 | 5 | 4 |
ee60beea89cbb3c6976ca5ac2ca2afc74a30e443 | README.md | README.md | npmalerts-web
=============
The website for npmalerts.com
| npmalerts-web [](https://travis-ci.org/seriema/npmalerts-web)
=============
The website for npmalerts.com
| Add build status to readme | Add build status to readme
| Markdown | mit | seriema/npmalerts-web,seriema/npmalerts-web | markdown | ## Code Before:
npmalerts-web
=============
The website for npmalerts.com
## Instruction:
Add build status to readme
## Code After:
npmalerts-web [](https://travis-ci.org/seriema/npmalerts-web)
=============
The website for npmalerts.com
| - npmalerts-web
+ npmalerts-web [](https://travis-ci.org/seriema/npmalerts-web)
=============
The website for npmalerts.com | 2 | 0.5 | 1 | 1 |
c6c985bc690c88f2819787824a50b22cc86cacf4 | app/controllers/admin/impersonations_controller.rb | app/controllers/admin/impersonations_controller.rb | class Admin::ImpersonationsController < Admin::ApplicationController
skip_before_action :authenticate_admin!
before_action :authenticate_impersonator!
def destroy
redirect_path = admin_user_path(current_user)
warden.set_user(impersonator, scope: :user)
session[:impersonator_id] = nil
redirect_to redirect_path
end
private
def impersonator
@impersonator ||= User.find(session[:impersonator_id]) if session[:impersonator_id]
end
def authenticate_impersonator!
render_404 unless impersonator && impersonator.is_admin? && !impersonator.blocked?
end
end
| class Admin::ImpersonationsController < Admin::ApplicationController
skip_before_action :authenticate_admin!
before_action :authenticate_impersonator!
def destroy
original_user = current_user
warden.set_user(impersonator, scope: :user)
session[:impersonator_id] = nil
redirect_to admin_user_path(original_user)
end
private
def impersonator
@impersonator ||= User.find(session[:impersonator_id]) if session[:impersonator_id]
end
def authenticate_impersonator!
render_404 unless impersonator && impersonator.is_admin? && !impersonator.blocked?
end
end
| Store original user in variable | Store original user in variable | Ruby | mit | larryli/gitlabhq,htve/GitlabForChinese,larryli/gitlabhq,shinexiao/gitlabhq,mmkassem/gitlabhq,martijnvermaat/gitlabhq,allysonbarros/gitlabhq,dreampet/gitlab,openwide-java/gitlabhq,mr-dxdy/gitlabhq,dplarson/gitlabhq,shinexiao/gitlabhq,jirutka/gitlabhq,dreampet/gitlab,LUMC/gitlabhq,LUMC/gitlabhq,dplarson/gitlabhq,darkrasid/gitlabhq,iiet/iiet-git,larryli/gitlabhq,martijnvermaat/gitlabhq,iiet/iiet-git,Soullivaneuh/gitlabhq,shinexiao/gitlabhq,stoplightio/gitlabhq,axilleas/gitlabhq,mmkassem/gitlabhq,allysonbarros/gitlabhq,mr-dxdy/gitlabhq,darkrasid/gitlabhq,martijnvermaat/gitlabhq,Soullivaneuh/gitlabhq,t-zuehlsdorff/gitlabhq,dreampet/gitlab,allysonbarros/gitlabhq,htve/GitlabForChinese,mr-dxdy/gitlabhq,dreampet/gitlab,SVArago/gitlabhq,Soullivaneuh/gitlabhq,icedwater/gitlabhq,jirutka/gitlabhq,iiet/iiet-git,screenpages/gitlabhq,openwide-java/gitlabhq,darkrasid/gitlabhq,dplarson/gitlabhq,screenpages/gitlabhq,t-zuehlsdorff/gitlabhq,stoplightio/gitlabhq,dplarson/gitlabhq,icedwater/gitlabhq,stoplightio/gitlabhq,SVArago/gitlabhq,openwide-java/gitlabhq,axilleas/gitlabhq,jirutka/gitlabhq,daiyu/gitlab-zh,mmkassem/gitlabhq,htve/GitlabForChinese,martijnvermaat/gitlabhq,iiet/iiet-git,allysonbarros/gitlabhq,axilleas/gitlabhq,daiyu/gitlab-zh,axilleas/gitlabhq,darkrasid/gitlabhq,t-zuehlsdorff/gitlabhq,jirutka/gitlabhq,mr-dxdy/gitlabhq,LUMC/gitlabhq,shinexiao/gitlabhq,larryli/gitlabhq,SVArago/gitlabhq,Soullivaneuh/gitlabhq,stoplightio/gitlabhq,LUMC/gitlabhq,htve/GitlabForChinese,icedwater/gitlabhq,daiyu/gitlab-zh,SVArago/gitlabhq,screenpages/gitlabhq,mmkassem/gitlabhq,daiyu/gitlab-zh,t-zuehlsdorff/gitlabhq,openwide-java/gitlabhq,icedwater/gitlabhq,screenpages/gitlabhq | ruby | ## Code Before:
class Admin::ImpersonationsController < Admin::ApplicationController
skip_before_action :authenticate_admin!
before_action :authenticate_impersonator!
def destroy
redirect_path = admin_user_path(current_user)
warden.set_user(impersonator, scope: :user)
session[:impersonator_id] = nil
redirect_to redirect_path
end
private
def impersonator
@impersonator ||= User.find(session[:impersonator_id]) if session[:impersonator_id]
end
def authenticate_impersonator!
render_404 unless impersonator && impersonator.is_admin? && !impersonator.blocked?
end
end
## Instruction:
Store original user in variable
## Code After:
class Admin::ImpersonationsController < Admin::ApplicationController
skip_before_action :authenticate_admin!
before_action :authenticate_impersonator!
def destroy
original_user = current_user
warden.set_user(impersonator, scope: :user)
session[:impersonator_id] = nil
redirect_to admin_user_path(original_user)
end
private
def impersonator
@impersonator ||= User.find(session[:impersonator_id]) if session[:impersonator_id]
end
def authenticate_impersonator!
render_404 unless impersonator && impersonator.is_admin? && !impersonator.blocked?
end
end
| class Admin::ImpersonationsController < Admin::ApplicationController
skip_before_action :authenticate_admin!
before_action :authenticate_impersonator!
def destroy
- redirect_path = admin_user_path(current_user)
+ original_user = current_user
warden.set_user(impersonator, scope: :user)
session[:impersonator_id] = nil
- redirect_to redirect_path
+ redirect_to admin_user_path(original_user)
end
private
def impersonator
@impersonator ||= User.find(session[:impersonator_id]) if session[:impersonator_id]
end
def authenticate_impersonator!
render_404 unless impersonator && impersonator.is_admin? && !impersonator.blocked?
end
end | 4 | 0.166667 | 2 | 2 |
ffa1a2f7a3a5b10df76f4c3527db7ebaf04a4d81 | docker-compose.yml | docker-compose.yml | wordpress:
image: wordpress_plugin_test:0.1.1
links:
- db:db
- phantomjs:phantomjs
volumes:
- ./wordpress:/var/www/html
- ./plugin:/data
environment:
PLUGIN_NAME: your-plugin-name
phantomjs:
image: wernight/phantomjs:2.1.1
command: phantomjs --webdriver=8910
db:
image: mysql:5.5
environment:
MYSQL_ROOT_PASSWORD: example
MYSQL_DATABASE: wordpress
| version: '2'
services:
wordpress:
image: wordpress_plugin_test:0.1.1
volumes:
- ./wordpress:/var/www/html
- ./plugin:/data
environment:
PLUGIN_NAME: your-plugin-name
phantomjs:
image: wernight/phantomjs:2.1.1
command: phantomjs --webdriver=8910
db:
image: mysql:5.5
environment:
MYSQL_ROOT_PASSWORD: example
MYSQL_DATABASE: wordpress
| Upgrade to using docker compose v2 | Upgrade to using docker compose v2
| YAML | mit | hirowatari/Docker-for-Wordpress-Plugin-Testing,hirowatari/Docker-for-Wordpress-Plugin-Testing | yaml | ## Code Before:
wordpress:
image: wordpress_plugin_test:0.1.1
links:
- db:db
- phantomjs:phantomjs
volumes:
- ./wordpress:/var/www/html
- ./plugin:/data
environment:
PLUGIN_NAME: your-plugin-name
phantomjs:
image: wernight/phantomjs:2.1.1
command: phantomjs --webdriver=8910
db:
image: mysql:5.5
environment:
MYSQL_ROOT_PASSWORD: example
MYSQL_DATABASE: wordpress
## Instruction:
Upgrade to using docker compose v2
## Code After:
version: '2'
services:
wordpress:
image: wordpress_plugin_test:0.1.1
volumes:
- ./wordpress:/var/www/html
- ./plugin:/data
environment:
PLUGIN_NAME: your-plugin-name
phantomjs:
image: wernight/phantomjs:2.1.1
command: phantomjs --webdriver=8910
db:
image: mysql:5.5
environment:
MYSQL_ROOT_PASSWORD: example
MYSQL_DATABASE: wordpress
| + version: '2'
+
+ services:
- wordpress:
+ wordpress:
? ++
- image: wordpress_plugin_test:0.1.1
+ image: wordpress_plugin_test:0.1.1
? ++
- links:
- - db:db
- - phantomjs:phantomjs
- volumes:
+ volumes:
? ++
- - ./wordpress:/var/www/html
+ - ./wordpress:/var/www/html
? ++
- - ./plugin:/data
+ - ./plugin:/data
? ++
- environment:
+ environment:
? ++
- PLUGIN_NAME: your-plugin-name
+ PLUGIN_NAME: your-plugin-name
? ++
- phantomjs:
+ phantomjs:
? ++
- image: wernight/phantomjs:2.1.1
+ image: wernight/phantomjs:2.1.1
? ++
- command: phantomjs --webdriver=8910
+ command: phantomjs --webdriver=8910
? ++
- db:
+ db:
? ++
- image: mysql:5.5
+ image: mysql:5.5
? ++
- environment:
+ environment:
? ++
- MYSQL_ROOT_PASSWORD: example
+ MYSQL_ROOT_PASSWORD: example
? ++
- MYSQL_DATABASE: wordpress
+ MYSQL_DATABASE: wordpress
? ++
| 36 | 2 | 18 | 18 |
d730308d9cd460407e1c17e8e56c54ba69bebb44 | test/integration/default/serverspec/spec_helper.rb | test/integration/default/serverspec/spec_helper.rb |
require 'serverspec'
set :backend, :exec
RSpec.configure do |c|
c.before :all do
c.path = '/bin:/sbin:/usr/bin'
end
end
|
require 'serverspec'
set :backend, :exec
RSpec.configure do |c|
c.before :all do
c.path = '/bin:/sbin:/usr/sbin:/usr/bin'
end
end
| Add /usr/sbin to RSpec path for testing. | Add /usr/sbin to RSpec path for testing.
| Ruby | apache-2.0 | PaytmLabs/chef-system,PaytmLabs/chef-system,crossroads/system,xhost-cookbooks/system,xhost-cookbooks/system,crossroads/system | ruby | ## Code Before:
require 'serverspec'
set :backend, :exec
RSpec.configure do |c|
c.before :all do
c.path = '/bin:/sbin:/usr/bin'
end
end
## Instruction:
Add /usr/sbin to RSpec path for testing.
## Code After:
require 'serverspec'
set :backend, :exec
RSpec.configure do |c|
c.before :all do
c.path = '/bin:/sbin:/usr/sbin:/usr/bin'
end
end
|
require 'serverspec'
set :backend, :exec
RSpec.configure do |c|
c.before :all do
- c.path = '/bin:/sbin:/usr/bin'
+ c.path = '/bin:/sbin:/usr/sbin:/usr/bin'
? ++++++++++
end
end | 2 | 0.2 | 1 | 1 |
4c1a2e68db746faecb0310aea1490b256e84abea | sashimi-webapp/src/components/file-manager/File.vue | sashimi-webapp/src/components/file-manager/File.vue | <template>
<div class="col vertical-align-child"
v-on:dblclick="openFile"
id="123">
<button class="file">
<img src="../../assets/images/icons/icon-file.svg" alt="file">
<p class="inline-block">Your first document</p>
</button>
</div>
</template>
<script>
export default {
methods: {
openFile() {
const fileId = this.$el.id;
this.$router.push({ path: 'content', query: { id: fileId } });
},
}
};
</script>
<style scoped lang="scss">
</style>
| <template>
<div class="col vertical-align-child"
v-on:dblclick="openFile"
id="123">
<button class="file">
<img src="../../assets/images/icons/icon-file.svg" alt="file">
<p class="inline-block">{{fileName}}</p>
</button>
</div>
</template>
<script>
export default {
props: ['fileName'],
data() {
},
methods: {
openFile() {
const fileId = this.$el.id;
this.$router.push({ path: 'content', query: { id: fileId } });
},
}
};
</script>
<style scoped lang="scss">
</style>
| Load filename from props passed down from Documents | Load filename from props passed down from Documents
| Vue | mit | nus-mtp/sashimi-note,nus-mtp/sashimi-note,nus-mtp/sashimi-note | vue | ## Code Before:
<template>
<div class="col vertical-align-child"
v-on:dblclick="openFile"
id="123">
<button class="file">
<img src="../../assets/images/icons/icon-file.svg" alt="file">
<p class="inline-block">Your first document</p>
</button>
</div>
</template>
<script>
export default {
methods: {
openFile() {
const fileId = this.$el.id;
this.$router.push({ path: 'content', query: { id: fileId } });
},
}
};
</script>
<style scoped lang="scss">
</style>
## Instruction:
Load filename from props passed down from Documents
## Code After:
<template>
<div class="col vertical-align-child"
v-on:dblclick="openFile"
id="123">
<button class="file">
<img src="../../assets/images/icons/icon-file.svg" alt="file">
<p class="inline-block">{{fileName}}</p>
</button>
</div>
</template>
<script>
export default {
props: ['fileName'],
data() {
},
methods: {
openFile() {
const fileId = this.$el.id;
this.$router.push({ path: 'content', query: { id: fileId } });
},
}
};
</script>
<style scoped lang="scss">
</style>
| <template>
<div class="col vertical-align-child"
v-on:dblclick="openFile"
id="123">
<button class="file">
<img src="../../assets/images/icons/icon-file.svg" alt="file">
- <p class="inline-block">Your first document</p>
? ^^^^^ ^^^^^^^^ ^^
+ <p class="inline-block">{{fileName}}</p>
? ^^ ^^^^ ^^
</button>
</div>
</template>
<script>
export default {
+ props: ['fileName'],
+ data() {
+ },
methods: {
openFile() {
const fileId = this.$el.id;
this.$router.push({ path: 'content', query: { id: fileId } });
},
}
};
</script>
<style scoped lang="scss">
</style> | 5 | 0.208333 | 4 | 1 |
551f52efeecde5d804d8f0da0a46a612a18b744e | zsh/loader.zsh | zsh/loader.zsh | rc_dir=$HOME/run_control
source $rc_dir/sh/loader.sh
zshrc_dir=$HOME/run_control/zsh
# Load OMZ first so that we can overwrite.
source_rc_files $zshrc_dir/ohmy.zsh
# OMZ criples my LESS options so restore them.
source $rc_dir/sh/sh.d/less.sh
# Load everything else.
source_rc_files $zshrc_dir/zsh.d/* ~/.zshrc.local $EXTRA_ZSHRC
unset rc_dir zshrc_dir
| rc_dir=$HOME/run_control
zshrc_dir=$rc_dir/zsh
# Load OMZ first so that we can overwrite.
source $zshrc_dir/ohmy.zsh
source $rc_dir/sh/loader.sh
# Load everything else.
source_rc_files $zshrc_dir/zsh.d/* ~/.zshrc.local $EXTRA_ZSHRC
unset rc_dir zshrc_dir
| Load OMZ before *everything* so we can overwrite *anything* | Load OMZ before *everything* so we can overwrite *anything*
ugh.
| Shell | mit | rwstauner/run_control,rwstauner/run_control,rwstauner/run_control,rwstauner/run_control,rwstauner/run_control | shell | ## Code Before:
rc_dir=$HOME/run_control
source $rc_dir/sh/loader.sh
zshrc_dir=$HOME/run_control/zsh
# Load OMZ first so that we can overwrite.
source_rc_files $zshrc_dir/ohmy.zsh
# OMZ criples my LESS options so restore them.
source $rc_dir/sh/sh.d/less.sh
# Load everything else.
source_rc_files $zshrc_dir/zsh.d/* ~/.zshrc.local $EXTRA_ZSHRC
unset rc_dir zshrc_dir
## Instruction:
Load OMZ before *everything* so we can overwrite *anything*
ugh.
## Code After:
rc_dir=$HOME/run_control
zshrc_dir=$rc_dir/zsh
# Load OMZ first so that we can overwrite.
source $zshrc_dir/ohmy.zsh
source $rc_dir/sh/loader.sh
# Load everything else.
source_rc_files $zshrc_dir/zsh.d/* ~/.zshrc.local $EXTRA_ZSHRC
unset rc_dir zshrc_dir
| rc_dir=$HOME/run_control
+ zshrc_dir=$rc_dir/zsh
- source $rc_dir/sh/loader.sh
-
- zshrc_dir=$HOME/run_control/zsh
# Load OMZ first so that we can overwrite.
- source_rc_files $zshrc_dir/ohmy.zsh
? ---------
+ source $zshrc_dir/ohmy.zsh
- # OMZ criples my LESS options so restore them.
- source $rc_dir/sh/sh.d/less.sh
? ^^^ -- ^^
+ source $rc_dir/sh/loader.sh
? ^^^ ^
# Load everything else.
source_rc_files $zshrc_dir/zsh.d/* ~/.zshrc.local $EXTRA_ZSHRC
unset rc_dir zshrc_dir | 9 | 0.5625 | 3 | 6 |
9eeaafcb5cb80ddafe57be9c9436c22a1d6d797a | README.md | README.md | Unit Tests
----------
To run only the unit tests, and exclude the integration tests:
diana@ubuntu:~/workspace/inferno$ nosetests --exclude=integration
To run both the unit and integration tests:
diana@ubuntu:~/workspace/inferno$ nosetests
If the tests were successful, you should see something like the following.
----------------------------------------------------------------------
Ran 100 tests in 1.000s
OK
The integration test suite assumes you have a running disco cluster.
diana@ubuntu:~$ disco start
Master ubuntu:8989 started
And that your inferno settings (~/.inferno or /etc/inferno/settings.yaml)
point to that disco master.
diana@ubuntu:~$ cat ~/.inferno
server: disco://localhost
Build Status: [Travis-CI](http://travis-ci.org/pooya/inferno) :: 
| Unit Tests
----------
To run only the unit tests, and exclude the integration tests:
diana@ubuntu:~/workspace/inferno$ nosetests --exclude=integration
To run both the unit and integration tests:
diana@ubuntu:~/workspace/inferno$ nosetests
If the tests were successful, you should see something like the following.
----------------------------------------------------------------------
Ran 100 tests in 1.000s
OK
The integration test suite assumes you have a running disco cluster.
diana@ubuntu:~$ disco start
Master ubuntu:8989 started
And that your inferno settings (~/.inferno or /etc/inferno/settings.yaml)
point to that disco master.
diana@ubuntu:~$ cat ~/.inferno
server: disco://localhost
Build Status: [Travis-CI](http://travis-ci.org/chango/inferno) :: 
| Update the build links to chango. | travis-ci: Update the build links to chango. | Markdown | mit | oldmantaiter/inferno,chango/inferno,pombredanne/inferno | markdown | ## Code Before:
Unit Tests
----------
To run only the unit tests, and exclude the integration tests:
diana@ubuntu:~/workspace/inferno$ nosetests --exclude=integration
To run both the unit and integration tests:
diana@ubuntu:~/workspace/inferno$ nosetests
If the tests were successful, you should see something like the following.
----------------------------------------------------------------------
Ran 100 tests in 1.000s
OK
The integration test suite assumes you have a running disco cluster.
diana@ubuntu:~$ disco start
Master ubuntu:8989 started
And that your inferno settings (~/.inferno or /etc/inferno/settings.yaml)
point to that disco master.
diana@ubuntu:~$ cat ~/.inferno
server: disco://localhost
Build Status: [Travis-CI](http://travis-ci.org/pooya/inferno) :: 
## Instruction:
travis-ci: Update the build links to chango.
## Code After:
Unit Tests
----------
To run only the unit tests, and exclude the integration tests:
diana@ubuntu:~/workspace/inferno$ nosetests --exclude=integration
To run both the unit and integration tests:
diana@ubuntu:~/workspace/inferno$ nosetests
If the tests were successful, you should see something like the following.
----------------------------------------------------------------------
Ran 100 tests in 1.000s
OK
The integration test suite assumes you have a running disco cluster.
diana@ubuntu:~$ disco start
Master ubuntu:8989 started
And that your inferno settings (~/.inferno or /etc/inferno/settings.yaml)
point to that disco master.
diana@ubuntu:~$ cat ~/.inferno
server: disco://localhost
Build Status: [Travis-CI](http://travis-ci.org/chango/inferno) :: 
| Unit Tests
----------
To run only the unit tests, and exclude the integration tests:
diana@ubuntu:~/workspace/inferno$ nosetests --exclude=integration
To run both the unit and integration tests:
diana@ubuntu:~/workspace/inferno$ nosetests
If the tests were successful, you should see something like the following.
----------------------------------------------------------------------
Ran 100 tests in 1.000s
OK
The integration test suite assumes you have a running disco cluster.
diana@ubuntu:~$ disco start
Master ubuntu:8989 started
And that your inferno settings (~/.inferno or /etc/inferno/settings.yaml)
point to that disco master.
diana@ubuntu:~$ cat ~/.inferno
server: disco://localhost
- Build Status: [Travis-CI](http://travis-ci.org/pooya/inferno) :: 
? ^ --- ^ ---
+ Build Status: [Travis-CI](http://travis-ci.org/chango/inferno) :: 
? ^^^^^ ^^^^^
| 2 | 0.066667 | 1 | 1 |
f60a839562ea45d3f80b7f23e9b7fabf7b07fac8 | server/templates/app.js | server/templates/app.js | var timeouts = [];
function updateResults() {
var query = $("#query").val();
for (var x=0; x<timeouts.length; x++) {
clearTimeout(timeouts[x]);
}
$.getJSON(
"/search",
{query: query},
function processQueryResult(data) {
$("#results").html("");
for (var x=0; x<data.length; x++) {
var postId = 'post' + x;
var post = '<div id="' + postId + '" class="result">';
post += '<h2><a href="' + data[x].url + '">' + data[x].title + '</a></h2>';
post += '</div>';
var timeout = showImage(x, postId, data[x].image);
timeouts.push(timeout);
$("#results").append(post);
}
}
);
}
function showImage(x, postId, image) {
var timeout = setTimeout(function() {
var img = '<img src="' + image + '" class="result-img"/>';
$("#" + postId).append(img);
}, 500 * x);
return timeout;
}
$("#query").keyup(updateResults);
| var timeouts = [];
function updateResults(e) {
if (e.which === 0) {
return;
}
var query = $("#query").val();
for (var x=0; x<timeouts.length; x++) {
clearTimeout(timeouts[x]);
}
$.getJSON(
"/search",
{query: query},
function processQueryResult(data) {
$("#results").html("");
for (var x=0; x<data.length; x++) {
var postId = 'post' + x;
var post = '<div id="' + postId + '" class="result">';
post += '<h2><a href="' + data[x].url + '">' + data[x].title + '</a></h2>';
post += '</div>';
var timeout = showImage(x, postId, data[x].image);
timeouts.push(timeout);
$("#results").append(post);
}
}
);
}
function showImage(x, postId, image) {
var timeout = setTimeout(function() {
var img = '<img src="' + image + '" class="result-img"/>';
$("#" + postId).append(img);
}, 500 * x);
return timeout;
}
$("#query").keypress(updateResults);
| Remove ajax call for non-character keys | Remove ajax call for non-character keys
| JavaScript | mit | albertyw/devops-reactions-index,albertyw/devops-reactions-index,albertyw/reaction-pics,albertyw/reaction-pics,albertyw/devops-reactions-index,albertyw/reaction-pics,albertyw/devops-reactions-index,albertyw/reaction-pics | javascript | ## Code Before:
var timeouts = [];
function updateResults() {
var query = $("#query").val();
for (var x=0; x<timeouts.length; x++) {
clearTimeout(timeouts[x]);
}
$.getJSON(
"/search",
{query: query},
function processQueryResult(data) {
$("#results").html("");
for (var x=0; x<data.length; x++) {
var postId = 'post' + x;
var post = '<div id="' + postId + '" class="result">';
post += '<h2><a href="' + data[x].url + '">' + data[x].title + '</a></h2>';
post += '</div>';
var timeout = showImage(x, postId, data[x].image);
timeouts.push(timeout);
$("#results").append(post);
}
}
);
}
function showImage(x, postId, image) {
var timeout = setTimeout(function() {
var img = '<img src="' + image + '" class="result-img"/>';
$("#" + postId).append(img);
}, 500 * x);
return timeout;
}
$("#query").keyup(updateResults);
## Instruction:
Remove ajax call for non-character keys
## Code After:
var timeouts = [];
function updateResults(e) {
if (e.which === 0) {
return;
}
var query = $("#query").val();
for (var x=0; x<timeouts.length; x++) {
clearTimeout(timeouts[x]);
}
$.getJSON(
"/search",
{query: query},
function processQueryResult(data) {
$("#results").html("");
for (var x=0; x<data.length; x++) {
var postId = 'post' + x;
var post = '<div id="' + postId + '" class="result">';
post += '<h2><a href="' + data[x].url + '">' + data[x].title + '</a></h2>';
post += '</div>';
var timeout = showImage(x, postId, data[x].image);
timeouts.push(timeout);
$("#results").append(post);
}
}
);
}
function showImage(x, postId, image) {
var timeout = setTimeout(function() {
var img = '<img src="' + image + '" class="result-img"/>';
$("#" + postId).append(img);
}, 500 * x);
return timeout;
}
$("#query").keypress(updateResults);
| var timeouts = [];
- function updateResults() {
+ function updateResults(e) {
? +
+ if (e.which === 0) {
+ return;
+ }
var query = $("#query").val();
for (var x=0; x<timeouts.length; x++) {
clearTimeout(timeouts[x]);
}
$.getJSON(
"/search",
{query: query},
function processQueryResult(data) {
$("#results").html("");
for (var x=0; x<data.length; x++) {
var postId = 'post' + x;
var post = '<div id="' + postId + '" class="result">';
post += '<h2><a href="' + data[x].url + '">' + data[x].title + '</a></h2>';
post += '</div>';
var timeout = showImage(x, postId, data[x].image);
timeouts.push(timeout);
$("#results").append(post);
}
}
);
}
function showImage(x, postId, image) {
var timeout = setTimeout(function() {
var img = '<img src="' + image + '" class="result-img"/>';
$("#" + postId).append(img);
}, 500 * x);
return timeout;
}
- $("#query").keyup(updateResults);
? -
+ $("#query").keypress(updateResults);
? ++++
| 7 | 0.212121 | 5 | 2 |
b37f35aa7fe6ac0a2981a9ac26f34798674e808a | api/app/controllers/v1/analytics_controller.rb | api/app/controllers/v1/analytics_controller.rb | module V1
class AnalyticsController < ApplicationController
SEGMENT_WRITE_KEY = Rails.application.secrets.segment_write_key
def identify
segment(:identify, %w(user_id traits))
end
def track
segment(:track, %w(user_id event properties))
end
def page
segment(:page, %w(user_id name properties))
end
def group
segment(:group, %w(user_id group_id traits))
end
private
# rubocop:disable Metrics/AbcSize
def segment(method, allowed_arguments)
analytics = Segment::Analytics.new(write_key: SEGMENT_WRITE_KEY)
arguments = {}
keys = params.to_unsafe_h.keys & allowed_arguments
keys.each { |k| arguments[k] = params.to_unsafe_h[k] }
analytics.public_send(method, arguments)
render json: { ok: true, method: method, arguments: arguments },
status: 200
rescue => e
render json: { ok: false, error: e.message }
end
# rubocop:enable Metrics/AbcSize
end
end
| module V1
class AnalyticsController < ApplicationController
SEGMENT_WRITE_KEY = Rails.application.secrets.segment_write_key
def identify
segment(:identify, %w(user_id traits))
end
def track
segment(:track, %w(user_id event properties))
end
def page
segment(:page, %w(user_id name properties))
end
def group
segment(:group, %w(user_id group_id traits))
end
private
def segment(method, allowed_arguments)
analytics = Segment::Analytics.new(write_key: SEGMENT_WRITE_KEY)
arguments = {}
keys = params.to_unsafe_h.keys & allowed_arguments
keys.each { |k| arguments[k] = params.to_unsafe_h[k] }
analytics.public_send(method, arguments)
render json: { ok: true, method: method, arguments: arguments },
status: 200
rescue => e
render json: { ok: false, error: e.message }
end
end
end
| Remove unnecessary disabling of rubocop | Remove unnecessary disabling of rubocop
| Ruby | mit | hackclub/api,hackclub/api,hackclub/api | ruby | ## Code Before:
module V1
class AnalyticsController < ApplicationController
SEGMENT_WRITE_KEY = Rails.application.secrets.segment_write_key
def identify
segment(:identify, %w(user_id traits))
end
def track
segment(:track, %w(user_id event properties))
end
def page
segment(:page, %w(user_id name properties))
end
def group
segment(:group, %w(user_id group_id traits))
end
private
# rubocop:disable Metrics/AbcSize
def segment(method, allowed_arguments)
analytics = Segment::Analytics.new(write_key: SEGMENT_WRITE_KEY)
arguments = {}
keys = params.to_unsafe_h.keys & allowed_arguments
keys.each { |k| arguments[k] = params.to_unsafe_h[k] }
analytics.public_send(method, arguments)
render json: { ok: true, method: method, arguments: arguments },
status: 200
rescue => e
render json: { ok: false, error: e.message }
end
# rubocop:enable Metrics/AbcSize
end
end
## Instruction:
Remove unnecessary disabling of rubocop
## Code After:
module V1
class AnalyticsController < ApplicationController
SEGMENT_WRITE_KEY = Rails.application.secrets.segment_write_key
def identify
segment(:identify, %w(user_id traits))
end
def track
segment(:track, %w(user_id event properties))
end
def page
segment(:page, %w(user_id name properties))
end
def group
segment(:group, %w(user_id group_id traits))
end
private
def segment(method, allowed_arguments)
analytics = Segment::Analytics.new(write_key: SEGMENT_WRITE_KEY)
arguments = {}
keys = params.to_unsafe_h.keys & allowed_arguments
keys.each { |k| arguments[k] = params.to_unsafe_h[k] }
analytics.public_send(method, arguments)
render json: { ok: true, method: method, arguments: arguments },
status: 200
rescue => e
render json: { ok: false, error: e.message }
end
end
end
| module V1
class AnalyticsController < ApplicationController
SEGMENT_WRITE_KEY = Rails.application.secrets.segment_write_key
def identify
segment(:identify, %w(user_id traits))
end
def track
segment(:track, %w(user_id event properties))
end
def page
segment(:page, %w(user_id name properties))
end
def group
segment(:group, %w(user_id group_id traits))
end
private
- # rubocop:disable Metrics/AbcSize
def segment(method, allowed_arguments)
analytics = Segment::Analytics.new(write_key: SEGMENT_WRITE_KEY)
arguments = {}
keys = params.to_unsafe_h.keys & allowed_arguments
keys.each { |k| arguments[k] = params.to_unsafe_h[k] }
analytics.public_send(method, arguments)
render json: { ok: true, method: method, arguments: arguments },
status: 200
rescue => e
render json: { ok: false, error: e.message }
end
- # rubocop:enable Metrics/AbcSize
end
end | 2 | 0.04878 | 0 | 2 |
0efc903eef01d2f1081fc9cf5fa68893c01e959a | app/views/notify/project_was_moved_email.html.haml | app/views/notify/project_was_moved_email.html.haml | %td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"}
%table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #555; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
%tr
%td{width: "21"}
%td
%h2
= "Project was moved in another location"
%td{width: "21"}
%tr
%td{width: "21"}
%td
%p
Project is now accessible via next link
= link_to project_url(@project) do
= @project.name_with_namespace
%p
You may want to update your local repository with new remote:
%br
%table{border: "0", cellpadding: "0", cellspacing: "0", width: "558"}
%tr
%td{valign: "top"}
%p{ style: "background:#f5f5f5; padding:10px; border:1px solid #ddd" }
git remote set-url origin #{@project.ssh_url_to_repo}
%br
%td{ width: "21"}
| %td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"}
%table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #555; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
%tr
%td{width: "21"}
%td
%h2
= "Project was moved to another location"
%td{width: "21"}
%tr
%td{width: "21"}
%td
%p
The project is now located under
= link_to project_url(@project) do
= @project.name_with_namespace
%p
To update the remote url in your local repository run:
%br
%table{border: "0", cellpadding: "0", cellspacing: "0", width: "558"}
%tr
%td{valign: "top"}
%p{ style: "background:#f5f5f5; padding:10px; border:1px solid #ddd" }
git remote set-url origin #{@project.ssh_url_to_repo}
%br
%td{ width: "21"}
| Fix text in project move mail | Fix text in project move mail
| Haml | mit | per-garden/gitlabhq,hzy001/gitlabhq,betabot7/gitlabhq,fpgentil/gitlabhq,NKMR6194/gitlabhq,NKMR6194/gitlabhq,ayufan/gitlabhq,8thcolor/rubyconfau2015-sadr,hacsoc/gitlabhq,Datacom/gitlabhq,MauriceMohlek/gitlabhq,ibiart/gitlabhq,rhels/gitlabhq,childbamboo/gitlabhq,betabot7/gitlabhq,theonlydoo/gitlabhq,nguyen-tien-mulodo/gitlabhq,sakishum/gitlabhq,NARKOZ/gitlabhq,pupaxxo/gitlabhq,cinderblock/gitlabhq,dplarson/gitlabhq,larryli/gitlabhq,szechyjs/gitlabhq,jrjang/gitlab-ce,atomaka/gitlabhq,SkyWei/gitlabhq,t-zuehlsdorff/gitlabhq,tk23/gitlabhq,LytayTOUCH/gitlabhq,ttasanen/gitlabhq,OtkurBiz/gitlabhq,darkrasid/gitlabhq,123Haynes/gitlabhq,since2014/gitlabhq,yulchitaj/TEST3,stoplightio/gitlabhq,folpindo/gitlabhq,gopeter/gitlabhq,bbodenmiller/gitlabhq,johnmyqin/gitlabhq,yuyue2013/ss,mavimo/gitlabhq,koreamic/gitlabhq,Keystion/gitlabhq,stoplightio/gitlabhq,gopeter/gitlabhq,mr-dxdy/gitlabhq,Burick/gitlabhq,dvrylc/gitlabhq,since2014/gitlabhq,zBMNForks/gitlabhq,NuLL3rr0r/gitlabhq,8thcolor/rubyconfau2015-sadr,larryli/gitlabhq,icedwater/gitlabhq,shinexiao/gitlabhq,per-garden/gitlabhq,cncodog/gitlab,louahola/gitlabhq,Datacom/gitlabhq,bozaro/gitlabhq,joalmeid/gitlabhq,allistera/gitlabhq,sue445/gitlabhq,yama07/gitlabhq,riyad/gitlabhq,yonglehou/gitlabhq,rhels/gitlabhq,tk23/gitlabhq,louahola/gitlabhq,SVArago/gitlabhq,ayufan/gitlabhq,salipro4ever/gitlabhq,Telekom-PD/gitlabhq,mrb/gitlabhq,shinexiao/gitlabhq,eliasp/gitlabhq,tempbottle/gitlabhq,zBMNForks/gitlabhq,rumpelsepp/gitlabhq,neiljbrookes/glab,ttasanen/gitlabhq,stellamiranda/mobbr-gitlabhq,achako/gitlabhq,kemenaran/gitlabhq,ordiychen/gitlabhq,SkyWei/gitlabhq,t-zuehlsdorff/gitlabhq,cinderblock/gitlabhq,mente/gitlabhq,per-garden/gitlabhq,kitech/gitlabhq,salipro4ever/gitlabhq,H3Chief/gitlabhq,julianengel/gitlabhq,rfeese/gitlab-ce,WSDC-NITWarangal/gitlabhq,bladealslayer/gitlabhq,jairzh/gitlabhq-sfdc,lbt/gitlabhq,michaKFromParis/sparkslab,icedwater/gitlabhq,bozaro/gitlabhq,darkrasid/gitlabhq,yuyue2013/ss,yatish27/gitlabhq,luzhongyang/gitlabhq,goeun/myRepo,jrjang/gitlabhq,xuvw/gitlabhq,OlegGirko/gitlab-ce,NARKOZ/gitlabhq,ArthurHoaro/Public-GitLab,hzy001/gitlabhq,sideci-sample/sideci-sample-gitlabhq,ferdinandrosario/gitlabhq,yonglehou/gitlabhq,LUMC/gitlabhq,stanhu/gitlabhq,joalmeid/gitlabhq,luzhongyang/gitlabhq,nuecho/gitlabhq,duduribeiro/gitlabhq,pkgr/gitlabhq,shinexiao/gitlabhq,wangcan2014/gitlabhq,Kambda/Mobbr,openwide-java/gitlabhq,mr-dxdy/gitlabhq,jirutka/gitlabhq,dplarson/gitlabhq,martinma4/gitlabhq,zrbsprite/gitlabhq,chadyred/gitlabhq,iiet/iiet-git,zrbsprite/gitlabhq,nmav/gitlabhq,DanielZhangQingLong/gitlabhq,ngpestelos/gitlabhq,fantasywind/gitlabhq,adaiguoguo/gitlab_globalserarch,martijnvermaat/gitlabhq,whluwit/gitlabhq,fpgentil/gitlabhq,allistera/gitlabhq,daiyu/gitlab-zh,Exeia/gitlabhq,youprofit/gitlabhq,1ed/gitlabhq,stanhu/gitlabhq,123Haynes/gitlabhq,aaronsnyder/gitlabhq,darkrasid/gitlabhq,mathstuf/gitlabhq,ordiychen/gitlabhq,folpindo/gitlabhq,dwrensha/gitlabhq,ttasanen/gitlabhq,dukex/gitlabhq,vjustov/gitlabhq,neiljbrookes/glab,theodi/gitlabhq,yama07/gitlabhq,goeun/myRepo,chrrrles/nodeflab,axilleas/gitlabhq,mrb/gitlabhq,Telekom-PD/gitlabhq,michaKFromParis/gitlabhq,jvanbaarsen/gitlabhq,whluwit/gitlabhq,liyakun/gitlabhq,ksoichiro/gitlabhq,fgbreel/gitlabhq,bigsurge/gitlabhq,pjknkda/gitlabhq,flashbuckets/gitlabhq,pkallberg/tjenare,kemenaran/gitlabhq,gorgee/gitlabhq,ayufan/gitlabhq,H3Chief/gitlabhq,cui-liqiang/gitlab-ce,theodi/gitlabhq,since2014/gitlabhq,youprofit/gitlabhq,yfaizal/gitlabhq,per-garden/gitlabhq,phinfonet/mobbr-gitlabhq,dvrylc/gitlabhq,123Haynes/gitlabhq,dplarson/gitlabhq,nuecho/gitlabhq,nmav/gitlabhq,jrjang/gitlab-ce,yonglehou/gitlabhq,dwrensha/gitlabhq,tk23/gitlabhq,fendoudeqingchunhh/gitlabhq,michaKFromParis/sparkslab,htve/GitlabForChinese,TheWatcher/gitlabhq,rumpelsepp/gitlabhq,Burick/gitlabhq,martijnvermaat/gitlabhq,Datacom/gitlabhq,yfaizal/gitlabhq,williamherry/gitlabhq,iiet/iiet-git,vjustov/gitlabhq,LytayTOUCH/gitlabhq,k4zzk/gitlabhq,dyon/gitlab,cncodog/gitlab,Soullivaneuh/gitlabhq,michaKFromParis/gitlabhqold,Devin001/gitlabhq,copystudy/gitlabhq,pulkit21/gitlabhq,martinma4/gitlabhq,WSDC-NITWarangal/gitlabhq,akumetsuv/gitlab,aaronsnyder/gitlabhq,szechyjs/gitlabhq,Tyrael/gitlabhq,chadyred/gitlabhq,fscherwi/gitlabhq,fendoudeqingchunhh/gitlabhq,yulchitaj/TEST3,mente/gitlabhq,dyon/gitlab,yulchitaj/TEST3,theonlydoo/gitlabhq,larryli/gitlabhq,williamherry/gitlabhq,wangcan2014/gitlabhq,TheWatcher/gitlabhq,8thcolor/testing-public-gitlabhq,michaKFromParis/gitlabhqold,delkyd/gitlabhq,aaronsnyder/gitlabhq,chadyred/gitlabhq,whluwit/gitlabhq,duduribeiro/gitlabhq,jvanbaarsen/gitlabhq,jairzh/gitlabhq-sfdc,stanhu/gitlabhq,martijnvermaat/gitlabhq,jaepyoung/gitlabhq,martijnvermaat/gitlabhq,chenrui2014/gitlabhq,delkyd/gitlabhq,williamherry/gitlabhq,LytayTOUCH/gitlabhq,fscherwi/gitlabhq,bigsurge/gitlabhq,hacsoc/gitlabhq,koreamic/gitlabhq,michaKFromParis/gitlabhq,openwide-java/gitlabhq,mrb/gitlabhq,lvfeng1130/gitlabhq,bigsurge/gitlabhq,Burick/gitlabhq,eliasp/gitlabhq,sekcheong/gitlabhq,hacsoc/gitlabhq,folpindo/gitlabhq,dukex/gitlabhq,stoplightio/gitlabhq,mmkassem/gitlabhq,CodeCantor/gitlabhq,phinfonet/mobbr-gitlabhq,sakishum/gitlabhq,delkyd/gitlabhq,windymid/test2,ikappas/gitlabhq,jaepyoung/gitlabhq,rhels/gitlabhq,copystudy/gitlabhq,8thcolor/eurucamp2014-htdsadr,cinderblock/gitlabhq,htve/GitlabForChinese,jrjang/gitlabhq,pjknkda/gitlabhq,screenpages/gitlabhq,atomaka/gitlabhq,aaronsnyder/gitlabhq,vjustov/gitlabhq,darkrasid/gitlabhq,gorgee/gitlabhq,cinderblock/gitlabhq,michaKFromParis/gitlabhq,Razer6/gitlabhq,yatish27/gitlabhq,julianengel/gitlabhq,liyakun/gitlabhq,Tyrael/gitlabhq,fpgentil/gitlabhq,dvrylc/gitlabhq,ayufan/gitlabhq,szechyjs/gitlabhq,Tyrael/gitlabhq,childbamboo/gitlabhq,julianengel/gitlabhq,chenrui2014/gitlabhq,flashbuckets/gitlabhq,hzy001/gitlabhq,louahola/gitlabhq,dreampet/gitlab,fscherwi/gitlabhq,daiyu/gitlab-zh,ZeoAlliance/gitlabhq,rfeese/gitlab-ce,fgbreel/gitlabhq,sonalkr132/gitlabhq,H3Chief/gitlabhq,ZeoAlliance/gitlabhq,ikappas/gitlabhq,Kambda/mobbr-gitlabhq,mathstuf/gitlabhq,dplarson/gitlabhq,dvrylc/gitlabhq,Kambda/mobbr-gitlabhq,fantasywind/gitlabhq,TheWatcher/gitlabhq,jaepyoung/gitlabhq,youprofit/gitlabhq,tempbottle/gitlabhq,k4zzk/gitlabhq,0x20h/gitlabhq,axilleas/gitlabhq,OlegGirko/gitlab-ce,tempbottle/gitlabhq,theonlydoo/gitlabhq,t-zuehlsdorff/gitlabhq,WSDC-NITWarangal/gitlabhq,mathstuf/gitlabhq,ArthurHoaro/Public-GitLab,ibiart/gitlabhq,mavimo/gitlabhq,sakishum/gitlabhq,mmkassem/gitlabhq,htve/GitlabForChinese,sekcheong/gitlabhq,ZeoAlliance/gitlabhq,michaKFromParis/gitlabhqold,Keystion/gitlabhq,manfer/gitlabhq,bladealslayer/gitlabhq,rumpelsepp/gitlabhq,dukex/gitlabhq,OlegGirko/gitlab-ce,daiyu/gitlab-zh,OtkurBiz/gitlabhq,eliasp/gitlabhq,rfeese/gitlab-ce,zBMNForks/gitlabhq,zBMNForks/gitlabhq,mr-dxdy/gitlabhq,eliasp/gitlabhq,bigsurge/gitlabhq,jrjang/gitlab-ce,xuvw/gitlabhq,bladealslayer/gitlabhq,duduribeiro/gitlabhq,liyakun/gitlabhq,cncodog/gitlab,cui-liqiang/gitlab-ce,mr-dxdy/gitlabhq,xuvw/gitlabhq,gorgee/gitlabhq,mente/gitlabhq,WSDC-NITWarangal/gitlabhq,Exeia/gitlabhq,fearenales/gitlabhq,OtkurBiz/gitlabhq,ferdinandrosario/gitlabhq,openwide-java/gitlabhq,cui-liqiang/gitlab-ce,8thcolor/eurucamp2014-htdsadr,pulkit21/gitlabhq,it33/gitlabhq,yuyue2013/ss,0x20h/gitlabhq,pulkit21/gitlabhq,kitech/gitlabhq,jirutka/gitlabhq,fendoudeqingchunhh/gitlabhq,sakishum/gitlabhq,betabot7/gitlabhq,gorgee/gitlabhq,jirutka/gitlabhq,pkgr/gitlabhq,ksoichiro/gitlabhq,jairzh/gitlabhq-sfdc,joalmeid/gitlabhq,koreamic/gitlabhq,stoplightio/gitlabhq,jrjang/gitlabhq,lvfeng1130/gitlabhq,nmav/gitlabhq,childbamboo/gitlabhq,screenpages/gitlabhq,whluwit/gitlabhq,NKMR6194/gitlabhq,jvanbaarsen/gitlabhq,since2014/gitlabhq,sideci-sample/sideci-sample-gitlabhq,chrrrles/nodeflab,ngpestelos/gitlabhq,dreampet/gitlab,hq804116393/gitlabhq,manfer/gitlabhq,revaret/gitlabhq,tim-hoff/gitlabhq,Devin001/gitlabhq,kitech/gitlabhq,gopeter/gitlabhq,tempbottle/gitlabhq,CodeCantor/gitlabhq,screenpages/gitlabhq,copystudy/gitlabhq,childbamboo/gitlabhq,adaiguoguo/gitlab_globalserarch,ArthurHoaro/Public-GitLab,Telekom-PD/gitlabhq,rebecamendez/gitlabhq,martinma4/gitlabhq,rumpelsepp/gitlabhq,kotaro-dev/gitlab-6-9,achako/gitlabhq,Exeia/gitlabhq,tk23/gitlabhq,stanhu/gitlabhq,LytayTOUCH/gitlabhq,Datacom/gitlabhq,sekcheong/gitlabhq,fearenales/gitlabhq,nguyen-tien-mulodo/gitlabhq,szechyjs/gitlabhq,folpindo/gitlabhq,DanielZhangQingLong/gitlabhq,openwide-java/gitlabhq,rfeese/gitlab-ce,atomaka/gitlabhq,stellamiranda/mobbr-gitlabhq,initiummedia/gitlabhq,SVArago/gitlabhq,it33/gitlabhq,lvfeng1130/gitlabhq,youprofit/gitlabhq,sideci-sample/sideci-sample-gitlabhq,tim-hoff/gitlabhq,pulkit21/gitlabhq,jvanbaarsen/gitlabhq,johnmyqin/gitlabhq,duduribeiro/gitlabhq,chrrrles/nodeflab,Telekom-PD/gitlabhq,flashbuckets/gitlabhq,yatish27/gitlabhq,windymid/test2,liyakun/gitlabhq,sue445/gitlabhq,OlegGirko/gitlab-ce,bbodenmiller/gitlabhq,8thcolor/rubyconfau2015-sadr,martinma4/gitlabhq,dwrensha/gitlabhq,hq804116393/gitlabhq,koreamic/gitlabhq,kotaro-dev/gitlab-6-9,pkgr/gitlabhq,johnmyqin/gitlabhq,allistera/gitlabhq,initiummedia/gitlabhq,zrbsprite/gitlabhq,SkyWei/gitlabhq,NARKOZ/gitlabhq,jaepyoung/gitlabhq,ikappas/gitlabhq,hzy001/gitlabhq,lvfeng1130/gitlabhq,dukex/gitlabhq,SVArago/gitlabhq,dwrensha/gitlabhq,bozaro/gitlabhq,shinexiao/gitlabhq,mmkassem/gitlabhq,yfaizal/gitlabhq,tim-hoff/gitlabhq,louahola/gitlabhq,Kambda/Mobbr,rebecamendez/gitlabhq,rebecamendez/gitlabhq,revaret/gitlabhq,sonalkr132/gitlabhq,it33/gitlabhq,kemenaran/gitlabhq,cncodog/gitlab,TheWatcher/gitlabhq,ttasanen/gitlabhq,manfer/gitlabhq,hacsoc/gitlabhq,LUMC/gitlabhq,pjknkda/gitlabhq,yonglehou/gitlabhq,SkyWei/gitlabhq,k4zzk/gitlabhq,allysonbarros/gitlabhq,julianengel/gitlabhq,yulchitaj/TEST3,sonalkr132/gitlabhq,yama07/gitlabhq,phinfonet/mobbr-gitlabhq,inetfuture/gitlab-tweak,dyon/gitlab,yfaizal/gitlabhq,nmav/gitlabhq,Exeia/gitlabhq,dreampet/gitlab,mente/gitlabhq,luzhongyang/gitlabhq,joalmeid/gitlabhq,vjustov/gitlabhq,8thcolor/testing-public-gitlabhq,sonalkr132/gitlabhq,bozaro/gitlabhq,wangcan2014/gitlabhq,kemenaran/gitlabhq,NARKOZ/gitlabhq,williamherry/gitlabhq,jirutka/gitlabhq,ksoichiro/gitlabhq,Tyrael/gitlabhq,fendoudeqingchunhh/gitlabhq,bbodenmiller/gitlabhq,rhels/gitlabhq,iiet/iiet-git,fantasywind/gitlabhq,yatish27/gitlabhq,screenpages/gitlabhq,neiljbrookes/glab,sue445/gitlabhq,hq804116393/gitlabhq,ngpestelos/gitlabhq,Keystion/gitlabhq,michaKFromParis/gitlabhq,OtkurBiz/gitlabhq,sue445/gitlabhq,ferdinandrosario/gitlabhq,lbt/gitlabhq,k4zzk/gitlabhq,H3Chief/gitlabhq,inetfuture/gitlab-tweak,sekcheong/gitlabhq,michaKFromParis/sparkslab,allistera/gitlabhq,rebecamendez/gitlabhq,htve/GitlabForChinese,yama07/gitlabhq,bbodenmiller/gitlabhq,zrbsprite/gitlabhq,cui-liqiang/gitlab-ce,icedwater/gitlabhq,fscherwi/gitlabhq,michaKFromParis/sparkslab,copystudy/gitlabhq,riyad/gitlabhq,inetfuture/gitlab-tweak,pjknkda/gitlabhq,revaret/gitlabhq,MauriceMohlek/gitlabhq,salipro4ever/gitlabhq,t-zuehlsdorff/gitlabhq,NKMR6194/gitlabhq,chenrui2014/gitlabhq,adaiguoguo/gitlab_globalserarch,chenrui2014/gitlabhq,nguyen-tien-mulodo/gitlabhq,nuecho/gitlabhq,mrb/gitlabhq,michaKFromParis/gitlabhqold,gopeter/gitlabhq,hq804116393/gitlabhq,theodi/gitlabhq,Kambda/Mobbr,Razer6/gitlabhq,fearenales/gitlabhq,riyad/gitlabhq,ferdinandrosario/gitlabhq,axilleas/gitlabhq,mavimo/gitlabhq,pkallberg/tjenare,Kambda/mobbr-gitlabhq,allysonbarros/gitlabhq,CodeCantor/gitlabhq,chadyred/gitlabhq,akumetsuv/gitlab,Keystion/gitlabhq,mathstuf/gitlabhq,larryli/gitlabhq,fpgentil/gitlabhq,fgbreel/gitlabhq,theodi/gitlabhq,fantasywind/gitlabhq,Devin001/gitlabhq,lbt/gitlabhq,axilleas/gitlabhq,ordiychen/gitlabhq,0x20h/gitlabhq,ikappas/gitlabhq,dreampet/gitlab,pupaxxo/gitlabhq,jrjang/gitlab-ce,Razer6/gitlabhq,Soullivaneuh/gitlabhq,adaiguoguo/gitlab_globalserarch,goeun/myRepo,johnmyqin/gitlabhq,tim-hoff/gitlabhq,Devin001/gitlabhq,daiyu/gitlab-zh,akumetsuv/gitlab,kitech/gitlabhq,LUMC/gitlabhq,ngpestelos/gitlabhq,kotaro-dev/gitlab-6-9,MauriceMohlek/gitlabhq,ordiychen/gitlabhq,ksoichiro/gitlabhq,DanielZhangQingLong/gitlabhq,allysonbarros/gitlabhq,icedwater/gitlabhq,fgbreel/gitlabhq,Razer6/gitlabhq,delkyd/gitlabhq,NuLL3rr0r/gitlabhq,luzhongyang/gitlabhq,8thcolor/testing-public-gitlabhq,it33/gitlabhq,theonlydoo/gitlabhq,jairzh/gitlabhq-sfdc,allysonbarros/gitlabhq,Soullivaneuh/gitlabhq,mmkassem/gitlabhq,pupaxxo/gitlabhq,initiummedia/gitlabhq,windymid/test2,MauriceMohlek/gitlabhq,salipro4ever/gitlabhq,flashbuckets/gitlabhq,Soullivaneuh/gitlabhq,1ed/gitlabhq,jrjang/gitlabhq,mavimo/gitlabhq,wangcan2014/gitlabhq,manfer/gitlabhq,pkallberg/tjenare,yuyue2013/ss,iiet/iiet-git,NuLL3rr0r/gitlabhq,revaret/gitlabhq,nguyen-tien-mulodo/gitlabhq,DanielZhangQingLong/gitlabhq,ibiart/gitlabhq,fearenales/gitlabhq,LUMC/gitlabhq,1ed/gitlabhq,initiummedia/gitlabhq,8thcolor/eurucamp2014-htdsadr,achako/gitlabhq,Burick/gitlabhq,stellamiranda/mobbr-gitlabhq,SVArago/gitlabhq | haml | ## Code Before:
%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"}
%table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #555; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
%tr
%td{width: "21"}
%td
%h2
= "Project was moved in another location"
%td{width: "21"}
%tr
%td{width: "21"}
%td
%p
Project is now accessible via next link
= link_to project_url(@project) do
= @project.name_with_namespace
%p
You may want to update your local repository with new remote:
%br
%table{border: "0", cellpadding: "0", cellspacing: "0", width: "558"}
%tr
%td{valign: "top"}
%p{ style: "background:#f5f5f5; padding:10px; border:1px solid #ddd" }
git remote set-url origin #{@project.ssh_url_to_repo}
%br
%td{ width: "21"}
## Instruction:
Fix text in project move mail
## Code After:
%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"}
%table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #555; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
%tr
%td{width: "21"}
%td
%h2
= "Project was moved to another location"
%td{width: "21"}
%tr
%td{width: "21"}
%td
%p
The project is now located under
= link_to project_url(@project) do
= @project.name_with_namespace
%p
To update the remote url in your local repository run:
%br
%table{border: "0", cellpadding: "0", cellspacing: "0", width: "558"}
%tr
%td{valign: "top"}
%p{ style: "background:#f5f5f5; padding:10px; border:1px solid #ddd" }
git remote set-url origin #{@project.ssh_url_to_repo}
%br
%td{ width: "21"}
| %td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"}
%table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #555; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
%tr
%td{width: "21"}
%td
%h2
- = "Project was moved in another location"
? ^^
+ = "Project was moved to another location"
? ^^
%td{width: "21"}
%tr
%td{width: "21"}
%td
%p
- Project is now accessible via next link
+ The project is now located under
= link_to project_url(@project) do
= @project.name_with_namespace
%p
- You may want to update your local repository with new remote:
+ To update the remote url in your local repository run:
%br
%table{border: "0", cellpadding: "0", cellspacing: "0", width: "558"}
%tr
%td{valign: "top"}
%p{ style: "background:#f5f5f5; padding:10px; border:1px solid #ddd" }
git remote set-url origin #{@project.ssh_url_to_repo}
%br
%td{ width: "21"} | 6 | 0.24 | 3 | 3 |
95dd9a9266ce9c1929224bdca3319cf608dfff17 | packaging/install-telepresence.ps1 | packaging/install-telepresence.ps1 | param
(
$Path = "C:\telepresence"
)
echo "Installing telepresence to $Path"
Start-Process msiexec -Wait -verb runAs -Args "/i $current_directory\winfsp.msi /passive /qn /L*V winfsp-install.log"
Start-Process msiexec -Wait -verb runAs -Args "/i $current_directory\sshfs-win.msi /passive /qn /L*V sshfs-win-install.log"
if(!(test-path $Path))
{
New-Item -ItemType Directory -Force -Path $Path
}
Copy-Item "telepresence.exe" -Destination "$Path" -Force
Copy-Item "wintun.dll" -Destination "$Path" -Force
# We update the PATH to include telepresence and its dependency, sshfs-win
[Environment]::SetEnvironmentVariable("Path", "C:\$Path;C:\\Program Files\\SSHFS-Win\\bin;$ENV:Path")
| param
(
$Path = "C:\telepresence"
)
echo "Installing telepresence to $Path"
Start-Process msiexec -Wait -verb runAs -Args "/i $current_directory\winfsp.msi /passive /qn /L*V winfsp-install.log"
Start-Process msiexec -Wait -verb runAs -Args "/i $current_directory\sshfs-win.msi /passive /qn /L*V sshfs-win-install.log"
if(!(test-path $Path))
{
New-Item -ItemType Directory -Force -Path $Path
}
Copy-Item "telepresence.exe" -Destination "$Path" -Force
Copy-Item "wintun.dll" -Destination "$Path" -Force
# We update the PATH to include telepresence and its dependency, sshfs-win
[Environment]::SetEnvironmentVariable("Path", "$Path;C:\Program Files\SSHFS-Win\bin;$ENV:Path", "Machine")
| Fix windows install script to set Path for the user | Fix windows install script to set Path for the user
Otherwise the path will be set for the session only
Signed-off-by: Jose Cortes <90db7b580b32d49369f56eb8df8e548917a57096@datawire.io>
| PowerShell | apache-2.0 | datawire/telepresence,datawire/telepresence,datawire/telepresence | powershell | ## Code Before:
param
(
$Path = "C:\telepresence"
)
echo "Installing telepresence to $Path"
Start-Process msiexec -Wait -verb runAs -Args "/i $current_directory\winfsp.msi /passive /qn /L*V winfsp-install.log"
Start-Process msiexec -Wait -verb runAs -Args "/i $current_directory\sshfs-win.msi /passive /qn /L*V sshfs-win-install.log"
if(!(test-path $Path))
{
New-Item -ItemType Directory -Force -Path $Path
}
Copy-Item "telepresence.exe" -Destination "$Path" -Force
Copy-Item "wintun.dll" -Destination "$Path" -Force
# We update the PATH to include telepresence and its dependency, sshfs-win
[Environment]::SetEnvironmentVariable("Path", "C:\$Path;C:\\Program Files\\SSHFS-Win\\bin;$ENV:Path")
## Instruction:
Fix windows install script to set Path for the user
Otherwise the path will be set for the session only
Signed-off-by: Jose Cortes <90db7b580b32d49369f56eb8df8e548917a57096@datawire.io>
## Code After:
param
(
$Path = "C:\telepresence"
)
echo "Installing telepresence to $Path"
Start-Process msiexec -Wait -verb runAs -Args "/i $current_directory\winfsp.msi /passive /qn /L*V winfsp-install.log"
Start-Process msiexec -Wait -verb runAs -Args "/i $current_directory\sshfs-win.msi /passive /qn /L*V sshfs-win-install.log"
if(!(test-path $Path))
{
New-Item -ItemType Directory -Force -Path $Path
}
Copy-Item "telepresence.exe" -Destination "$Path" -Force
Copy-Item "wintun.dll" -Destination "$Path" -Force
# We update the PATH to include telepresence and its dependency, sshfs-win
[Environment]::SetEnvironmentVariable("Path", "$Path;C:\Program Files\SSHFS-Win\bin;$ENV:Path", "Machine")
| param
(
$Path = "C:\telepresence"
)
echo "Installing telepresence to $Path"
Start-Process msiexec -Wait -verb runAs -Args "/i $current_directory\winfsp.msi /passive /qn /L*V winfsp-install.log"
Start-Process msiexec -Wait -verb runAs -Args "/i $current_directory\sshfs-win.msi /passive /qn /L*V sshfs-win-install.log"
if(!(test-path $Path))
{
New-Item -ItemType Directory -Force -Path $Path
}
Copy-Item "telepresence.exe" -Destination "$Path" -Force
Copy-Item "wintun.dll" -Destination "$Path" -Force
# We update the PATH to include telepresence and its dependency, sshfs-win
- [Environment]::SetEnvironmentVariable("Path", "C:\$Path;C:\\Program Files\\SSHFS-Win\\bin;$ENV:Path")
? --- - - -
+ [Environment]::SetEnvironmentVariable("Path", "$Path;C:\Program Files\SSHFS-Win\bin;$ENV:Path", "Machine")
? +++++++++++
| 2 | 0.1 | 1 | 1 |
d5514ca3f2b3429323e69f5eda1d7048c33a58a8 | project.clj | project.clj | (defproject com.lemondronor/turboshrimp-h264j "0.2.0"
:description (str "An AR.Drone video deocder for the turboshrimp library "
"that uses h264j.")
:url "https://github.com/wiseman/turboshrimp-h264j"
:license {:name "MIT License"
:url "http://opensource.org/licenses/MIT"}
:dependencies [[com.twilight/h264 "0.0.1"]
[org.clojure/clojure "1.6.0"]]
:profiles {:test
{:dependencies [[com.lemondronor/turboshrimp "0.3.1"]]
:resource-paths ["test-resources"]}})
| (defproject com.lemondronor/turboshrimp-h264j "0.2.1-SNAPSHOT"
:description (str "An AR.Drone video deocder for the turboshrimp library "
"that uses h264j.")
:url "https://github.com/wiseman/turboshrimp-h264j"
:license {:name "MIT License"
:url "http://opensource.org/licenses/MIT"}
:deploy-repositories [["releases" :clojars]]
:dependencies [[com.twilight/h264 "0.0.1"]
[org.clojure/clojure "1.6.0"]]
:profiles {:test
{:dependencies [[com.lemondronor/turboshrimp "0.3.1"]]
:resource-paths ["test-resources"]}})
| Deploy to clojars by default. | Deploy to clojars by default.
| Clojure | mit | wiseman/turboshrimp-h264j | clojure | ## Code Before:
(defproject com.lemondronor/turboshrimp-h264j "0.2.0"
:description (str "An AR.Drone video deocder for the turboshrimp library "
"that uses h264j.")
:url "https://github.com/wiseman/turboshrimp-h264j"
:license {:name "MIT License"
:url "http://opensource.org/licenses/MIT"}
:dependencies [[com.twilight/h264 "0.0.1"]
[org.clojure/clojure "1.6.0"]]
:profiles {:test
{:dependencies [[com.lemondronor/turboshrimp "0.3.1"]]
:resource-paths ["test-resources"]}})
## Instruction:
Deploy to clojars by default.
## Code After:
(defproject com.lemondronor/turboshrimp-h264j "0.2.1-SNAPSHOT"
:description (str "An AR.Drone video deocder for the turboshrimp library "
"that uses h264j.")
:url "https://github.com/wiseman/turboshrimp-h264j"
:license {:name "MIT License"
:url "http://opensource.org/licenses/MIT"}
:deploy-repositories [["releases" :clojars]]
:dependencies [[com.twilight/h264 "0.0.1"]
[org.clojure/clojure "1.6.0"]]
:profiles {:test
{:dependencies [[com.lemondronor/turboshrimp "0.3.1"]]
:resource-paths ["test-resources"]}})
| - (defproject com.lemondronor/turboshrimp-h264j "0.2.0"
? ^
+ (defproject com.lemondronor/turboshrimp-h264j "0.2.1-SNAPSHOT"
? ^^^^^^^^^^
:description (str "An AR.Drone video deocder for the turboshrimp library "
"that uses h264j.")
:url "https://github.com/wiseman/turboshrimp-h264j"
:license {:name "MIT License"
:url "http://opensource.org/licenses/MIT"}
+ :deploy-repositories [["releases" :clojars]]
:dependencies [[com.twilight/h264 "0.0.1"]
[org.clojure/clojure "1.6.0"]]
:profiles {:test
{:dependencies [[com.lemondronor/turboshrimp "0.3.1"]]
:resource-paths ["test-resources"]}}) | 3 | 0.272727 | 2 | 1 |
78b8bfaa0a56a9bf14f460f51b57bb4d9bb5c38a | test/handmade.coffee | test/handmade.coffee | fs = require 'fs'
path = require 'path'
assert = require 'assert'
valid8 = require '..'
random = require './random'
buffers = []
test = (buffer)->
buffer = new Buffer buffer unless buffer instanceof Buffer
buffers.push buffer = buffer
assert valid8 buffer
describe 'Empty buffer', ->
it 'is valid', ->
test 0
describe 'ASCII', ->
it 'is valid', ->
for i in [0..0x7F]
test Buffer [i]
test [0x7F..0]
describe 'Cyrillic', ->
it 'is valid', ->
test 'Однажды в студёную зимнюю пору'
describe 'Glass', ->
it 'is eatable', ->
test fs.readFileSync path.join __dirname, 'glass.html'
describe 'Coffee', ->
it 'is drinkable', ->
test fs.readFileSync __filename
describe "Buffer", ->
it "is inspected entirely", ->
for b in buffers
assert not valid8 Buffer.concat [
b,
new Buffer [random 128, 255]
]
assert not valid8 Buffer.concat [
b,
new Buffer [random 128, 255],
random.pick buffers
]
| fs = require 'fs'
path = require 'path'
assert = require 'assert'
valid8 = require '..'
random = require './random'
buffers = []
test = (buffer)->
buffer = new Buffer buffer unless buffer instanceof Buffer
buffers.push buffer = buffer
assert valid8 buffer
describe 'Empty buffer', ->
it 'is valid', ->
test 0
describe 'ASCII', ->
it 'is valid', ->
for i in [0..0x7F]
test Buffer [i]
test [0x7F..0]
describe 'Cyrillic', ->
it 'is valid', ->
test 'Однажды в студёную зимнюю пору'
describe 'Glass', ->
it 'is eatable', ->
test fs.readFileSync path.join __dirname, 'glass.html'
describe 'Coffee', ->
it 'is drinkable', ->
test fs.readFileSync __filename
describe "Pile of poo", ->
it "is valid either", ->
test "💩" # "\u{1F4A9}" # https://mathiasbynens.be/notes/javascript-unicode
describe "Buffer", ->
it "is inspected entirely", ->
for b in buffers
assert not valid8 Buffer.concat [
b,
new Buffer [random 128, 255]
]
assert not valid8 Buffer.concat [
b,
new Buffer [random 128, 255],
random.pick buffers
]
| Test for pile of poo | Test for pile of poo
| CoffeeScript | mit | ukoloff/valid-8 | coffeescript | ## Code Before:
fs = require 'fs'
path = require 'path'
assert = require 'assert'
valid8 = require '..'
random = require './random'
buffers = []
test = (buffer)->
buffer = new Buffer buffer unless buffer instanceof Buffer
buffers.push buffer = buffer
assert valid8 buffer
describe 'Empty buffer', ->
it 'is valid', ->
test 0
describe 'ASCII', ->
it 'is valid', ->
for i in [0..0x7F]
test Buffer [i]
test [0x7F..0]
describe 'Cyrillic', ->
it 'is valid', ->
test 'Однажды в студёную зимнюю пору'
describe 'Glass', ->
it 'is eatable', ->
test fs.readFileSync path.join __dirname, 'glass.html'
describe 'Coffee', ->
it 'is drinkable', ->
test fs.readFileSync __filename
describe "Buffer", ->
it "is inspected entirely", ->
for b in buffers
assert not valid8 Buffer.concat [
b,
new Buffer [random 128, 255]
]
assert not valid8 Buffer.concat [
b,
new Buffer [random 128, 255],
random.pick buffers
]
## Instruction:
Test for pile of poo
## Code After:
fs = require 'fs'
path = require 'path'
assert = require 'assert'
valid8 = require '..'
random = require './random'
buffers = []
test = (buffer)->
buffer = new Buffer buffer unless buffer instanceof Buffer
buffers.push buffer = buffer
assert valid8 buffer
describe 'Empty buffer', ->
it 'is valid', ->
test 0
describe 'ASCII', ->
it 'is valid', ->
for i in [0..0x7F]
test Buffer [i]
test [0x7F..0]
describe 'Cyrillic', ->
it 'is valid', ->
test 'Однажды в студёную зимнюю пору'
describe 'Glass', ->
it 'is eatable', ->
test fs.readFileSync path.join __dirname, 'glass.html'
describe 'Coffee', ->
it 'is drinkable', ->
test fs.readFileSync __filename
describe "Pile of poo", ->
it "is valid either", ->
test "💩" # "\u{1F4A9}" # https://mathiasbynens.be/notes/javascript-unicode
describe "Buffer", ->
it "is inspected entirely", ->
for b in buffers
assert not valid8 Buffer.concat [
b,
new Buffer [random 128, 255]
]
assert not valid8 Buffer.concat [
b,
new Buffer [random 128, 255],
random.pick buffers
]
| fs = require 'fs'
path = require 'path'
assert = require 'assert'
valid8 = require '..'
random = require './random'
buffers = []
test = (buffer)->
buffer = new Buffer buffer unless buffer instanceof Buffer
buffers.push buffer = buffer
assert valid8 buffer
describe 'Empty buffer', ->
it 'is valid', ->
test 0
describe 'ASCII', ->
it 'is valid', ->
for i in [0..0x7F]
test Buffer [i]
test [0x7F..0]
describe 'Cyrillic', ->
it 'is valid', ->
test 'Однажды в студёную зимнюю пору'
describe 'Glass', ->
it 'is eatable', ->
test fs.readFileSync path.join __dirname, 'glass.html'
describe 'Coffee', ->
it 'is drinkable', ->
test fs.readFileSync __filename
+ describe "Pile of poo", ->
+ it "is valid either", ->
+ test "💩" # "\u{1F4A9}" # https://mathiasbynens.be/notes/javascript-unicode
+
describe "Buffer", ->
it "is inspected entirely", ->
for b in buffers
assert not valid8 Buffer.concat [
b,
new Buffer [random 128, 255]
]
assert not valid8 Buffer.concat [
b,
new Buffer [random 128, 255],
random.pick buffers
] | 4 | 0.078431 | 4 | 0 |
0c629dadf707718f31407a5254a4f81cbd28b601 | src/main/java/org/dita/dost/platform/ListTranstypeAction.java | src/main/java/org/dita/dost/platform/ListTranstypeAction.java | /*
* This file is part of the DITA Open Toolkit project.
*
* Copyright 2011 Jarno Elovirta
*
* See the accompanying LICENSE file for applicable license.
*/
package org.dita.dost.platform;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
import org.xml.sax.ContentHandler;
import org.xml.sax.SAXException;
/**
* List transtypes integration action.
*
* @since 1.5.4
* @author Jarno Elovirta
*/
final class ListTranstypeAction extends ImportAction {
/**
* Get result.
*/
@Override
public void getResult(final ContentHandler buf) throws SAXException {
final String separator = paramTable.getOrDefault("separator", "|");
final List<String> v = valueSet.stream()
.map(fileValue -> fileValue.value)
.collect(Collectors.toList());
Collections.sort(v);
final StringBuilder retBuf = new StringBuilder();
for (final Iterator<String> i = v.iterator(); i.hasNext();) {
retBuf.append(i.next());
if (i.hasNext()) {
retBuf.append(separator);
}
}
final char[] ret = retBuf.toString().toCharArray();
buf.characters(ret, 0, ret.length);
}
@Override
public String getResult() {
throw new UnsupportedOperationException();
}
}
| /*
* This file is part of the DITA Open Toolkit project.
*
* Copyright 2011 Jarno Elovirta
*
* See the accompanying LICENSE file for applicable license.
*/
package org.dita.dost.platform;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
import org.xml.sax.ContentHandler;
import org.xml.sax.SAXException;
/**
* List transtypes integration action.
*
* @since 1.5.4
* @author Jarno Elovirta
*/
final class ListTranstypeAction extends ImportAction {
/**
* Get result.
*/
@Override
public void getResult(final ContentHandler buf) throws SAXException {
final String separator = paramTable.getOrDefault("separator", "|");
final List<String> v = valueSet.stream()
.map(fileValue -> fileValue.value)
.distinct()
.collect(Collectors.toList());
Collections.sort(v);
final StringBuilder retBuf = new StringBuilder();
for (final Iterator<String> i = v.iterator(); i.hasNext();) {
retBuf.append(i.next());
if (i.hasNext()) {
retBuf.append(separator);
}
}
final char[] ret = retBuf.toString().toCharArray();
buf.characters(ret, 0, ret.length);
}
@Override
public String getResult() {
throw new UnsupportedOperationException();
}
}
| Drop duplicates when listing transform types | Drop duplicates when listing transform types
Signed-off-by: Robert D Anderson <4907d442684b61876fae0471c4d2d08024a9ca72@us.ibm.com>
| Java | apache-2.0 | dita-ot/dita-ot,infotexture/dita-ot,infotexture/dita-ot,dita-ot/dita-ot,drmacro/dita-ot,infotexture/dita-ot,shaneataylor/dita-ot,drmacro/dita-ot,shaneataylor/dita-ot,infotexture/dita-ot,shaneataylor/dita-ot,drmacro/dita-ot,shaneataylor/dita-ot,infotexture/dita-ot,dita-ot/dita-ot,dita-ot/dita-ot,shaneataylor/dita-ot,drmacro/dita-ot,dita-ot/dita-ot,drmacro/dita-ot | java | ## Code Before:
/*
* This file is part of the DITA Open Toolkit project.
*
* Copyright 2011 Jarno Elovirta
*
* See the accompanying LICENSE file for applicable license.
*/
package org.dita.dost.platform;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
import org.xml.sax.ContentHandler;
import org.xml.sax.SAXException;
/**
* List transtypes integration action.
*
* @since 1.5.4
* @author Jarno Elovirta
*/
final class ListTranstypeAction extends ImportAction {
/**
* Get result.
*/
@Override
public void getResult(final ContentHandler buf) throws SAXException {
final String separator = paramTable.getOrDefault("separator", "|");
final List<String> v = valueSet.stream()
.map(fileValue -> fileValue.value)
.collect(Collectors.toList());
Collections.sort(v);
final StringBuilder retBuf = new StringBuilder();
for (final Iterator<String> i = v.iterator(); i.hasNext();) {
retBuf.append(i.next());
if (i.hasNext()) {
retBuf.append(separator);
}
}
final char[] ret = retBuf.toString().toCharArray();
buf.characters(ret, 0, ret.length);
}
@Override
public String getResult() {
throw new UnsupportedOperationException();
}
}
## Instruction:
Drop duplicates when listing transform types
Signed-off-by: Robert D Anderson <4907d442684b61876fae0471c4d2d08024a9ca72@us.ibm.com>
## Code After:
/*
* This file is part of the DITA Open Toolkit project.
*
* Copyright 2011 Jarno Elovirta
*
* See the accompanying LICENSE file for applicable license.
*/
package org.dita.dost.platform;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
import org.xml.sax.ContentHandler;
import org.xml.sax.SAXException;
/**
* List transtypes integration action.
*
* @since 1.5.4
* @author Jarno Elovirta
*/
final class ListTranstypeAction extends ImportAction {
/**
* Get result.
*/
@Override
public void getResult(final ContentHandler buf) throws SAXException {
final String separator = paramTable.getOrDefault("separator", "|");
final List<String> v = valueSet.stream()
.map(fileValue -> fileValue.value)
.distinct()
.collect(Collectors.toList());
Collections.sort(v);
final StringBuilder retBuf = new StringBuilder();
for (final Iterator<String> i = v.iterator(); i.hasNext();) {
retBuf.append(i.next());
if (i.hasNext()) {
retBuf.append(separator);
}
}
final char[] ret = retBuf.toString().toCharArray();
buf.characters(ret, 0, ret.length);
}
@Override
public String getResult() {
throw new UnsupportedOperationException();
}
}
| /*
* This file is part of the DITA Open Toolkit project.
*
* Copyright 2011 Jarno Elovirta
*
* See the accompanying LICENSE file for applicable license.
*/
package org.dita.dost.platform;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
import org.xml.sax.ContentHandler;
import org.xml.sax.SAXException;
/**
* List transtypes integration action.
*
* @since 1.5.4
* @author Jarno Elovirta
*/
final class ListTranstypeAction extends ImportAction {
/**
* Get result.
*/
@Override
public void getResult(final ContentHandler buf) throws SAXException {
final String separator = paramTable.getOrDefault("separator", "|");
final List<String> v = valueSet.stream()
.map(fileValue -> fileValue.value)
+ .distinct()
.collect(Collectors.toList());
Collections.sort(v);
final StringBuilder retBuf = new StringBuilder();
for (final Iterator<String> i = v.iterator(); i.hasNext();) {
retBuf.append(i.next());
if (i.hasNext()) {
retBuf.append(separator);
}
}
final char[] ret = retBuf.toString().toCharArray();
buf.characters(ret, 0, ret.length);
}
@Override
public String getResult() {
throw new UnsupportedOperationException();
}
} | 1 | 0.018868 | 1 | 0 |
0c9ee25ca21846c6b2be4d7f4c89f0fe8125e8e8 | audio/CMakeLists.txt | audio/CMakeLists.txt | set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
find_package(OpenAL 1.8 REQUIRED)
find_package(Alure 1.2 REQUIRED)
gluon_include_directories(GluonAudio
${GLUONCORE_INCLUDE_DIRS}
${ALURE_INCLUDE_DIRS}
${OPENAL_INCLUDE_DIR}
#TODO: Make use of phonon instead of these libs for file input. Saves us another few dependencies.
)
if( BUILD_EXAMPLES )
add_subdirectory(examples)
endif()
set(GluonAudio_SRCS
#capture.cpp
engine.cpp
player.cpp
sound.cpp
#capturedevice_p.cpp
device_p.cpp
)
set(GluonAudio_HEADERS
#capture.h
engine.h
gluon_audio_export.h
player.h
sound.h
)
gluon_add_library(GluonAudio SHARED
SOURCES ${GluonAudio_SRCS}
HEADERS ${GluonAudio_HEADERS}
LIBRARIES ${GLUONCORE_LIBRARIES} ${OPENAL_LIBRARY} ${ALURE_LIBRARIES}
)
if(BUILD_TESTS)
add_subdirectory(tests)
endif()
| set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
find_package(OpenAL 1.8 REQUIRED)
find_package(Alure 1.2 REQUIRED)
gluon_include_directories(GluonAudio
${GLUONCORE_INCLUDE_DIRS}
${ALURE_INCLUDE_DIRS}
${OPENAL_INCLUDE_DIR}
)
set(GluonAudio_SRCS
engine.cpp
player.cpp
sound.cpp
device_p.cpp
)
set(GluonAudio_HEADERS
engine.h
gluon_audio_export.h
player.h
sound.h
)
gluon_add_library(GluonAudio SHARED
SOURCES ${GluonAudio_SRCS}
HEADERS ${GluonAudio_HEADERS}
LIBRARIES ${GLUONCORE_LIBRARIES} ${OPENAL_LIBRARY} ${ALURE_LIBRARIES}
)
gluon_add_subdirectories(examples tests) | Remove obsolete lines and use the new gluon_add_subdirectory macro | audio: Remove obsolete lines and use the new gluon_add_subdirectory macro
| Text | lgpl-2.1 | KDE/gluon,KDE/gluon,KDE/gluon,KDE/gluon | text | ## Code Before:
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
find_package(OpenAL 1.8 REQUIRED)
find_package(Alure 1.2 REQUIRED)
gluon_include_directories(GluonAudio
${GLUONCORE_INCLUDE_DIRS}
${ALURE_INCLUDE_DIRS}
${OPENAL_INCLUDE_DIR}
#TODO: Make use of phonon instead of these libs for file input. Saves us another few dependencies.
)
if( BUILD_EXAMPLES )
add_subdirectory(examples)
endif()
set(GluonAudio_SRCS
#capture.cpp
engine.cpp
player.cpp
sound.cpp
#capturedevice_p.cpp
device_p.cpp
)
set(GluonAudio_HEADERS
#capture.h
engine.h
gluon_audio_export.h
player.h
sound.h
)
gluon_add_library(GluonAudio SHARED
SOURCES ${GluonAudio_SRCS}
HEADERS ${GluonAudio_HEADERS}
LIBRARIES ${GLUONCORE_LIBRARIES} ${OPENAL_LIBRARY} ${ALURE_LIBRARIES}
)
if(BUILD_TESTS)
add_subdirectory(tests)
endif()
## Instruction:
audio: Remove obsolete lines and use the new gluon_add_subdirectory macro
## Code After:
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
find_package(OpenAL 1.8 REQUIRED)
find_package(Alure 1.2 REQUIRED)
gluon_include_directories(GluonAudio
${GLUONCORE_INCLUDE_DIRS}
${ALURE_INCLUDE_DIRS}
${OPENAL_INCLUDE_DIR}
)
set(GluonAudio_SRCS
engine.cpp
player.cpp
sound.cpp
device_p.cpp
)
set(GluonAudio_HEADERS
engine.h
gluon_audio_export.h
player.h
sound.h
)
gluon_add_library(GluonAudio SHARED
SOURCES ${GluonAudio_SRCS}
HEADERS ${GluonAudio_HEADERS}
LIBRARIES ${GLUONCORE_LIBRARIES} ${OPENAL_LIBRARY} ${ALURE_LIBRARIES}
)
gluon_add_subdirectories(examples tests) | set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
find_package(OpenAL 1.8 REQUIRED)
find_package(Alure 1.2 REQUIRED)
gluon_include_directories(GluonAudio
${GLUONCORE_INCLUDE_DIRS}
${ALURE_INCLUDE_DIRS}
${OPENAL_INCLUDE_DIR}
- #TODO: Make use of phonon instead of these libs for file input. Saves us another few dependencies.
)
- if( BUILD_EXAMPLES )
- add_subdirectory(examples)
- endif()
-
set(GluonAudio_SRCS
- #capture.cpp
engine.cpp
player.cpp
sound.cpp
-
- #capturedevice_p.cpp
device_p.cpp
)
set(GluonAudio_HEADERS
- #capture.h
engine.h
gluon_audio_export.h
player.h
sound.h
)
gluon_add_library(GluonAudio SHARED
SOURCES ${GluonAudio_SRCS}
HEADERS ${GluonAudio_HEADERS}
LIBRARIES ${GLUONCORE_LIBRARIES} ${OPENAL_LIBRARY} ${ALURE_LIBRARIES}
)
+ gluon_add_subdirectories(examples tests)
- if(BUILD_TESTS)
- add_subdirectory(tests)
- endif() | 13 | 0.295455 | 1 | 12 |
65f30d8fcbe42d04473cd9229b44b959bcb57b5f | jktebop.rb | jktebop.rb | class Jktebop < Formula
homepage "http://www.astro.keele.ac.uk/jkt/codes/jktebop.html"
url "http://www.astro.keele.ac.uk/jkt/codes/jktebop-v34.tgz"
sha1 "ea08d44eafb337e7ad0aab06197614ffd209099c"
option "with-examples", "Install the examples into share/#{name}"
depends_on :fortran
def install
system "#{ENV.fc} -O2 -o #{name} #{name}.f"
bin.install name
if build.with? "examples"
mkdir "#{name}" do
%w{dat out fit in par}.each do |ext|
mv Dir.glob("../*.#{ext}"), '.'
end
end
share.install "#{name}"
end
end
end
| class Jktebop < Formula
homepage "http://www.astro.keele.ac.uk/jkt/codes/jktebop.html"
url "http://www.astro.keele.ac.uk/jkt/codes/jktebop-v34.tgz"
sha1 "ea08d44eafb337e7ad0aab06197614ffd209099c"
option "with-examples", "Install the examples into share/#{name}"
depends_on :fortran
depends_on "jktld" => :optional
def install
system "#{ENV.fc} -O2 -o #{name} #{name}.f"
bin.install name
if build.with? "examples"
mkdir "#{name}" do
%w{dat out fit in par}.each do |ext|
mv Dir.glob("../*.#{ext}"), '.'
end
end
share.install "#{name}"
end
end
def caveats
"To compute limb darkening coefficients (task 1) install jktld"
end
end
| Add note and optional install dependency jktld | Add note and optional install dependency jktld
| Ruby | mit | mindriot101/homebrew-alt | ruby | ## Code Before:
class Jktebop < Formula
homepage "http://www.astro.keele.ac.uk/jkt/codes/jktebop.html"
url "http://www.astro.keele.ac.uk/jkt/codes/jktebop-v34.tgz"
sha1 "ea08d44eafb337e7ad0aab06197614ffd209099c"
option "with-examples", "Install the examples into share/#{name}"
depends_on :fortran
def install
system "#{ENV.fc} -O2 -o #{name} #{name}.f"
bin.install name
if build.with? "examples"
mkdir "#{name}" do
%w{dat out fit in par}.each do |ext|
mv Dir.glob("../*.#{ext}"), '.'
end
end
share.install "#{name}"
end
end
end
## Instruction:
Add note and optional install dependency jktld
## Code After:
class Jktebop < Formula
homepage "http://www.astro.keele.ac.uk/jkt/codes/jktebop.html"
url "http://www.astro.keele.ac.uk/jkt/codes/jktebop-v34.tgz"
sha1 "ea08d44eafb337e7ad0aab06197614ffd209099c"
option "with-examples", "Install the examples into share/#{name}"
depends_on :fortran
depends_on "jktld" => :optional
def install
system "#{ENV.fc} -O2 -o #{name} #{name}.f"
bin.install name
if build.with? "examples"
mkdir "#{name}" do
%w{dat out fit in par}.each do |ext|
mv Dir.glob("../*.#{ext}"), '.'
end
end
share.install "#{name}"
end
end
def caveats
"To compute limb darkening coefficients (task 1) install jktld"
end
end
| class Jktebop < Formula
homepage "http://www.astro.keele.ac.uk/jkt/codes/jktebop.html"
url "http://www.astro.keele.ac.uk/jkt/codes/jktebop-v34.tgz"
sha1 "ea08d44eafb337e7ad0aab06197614ffd209099c"
option "with-examples", "Install the examples into share/#{name}"
depends_on :fortran
+ depends_on "jktld" => :optional
def install
system "#{ENV.fc} -O2 -o #{name} #{name}.f"
bin.install name
if build.with? "examples"
mkdir "#{name}" do
%w{dat out fit in par}.each do |ext|
mv Dir.glob("../*.#{ext}"), '.'
end
end
share.install "#{name}"
end
end
+
+ def caveats
+ "To compute limb darkening coefficients (task 1) install jktld"
+ end
end | 5 | 0.217391 | 5 | 0 |
4df0803e2fa106eadebda741e173c5b75cb4b35d | app/models/collection.rb | app/models/collection.rb | class Collection < ActiveFedora::Base
include Hydra::Collection
include CurationConcern::CollectionModel
include Hydra::Collections::Collectible
def can_be_member_of_collection?(collection)
collection == self ? false : true
end
end
| class Collection < ActiveFedora::Base
include Hydra::Collection
# override the default Hydra properties so we don't get a prefix deprecation warning.
has_metadata "properties", type: Worthwhile::PropertiesDatastream
include CurationConcern::CollectionModel
include Hydra::Collections::Collectible
def can_be_member_of_collection?(collection)
collection == self ? false : true
end
end
| Use the local properties datastream to avoid a deprecation warning | Use the local properties datastream to avoid a deprecation warning
| Ruby | apache-2.0 | samvera/hyrax,samvera/hyrax,samvera/hyrax,samvera/hyrax | ruby | ## Code Before:
class Collection < ActiveFedora::Base
include Hydra::Collection
include CurationConcern::CollectionModel
include Hydra::Collections::Collectible
def can_be_member_of_collection?(collection)
collection == self ? false : true
end
end
## Instruction:
Use the local properties datastream to avoid a deprecation warning
## Code After:
class Collection < ActiveFedora::Base
include Hydra::Collection
# override the default Hydra properties so we don't get a prefix deprecation warning.
has_metadata "properties", type: Worthwhile::PropertiesDatastream
include CurationConcern::CollectionModel
include Hydra::Collections::Collectible
def can_be_member_of_collection?(collection)
collection == self ? false : true
end
end
| class Collection < ActiveFedora::Base
include Hydra::Collection
+ # override the default Hydra properties so we don't get a prefix deprecation warning.
+ has_metadata "properties", type: Worthwhile::PropertiesDatastream
include CurationConcern::CollectionModel
include Hydra::Collections::Collectible
def can_be_member_of_collection?(collection)
collection == self ? false : true
end
end | 2 | 0.222222 | 2 | 0 |
497bb540cb26a05621e13c8b3ba598308cd7fc3f | README.md | README.md | Raspberry-Pi-Robot
==================
A project to test out the raspberry pi GPIO's.
This robot has so far no autonomy, and is controlled by ssh-ing to the raspberry pi and running the 'motor_test.pi' script.

 | Raspberry-Pi-Robot
==================
A project to test out the raspberry pi GPIO's.
This robot has so far no autonomy, and is controlled by ssh-ing to the raspberry pi and running the 'motor_test.pi' script.


| Update readme with proper img links | Update readme with proper img links
| Markdown | mit | philiplarsson/Raspberry-Pi-Robot | markdown | ## Code Before:
Raspberry-Pi-Robot
==================
A project to test out the raspberry pi GPIO's.
This robot has so far no autonomy, and is controlled by ssh-ing to the raspberry pi and running the 'motor_test.pi' script.


## Instruction:
Update readme with proper img links
## Code After:
Raspberry-Pi-Robot
==================
A project to test out the raspberry pi GPIO's.
This robot has so far no autonomy, and is controlled by ssh-ing to the raspberry pi and running the 'motor_test.pi' script.


| Raspberry-Pi-Robot
==================
A project to test out the raspberry pi GPIO's.
This robot has so far no autonomy, and is controlled by ssh-ing to the raspberry pi and running the 'motor_test.pi' script.
- 
+ 
? ++++ +++++++++++ +++++++
- 
+ 
? ++++ +++++++++++ +++++++
| 4 | 0.5 | 2 | 2 |
7d3ccf20f31519d2c9633bf30151860d17147a71 | .travis.yml | .travis.yml | language: python
python:
- '2.7'
- '3.4'
install:
- pip install -r requirements.txt
script: nosetests
| language: python
python:
- '2.6'
- '2.7'
- '3.3'
- '3.4'
install:
- pip install -r requirements.txt
- pip install pytest > /dev/null
- pip install pytest-cov > /dev/null
- pip install coveralls > /dev/null
script: py.test --cov dailymotion.py --cov-report term-missing TestDailymotion.py
after_success:
- coveralls
| Add coveralls stats to Travis builds. | Add coveralls stats to Travis builds.
| YAML | mit | LoveIsGrief/dailymotion-sdk-python,dailymotion/dailymotion-sdk-python | yaml | ## Code Before:
language: python
python:
- '2.7'
- '3.4'
install:
- pip install -r requirements.txt
script: nosetests
## Instruction:
Add coveralls stats to Travis builds.
## Code After:
language: python
python:
- '2.6'
- '2.7'
- '3.3'
- '3.4'
install:
- pip install -r requirements.txt
- pip install pytest > /dev/null
- pip install pytest-cov > /dev/null
- pip install coveralls > /dev/null
script: py.test --cov dailymotion.py --cov-report term-missing TestDailymotion.py
after_success:
- coveralls
| language: python
+
python:
+ - '2.6'
- '2.7'
+ - '3.3'
- '3.4'
+
install:
- pip install -r requirements.txt
- script: nosetests
+ - pip install pytest > /dev/null
+ - pip install pytest-cov > /dev/null
+ - pip install coveralls > /dev/null
+
+ script: py.test --cov dailymotion.py --cov-report term-missing TestDailymotion.py
+
+ after_success:
+ - coveralls | 13 | 1.857143 | 12 | 1 |
3daa15b0ccb3fc4891daf55724cbeaa705f923e5 | scripts/clio_daemon.py | scripts/clio_daemon.py |
import logging
import simpledaemon
class clio_daemon(simpledaemon.Daemon):
default_conf = 'clio_daemon.conf'
section = 'clio'
def run(self):
import eventlet
from clio.store import app
logger = logging.getLogger()
if logger.handlers:
[app.logger.addHandler(h) for h in logger.handlers]
app.logger.setLevel(logger.level)
eventlet.serve(eventlet.listen((app.config['HOST'], app.config['PORT']), backlog=2048), app)
if __name__ == '__main__':
clio_daemon().main()
|
import simpledaemon
class clio_daemon(simpledaemon.Daemon):
default_conf = 'clio_daemon.conf'
section = 'clio'
def run(self):
import eventlet
from clio.store import app
eventlet.serve(eventlet.listen((app.config['HOST'], app.config['PORT']), backlog=2048), app)
if __name__ == '__main__':
clio_daemon().main()
| Revert "output flask logging into simpledaemon's log file." | Revert "output flask logging into simpledaemon's log file."
This is completely superfluous - logging does this already
automatically.
This reverts commit 18091efef351ecddb1d29ee7d01d0a7fb567a7b7.
| Python | apache-2.0 | geodelic/clio,geodelic/clio | python | ## Code Before:
import logging
import simpledaemon
class clio_daemon(simpledaemon.Daemon):
default_conf = 'clio_daemon.conf'
section = 'clio'
def run(self):
import eventlet
from clio.store import app
logger = logging.getLogger()
if logger.handlers:
[app.logger.addHandler(h) for h in logger.handlers]
app.logger.setLevel(logger.level)
eventlet.serve(eventlet.listen((app.config['HOST'], app.config['PORT']), backlog=2048), app)
if __name__ == '__main__':
clio_daemon().main()
## Instruction:
Revert "output flask logging into simpledaemon's log file."
This is completely superfluous - logging does this already
automatically.
This reverts commit 18091efef351ecddb1d29ee7d01d0a7fb567a7b7.
## Code After:
import simpledaemon
class clio_daemon(simpledaemon.Daemon):
default_conf = 'clio_daemon.conf'
section = 'clio'
def run(self):
import eventlet
from clio.store import app
eventlet.serve(eventlet.listen((app.config['HOST'], app.config['PORT']), backlog=2048), app)
if __name__ == '__main__':
clio_daemon().main()
| -
- import logging
import simpledaemon
class clio_daemon(simpledaemon.Daemon):
default_conf = 'clio_daemon.conf'
section = 'clio'
def run(self):
import eventlet
from clio.store import app
- logger = logging.getLogger()
- if logger.handlers:
- [app.logger.addHandler(h) for h in logger.handlers]
- app.logger.setLevel(logger.level)
eventlet.serve(eventlet.listen((app.config['HOST'], app.config['PORT']), backlog=2048), app)
if __name__ == '__main__':
clio_daemon().main()
| 6 | 0.285714 | 0 | 6 |
5c0e1437d466ad4b2de6c4b606811b132139fe12 | plugins/available/node.plugin.bash | plugins/available/node.plugin.bash | cite about-plugin
about-plugin 'Node.js helper functions'
export PATH=./node_modules/.bin:$PATH
| cite about-plugin
about-plugin 'Node.js helper functions'
export PATH=./node_modules/.bin:$PATH
# Make sure the global npm prefix is on the path
[[ `which npm` ]] && export PATH=$(npm config get prefix)/bin:$PATH
| Make sure that the npm prefix is in PATH | Make sure that the npm prefix is in PATH
| Shell | mit | prajnak/bash_it | shell | ## Code Before:
cite about-plugin
about-plugin 'Node.js helper functions'
export PATH=./node_modules/.bin:$PATH
## Instruction:
Make sure that the npm prefix is in PATH
## Code After:
cite about-plugin
about-plugin 'Node.js helper functions'
export PATH=./node_modules/.bin:$PATH
# Make sure the global npm prefix is on the path
[[ `which npm` ]] && export PATH=$(npm config get prefix)/bin:$PATH
| cite about-plugin
about-plugin 'Node.js helper functions'
export PATH=./node_modules/.bin:$PATH
+ # Make sure the global npm prefix is on the path
+ [[ `which npm` ]] && export PATH=$(npm config get prefix)/bin:$PATH
+ | 3 | 0.5 | 3 | 0 |
ec216eab76bb90eff31585d1fccfd940c91d7b55 | lib/childprocess/unix/process.rb | lib/childprocess/unix/process.rb | module ChildProcess
module Unix
class Process < AbstractProcess
attr_reader :pid
def io
@io ||= Unix::IO.new
end
def stop(timeout = 3)
assert_started
send_term
begin
return poll_for_exit(timeout)
rescue TimeoutError
# try next
end
send_kill
wait
rescue Errno::ECHILD, Errno::ESRCH
# handle race condition where process dies between timeout
# and send_kill
true
end
def exited?
return true if @exit_code
assert_started
pid, status = ::Process.waitpid2(@pid, ::Process::WNOHANG)
log(:pid => pid, :status => status)
if pid
@exit_code = status.exitstatus || status.termsig
end
!!pid
end
def wait
assert_started
pid, status = ::Process.waitpid2 @pid
@exit_code = status.exitstatus || status.termsig
end
private
def send_term
send_signal 'TERM'
end
def send_kill
send_signal 'KILL'
end
def send_signal(sig)
assert_started
log "sending #{sig}"
::Process.kill sig, @pid
end
end # Process
end # Unix
end # ChildProcess
| module ChildProcess
module Unix
class Process < AbstractProcess
attr_reader :pid
def io
@io ||= Unix::IO.new
end
def stop(timeout = 3)
assert_started
send_term
begin
return poll_for_exit(timeout)
rescue TimeoutError
# try next
end
send_kill
wait
rescue Errno::ECHILD, Errno::ESRCH
# handle race condition where process dies between timeout
# and send_kill
true
end
def exited?
return true if @exit_code
assert_started
pid, status = ::Process.waitpid2(@pid, ::Process::WNOHANG)
pid = nil if pid == 0 # may happen on jruby
log(:pid => pid, :status => status)
if pid
@exit_code = status.exitstatus || status.termsig
end
!!pid
end
def wait
assert_started
pid, status = ::Process.waitpid2 @pid
@exit_code = status.exitstatus || status.termsig
end
private
def send_term
send_signal 'TERM'
end
def send_kill
send_signal 'KILL'
end
def send_signal(sig)
assert_started
log "sending #{sig}"
::Process.kill sig, @pid
end
end # Process
end # Unix
end # ChildProcess
| Fix JRuby issue with posix spawn. | Fix JRuby issue with posix spawn.
Process.waitpid2 can apparently return 0 instead of nil on JRuby, if the process is still alive.
| Ruby | mit | Kilosassy/childprocess,jarib/childprocess,enkessler/childprocess | ruby | ## Code Before:
module ChildProcess
module Unix
class Process < AbstractProcess
attr_reader :pid
def io
@io ||= Unix::IO.new
end
def stop(timeout = 3)
assert_started
send_term
begin
return poll_for_exit(timeout)
rescue TimeoutError
# try next
end
send_kill
wait
rescue Errno::ECHILD, Errno::ESRCH
# handle race condition where process dies between timeout
# and send_kill
true
end
def exited?
return true if @exit_code
assert_started
pid, status = ::Process.waitpid2(@pid, ::Process::WNOHANG)
log(:pid => pid, :status => status)
if pid
@exit_code = status.exitstatus || status.termsig
end
!!pid
end
def wait
assert_started
pid, status = ::Process.waitpid2 @pid
@exit_code = status.exitstatus || status.termsig
end
private
def send_term
send_signal 'TERM'
end
def send_kill
send_signal 'KILL'
end
def send_signal(sig)
assert_started
log "sending #{sig}"
::Process.kill sig, @pid
end
end # Process
end # Unix
end # ChildProcess
## Instruction:
Fix JRuby issue with posix spawn.
Process.waitpid2 can apparently return 0 instead of nil on JRuby, if the process is still alive.
## Code After:
module ChildProcess
module Unix
class Process < AbstractProcess
attr_reader :pid
def io
@io ||= Unix::IO.new
end
def stop(timeout = 3)
assert_started
send_term
begin
return poll_for_exit(timeout)
rescue TimeoutError
# try next
end
send_kill
wait
rescue Errno::ECHILD, Errno::ESRCH
# handle race condition where process dies between timeout
# and send_kill
true
end
def exited?
return true if @exit_code
assert_started
pid, status = ::Process.waitpid2(@pid, ::Process::WNOHANG)
pid = nil if pid == 0 # may happen on jruby
log(:pid => pid, :status => status)
if pid
@exit_code = status.exitstatus || status.termsig
end
!!pid
end
def wait
assert_started
pid, status = ::Process.waitpid2 @pid
@exit_code = status.exitstatus || status.termsig
end
private
def send_term
send_signal 'TERM'
end
def send_kill
send_signal 'KILL'
end
def send_signal(sig)
assert_started
log "sending #{sig}"
::Process.kill sig, @pid
end
end # Process
end # Unix
end # ChildProcess
| module ChildProcess
module Unix
class Process < AbstractProcess
attr_reader :pid
def io
@io ||= Unix::IO.new
end
def stop(timeout = 3)
assert_started
send_term
begin
return poll_for_exit(timeout)
rescue TimeoutError
# try next
end
send_kill
wait
rescue Errno::ECHILD, Errno::ESRCH
# handle race condition where process dies between timeout
# and send_kill
true
end
def exited?
return true if @exit_code
assert_started
pid, status = ::Process.waitpid2(@pid, ::Process::WNOHANG)
+ pid = nil if pid == 0 # may happen on jruby
log(:pid => pid, :status => status)
if pid
@exit_code = status.exitstatus || status.termsig
end
!!pid
end
def wait
assert_started
pid, status = ::Process.waitpid2 @pid
@exit_code = status.exitstatus || status.termsig
end
private
def send_term
send_signal 'TERM'
end
def send_kill
send_signal 'KILL'
end
def send_signal(sig)
assert_started
log "sending #{sig}"
::Process.kill sig, @pid
end
end # Process
end # Unix
end # ChildProcess | 1 | 0.014493 | 1 | 0 |
bbd377e0ca903c9247ac6cf4496d14249af7b62d | src/ChromeDevToolsGeneratorCLI/Templates/project.hbs | src/ChromeDevToolsGeneratorCLI/Templates/project.hbs | <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>{{chromeVersion.BrowserVersion}}</Version>
<Authors>Sean McLellan</Authors>
<Company>BaristaLabs, LLC</Company>
<RepositoryUrl>https://github.com/BaristaLabs/chrome-dev-tools-runtime.git</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageTags>ChromeDevTools, .Net Core</PackageTags>
<PackageLicenseUrl>https://raw.githubusercontent.com/BaristaLabs/chrome-dev-tools-runtime/master/LICENSE</PackageLicenseUrl>
<Copyright>Copyright (c) 2017 BaristaLabs, LLC</Copyright>
<PackageProjectUrl>https://github.com/BaristaLabs/chrome-dev-tools-runtime</PackageProjectUrl>
<Description>.Net Core based runtime to interact with an running instance of Chrome via the ChromeDevTools protocol.</Description>
<PackageReleaseNotes>Chrome Version: {{chromeVersion.BrowserVersion}}; Protocol Version: {{chromeVersion.ProtocolVersion}}; Runtime Version: {{runtimeVersion}};</PackageReleaseNotes>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.2" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="WebSocket4Net" Version="0.15.0" />
</ItemGroup>
</Project>
| <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>{{chromeVersion.BrowserVersion}}{{#if runtimeVersion}}-{{runtimeVersion}}{{/if}}</Version>
<Authors>Sean McLellan</Authors>
<Company>BaristaLabs, LLC</Company>
<RepositoryUrl>https://github.com/BaristaLabs/chrome-dev-tools-runtime.git</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageTags>ChromeDevTools, .Net Core</PackageTags>
<PackageLicenseUrl>https://raw.githubusercontent.com/BaristaLabs/chrome-dev-tools-runtime/master/LICENSE</PackageLicenseUrl>
<Copyright>Copyright (c) 2017 BaristaLabs, LLC</Copyright>
<PackageProjectUrl>https://github.com/BaristaLabs/chrome-dev-tools-runtime</PackageProjectUrl>
<Description>.Net Core based runtime to interact with an running instance of Chrome via the ChromeDevTools protocol.</Description>
<PackageReleaseNotes>Chrome Version: {{chromeVersion.BrowserVersion}}; Protocol Version: {{chromeVersion.ProtocolVersion}};{{#if runtimeVersion}} Runtime Version: {{runtimeVersion}};{{/if}}</PackageReleaseNotes>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.2" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="WebSocket4Net" Version="0.15.0" />
</ItemGroup>
</Project>
| Update template to conditionally output runtime | Update template to conditionally output runtime
| Handlebars | mit | BaristaLabs/chrome-dev-tools,BaristaLabs/chrome-dev-tools | handlebars | ## Code Before:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>{{chromeVersion.BrowserVersion}}</Version>
<Authors>Sean McLellan</Authors>
<Company>BaristaLabs, LLC</Company>
<RepositoryUrl>https://github.com/BaristaLabs/chrome-dev-tools-runtime.git</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageTags>ChromeDevTools, .Net Core</PackageTags>
<PackageLicenseUrl>https://raw.githubusercontent.com/BaristaLabs/chrome-dev-tools-runtime/master/LICENSE</PackageLicenseUrl>
<Copyright>Copyright (c) 2017 BaristaLabs, LLC</Copyright>
<PackageProjectUrl>https://github.com/BaristaLabs/chrome-dev-tools-runtime</PackageProjectUrl>
<Description>.Net Core based runtime to interact with an running instance of Chrome via the ChromeDevTools protocol.</Description>
<PackageReleaseNotes>Chrome Version: {{chromeVersion.BrowserVersion}}; Protocol Version: {{chromeVersion.ProtocolVersion}}; Runtime Version: {{runtimeVersion}};</PackageReleaseNotes>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.2" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="WebSocket4Net" Version="0.15.0" />
</ItemGroup>
</Project>
## Instruction:
Update template to conditionally output runtime
## Code After:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>{{chromeVersion.BrowserVersion}}{{#if runtimeVersion}}-{{runtimeVersion}}{{/if}}</Version>
<Authors>Sean McLellan</Authors>
<Company>BaristaLabs, LLC</Company>
<RepositoryUrl>https://github.com/BaristaLabs/chrome-dev-tools-runtime.git</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageTags>ChromeDevTools, .Net Core</PackageTags>
<PackageLicenseUrl>https://raw.githubusercontent.com/BaristaLabs/chrome-dev-tools-runtime/master/LICENSE</PackageLicenseUrl>
<Copyright>Copyright (c) 2017 BaristaLabs, LLC</Copyright>
<PackageProjectUrl>https://github.com/BaristaLabs/chrome-dev-tools-runtime</PackageProjectUrl>
<Description>.Net Core based runtime to interact with an running instance of Chrome via the ChromeDevTools protocol.</Description>
<PackageReleaseNotes>Chrome Version: {{chromeVersion.BrowserVersion}}; Protocol Version: {{chromeVersion.ProtocolVersion}};{{#if runtimeVersion}} Runtime Version: {{runtimeVersion}};{{/if}}</PackageReleaseNotes>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.2" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="WebSocket4Net" Version="0.15.0" />
</ItemGroup>
</Project>
| <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
- <Version>{{chromeVersion.BrowserVersion}}</Version>
+ <Version>{{chromeVersion.BrowserVersion}}{{#if runtimeVersion}}-{{runtimeVersion}}{{/if}}</Version>
<Authors>Sean McLellan</Authors>
<Company>BaristaLabs, LLC</Company>
<RepositoryUrl>https://github.com/BaristaLabs/chrome-dev-tools-runtime.git</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageTags>ChromeDevTools, .Net Core</PackageTags>
<PackageLicenseUrl>https://raw.githubusercontent.com/BaristaLabs/chrome-dev-tools-runtime/master/LICENSE</PackageLicenseUrl>
<Copyright>Copyright (c) 2017 BaristaLabs, LLC</Copyright>
<PackageProjectUrl>https://github.com/BaristaLabs/chrome-dev-tools-runtime</PackageProjectUrl>
<Description>.Net Core based runtime to interact with an running instance of Chrome via the ChromeDevTools protocol.</Description>
- <PackageReleaseNotes>Chrome Version: {{chromeVersion.BrowserVersion}}; Protocol Version: {{chromeVersion.ProtocolVersion}}; Runtime Version: {{runtimeVersion}};</PackageReleaseNotes>
+ <PackageReleaseNotes>Chrome Version: {{chromeVersion.BrowserVersion}}; Protocol Version: {{chromeVersion.ProtocolVersion}};{{#if runtimeVersion}} Runtime Version: {{runtimeVersion}};{{/if}}</PackageReleaseNotes>
? ++++++++++++++++++++++ +++++++
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.2" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="WebSocket4Net" Version="0.15.0" />
</ItemGroup>
</Project> | 4 | 0.173913 | 2 | 2 |
1b3ec35857a8eff88b8984c83564e18a25ff081e | app/routes.py | app/routes.py | from flask import request, jsonify, session, g
import numpy as np
from DatasetCreation import ConstructDataset
from . import app
from . import firebase
from sklearn.ensemble import RandomForestClassifier
from sklearn import preprocessing
from sklearn.cross_validation import cross_val_score
@app.route("/", methods=["GET"])
def index():
response = firebase.get("/", None)
response = response or {}
datapoints, labels = ConstructDataset(response)
print len(datapoints)
print len(labels)
# print datapoints[ labels == True ]
print datapoints[10]
#enc = preprocessing.OneHotEncoder()
#print enc.fit(datapoints)
#clf = RandomForestClassifier(n_estimators=10, min_samples_split=1)
#clf = clf.fit(datapoints, labels)
#scores = cross_val_score(clf, datapoints, labels)
#scores.mean()
#clf = DecisionTreeClassifier(max_depth=None, min_samples_split=1, random_state=0)
#scores = cross_val_score(clf, datapoints, labels)
#scores.mean()
return jsonify(response) | from flask import jsonify
from . import app
from . import firebase
@app.route("/", methods=["GET"])
def index():
response = firebase.get("/", None)
response = response or {}
return jsonify(response)
| Remove commented code and unused imports | Remove commented code and unused imports
| Python | mit | MachineLearningProject/flight-delay-prediction,MachineLearningProject/flight-delay-prediction,MachineLearningProject/flight-delay-prediction | python | ## Code Before:
from flask import request, jsonify, session, g
import numpy as np
from DatasetCreation import ConstructDataset
from . import app
from . import firebase
from sklearn.ensemble import RandomForestClassifier
from sklearn import preprocessing
from sklearn.cross_validation import cross_val_score
@app.route("/", methods=["GET"])
def index():
response = firebase.get("/", None)
response = response or {}
datapoints, labels = ConstructDataset(response)
print len(datapoints)
print len(labels)
# print datapoints[ labels == True ]
print datapoints[10]
#enc = preprocessing.OneHotEncoder()
#print enc.fit(datapoints)
#clf = RandomForestClassifier(n_estimators=10, min_samples_split=1)
#clf = clf.fit(datapoints, labels)
#scores = cross_val_score(clf, datapoints, labels)
#scores.mean()
#clf = DecisionTreeClassifier(max_depth=None, min_samples_split=1, random_state=0)
#scores = cross_val_score(clf, datapoints, labels)
#scores.mean()
return jsonify(response)
## Instruction:
Remove commented code and unused imports
## Code After:
from flask import jsonify
from . import app
from . import firebase
@app.route("/", methods=["GET"])
def index():
response = firebase.get("/", None)
response = response or {}
return jsonify(response)
| + from flask import jsonify
- from flask import request, jsonify, session, g
- import numpy as np
- from DatasetCreation import ConstructDataset
from . import app
from . import firebase
-
- from sklearn.ensemble import RandomForestClassifier
- from sklearn import preprocessing
- from sklearn.cross_validation import cross_val_score
@app.route("/", methods=["GET"])
def index():
response = firebase.get("/", None)
response = response or {}
- datapoints, labels = ConstructDataset(response)
- print len(datapoints)
- print len(labels)
-
- # print datapoints[ labels == True ]
- print datapoints[10]
-
- #enc = preprocessing.OneHotEncoder()
- #print enc.fit(datapoints)
-
- #clf = RandomForestClassifier(n_estimators=10, min_samples_split=1)
- #clf = clf.fit(datapoints, labels)
-
- #scores = cross_val_score(clf, datapoints, labels)
- #scores.mean()
-
- #clf = DecisionTreeClassifier(max_depth=None, min_samples_split=1, random_state=0)
- #scores = cross_val_score(clf, datapoints, labels)
- #scores.mean()
-
return jsonify(response) | 28 | 0.736842 | 1 | 27 |
2ef3898488b8d4c386c0fa50779666ad770b36c6 | .zsh/config.zsh | .zsh/config.zsh | export EDITOR='nano'
# Paths
export PATH="./bin:$HOME/bin:$HOME/.rbenv/plugins/ruby-build/bin:/usr/local/heroku/bin:/usr/local/foreman/bin:/usr/local/bin:$HOME/Code/go/bin:/Applications/Postgres.app/Contents/Versions/9.3/bin:$PATH"
export MANPATH="/usr/local/man:/usr/local/mysql/man:/usr/local/git/man:$MANPATH"
export GOPATH=$HOME/Code/go
# Colors
export CLICOLOR=1
autoload colors; colors;
export LSCOLORS="Gxfxcxdxbxegedabagacad"
setopt PROMPT_SUBST
# RENV
autoload -U ~/.rbenv/shims
export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
# Timer
REPORTTIME=10 # print elapsed time when more than 10 seconds
# Quote pasted URLs
autoload -U url-quote-magic
zle -N self-insert url-quote-magic
# Tetris
autoload -U tetris
zle -N tetris
bindkey ^T tetris
# Misc options
setopt NO_BG_NICE # don't nice background tasks
setopt NO_HUP
setopt NO_LIST_BEEP
setopt LOCAL_OPTIONS # allow functions to have local options
setopt LOCAL_TRAPS # allow functions to have local traps
setopt COMPLETE_IN_WORD
setopt IGNORE_EOF
| export EDITOR='nano'
# Paths
export PATH="$HOME/bin:$HOME/.rbenv/plugins/ruby-build/bin:/usr/local/heroku/bin:/usr/local/foreman/bin:/usr/local/bin:$HOME/Code/go/bin:/System/Library/CoreServices:$PATH"
export MANPATH="/usr/local/man:/usr/local/mysql/man:/usr/local/git/man:$MANPATH"
export GOPATH=$HOME/Code/go
# Colors
export CLICOLOR=1
autoload colors; colors;
export LSCOLORS="Gxfxcxdxbxegedabagacad"
setopt PROMPT_SUBST
# RENV
autoload -U ~/.rbenv/shims
export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
# Timer
REPORTTIME=10 # print elapsed time when more than 10 seconds
# Quote pasted URLs
autoload -U url-quote-magic
zle -N self-insert url-quote-magic
# Tetris
autoload -U tetris
zle -N tetris
bindkey ^T tetris
# Misc options
setopt NO_BG_NICE # don't nice background tasks
setopt NO_HUP
setopt NO_LIST_BEEP
setopt LOCAL_OPTIONS # allow functions to have local options
setopt LOCAL_TRAPS # allow functions to have local traps
setopt COMPLETE_IN_WORD
setopt IGNORE_EOF
| Update my PATH so @max and @jclem will leave me alone | Update my PATH so @max and @jclem will leave me alone
| Shell | mit | soffes/dotfiles,soffes/dotfiles | shell | ## Code Before:
export EDITOR='nano'
# Paths
export PATH="./bin:$HOME/bin:$HOME/.rbenv/plugins/ruby-build/bin:/usr/local/heroku/bin:/usr/local/foreman/bin:/usr/local/bin:$HOME/Code/go/bin:/Applications/Postgres.app/Contents/Versions/9.3/bin:$PATH"
export MANPATH="/usr/local/man:/usr/local/mysql/man:/usr/local/git/man:$MANPATH"
export GOPATH=$HOME/Code/go
# Colors
export CLICOLOR=1
autoload colors; colors;
export LSCOLORS="Gxfxcxdxbxegedabagacad"
setopt PROMPT_SUBST
# RENV
autoload -U ~/.rbenv/shims
export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
# Timer
REPORTTIME=10 # print elapsed time when more than 10 seconds
# Quote pasted URLs
autoload -U url-quote-magic
zle -N self-insert url-quote-magic
# Tetris
autoload -U tetris
zle -N tetris
bindkey ^T tetris
# Misc options
setopt NO_BG_NICE # don't nice background tasks
setopt NO_HUP
setopt NO_LIST_BEEP
setopt LOCAL_OPTIONS # allow functions to have local options
setopt LOCAL_TRAPS # allow functions to have local traps
setopt COMPLETE_IN_WORD
setopt IGNORE_EOF
## Instruction:
Update my PATH so @max and @jclem will leave me alone
## Code After:
export EDITOR='nano'
# Paths
export PATH="$HOME/bin:$HOME/.rbenv/plugins/ruby-build/bin:/usr/local/heroku/bin:/usr/local/foreman/bin:/usr/local/bin:$HOME/Code/go/bin:/System/Library/CoreServices:$PATH"
export MANPATH="/usr/local/man:/usr/local/mysql/man:/usr/local/git/man:$MANPATH"
export GOPATH=$HOME/Code/go
# Colors
export CLICOLOR=1
autoload colors; colors;
export LSCOLORS="Gxfxcxdxbxegedabagacad"
setopt PROMPT_SUBST
# RENV
autoload -U ~/.rbenv/shims
export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
# Timer
REPORTTIME=10 # print elapsed time when more than 10 seconds
# Quote pasted URLs
autoload -U url-quote-magic
zle -N self-insert url-quote-magic
# Tetris
autoload -U tetris
zle -N tetris
bindkey ^T tetris
# Misc options
setopt NO_BG_NICE # don't nice background tasks
setopt NO_HUP
setopt NO_LIST_BEEP
setopt LOCAL_OPTIONS # allow functions to have local options
setopt LOCAL_TRAPS # allow functions to have local traps
setopt COMPLETE_IN_WORD
setopt IGNORE_EOF
| export EDITOR='nano'
# Paths
- export PATH="./bin:$HOME/bin:$HOME/.rbenv/plugins/ruby-build/bin:/usr/local/heroku/bin:/usr/local/foreman/bin:/usr/local/bin:$HOME/Code/go/bin:/Applications/Postgres.app/Contents/Versions/9.3/bin:$PATH"
? ------ ^^^^^^^^^^^^^^^ ^ --- ^^ ^^ ^^^^^ ------------
+ export PATH="$HOME/bin:$HOME/.rbenv/plugins/ruby-build/bin:/usr/local/heroku/bin:/usr/local/foreman/bin:/usr/local/bin:$HOME/Code/go/bin:/System/Library/CoreServices:$PATH"
? ^^ ^^^^^^ ^^ ^ ^ ++++
export MANPATH="/usr/local/man:/usr/local/mysql/man:/usr/local/git/man:$MANPATH"
export GOPATH=$HOME/Code/go
# Colors
export CLICOLOR=1
autoload colors; colors;
export LSCOLORS="Gxfxcxdxbxegedabagacad"
setopt PROMPT_SUBST
# RENV
autoload -U ~/.rbenv/shims
export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
# Timer
REPORTTIME=10 # print elapsed time when more than 10 seconds
# Quote pasted URLs
autoload -U url-quote-magic
zle -N self-insert url-quote-magic
# Tetris
autoload -U tetris
zle -N tetris
bindkey ^T tetris
# Misc options
setopt NO_BG_NICE # don't nice background tasks
setopt NO_HUP
setopt NO_LIST_BEEP
setopt LOCAL_OPTIONS # allow functions to have local options
setopt LOCAL_TRAPS # allow functions to have local traps
setopt COMPLETE_IN_WORD
setopt IGNORE_EOF | 2 | 0.054054 | 1 | 1 |
29aa1a440a9ff225d3f9a4773f9097a5efcbd0de | test/integration/test_output.py | test/integration/test_output.py | from ..helpers import *
def test_honcho_start_joins_stderr_into_stdout():
ret, out, err = get_honcho_output(['-f', 'Procfile.output', 'start'])
assert_equal(ret, 0)
assert_in('some normal output', out)
assert_in('and then write to stderr', out)
assert_equal(err, '')
def test_honcho_run_keeps_stderr_and_stdout_separate():
ret, out, err = get_honcho_output(['run', 'python', 'output.py'])
assert_equal(ret, 0)
assert_equal(out, 'some normal output\n')
assert_equal(err, 'and then write to stderr\n')
| from ..helpers import *
def test_honcho_start_joins_stderr_into_stdout():
ret, out, err = get_honcho_output(['-f', 'Procfile.output', 'start'])
assert_equal(ret, 0)
assert_regexp_matches(out, r'some normal output')
assert_regexp_matches(out, r'and then write to stderr')
assert_equal(err, '')
def test_honcho_run_keeps_stderr_and_stdout_separate():
ret, out, err = get_honcho_output(['run', 'python', 'output.py'])
assert_equal(ret, 0)
assert_equal(out, 'some normal output\n')
assert_equal(err, 'and then write to stderr\n')
| Rewrite assertions for Python 2.6 compatibility | Rewrite assertions for Python 2.6 compatibility
| Python | mit | janusnic/honcho,xarisd/honcho,myyk/honcho,gratipay/honcho,nickstenning/honcho,nickstenning/honcho,gratipay/honcho | python | ## Code Before:
from ..helpers import *
def test_honcho_start_joins_stderr_into_stdout():
ret, out, err = get_honcho_output(['-f', 'Procfile.output', 'start'])
assert_equal(ret, 0)
assert_in('some normal output', out)
assert_in('and then write to stderr', out)
assert_equal(err, '')
def test_honcho_run_keeps_stderr_and_stdout_separate():
ret, out, err = get_honcho_output(['run', 'python', 'output.py'])
assert_equal(ret, 0)
assert_equal(out, 'some normal output\n')
assert_equal(err, 'and then write to stderr\n')
## Instruction:
Rewrite assertions for Python 2.6 compatibility
## Code After:
from ..helpers import *
def test_honcho_start_joins_stderr_into_stdout():
ret, out, err = get_honcho_output(['-f', 'Procfile.output', 'start'])
assert_equal(ret, 0)
assert_regexp_matches(out, r'some normal output')
assert_regexp_matches(out, r'and then write to stderr')
assert_equal(err, '')
def test_honcho_run_keeps_stderr_and_stdout_separate():
ret, out, err = get_honcho_output(['run', 'python', 'output.py'])
assert_equal(ret, 0)
assert_equal(out, 'some normal output\n')
assert_equal(err, 'and then write to stderr\n')
| from ..helpers import *
def test_honcho_start_joins_stderr_into_stdout():
ret, out, err = get_honcho_output(['-f', 'Procfile.output', 'start'])
assert_equal(ret, 0)
- assert_in('some normal output', out)
- assert_in('and then write to stderr', out)
+ assert_regexp_matches(out, r'some normal output')
+ assert_regexp_matches(out, r'and then write to stderr')
assert_equal(err, '')
def test_honcho_run_keeps_stderr_and_stdout_separate():
ret, out, err = get_honcho_output(['run', 'python', 'output.py'])
assert_equal(ret, 0)
assert_equal(out, 'some normal output\n')
assert_equal(err, 'and then write to stderr\n') | 4 | 0.210526 | 2 | 2 |
da972d2d756b8a6ae81ef064b8a9bf4695b30229 | packages/co/conduit-resumablesink.yaml | packages/co/conduit-resumablesink.yaml | homepage: http://github.com/A1kmm/conduit-resumablesink
changelog-type: ''
hash: 33840b187d07997c9c0c731b0da93751b8d75321bc5595e06d7ac0e493d609d8
test-bench-deps:
void: -any
bytestring: -any
base: -any
hspec: ! '>=1.3'
conduit: -any
conduit-resumablesink: -any
transformers: -any
maintainer: andrew@amxl.com
synopsis: Allows conduit to resume sinks to feed multiple sources into it.
changelog: ''
basic-deps:
void: ! '>=0.6 && <0.7'
base: ! '>=4 && <5'
conduit: ! '>=1.0.5 && <1.1'
all-versions:
- '0.1'
- '0.1.1'
author: Andrew Miller
latest: '0.1.1'
description-type: haddock
description: ! '@conduit-resumablesink@ is a solution to the problem where you have
a @conduit@
sink and you want to feed multiple sources into it as each source is exhausted.
This is essentially the opposite of the ResumableSource functionality supplied
with conduit.'
license-name: BSD3
| homepage: http://github.com/A1kmm/conduit-resumablesink
changelog-type: ''
hash: eb7ac70862310a10038fa178594d6e0c0b03cf1a8c3aa6293fc316871c058b24
test-bench-deps:
void: -any
bytestring: -any
base: -any
hspec: ! '>=1.3'
conduit: -any
conduit-resumablesink: -any
transformers: -any
resourcet: -any
maintainer: andrew@amxl.com
synopsis: Allows conduit to resume sinks to feed multiple sources into it.
changelog: ''
basic-deps:
void: ! '>=0.6 && <0.8'
base: ! '>=4 && <5'
conduit: ! '>=1.2 && <1.3'
all-versions:
- '0.1'
- '0.1.1'
- '0.2'
author: Andrew Miller
latest: '0.2'
description-type: haddock
description: ! '@conduit-resumablesink@ is a solution to the problem where you have
a @conduit@
sink and you want to feed multiple sources into it as each source is exhausted.
This is essentially the opposite of the ResumableSource functionality supplied
with conduit.'
license-name: BSD3
| Update from Hackage at 2017-11-01T08:14:43Z | Update from Hackage at 2017-11-01T08:14:43Z
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: http://github.com/A1kmm/conduit-resumablesink
changelog-type: ''
hash: 33840b187d07997c9c0c731b0da93751b8d75321bc5595e06d7ac0e493d609d8
test-bench-deps:
void: -any
bytestring: -any
base: -any
hspec: ! '>=1.3'
conduit: -any
conduit-resumablesink: -any
transformers: -any
maintainer: andrew@amxl.com
synopsis: Allows conduit to resume sinks to feed multiple sources into it.
changelog: ''
basic-deps:
void: ! '>=0.6 && <0.7'
base: ! '>=4 && <5'
conduit: ! '>=1.0.5 && <1.1'
all-versions:
- '0.1'
- '0.1.1'
author: Andrew Miller
latest: '0.1.1'
description-type: haddock
description: ! '@conduit-resumablesink@ is a solution to the problem where you have
a @conduit@
sink and you want to feed multiple sources into it as each source is exhausted.
This is essentially the opposite of the ResumableSource functionality supplied
with conduit.'
license-name: BSD3
## Instruction:
Update from Hackage at 2017-11-01T08:14:43Z
## Code After:
homepage: http://github.com/A1kmm/conduit-resumablesink
changelog-type: ''
hash: eb7ac70862310a10038fa178594d6e0c0b03cf1a8c3aa6293fc316871c058b24
test-bench-deps:
void: -any
bytestring: -any
base: -any
hspec: ! '>=1.3'
conduit: -any
conduit-resumablesink: -any
transformers: -any
resourcet: -any
maintainer: andrew@amxl.com
synopsis: Allows conduit to resume sinks to feed multiple sources into it.
changelog: ''
basic-deps:
void: ! '>=0.6 && <0.8'
base: ! '>=4 && <5'
conduit: ! '>=1.2 && <1.3'
all-versions:
- '0.1'
- '0.1.1'
- '0.2'
author: Andrew Miller
latest: '0.2'
description-type: haddock
description: ! '@conduit-resumablesink@ is a solution to the problem where you have
a @conduit@
sink and you want to feed multiple sources into it as each source is exhausted.
This is essentially the opposite of the ResumableSource functionality supplied
with conduit.'
license-name: BSD3
| homepage: http://github.com/A1kmm/conduit-resumablesink
changelog-type: ''
- hash: 33840b187d07997c9c0c731b0da93751b8d75321bc5595e06d7ac0e493d609d8
+ hash: eb7ac70862310a10038fa178594d6e0c0b03cf1a8c3aa6293fc316871c058b24
test-bench-deps:
void: -any
bytestring: -any
base: -any
hspec: ! '>=1.3'
conduit: -any
conduit-resumablesink: -any
transformers: -any
+ resourcet: -any
maintainer: andrew@amxl.com
synopsis: Allows conduit to resume sinks to feed multiple sources into it.
changelog: ''
basic-deps:
- void: ! '>=0.6 && <0.7'
? ^
+ void: ! '>=0.6 && <0.8'
? ^
base: ! '>=4 && <5'
- conduit: ! '>=1.0.5 && <1.1'
? ^^^ ^
+ conduit: ! '>=1.2 && <1.3'
? ^ ^
all-versions:
- '0.1'
- '0.1.1'
+ - '0.2'
author: Andrew Miller
- latest: '0.1.1'
? ^^^
+ latest: '0.2'
? ^
description-type: haddock
description: ! '@conduit-resumablesink@ is a solution to the problem where you have
a @conduit@
sink and you want to feed multiple sources into it as each source is exhausted.
This is essentially the opposite of the ResumableSource functionality supplied
with conduit.'
license-name: BSD3 | 10 | 0.30303 | 6 | 4 |
4f0a6ed5d8490eeb9cf056f686c734e83bd90de3 | spec/marker-manager-spec.js | spec/marker-manager-spec.js | /** @babel */
import helpers from './spec-helpers'
import MarkerManager from '../lib/marker-manager'
describe('MarkerManager', () => {
beforeEach(() => {
waitsForPromise(() => {
return helpers.activatePackages()
})
})
describe('addMarkers', () => {
it('verifies that only messages that have a range and a matching file path are marked', () => {
const editor = {
getPath: () => 'foo.tex',
onDidDestroy: () => { return { dispose: () => null } }
}
const manager = new MarkerManager(editor)
const messages = [{
type: 'error',
range: [[0, 0], [0, 1]],
filePath: 'foo.tex'
}, {
type: 'warning',
range: [[0, 0], [0, 1]],
filePath: 'bar.tex'
}, {
type: 'info',
filePath: 'foo.tex'
}]
spyOn(manager, 'addMarker')
manager.addMarkers(messages, false)
expect(manager.addMarker).toHaveBeenCalledWith('error', 'foo.tex', [[0, 0], [0, 1]])
expect(manager.addMarker.calls.length).toEqual(1)
})
})
})
| /** @babel */
import helpers from './spec-helpers'
import MarkerManager from '../lib/marker-manager'
describe('MarkerManager', () => {
beforeEach(() => {
waitsForPromise(() => {
return helpers.activatePackages()
})
})
describe('addMarkers', () => {
let editor, manager
beforeEach(() => {
editor = {
getPath: () => 'foo.tex',
onDidDestroy: () => { return { dispose: () => null } }
}
manager = new MarkerManager(editor)
spyOn(manager, 'addMarker')
spyOn(manager, 'clear')
})
it('verifies that only messages that have a range and a matching file path are marked', () => {
const messages = [{
type: 'error',
range: [[0, 0], [0, 1]],
filePath: 'foo.tex'
}, {
type: 'warning',
range: [[0, 0], [0, 1]],
filePath: 'bar.tex'
}, {
type: 'info',
filePath: 'foo.tex'
}]
manager.addMarkers(messages, false)
expect(manager.addMarker).toHaveBeenCalledWith('error', 'foo.tex', [[0, 0], [0, 1]])
expect(manager.addMarker.calls.length).toEqual(1)
expect(manager.clear).not.toHaveBeenCalled()
})
it('verifies that clear is called when reset flag is set', () => {
manager.addMarkers([], true)
expect(manager.clear).toHaveBeenCalled()
})
})
})
| Add test for reset flag | Add test for reset flag
| JavaScript | mit | thomasjo/atom-latex,thomasjo/atom-latex,thomasjo/atom-latex | javascript | ## Code Before:
/** @babel */
import helpers from './spec-helpers'
import MarkerManager from '../lib/marker-manager'
describe('MarkerManager', () => {
beforeEach(() => {
waitsForPromise(() => {
return helpers.activatePackages()
})
})
describe('addMarkers', () => {
it('verifies that only messages that have a range and a matching file path are marked', () => {
const editor = {
getPath: () => 'foo.tex',
onDidDestroy: () => { return { dispose: () => null } }
}
const manager = new MarkerManager(editor)
const messages = [{
type: 'error',
range: [[0, 0], [0, 1]],
filePath: 'foo.tex'
}, {
type: 'warning',
range: [[0, 0], [0, 1]],
filePath: 'bar.tex'
}, {
type: 'info',
filePath: 'foo.tex'
}]
spyOn(manager, 'addMarker')
manager.addMarkers(messages, false)
expect(manager.addMarker).toHaveBeenCalledWith('error', 'foo.tex', [[0, 0], [0, 1]])
expect(manager.addMarker.calls.length).toEqual(1)
})
})
})
## Instruction:
Add test for reset flag
## Code After:
/** @babel */
import helpers from './spec-helpers'
import MarkerManager from '../lib/marker-manager'
describe('MarkerManager', () => {
beforeEach(() => {
waitsForPromise(() => {
return helpers.activatePackages()
})
})
describe('addMarkers', () => {
let editor, manager
beforeEach(() => {
editor = {
getPath: () => 'foo.tex',
onDidDestroy: () => { return { dispose: () => null } }
}
manager = new MarkerManager(editor)
spyOn(manager, 'addMarker')
spyOn(manager, 'clear')
})
it('verifies that only messages that have a range and a matching file path are marked', () => {
const messages = [{
type: 'error',
range: [[0, 0], [0, 1]],
filePath: 'foo.tex'
}, {
type: 'warning',
range: [[0, 0], [0, 1]],
filePath: 'bar.tex'
}, {
type: 'info',
filePath: 'foo.tex'
}]
manager.addMarkers(messages, false)
expect(manager.addMarker).toHaveBeenCalledWith('error', 'foo.tex', [[0, 0], [0, 1]])
expect(manager.addMarker.calls.length).toEqual(1)
expect(manager.clear).not.toHaveBeenCalled()
})
it('verifies that clear is called when reset flag is set', () => {
manager.addMarkers([], true)
expect(manager.clear).toHaveBeenCalled()
})
})
})
| /** @babel */
import helpers from './spec-helpers'
import MarkerManager from '../lib/marker-manager'
describe('MarkerManager', () => {
beforeEach(() => {
waitsForPromise(() => {
return helpers.activatePackages()
})
})
describe('addMarkers', () => {
- it('verifies that only messages that have a range and a matching file path are marked', () => {
+ let editor, manager
+
+ beforeEach(() => {
- const editor = {
? ------
+ editor = {
getPath: () => 'foo.tex',
onDidDestroy: () => { return { dispose: () => null } }
}
- const manager = new MarkerManager(editor)
? ------
+ manager = new MarkerManager(editor)
+ spyOn(manager, 'addMarker')
+ spyOn(manager, 'clear')
+ })
+
+ it('verifies that only messages that have a range and a matching file path are marked', () => {
const messages = [{
type: 'error',
range: [[0, 0], [0, 1]],
filePath: 'foo.tex'
}, {
type: 'warning',
range: [[0, 0], [0, 1]],
filePath: 'bar.tex'
}, {
type: 'info',
filePath: 'foo.tex'
}]
- spyOn(manager, 'addMarker')
manager.addMarkers(messages, false)
expect(manager.addMarker).toHaveBeenCalledWith('error', 'foo.tex', [[0, 0], [0, 1]])
expect(manager.addMarker.calls.length).toEqual(1)
+ expect(manager.clear).not.toHaveBeenCalled()
+ })
+
+ it('verifies that clear is called when reset flag is set', () => {
+ manager.addMarkers([], true)
+
+ expect(manager.clear).toHaveBeenCalled()
})
})
}) | 21 | 0.525 | 17 | 4 |
56ba5665fce7dbd323952c200289577437e73f5c | components/nav.js | components/nav.js | import React, { Component } from 'react'
import { Link } from 'react-router'
class Nav extends React.Component {
render () {
return (
<nav>
<h1>Welcome to {this.props.title}</h1>
<Link to="/" activeClassName="active">Home</Link>
<Link to="/books" activeClassName="active">Books</Link>
<Link to="/authors" activeClassName="active">Authors</Link>
</nav>
)
}
}
export default Nav
| import React, { Component } from 'react'
import { Link } from 'react-router'
import { IndexLink } from 'react-router'
class Nav extends React.Component {
render () {
return (
<nav>
<h1>Welcome to {this.props.title}</h1>
<IndexLink to="/" activeClassName="active">Home</IndexLink>
<Link to="/books" activeClassName="active">Books</Link>
<Link to="/authors" activeClassName="active">Authors</Link>
</nav>
)
}
}
export default Nav
| Fix index link always active | Fix index link always active
| JavaScript | mit | rich-farr/biblioteca,rich-farr/biblioteca | javascript | ## Code Before:
import React, { Component } from 'react'
import { Link } from 'react-router'
class Nav extends React.Component {
render () {
return (
<nav>
<h1>Welcome to {this.props.title}</h1>
<Link to="/" activeClassName="active">Home</Link>
<Link to="/books" activeClassName="active">Books</Link>
<Link to="/authors" activeClassName="active">Authors</Link>
</nav>
)
}
}
export default Nav
## Instruction:
Fix index link always active
## Code After:
import React, { Component } from 'react'
import { Link } from 'react-router'
import { IndexLink } from 'react-router'
class Nav extends React.Component {
render () {
return (
<nav>
<h1>Welcome to {this.props.title}</h1>
<IndexLink to="/" activeClassName="active">Home</IndexLink>
<Link to="/books" activeClassName="active">Books</Link>
<Link to="/authors" activeClassName="active">Authors</Link>
</nav>
)
}
}
export default Nav
| import React, { Component } from 'react'
import { Link } from 'react-router'
+ import { IndexLink } from 'react-router'
class Nav extends React.Component {
render () {
return (
<nav>
<h1>Welcome to {this.props.title}</h1>
- <Link to="/" activeClassName="active">Home</Link>
+ <IndexLink to="/" activeClassName="active">Home</IndexLink>
? +++++ +++++
<Link to="/books" activeClassName="active">Books</Link>
<Link to="/authors" activeClassName="active">Authors</Link>
</nav>
)
}
}
export default Nav | 3 | 0.166667 | 2 | 1 |
d631274bbf4d2bbc47b853e14354879a492af554 | _config.yml | _config.yml | port: 4004
title: Adventures with my Pi
header-img: img/pi-bg.jpg
email: drmikegardner@gmail.com
copyright_name: Mike Gardner
description: "Documenting projects with my Raspberry Pi"
baseurl: "/raspberrypi"
url: "http://mikegardner.me.uk/pi"
email_username: drmikegardner@gmail.com
# Build settings
markdown: kramdown
highlighter: rouge
permalink: pretty
paginate: 10
exclude: ["less","node_modules","Gruntfile.js","package.json","README.md"]
gems: [jekyll-paginate, jekyll-feed]
| port: 4004
title: Adventures with my Pi
header-img: img/pi-bg.jpg
email: drmikegardner@gmail.com
copyright_name: Mike Gardner
description: "Documenting projects with my Raspberry Pi"
#baseurl: "/raspberrypi"
#url: "http://mikegardner.me.uk/pi"
url: "http://pi.mikegardner.me.uk"
email_username: drmikegardner@gmail.com
# Build settings
markdown: kramdown
highlighter: rouge
permalink: pretty
paginate: 10
exclude: ["less","node_modules","Gruntfile.js","package.json","README.md"]
gems: [jekyll-paginate, jekyll-feed]
| Tweak baser now on custom domain | Tweak baser now on custom domain
| YAML | mit | drmikeuk/raspberrypi,drmikeuk/raspberrypi,drmikeuk/raspberrypi | yaml | ## Code Before:
port: 4004
title: Adventures with my Pi
header-img: img/pi-bg.jpg
email: drmikegardner@gmail.com
copyright_name: Mike Gardner
description: "Documenting projects with my Raspberry Pi"
baseurl: "/raspberrypi"
url: "http://mikegardner.me.uk/pi"
email_username: drmikegardner@gmail.com
# Build settings
markdown: kramdown
highlighter: rouge
permalink: pretty
paginate: 10
exclude: ["less","node_modules","Gruntfile.js","package.json","README.md"]
gems: [jekyll-paginate, jekyll-feed]
## Instruction:
Tweak baser now on custom domain
## Code After:
port: 4004
title: Adventures with my Pi
header-img: img/pi-bg.jpg
email: drmikegardner@gmail.com
copyright_name: Mike Gardner
description: "Documenting projects with my Raspberry Pi"
#baseurl: "/raspberrypi"
#url: "http://mikegardner.me.uk/pi"
url: "http://pi.mikegardner.me.uk"
email_username: drmikegardner@gmail.com
# Build settings
markdown: kramdown
highlighter: rouge
permalink: pretty
paginate: 10
exclude: ["less","node_modules","Gruntfile.js","package.json","README.md"]
gems: [jekyll-paginate, jekyll-feed]
| port: 4004
title: Adventures with my Pi
header-img: img/pi-bg.jpg
email: drmikegardner@gmail.com
copyright_name: Mike Gardner
description: "Documenting projects with my Raspberry Pi"
- baseurl: "/raspberrypi"
+ #baseurl: "/raspberrypi"
? +
- url: "http://mikegardner.me.uk/pi"
+ #url: "http://mikegardner.me.uk/pi"
? +
+ url: "http://pi.mikegardner.me.uk"
email_username: drmikegardner@gmail.com
# Build settings
markdown: kramdown
highlighter: rouge
permalink: pretty
paginate: 10
exclude: ["less","node_modules","Gruntfile.js","package.json","README.md"]
gems: [jekyll-paginate, jekyll-feed] | 5 | 0.277778 | 3 | 2 |
3e43b363701eb1744e9b628e00569231cf91e582 | doc.go | doc.go | // Package vpki provides a layer of abstraction between the golang stdlib
// crypto primitives and common crypto uses (e.g. serving HTTPS) and the
// functionality provided by Vault. Internally, the library generates private
// keys locally and sends CSRs to the vault server, so that private keys are
// never transmitted.
package vpki
| // Package vpki provides a layer of abstraction between the golang stdlib
// crypto primitives and common crypto uses (e.g. serving HTTPS) and the
// functionality provided by Vault. Internally, the library generates private
// keys locally and sends CSRs to the vault server, so that private keys are
// never transmitted.
package vpki // import "astuart.co/vpki"
| Update import statement to only allow single source | Update import statement to only allow single source
| Go | mit | andrewstuart/vpki | go | ## Code Before:
// Package vpki provides a layer of abstraction between the golang stdlib
// crypto primitives and common crypto uses (e.g. serving HTTPS) and the
// functionality provided by Vault. Internally, the library generates private
// keys locally and sends CSRs to the vault server, so that private keys are
// never transmitted.
package vpki
## Instruction:
Update import statement to only allow single source
## Code After:
// Package vpki provides a layer of abstraction between the golang stdlib
// crypto primitives and common crypto uses (e.g. serving HTTPS) and the
// functionality provided by Vault. Internally, the library generates private
// keys locally and sends CSRs to the vault server, so that private keys are
// never transmitted.
package vpki // import "astuart.co/vpki"
| // Package vpki provides a layer of abstraction between the golang stdlib
// crypto primitives and common crypto uses (e.g. serving HTTPS) and the
// functionality provided by Vault. Internally, the library generates private
// keys locally and sends CSRs to the vault server, so that private keys are
// never transmitted.
- package vpki
+ package vpki // import "astuart.co/vpki" | 2 | 0.333333 | 1 | 1 |
c7183dcb977013a3fd1cd2b083054697e2d3f449 | README.md | README.md |
A loan and interest calculation plugin for jQuery.
#### [View Demos](http://accruejs.com)
#### [Documentation](https://github.com/jpederson/Accrue.js/wiki)
*****
### Quick Start
For the most basic usage of the plugin, all you need is the code below. Of course, you may need to adjust src properties based on where you store files, and you'll want to add styles - but the core functionality will be there.
```html
<div class="calculator"></div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="jquery.accrue.min.js"></script>
<script>
$(document).ready(function(){
$(".calculator").accrue();
});
</script>
```
*****
### Contributing
To contribute, you'll need [nodejs](http://nodejs.org/) and [Grunt](http://gruntjs.com/) installed. Fork and clone the repo, then visit the directory in the terminal and type `npm install`. After that you can simply run the `grunt` command to watch the files in the project. It'll automatically lint, test, compile, and minify the plugin files so you can just code.
[](http://gruntjs.com/)
|
A loan and interest calculation plugin for jQuery.
#### [View Demos](http://accruejs.com)
#### [Documentation](https://github.com/jpederson/Accrue.js/wiki)
*****
### Quick Start
For the most basic usage of the plugin, all you need is the code below. Of course, you may need to adjust src properties based on where you store files, and you'll want to add styles - but the core functionality will be there.
```html
<div class="calculator"></div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="jquery.accrue.min.js"></script>
<script>
$(document).ready(function(){
$(".calculator").accrue();
});
</script>
```
*****
### Install Methods
##### Via Github
```
git clone git@github.com:jpederson/Accrue.js.git accruejs
```
##### Via Bower
```
bower install accruejs
```
*****
### Contributing
To contribute, you'll need [nodejs](http://nodejs.org/) and [Grunt](http://gruntjs.com/) installed. Fork and clone the repo, then visit the directory in the terminal and type `npm install`. After that you can simply run the `grunt` command to watch the files in the project. It'll automatically lint, test, compile, and minify the plugin files so you can just code.
[](http://gruntjs.com/)
| Add install methods section to readme now that we have a bower package. | Add install methods section to readme now that we have a bower package.
| Markdown | mit | jpederson/Accrue.js,jpederson/Accrue.js | markdown | ## Code Before:
A loan and interest calculation plugin for jQuery.
#### [View Demos](http://accruejs.com)
#### [Documentation](https://github.com/jpederson/Accrue.js/wiki)
*****
### Quick Start
For the most basic usage of the plugin, all you need is the code below. Of course, you may need to adjust src properties based on where you store files, and you'll want to add styles - but the core functionality will be there.
```html
<div class="calculator"></div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="jquery.accrue.min.js"></script>
<script>
$(document).ready(function(){
$(".calculator").accrue();
});
</script>
```
*****
### Contributing
To contribute, you'll need [nodejs](http://nodejs.org/) and [Grunt](http://gruntjs.com/) installed. Fork and clone the repo, then visit the directory in the terminal and type `npm install`. After that you can simply run the `grunt` command to watch the files in the project. It'll automatically lint, test, compile, and minify the plugin files so you can just code.
[](http://gruntjs.com/)
## Instruction:
Add install methods section to readme now that we have a bower package.
## Code After:
A loan and interest calculation plugin for jQuery.
#### [View Demos](http://accruejs.com)
#### [Documentation](https://github.com/jpederson/Accrue.js/wiki)
*****
### Quick Start
For the most basic usage of the plugin, all you need is the code below. Of course, you may need to adjust src properties based on where you store files, and you'll want to add styles - but the core functionality will be there.
```html
<div class="calculator"></div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="jquery.accrue.min.js"></script>
<script>
$(document).ready(function(){
$(".calculator").accrue();
});
</script>
```
*****
### Install Methods
##### Via Github
```
git clone git@github.com:jpederson/Accrue.js.git accruejs
```
##### Via Bower
```
bower install accruejs
```
*****
### Contributing
To contribute, you'll need [nodejs](http://nodejs.org/) and [Grunt](http://gruntjs.com/) installed. Fork and clone the repo, then visit the directory in the terminal and type `npm install`. After that you can simply run the `grunt` command to watch the files in the project. It'll automatically lint, test, compile, and minify the plugin files so you can just code.
[](http://gruntjs.com/)
|
A loan and interest calculation plugin for jQuery.
#### [View Demos](http://accruejs.com)
#### [Documentation](https://github.com/jpederson/Accrue.js/wiki)
*****
### Quick Start
For the most basic usage of the plugin, all you need is the code below. Of course, you may need to adjust src properties based on where you store files, and you'll want to add styles - but the core functionality will be there.
```html
<div class="calculator"></div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="jquery.accrue.min.js"></script>
<script>
$(document).ready(function(){
$(".calculator").accrue();
});
</script>
```
*****
+ ### Install Methods
+
+ ##### Via Github
+
+ ```
+ git clone git@github.com:jpederson/Accrue.js.git accruejs
+ ```
+
+ ##### Via Bower
+
+ ```
+ bower install accruejs
+ ```
+
+ *****
+
### Contributing
To contribute, you'll need [nodejs](http://nodejs.org/) and [Grunt](http://gruntjs.com/) installed. Fork and clone the repo, then visit the directory in the terminal and type `npm install`. After that you can simply run the `grunt` command to watch the files in the project. It'll automatically lint, test, compile, and minify the plugin files so you can just code.
[](http://gruntjs.com/) | 16 | 0.533333 | 16 | 0 |
fe229049bcf94646945b3fec383d8c8ce278eefb | test/http.js | test/http.js | var assert = require('assert');
var expect = require('chai').expect;
var Fabric = require('../');
var server = new Fabric.HTTP();
describe('HTTP', function () {
before(function (done) {
server.define('Widget', {
properties: {
name: { type: String , maxLength: 100 }
},
routes: {
query: '/widgets',
get: '/widgets/:id'
}
});
server.start(done);
});
after(async function () {
await server.stop();
});
it('should expose a constructor', function () {
assert.equal(typeof Fabric.HTTP, 'function');
});
it('can serve a resource', async function () {
let remote = new Fabric.Remote({
host: 'localhost:3000'
});
let payload = {
name: 'foobar'
};
let vector = new Fabric.Vector(payload);
vector._sign();
let result = await remote._POST('/widgets', payload);
let object = await remote._GET('/widgets');
assert.equal(result['@id'], vector['@id']);
assert.equal(object[0]['@id'], vector['@id']);
});
});
| var assert = require('assert');
var expect = require('chai').expect;
var Fabric = require('../');
var server = new Fabric.HTTP();
describe('HTTP', function () {
before(function (done) {
server.define('Widget', {
properties: {
name: { type: String , maxLength: 100 }
},
routes: {
query: '/widgets',
get: '/widgets/:id'
}
});
server.start(done);
});
after(async function () {
await server.stop();
});
it('should expose a constructor', function () {
assert.equal(typeof Fabric.HTTP, 'function');
});
it('can serve a resource', async function () {
let remote = new Fabric.Remote({
host: 'localhost:3000'
});
let payload = {
name: 'foobar'
};
let vector = new Fabric.Vector(payload);
vector._sign();
let result = await remote._POST('/widgets', payload);
let object = await remote._GET('/widgets');
console.log('result:', result);
console.log('object:', object);
assert.equal(result['@id'], vector['@id']);
assert.equal(object[0]['@id'], vector['@id']);
});
});
| Improve logging for HTTP debug mode | Improve logging for HTTP debug mode
| JavaScript | mit | martindale/fabric,martindale/fabric,martindale/fabric | javascript | ## Code Before:
var assert = require('assert');
var expect = require('chai').expect;
var Fabric = require('../');
var server = new Fabric.HTTP();
describe('HTTP', function () {
before(function (done) {
server.define('Widget', {
properties: {
name: { type: String , maxLength: 100 }
},
routes: {
query: '/widgets',
get: '/widgets/:id'
}
});
server.start(done);
});
after(async function () {
await server.stop();
});
it('should expose a constructor', function () {
assert.equal(typeof Fabric.HTTP, 'function');
});
it('can serve a resource', async function () {
let remote = new Fabric.Remote({
host: 'localhost:3000'
});
let payload = {
name: 'foobar'
};
let vector = new Fabric.Vector(payload);
vector._sign();
let result = await remote._POST('/widgets', payload);
let object = await remote._GET('/widgets');
assert.equal(result['@id'], vector['@id']);
assert.equal(object[0]['@id'], vector['@id']);
});
});
## Instruction:
Improve logging for HTTP debug mode
## Code After:
var assert = require('assert');
var expect = require('chai').expect;
var Fabric = require('../');
var server = new Fabric.HTTP();
describe('HTTP', function () {
before(function (done) {
server.define('Widget', {
properties: {
name: { type: String , maxLength: 100 }
},
routes: {
query: '/widgets',
get: '/widgets/:id'
}
});
server.start(done);
});
after(async function () {
await server.stop();
});
it('should expose a constructor', function () {
assert.equal(typeof Fabric.HTTP, 'function');
});
it('can serve a resource', async function () {
let remote = new Fabric.Remote({
host: 'localhost:3000'
});
let payload = {
name: 'foobar'
};
let vector = new Fabric.Vector(payload);
vector._sign();
let result = await remote._POST('/widgets', payload);
let object = await remote._GET('/widgets');
console.log('result:', result);
console.log('object:', object);
assert.equal(result['@id'], vector['@id']);
assert.equal(object[0]['@id'], vector['@id']);
});
});
| var assert = require('assert');
var expect = require('chai').expect;
var Fabric = require('../');
var server = new Fabric.HTTP();
describe('HTTP', function () {
before(function (done) {
server.define('Widget', {
properties: {
name: { type: String , maxLength: 100 }
},
routes: {
query: '/widgets',
get: '/widgets/:id'
}
});
server.start(done);
});
after(async function () {
await server.stop();
});
it('should expose a constructor', function () {
assert.equal(typeof Fabric.HTTP, 'function');
});
it('can serve a resource', async function () {
let remote = new Fabric.Remote({
host: 'localhost:3000'
});
let payload = {
name: 'foobar'
};
let vector = new Fabric.Vector(payload);
vector._sign();
let result = await remote._POST('/widgets', payload);
let object = await remote._GET('/widgets');
+
+ console.log('result:', result);
+ console.log('object:', object);
assert.equal(result['@id'], vector['@id']);
assert.equal(object[0]['@id'], vector['@id']);
});
}); | 3 | 0.061224 | 3 | 0 |
123bfceab6d88230f1f401ebebde5ffd6a90c924 | requirements.txt | requirements.txt | https://github.com/Balu-Varanasi/django-autoslug/archive/9fb8528a9e2cc2bbad167595b9f7ef0ca1389dbc.zip
django-model-utils>=2.3.1
django-mptt>=0.7.4
factory-boy>=2.5.2
Sphinx>=1.8.5 | django-autoslug>=1.9.6
django-model-utils>=2.3.1
django-mptt>=0.7.4
factory-boy>=2.5.2
Sphinx>=1.8.5 | Use official release of django-autoslug | Use official release of django-autoslug
| Text | bsd-3-clause | ad-m/django-teryt-tree | text | ## Code Before:
https://github.com/Balu-Varanasi/django-autoslug/archive/9fb8528a9e2cc2bbad167595b9f7ef0ca1389dbc.zip
django-model-utils>=2.3.1
django-mptt>=0.7.4
factory-boy>=2.5.2
Sphinx>=1.8.5
## Instruction:
Use official release of django-autoslug
## Code After:
django-autoslug>=1.9.6
django-model-utils>=2.3.1
django-mptt>=0.7.4
factory-boy>=2.5.2
Sphinx>=1.8.5 | - https://github.com/Balu-Varanasi/django-autoslug/archive/9fb8528a9e2cc2bbad167595b9f7ef0ca1389dbc.zip
+ django-autoslug>=1.9.6
django-model-utils>=2.3.1
django-mptt>=0.7.4
factory-boy>=2.5.2
Sphinx>=1.8.5 | 2 | 0.4 | 1 | 1 |
2e500a8a295544619bc1cf60b112e37625374120 | ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk | ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk | LD_FILE = boards/samd21x18-bootloader-external-flash.ld
USB_VID = 0x239A
USB_PID = 0x8023
USB_PRODUCT = "Feather M0 Express"
USB_MANUFACTURER = "Adafruit Industries LLC"
SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C"
LONGINT_IMPL = MPZ
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
CIRCUITPY_NETWORK = 1
MICROPY_PY_WIZNET5K = 5500
CIRCUITPY_FREQUENCYIO = 0
| LD_FILE = boards/samd21x18-bootloader-external-flash.ld
USB_VID = 0x239A
USB_PID = 0x8023
USB_PRODUCT = "Feather M0 Express"
USB_MANUFACTURER = "Adafruit Industries LLC"
SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C"
LONGINT_IMPL = MPZ
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
CFLAGS_INLINE_LIMIT = 70
CIRCUITPY_NETWORK = 1
MICROPY_PY_WIZNET5K = 5500
CIRCUITPY_FREQUENCYIO = 0
| Copy inline setting on feather m0 express that the metro has. | Copy inline setting on feather m0 express that the metro has.
| Makefile | mit | adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/micropython,adafruit/circuitpython,adafruit/micropython,adafruit/circuitpython,adafruit/circuitpython,adafruit/micropython,adafruit/micropython,adafruit/micropython | makefile | ## Code Before:
LD_FILE = boards/samd21x18-bootloader-external-flash.ld
USB_VID = 0x239A
USB_PID = 0x8023
USB_PRODUCT = "Feather M0 Express"
USB_MANUFACTURER = "Adafruit Industries LLC"
SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C"
LONGINT_IMPL = MPZ
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
CIRCUITPY_NETWORK = 1
MICROPY_PY_WIZNET5K = 5500
CIRCUITPY_FREQUENCYIO = 0
## Instruction:
Copy inline setting on feather m0 express that the metro has.
## Code After:
LD_FILE = boards/samd21x18-bootloader-external-flash.ld
USB_VID = 0x239A
USB_PID = 0x8023
USB_PRODUCT = "Feather M0 Express"
USB_MANUFACTURER = "Adafruit Industries LLC"
SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C"
LONGINT_IMPL = MPZ
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
CFLAGS_INLINE_LIMIT = 70
CIRCUITPY_NETWORK = 1
MICROPY_PY_WIZNET5K = 5500
CIRCUITPY_FREQUENCYIO = 0
| LD_FILE = boards/samd21x18-bootloader-external-flash.ld
USB_VID = 0x239A
USB_PID = 0x8023
USB_PRODUCT = "Feather M0 Express"
USB_MANUFACTURER = "Adafruit Industries LLC"
SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C"
LONGINT_IMPL = MPZ
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
+ CFLAGS_INLINE_LIMIT = 70
+
CIRCUITPY_NETWORK = 1
MICROPY_PY_WIZNET5K = 5500
CIRCUITPY_FREQUENCYIO = 0 | 2 | 0.111111 | 2 | 0 |
d75db03f798ffca4cf97b1dead34724983fa19ab | parse-parameter.js | parse-parameter.js | 'use strict';
let moment = require('moment');
let dateTimeFormat = require('./date-time-format');
module.exports = function(value) {
if(value[0] === '@') {
return moment(parseDate(value.slice(1))).format(dateTimeFormat);
}
try {
return JSON.parse(value);
}
catch(error) {
if(value.indexOf(',') !== -1) {
return value.split(',').map(maybeParse);
}
else {
return value;
}
}
};
| 'use strict';
let moment = require('moment');
let dateTimeFormat = require('./date-time-format');
module.exports = exports = function(value) {
if(value[0] === '@') {
return moment(parseDate(value.slice(1))).format(dateTimeFormat);
}
try {
return JSON.parse(value);
}
catch(error) {
if(value.indexOf(',') !== -1) {
return value.split(',').map(exports);
}
else {
return value;
}
}
};
| Fix reference to undeclared variable maybeParse. | Fix reference to undeclared variable maybeParse.
| JavaScript | agpl-3.0 | n2liquid/ev | javascript | ## Code Before:
'use strict';
let moment = require('moment');
let dateTimeFormat = require('./date-time-format');
module.exports = function(value) {
if(value[0] === '@') {
return moment(parseDate(value.slice(1))).format(dateTimeFormat);
}
try {
return JSON.parse(value);
}
catch(error) {
if(value.indexOf(',') !== -1) {
return value.split(',').map(maybeParse);
}
else {
return value;
}
}
};
## Instruction:
Fix reference to undeclared variable maybeParse.
## Code After:
'use strict';
let moment = require('moment');
let dateTimeFormat = require('./date-time-format');
module.exports = exports = function(value) {
if(value[0] === '@') {
return moment(parseDate(value.slice(1))).format(dateTimeFormat);
}
try {
return JSON.parse(value);
}
catch(error) {
if(value.indexOf(',') !== -1) {
return value.split(',').map(exports);
}
else {
return value;
}
}
};
| 'use strict';
let moment = require('moment');
let dateTimeFormat = require('./date-time-format');
- module.exports = function(value) {
+ module.exports = exports = function(value) {
? ++++++++++
if(value[0] === '@') {
return moment(parseDate(value.slice(1))).format(dateTimeFormat);
}
try {
return JSON.parse(value);
}
catch(error) {
if(value.indexOf(',') !== -1) {
- return value.split(',').map(maybeParse);
? ---- ^^ -
+ return value.split(',').map(exports);
? ^^^ +
}
else {
return value;
}
}
}; | 4 | 0.181818 | 2 | 2 |
537630b6dfa1d7b0e85ccdc8c482e2bf13e93d8e | examples/bar_grouped.json | examples/bar_grouped.json | {
"data": {"url": "data/cars.json"},
"mark": "bar",
"encoding": {
"x": {"field": "Origin", "type": "nominal"},
"y": {"field": "Acceleration", "type": "quantitative", "aggregate": "mean"},
"column": {"field": "Cylinders", "type": "ordinal"},
"color": {"field": "Origin", "type": "nominal"}
}
}
| {
"data": {"url": "data/cars.json"},
"mark": "bar",
"encoding": {
"x": {
"field": "Origin",
"type": "nominal",
"axis": {"labels": false,"title": "","tickSize": 0}
},
"y": {
"field": "Acceleration",
"type": "quantitative",
"aggregate": "mean"
},
"column": {"field": "Cylinders","type": "ordinal"},
"color": {"field": "Origin","type": "nominal"}
}
}
| Use labels: false in grouped bar chart example | Use labels: false in grouped bar chart example | JSON | bsd-3-clause | uwdata/vega-lite,vega/vega-lite,vega/vega-lite,vega/vega-lite,uwdata/vega-lite,uwdata/vega-lite,vega/vega-lite,uwdata/vega-lite,uwdata/vega-lite,vega/vega-lite | json | ## Code Before:
{
"data": {"url": "data/cars.json"},
"mark": "bar",
"encoding": {
"x": {"field": "Origin", "type": "nominal"},
"y": {"field": "Acceleration", "type": "quantitative", "aggregate": "mean"},
"column": {"field": "Cylinders", "type": "ordinal"},
"color": {"field": "Origin", "type": "nominal"}
}
}
## Instruction:
Use labels: false in grouped bar chart example
## Code After:
{
"data": {"url": "data/cars.json"},
"mark": "bar",
"encoding": {
"x": {
"field": "Origin",
"type": "nominal",
"axis": {"labels": false,"title": "","tickSize": 0}
},
"y": {
"field": "Acceleration",
"type": "quantitative",
"aggregate": "mean"
},
"column": {"field": "Cylinders","type": "ordinal"},
"color": {"field": "Origin","type": "nominal"}
}
}
| {
"data": {"url": "data/cars.json"},
"mark": "bar",
"encoding": {
- "x": {"field": "Origin", "type": "nominal"},
- "y": {"field": "Acceleration", "type": "quantitative", "aggregate": "mean"},
+ "x": {
+ "field": "Origin",
+ "type": "nominal",
+ "axis": {"labels": false,"title": "","tickSize": 0}
+ },
+ "y": {
+ "field": "Acceleration",
+ "type": "quantitative",
+ "aggregate": "mean"
+ },
- "column": {"field": "Cylinders", "type": "ordinal"},
? -
+ "column": {"field": "Cylinders","type": "ordinal"},
- "color": {"field": "Origin", "type": "nominal"}
? -
+ "color": {"field": "Origin","type": "nominal"}
}
} | 16 | 1.6 | 12 | 4 |
a7c3e1432ecc299bda297185ed4ce39348e2c405 | lib/recent_store.rb | lib/recent_store.rb | require 'sequel'
require 'base64'
require_relative 'db'
unless DB.table_exists?(:library_stores)
DB.create_table(:library_stores) do
String :name, primary_key: true
String :source
String :versions
DateTime :created_at
end
end
class LibraryStore < Sequel::Model(DB)
plugin :serialization, :json, :versions
end
LibraryStore.unrestrict_primary_key
class RecentStore
def initialize(maxsize = 20)
@maxsize = maxsize
end
def push(library_versions)
library_name = library_versions.first.name
unless LibraryStore[library_name]
LibraryStore.create(
name: library_name,
versions: library_versions,
source: 'github',
created_at: Time.now)
end
end
def size
LibraryStore.count
end
def each(&block)
LibraryStore.select.order(Sequel.desc(:created_at)).limit(@maxsize).all.each(&block)
end
end
| require 'sequel'
require 'base64'
require_relative 'db'
unless DB.table_exists?(:library_stores)
DB.create_table(:library_stores) do
String :name, primary_key: true
String :source
String :versions
DateTime :created_at
end
end
class LibraryStore < Sequel::Model(DB)
plugin :serialization, :json, :versions
end
LibraryStore.unrestrict_primary_key
class RecentStore
def initialize(maxsize = 20)
@maxsize = maxsize
end
def push(library_versions)
library_name = library_versions.first.name
unless LibraryStore[library_name]
LibraryStore.create(
name: library_name,
versions: library_versions,
source: 'github',
created_at: Time.now)
end
end
def size
LibraryStore.count
end
def each(&block)
LibraryStore.select.order(Sequel.desc(:created_at)).limit(@maxsize).all.each do |row|
yield row.name, to_versions(row)
end
end
private
def to_versions(row)
return nil unless row
row.versions.split(" ").map do |v|
ver, platform = *v.split(',')
lib = YARD::Server::LibraryVersion.new(row.name, ver, nil, :github)
lib.platform = platform
lib
end
end
end
| Fix GitHub versions on recent store | Fix GitHub versions on recent store
| Ruby | mit | docmeta/rubydoc.info,docmeta/rubydoc.info,docmeta/rubydoc.info,docmeta/rubydoc.info | ruby | ## Code Before:
require 'sequel'
require 'base64'
require_relative 'db'
unless DB.table_exists?(:library_stores)
DB.create_table(:library_stores) do
String :name, primary_key: true
String :source
String :versions
DateTime :created_at
end
end
class LibraryStore < Sequel::Model(DB)
plugin :serialization, :json, :versions
end
LibraryStore.unrestrict_primary_key
class RecentStore
def initialize(maxsize = 20)
@maxsize = maxsize
end
def push(library_versions)
library_name = library_versions.first.name
unless LibraryStore[library_name]
LibraryStore.create(
name: library_name,
versions: library_versions,
source: 'github',
created_at: Time.now)
end
end
def size
LibraryStore.count
end
def each(&block)
LibraryStore.select.order(Sequel.desc(:created_at)).limit(@maxsize).all.each(&block)
end
end
## Instruction:
Fix GitHub versions on recent store
## Code After:
require 'sequel'
require 'base64'
require_relative 'db'
unless DB.table_exists?(:library_stores)
DB.create_table(:library_stores) do
String :name, primary_key: true
String :source
String :versions
DateTime :created_at
end
end
class LibraryStore < Sequel::Model(DB)
plugin :serialization, :json, :versions
end
LibraryStore.unrestrict_primary_key
class RecentStore
def initialize(maxsize = 20)
@maxsize = maxsize
end
def push(library_versions)
library_name = library_versions.first.name
unless LibraryStore[library_name]
LibraryStore.create(
name: library_name,
versions: library_versions,
source: 'github',
created_at: Time.now)
end
end
def size
LibraryStore.count
end
def each(&block)
LibraryStore.select.order(Sequel.desc(:created_at)).limit(@maxsize).all.each do |row|
yield row.name, to_versions(row)
end
end
private
def to_versions(row)
return nil unless row
row.versions.split(" ").map do |v|
ver, platform = *v.split(',')
lib = YARD::Server::LibraryVersion.new(row.name, ver, nil, :github)
lib.platform = platform
lib
end
end
end
| require 'sequel'
require 'base64'
require_relative 'db'
unless DB.table_exists?(:library_stores)
DB.create_table(:library_stores) do
String :name, primary_key: true
String :source
String :versions
DateTime :created_at
end
end
class LibraryStore < Sequel::Model(DB)
plugin :serialization, :json, :versions
end
LibraryStore.unrestrict_primary_key
class RecentStore
def initialize(maxsize = 20)
@maxsize = maxsize
end
def push(library_versions)
library_name = library_versions.first.name
unless LibraryStore[library_name]
LibraryStore.create(
name: library_name,
versions: library_versions,
source: 'github',
created_at: Time.now)
end
end
def size
LibraryStore.count
end
def each(&block)
- LibraryStore.select.order(Sequel.desc(:created_at)).limit(@maxsize).all.each(&block)
? ^^^^ ^^^
+ LibraryStore.select.order(Sequel.desc(:created_at)).limit(@maxsize).all.each do |row|
? ^^ ^^^^^^
+ yield row.name, to_versions(row)
+ end
+ end
+
+ private
+
+ def to_versions(row)
+ return nil unless row
+ row.versions.split(" ").map do |v|
+ ver, platform = *v.split(',')
+ lib = YARD::Server::LibraryVersion.new(row.name, ver, nil, :github)
+ lib.platform = platform
+ lib
+ end
end
end | 16 | 0.372093 | 15 | 1 |
db3c996cef0abc45be7032202cd8557d7d5e87d2 | src/util/xmlUtil.ml | src/util/xmlUtil.ml | (* XML escape extracted here to avoid dependency cycle:
CilType -> Goblintutil -> GobConfig -> Tracing -> Node -> CilType *)
let escape (x:string):string =
(* Safe to escape all these everywhere in XML: https://stackoverflow.com/a/1091953/854540 *)
Str.global_replace (Str.regexp "&") "&" x |>
Str.global_replace (Str.regexp "<") "<" |>
Str.global_replace (Str.regexp ">") ">" |>
Str.global_replace (Str.regexp "\"") """ |>
Str.global_replace (Str.regexp "'") "'" |>
Str.global_replace (Str.regexp "[\x0b\001\x0c\x0f\x0e]") "" (* g2html just cannot handle from some kernel benchmarks, even when escaped... *)
| (* XML escape extracted here to avoid dependency cycle:
CilType -> Goblintutil -> GobConfig -> Tracing -> Node -> CilType *)
let escape (x:string):string =
(* Safe to escape all these everywhere in XML: https://stackoverflow.com/a/1091953/854540 *)
Str.global_replace (Str.regexp "&") "&" x |>
Str.global_replace (Str.regexp "<") "<" |>
Str.global_replace (Str.regexp ">") ">" |>
Str.global_replace (Str.regexp "\"") """ |>
Str.global_replace (Str.regexp "'") "'" |>
Str.global_replace (Str.regexp "[\x0b\001\x0c\x0f\x0e]") "" |> (* g2html just cannot handle from some kernel benchmarks, even when escaped... *)
Str.global_replace (Str.regexp "[\x1b]") "" (* g2html cannot handle from chrony *)
| Add \x1b escape to XmlUtil for chrony | Add \x1b escape to XmlUtil for chrony
| OCaml | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer | ocaml | ## Code Before:
(* XML escape extracted here to avoid dependency cycle:
CilType -> Goblintutil -> GobConfig -> Tracing -> Node -> CilType *)
let escape (x:string):string =
(* Safe to escape all these everywhere in XML: https://stackoverflow.com/a/1091953/854540 *)
Str.global_replace (Str.regexp "&") "&" x |>
Str.global_replace (Str.regexp "<") "<" |>
Str.global_replace (Str.regexp ">") ">" |>
Str.global_replace (Str.regexp "\"") """ |>
Str.global_replace (Str.regexp "'") "'" |>
Str.global_replace (Str.regexp "[\x0b\001\x0c\x0f\x0e]") "" (* g2html just cannot handle from some kernel benchmarks, even when escaped... *)
## Instruction:
Add \x1b escape to XmlUtil for chrony
## Code After:
(* XML escape extracted here to avoid dependency cycle:
CilType -> Goblintutil -> GobConfig -> Tracing -> Node -> CilType *)
let escape (x:string):string =
(* Safe to escape all these everywhere in XML: https://stackoverflow.com/a/1091953/854540 *)
Str.global_replace (Str.regexp "&") "&" x |>
Str.global_replace (Str.regexp "<") "<" |>
Str.global_replace (Str.regexp ">") ">" |>
Str.global_replace (Str.regexp "\"") """ |>
Str.global_replace (Str.regexp "'") "'" |>
Str.global_replace (Str.regexp "[\x0b\001\x0c\x0f\x0e]") "" |> (* g2html just cannot handle from some kernel benchmarks, even when escaped... *)
Str.global_replace (Str.regexp "[\x1b]") "" (* g2html cannot handle from chrony *)
| (* XML escape extracted here to avoid dependency cycle:
CilType -> Goblintutil -> GobConfig -> Tracing -> Node -> CilType *)
let escape (x:string):string =
(* Safe to escape all these everywhere in XML: https://stackoverflow.com/a/1091953/854540 *)
Str.global_replace (Str.regexp "&") "&" x |>
Str.global_replace (Str.regexp "<") "<" |>
Str.global_replace (Str.regexp ">") ">" |>
Str.global_replace (Str.regexp "\"") """ |>
Str.global_replace (Str.regexp "'") "'" |>
- Str.global_replace (Str.regexp "[\x0b\001\x0c\x0f\x0e]") "" (* g2html just cannot handle from some kernel benchmarks, even when escaped... *)
+ Str.global_replace (Str.regexp "[\x0b\001\x0c\x0f\x0e]") "" |> (* g2html just cannot handle from some kernel benchmarks, even when escaped... *)
? +++
+ Str.global_replace (Str.regexp "[\x1b]") "" (* g2html cannot handle from chrony *) | 3 | 0.272727 | 2 | 1 |
e166096663af9d4b13b2cf20ae4e412143599813 | javascripts/custom/ajax.js | javascripts/custom/ajax.js | // Define DrupalAjaxRequest
var DrupalAjaxRequest = (function () {
var fetch = function(feed_id, callback) {
Zepto.ajax(
{
url: Kiosk.contentUrl(feed_id),
dataType: 'jsonp',
type: 'GET',
cache: false,
success: function (result) {
callback(result);
}
}
);
}
return {
fetch : fetch
}
})(); | // Define DrupalAjaxRequest
var DrupalAjaxRequest = (function () {
var fetchNode = function(node_id, callback) {
Zepto.ajax(
{
url: Kiosk.contentUrl('node'),
dataType: 'jsonp',
data: {nid: node_id},
type: 'GET',
cache: false,
success: function (result) {
callback(result);
}
}
);
}
var fetchCollections = function(callback) {
Zepto.ajax(
{
url: Kiosk.contentUrl('collections'),
dataType: 'jsonp',
type: 'GET',
cache: false,
success: function (result) {
callback(result);
}
}
);
}
return {
fetchNode : fetchNode,
fetchCollections: fetchCollections
}
})(); | Add a method for fetching a node, and collections list (artifacts). | Add a method for fetching a node, and collections list (artifacts).
| JavaScript | mit | historiclewes/pilots-kiosk,historiclewes/pilots-kiosk,historiclewes/pilots-kiosk | javascript | ## Code Before:
// Define DrupalAjaxRequest
var DrupalAjaxRequest = (function () {
var fetch = function(feed_id, callback) {
Zepto.ajax(
{
url: Kiosk.contentUrl(feed_id),
dataType: 'jsonp',
type: 'GET',
cache: false,
success: function (result) {
callback(result);
}
}
);
}
return {
fetch : fetch
}
})();
## Instruction:
Add a method for fetching a node, and collections list (artifacts).
## Code After:
// Define DrupalAjaxRequest
var DrupalAjaxRequest = (function () {
var fetchNode = function(node_id, callback) {
Zepto.ajax(
{
url: Kiosk.contentUrl('node'),
dataType: 'jsonp',
data: {nid: node_id},
type: 'GET',
cache: false,
success: function (result) {
callback(result);
}
}
);
}
var fetchCollections = function(callback) {
Zepto.ajax(
{
url: Kiosk.contentUrl('collections'),
dataType: 'jsonp',
type: 'GET',
cache: false,
success: function (result) {
callback(result);
}
}
);
}
return {
fetchNode : fetchNode,
fetchCollections: fetchCollections
}
})(); | // Define DrupalAjaxRequest
var DrupalAjaxRequest = (function () {
- var fetch = function(feed_id, callback) {
? ^ --
+ var fetchNode = function(node_id, callback) {
? ++++ ^^^
Zepto.ajax(
- {
? --
+ {
- url: Kiosk.contentUrl(feed_id),
? -- ^ ^^^^^
+ url: Kiosk.contentUrl('node'),
? ^^^^ ^
- dataType: 'jsonp',
? --
+ dataType: 'jsonp',
+ data: {nid: node_id},
- type: 'GET',
? --
+ type: 'GET',
- cache: false,
? --
+ cache: false,
- success: function (result) {
? --
+ success: function (result) {
- callback(result);
? --
+ callback(result);
- }
}
+ }
+ );
+ }
+
+ var fetchCollections = function(callback) {
+ Zepto.ajax(
+ {
+ url: Kiosk.contentUrl('collections'),
+ dataType: 'jsonp',
+ type: 'GET',
+ cache: false,
+ success: function (result) {
+ callback(result);
+ }
+ }
);
}
return {
- fetch : fetch
+ fetchNode : fetchNode,
? ++++ +++++
+ fetchCollections: fetchCollections
}
})(); | 36 | 1.8 | 26 | 10 |
a23d44d3acc633ffdebed76b6f7fcc9322a72983 | src/package.json | src/package.json | {
"name": "StyledElements",
"private": true,
"devDependencies": {
"grunt": "~0.4.5",
"grunt-contrib-jshint": "^1.0.0",
"grunt-contrib-uglify": "~0.9.1",
"grunt-jscs": "^2.8.0",
"grunt-jsdoc": "^2.1.0",
"grunt-karma": "^2.0.0",
"karma": "^1.1.0",
"karma-chrome-launcher": "^1.0.1",
"karma-coverage": "^1.0.0",
"karma-firefox-launcher": "^1.0.0",
"karma-jasmine": "^1.0.2"
}
}
| {
"name": "StyledElements",
"private": true,
"devDependencies": {
"grunt": "~0.4.5",
"grunt-contrib-jshint": "^1.0.0",
"grunt-contrib-uglify": "~0.9.1",
"grunt-jscs": "^2.8.0",
"grunt-jsdoc": "^2.1.0",
"grunt-karma": "^2.0.0",
"jasmine-core": "<2.5.0",
"karma": "^1.1.0",
"karma-chrome-launcher": "^1.0.1",
"karma-coverage": "^1.0.0",
"karma-firefox-launcher": "^1.0.0",
"karma-jasmine": "^1.0.2"
}
}
| Use Jasmine version less than 2.5 | Use Jasmine version less than 2.5
| JSON | agpl-3.0 | jpajuelo/wirecloud,jpajuelo/wirecloud,jpajuelo/wirecloud,jpajuelo/wirecloud | json | ## Code Before:
{
"name": "StyledElements",
"private": true,
"devDependencies": {
"grunt": "~0.4.5",
"grunt-contrib-jshint": "^1.0.0",
"grunt-contrib-uglify": "~0.9.1",
"grunt-jscs": "^2.8.0",
"grunt-jsdoc": "^2.1.0",
"grunt-karma": "^2.0.0",
"karma": "^1.1.0",
"karma-chrome-launcher": "^1.0.1",
"karma-coverage": "^1.0.0",
"karma-firefox-launcher": "^1.0.0",
"karma-jasmine": "^1.0.2"
}
}
## Instruction:
Use Jasmine version less than 2.5
## Code After:
{
"name": "StyledElements",
"private": true,
"devDependencies": {
"grunt": "~0.4.5",
"grunt-contrib-jshint": "^1.0.0",
"grunt-contrib-uglify": "~0.9.1",
"grunt-jscs": "^2.8.0",
"grunt-jsdoc": "^2.1.0",
"grunt-karma": "^2.0.0",
"jasmine-core": "<2.5.0",
"karma": "^1.1.0",
"karma-chrome-launcher": "^1.0.1",
"karma-coverage": "^1.0.0",
"karma-firefox-launcher": "^1.0.0",
"karma-jasmine": "^1.0.2"
}
}
| {
"name": "StyledElements",
"private": true,
"devDependencies": {
"grunt": "~0.4.5",
"grunt-contrib-jshint": "^1.0.0",
"grunt-contrib-uglify": "~0.9.1",
"grunt-jscs": "^2.8.0",
"grunt-jsdoc": "^2.1.0",
"grunt-karma": "^2.0.0",
+ "jasmine-core": "<2.5.0",
"karma": "^1.1.0",
"karma-chrome-launcher": "^1.0.1",
"karma-coverage": "^1.0.0",
"karma-firefox-launcher": "^1.0.0",
"karma-jasmine": "^1.0.2"
}
} | 1 | 0.058824 | 1 | 0 |
0a4c74449dccd97c187b0d3779ccd1d8f87d3d77 | package.json | package.json | {
"name": "expect-the-unexpected",
"version": "0.0.2",
"main": "index.js",
"scripts": {
"test": "mocha",
"coverage": "NODE_ENV=development istanbul cover --include-all-sources _mocha -- --reporter dot"
},
"author": "Gustav Nikolaj <gustavnikolaj@gmail.com>",
"contributors": [
"Sune Simonsen <sune@we-knowhow.dk>"
],
"repository": {
"type": "git",
"url": "http://github.com/gustavnikolaj/expect-the-unexpected.git"
},
"license": "ISC",
"dependencies": {
"unexpected": "5.1.6"
},
"devDependencies": {
"istanbul": "0.3.5",
"mocha": "2.1.0"
}
}
| {
"name": "expect-the-unexpected",
"version": "0.0.2",
"main": "index.js",
"scripts": {
"test": "mocha",
"coverage": "NODE_ENV=development istanbul cover --include-all-sources _mocha -- --reporter dot"
},
"author": "Gustav Nikolaj <gustavnikolaj@gmail.com>",
"contributors": [
"Sune Simonsen <sune@we-knowhow.dk>"
],
"repository": {
"type": "git",
"url": "http://github.com/gustavnikolaj/expect-the-unexpected.git"
},
"license": "ISC",
"peerDependencies": {
"unexpected": "5"
},
"devDependencies": {
"istanbul": "0.3.5",
"mocha": "2.1.0",
"unexpected": "5.1.6"
}
}
| Make unexpected a peer dependency | Make unexpected a peer dependency
| JSON | isc | unexpectedjs/expect-the-unexpected | json | ## Code Before:
{
"name": "expect-the-unexpected",
"version": "0.0.2",
"main": "index.js",
"scripts": {
"test": "mocha",
"coverage": "NODE_ENV=development istanbul cover --include-all-sources _mocha -- --reporter dot"
},
"author": "Gustav Nikolaj <gustavnikolaj@gmail.com>",
"contributors": [
"Sune Simonsen <sune@we-knowhow.dk>"
],
"repository": {
"type": "git",
"url": "http://github.com/gustavnikolaj/expect-the-unexpected.git"
},
"license": "ISC",
"dependencies": {
"unexpected": "5.1.6"
},
"devDependencies": {
"istanbul": "0.3.5",
"mocha": "2.1.0"
}
}
## Instruction:
Make unexpected a peer dependency
## Code After:
{
"name": "expect-the-unexpected",
"version": "0.0.2",
"main": "index.js",
"scripts": {
"test": "mocha",
"coverage": "NODE_ENV=development istanbul cover --include-all-sources _mocha -- --reporter dot"
},
"author": "Gustav Nikolaj <gustavnikolaj@gmail.com>",
"contributors": [
"Sune Simonsen <sune@we-knowhow.dk>"
],
"repository": {
"type": "git",
"url": "http://github.com/gustavnikolaj/expect-the-unexpected.git"
},
"license": "ISC",
"peerDependencies": {
"unexpected": "5"
},
"devDependencies": {
"istanbul": "0.3.5",
"mocha": "2.1.0",
"unexpected": "5.1.6"
}
}
| {
"name": "expect-the-unexpected",
"version": "0.0.2",
"main": "index.js",
"scripts": {
"test": "mocha",
"coverage": "NODE_ENV=development istanbul cover --include-all-sources _mocha -- --reporter dot"
},
"author": "Gustav Nikolaj <gustavnikolaj@gmail.com>",
"contributors": [
"Sune Simonsen <sune@we-knowhow.dk>"
],
"repository": {
"type": "git",
"url": "http://github.com/gustavnikolaj/expect-the-unexpected.git"
},
"license": "ISC",
- "dependencies": {
? ^
+ "peerDependencies": {
? ^^^^^
- "unexpected": "5.1.6"
? ----
+ "unexpected": "5"
},
"devDependencies": {
"istanbul": "0.3.5",
- "mocha": "2.1.0"
+ "mocha": "2.1.0",
? +
+ "unexpected": "5.1.6"
}
} | 7 | 0.28 | 4 | 3 |
03aec4e07969d008a9eabc19f33b27f859a8dfaf | contact.html | contact.html | <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style.css"/>
<title>Contact - Grapher Program Website</title>
</head>
<body>
<div class="container">
<ul class="header_ul">
<li class="header_li"><a class="button" title="Home" href="index.html">Home</a></li>
<li class="header_li"><a class="button" title="Tutorial" href="tutorial.html">Tutorial</a></li>
<li class="header_li"><a class="button" title="Download" href="download.html">Download</a></li>
<li class="header_li"><a class="button" title="Changelog" href="changelog.html">Changelog</a></li>
<li class="header_li"><a class="button" title="Contact" href="contact.html">Contact</a></li>
</ul>
<div class="content">
<h1>Contact</h1>
<p>To contact me, send e-mail to <a href="mailto:superlala32@gmail.com" target="_top">
superlala32@gmail.com</a></p>
</div>
</div>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style.css"/>
<title>Contact - Grapher Program Website</title>
</head>
<body>
<div class="container">
<ul class="header_ul">
<li class="header_li"><a class="button" title="Home" href="index.html">Home</a></li>
<li class="header_li"><a class="button" title="Tutorial" href="tutorial.html">Tutorial</a></li>
<li class="header_li"><a class="button" title="Download" href="download.html">Download</a></li>
<li class="header_li"><a class="button" title="Changelog" href="changelog.html">Changelog</a></li>
<li class="header_li"><a class="button" title="Contact" href="contact.html">Contact</a></li>
</ul>
<div class="content">
<h1>Contact</h1>
<p>To contact me, send e-mail to <a href="mailto:patrick@patowen.net" target="_top">
superlala32@gmail.com</a></p>
</div>
</div>
</body>
</html>
| Switch to a less strange e-mail address | Switch to a less strange e-mail address
| HTML | mit | patowen/patowen.github.io,patowen/patowen.github.io | html | ## Code Before:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style.css"/>
<title>Contact - Grapher Program Website</title>
</head>
<body>
<div class="container">
<ul class="header_ul">
<li class="header_li"><a class="button" title="Home" href="index.html">Home</a></li>
<li class="header_li"><a class="button" title="Tutorial" href="tutorial.html">Tutorial</a></li>
<li class="header_li"><a class="button" title="Download" href="download.html">Download</a></li>
<li class="header_li"><a class="button" title="Changelog" href="changelog.html">Changelog</a></li>
<li class="header_li"><a class="button" title="Contact" href="contact.html">Contact</a></li>
</ul>
<div class="content">
<h1>Contact</h1>
<p>To contact me, send e-mail to <a href="mailto:superlala32@gmail.com" target="_top">
superlala32@gmail.com</a></p>
</div>
</div>
</body>
</html>
## Instruction:
Switch to a less strange e-mail address
## Code After:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style.css"/>
<title>Contact - Grapher Program Website</title>
</head>
<body>
<div class="container">
<ul class="header_ul">
<li class="header_li"><a class="button" title="Home" href="index.html">Home</a></li>
<li class="header_li"><a class="button" title="Tutorial" href="tutorial.html">Tutorial</a></li>
<li class="header_li"><a class="button" title="Download" href="download.html">Download</a></li>
<li class="header_li"><a class="button" title="Changelog" href="changelog.html">Changelog</a></li>
<li class="header_li"><a class="button" title="Contact" href="contact.html">Contact</a></li>
</ul>
<div class="content">
<h1>Contact</h1>
<p>To contact me, send e-mail to <a href="mailto:patrick@patowen.net" target="_top">
superlala32@gmail.com</a></p>
</div>
</div>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style.css"/>
<title>Contact - Grapher Program Website</title>
</head>
<body>
<div class="container">
<ul class="header_ul">
<li class="header_li"><a class="button" title="Home" href="index.html">Home</a></li>
<li class="header_li"><a class="button" title="Tutorial" href="tutorial.html">Tutorial</a></li>
<li class="header_li"><a class="button" title="Download" href="download.html">Download</a></li>
<li class="header_li"><a class="button" title="Changelog" href="changelog.html">Changelog</a></li>
<li class="header_li"><a class="button" title="Contact" href="contact.html">Contact</a></li>
</ul>
<div class="content">
<h1>Contact</h1>
- <p>To contact me, send e-mail to <a href="mailto:superlala32@gmail.com" target="_top">
? -- ^^^^^^^^^^^^^ ^^^
+ <p>To contact me, send e-mail to <a href="mailto:patrick@patowen.net" target="_top">
? ++++++++++++ ^ ^^^
superlala32@gmail.com</a></p>
</div>
</div>
</body>
</html> | 2 | 0.066667 | 1 | 1 |
cb3a51bd38548a67a0d28a57523c98536cd23c5e | example-usage/main.go | example-usage/main.go | package main
import (
"github.com/Sirupsen/logrus"
"github.com/rogierlommers/logrus-redis-hook"
)
func init() {
hook, err := logredis.NewHook("localhost",
"my_redis_key", // key to use
"v0", // logstash format (v0, v1 or custom)
"my_app_name", // your application name
"my_hostname", // your hostname
"", // password for redis authentication, leave empty for no authentication
6379, // redis port
)
if err == nil {
logrus.AddHook(hook)
} else {
logrus.Error(err)
}
}
func main() {
// when hook is injected succesfully, logs will be send to redis server
logrus.Info("just some info logging...")
// we also support log.WithFields()
logrus.WithFields(logrus.Fields{"animal": "walrus",
"foo": "bar",
"this": "that"}).
Info("A walrus appears")
}
| package main
import (
"io/ioutil"
"github.com/Sirupsen/logrus"
"github.com/rogierlommers/logrus-redis-hook"
)
func init() {
hook, err := logredis.NewHook("localhost",
"my_redis_key", // key to use
"v0", // logstash format (v0, v1 or custom)
"my_app_name", // your application name
"my_hostname", // your hostname
"", // password for redis authentication, leave empty for no authentication
6379, // redis port
)
if err == nil {
logrus.AddHook(hook)
} else {
logrus.Error(err)
}
}
func main() {
// when hook is injected succesfully, logs will be send to redis server
logrus.Info("just some info logging...")
// we also support log.WithFields()
logrus.WithFields(logrus.Fields{"animal": "walrus",
"foo": "bar",
"this": "that"}).
Info("A walrus appears")
// If you want to disable writing to stdout, use setOutput
logrus.SetOutput(ioutil.Discard)
logrus.Info("This will only be sent to Redis")
}
| Add example to stop logging to stdout | Add example to stop logging to stdout
| Go | mit | rogierlommers/logrus-redis-hook | go | ## Code Before:
package main
import (
"github.com/Sirupsen/logrus"
"github.com/rogierlommers/logrus-redis-hook"
)
func init() {
hook, err := logredis.NewHook("localhost",
"my_redis_key", // key to use
"v0", // logstash format (v0, v1 or custom)
"my_app_name", // your application name
"my_hostname", // your hostname
"", // password for redis authentication, leave empty for no authentication
6379, // redis port
)
if err == nil {
logrus.AddHook(hook)
} else {
logrus.Error(err)
}
}
func main() {
// when hook is injected succesfully, logs will be send to redis server
logrus.Info("just some info logging...")
// we also support log.WithFields()
logrus.WithFields(logrus.Fields{"animal": "walrus",
"foo": "bar",
"this": "that"}).
Info("A walrus appears")
}
## Instruction:
Add example to stop logging to stdout
## Code After:
package main
import (
"io/ioutil"
"github.com/Sirupsen/logrus"
"github.com/rogierlommers/logrus-redis-hook"
)
func init() {
hook, err := logredis.NewHook("localhost",
"my_redis_key", // key to use
"v0", // logstash format (v0, v1 or custom)
"my_app_name", // your application name
"my_hostname", // your hostname
"", // password for redis authentication, leave empty for no authentication
6379, // redis port
)
if err == nil {
logrus.AddHook(hook)
} else {
logrus.Error(err)
}
}
func main() {
// when hook is injected succesfully, logs will be send to redis server
logrus.Info("just some info logging...")
// we also support log.WithFields()
logrus.WithFields(logrus.Fields{"animal": "walrus",
"foo": "bar",
"this": "that"}).
Info("A walrus appears")
// If you want to disable writing to stdout, use setOutput
logrus.SetOutput(ioutil.Discard)
logrus.Info("This will only be sent to Redis")
}
| package main
import (
+ "io/ioutil"
+
"github.com/Sirupsen/logrus"
"github.com/rogierlommers/logrus-redis-hook"
)
func init() {
hook, err := logredis.NewHook("localhost",
"my_redis_key", // key to use
"v0", // logstash format (v0, v1 or custom)
"my_app_name", // your application name
"my_hostname", // your hostname
"", // password for redis authentication, leave empty for no authentication
6379, // redis port
)
if err == nil {
logrus.AddHook(hook)
} else {
logrus.Error(err)
}
}
func main() {
// when hook is injected succesfully, logs will be send to redis server
logrus.Info("just some info logging...")
// we also support log.WithFields()
logrus.WithFields(logrus.Fields{"animal": "walrus",
"foo": "bar",
"this": "that"}).
Info("A walrus appears")
+
+ // If you want to disable writing to stdout, use setOutput
+ logrus.SetOutput(ioutil.Discard)
+ logrus.Info("This will only be sent to Redis")
} | 6 | 0.181818 | 6 | 0 |
8626733d3a4960013189ffa90fe8e496dd8cc90a | calexicon/constants.py | calexicon/constants.py | from datetime import date as vanilla_date
from dates.base import BasicBCEDate
first_julian_date = BasicBCEDate(-45, 1, 1)
first_vanilla_date = vanilla_date(1, 1, 1)
last_vanilla_date = vanilla_date(9999, 12, 31)
julian_day_number_of_first_vanilla_date = 1721423
julian_day_number_of_last_vanilla_date = (
julian_day_number_of_first_vanilla_date
+ (last_vanilla_date - first_vanilla_date).days
)
| from datetime import date as vanilla_date
from dates.base import BasicBCEDate
first_julian_date = BasicBCEDate(-45, 1, 1)
first_vanilla_date = vanilla_date(1, 1, 1)
last_vanilla_date = vanilla_date(9999, 12, 31)
julian_day_number_of_first_vanilla_date = 1721423
julian_day_number_of_last_vanilla_date = (
julian_day_number_of_first_vanilla_date
+ (last_vanilla_date - first_vanilla_date).days
)
number_of_vanilla_dates = (last_vanilla_date - first_vanilla_date).days
| Add another constant for the number of vanilla dates. | Add another constant for the number of vanilla dates.
| Python | apache-2.0 | jwg4/calexicon,jwg4/qual | python | ## Code Before:
from datetime import date as vanilla_date
from dates.base import BasicBCEDate
first_julian_date = BasicBCEDate(-45, 1, 1)
first_vanilla_date = vanilla_date(1, 1, 1)
last_vanilla_date = vanilla_date(9999, 12, 31)
julian_day_number_of_first_vanilla_date = 1721423
julian_day_number_of_last_vanilla_date = (
julian_day_number_of_first_vanilla_date
+ (last_vanilla_date - first_vanilla_date).days
)
## Instruction:
Add another constant for the number of vanilla dates.
## Code After:
from datetime import date as vanilla_date
from dates.base import BasicBCEDate
first_julian_date = BasicBCEDate(-45, 1, 1)
first_vanilla_date = vanilla_date(1, 1, 1)
last_vanilla_date = vanilla_date(9999, 12, 31)
julian_day_number_of_first_vanilla_date = 1721423
julian_day_number_of_last_vanilla_date = (
julian_day_number_of_first_vanilla_date
+ (last_vanilla_date - first_vanilla_date).days
)
number_of_vanilla_dates = (last_vanilla_date - first_vanilla_date).days
| from datetime import date as vanilla_date
from dates.base import BasicBCEDate
first_julian_date = BasicBCEDate(-45, 1, 1)
first_vanilla_date = vanilla_date(1, 1, 1)
last_vanilla_date = vanilla_date(9999, 12, 31)
julian_day_number_of_first_vanilla_date = 1721423
julian_day_number_of_last_vanilla_date = (
julian_day_number_of_first_vanilla_date
+ (last_vanilla_date - first_vanilla_date).days
)
+
+ number_of_vanilla_dates = (last_vanilla_date - first_vanilla_date).days | 2 | 0.153846 | 2 | 0 |
a9ecb970193ac30b061fb3ae9a754ca2c588e21c | app/views/devise/sessions/new.html.erb | app/views/devise/sessions/new.html.erb | <%= form_with(model: resource, url: session_path(resource_name), local: true,
skip_enforcing_utf8: true, class: 'login-form',
html: { novalidate: true }) do |f| %>
<div class="username">
<%= f.label :username, t('user_sessions.new.username') %>
<%= f.email_field :username, id: 'user_username',
'aria-label': t('user_sessions.new.username'), autofocus: true, autocomplete: 'off' %>
</div>
<div class="password">
<%= f.label :password, t('user_sessions.new.password') %>
<%= f.password_field :password, id: 'user_password',
'aria-label': t('user_sessions.new.password'), autocomplete: 'off' %>
</div>
<%= f.submit t('user_sessions.new.submit'), class: 'submit' %>
<% end %>
| <%= form_with(model: resource, url: session_path(resource_name), local: true,
class: 'login-form', html: { novalidate: true }) do |f| %>
<div class="username">
<%= f.label :username, t('user_sessions.new.username') %>
<%= f.email_field :username, id: 'user_username',
'aria-label': t('user_sessions.new.username'), autofocus: true, autocomplete: 'off' %>
</div>
<div class="password">
<%= f.label :password, t('user_sessions.new.password') %>
<%= f.password_field :password, id: 'user_password',
'aria-label': t('user_sessions.new.password'), autocomplete: 'off' %>
</div>
<%= f.submit t('user_sessions.new.submit'), class: 'submit' %>
<% end %>
| Revert "Do not use UTF-8 enforcer in login form" | Revert "Do not use UTF-8 enforcer in login form"
This reverts commit 9ad8be4a3e64ff8bd9c7c538ea3cb6dbbc3bd6b7.
| HTML+ERB | mit | Labtec/OpenLIS,Labtec/OpenLIS,Labtec/OpenLIS | html+erb | ## Code Before:
<%= form_with(model: resource, url: session_path(resource_name), local: true,
skip_enforcing_utf8: true, class: 'login-form',
html: { novalidate: true }) do |f| %>
<div class="username">
<%= f.label :username, t('user_sessions.new.username') %>
<%= f.email_field :username, id: 'user_username',
'aria-label': t('user_sessions.new.username'), autofocus: true, autocomplete: 'off' %>
</div>
<div class="password">
<%= f.label :password, t('user_sessions.new.password') %>
<%= f.password_field :password, id: 'user_password',
'aria-label': t('user_sessions.new.password'), autocomplete: 'off' %>
</div>
<%= f.submit t('user_sessions.new.submit'), class: 'submit' %>
<% end %>
## Instruction:
Revert "Do not use UTF-8 enforcer in login form"
This reverts commit 9ad8be4a3e64ff8bd9c7c538ea3cb6dbbc3bd6b7.
## Code After:
<%= form_with(model: resource, url: session_path(resource_name), local: true,
class: 'login-form', html: { novalidate: true }) do |f| %>
<div class="username">
<%= f.label :username, t('user_sessions.new.username') %>
<%= f.email_field :username, id: 'user_username',
'aria-label': t('user_sessions.new.username'), autofocus: true, autocomplete: 'off' %>
</div>
<div class="password">
<%= f.label :password, t('user_sessions.new.password') %>
<%= f.password_field :password, id: 'user_password',
'aria-label': t('user_sessions.new.password'), autocomplete: 'off' %>
</div>
<%= f.submit t('user_sessions.new.submit'), class: 'submit' %>
<% end %>
| <%= form_with(model: resource, url: session_path(resource_name), local: true,
- skip_enforcing_utf8: true, class: 'login-form',
- html: { novalidate: true }) do |f| %>
+ class: 'login-form', html: { novalidate: true }) do |f| %>
? +++++++++++++++++++++
<div class="username">
<%= f.label :username, t('user_sessions.new.username') %>
<%= f.email_field :username, id: 'user_username',
'aria-label': t('user_sessions.new.username'), autofocus: true, autocomplete: 'off' %>
</div>
<div class="password">
<%= f.label :password, t('user_sessions.new.password') %>
<%= f.password_field :password, id: 'user_password',
'aria-label': t('user_sessions.new.password'), autocomplete: 'off' %>
</div>
<%= f.submit t('user_sessions.new.submit'), class: 'submit' %>
<% end %> | 3 | 0.176471 | 1 | 2 |
1ba2df17d0d981ba3def6f74a730ee81da3874ed | docs/02_table_of_contents.md | docs/02_table_of_contents.md |
* [Install](#install)
* [Usage](#usage)
* [API Reference](#api-reference)
* [FAQ](#faq)
* [Version history](#version-history)
* [License](#license-and-author-information)
|
* [Install](#install)
* [Usage](#usage)
* [API Reference](#api-reference)
* [FAQ](#faq)
* [Version history](#version-history)
* [License](#license)
| Fix incorrect link to license | Fix incorrect link to license | Markdown | mit | inikulin/parse5,inikulin/parse5,HTMLParseErrorWG/parse5,inikulin/parse5,inikulin/parse5,HTMLParseErrorWG/parse5 | markdown | ## Code Before:
* [Install](#install)
* [Usage](#usage)
* [API Reference](#api-reference)
* [FAQ](#faq)
* [Version history](#version-history)
* [License](#license-and-author-information)
## Instruction:
Fix incorrect link to license
## Code After:
* [Install](#install)
* [Usage](#usage)
* [API Reference](#api-reference)
* [FAQ](#faq)
* [Version history](#version-history)
* [License](#license)
|
* [Install](#install)
* [Usage](#usage)
* [API Reference](#api-reference)
* [FAQ](#faq)
* [Version history](#version-history)
- * [License](#license-and-author-information)
+ * [License](#license) | 2 | 0.285714 | 1 | 1 |
c3d67fa0ef34bb5b4f3b2af809ce638cb1aae5d6 | package.json | package.json | {
"name": "dagre",
"version": "0.4.7-pre",
"description": "Graph layout for JavaScript",
"author": "Chris Pettitt <cpettitt@gmail.com>",
"main": "index.js",
"keywords": [
"graph",
"layout"
],
"dependencies": {},
"devDependencies": {
"browserify": "^5.10.1",
"chai": "^1.9.1",
"graphlib-dot": "0.4.8",
"istanbul": "^0.3.0",
"jscs": "^1.5.9",
"jshint": "^2.5.5",
"jshint-stylish": "^0.4.0",
"lodash": "^2.4.1",
"mocha": "^1.21.4",
"semver": "^3.0.1",
"uglify-js": "^2.4.15"
},
"repository": {
"type": "git",
"url": "https://github.com/cpettitt/dagre.git"
},
"license": "MIT"
}
| {
"name": "dagre",
"version": "0.4.7-pre",
"description": "Graph layout for JavaScript",
"author": "Chris Pettitt <cpettitt@gmail.com>",
"main": "index.js",
"keywords": [
"graph",
"layout"
],
"dependencies": {
"graphlib": "git://github.com/cpettitt/graphlib.git#1.0.0-dev",
"lodash": "^2.4.1"
},
"devDependencies": {
"browserify": "^5.10.1",
"chai": "^1.9.1",
"istanbul": "^0.3.0",
"jscs": "^1.5.9",
"jshint": "^2.5.5",
"jshint-stylish": "^0.4.0",
"lodash": "^2.4.1",
"mocha": "^1.21.4",
"semver": "^3.0.1",
"uglify-js": "^2.4.15"
},
"repository": {
"type": "git",
"url": "https://github.com/cpettitt/dagre.git"
},
"license": "MIT"
}
| Add lodash and a dev version of graphlib | Add lodash and a dev version of graphlib
| JSON | mit | 9n/dagre,GerHobbelt/dagre,abduld/dagre,witcxc/dagre,kdawes/dagre,abduld/dagre,kdawes/dagre,shelsonjava/dagre,lmcorbo/dagre,abduld/dagre,GerHobbelt/dagre,9n/dagre,lmcorbo/dagre,cpettitt/dagre,GerHobbelt/dagre,witcxc/dagre,9n/dagre,lmcorbo/dagre,shelsonjava/dagre,tylingsoft/dagre-layout,cpettitt/dagre,tylingsoft/dagre-layout,kdawes/dagre,cpettitt/dagre,shelsonjava/dagre | json | ## Code Before:
{
"name": "dagre",
"version": "0.4.7-pre",
"description": "Graph layout for JavaScript",
"author": "Chris Pettitt <cpettitt@gmail.com>",
"main": "index.js",
"keywords": [
"graph",
"layout"
],
"dependencies": {},
"devDependencies": {
"browserify": "^5.10.1",
"chai": "^1.9.1",
"graphlib-dot": "0.4.8",
"istanbul": "^0.3.0",
"jscs": "^1.5.9",
"jshint": "^2.5.5",
"jshint-stylish": "^0.4.0",
"lodash": "^2.4.1",
"mocha": "^1.21.4",
"semver": "^3.0.1",
"uglify-js": "^2.4.15"
},
"repository": {
"type": "git",
"url": "https://github.com/cpettitt/dagre.git"
},
"license": "MIT"
}
## Instruction:
Add lodash and a dev version of graphlib
## Code After:
{
"name": "dagre",
"version": "0.4.7-pre",
"description": "Graph layout for JavaScript",
"author": "Chris Pettitt <cpettitt@gmail.com>",
"main": "index.js",
"keywords": [
"graph",
"layout"
],
"dependencies": {
"graphlib": "git://github.com/cpettitt/graphlib.git#1.0.0-dev",
"lodash": "^2.4.1"
},
"devDependencies": {
"browserify": "^5.10.1",
"chai": "^1.9.1",
"istanbul": "^0.3.0",
"jscs": "^1.5.9",
"jshint": "^2.5.5",
"jshint-stylish": "^0.4.0",
"lodash": "^2.4.1",
"mocha": "^1.21.4",
"semver": "^3.0.1",
"uglify-js": "^2.4.15"
},
"repository": {
"type": "git",
"url": "https://github.com/cpettitt/dagre.git"
},
"license": "MIT"
}
| {
"name": "dagre",
"version": "0.4.7-pre",
"description": "Graph layout for JavaScript",
"author": "Chris Pettitt <cpettitt@gmail.com>",
"main": "index.js",
"keywords": [
"graph",
"layout"
],
- "dependencies": {},
? --
+ "dependencies": {
+ "graphlib": "git://github.com/cpettitt/graphlib.git#1.0.0-dev",
+ "lodash": "^2.4.1"
+ },
"devDependencies": {
"browserify": "^5.10.1",
"chai": "^1.9.1",
- "graphlib-dot": "0.4.8",
"istanbul": "^0.3.0",
"jscs": "^1.5.9",
"jshint": "^2.5.5",
"jshint-stylish": "^0.4.0",
"lodash": "^2.4.1",
"mocha": "^1.21.4",
"semver": "^3.0.1",
"uglify-js": "^2.4.15"
},
"repository": {
"type": "git",
"url": "https://github.com/cpettitt/dagre.git"
},
"license": "MIT"
} | 6 | 0.2 | 4 | 2 |
12eca6c52d32c42276be8b7ee6d4240e44d1a35c | lib/tests/dashboards/content.js | lib/tests/dashboards/content.js |
var Mocha = require('mocha'),
_ = require('underscore');
module.exports = function (browser, dashboard, suite /*, config*/) {
var tests = {
'has a breadcrumb': function () {
return browser
.$('#global-breadcrumb ol').isDisplayed()
.should.eventually.be.ok
.$('#global-breadcrumb ol li:nth-child(1) a').text()
.should.eventually.equal('Performance')
.$('#global-breadcrumb ol li:nth-child(1) a').getAttribute('href')
.should.eventually.match(/\/performance$/)
.$('#global-breadcrumb ol li:nth-child(2)').text()
.should.eventually.equal('Activity on GOV.UK')
.then(function () {
if (dashboard.slug !== 'site-activity') {
return browser
.$('#global-breadcrumb ol li:nth-child(3)').text()
.should.eventually.equal(dashboard.title);
}
});
},
'has a link to the site in the header': function () {
if (dashboard.relatedPages && dashboard.relatedPages.transaction) {
return browser
.$('#content .related-pages .related-transaction a').text()
.should.eventually.equal(dashboard.relatedPages.transaction.title)
.$('#content .related-pages .related-transaction a').getAttribute('href')
.should.eventually.equal(dashboard.relatedPages.transaction.url);
}
}
};
_.each(tests, function (test, key) {
suite.addTest(new Mocha.Test(key, test));
});
return suite;
};
|
var Mocha = require('mocha'),
_ = require('underscore');
module.exports = function (browser, dashboard, suite /*, config*/) {
var tests = {
'has a breadcrumb': function () {
return browser
.$('#global-breadcrumb ol').isDisplayed()
.should.eventually.be.ok
.$('#global-breadcrumb ol li:nth-child(1) a').text()
.should.eventually.equal('Performance')
.$('#global-breadcrumb ol li:nth-child(1) a').getAttribute('href')
.should.eventually.match(/\/performance$/)
.$('#global-breadcrumb ol li:nth-child(2)').text()
.should.eventually.equal('Activity on GOV.UK')
.then(function () {
if (dashboard.slug !== 'site-activity') {
return browser
.$('#global-breadcrumb ol li:nth-child(3)').text()
.should.eventually.contain(dashboard.title.substr(0, 32));
}
});
},
'has a link to the site in the header': function () {
if (dashboard.relatedPages && dashboard.relatedPages.transaction) {
return browser
.$('#content .related-pages .related-transaction a').text()
.should.eventually.equal(dashboard.relatedPages.transaction.title)
.$('#content .related-pages .related-transaction a').getAttribute('href')
.should.eventually.equal(dashboard.relatedPages.transaction.url);
}
}
};
_.each(tests, function (test, key) {
suite.addTest(new Mocha.Test(key, test));
});
return suite;
};
| Fix substringing of long breadcrumb items | Fix substringing of long breadcrumb items
| JavaScript | mit | alphagov/cheapseats | javascript | ## Code Before:
var Mocha = require('mocha'),
_ = require('underscore');
module.exports = function (browser, dashboard, suite /*, config*/) {
var tests = {
'has a breadcrumb': function () {
return browser
.$('#global-breadcrumb ol').isDisplayed()
.should.eventually.be.ok
.$('#global-breadcrumb ol li:nth-child(1) a').text()
.should.eventually.equal('Performance')
.$('#global-breadcrumb ol li:nth-child(1) a').getAttribute('href')
.should.eventually.match(/\/performance$/)
.$('#global-breadcrumb ol li:nth-child(2)').text()
.should.eventually.equal('Activity on GOV.UK')
.then(function () {
if (dashboard.slug !== 'site-activity') {
return browser
.$('#global-breadcrumb ol li:nth-child(3)').text()
.should.eventually.equal(dashboard.title);
}
});
},
'has a link to the site in the header': function () {
if (dashboard.relatedPages && dashboard.relatedPages.transaction) {
return browser
.$('#content .related-pages .related-transaction a').text()
.should.eventually.equal(dashboard.relatedPages.transaction.title)
.$('#content .related-pages .related-transaction a').getAttribute('href')
.should.eventually.equal(dashboard.relatedPages.transaction.url);
}
}
};
_.each(tests, function (test, key) {
suite.addTest(new Mocha.Test(key, test));
});
return suite;
};
## Instruction:
Fix substringing of long breadcrumb items
## Code After:
var Mocha = require('mocha'),
_ = require('underscore');
module.exports = function (browser, dashboard, suite /*, config*/) {
var tests = {
'has a breadcrumb': function () {
return browser
.$('#global-breadcrumb ol').isDisplayed()
.should.eventually.be.ok
.$('#global-breadcrumb ol li:nth-child(1) a').text()
.should.eventually.equal('Performance')
.$('#global-breadcrumb ol li:nth-child(1) a').getAttribute('href')
.should.eventually.match(/\/performance$/)
.$('#global-breadcrumb ol li:nth-child(2)').text()
.should.eventually.equal('Activity on GOV.UK')
.then(function () {
if (dashboard.slug !== 'site-activity') {
return browser
.$('#global-breadcrumb ol li:nth-child(3)').text()
.should.eventually.contain(dashboard.title.substr(0, 32));
}
});
},
'has a link to the site in the header': function () {
if (dashboard.relatedPages && dashboard.relatedPages.transaction) {
return browser
.$('#content .related-pages .related-transaction a').text()
.should.eventually.equal(dashboard.relatedPages.transaction.title)
.$('#content .related-pages .related-transaction a').getAttribute('href')
.should.eventually.equal(dashboard.relatedPages.transaction.url);
}
}
};
_.each(tests, function (test, key) {
suite.addTest(new Mocha.Test(key, test));
});
return suite;
};
|
var Mocha = require('mocha'),
_ = require('underscore');
module.exports = function (browser, dashboard, suite /*, config*/) {
var tests = {
'has a breadcrumb': function () {
return browser
.$('#global-breadcrumb ol').isDisplayed()
.should.eventually.be.ok
.$('#global-breadcrumb ol li:nth-child(1) a').text()
.should.eventually.equal('Performance')
.$('#global-breadcrumb ol li:nth-child(1) a').getAttribute('href')
.should.eventually.match(/\/performance$/)
.$('#global-breadcrumb ol li:nth-child(2)').text()
.should.eventually.equal('Activity on GOV.UK')
.then(function () {
if (dashboard.slug !== 'site-activity') {
return browser
.$('#global-breadcrumb ol li:nth-child(3)').text()
- .should.eventually.equal(dashboard.title);
? ^^^ ^
+ .should.eventually.contain(dashboard.title.substr(0, 32));
? ^^^^ ^^ ++++++++++++++
}
});
},
'has a link to the site in the header': function () {
if (dashboard.relatedPages && dashboard.relatedPages.transaction) {
return browser
.$('#content .related-pages .related-transaction a').text()
.should.eventually.equal(dashboard.relatedPages.transaction.title)
.$('#content .related-pages .related-transaction a').getAttribute('href')
.should.eventually.equal(dashboard.relatedPages.transaction.url);
}
}
};
_.each(tests, function (test, key) {
suite.addTest(new Mocha.Test(key, test));
});
return suite;
}; | 2 | 0.042553 | 1 | 1 |
e186c8de77415445b6157bf0859874f1d556394a | .travis.yml | .travis.yml | sudo: required
dist: trusty
language: node_js
node_js:
- '4.2'
notifications:
email: false
before_install:
- if [[ `npm -v` != 3* ]]; then npm i -g npm@3; fi
install:
- npm install
before_script:
script:
- npm run lint
- npm test
after_script:
- npm run build
| sudo: required
dist: trusty
language: node_js
node_js:
- '4.6'
notifications:
email: false
before_install:
- npm i -g npm@3.9.5
install:
- npm install
before_script:
script:
- npm run lint
- npm test
after_script:
- npm run build
| Update CI to provide ISO environment | Update CI to provide ISO environment
| YAML | mit | DavidLevayer/countable,DavidLevayer/countable,DavidLevayer/countable | yaml | ## Code Before:
sudo: required
dist: trusty
language: node_js
node_js:
- '4.2'
notifications:
email: false
before_install:
- if [[ `npm -v` != 3* ]]; then npm i -g npm@3; fi
install:
- npm install
before_script:
script:
- npm run lint
- npm test
after_script:
- npm run build
## Instruction:
Update CI to provide ISO environment
## Code After:
sudo: required
dist: trusty
language: node_js
node_js:
- '4.6'
notifications:
email: false
before_install:
- npm i -g npm@3.9.5
install:
- npm install
before_script:
script:
- npm run lint
- npm test
after_script:
- npm run build
| sudo: required
dist: trusty
language: node_js
node_js:
- - '4.2'
? ^
+ - '4.6'
? ^
notifications:
email: false
before_install:
- - if [[ `npm -v` != 3* ]]; then npm i -g npm@3; fi
+ - npm i -g npm@3.9.5
install:
- npm install
before_script:
script:
- npm run lint
- npm test
after_script:
- npm run build | 4 | 0.173913 | 2 | 2 |
eba24c5f9a20f1663611520bf7e2f846f7175959 | core/kotlinx-coroutines-test/src/TestCoroutineExceptionHandler.kt | core/kotlinx-coroutines-test/src/TestCoroutineExceptionHandler.kt | package kotlinx.coroutines.test
import kotlinx.coroutines.CoroutineExceptionHandler
import java.util.*
import kotlin.coroutines.CoroutineContext
/**
* Access uncaught coroutines exceptions captured during test execution.
*
* Note, tests executed via [runBlockingTest] or [TestCoroutineScope.runBlocking] will not trigger uncaught exception
* handling and should use [Deferred.await] or [Job.getCancellationException] to test exceptions.
*/
interface ExceptionCaptor {
/**
* List of uncaught coroutine exceptions.
*
* During [cleanupTestCoroutines] the first element of this list will be rethrown if it is not empty.
*/
val exceptions: MutableList<Throwable>
/**
* Call after the test completes.
*
* @throws Throwable the first uncaught exception, if there are any uncaught exceptions
*/
fun cleanupTestCoroutines()
}
/**
* An exception handler that can be used to capture uncaught exceptions in tests.
*/
class TestCoroutineExceptionHandler: ExceptionCaptor, CoroutineExceptionHandler {
override fun handleException(context: CoroutineContext, exception: Throwable) {
exceptions += exception
}
override val key = CoroutineExceptionHandler
override val exceptions = LinkedList<Throwable>()
override fun cleanupTestCoroutines() {
val exception = exceptions.firstOrNull() ?: return
throw exception
}
}
| package kotlinx.coroutines.test
import kotlinx.coroutines.CoroutineExceptionHandler
import java.util.*
import kotlin.coroutines.CoroutineContext
/**
* Access uncaught coroutines exceptions captured during test execution.
*
* Note, tests executed via [runBlockingTest] or [TestCoroutineScope.runBlocking] will not trigger uncaught exception
* handling and should use [Deferred.await] or [Job.getCancellationException] to test exceptions.
*/
interface ExceptionCaptor {
/**
* List of uncaught coroutine exceptions.
*
* During [cleanupTestCoroutines] the first element of this list will be rethrown if it is not empty.
*/
val exceptions: List<Throwable>
/**
* Call after the test completes.
*
* @throws Throwable the first uncaught exception, if there are any uncaught exceptions
*/
fun cleanupTestCoroutines()
}
/**
* An exception handler that can be used to capture uncaught exceptions in tests.
*/
class TestCoroutineExceptionHandler: ExceptionCaptor, CoroutineExceptionHandler {
val lock = Object()
override fun handleException(context: CoroutineContext, exception: Throwable) {
synchronized(lock) {
_exceptions += exception
}
}
override val key = CoroutineExceptionHandler
private val _exceptions = mutableListOf<Throwable>()
override val exceptions
get() = _exceptions.toList()
override fun cleanupTestCoroutines() {
synchronized(lock) {
val exception = _exceptions.firstOrNull() ?: return
throw exception
}
}
}
| Add thread saftey to exceptions | Add thread saftey to exceptions
| Kotlin | apache-2.0 | Kotlin/kotlinx.coroutines,Kotlin/kotlinx.coroutines,Kotlin/kotlinx.coroutines,Kotlin/kotlinx.coroutines,Kotlin/kotlinx.coroutines | kotlin | ## Code Before:
package kotlinx.coroutines.test
import kotlinx.coroutines.CoroutineExceptionHandler
import java.util.*
import kotlin.coroutines.CoroutineContext
/**
* Access uncaught coroutines exceptions captured during test execution.
*
* Note, tests executed via [runBlockingTest] or [TestCoroutineScope.runBlocking] will not trigger uncaught exception
* handling and should use [Deferred.await] or [Job.getCancellationException] to test exceptions.
*/
interface ExceptionCaptor {
/**
* List of uncaught coroutine exceptions.
*
* During [cleanupTestCoroutines] the first element of this list will be rethrown if it is not empty.
*/
val exceptions: MutableList<Throwable>
/**
* Call after the test completes.
*
* @throws Throwable the first uncaught exception, if there are any uncaught exceptions
*/
fun cleanupTestCoroutines()
}
/**
* An exception handler that can be used to capture uncaught exceptions in tests.
*/
class TestCoroutineExceptionHandler: ExceptionCaptor, CoroutineExceptionHandler {
override fun handleException(context: CoroutineContext, exception: Throwable) {
exceptions += exception
}
override val key = CoroutineExceptionHandler
override val exceptions = LinkedList<Throwable>()
override fun cleanupTestCoroutines() {
val exception = exceptions.firstOrNull() ?: return
throw exception
}
}
## Instruction:
Add thread saftey to exceptions
## Code After:
package kotlinx.coroutines.test
import kotlinx.coroutines.CoroutineExceptionHandler
import java.util.*
import kotlin.coroutines.CoroutineContext
/**
* Access uncaught coroutines exceptions captured during test execution.
*
* Note, tests executed via [runBlockingTest] or [TestCoroutineScope.runBlocking] will not trigger uncaught exception
* handling and should use [Deferred.await] or [Job.getCancellationException] to test exceptions.
*/
interface ExceptionCaptor {
/**
* List of uncaught coroutine exceptions.
*
* During [cleanupTestCoroutines] the first element of this list will be rethrown if it is not empty.
*/
val exceptions: List<Throwable>
/**
* Call after the test completes.
*
* @throws Throwable the first uncaught exception, if there are any uncaught exceptions
*/
fun cleanupTestCoroutines()
}
/**
* An exception handler that can be used to capture uncaught exceptions in tests.
*/
class TestCoroutineExceptionHandler: ExceptionCaptor, CoroutineExceptionHandler {
val lock = Object()
override fun handleException(context: CoroutineContext, exception: Throwable) {
synchronized(lock) {
_exceptions += exception
}
}
override val key = CoroutineExceptionHandler
private val _exceptions = mutableListOf<Throwable>()
override val exceptions
get() = _exceptions.toList()
override fun cleanupTestCoroutines() {
synchronized(lock) {
val exception = _exceptions.firstOrNull() ?: return
throw exception
}
}
}
| package kotlinx.coroutines.test
import kotlinx.coroutines.CoroutineExceptionHandler
import java.util.*
import kotlin.coroutines.CoroutineContext
/**
* Access uncaught coroutines exceptions captured during test execution.
*
* Note, tests executed via [runBlockingTest] or [TestCoroutineScope.runBlocking] will not trigger uncaught exception
* handling and should use [Deferred.await] or [Job.getCancellationException] to test exceptions.
*/
interface ExceptionCaptor {
/**
* List of uncaught coroutine exceptions.
*
* During [cleanupTestCoroutines] the first element of this list will be rethrown if it is not empty.
*/
- val exceptions: MutableList<Throwable>
? -------
+ val exceptions: List<Throwable>
/**
* Call after the test completes.
*
* @throws Throwable the first uncaught exception, if there are any uncaught exceptions
*/
fun cleanupTestCoroutines()
}
/**
* An exception handler that can be used to capture uncaught exceptions in tests.
*/
class TestCoroutineExceptionHandler: ExceptionCaptor, CoroutineExceptionHandler {
+ val lock = Object()
+
override fun handleException(context: CoroutineContext, exception: Throwable) {
+ synchronized(lock) {
- exceptions += exception
+ _exceptions += exception
? +++++
+ }
}
override val key = CoroutineExceptionHandler
- override val exceptions = LinkedList<Throwable>()
? ^^^^ ^ ^^^^ -
+ private val _exceptions = mutableListOf<Throwable>()
? ^ ^^^ + ^^^^^^ ++
+
+ override val exceptions
+ get() = _exceptions.toList()
override fun cleanupTestCoroutines() {
+ synchronized(lock) {
- val exception = exceptions.firstOrNull() ?: return
+ val exception = _exceptions.firstOrNull() ?: return
? ++++ +
- throw exception
+ throw exception
? ++++
+ }
}
} | 19 | 0.422222 | 14 | 5 |
a4102e8a4aeaedc8ad9d258d7962f1f661cf6abb | src/main/java/com/laytonsmith/abstraction/enums/MCTeleportCause.java | src/main/java/com/laytonsmith/abstraction/enums/MCTeleportCause.java | package com.laytonsmith.abstraction.enums;
import com.laytonsmith.annotations.MEnum;
@MEnum("TeleportCause")
public enum MCTeleportCause {
COMMAND,
END_PORTAL,
ENDER_PEARL,
NETHER_PORTAL,
PLUGIN,
SPECTATE,
UNKNOWN
}
| package com.laytonsmith.abstraction.enums;
import com.laytonsmith.annotations.MEnum;
@MEnum("TeleportCause")
public enum MCTeleportCause {
COMMAND,
END_PORTAL,
ENDER_PEARL,
NETHER_PORTAL,
PLUGIN,
SPECTATE,
END_GATEWAY,
UNKNOWN
}
| Add END_GATEWAY to teleport causes | Add END_GATEWAY to teleport causes
| Java | mit | sk89q/CommandHelper,sk89q/CommandHelper,sk89q/CommandHelper,sk89q/CommandHelper | java | ## Code Before:
package com.laytonsmith.abstraction.enums;
import com.laytonsmith.annotations.MEnum;
@MEnum("TeleportCause")
public enum MCTeleportCause {
COMMAND,
END_PORTAL,
ENDER_PEARL,
NETHER_PORTAL,
PLUGIN,
SPECTATE,
UNKNOWN
}
## Instruction:
Add END_GATEWAY to teleport causes
## Code After:
package com.laytonsmith.abstraction.enums;
import com.laytonsmith.annotations.MEnum;
@MEnum("TeleportCause")
public enum MCTeleportCause {
COMMAND,
END_PORTAL,
ENDER_PEARL,
NETHER_PORTAL,
PLUGIN,
SPECTATE,
END_GATEWAY,
UNKNOWN
}
| package com.laytonsmith.abstraction.enums;
import com.laytonsmith.annotations.MEnum;
@MEnum("TeleportCause")
public enum MCTeleportCause {
COMMAND,
END_PORTAL,
ENDER_PEARL,
NETHER_PORTAL,
PLUGIN,
SPECTATE,
+ END_GATEWAY,
UNKNOWN
} | 1 | 0.071429 | 1 | 0 |
f99fe50b52650a9a4f83f733e44044b213a89bd9 | README.md | README.md | <div style="text-align:center">

</div>
<div style="text-align:center">
<h1>blag</h1>
</div>
<div style="text-align:center;">
A testing ground for various technologies.
</div>
## Rationale
Some smart people keep saying, over and over, that everyone needs some sort
of side project. As someone who is vastly inferior to these smart people, I made
a blog. I figure that this blog can be my, as I can incrementally add to it in
the midst of my (insanely busy) life. This blog was originally based on
`faceyspacey/redux-first-router-demo`, but its basis *can* change at any moment.
## Note:
This project is not actually meant to be *used*. As in, I'll probably entirely
forget about it at some point and it will fall into a world of unmaintained
sadness. And then I'll rewrite the whole thing. Also, I have absolutely no
qualifications — I'm still in high school, and have had no formal
programming training whatsoever (my school doesn't offer those sorts of
courses). So... If you decide to base *anything* off my work in this repo, be
warned: __*There be dragons!*__
---
[LICENSE](/LICENSE)
| <div align="center">
<img src="https://rawgit.com/jo12bar/blag/master/README-header.jpg" title="Finally decides to do homework... Somehow ends up making a side project..." />
</div>
<h1 align="center">blag</h1>
<p align="center">A testing ground for various technologies.</p>
## Rationale
Some smart people keep saying, over and over, that everyone needs some sort
of side project. As someone who is vastly inferior to these smart people, I made
a blog. I figure that this blog can be my, as I can incrementally add to it in
the midst of my (insanely busy) life. This blog was originally based on
`faceyspacey/redux-first-router-demo`, but its basis *can* change at any moment.
## Note:
This project is not actually meant to be *used*. As in, I'll probably entirely
forget about it at some point and it will fall into a world of unmaintained
sadness. And then I'll rewrite the whole thing. Also, I have absolutely no
qualifications — I'm still in high school, and have had no formal
programming training whatsoever (my school doesn't offer those sorts of
courses). So... If you decide to base *anything* off my work in this repo, be
warned: __*There be dragons!*__
---
[LICENSE](/LICENSE)
| Fix header image to actually display inside div | Fix header image to actually display inside div
| Markdown | mit | jo12bar/blag | markdown | ## Code Before:
<div style="text-align:center">

</div>
<div style="text-align:center">
<h1>blag</h1>
</div>
<div style="text-align:center;">
A testing ground for various technologies.
</div>
## Rationale
Some smart people keep saying, over and over, that everyone needs some sort
of side project. As someone who is vastly inferior to these smart people, I made
a blog. I figure that this blog can be my, as I can incrementally add to it in
the midst of my (insanely busy) life. This blog was originally based on
`faceyspacey/redux-first-router-demo`, but its basis *can* change at any moment.
## Note:
This project is not actually meant to be *used*. As in, I'll probably entirely
forget about it at some point and it will fall into a world of unmaintained
sadness. And then I'll rewrite the whole thing. Also, I have absolutely no
qualifications — I'm still in high school, and have had no formal
programming training whatsoever (my school doesn't offer those sorts of
courses). So... If you decide to base *anything* off my work in this repo, be
warned: __*There be dragons!*__
---
[LICENSE](/LICENSE)
## Instruction:
Fix header image to actually display inside div
## Code After:
<div align="center">
<img src="https://rawgit.com/jo12bar/blag/master/README-header.jpg" title="Finally decides to do homework... Somehow ends up making a side project..." />
</div>
<h1 align="center">blag</h1>
<p align="center">A testing ground for various technologies.</p>
## Rationale
Some smart people keep saying, over and over, that everyone needs some sort
of side project. As someone who is vastly inferior to these smart people, I made
a blog. I figure that this blog can be my, as I can incrementally add to it in
the midst of my (insanely busy) life. This blog was originally based on
`faceyspacey/redux-first-router-demo`, but its basis *can* change at any moment.
## Note:
This project is not actually meant to be *used*. As in, I'll probably entirely
forget about it at some point and it will fall into a world of unmaintained
sadness. And then I'll rewrite the whole thing. Also, I have absolutely no
qualifications — I'm still in high school, and have had no formal
programming training whatsoever (my school doesn't offer those sorts of
courses). So... If you decide to base *anything* off my work in this repo, be
warned: __*There be dragons!*__
---
[LICENSE](/LICENSE)
| - <div style="text-align:center">
- 
+ <div align="center">
+ <img src="https://rawgit.com/jo12bar/blag/master/README-header.jpg" title="Finally decides to do homework... Somehow ends up making a side project..." />
</div>
+ <h1 align="center">blag</h1>
- <div style="text-align:center">
- <h1>blag</h1>
- </div>
- <div style="text-align:center;">
- A testing ground for various technologies.
? ^
+ <p align="center">A testing ground for various technologies.</p>
? ++ ^^^^^^^^^^^^^^^ ++++
- </div>
## Rationale
Some smart people keep saying, over and over, that everyone needs some sort
of side project. As someone who is vastly inferior to these smart people, I made
a blog. I figure that this blog can be my, as I can incrementally add to it in
the midst of my (insanely busy) life. This blog was originally based on
`faceyspacey/redux-first-router-demo`, but its basis *can* change at any moment.
## Note:
This project is not actually meant to be *used*. As in, I'll probably entirely
forget about it at some point and it will fall into a world of unmaintained
sadness. And then I'll rewrite the whole thing. Also, I have absolutely no
qualifications — I'm still in high school, and have had no formal
programming training whatsoever (my school doesn't offer those sorts of
courses). So... If you decide to base *anything* off my work in this repo, be
warned: __*There be dragons!*__
---
[LICENSE](/LICENSE) | 12 | 0.363636 | 4 | 8 |
bc414ecb41fce5ace259166ed366763f007f88b4 | src/http-configurable.js | src/http-configurable.js | 'use strict';
var _ = require('lodash');
var httpConfigurable = {};
httpConfigurable.initHttpConfigurable = function() {
this.thenApplies = [];
this.headers = {};
};
httpConfigurable.header = function(headerKey, headerValue) {
this.headers[headerKey] = headerValue;
return this;
};
httpConfigurable.contentType = function(mimeType) {
return this.header('Content-Type', mimeType);
};
httpConfigurable.accept = function(mimeType) {
return this.header('Accept', mimeType);
};
httpConfigurable.thenApply = function(onFulfilled, onRejected, onProgress) {
var applies = {
onFulfilled: onFulfilled,
onRejected: onRejected,
onProgress: onProgress
};
this.thenApplies.push(applies);
return this;
};
httpConfigurable.mergeThenApplies = function(_thenApplies) {
_.extend(this.thenApplies, _thenApplies);
};
module.exports = httpConfigurable;
| 'use strict';
var _ = require('lodash');
var httpConfigurable = {};
httpConfigurable.initHttpConfigurable = function() {
this.thenApplies = [];
this.headers = {};
};
httpConfigurable.header = function(headerKey, headerValue) {
this.headers[headerKey] = headerValue;
return this;
};
httpConfigurable.contentType = function(mimeType) {
return this.header('Content-Type', mimeType);
};
httpConfigurable.accept = function(mimeType) {
return this.header('Accept', mimeType);
};
httpConfigurable.then = function(onFulfilled, onRejected, onProgress) {
var applies = {
onFulfilled: onFulfilled,
onRejected: onRejected,
onProgress: onProgress
};
this.thenApplies.push(applies);
return this;
};
httpConfigurable.thenApply = httpConfigurable.then;
httpConfigurable.mergeThenApplies = function(_thenApplies) {
_.extend(this.thenApplies, _thenApplies);
};
module.exports = httpConfigurable;
| Rename thenApply function to then | Rename thenApply function to then
| JavaScript | mit | kahnjw/endpoints | javascript | ## Code Before:
'use strict';
var _ = require('lodash');
var httpConfigurable = {};
httpConfigurable.initHttpConfigurable = function() {
this.thenApplies = [];
this.headers = {};
};
httpConfigurable.header = function(headerKey, headerValue) {
this.headers[headerKey] = headerValue;
return this;
};
httpConfigurable.contentType = function(mimeType) {
return this.header('Content-Type', mimeType);
};
httpConfigurable.accept = function(mimeType) {
return this.header('Accept', mimeType);
};
httpConfigurable.thenApply = function(onFulfilled, onRejected, onProgress) {
var applies = {
onFulfilled: onFulfilled,
onRejected: onRejected,
onProgress: onProgress
};
this.thenApplies.push(applies);
return this;
};
httpConfigurable.mergeThenApplies = function(_thenApplies) {
_.extend(this.thenApplies, _thenApplies);
};
module.exports = httpConfigurable;
## Instruction:
Rename thenApply function to then
## Code After:
'use strict';
var _ = require('lodash');
var httpConfigurable = {};
httpConfigurable.initHttpConfigurable = function() {
this.thenApplies = [];
this.headers = {};
};
httpConfigurable.header = function(headerKey, headerValue) {
this.headers[headerKey] = headerValue;
return this;
};
httpConfigurable.contentType = function(mimeType) {
return this.header('Content-Type', mimeType);
};
httpConfigurable.accept = function(mimeType) {
return this.header('Accept', mimeType);
};
httpConfigurable.then = function(onFulfilled, onRejected, onProgress) {
var applies = {
onFulfilled: onFulfilled,
onRejected: onRejected,
onProgress: onProgress
};
this.thenApplies.push(applies);
return this;
};
httpConfigurable.thenApply = httpConfigurable.then;
httpConfigurable.mergeThenApplies = function(_thenApplies) {
_.extend(this.thenApplies, _thenApplies);
};
module.exports = httpConfigurable;
| 'use strict';
var _ = require('lodash');
var httpConfigurable = {};
httpConfigurable.initHttpConfigurable = function() {
this.thenApplies = [];
this.headers = {};
};
httpConfigurable.header = function(headerKey, headerValue) {
this.headers[headerKey] = headerValue;
return this;
};
httpConfigurable.contentType = function(mimeType) {
return this.header('Content-Type', mimeType);
};
httpConfigurable.accept = function(mimeType) {
return this.header('Accept', mimeType);
};
- httpConfigurable.thenApply = function(onFulfilled, onRejected, onProgress) {
? -----
+ httpConfigurable.then = function(onFulfilled, onRejected, onProgress) {
var applies = {
onFulfilled: onFulfilled,
onRejected: onRejected,
onProgress: onProgress
};
this.thenApplies.push(applies);
return this;
};
+ httpConfigurable.thenApply = httpConfigurable.then;
+
httpConfigurable.mergeThenApplies = function(_thenApplies) {
_.extend(this.thenApplies, _thenApplies);
};
module.exports = httpConfigurable; | 4 | 0.093023 | 3 | 1 |
61b7320e3a7e075a27398f91c85371d5461e8604 | KiwiLibrary/Resource/Library/Graphics.js | KiwiLibrary/Resource/Library/Graphics.js | /*
* Graphics.js
*/
class SpriteNodeAction {
constructor(active, speed, angle){
this.mActive = active ; // Bool
this.mSpeed = speed ; // Double [m/sec]
this.mAngle = angle ; // Double [radian]
}
get active() { return this.mActive ; }
get speed() { return this.mSpeed ; }
get angle() { return this.mAngle ; }
}
class SpriteNodeStatus {
constructor(pos, size){
this.mPosition = pos ; // Point
this.mSize = size ; // Size
}
get position() { return this.mPosition ; }
get size() { return this.mSize ; }
}
| /*
* Graphics.js
*/
class SpriteNodeAction {
constructor(active, speed, angle){
checkVariables("SpriteNodeAction.constructor", active, speed, angle) ;
this.mActive = active ; // Bool
this.mSpeed = speed ; // Double [m/sec]
this.mAngle = angle ; // Double [radian]
}
get active() { return this.mActive ; }
get speed() { return this.mSpeed ; }
get angle() { return this.mAngle ; }
// toParameter() -> Object
toParameter() {
let obj = {
active: this.mActive,
speed: this.mSpeed,
angle: this.mAngle
} ;
return obj ;
}
}
class SpriteNodeStatus {
constructor(pos, size, energy){
checkVariables("SpriteNodeStatus.constructor", pos, size, energy) ;
this.mPosition = pos ; // Point
this.mSize = size ; // Size
this.mEnergy = energy ; // Double
}
get position() { return this.mPosition ; }
get size() { return this.mSize ; }
get energy() { return this.mEnergy ; }
// toParameter() -> Object
toParameter() {
let obj = {
position: this.mPosition,
size: this.mSize,
energy: this.mEnergy
} ;
return obj ;
}
}
| Update built-in JavaScript for sprite node | KiwiLibrary: Update built-in JavaScript for sprite node
| JavaScript | lgpl-2.1 | steelwheels/KiwiScript,steelwheels/KiwiScript,steelwheels/KiwiScript,steelwheels/KiwiScript | javascript | ## Code Before:
/*
* Graphics.js
*/
class SpriteNodeAction {
constructor(active, speed, angle){
this.mActive = active ; // Bool
this.mSpeed = speed ; // Double [m/sec]
this.mAngle = angle ; // Double [radian]
}
get active() { return this.mActive ; }
get speed() { return this.mSpeed ; }
get angle() { return this.mAngle ; }
}
class SpriteNodeStatus {
constructor(pos, size){
this.mPosition = pos ; // Point
this.mSize = size ; // Size
}
get position() { return this.mPosition ; }
get size() { return this.mSize ; }
}
## Instruction:
KiwiLibrary: Update built-in JavaScript for sprite node
## Code After:
/*
* Graphics.js
*/
class SpriteNodeAction {
constructor(active, speed, angle){
checkVariables("SpriteNodeAction.constructor", active, speed, angle) ;
this.mActive = active ; // Bool
this.mSpeed = speed ; // Double [m/sec]
this.mAngle = angle ; // Double [radian]
}
get active() { return this.mActive ; }
get speed() { return this.mSpeed ; }
get angle() { return this.mAngle ; }
// toParameter() -> Object
toParameter() {
let obj = {
active: this.mActive,
speed: this.mSpeed,
angle: this.mAngle
} ;
return obj ;
}
}
class SpriteNodeStatus {
constructor(pos, size, energy){
checkVariables("SpriteNodeStatus.constructor", pos, size, energy) ;
this.mPosition = pos ; // Point
this.mSize = size ; // Size
this.mEnergy = energy ; // Double
}
get position() { return this.mPosition ; }
get size() { return this.mSize ; }
get energy() { return this.mEnergy ; }
// toParameter() -> Object
toParameter() {
let obj = {
position: this.mPosition,
size: this.mSize,
energy: this.mEnergy
} ;
return obj ;
}
}
| /*
* Graphics.js
*/
class SpriteNodeAction {
constructor(active, speed, angle){
+ checkVariables("SpriteNodeAction.constructor", active, speed, angle) ;
this.mActive = active ; // Bool
this.mSpeed = speed ; // Double [m/sec]
this.mAngle = angle ; // Double [radian]
}
- get active() { return this.mActive ; }
+ get active() { return this.mActive ; }
? +
get speed() { return this.mSpeed ; }
get angle() { return this.mAngle ; }
+
+ // toParameter() -> Object
+ toParameter() {
+ let obj = {
+ active: this.mActive,
+ speed: this.mSpeed,
+ angle: this.mAngle
+ } ;
+ return obj ;
+ }
}
class SpriteNodeStatus {
- constructor(pos, size){
+ constructor(pos, size, energy){
? ++++++++
+ checkVariables("SpriteNodeStatus.constructor", pos, size, energy) ;
this.mPosition = pos ; // Point
this.mSize = size ; // Size
+ this.mEnergy = energy ; // Double
}
get position() { return this.mPosition ; }
get size() { return this.mSize ; }
+ get energy() { return this.mEnergy ; }
+
+ // toParameter() -> Object
+ toParameter() {
+ let obj = {
+ position: this.mPosition,
+ size: this.mSize,
+ energy: this.mEnergy
+ } ;
+ return obj ;
+ }
}
| 28 | 1.166667 | 26 | 2 |
1fc71e1d3a95fb02b91c503cff1a9df7ae6531df | src/com/facebook/buck/cxx/AbstractClangCxxCompilationDatabaseEntry.java | src/com/facebook/buck/cxx/AbstractClangCxxCompilationDatabaseEntry.java | /*
* Copyright 2015-present Facebook, Inc.
*
* 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 com.facebook.buck.cxx;
import com.facebook.buck.util.Escaper;
import com.facebook.buck.util.immutables.BuckStyleImmutable;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import org.immutables.value.Value;
@BuckStyleImmutable
@Value.Immutable
abstract class AbstractClangCxxCompilationDatabaseEntry implements CxxCompilationDatabaseEntry {
@Value.Parameter
public abstract String getDirectory();
@Override
@Value.Parameter
public abstract String getFile();
@JsonIgnore
@Value.Parameter
public abstract ImmutableList<String> getArgs();
@Override
@Value.Derived
public String getCommand() {
return Joiner.on(' ').join(
Iterables.transform(
getArgs(),
Escaper.SHELL_ESCAPER));
}
}
| /*
* Copyright 2015-present Facebook, Inc.
*
* 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 com.facebook.buck.cxx;
import com.facebook.buck.util.Escaper;
import com.facebook.buck.util.immutables.BuckStyleImmutable;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import org.immutables.value.Value;
@BuckStyleImmutable
@Value.Immutable
abstract class AbstractClangCxxCompilationDatabaseEntry implements CxxCompilationDatabaseEntry {
@Value.Parameter
public abstract String getDirectory();
@Override
@Value.Parameter
public abstract String getFile();
@Value.Parameter
public abstract ImmutableList<String> getArguments();
@Override
@Value.Derived
public String getCommand() {
return Joiner.on(' ').join(
Iterables.transform(
getArguments(),
Escaper.SHELL_ESCAPER));
}
}
| Add arguments to clang entries. | Add arguments to clang entries.
Summary:
http://reviews.llvm.org/rL245036 added a new attribute to clang
compilation database entries, `arguments`.
Test Plan:
CI
create a compilation database with clang format, see it has `arguments`
| Java | apache-2.0 | OkBuilds/buck,daedric/buck,OkBuilds/buck,tgummerer/buck,Dominator008/buck,zhan-xiong/buck,rmaz/buck,marcinkwiatkowski/buck,brettwooldridge/buck,illicitonion/buck,tgummerer/buck,Addepar/buck,ilya-klyuchnikov/buck,shs96c/buck,dsyang/buck,illicitonion/buck,mogers/buck,liuyang-li/buck,sdwilsh/buck,k21/buck,Dominator008/buck,robbertvanginkel/buck,mikekap/buck,SeleniumHQ/buck,tgummerer/buck,janicduplessis/buck,daedric/buck,tgummerer/buck,nguyentruongtho/buck,romanoid/buck,daedric/buck,rhencke/buck,kageiit/buck,nguyentruongtho/buck,facebook/buck,shybovycha/buck,LegNeato/buck,liuyang-li/buck,vine/buck,kageiit/buck,OkBuilds/buck,liuyang-li/buck,mikekap/buck,darkforestzero/buck,Distrotech/buck,JoelMarcey/buck,raviagarwal7/buck,justinmuller/buck,sdwilsh/buck,rhencke/buck,mogers/buck,rmaz/buck,zhan-xiong/buck,marcinkwiatkowski/buck,romanoid/buck,mogers/buck,liuyang-li/buck,rhencke/buck,robbertvanginkel/buck,nguyentruongtho/buck,zhan-xiong/buck,ilya-klyuchnikov/buck,davido/buck,liuyang-li/buck,mogers/buck,marcinkwiatkowski/buck,OkBuilds/buck,vine/buck,grumpyjames/buck,bocon13/buck,rhencke/buck,ilya-klyuchnikov/buck,Addepar/buck,dsyang/buck,raviagarwal7/buck,OkBuilds/buck,brettwooldridge/buck,zpao/buck,tgummerer/buck,grumpyjames/buck,marcinkwiatkowski/buck,k21/buck,shybovycha/buck,Distrotech/buck,robbertvanginkel/buck,k21/buck,justinmuller/buck,shybovycha/buck,JoelMarcey/buck,facebook/buck,justinmuller/buck,vschs007/buck,clonetwin26/buck,k21/buck,shybovycha/buck,brettwooldridge/buck,rmaz/buck,dsyang/buck,raviagarwal7/buck,vschs007/buck,mogers/buck,rhencke/buck,shybovycha/buck,grumpyjames/buck,Dominator008/buck,clonetwin26/buck,justinmuller/buck,SeleniumHQ/buck,janicduplessis/buck,Addepar/buck,ilya-klyuchnikov/buck,daedric/buck,vine/buck,mikekap/buck,clonetwin26/buck,grumpyjames/buck,Dominator008/buck,OkBuilds/buck,Dominator008/buck,JoelMarcey/buck,rowillia/buck,raviagarwal7/buck,illicitonion/buck,darkforestzero/buck,janicduplessis/buck,vschs007/buck,JoelMarcey/buck,rowillia/buck,tgummerer/buck,SeleniumHQ/buck,brettwooldridge/buck,Addepar/buck,mikekap/buck,kageiit/buck,vschs007/buck,illicitonion/buck,darkforestzero/buck,vine/buck,LegNeato/buck,OkBuilds/buck,Distrotech/buck,ilya-klyuchnikov/buck,justinmuller/buck,clonetwin26/buck,justinmuller/buck,zhan-xiong/buck,romanoid/buck,clonetwin26/buck,Dominator008/buck,tgummerer/buck,romanoid/buck,dsyang/buck,SeleniumHQ/buck,romanoid/buck,shs96c/buck,illicitonion/buck,dsyang/buck,zhan-xiong/buck,mikekap/buck,rmaz/buck,rowillia/buck,shs96c/buck,nguyentruongtho/buck,SeleniumHQ/buck,daedric/buck,shs96c/buck,romanoid/buck,robbertvanginkel/buck,raviagarwal7/buck,k21/buck,ilya-klyuchnikov/buck,clonetwin26/buck,sdwilsh/buck,Addepar/buck,brettwooldridge/buck,marcinkwiatkowski/buck,robbertvanginkel/buck,SeleniumHQ/buck,daedric/buck,zhan-xiong/buck,shs96c/buck,Distrotech/buck,kageiit/buck,JoelMarcey/buck,darkforestzero/buck,rowillia/buck,clonetwin26/buck,mogers/buck,vschs007/buck,dsyang/buck,zhan-xiong/buck,ilya-klyuchnikov/buck,JoelMarcey/buck,SeleniumHQ/buck,vine/buck,marcinkwiatkowski/buck,JoelMarcey/buck,bocon13/buck,rmaz/buck,romanoid/buck,davido/buck,rmaz/buck,illicitonion/buck,marcinkwiatkowski/buck,justinmuller/buck,justinmuller/buck,rowillia/buck,rmaz/buck,bocon13/buck,grumpyjames/buck,rowillia/buck,OkBuilds/buck,rowillia/buck,janicduplessis/buck,marcinkwiatkowski/buck,mikekap/buck,janicduplessis/buck,vschs007/buck,vine/buck,raviagarwal7/buck,daedric/buck,rmaz/buck,Addepar/buck,facebook/buck,rhencke/buck,Dominator008/buck,romanoid/buck,liuyang-li/buck,grumpyjames/buck,brettwooldridge/buck,shs96c/buck,rhencke/buck,k21/buck,Distrotech/buck,darkforestzero/buck,clonetwin26/buck,Addepar/buck,robbertvanginkel/buck,vschs007/buck,janicduplessis/buck,sdwilsh/buck,SeleniumHQ/buck,rmaz/buck,grumpyjames/buck,dsyang/buck,kageiit/buck,zhan-xiong/buck,davido/buck,rmaz/buck,raviagarwal7/buck,liuyang-li/buck,zhan-xiong/buck,vschs007/buck,marcinkwiatkowski/buck,LegNeato/buck,davido/buck,raviagarwal7/buck,OkBuilds/buck,rowillia/buck,rhencke/buck,mogers/buck,janicduplessis/buck,nguyentruongtho/buck,mogers/buck,raviagarwal7/buck,facebook/buck,rowillia/buck,sdwilsh/buck,davido/buck,zhan-xiong/buck,sdwilsh/buck,shybovycha/buck,JoelMarcey/buck,ilya-klyuchnikov/buck,shybovycha/buck,brettwooldridge/buck,justinmuller/buck,brettwooldridge/buck,darkforestzero/buck,raviagarwal7/buck,LegNeato/buck,robbertvanginkel/buck,LegNeato/buck,shybovycha/buck,vine/buck,liuyang-li/buck,davido/buck,k21/buck,rowillia/buck,nguyentruongtho/buck,SeleniumHQ/buck,grumpyjames/buck,mikekap/buck,liuyang-li/buck,shybovycha/buck,darkforestzero/buck,Dominator008/buck,illicitonion/buck,Dominator008/buck,romanoid/buck,zhan-xiong/buck,raviagarwal7/buck,daedric/buck,illicitonion/buck,marcinkwiatkowski/buck,shs96c/buck,k21/buck,shybovycha/buck,illicitonion/buck,liuyang-li/buck,janicduplessis/buck,rowillia/buck,shs96c/buck,facebook/buck,k21/buck,robbertvanginkel/buck,davido/buck,davido/buck,illicitonion/buck,Addepar/buck,shs96c/buck,illicitonion/buck,k21/buck,illicitonion/buck,sdwilsh/buck,marcinkwiatkowski/buck,bocon13/buck,vschs007/buck,bocon13/buck,darkforestzero/buck,clonetwin26/buck,shybovycha/buck,bocon13/buck,sdwilsh/buck,dsyang/buck,Distrotech/buck,Distrotech/buck,mogers/buck,vine/buck,vschs007/buck,sdwilsh/buck,janicduplessis/buck,OkBuilds/buck,Addepar/buck,clonetwin26/buck,shs96c/buck,mogers/buck,daedric/buck,brettwooldridge/buck,justinmuller/buck,shs96c/buck,LegNeato/buck,zpao/buck,JoelMarcey/buck,rowillia/buck,Addepar/buck,darkforestzero/buck,tgummerer/buck,romanoid/buck,SeleniumHQ/buck,kageiit/buck,justinmuller/buck,facebook/buck,brettwooldridge/buck,marcinkwiatkowski/buck,marcinkwiatkowski/buck,dsyang/buck,vschs007/buck,bocon13/buck,rhencke/buck,davido/buck,raviagarwal7/buck,vschs007/buck,daedric/buck,zpao/buck,nguyentruongtho/buck,sdwilsh/buck,zpao/buck,illicitonion/buck,daedric/buck,JoelMarcey/buck,Addepar/buck,OkBuilds/buck,LegNeato/buck,daedric/buck,JoelMarcey/buck,Dominator008/buck,shybovycha/buck,vine/buck,Addepar/buck,grumpyjames/buck,darkforestzero/buck,dsyang/buck,bocon13/buck,robbertvanginkel/buck,OkBuilds/buck,robbertvanginkel/buck,ilya-klyuchnikov/buck,romanoid/buck,brettwooldridge/buck,rmaz/buck,romanoid/buck,davido/buck,rhencke/buck,ilya-klyuchnikov/buck,Distrotech/buck,liuyang-li/buck,JoelMarcey/buck,OkBuilds/buck,shs96c/buck,Distrotech/buck,SeleniumHQ/buck,clonetwin26/buck,mikekap/buck,bocon13/buck,grumpyjames/buck,tgummerer/buck,Distrotech/buck,shybovycha/buck,sdwilsh/buck,ilya-klyuchnikov/buck,Dominator008/buck,davido/buck,janicduplessis/buck,zpao/buck,zhan-xiong/buck,sdwilsh/buck,vine/buck,mogers/buck,sdwilsh/buck,SeleniumHQ/buck,clonetwin26/buck,justinmuller/buck,rmaz/buck,raviagarwal7/buck,LegNeato/buck,romanoid/buck,darkforestzero/buck,darkforestzero/buck,bocon13/buck,zhan-xiong/buck,LegNeato/buck,dsyang/buck,brettwooldridge/buck,mikekap/buck,tgummerer/buck,grumpyjames/buck,Dominator008/buck,LegNeato/buck,k21/buck,robbertvanginkel/buck,k21/buck,darkforestzero/buck,brettwooldridge/buck,vschs007/buck,vine/buck,k21/buck,SeleniumHQ/buck,ilya-klyuchnikov/buck,mikekap/buck,facebook/buck,Addepar/buck,tgummerer/buck,grumpyjames/buck,davido/buck,davido/buck,dsyang/buck,mikekap/buck,ilya-klyuchnikov/buck,kageiit/buck,zpao/buck,mikekap/buck,shs96c/buck,rhencke/buck,LegNeato/buck,LegNeato/buck,bocon13/buck,robbertvanginkel/buck,robbertvanginkel/buck,justinmuller/buck,janicduplessis/buck,LegNeato/buck,clonetwin26/buck,rmaz/buck,zpao/buck,bocon13/buck,Distrotech/buck,JoelMarcey/buck,janicduplessis/buck,dsyang/buck,daedric/buck | java | ## Code Before:
/*
* Copyright 2015-present Facebook, Inc.
*
* 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 com.facebook.buck.cxx;
import com.facebook.buck.util.Escaper;
import com.facebook.buck.util.immutables.BuckStyleImmutable;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import org.immutables.value.Value;
@BuckStyleImmutable
@Value.Immutable
abstract class AbstractClangCxxCompilationDatabaseEntry implements CxxCompilationDatabaseEntry {
@Value.Parameter
public abstract String getDirectory();
@Override
@Value.Parameter
public abstract String getFile();
@JsonIgnore
@Value.Parameter
public abstract ImmutableList<String> getArgs();
@Override
@Value.Derived
public String getCommand() {
return Joiner.on(' ').join(
Iterables.transform(
getArgs(),
Escaper.SHELL_ESCAPER));
}
}
## Instruction:
Add arguments to clang entries.
Summary:
http://reviews.llvm.org/rL245036 added a new attribute to clang
compilation database entries, `arguments`.
Test Plan:
CI
create a compilation database with clang format, see it has `arguments`
## Code After:
/*
* Copyright 2015-present Facebook, Inc.
*
* 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 com.facebook.buck.cxx;
import com.facebook.buck.util.Escaper;
import com.facebook.buck.util.immutables.BuckStyleImmutable;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import org.immutables.value.Value;
@BuckStyleImmutable
@Value.Immutable
abstract class AbstractClangCxxCompilationDatabaseEntry implements CxxCompilationDatabaseEntry {
@Value.Parameter
public abstract String getDirectory();
@Override
@Value.Parameter
public abstract String getFile();
@Value.Parameter
public abstract ImmutableList<String> getArguments();
@Override
@Value.Derived
public String getCommand() {
return Joiner.on(' ').join(
Iterables.transform(
getArguments(),
Escaper.SHELL_ESCAPER));
}
}
| /*
* Copyright 2015-present Facebook, Inc.
*
* 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 com.facebook.buck.cxx;
import com.facebook.buck.util.Escaper;
import com.facebook.buck.util.immutables.BuckStyleImmutable;
- import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import org.immutables.value.Value;
@BuckStyleImmutable
@Value.Immutable
abstract class AbstractClangCxxCompilationDatabaseEntry implements CxxCompilationDatabaseEntry {
@Value.Parameter
public abstract String getDirectory();
@Override
@Value.Parameter
public abstract String getFile();
- @JsonIgnore
@Value.Parameter
- public abstract ImmutableList<String> getArgs();
+ public abstract ImmutableList<String> getArguments();
? +++++
@Override
@Value.Derived
public String getCommand() {
return Joiner.on(' ').join(
Iterables.transform(
- getArgs(),
+ getArguments(),
? +++++
Escaper.SHELL_ESCAPER));
}
} | 6 | 0.115385 | 2 | 4 |
c019b5c58ff6e6a0f30b36a27b2b0c4eb9620291 | travis/build-wheels.sh | travis/build-wheels.sh | set -e -x
for PYBIN in /opt/python/*/bin; do
${PYBIN}/pip install -r /io/dev-requirements.txt
${PYBIN}/pip wheel /io/ -w wheelhouse/
done
for whl in wheelhouse/*.whl; do
auditwheel repair $whl -w /io/wheelhouse/
done
for PYBIN in /opt/python/*/bin/; do
${PYBIN}/pip install arpreq --no-index -f /io/wheelhouse
(cd $HOME; ${PYBIN}/py.test /io/tests)
done
| set -exuo pipefail
cache_dir=/io/wheelhouse/pip-cache
cd /opt/python
readonly -a versions=(*)
cd "${HOME}"
# Compile wheels
for version in "${versions[@]}"; do
if [[ -x "/opt/python/${version}/bin/virtualenv" ]]; then
declare -a venv=("/opt/python/${version}/bin/virtualenv" --system-site-packages --without-pip)
else
declare -a venv=("/opt/python/${version}/bin/python" -m venv --system-site-packages --without-pip)
fi
"${venv[@]}" "${version}"
"${version}/bin/python" -m pip install --cache-dir "${cache_dir}" -r /io/dev-requirements.txt
"${version}/bin/python" -m pip wheel /io/ --no-deps
done
# Bundle external shared libraries into the wheels
for wheel in *.whl; do
auditwheel repair "$wheel" --plat "$PLAT" -w /io/wheelhouse/
done
# Install packages and test
for version in "${versions[@]}"; do
"${version}/bin/python" -m pip install arpreq --no-index -f /io/wheelhouse
"${version}/bin/python" -m pytest /io/tests -v
done
| Build wheels in virtual environment | Build wheels in virtual environment
| Shell | mit | sebschrader/python-arpreq,sebschrader/python-arpreq,sebschrader/python-arpreq,sebschrader/python-arpreq | shell | ## Code Before:
set -e -x
for PYBIN in /opt/python/*/bin; do
${PYBIN}/pip install -r /io/dev-requirements.txt
${PYBIN}/pip wheel /io/ -w wheelhouse/
done
for whl in wheelhouse/*.whl; do
auditwheel repair $whl -w /io/wheelhouse/
done
for PYBIN in /opt/python/*/bin/; do
${PYBIN}/pip install arpreq --no-index -f /io/wheelhouse
(cd $HOME; ${PYBIN}/py.test /io/tests)
done
## Instruction:
Build wheels in virtual environment
## Code After:
set -exuo pipefail
cache_dir=/io/wheelhouse/pip-cache
cd /opt/python
readonly -a versions=(*)
cd "${HOME}"
# Compile wheels
for version in "${versions[@]}"; do
if [[ -x "/opt/python/${version}/bin/virtualenv" ]]; then
declare -a venv=("/opt/python/${version}/bin/virtualenv" --system-site-packages --without-pip)
else
declare -a venv=("/opt/python/${version}/bin/python" -m venv --system-site-packages --without-pip)
fi
"${venv[@]}" "${version}"
"${version}/bin/python" -m pip install --cache-dir "${cache_dir}" -r /io/dev-requirements.txt
"${version}/bin/python" -m pip wheel /io/ --no-deps
done
# Bundle external shared libraries into the wheels
for wheel in *.whl; do
auditwheel repair "$wheel" --plat "$PLAT" -w /io/wheelhouse/
done
# Install packages and test
for version in "${versions[@]}"; do
"${version}/bin/python" -m pip install arpreq --no-index -f /io/wheelhouse
"${version}/bin/python" -m pytest /io/tests -v
done
| - set -e -x
+ set -exuo pipefail
- for PYBIN in /opt/python/*/bin; do
- ${PYBIN}/pip install -r /io/dev-requirements.txt
- ${PYBIN}/pip wheel /io/ -w wheelhouse/
+ cache_dir=/io/wheelhouse/pip-cache
+ cd /opt/python
+ readonly -a versions=(*)
+ cd "${HOME}"
+
+ # Compile wheels
+ for version in "${versions[@]}"; do
+ if [[ -x "/opt/python/${version}/bin/virtualenv" ]]; then
+ declare -a venv=("/opt/python/${version}/bin/virtualenv" --system-site-packages --without-pip)
+ else
+ declare -a venv=("/opt/python/${version}/bin/python" -m venv --system-site-packages --without-pip)
+ fi
+ "${venv[@]}" "${version}"
+ "${version}/bin/python" -m pip install --cache-dir "${cache_dir}" -r /io/dev-requirements.txt
+ "${version}/bin/python" -m pip wheel /io/ --no-deps
done
+ # Bundle external shared libraries into the wheels
- for whl in wheelhouse/*.whl; do
? -----------
+ for wheel in *.whl; do
? ++
- auditwheel repair $whl -w /io/wheelhouse/
+ auditwheel repair "$wheel" --plat "$PLAT" -w /io/wheelhouse/
? + ++ ++++++++++++++++
done
- for PYBIN in /opt/python/*/bin/; do
+ # Install packages and test
+ for version in "${versions[@]}"; do
- ${PYBIN}/pip install arpreq --no-index -f /io/wheelhouse
? ^^^^^
+ "${version}/bin/python" -m pip install arpreq --no-index -f /io/wheelhouse
? + ^^^^^^^ +++++++++++++++
- (cd $HOME; ${PYBIN}/py.test /io/tests)
+ "${version}/bin/python" -m pytest /io/tests -v
done | 32 | 2.133333 | 23 | 9 |
2052f5f83a280c4ec4ce72e99957f9aadf3b53ae | layouts/index.html | layouts/index.html | {{ define "main" }}
<div>
<h1>{{ .Site.Title }}</h1>
{{- with .Site.Params.homeSubtitle }}
<p>{{.}}</p>
{{- end }}
{{- with .Site.Params.social }}
<div>
{{ partialCached "social-icons.html" . }}
</div>
{{- end }}
</div>
{{ end }}
| {{ define "main" }}
<main aria-role="main">
<div>
<h1>{{ .Site.Title }}</h1>
{{- with .Site.Params.homeSubtitle }}
<p>{{.}}</p>
{{- end }}
{{- with .Site.Params.social }}
<div>
{{ partial "social-icons.html" . }}
</div>
{{- end }}
</div>
</main>
{{ end }}
| Add main tag in homepage | Add main tag in homepage
| HTML | mit | MSF-Jarvis/msf-jarvis.github.io | html | ## Code Before:
{{ define "main" }}
<div>
<h1>{{ .Site.Title }}</h1>
{{- with .Site.Params.homeSubtitle }}
<p>{{.}}</p>
{{- end }}
{{- with .Site.Params.social }}
<div>
{{ partialCached "social-icons.html" . }}
</div>
{{- end }}
</div>
{{ end }}
## Instruction:
Add main tag in homepage
## Code After:
{{ define "main" }}
<main aria-role="main">
<div>
<h1>{{ .Site.Title }}</h1>
{{- with .Site.Params.homeSubtitle }}
<p>{{.}}</p>
{{- end }}
{{- with .Site.Params.social }}
<div>
{{ partial "social-icons.html" . }}
</div>
{{- end }}
</div>
</main>
{{ end }}
| {{ define "main" }}
+ <main aria-role="main">
- <div>
+ <div>
? ++++
- <h1>{{ .Site.Title }}</h1>
+ <h1>{{ .Site.Title }}</h1>
? ++++
- {{- with .Site.Params.homeSubtitle }}
+ {{- with .Site.Params.homeSubtitle }}
? ++++
- <p>{{.}}</p>
+ <p>{{.}}</p>
? ++++
- {{- end }}
+ {{- end }}
? ++++
- {{- with .Site.Params.social }}
+ {{- with .Site.Params.social }}
? ++++
- <div>
+ <div>
? ++++
- {{ partialCached "social-icons.html" . }}
? ------
+ {{ partial "social-icons.html" . }}
? ++++
- </div>
+ </div>
? ++++
- {{- end }}
+ {{- end }}
? ++++
- </div>
+ </div>
? ++++
+ </main>
{{ end }} | 24 | 1.6 | 13 | 11 |
54ba447deb2b25633122d66bb106e898b3303595 | .travis.yml | .travis.yml | language: objective-c
sudo: false # Enable container-based builds
env:
matrix:
- EXAMPLE="cats"
- EXAMPLE="llvm_projects"
before_install: brew update
install: brew install python3
before_script: python3 setup.py -q install
script: scripts/test_${EXAMPLE}_example.sh
branches:
only: # whitelist
- master
notifications:
email: false
| language: objective-c
sudo: false # Enable container-based builds
env:
matrix:
- EXAMPLE="cats"
- EXAMPLE="llvm_projects"
before_install: brew update
install: brew install python3
before_script: python3 setup.py -q install
script: scripts/test_${EXAMPLE}_example.sh
branches:
only: # whitelist
- master
notifications:
email: false
slack:
secure: G5UcsKT8xMjddtTSUPXECI3uobS5/sRn87iC+fMilbpnDK3yAGoKkyCfPK4E/kJSEPZ8hBKz3uHNzpb0DdOSsjbAItiI+RQ3Glgs86B1sg2pqB2uwVPDCyPn8XHnpYPkKxFYlG19/JG9SEDej4N3kjnB4FVBm7n38ZFWjZh7s2fOjlpPKiHz8pe3B8XYfXTyQGIr9Q2I1eHbQJOEzs4PO1j/uKC1jgwe7nZnOE3sYsfcabScEHTz4Z7s9xhRXcwvorhQYQtBS7id9Gg5E4ANhoVVs7QifazDE1EK3vWjvoFYgYKnCbXzQunB09XlymrWTJZx80JOmgALU0UPUEI8Wvt/kXQP9oxqsMEeoP7UbZvXTfmeOVlm+5f5oesp/JQeBvaPj5qnbWVzcMGqi/hev4qwNv01jQOWrzVmZazw+HgeQcuaHKprK7KLdPFQR5c6CJJtwIxwdRGLmHVTtKIVQo45mEEnjHpYOmbkmmN2VETdgRlkV8t0WdCQpXXVH7uniwa7cYzb9shpiq0o+G3uHN1eUIuia/0XIVgWRL0baN6JitEBvc032M/3UrJESStQFpMF/Nw+NXm38xp7sQWReZM1ZVIBNIR1XPnaZxuLzBhKKCYcByYz7PEF71o/SkWHhAa3EKPO+9q4zceTbWunjRlp1ycUIMyhqDlCpHM8c2Y=
| Add Slack integration for Travis CI | Add Slack integration for Travis CI
| YAML | mit | JrGoodle/clowder,JrGoodle/clowder,JrGoodle/clowder | yaml | ## Code Before:
language: objective-c
sudo: false # Enable container-based builds
env:
matrix:
- EXAMPLE="cats"
- EXAMPLE="llvm_projects"
before_install: brew update
install: brew install python3
before_script: python3 setup.py -q install
script: scripts/test_${EXAMPLE}_example.sh
branches:
only: # whitelist
- master
notifications:
email: false
## Instruction:
Add Slack integration for Travis CI
## Code After:
language: objective-c
sudo: false # Enable container-based builds
env:
matrix:
- EXAMPLE="cats"
- EXAMPLE="llvm_projects"
before_install: brew update
install: brew install python3
before_script: python3 setup.py -q install
script: scripts/test_${EXAMPLE}_example.sh
branches:
only: # whitelist
- master
notifications:
email: false
slack:
secure: G5UcsKT8xMjddtTSUPXECI3uobS5/sRn87iC+fMilbpnDK3yAGoKkyCfPK4E/kJSEPZ8hBKz3uHNzpb0DdOSsjbAItiI+RQ3Glgs86B1sg2pqB2uwVPDCyPn8XHnpYPkKxFYlG19/JG9SEDej4N3kjnB4FVBm7n38ZFWjZh7s2fOjlpPKiHz8pe3B8XYfXTyQGIr9Q2I1eHbQJOEzs4PO1j/uKC1jgwe7nZnOE3sYsfcabScEHTz4Z7s9xhRXcwvorhQYQtBS7id9Gg5E4ANhoVVs7QifazDE1EK3vWjvoFYgYKnCbXzQunB09XlymrWTJZx80JOmgALU0UPUEI8Wvt/kXQP9oxqsMEeoP7UbZvXTfmeOVlm+5f5oesp/JQeBvaPj5qnbWVzcMGqi/hev4qwNv01jQOWrzVmZazw+HgeQcuaHKprK7KLdPFQR5c6CJJtwIxwdRGLmHVTtKIVQo45mEEnjHpYOmbkmmN2VETdgRlkV8t0WdCQpXXVH7uniwa7cYzb9shpiq0o+G3uHN1eUIuia/0XIVgWRL0baN6JitEBvc032M/3UrJESStQFpMF/Nw+NXm38xp7sQWReZM1ZVIBNIR1XPnaZxuLzBhKKCYcByYz7PEF71o/SkWHhAa3EKPO+9q4zceTbWunjRlp1ycUIMyhqDlCpHM8c2Y=
| language: objective-c
sudo: false # Enable container-based builds
env:
matrix:
- EXAMPLE="cats"
- EXAMPLE="llvm_projects"
before_install: brew update
install: brew install python3
before_script: python3 setup.py -q install
script: scripts/test_${EXAMPLE}_example.sh
branches:
only: # whitelist
- master
notifications:
email: false
+ slack:
+ secure: G5UcsKT8xMjddtTSUPXECI3uobS5/sRn87iC+fMilbpnDK3yAGoKkyCfPK4E/kJSEPZ8hBKz3uHNzpb0DdOSsjbAItiI+RQ3Glgs86B1sg2pqB2uwVPDCyPn8XHnpYPkKxFYlG19/JG9SEDej4N3kjnB4FVBm7n38ZFWjZh7s2fOjlpPKiHz8pe3B8XYfXTyQGIr9Q2I1eHbQJOEzs4PO1j/uKC1jgwe7nZnOE3sYsfcabScEHTz4Z7s9xhRXcwvorhQYQtBS7id9Gg5E4ANhoVVs7QifazDE1EK3vWjvoFYgYKnCbXzQunB09XlymrWTJZx80JOmgALU0UPUEI8Wvt/kXQP9oxqsMEeoP7UbZvXTfmeOVlm+5f5oesp/JQeBvaPj5qnbWVzcMGqi/hev4qwNv01jQOWrzVmZazw+HgeQcuaHKprK7KLdPFQR5c6CJJtwIxwdRGLmHVTtKIVQo45mEEnjHpYOmbkmmN2VETdgRlkV8t0WdCQpXXVH7uniwa7cYzb9shpiq0o+G3uHN1eUIuia/0XIVgWRL0baN6JitEBvc032M/3UrJESStQFpMF/Nw+NXm38xp7sQWReZM1ZVIBNIR1XPnaZxuLzBhKKCYcByYz7PEF71o/SkWHhAa3EKPO+9q4zceTbWunjRlp1ycUIMyhqDlCpHM8c2Y= | 2 | 0.086957 | 2 | 0 |
e79b6dad035d55297922a078fc633fbba9238767 | public/js/discourse.js | public/js/discourse.js | var discourseUrl = window.hackdash && window.hackdash.discourseUrl;
if (discourseUrl) {
DiscourseEmbed = {
discourseEmbedUrl: window.location.href,
discourseUrl: discourseUrl
};
// The only way to re-execute Discourse embedding script seems to be to re-insert it.
$("#discourse-comments").remove();
$("#discourse-embed-script").remove();
$(".discourse-ctn").append($("<div>", {
"id": "discourse-comments"
}));
$("head").append($("<script>", {
"async": true,
"id": "discourse-embed-script",
"src": DiscourseEmbed.discourseUrl + 'javascripts/embed.js',
"type": "text/javascript"
}));
}
| var discourseUrl = window.hackdash && window.hackdash.discourseUrl;
if (discourseUrl) {
DiscourseEmbed = {
discourseEmbedUrl: [location.protocol, '//', location.host, location.pathname].join(''),
discourseUrl: discourseUrl
};
// The only way to re-execute Discourse embedding script seems to be to re-insert it.
$("#discourse-comments").remove();
$("#discourse-embed-script").remove();
$(".discourse-ctn").append($("<div>", {
"id": "discourse-comments"
}));
$("head").append($("<script>", {
"async": true,
"id": "discourse-embed-script",
"src": DiscourseEmbed.discourseUrl + 'javascripts/embed.js',
"type": "text/javascript"
}));
}
| Remove query and hash from Discourse URLs. | Remove query and hash from Discourse URLs.
In some cases, hackdash adds a query to the URL of the projects. This patch ignore the query, to ensure that 2 different Discourse forums are not created for the same project. | JavaScript | mit | danzajdband/hackdash,impronunciable/hackdash,danzajdband/hackdash,impronunciable/hackdash | javascript | ## Code Before:
var discourseUrl = window.hackdash && window.hackdash.discourseUrl;
if (discourseUrl) {
DiscourseEmbed = {
discourseEmbedUrl: window.location.href,
discourseUrl: discourseUrl
};
// The only way to re-execute Discourse embedding script seems to be to re-insert it.
$("#discourse-comments").remove();
$("#discourse-embed-script").remove();
$(".discourse-ctn").append($("<div>", {
"id": "discourse-comments"
}));
$("head").append($("<script>", {
"async": true,
"id": "discourse-embed-script",
"src": DiscourseEmbed.discourseUrl + 'javascripts/embed.js',
"type": "text/javascript"
}));
}
## Instruction:
Remove query and hash from Discourse URLs.
In some cases, hackdash adds a query to the URL of the projects. This patch ignore the query, to ensure that 2 different Discourse forums are not created for the same project.
## Code After:
var discourseUrl = window.hackdash && window.hackdash.discourseUrl;
if (discourseUrl) {
DiscourseEmbed = {
discourseEmbedUrl: [location.protocol, '//', location.host, location.pathname].join(''),
discourseUrl: discourseUrl
};
// The only way to re-execute Discourse embedding script seems to be to re-insert it.
$("#discourse-comments").remove();
$("#discourse-embed-script").remove();
$(".discourse-ctn").append($("<div>", {
"id": "discourse-comments"
}));
$("head").append($("<script>", {
"async": true,
"id": "discourse-embed-script",
"src": DiscourseEmbed.discourseUrl + 'javascripts/embed.js',
"type": "text/javascript"
}));
}
| var discourseUrl = window.hackdash && window.hackdash.discourseUrl;
if (discourseUrl) {
DiscourseEmbed = {
- discourseEmbedUrl: window.location.href,
+ discourseEmbedUrl: [location.protocol, '//', location.host, location.pathname].join(''),
discourseUrl: discourseUrl
};
// The only way to re-execute Discourse embedding script seems to be to re-insert it.
$("#discourse-comments").remove();
$("#discourse-embed-script").remove();
$(".discourse-ctn").append($("<div>", {
"id": "discourse-comments"
}));
$("head").append($("<script>", {
"async": true,
"id": "discourse-embed-script",
"src": DiscourseEmbed.discourseUrl + 'javascripts/embed.js',
"type": "text/javascript"
}));
} | 2 | 0.105263 | 1 | 1 |
efc47b800fda5543361c0f4105b66e40142ebb88 | jest.config.js | jest.config.js | /* eslint-env node */
const { JEST_NOTIFY, ENABLE_JEST_NOTIFICATIONS } = process.env
module.exports = {
// Provides nice test output of what's being run
verbose: true,
// OS notifications of test results in watch mode only
// 😢 https://github.com/facebook/jest/issues/8036
notify: Boolean(JEST_NOTIFY) && Boolean(ENABLE_JEST_NOTIFICATIONS),
// Test coverage can be enforced with a coverageThreshold
collectCoverage: true,
coverageReporters: ['text-summary'],
collectCoverageFrom: ['src/**/*.js'],
// Pre/Post test framework setup configs
setupFilesAfterEnv: ['<rootDir>/test/jest-extend.js'],
}
| /* eslint-env node */
const { ENABLE_JEST_NOTIFICATIONS } = process.env
module.exports = {
// Provides nice test output of what's being run
verbose: true,
// OS notifications of test results is an opt in for funesies
notify: Boolean(ENABLE_JEST_NOTIFICATIONS),
// Test coverage can be enforced with a coverageThreshold
collectCoverage: true,
coverageReporters: ['text-summary'],
collectCoverageFrom: ['src/**/*.js', '!**/*.stories.js'],
// Pre/Post test framework setup configs
setupFilesAfterEnv: ['<rootDir>/test/jest-extend.js'],
}
| Fix test coverage metrics and enable notifications again 🎉 | Test: Fix test coverage metrics and enable notifications again 🎉
| JavaScript | mit | crystal-ball/componentry,crystal-ball/componentry,crystal-ball/componentry | javascript | ## Code Before:
/* eslint-env node */
const { JEST_NOTIFY, ENABLE_JEST_NOTIFICATIONS } = process.env
module.exports = {
// Provides nice test output of what's being run
verbose: true,
// OS notifications of test results in watch mode only
// 😢 https://github.com/facebook/jest/issues/8036
notify: Boolean(JEST_NOTIFY) && Boolean(ENABLE_JEST_NOTIFICATIONS),
// Test coverage can be enforced with a coverageThreshold
collectCoverage: true,
coverageReporters: ['text-summary'],
collectCoverageFrom: ['src/**/*.js'],
// Pre/Post test framework setup configs
setupFilesAfterEnv: ['<rootDir>/test/jest-extend.js'],
}
## Instruction:
Test: Fix test coverage metrics and enable notifications again 🎉
## Code After:
/* eslint-env node */
const { ENABLE_JEST_NOTIFICATIONS } = process.env
module.exports = {
// Provides nice test output of what's being run
verbose: true,
// OS notifications of test results is an opt in for funesies
notify: Boolean(ENABLE_JEST_NOTIFICATIONS),
// Test coverage can be enforced with a coverageThreshold
collectCoverage: true,
coverageReporters: ['text-summary'],
collectCoverageFrom: ['src/**/*.js', '!**/*.stories.js'],
// Pre/Post test framework setup configs
setupFilesAfterEnv: ['<rootDir>/test/jest-extend.js'],
}
| /* eslint-env node */
- const { JEST_NOTIFY, ENABLE_JEST_NOTIFICATIONS } = process.env
? -------------
+ const { ENABLE_JEST_NOTIFICATIONS } = process.env
module.exports = {
// Provides nice test output of what's being run
verbose: true,
- // OS notifications of test results in watch mode only
? ^^ -- ^ ^ ^^^^^
+ // OS notifications of test results is an opt in for funesies
? +++ ^^ ^^^^ ^^^^^ ^^^^
- // 😢 https://github.com/facebook/jest/issues/8036
- notify: Boolean(JEST_NOTIFY) && Boolean(ENABLE_JEST_NOTIFICATIONS),
? ------------------------
+ notify: Boolean(ENABLE_JEST_NOTIFICATIONS),
// Test coverage can be enforced with a coverageThreshold
collectCoverage: true,
coverageReporters: ['text-summary'],
- collectCoverageFrom: ['src/**/*.js'],
+ collectCoverageFrom: ['src/**/*.js', '!**/*.stories.js'],
? ++++++++++++++++++++
// Pre/Post test framework setup configs
setupFilesAfterEnv: ['<rootDir>/test/jest-extend.js'],
} | 9 | 0.45 | 4 | 5 |
5fce4a70f2c9b1bd46b3fa61683030b1f24c224b | src/jsx/components/Intro.jsx | src/jsx/components/Intro.jsx | import React, { Component } from 'react';
import links from 'css/components/_links.scss';
import { Section, Content, Title } from './layout';
export default class Intro extends Component {
render() {
return (
<Section>
<Content>
<Title>About</Title>
<p>Hey, nice to meet you, I'm David Minnerly. I'm a programmer, 3D modeler, and I also make websites on occasion.</p>
<p>I'm 20 years old and I've been programming since I was 13. I'm fluent in Lua, and I can hold my ground in JavaScript and Python. I've also done a bit of 3D modeling in recent years, and I've made a few websites. I frequently post about what I'm up to on <a href="https://twitter.com/voxeldavid" className={links.twitter}>Twitter <i className="fa fa-twitter" /></a> and many of my projets are open-sourced on <a href="https://github.com/vocksel" className={links.github}>GitHub <i className="fa fa-github" /></a>.</p>
</Content>
</Section>
);
}
}
| import React, { Component } from 'react';
import links from 'css/components/_links.scss';
import { Section, Content, Title } from './layout';
export default class Intro extends Component {
render() {
return (
<Section>
<Content>
<Title>About</Title>
<p>Hey, nice to meet you, I'm David Minnerly. I'm a programmer, 3D modeler, and I also make websites on occasion.</p>
<p>I'm 20 years old and I've been programming since I was 13. I'm fluent in Lua, and I can hold my ground in JavaScript and Python. I frequently post about what I'm up to on <a href="https://twitter.com/voxeldavid" className={links.twitter}>Twitter <i className="fa fa-twitter" /></a> and many of my projets are open-sourced on <a href="https://github.com/vocksel" className={links.github}>GitHub <i className="fa fa-github" /></a>.</p>
</Content>
</Section>
);
}
}
| Remove a sentence about my recent work | Remove a sentence about my recent work
It didn't really fit with the rest of the paragraph. Going from my selling points to social media flows a lot better
| JSX | mit | VoxelDavid/voxeldavid-website,VoxelDavid/voxeldavid-website,vocksel/my-website,vocksel/my-website | jsx | ## Code Before:
import React, { Component } from 'react';
import links from 'css/components/_links.scss';
import { Section, Content, Title } from './layout';
export default class Intro extends Component {
render() {
return (
<Section>
<Content>
<Title>About</Title>
<p>Hey, nice to meet you, I'm David Minnerly. I'm a programmer, 3D modeler, and I also make websites on occasion.</p>
<p>I'm 20 years old and I've been programming since I was 13. I'm fluent in Lua, and I can hold my ground in JavaScript and Python. I've also done a bit of 3D modeling in recent years, and I've made a few websites. I frequently post about what I'm up to on <a href="https://twitter.com/voxeldavid" className={links.twitter}>Twitter <i className="fa fa-twitter" /></a> and many of my projets are open-sourced on <a href="https://github.com/vocksel" className={links.github}>GitHub <i className="fa fa-github" /></a>.</p>
</Content>
</Section>
);
}
}
## Instruction:
Remove a sentence about my recent work
It didn't really fit with the rest of the paragraph. Going from my selling points to social media flows a lot better
## Code After:
import React, { Component } from 'react';
import links from 'css/components/_links.scss';
import { Section, Content, Title } from './layout';
export default class Intro extends Component {
render() {
return (
<Section>
<Content>
<Title>About</Title>
<p>Hey, nice to meet you, I'm David Minnerly. I'm a programmer, 3D modeler, and I also make websites on occasion.</p>
<p>I'm 20 years old and I've been programming since I was 13. I'm fluent in Lua, and I can hold my ground in JavaScript and Python. I frequently post about what I'm up to on <a href="https://twitter.com/voxeldavid" className={links.twitter}>Twitter <i className="fa fa-twitter" /></a> and many of my projets are open-sourced on <a href="https://github.com/vocksel" className={links.github}>GitHub <i className="fa fa-github" /></a>.</p>
</Content>
</Section>
);
}
}
| import React, { Component } from 'react';
import links from 'css/components/_links.scss';
import { Section, Content, Title } from './layout';
export default class Intro extends Component {
render() {
return (
<Section>
<Content>
<Title>About</Title>
<p>Hey, nice to meet you, I'm David Minnerly. I'm a programmer, 3D modeler, and I also make websites on occasion.</p>
- <p>I'm 20 years old and I've been programming since I was 13. I'm fluent in Lua, and I can hold my ground in JavaScript and Python. I've also done a bit of 3D modeling in recent years, and I've made a few websites. I frequently post about what I'm up to on <a href="https://twitter.com/voxeldavid" className={links.twitter}>Twitter <i className="fa fa-twitter" /></a> and many of my projets are open-sourced on <a href="https://github.com/vocksel" className={links.github}>GitHub <i className="fa fa-github" /></a>.</p>
+ <p>I'm 20 years old and I've been programming since I was 13. I'm fluent in Lua, and I can hold my ground in JavaScript and Python. I frequently post about what I'm up to on <a href="https://twitter.com/voxeldavid" className={links.twitter}>Twitter <i className="fa fa-twitter" /></a> and many of my projets are open-sourced on <a href="https://github.com/vocksel" className={links.github}>GitHub <i className="fa fa-github" /></a>.</p>
</Content>
</Section>
);
}
} | 2 | 0.1 | 1 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.