commit
stringlengths
40
40
old_file
stringlengths
4
237
new_file
stringlengths
4
237
old_contents
stringlengths
1
4.24k
new_contents
stringlengths
5
4.84k
subject
stringlengths
15
778
message
stringlengths
16
6.86k
lang
stringlengths
1
30
license
stringclasses
13 values
repos
stringlengths
5
116k
config
stringlengths
1
30
content
stringlengths
105
8.72k
a2a4975a52645a7cf28327a15438ec2ddcb28bfd
src/actions/actions.js
src/actions/actions.js
const ADD_TABLE_ROW = "ADD_TABLE_ROW" const EDIT_TABLE_ROW = "EDIT_TABLE_ROW" const UPDATE_TABLE_CELL = "UPDATE_TABLE_CELL" let nextTableRowId = 0 const addTableRow = (tableRow) => { return { type: ADD_TABLE_ROW, tableRow, id: nextTableRowId++ } } const editTableRow = (id) => { return { type: EDIT_TABLE_ROW, id } } /* tableRow object: { id: Integer, tableName: String, editing: bool, readOnly: bool, cells: [{ tableRowId: Integer, index: Integer, value: String or Number, type: String }] } make Table map the tableRow state it's passed and create TableRow components from it */
const ADD_TABLE_ROW = "ADD_TABLE_ROW" const EDIT_TABLE_ROW = "EDIT_TABLE_ROW" const SAVE_TABLE_ROW = "SAVE_TABLE_ROW" let nextTableRowId = 0 const addTableRow = (tableRow) => { return { type: ADD_TABLE_ROW, tableRow, id: nextTableRowId++ } } //Remove editing state from TableRow, use this passed down as prop const editTableRow = (id) => { return { type: EDIT_TABLE_ROW, id } } const saveTableRow = (cells) => { return { type: SAVE_TABLE_ROW, cells } } /* tableRow object: { id: Integer, tableName: String, editing: bool, readOnly: bool, cells: [{ tableRowId: Integer, index: Integer, value: String or Number, type: String }] } make Table map the tableRow state it's passed and create TableRow components from it */
Add save table row action
Add save table row action
JavaScript
mit
severnsc/brewing-app,severnsc/brewing-app
javascript
## Code Before: const ADD_TABLE_ROW = "ADD_TABLE_ROW" const EDIT_TABLE_ROW = "EDIT_TABLE_ROW" const UPDATE_TABLE_CELL = "UPDATE_TABLE_CELL" let nextTableRowId = 0 const addTableRow = (tableRow) => { return { type: ADD_TABLE_ROW, tableRow, id: nextTableRowId++ } } const editTableRow = (id) => { return { type: EDIT_TABLE_ROW, id } } /* tableRow object: { id: Integer, tableName: String, editing: bool, readOnly: bool, cells: [{ tableRowId: Integer, index: Integer, value: String or Number, type: String }] } make Table map the tableRow state it's passed and create TableRow components from it */ ## Instruction: Add save table row action ## Code After: const ADD_TABLE_ROW = "ADD_TABLE_ROW" const EDIT_TABLE_ROW = "EDIT_TABLE_ROW" const SAVE_TABLE_ROW = "SAVE_TABLE_ROW" let nextTableRowId = 0 const addTableRow = (tableRow) => { return { type: ADD_TABLE_ROW, tableRow, id: nextTableRowId++ } } //Remove editing state from TableRow, use this passed down as prop const editTableRow = (id) => { return { type: EDIT_TABLE_ROW, id } } const saveTableRow = (cells) => { return { type: SAVE_TABLE_ROW, cells } } /* tableRow object: { id: Integer, tableName: String, editing: bool, readOnly: bool, cells: [{ tableRowId: Integer, index: Integer, value: String or Number, type: String }] } make Table map the tableRow state it's passed and create TableRow components from it */
ee0a26fa7ad897ecb7db6abfb18a2eed8cdf0473
framework/stagestack.cpp
framework/stagestack.cpp
namespace OpenApoc { void StageStack::Push(std::shared_ptr<Stage> newStage) { // Pause any current stage if(this->Current()) this->Current()->Pause(); this->Stack.push(newStage); newStage->Begin(); } std::shared_ptr<Stage> StageStack::Pop() { std::shared_ptr<Stage> result = this->Current(); if (result) { Stack.pop(); } // If there's still an item on the stack, resume it if( this->Current() ) this->Current()->Resume(); return result; } std::shared_ptr<Stage> StageStack::Current() { if (this->Stack.empty()) return nullptr; else return this->Stack.top(); } bool StageStack::IsEmpty() { return this->Stack.empty(); } void StageStack::Clear() { while (!this->Stack.empty()) this->Stack.pop(); } }; //namespace OpenApoc
namespace OpenApoc { void StageStack::Push(std::shared_ptr<Stage> newStage) { // Pause any current stage if(this->Current()) this->Current()->Pause(); this->Stack.push(newStage); newStage->Begin(); } std::shared_ptr<Stage> StageStack::Pop() { std::shared_ptr<Stage> result = this->Current(); if (result) { result->Finish(); Stack.pop(); } // If there's still an item on the stack, resume it if( this->Current() ) this->Current()->Resume(); return result; } std::shared_ptr<Stage> StageStack::Current() { if (this->Stack.empty()) return nullptr; else return this->Stack.top(); } bool StageStack::IsEmpty() { return this->Stack.empty(); } void StageStack::Clear() { while (!this->IsEmpty()) this->Pop(); } }; //namespace OpenApoc
Call Finish() on Stages removed from the stack
Call Finish() on Stages removed from the stack
C++
mit
steveschnepp/OpenApoc,ShadowDancer/OpenApoc,Istrebitel/OpenApoc,ShadowDancer/OpenApoc,FranciscoDA/OpenApoc,agry/x-com,AndO3131/OpenApoc,AndO3131/OpenApoc,steveschnepp/OpenApoc,agry/x-com,pmprog/OpenApoc,agry/x-com,FranciscoDA/OpenApoc,pmprog/OpenApoc,Istrebitel/OpenApoc,FranciscoDA/OpenApoc,AndO3131/OpenApoc
c++
## Code Before: namespace OpenApoc { void StageStack::Push(std::shared_ptr<Stage> newStage) { // Pause any current stage if(this->Current()) this->Current()->Pause(); this->Stack.push(newStage); newStage->Begin(); } std::shared_ptr<Stage> StageStack::Pop() { std::shared_ptr<Stage> result = this->Current(); if (result) { Stack.pop(); } // If there's still an item on the stack, resume it if( this->Current() ) this->Current()->Resume(); return result; } std::shared_ptr<Stage> StageStack::Current() { if (this->Stack.empty()) return nullptr; else return this->Stack.top(); } bool StageStack::IsEmpty() { return this->Stack.empty(); } void StageStack::Clear() { while (!this->Stack.empty()) this->Stack.pop(); } }; //namespace OpenApoc ## Instruction: Call Finish() on Stages removed from the stack ## Code After: namespace OpenApoc { void StageStack::Push(std::shared_ptr<Stage> newStage) { // Pause any current stage if(this->Current()) this->Current()->Pause(); this->Stack.push(newStage); newStage->Begin(); } std::shared_ptr<Stage> StageStack::Pop() { std::shared_ptr<Stage> result = this->Current(); if (result) { result->Finish(); Stack.pop(); } // If there's still an item on the stack, resume it if( this->Current() ) this->Current()->Resume(); return result; } std::shared_ptr<Stage> StageStack::Current() { if (this->Stack.empty()) return nullptr; else return this->Stack.top(); } bool StageStack::IsEmpty() { return this->Stack.empty(); } void StageStack::Clear() { while (!this->IsEmpty()) this->Pop(); } }; //namespace OpenApoc
2679bee67e0af83f81336476f76c081813c99b3b
qbs/modules/cutehmi/qmltypes/qmltypes.qbs
qbs/modules/cutehmi/qmltypes/qmltypes.qbs
import qbs import qbs.Environment import qbs.Utilities import "functions.js" as Functions /** This module generates 'plugins.qmltypes' artifact. */ Module { additionalProductTypes: ["qmltypes"] condition: qbs.targetOS.contains("windows") Depends { name: "Qt.core" } Rule { multiplex: true inputs: ["qml", "dynamiclibrary"] prepare: { var dumpCmd = new Command(product.Qt.core.binPath + "/qmlplugindump", ["-nonrelocatable", product.name, product.major + "." + product.minor, "QML"]); dumpCmd.workingDirectory = product.qbs.installRoot dumpCmd.description = "invoking 'qmlplugindump' program to generate " + product.sourceDirectory + "/plugins.qmltypes"; dumpCmd.highlight = "codegen" dumpCmd.stdoutFilePath = product.sourceDirectory + "/plugins.qmltypes" return [dumpCmd] } Artifact { filePath: product.sourceDirectory + "/plugins.qmltypes" fileTags: ["qmltypes"] } } }
import qbs import qbs.Environment import qbs.Utilities import "functions.js" as Functions /** This module generates 'plugins.qmltypes' artifact. */ Module { additionalProductTypes: ["qmltypes"] Depends { name: "Qt.core" } Rule { condition: qbs.targetOS.contains("windows") multiplex: true inputs: ["qml", "dynamiclibrary"] prepare: { var dumpCmd = new Command(product.Qt.core.binPath + "/qmlplugindump", ["-nonrelocatable", product.name, product.major + "." + product.minor, "QML"]); dumpCmd.workingDirectory = product.qbs.installRoot dumpCmd.description = "invoking 'qmlplugindump' program to generate " + product.sourceDirectory + "/plugins.qmltypes"; dumpCmd.highlight = "codegen" dumpCmd.stdoutFilePath = product.sourceDirectory + "/plugins.qmltypes" return [dumpCmd] } Artifact { filePath: product.sourceDirectory + "/plugins.qmltypes" fileTags: ["qmltypes"] } } }
Move condition to `Rule` item.
Move condition to `Rule` item.
QML
mit
michpolicht/CuteHMI,michpolicht/CuteHMI,michpolicht/CuteHMI,michpolicht/CuteHMI,michpolicht/CuteHMI
qml
## Code Before: import qbs import qbs.Environment import qbs.Utilities import "functions.js" as Functions /** This module generates 'plugins.qmltypes' artifact. */ Module { additionalProductTypes: ["qmltypes"] condition: qbs.targetOS.contains("windows") Depends { name: "Qt.core" } Rule { multiplex: true inputs: ["qml", "dynamiclibrary"] prepare: { var dumpCmd = new Command(product.Qt.core.binPath + "/qmlplugindump", ["-nonrelocatable", product.name, product.major + "." + product.minor, "QML"]); dumpCmd.workingDirectory = product.qbs.installRoot dumpCmd.description = "invoking 'qmlplugindump' program to generate " + product.sourceDirectory + "/plugins.qmltypes"; dumpCmd.highlight = "codegen" dumpCmd.stdoutFilePath = product.sourceDirectory + "/plugins.qmltypes" return [dumpCmd] } Artifact { filePath: product.sourceDirectory + "/plugins.qmltypes" fileTags: ["qmltypes"] } } } ## Instruction: Move condition to `Rule` item. ## Code After: import qbs import qbs.Environment import qbs.Utilities import "functions.js" as Functions /** This module generates 'plugins.qmltypes' artifact. */ Module { additionalProductTypes: ["qmltypes"] Depends { name: "Qt.core" } Rule { condition: qbs.targetOS.contains("windows") multiplex: true inputs: ["qml", "dynamiclibrary"] prepare: { var dumpCmd = new Command(product.Qt.core.binPath + "/qmlplugindump", ["-nonrelocatable", product.name, product.major + "." + product.minor, "QML"]); dumpCmd.workingDirectory = product.qbs.installRoot dumpCmd.description = "invoking 'qmlplugindump' program to generate " + product.sourceDirectory + "/plugins.qmltypes"; dumpCmd.highlight = "codegen" dumpCmd.stdoutFilePath = product.sourceDirectory + "/plugins.qmltypes" return [dumpCmd] } Artifact { filePath: product.sourceDirectory + "/plugins.qmltypes" fileTags: ["qmltypes"] } } }
ba57f2f031de3f615e3a36e2ceb42ca8d14af807
gobbler/views/addGibletView.html
gobbler/views/addGibletView.html
<template name="addGiblet"> <nav> {{>navBar}} </nav> <form action="/" class="addGiblet"> <input type="text" name="taskname" placeholder="Title for this job/giblet"> <input type="url" name="url" placeholder="Url to search"> <input type="text" name="keywords" placeholder="Keywords to search for, eg. keyword1, keyword2"> <div> <span>Notifications <br/> <label for="SMS">Text Updates<input type="checkbox" name="SMS"></label> <label for="Email">Email Updates<input type="checkbox" name="email"></label> </span> </div> <span>Check the website... <input type="number" name="frequency" placeholder="Number of times"> Per Day </span> <button>Submit</button> </form> </template>
<template name="dashboardTemplate"> <div class='dashboard'> {{>navBar}} <form action="/" class="addGiblet"> <input type="text" name="taskname" placeholder="Title for this job/giblet"> <input type="url" name="url" placeholder="Url to search"> <input type="text" name="keywords" placeholder="Keywords to search for, eg. keyword1, keyword2"> <div> <span>Notifications <br/> <label for="SMS">Text Updates<input type="checkbox" name="SMS"></label> <label for="Email">Email Updates<input type="checkbox" name="email"></label> </span> </div> <span>Check the website... <input type="number" name="frequency" placeholder="Number of times"> Per Day </span> <button>Submit</button> </form> </div> </template>
Refactor and rename giblet view to dashboard
Refactor and rename giblet view to dashboard
HTML
mit
UnfetteredCheddar/UnfetteredCheddar,UnfetteredCheddar/UnfetteredCheddar
html
## Code Before: <template name="addGiblet"> <nav> {{>navBar}} </nav> <form action="/" class="addGiblet"> <input type="text" name="taskname" placeholder="Title for this job/giblet"> <input type="url" name="url" placeholder="Url to search"> <input type="text" name="keywords" placeholder="Keywords to search for, eg. keyword1, keyword2"> <div> <span>Notifications <br/> <label for="SMS">Text Updates<input type="checkbox" name="SMS"></label> <label for="Email">Email Updates<input type="checkbox" name="email"></label> </span> </div> <span>Check the website... <input type="number" name="frequency" placeholder="Number of times"> Per Day </span> <button>Submit</button> </form> </template> ## Instruction: Refactor and rename giblet view to dashboard ## Code After: <template name="dashboardTemplate"> <div class='dashboard'> {{>navBar}} <form action="/" class="addGiblet"> <input type="text" name="taskname" placeholder="Title for this job/giblet"> <input type="url" name="url" placeholder="Url to search"> <input type="text" name="keywords" placeholder="Keywords to search for, eg. keyword1, keyword2"> <div> <span>Notifications <br/> <label for="SMS">Text Updates<input type="checkbox" name="SMS"></label> <label for="Email">Email Updates<input type="checkbox" name="email"></label> </span> </div> <span>Check the website... <input type="number" name="frequency" placeholder="Number of times"> Per Day </span> <button>Submit</button> </form> </div> </template>
18ec52a1c34e263e4d909fc1ee19500f9adac26b
examples/django_example/example/app/models.py
examples/django_example/example/app/models.py
from django.db import models # Create your models here.
from django.contrib.auth.models import AbstractUser, UserManager class CustomUser(AbstractUser): objects = UserManager()
Define a custom user model
Define a custom user model
Python
bsd-3-clause
S01780/python-social-auth,tobias47n9e/social-core,falcon1kr/python-social-auth,ByteInternet/python-social-auth,muhammad-ammar/python-social-auth,contracode/python-social-auth,S01780/python-social-auth,clef/python-social-auth,lawrence34/python-social-auth,python-social-auth/social-storage-sqlalchemy,fearlessspider/python-social-auth,MSOpenTech/python-social-auth,Andygmb/python-social-auth,mrwags/python-social-auth,ariestiyansyah/python-social-auth,clef/python-social-auth,bjorand/python-social-auth,cjltsod/python-social-auth,barseghyanartur/python-social-auth,nirmalvp/python-social-auth,Andygmb/python-social-auth,garrett-schlesinger/python-social-auth,henocdz/python-social-auth,VishvajitP/python-social-auth,duoduo369/python-social-auth,merutak/python-social-auth,drxos/python-social-auth,firstjob/python-social-auth,webjunkie/python-social-auth,DhiaEddineSaidi/python-social-auth,python-social-auth/social-app-django,barseghyanartur/python-social-auth,rsteca/python-social-auth,jneves/python-social-auth,mrwags/python-social-auth,mrwags/python-social-auth,frankier/python-social-auth,JJediny/python-social-auth,joelstanner/python-social-auth,lamby/python-social-auth,bjorand/python-social-auth,python-social-auth/social-core,chandolia/python-social-auth,jeyraof/python-social-auth,cmichal/python-social-auth,falcon1kr/python-social-auth,robbiet480/python-social-auth,contracode/python-social-auth,lawrence34/python-social-auth,yprez/python-social-auth,bjorand/python-social-auth,garrett-schlesinger/python-social-auth,clef/python-social-auth,python-social-auth/social-app-django,jameslittle/python-social-auth,tkajtoch/python-social-auth,python-social-auth/social-app-django,JerzySpendel/python-social-auth,muhammad-ammar/python-social-auth,msampathkumar/python-social-auth,webjunkie/python-social-auth,mark-adams/python-social-auth,iruga090/python-social-auth,contracode/python-social-auth,JJediny/python-social-auth,lamby/python-social-auth,cmichal/python-social-auth,alrusdi/python-social-auth,python-social-auth/social-docs,yprez/python-social-auth,san-mate/python-social-auth,jeyraof/python-social-auth,ononeor12/python-social-auth,jneves/python-social-auth,lawrence34/python-social-auth,DhiaEddineSaidi/python-social-auth,python-social-auth/social-app-cherrypy,michael-borisov/python-social-auth,SeanHayes/python-social-auth,lneoe/python-social-auth,joelstanner/python-social-auth,duoduo369/python-social-auth,lneoe/python-social-auth,fearlessspider/python-social-auth,chandolia/python-social-auth,hsr-ba-fs15-dat/python-social-auth,daniula/python-social-auth,VishvajitP/python-social-auth,daniula/python-social-auth,alrusdi/python-social-auth,mark-adams/python-social-auth,barseghyanartur/python-social-auth,rsalmaso/python-social-auth,mathspace/python-social-auth,JJediny/python-social-auth,michael-borisov/python-social-auth,san-mate/python-social-auth,lneoe/python-social-auth,jameslittle/python-social-auth,rsteca/python-social-auth,henocdz/python-social-auth,S01780/python-social-auth,tkajtoch/python-social-auth,tutumcloud/python-social-auth,michael-borisov/python-social-auth,JerzySpendel/python-social-auth,degs098/python-social-auth,robbiet480/python-social-auth,rsalmaso/python-social-auth,nirmalvp/python-social-auth,falcon1kr/python-social-auth,python-social-auth/social-core,ariestiyansyah/python-social-auth,ariestiyansyah/python-social-auth,ByteInternet/python-social-auth,hsr-ba-fs15-dat/python-social-auth,nirmalvp/python-social-auth,DhiaEddineSaidi/python-social-auth,joelstanner/python-social-auth,ononeor12/python-social-auth,wildtetris/python-social-auth,henocdz/python-social-auth,mathspace/python-social-auth,MSOpenTech/python-social-auth,wildtetris/python-social-auth,degs098/python-social-auth,noodle-learns-programming/python-social-auth,SeanHayes/python-social-auth,mchdks/python-social-auth,lamby/python-social-auth,merutak/python-social-auth,jneves/python-social-auth,chandolia/python-social-auth,mchdks/python-social-auth,webjunkie/python-social-auth,ByteInternet/python-social-auth,fearlessspider/python-social-auth,firstjob/python-social-auth,noodle-learns-programming/python-social-auth,VishvajitP/python-social-auth,daniula/python-social-auth,mark-adams/python-social-auth,tkajtoch/python-social-auth,san-mate/python-social-auth,jeyraof/python-social-auth,robbiet480/python-social-auth,wildtetris/python-social-auth,jameslittle/python-social-auth,msampathkumar/python-social-auth,alrusdi/python-social-auth,msampathkumar/python-social-auth,yprez/python-social-auth,firstjob/python-social-auth,ononeor12/python-social-auth,tutumcloud/python-social-auth,noodle-learns-programming/python-social-auth,mathspace/python-social-auth,hsr-ba-fs15-dat/python-social-auth,muhammad-ammar/python-social-auth,degs098/python-social-auth,rsteca/python-social-auth,JerzySpendel/python-social-auth,frankier/python-social-auth,mchdks/python-social-auth,Andygmb/python-social-auth,iruga090/python-social-auth,merutak/python-social-auth,MSOpenTech/python-social-auth,cjltsod/python-social-auth,cmichal/python-social-auth,drxos/python-social-auth,drxos/python-social-auth,iruga090/python-social-auth
python
## Code Before: from django.db import models # Create your models here. ## Instruction: Define a custom user model ## Code After: from django.contrib.auth.models import AbstractUser, UserManager class CustomUser(AbstractUser): objects = UserManager()
a90f6a12c5607ed7ba5bf7d3d93c15676df8afad
.travis.yml
.travis.yml
language: go go: 1.1 install: - export PATH=$PATH:$HOME/gopath/bin # Annoyingly, we can not use go get revel/... because references to app/routes package fail - go get -v github.com/robfig/revel/revel - go get -v github.com/robfig/revel/harness - go get -v github.com/coopernurse/gorp - go get -v code.google.com/p/go.crypto/bcrypt - go get -v labix.org/v2/mgo - go get -v labix.org/v2/mgo/bson - go get github.com/jgraham909/revmgo script: - go test github.com/robfig/revel - go test github.com/robfig/revel/cache - go test github.com/robfig/revel/harness # Build & run the sample apps - revel test github.com/FunnyMonkey/sally
language: go go: 1.1 install: - export PATH=$PATH:$HOME/gopath/bin # Annoyingly, we can not use go get revel/... because references to app/routes package fail - go get -v github.com/robfig/revel/revel - go get -v github.com/robfig/revel/harness - go get -v github.com/coopernurse/gorp - go get -v code.google.com/p/go.crypto/bcrypt - go get -v labix.org/v2/mgo - go get -v labix.org/v2/mgo/bson - go get github.com/jgraham909/revmgo script: - go test github.com/robfig/revel - go test github.com/robfig/revel/harness # Build & run the sample apps - revel test github.com/FunnyMonkey/sally
Remove revel cache test we aren't using that
Remove revel cache test we aren't using that
YAML
mit
FunnyMonkey/sally
yaml
## Code Before: language: go go: 1.1 install: - export PATH=$PATH:$HOME/gopath/bin # Annoyingly, we can not use go get revel/... because references to app/routes package fail - go get -v github.com/robfig/revel/revel - go get -v github.com/robfig/revel/harness - go get -v github.com/coopernurse/gorp - go get -v code.google.com/p/go.crypto/bcrypt - go get -v labix.org/v2/mgo - go get -v labix.org/v2/mgo/bson - go get github.com/jgraham909/revmgo script: - go test github.com/robfig/revel - go test github.com/robfig/revel/cache - go test github.com/robfig/revel/harness # Build & run the sample apps - revel test github.com/FunnyMonkey/sally ## Instruction: Remove revel cache test we aren't using that ## Code After: language: go go: 1.1 install: - export PATH=$PATH:$HOME/gopath/bin # Annoyingly, we can not use go get revel/... because references to app/routes package fail - go get -v github.com/robfig/revel/revel - go get -v github.com/robfig/revel/harness - go get -v github.com/coopernurse/gorp - go get -v code.google.com/p/go.crypto/bcrypt - go get -v labix.org/v2/mgo - go get -v labix.org/v2/mgo/bson - go get github.com/jgraham909/revmgo script: - go test github.com/robfig/revel - go test github.com/robfig/revel/harness # Build & run the sample apps - revel test github.com/FunnyMonkey/sally
130df743b14cf329c09f0c514ec0d6991b21dd45
examples/mnist-deepautoencoder.py
examples/mnist-deepautoencoder.py
import matplotlib.pyplot as plt import theanets from utils import load_mnist, plot_layers, plot_images train, valid, _ = load_mnist() e = theanets.Experiment( theanets.Autoencoder, layers=(784, 256, 64, 36, 64, 256, 784), train_batches=100, tied_weights=True, ) e.train(train, valid, optimize='layerwise') e.train(train, valid) plot_layers([e.network.get_weights(i) for i in (1, 2, 3)], tied_weights=True) plt.tight_layout() plt.show() valid = valid[:16*16] plot_images(valid, 121, 'Sample data') plot_images(e.network.predict(valid), 122, 'Reconstructed data') plt.tight_layout() plt.show()
import matplotlib.pyplot as plt import theanets from utils import load_mnist, plot_layers, plot_images train, valid, _ = load_mnist() e = theanets.Experiment( theanets.Autoencoder, layers=(784, 256, 64, 36, 64, 256, 784), train_batches=100, tied_weights=True, ) e.train(train, valid, optimize='layerwise', patience=1, min_improvement=0.1) e.train(train, valid) plot_layers([e.network.get_weights(i) for i in (1, 2, 3)], tied_weights=True) plt.tight_layout() plt.show() valid = valid[:16*16] plot_images(valid, 121, 'Sample data') plot_images(e.network.predict(valid), 122, 'Reconstructed data') plt.tight_layout() plt.show()
Decrease patience for each layerwise trainer.
Decrease patience for each layerwise trainer.
Python
mit
chrinide/theanets,lmjohns3/theanets,devdoer/theanets
python
## Code Before: import matplotlib.pyplot as plt import theanets from utils import load_mnist, plot_layers, plot_images train, valid, _ = load_mnist() e = theanets.Experiment( theanets.Autoencoder, layers=(784, 256, 64, 36, 64, 256, 784), train_batches=100, tied_weights=True, ) e.train(train, valid, optimize='layerwise') e.train(train, valid) plot_layers([e.network.get_weights(i) for i in (1, 2, 3)], tied_weights=True) plt.tight_layout() plt.show() valid = valid[:16*16] plot_images(valid, 121, 'Sample data') plot_images(e.network.predict(valid), 122, 'Reconstructed data') plt.tight_layout() plt.show() ## Instruction: Decrease patience for each layerwise trainer. ## Code After: import matplotlib.pyplot as plt import theanets from utils import load_mnist, plot_layers, plot_images train, valid, _ = load_mnist() e = theanets.Experiment( theanets.Autoencoder, layers=(784, 256, 64, 36, 64, 256, 784), train_batches=100, tied_weights=True, ) e.train(train, valid, optimize='layerwise', patience=1, min_improvement=0.1) e.train(train, valid) plot_layers([e.network.get_weights(i) for i in (1, 2, 3)], tied_weights=True) plt.tight_layout() plt.show() valid = valid[:16*16] plot_images(valid, 121, 'Sample data') plot_images(e.network.predict(valid), 122, 'Reconstructed data') plt.tight_layout() plt.show()
060d23439de45065aec734b031e4be2445acbd40
src/processTailwindFeatures.js
src/processTailwindFeatures.js
import _ from 'lodash' import postcss from 'postcss' import substituteTailwindAtRules from './lib/substituteTailwindAtRules' import evaluateTailwindFunctions from './lib/evaluateTailwindFunctions' import substituteVariantsAtRules from './lib/substituteVariantsAtRules' import substituteResponsiveAtRules from './lib/substituteResponsiveAtRules' import substituteScreenAtRules from './lib/substituteScreenAtRules' import substituteClassApplyAtRules from './lib/substituteClassApplyAtRules' import processPlugins from './util/processPlugins' import defaultPlugins from './defaultPlugins' export default function(getConfig) { return function(css) { const config = getConfig() const processedPlugins = processPlugins([...defaultPlugins(config), ...config.plugins], config) return postcss([ substituteTailwindAtRules(config, processedPlugins, processedPlugins.utilities), evaluateTailwindFunctions(config), substituteVariantsAtRules(config, processedPlugins), substituteResponsiveAtRules(config), substituteScreenAtRules(config), substituteClassApplyAtRules(config, processedPlugins.utilities), // This quick plugin is necessary to avoid a serious performance // hit due to nodes created by postcss-js having an empty `raws` // value, and PostCSS not providing a default `raws.semicolon` // value. This turns determining what value to use there into an // O(n) operation instead of an O(1) operation. // // The latest version of PostCSS 7.x has this patched internally, // but patching from userland until we upgrade from v6 to v7. function(root) { root.rawCache = { colon: ': ', indent: ' ', beforeDecl: '\n', beforeRule: '\n', beforeOpen: ' ', beforeClose: '\n', beforeComment: '\n', after: '\n', emptyBody: '', commentLeft: ' ', commentRight: ' ', semicolon: false, } }, ]).process(css, { from: _.get(css, 'source.input.file') }) } }
import _ from 'lodash' import postcss from 'postcss' import substituteTailwindAtRules from './lib/substituteTailwindAtRules' import evaluateTailwindFunctions from './lib/evaluateTailwindFunctions' import substituteVariantsAtRules from './lib/substituteVariantsAtRules' import substituteResponsiveAtRules from './lib/substituteResponsiveAtRules' import substituteScreenAtRules from './lib/substituteScreenAtRules' import substituteClassApplyAtRules from './lib/substituteClassApplyAtRules' import processPlugins from './util/processPlugins' import defaultPlugins from './defaultPlugins' export default function(getConfig) { return function(css) { const config = getConfig() const processedPlugins = processPlugins([...defaultPlugins(config), ...config.plugins], config) return postcss([ substituteTailwindAtRules(config, processedPlugins, processedPlugins.utilities), evaluateTailwindFunctions(config), substituteVariantsAtRules(config, processedPlugins), substituteResponsiveAtRules(config), substituteScreenAtRules(config), substituteClassApplyAtRules(config, processedPlugins.utilities), ]).process(css, { from: _.get(css, 'source.input.file') }) } }
Remove code obsoleted by upgrading PostCSS
Remove code obsoleted by upgrading PostCSS
JavaScript
mit
tailwindlabs/tailwindcss,tailwindcss/tailwindcss,tailwindlabs/tailwindcss,tailwindlabs/tailwindcss
javascript
## Code Before: import _ from 'lodash' import postcss from 'postcss' import substituteTailwindAtRules from './lib/substituteTailwindAtRules' import evaluateTailwindFunctions from './lib/evaluateTailwindFunctions' import substituteVariantsAtRules from './lib/substituteVariantsAtRules' import substituteResponsiveAtRules from './lib/substituteResponsiveAtRules' import substituteScreenAtRules from './lib/substituteScreenAtRules' import substituteClassApplyAtRules from './lib/substituteClassApplyAtRules' import processPlugins from './util/processPlugins' import defaultPlugins from './defaultPlugins' export default function(getConfig) { return function(css) { const config = getConfig() const processedPlugins = processPlugins([...defaultPlugins(config), ...config.plugins], config) return postcss([ substituteTailwindAtRules(config, processedPlugins, processedPlugins.utilities), evaluateTailwindFunctions(config), substituteVariantsAtRules(config, processedPlugins), substituteResponsiveAtRules(config), substituteScreenAtRules(config), substituteClassApplyAtRules(config, processedPlugins.utilities), // This quick plugin is necessary to avoid a serious performance // hit due to nodes created by postcss-js having an empty `raws` // value, and PostCSS not providing a default `raws.semicolon` // value. This turns determining what value to use there into an // O(n) operation instead of an O(1) operation. // // The latest version of PostCSS 7.x has this patched internally, // but patching from userland until we upgrade from v6 to v7. function(root) { root.rawCache = { colon: ': ', indent: ' ', beforeDecl: '\n', beforeRule: '\n', beforeOpen: ' ', beforeClose: '\n', beforeComment: '\n', after: '\n', emptyBody: '', commentLeft: ' ', commentRight: ' ', semicolon: false, } }, ]).process(css, { from: _.get(css, 'source.input.file') }) } } ## Instruction: Remove code obsoleted by upgrading PostCSS ## Code After: import _ from 'lodash' import postcss from 'postcss' import substituteTailwindAtRules from './lib/substituteTailwindAtRules' import evaluateTailwindFunctions from './lib/evaluateTailwindFunctions' import substituteVariantsAtRules from './lib/substituteVariantsAtRules' import substituteResponsiveAtRules from './lib/substituteResponsiveAtRules' import substituteScreenAtRules from './lib/substituteScreenAtRules' import substituteClassApplyAtRules from './lib/substituteClassApplyAtRules' import processPlugins from './util/processPlugins' import defaultPlugins from './defaultPlugins' export default function(getConfig) { return function(css) { const config = getConfig() const processedPlugins = processPlugins([...defaultPlugins(config), ...config.plugins], config) return postcss([ substituteTailwindAtRules(config, processedPlugins, processedPlugins.utilities), evaluateTailwindFunctions(config), substituteVariantsAtRules(config, processedPlugins), substituteResponsiveAtRules(config), substituteScreenAtRules(config), substituteClassApplyAtRules(config, processedPlugins.utilities), ]).process(css, { from: _.get(css, 'source.input.file') }) } }
d5893107e1139bbb1a34be1c57f86646da4eac97
Stately/app/src/main/java/com/lloydtorres/stately/dto/NationOverviewCardData.java
Stately/app/src/main/java/com/lloydtorres/stately/dto/NationOverviewCardData.java
package com.lloydtorres.stately.dto; /** * Created by Lloyd on 2016-07-24. * A holder for data in the main nation overview card. */ public class NationOverviewCardData { public String category; public String region; public String inflDesc; public int inflScore; public String population; public String motto; public String established; public String waState; public String endorsements; public String gaVote; public String scVote; public NationOverviewCardData() { super(); } }
package com.lloydtorres.stately.dto; /** * Created by Lloyd on 2016-07-24. * A holder for data in the main nation overview card. */ public class NationOverviewCardData { public String category; public String region; public String inflDesc; public int inflScore; public String population; public String motto; public String established; public String lastSeen; public String waState; public String endorsements; public String gaVote; public String scVote; public NationOverviewCardData() { super(); } }
Add last seen parameter to nation overview card DTO
Add last seen parameter to nation overview card DTO
Java
apache-2.0
lloydtorres/stately
java
## Code Before: package com.lloydtorres.stately.dto; /** * Created by Lloyd on 2016-07-24. * A holder for data in the main nation overview card. */ public class NationOverviewCardData { public String category; public String region; public String inflDesc; public int inflScore; public String population; public String motto; public String established; public String waState; public String endorsements; public String gaVote; public String scVote; public NationOverviewCardData() { super(); } } ## Instruction: Add last seen parameter to nation overview card DTO ## Code After: package com.lloydtorres.stately.dto; /** * Created by Lloyd on 2016-07-24. * A holder for data in the main nation overview card. */ public class NationOverviewCardData { public String category; public String region; public String inflDesc; public int inflScore; public String population; public String motto; public String established; public String lastSeen; public String waState; public String endorsements; public String gaVote; public String scVote; public NationOverviewCardData() { super(); } }
220cf5627ec4d94af2d114f04a9fb1c97596b39e
lib/collate/engine.rb
lib/collate/engine.rb
require_relative 'active_record_extension' require_relative 'action_view_extension' require 'rails' module Collate class Engine < ::Rails::Engine isolate_namespace Collate ActiveSupport.on_load :action_view do include Collate::ActionViewExtension end ActiveSupport.on_load :active_record do extend Collate::ActiveRecordExtension end ActionController::Base.prepend_view_path File.dirname(__FILE__) + "/../app/views" end end
require_relative 'active_record_extension' require_relative 'action_view_extension' require 'rails' module Collate class Engine < ::Rails::Engine isolate_namespace Collate ActiveSupport.on_load :action_view do include Collate::ActionViewExtension end ActiveSupport.on_load :active_record do extend Collate::ActiveRecordExtension end if defined? ActionController::Base ActionController::Base.prepend_view_path File.dirname(__FILE__) + "/../app/views" end end end
Check if constant is initialized (won’t be in the tests so far).
Check if constant is initialized (won’t be in the tests so far).
Ruby
mit
trackingboard/collate,trackingboard/collate,trackingboard/collate
ruby
## Code Before: require_relative 'active_record_extension' require_relative 'action_view_extension' require 'rails' module Collate class Engine < ::Rails::Engine isolate_namespace Collate ActiveSupport.on_load :action_view do include Collate::ActionViewExtension end ActiveSupport.on_load :active_record do extend Collate::ActiveRecordExtension end ActionController::Base.prepend_view_path File.dirname(__FILE__) + "/../app/views" end end ## Instruction: Check if constant is initialized (won’t be in the tests so far). ## Code After: require_relative 'active_record_extension' require_relative 'action_view_extension' require 'rails' module Collate class Engine < ::Rails::Engine isolate_namespace Collate ActiveSupport.on_load :action_view do include Collate::ActionViewExtension end ActiveSupport.on_load :active_record do extend Collate::ActiveRecordExtension end if defined? ActionController::Base ActionController::Base.prepend_view_path File.dirname(__FILE__) + "/../app/views" end end end
905577841e43e049972d089750c27529367006cb
src/TableParser/TypeInfo.php
src/TableParser/TypeInfo.php
<?php namespace Maghead\TableParser; class TypeInfo { public $type; public $length; public $precision; public $isa; public $fullQualifiedTypeName; public $unsigned; public $enum = array(); public $set = array(); public function __construct($typeName = null, $length = null) { $this->type = $typeName; $this->length = $length; } public function getType() { return $this->type; } public function getLength() { return $this->length; } public function getPrecision() { return $this->precision; } }
<?php namespace Maghead\TableParser; /** * Plain old object for column type info */ class TypeInfo { public $type; public $length; public $precision; public $isa; public $fullQualifiedTypeName; public $unsigned; public $enum = array(); public $set = array(); public function __construct($typeName = null, $length = null) { $this->type = $typeName; $this->length = $length; } }
Clean up type info interfaces
Clean up type info interfaces
PHP
bsd-3-clause
c9s/LazyRecord,c9s/LazyRecord,c9s/LazyRecord
php
## Code Before: <?php namespace Maghead\TableParser; class TypeInfo { public $type; public $length; public $precision; public $isa; public $fullQualifiedTypeName; public $unsigned; public $enum = array(); public $set = array(); public function __construct($typeName = null, $length = null) { $this->type = $typeName; $this->length = $length; } public function getType() { return $this->type; } public function getLength() { return $this->length; } public function getPrecision() { return $this->precision; } } ## Instruction: Clean up type info interfaces ## Code After: <?php namespace Maghead\TableParser; /** * Plain old object for column type info */ class TypeInfo { public $type; public $length; public $precision; public $isa; public $fullQualifiedTypeName; public $unsigned; public $enum = array(); public $set = array(); public function __construct($typeName = null, $length = null) { $this->type = $typeName; $this->length = $length; } }
c8a20cabb71b249072a001ccf9c1c306640a511a
include/llvm/MC/MCParser/MCAsmParserUtils.h
include/llvm/MC/MCParser/MCAsmParserUtils.h
//===------ llvm/MC/MCAsmParserUtils.h - Asm Parser Utilities ---*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_MC_MCPARSER_MCASMPARSERUTILS_H #define LLVM_MC_MCPARSER_MCASMPARSERUTILS_H namespace llvm { namespace MCParserUtils { /// Parse a value expression and return whether it can be assigned to a symbol /// with the given name. /// /// On success, returns false and sets the Symbol and Value output parameters. bool parseAssignmentExpression(StringRef Name, bool allow_redef, MCAsmParser &Parser, MCSymbol *&Symbol, const MCExpr *&Value); } // namespace MCParserUtils } // namespace llvm #endif
//===------ llvm/MC/MCAsmParserUtils.h - Asm Parser Utilities ---*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_MC_MCPARSER_MCASMPARSERUTILS_H #define LLVM_MC_MCPARSER_MCASMPARSERUTILS_H namespace llvm { class MCAsmParser; class MCExpr; class MCSymbol; class StringRef; namespace MCParserUtils { /// Parse a value expression and return whether it can be assigned to a symbol /// with the given name. /// /// On success, returns false and sets the Symbol and Value output parameters. bool parseAssignmentExpression(StringRef Name, bool allow_redef, MCAsmParser &Parser, MCSymbol *&Symbol, const MCExpr *&Value); } // namespace MCParserUtils } // namespace llvm #endif
Make header parse standalone. NFC.
Make header parse standalone. NFC. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@240814 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm
c
## Code Before: //===------ llvm/MC/MCAsmParserUtils.h - Asm Parser Utilities ---*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_MC_MCPARSER_MCASMPARSERUTILS_H #define LLVM_MC_MCPARSER_MCASMPARSERUTILS_H namespace llvm { namespace MCParserUtils { /// Parse a value expression and return whether it can be assigned to a symbol /// with the given name. /// /// On success, returns false and sets the Symbol and Value output parameters. bool parseAssignmentExpression(StringRef Name, bool allow_redef, MCAsmParser &Parser, MCSymbol *&Symbol, const MCExpr *&Value); } // namespace MCParserUtils } // namespace llvm #endif ## Instruction: Make header parse standalone. NFC. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@240814 91177308-0d34-0410-b5e6-96231b3b80d8 ## Code After: //===------ llvm/MC/MCAsmParserUtils.h - Asm Parser Utilities ---*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_MC_MCPARSER_MCASMPARSERUTILS_H #define LLVM_MC_MCPARSER_MCASMPARSERUTILS_H namespace llvm { class MCAsmParser; class MCExpr; class MCSymbol; class StringRef; namespace MCParserUtils { /// Parse a value expression and return whether it can be assigned to a symbol /// with the given name. /// /// On success, returns false and sets the Symbol and Value output parameters. bool parseAssignmentExpression(StringRef Name, bool allow_redef, MCAsmParser &Parser, MCSymbol *&Symbol, const MCExpr *&Value); } // namespace MCParserUtils } // namespace llvm #endif
00b5174f0f97e59a5dd90cab83d69e15b3fb6145
ecplurkbot/config/keywords.sample.json
ecplurkbot/config/keywords.sample.json
{ "summon_keywords": { "召喚詞1": ["回應1"] }, "keywords": [ {"關鍵詞1": ["回應1"]}, {"關鍵詞2": ["回應2"]}, {"關鍵詞3": ["回應3"]}, {"關鍵詞4": ["回應4"]} ] }
{ "summon_keywords": { "召喚詞1": ["回應1"] }, "keywords": [ {"關鍵詞1": ["回應1", "回應2"]}, {"關鍵詞2": ["回應1", "回應2"]}, {"關鍵詞3": ["回應1", "回應2"]}, {"關鍵詞4": ["回應1", "回應2"]} ] }
Edit the example keywords.json for easy to understand
Edit the example keywords.json for easy to understand
JSON
apache-2.0
dollars0427/ecplurkbot
json
## Code Before: { "summon_keywords": { "召喚詞1": ["回應1"] }, "keywords": [ {"關鍵詞1": ["回應1"]}, {"關鍵詞2": ["回應2"]}, {"關鍵詞3": ["回應3"]}, {"關鍵詞4": ["回應4"]} ] } ## Instruction: Edit the example keywords.json for easy to understand ## Code After: { "summon_keywords": { "召喚詞1": ["回應1"] }, "keywords": [ {"關鍵詞1": ["回應1", "回應2"]}, {"關鍵詞2": ["回應1", "回應2"]}, {"關鍵詞3": ["回應1", "回應2"]}, {"關鍵詞4": ["回應1", "回應2"]} ] }
6dfaf51c8bd498f9e955d6f7cdf92388b4ce9d68
java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo_sed.properties
java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo_sed.properties
delete=Version,version,Java,OS,[0-9*].[0-9*].[0-9*]
delete=Version,version,Java,OS,[0-9*].[0-9*].[0-9*],JRE - JDBC
Fix derbynet/sysinfo test on JDK 1.3 by sed'ing out new JDK version string.
Fix derbynet/sysinfo test on JDK 1.3 by sed'ing out new JDK version string. git-svn-id: e32e6781feeb0a0de14883205950ae267a8dad4f@152920 13f79535-47bb-0310-9956-ffa450edef68
INI
apache-2.0
apache/derby,trejkaz/derby,apache/derby,trejkaz/derby,apache/derby,apache/derby,trejkaz/derby
ini
## Code Before: delete=Version,version,Java,OS,[0-9*].[0-9*].[0-9*] ## Instruction: Fix derbynet/sysinfo test on JDK 1.3 by sed'ing out new JDK version string. git-svn-id: e32e6781feeb0a0de14883205950ae267a8dad4f@152920 13f79535-47bb-0310-9956-ffa450edef68 ## Code After: delete=Version,version,Java,OS,[0-9*].[0-9*].[0-9*],JRE - JDBC
7f144d1545a5547cdd7901bf61347a5ce4cff7d3
app/views/shared/_sidebar.html.erb
app/views/shared/_sidebar.html.erb
<% if current_subdomain %> <div id="sidebar"> <div id="sidebar-glow"></div> <div id="header"> <div id="title"> <div class="top"></div> <div class="content"> <h1><%= link_to current_subdomain.name, dashboard_path %></h1> <span class="tagline">Mine Gems&trade;</span> </div> <div class="bottom"></div> </div> </div> <div id="mylinks" class="list"> <ul> <li class="nolabel"><%= link_to content_tag(:strong, "Dashboard"), dashboard_path %></li> <li class="nolabel"><%= link_to content_tag(:strong, "Gems"), gems_path %></li> <li class="nolabel"><%= link_to content_tag(:strong, "Account"), account_path %></li> </ul> </div> </div> <% end %>
<% if defined?(:current_subdomain) && current_subdomain %> <div id="sidebar"> <div id="sidebar-glow"></div> <div id="header"> <div id="title"> <div class="top"></div> <div class="content"> <h1><%= link_to current_subdomain.name, dashboard_path %></h1> <span class="tagline">Mine Gems&trade;</span> </div> <div class="bottom"></div> </div> </div> <div id="mylinks" class="list"> <ul> <li class="nolabel"><%= link_to content_tag(:strong, "Dashboard"), dashboard_path %></li> <li class="nolabel"><%= link_to content_tag(:strong, "Gems"), gems_path %></li> <li class="nolabel"><%= link_to content_tag(:strong, "Account"), account_path %></li> </ul> </div> </div> <% end %>
Fix error undefined local variable or method `current_subdomain'
Fix error undefined local variable or method `current_subdomain' This is a temporary fix, I suggest the product layout to be different than the promotional site layout.
HTML+ERB
mit
jodosha/minegems,jodosha/minegems
html+erb
## Code Before: <% if current_subdomain %> <div id="sidebar"> <div id="sidebar-glow"></div> <div id="header"> <div id="title"> <div class="top"></div> <div class="content"> <h1><%= link_to current_subdomain.name, dashboard_path %></h1> <span class="tagline">Mine Gems&trade;</span> </div> <div class="bottom"></div> </div> </div> <div id="mylinks" class="list"> <ul> <li class="nolabel"><%= link_to content_tag(:strong, "Dashboard"), dashboard_path %></li> <li class="nolabel"><%= link_to content_tag(:strong, "Gems"), gems_path %></li> <li class="nolabel"><%= link_to content_tag(:strong, "Account"), account_path %></li> </ul> </div> </div> <% end %> ## Instruction: Fix error undefined local variable or method `current_subdomain' This is a temporary fix, I suggest the product layout to be different than the promotional site layout. ## Code After: <% if defined?(:current_subdomain) && current_subdomain %> <div id="sidebar"> <div id="sidebar-glow"></div> <div id="header"> <div id="title"> <div class="top"></div> <div class="content"> <h1><%= link_to current_subdomain.name, dashboard_path %></h1> <span class="tagline">Mine Gems&trade;</span> </div> <div class="bottom"></div> </div> </div> <div id="mylinks" class="list"> <ul> <li class="nolabel"><%= link_to content_tag(:strong, "Dashboard"), dashboard_path %></li> <li class="nolabel"><%= link_to content_tag(:strong, "Gems"), gems_path %></li> <li class="nolabel"><%= link_to content_tag(:strong, "Account"), account_path %></li> </ul> </div> </div> <% end %>
191642d9ad1367ce0bb83db72051861ded7aa202
lib/tasks/travis-ci.rake
lib/tasks/travis-ci.rake
begin namespace :travis do desc "Run all specs in except for the request specs" RSpec::Core::RakeTask.new(:ci => :environment) do |task| ENV["RAILS_ENV"] = "test" task.pattern = FileList["spec/**/*_spec.rb"].exclude("spec/requests/**/*_spec.rb") end end rescue LoadError # In production, we `bundle --without development test`, so RSpec is not # included. Whenever you run a rake task or load the app it loads all of the # tasks in lib/tasks, so this will fail in those cases. We don't need this # task in those cases, so just fail gracefully and print a warning. $stderr.puts "RSpec is not available in this environment. Not loading travis:ci Rake task." end
begin require 'rspec/core/rake_task' namespace :travis do desc "Run all specs in except for the request specs" RSpec::Core::RakeTask.new(:ci => :environment) do |task| ENV["RAILS_ENV"] = "test" task.pattern = FileList["spec/**/*_spec.rb"].exclude("spec/requests/**/*_spec.rb") end end rescue LoadError # In production, we `bundle --without development test`, so RSpec is not # included. Whenever you run a rake task or load the app it loads all of the # tasks in lib/tasks, so this will fail in those cases. We don't need this # task in those cases, so just fail gracefully and print a warning. $stderr.puts "RSpec is not available in this environment. Not loading travis:ci Rake task." end
Add the rspec load call for rake_task
Add the rspec load call for rake_task This is needed to actually trigger the LoadError. If it isn't present then the rescue block will never fire and the uninitialized constant error for RSpec will still happen in prod.
Ruby
apache-2.0
charlesjohnson/chef-server,chef/chef-server,rmoorman/chef-server,chef/chef-server,stephenbm/chef-server,chef/oc-id,itmustbejj/chef-server,poliva83/chef-server,stephenbm/chef-server,charlesjohnson/chef-server,juliandunn/chef-server-1,juliandunn/chef-server-1,marcparadise/chef-server,juliandunn/chef-server-1,itmustbejj/chef-server,Minerapp/chef-server,poliva83/chef-server,itmustbejj/chef-server,chef/chef-server,vladuemilian/chef-server,chef/chef-server,charlesjohnson/chef-server,rmoorman/chef-server,vladuemilian/chef-server,Minerapp/chef-server,chef/oc-id,stephenbm/chef-server,vladuemilian/chef-server,itmustbejj/chef-server,stephenbm/chef-server,juliandunn/chef-server-1,vladuemilian/chef-server,poliva83/chef-server,marcparadise/chef-server,charlesjohnson/chef-server,chef/chef-server,juliandunn/chef-server-1,vladuemilian/chef-server,rmoorman/chef-server,marcparadise/chef-server,chef/chef-server,itmustbejj/chef-server,marcparadise/chef-server,rmoorman/chef-server,rmoorman/chef-server,charlesjohnson/chef-server,stephenbm/chef-server,Minerapp/chef-server,Minerapp/chef-server,poliva83/chef-server,chef/oc-id,poliva83/chef-server,marcparadise/chef-server,Minerapp/chef-server
ruby
## Code Before: begin namespace :travis do desc "Run all specs in except for the request specs" RSpec::Core::RakeTask.new(:ci => :environment) do |task| ENV["RAILS_ENV"] = "test" task.pattern = FileList["spec/**/*_spec.rb"].exclude("spec/requests/**/*_spec.rb") end end rescue LoadError # In production, we `bundle --without development test`, so RSpec is not # included. Whenever you run a rake task or load the app it loads all of the # tasks in lib/tasks, so this will fail in those cases. We don't need this # task in those cases, so just fail gracefully and print a warning. $stderr.puts "RSpec is not available in this environment. Not loading travis:ci Rake task." end ## Instruction: Add the rspec load call for rake_task This is needed to actually trigger the LoadError. If it isn't present then the rescue block will never fire and the uninitialized constant error for RSpec will still happen in prod. ## Code After: begin require 'rspec/core/rake_task' namespace :travis do desc "Run all specs in except for the request specs" RSpec::Core::RakeTask.new(:ci => :environment) do |task| ENV["RAILS_ENV"] = "test" task.pattern = FileList["spec/**/*_spec.rb"].exclude("spec/requests/**/*_spec.rb") end end rescue LoadError # In production, we `bundle --without development test`, so RSpec is not # included. Whenever you run a rake task or load the app it loads all of the # tasks in lib/tasks, so this will fail in those cases. We don't need this # task in those cases, so just fail gracefully and print a warning. $stderr.puts "RSpec is not available in this environment. Not loading travis:ci Rake task." end
9c995511e10c82c9fe13fe27c5c4221b207477e6
docker-compose-unit-tests.yml
docker-compose-unit-tests.yml
version: '3.2' services: ############################################# # Start app as a container ############################################# web: # build from local Dockerfile build: . # if not --build and kth-azure-app already exists in # your local computers registry 'image' is used. image: $LOCAL_IMAGE_ID # LOCAL_IMAGE_ID, IMAGE_NAME and IMAGE_VERSION # Since we do not want to add tests to our # production image. We mount the catalog # 'tests' on in the repo on your local machine # to /tests on the inside of the container. # The volume mount is done at startup. volumes: - ./test:/test - ./node_modules:/node_modules # The unit test command that triggers tests to be run # inside the container # This example runs test in package.json which is # part of the kth-azure-app image. tty: true command: npm run test:docker-unit environment: - TEST_CREDENTIAL_FEEL_FREE_TO_REMOVE
version: '3.2' services: ############################################# # Start app as a container ############################################# web: # build from local Dockerfile build: . # if not --build and kth-azure-app already exists in # your local computers registry 'image' is used. image: $LOCAL_IMAGE_ID # LOCAL_IMAGE_ID, IMAGE_NAME and IMAGE_VERSION # Since we do not want to add tests to our # production image. We mount the catalog # 'tests' on in the repo on your local machine # to /tests on the inside of the container. # The volume mount is done at startup. volumes: - ./test:/test - ./node_modules:/node_modules # The unit test command that triggers tests to be run # inside the container # This example runs test in package.json which is # part of the kth-azure-app image. tty: true command: npm run test:docker-unit
Remove unused variable in .yml file
Remove unused variable in .yml file
YAML
mit
KTH/lms-sync,KTH/lms-sync
yaml
## Code Before: version: '3.2' services: ############################################# # Start app as a container ############################################# web: # build from local Dockerfile build: . # if not --build and kth-azure-app already exists in # your local computers registry 'image' is used. image: $LOCAL_IMAGE_ID # LOCAL_IMAGE_ID, IMAGE_NAME and IMAGE_VERSION # Since we do not want to add tests to our # production image. We mount the catalog # 'tests' on in the repo on your local machine # to /tests on the inside of the container. # The volume mount is done at startup. volumes: - ./test:/test - ./node_modules:/node_modules # The unit test command that triggers tests to be run # inside the container # This example runs test in package.json which is # part of the kth-azure-app image. tty: true command: npm run test:docker-unit environment: - TEST_CREDENTIAL_FEEL_FREE_TO_REMOVE ## Instruction: Remove unused variable in .yml file ## Code After: version: '3.2' services: ############################################# # Start app as a container ############################################# web: # build from local Dockerfile build: . # if not --build and kth-azure-app already exists in # your local computers registry 'image' is used. image: $LOCAL_IMAGE_ID # LOCAL_IMAGE_ID, IMAGE_NAME and IMAGE_VERSION # Since we do not want to add tests to our # production image. We mount the catalog # 'tests' on in the repo on your local machine # to /tests on the inside of the container. # The volume mount is done at startup. volumes: - ./test:/test - ./node_modules:/node_modules # The unit test command that triggers tests to be run # inside the container # This example runs test in package.json which is # part of the kth-azure-app image. tty: true command: npm run test:docker-unit
2da9bd4f2177b1d9c0f58d2f19e3b83257e45ded
sample/src/main/java/io/rapidpro/sdk/sample/Application.java
sample/src/main/java/io/rapidpro/sdk/sample/Application.java
package io.rapidpro.sdk.sample; import io.rapidpro.sdk.FcmClient; import io.rapidpro.sdk.UiConfiguration; import io.rapidpro.sdk.sample.services.PushRegistrationService; /** * Created by John Cordeiro on 5/10/17. * Copyright © 2017 rapidpro-android-sdk, Inc. All rights reserved. */ public class Application extends android.app.Application { @Override public void onCreate() { super.onCreate(); FcmClient.initialize(new FcmClient.Builder(this) .setHost("https://rapidpro.ilhasoft.mobi/") .setToken("f417616c57339f28e07bcedf8d4f23f74614bcb5") .setChannel("7815c7fb-eed7-41fe-b585-2a244d398fcb") .setRegistrationServiceClass(PushRegistrationService.class) .setUiConfiguration(new UiConfiguration() .setPermissionMessage("Please give me permission to open floating chat!") .setTheme(R.style.AppTheme_Blue) .setIconResource(R.mipmap.ic_launcher) .setTitleString("RapidPRO Sample SDK"))); } }
package io.rapidpro.sdk.sample; import android.support.annotation.ColorRes; import android.support.v4.content.res.ResourcesCompat; import io.rapidpro.sdk.FcmClient; import io.rapidpro.sdk.UiConfiguration; import io.rapidpro.sdk.sample.services.PushRegistrationService; /** * Created by John Cordeiro on 5/10/17. * Copyright © 2017 rapidpro-android-sdk, Inc. All rights reserved. */ public class Application extends android.app.Application { @Override public void onCreate() { super.onCreate(); FcmClient.initialize(new FcmClient.Builder(this) .setHost("https://rapidpro.ilhasoft.mobi/") .setToken("f417616c57339f28e07bcedf8d4f23f74614bcb5") .setChannel("7815c7fb-eed7-41fe-b585-2a244d398fcb") .setRegistrationServiceClass(PushRegistrationService.class) .setUiConfiguration(new UiConfiguration() .setPermissionMessage("Please give me permission to open floating chat!") .setTheme(R.style.AppTheme_Blue) .setIconResource(R.mipmap.ic_launcher) .setIconFloatingChat(R.mipmap.ic_launcher) .setTitleColor(getColorCompat(android.R.color.white)) .setTitleString("RapidPRO Sample SDK"))); } private int getColorCompat(@ColorRes int colorRes) { return ResourcesCompat.getColor(getResources(), colorRes, getTheme()); } }
Add missing ui configuration on sample project
Add missing ui configuration on sample project
Java
agpl-3.0
Ilhasoft/rapidpro-android-sdk
java
## Code Before: package io.rapidpro.sdk.sample; import io.rapidpro.sdk.FcmClient; import io.rapidpro.sdk.UiConfiguration; import io.rapidpro.sdk.sample.services.PushRegistrationService; /** * Created by John Cordeiro on 5/10/17. * Copyright © 2017 rapidpro-android-sdk, Inc. All rights reserved. */ public class Application extends android.app.Application { @Override public void onCreate() { super.onCreate(); FcmClient.initialize(new FcmClient.Builder(this) .setHost("https://rapidpro.ilhasoft.mobi/") .setToken("f417616c57339f28e07bcedf8d4f23f74614bcb5") .setChannel("7815c7fb-eed7-41fe-b585-2a244d398fcb") .setRegistrationServiceClass(PushRegistrationService.class) .setUiConfiguration(new UiConfiguration() .setPermissionMessage("Please give me permission to open floating chat!") .setTheme(R.style.AppTheme_Blue) .setIconResource(R.mipmap.ic_launcher) .setTitleString("RapidPRO Sample SDK"))); } } ## Instruction: Add missing ui configuration on sample project ## Code After: package io.rapidpro.sdk.sample; import android.support.annotation.ColorRes; import android.support.v4.content.res.ResourcesCompat; import io.rapidpro.sdk.FcmClient; import io.rapidpro.sdk.UiConfiguration; import io.rapidpro.sdk.sample.services.PushRegistrationService; /** * Created by John Cordeiro on 5/10/17. * Copyright © 2017 rapidpro-android-sdk, Inc. All rights reserved. */ public class Application extends android.app.Application { @Override public void onCreate() { super.onCreate(); FcmClient.initialize(new FcmClient.Builder(this) .setHost("https://rapidpro.ilhasoft.mobi/") .setToken("f417616c57339f28e07bcedf8d4f23f74614bcb5") .setChannel("7815c7fb-eed7-41fe-b585-2a244d398fcb") .setRegistrationServiceClass(PushRegistrationService.class) .setUiConfiguration(new UiConfiguration() .setPermissionMessage("Please give me permission to open floating chat!") .setTheme(R.style.AppTheme_Blue) .setIconResource(R.mipmap.ic_launcher) .setIconFloatingChat(R.mipmap.ic_launcher) .setTitleColor(getColorCompat(android.R.color.white)) .setTitleString("RapidPRO Sample SDK"))); } private int getColorCompat(@ColorRes int colorRes) { return ResourcesCompat.getColor(getResources(), colorRes, getTheme()); } }
2e5ab02ea17ab5c89057433283b77192946736a7
.codeclimate.yml
.codeclimate.yml
engines: checkstyle: enabled: true channel: "beta" ratings: paths: - "**.java"
engines: checkstyle: enabled: true channel: "beta" ratings: paths: - "**.java" exclude_patterns: - "src/main/java/io/prometheus/common/ConfigVals.java"
Remove ConfigVals.java from Code Climate review
Remove ConfigVals.java from Code Climate review
YAML
apache-2.0
pambrose/prometheus-proxy,pambrose/prometheus-proxy,pambrose/prometheus-proxy
yaml
## Code Before: engines: checkstyle: enabled: true channel: "beta" ratings: paths: - "**.java" ## Instruction: Remove ConfigVals.java from Code Climate review ## Code After: engines: checkstyle: enabled: true channel: "beta" ratings: paths: - "**.java" exclude_patterns: - "src/main/java/io/prometheus/common/ConfigVals.java"
a364196814c3b33e7fd51a42b4c3a48a3aaeaee8
volaparrot/constants.py
volaparrot/constants.py
ADMINFAG = ["RealDolos"] PARROTFAG = "Parrot" BLACKFAGS = [i.casefold() for i in ( "kalyx", "merc", "loliq", "annoying", "bot", "RootBeats", "JEW2FORU", "quag", "mire", "perici")] OBAMAS = [i.casefold() for i in ( "counselor", "briseis", "apha", "bread", "ark3", "jizzbomb", "acid", "elkoalemos", "tarta")] BLACKROOMS = "e7u-CG", "jAzmc3", "f66jeG", "24_zFd" WHITEROOMS = "9pdLvy"
ADMINFAG = ["RealDolos"] PARROTFAG = "Parrot" BLACKFAGS = [i.casefold() for i in ( "kalyx", "merc", "loliq", "annoying", "RootBeats", "JEW2FORU", "quag", "mire", "perici", "Voldemort", "briseis", "brisis", "GNUsuks", "rhooes", "n1sm4n", "honeyhole", "Printer", "yume1")] OBAMAS = [i.casefold() for i in ( "counselor", "briseis", "apha", "bread", "ark3", "jizzbomb", "acid", "elkoalemos", "tarta", "counselor", "myon")] BLACKROOMS = "e7u-CG", "jAzmc3", "f66jeG", "24_zFd", "BHfjGvT", "BHI0pxg", WHITEROOMS = "BEEPi",
Update list of extraordinary gentlemen
Update list of extraordinary gentlemen
Python
mit
RealDolos/volaparrot
python
## Code Before: ADMINFAG = ["RealDolos"] PARROTFAG = "Parrot" BLACKFAGS = [i.casefold() for i in ( "kalyx", "merc", "loliq", "annoying", "bot", "RootBeats", "JEW2FORU", "quag", "mire", "perici")] OBAMAS = [i.casefold() for i in ( "counselor", "briseis", "apha", "bread", "ark3", "jizzbomb", "acid", "elkoalemos", "tarta")] BLACKROOMS = "e7u-CG", "jAzmc3", "f66jeG", "24_zFd" WHITEROOMS = "9pdLvy" ## Instruction: Update list of extraordinary gentlemen ## Code After: ADMINFAG = ["RealDolos"] PARROTFAG = "Parrot" BLACKFAGS = [i.casefold() for i in ( "kalyx", "merc", "loliq", "annoying", "RootBeats", "JEW2FORU", "quag", "mire", "perici", "Voldemort", "briseis", "brisis", "GNUsuks", "rhooes", "n1sm4n", "honeyhole", "Printer", "yume1")] OBAMAS = [i.casefold() for i in ( "counselor", "briseis", "apha", "bread", "ark3", "jizzbomb", "acid", "elkoalemos", "tarta", "counselor", "myon")] BLACKROOMS = "e7u-CG", "jAzmc3", "f66jeG", "24_zFd", "BHfjGvT", "BHI0pxg", WHITEROOMS = "BEEPi",
f7531d1a3d5621a5c03fe31febc0b2fa0c11604f
config/govuk_index/migrated_formats.yaml
config/govuk_index/migrated_formats.yaml
migrated: - help_page indexable: - answer - guide - licence - transaction - simple_smart_answer
migrated: - help_page indexable: - answer - guide - licence - local_transaction - transaction - simple_smart_answer
Make local transaction format indexable
Make local transaction format indexable
YAML
mit
alphagov/rummager,alphagov/rummager
yaml
## Code Before: migrated: - help_page indexable: - answer - guide - licence - transaction - simple_smart_answer ## Instruction: Make local transaction format indexable ## Code After: migrated: - help_page indexable: - answer - guide - licence - local_transaction - transaction - simple_smart_answer
bc77f307e5c2bd6eb23fa5c8c46f678e6fcc4888
swig/perl/CMakeLists.txt
swig/perl/CMakeLists.txt
include(UseSWIG) include(FindPerlLibs) set(CMAKE_SWIG_FLAGS "-module" "openscap_pm") if (${CMAKE_VERSION} VERSION_LESS "3.8.0") swig_add_module(openscap_pm perl5 ../openscap.i) else() swig_add_library(openscap_pm LANGUAGE perl5 SOURCES ../openscap.i) endif() swig_link_libraries(openscap_pm openscap ${PERL_LIBRARY}) target_include_directories(openscap_pm PUBLIC ${PERL_INCLUDE_PATH}) if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang") target_compile_options(${SWIG_MODULE_openscap_pm_REAL_NAME} PUBLIC "-w") endif() if (APPLE) install(TARGETS ${SWIG_MODULE_openscap_pm_REAL_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/perl5/vendor_perl) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/openscap_pm.pm DESTINATION ${CMAKE_INSTALL_DATADIR}/perl5/vendor_perl) else() install(TARGETS ${SWIG_MODULE_openscap_pm_REAL_NAME} DESTINATION ${PERL_VENDORLIB}) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/openscap_pm.pm DESTINATION ${PERL_VENDORARCH}) endif()
include(UseSWIG) include(FindPerlLibs) set(CMAKE_SWIG_FLAGS "-module" "openscap_pm") if (${CMAKE_VERSION} VERSION_LESS "3.8.0") swig_add_module(openscap_pm perl5 ../openscap.i) else() swig_add_library(openscap_pm LANGUAGE perl5 SOURCES ../openscap.i) endif() swig_link_libraries(openscap_pm openscap ${PERL_LIBRARY}) target_include_directories(openscap_pm PUBLIC ${PERL_INCLUDE_PATH}) if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang") target_compile_options(${SWIG_MODULE_openscap_pm_REAL_NAME} PUBLIC "-w") endif() if (APPLE OR (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")) install(TARGETS ${SWIG_MODULE_openscap_pm_REAL_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/perl5/vendor_perl) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/openscap_pm.pm DESTINATION ${CMAKE_INSTALL_DATADIR}/perl5/vendor_perl) else() install(TARGETS ${SWIG_MODULE_openscap_pm_REAL_NAME} DESTINATION ${PERL_VENDORLIB}) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/openscap_pm.pm DESTINATION ${PERL_VENDORARCH}) endif()
Fix the build for FreeBSD.
Fix the build for FreeBSD. Commit 69b9b1519 ("Changing hardcoded libperl path for FindPerlLibs method") caused openscap to fail to build on FreeBSD with the following errors: CMake Error at swig/perl/CMakeLists.txt:22 (install): install TARGETS given no LIBRARY DESTINATION for module target "openscap_pm". CMake Error at swig/perl/CMakeLists.txt:24 (install): install PROGRAMS given no DESTINATION! This is due to cmake on FreeBSD not defining PERL_VENDORLIB and PERL_VENDORARCH. Correct this issue by including FreeBSD alongside macOS in using the old hardcoded paths for now.
Text
lgpl-2.1
OpenSCAP/openscap,OpenSCAP/openscap,OpenSCAP/openscap,OpenSCAP/openscap,OpenSCAP/openscap,OpenSCAP/openscap
text
## Code Before: include(UseSWIG) include(FindPerlLibs) set(CMAKE_SWIG_FLAGS "-module" "openscap_pm") if (${CMAKE_VERSION} VERSION_LESS "3.8.0") swig_add_module(openscap_pm perl5 ../openscap.i) else() swig_add_library(openscap_pm LANGUAGE perl5 SOURCES ../openscap.i) endif() swig_link_libraries(openscap_pm openscap ${PERL_LIBRARY}) target_include_directories(openscap_pm PUBLIC ${PERL_INCLUDE_PATH}) if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang") target_compile_options(${SWIG_MODULE_openscap_pm_REAL_NAME} PUBLIC "-w") endif() if (APPLE) install(TARGETS ${SWIG_MODULE_openscap_pm_REAL_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/perl5/vendor_perl) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/openscap_pm.pm DESTINATION ${CMAKE_INSTALL_DATADIR}/perl5/vendor_perl) else() install(TARGETS ${SWIG_MODULE_openscap_pm_REAL_NAME} DESTINATION ${PERL_VENDORLIB}) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/openscap_pm.pm DESTINATION ${PERL_VENDORARCH}) endif() ## Instruction: Fix the build for FreeBSD. Commit 69b9b1519 ("Changing hardcoded libperl path for FindPerlLibs method") caused openscap to fail to build on FreeBSD with the following errors: CMake Error at swig/perl/CMakeLists.txt:22 (install): install TARGETS given no LIBRARY DESTINATION for module target "openscap_pm". CMake Error at swig/perl/CMakeLists.txt:24 (install): install PROGRAMS given no DESTINATION! This is due to cmake on FreeBSD not defining PERL_VENDORLIB and PERL_VENDORARCH. Correct this issue by including FreeBSD alongside macOS in using the old hardcoded paths for now. ## Code After: include(UseSWIG) include(FindPerlLibs) set(CMAKE_SWIG_FLAGS "-module" "openscap_pm") if (${CMAKE_VERSION} VERSION_LESS "3.8.0") swig_add_module(openscap_pm perl5 ../openscap.i) else() swig_add_library(openscap_pm LANGUAGE perl5 SOURCES ../openscap.i) endif() swig_link_libraries(openscap_pm openscap ${PERL_LIBRARY}) target_include_directories(openscap_pm PUBLIC ${PERL_INCLUDE_PATH}) if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang") target_compile_options(${SWIG_MODULE_openscap_pm_REAL_NAME} PUBLIC "-w") endif() if (APPLE OR (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")) install(TARGETS ${SWIG_MODULE_openscap_pm_REAL_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/perl5/vendor_perl) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/openscap_pm.pm DESTINATION ${CMAKE_INSTALL_DATADIR}/perl5/vendor_perl) else() install(TARGETS ${SWIG_MODULE_openscap_pm_REAL_NAME} DESTINATION ${PERL_VENDORLIB}) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/openscap_pm.pm DESTINATION ${PERL_VENDORARCH}) endif()
f5b768cec7f837000695aff1062bf0d2013bd6ee
core/spec/entities/menu/menu_entry_spec.rb
core/spec/entities/menu/menu_entry_spec.rb
require 'spec_helper' require 'menu/menu_entry' module Abc describe MenuEntry do it "wraps passed children" do e = MenuEntry.new('My title', [{:title => 'Child 1'}]) e.children.first.class.should == MenuEntry end end end
require 'spec_helper' require 'menu/menu_entry' module Abc describe MenuEntry do it "wraps passed children" do e = MenuEntry.new('My title', [{:title => 'Child 1'}]) expect(e.children.first).to be_kind_of Abc::MenuEntry end end end
Use be_kind_of in class comparison.
Use be_kind_of in class comparison.
Ruby
bsd-3-clause
grounded/afterburnercms,grounded/afterburnercms
ruby
## Code Before: require 'spec_helper' require 'menu/menu_entry' module Abc describe MenuEntry do it "wraps passed children" do e = MenuEntry.new('My title', [{:title => 'Child 1'}]) e.children.first.class.should == MenuEntry end end end ## Instruction: Use be_kind_of in class comparison. ## Code After: require 'spec_helper' require 'menu/menu_entry' module Abc describe MenuEntry do it "wraps passed children" do e = MenuEntry.new('My title', [{:title => 'Child 1'}]) expect(e.children.first).to be_kind_of Abc::MenuEntry end end end
a9755fc4b30629ea2c9db51aa6d4218f99fcabc3
frigg/deployments/migrations/0004_auto_20150725_1456.py
frigg/deployments/migrations/0004_auto_20150725_1456.py
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('deployments', '0003_prdeployment_start_time'), ] operations = [ migrations.AlterField( model_name='prdeployment', name='image', field=models.CharField(default='frigg/frigg-test-base', max_length=255), ), ]
from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('deployments', '0003_prdeployment_start_time'), ] operations = [ migrations.AlterField( model_name='prdeployment', name='image', field=models.CharField(default=settings.FRIGG_PREVIEW_IMAGE, max_length=255), ), ]
Set FRIGG_PREVIEW_IMAGE in db migrations
Set FRIGG_PREVIEW_IMAGE in db migrations
Python
mit
frigg/frigg-hq,frigg/frigg-hq,frigg/frigg-hq
python
## Code Before: from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('deployments', '0003_prdeployment_start_time'), ] operations = [ migrations.AlterField( model_name='prdeployment', name='image', field=models.CharField(default='frigg/frigg-test-base', max_length=255), ), ] ## Instruction: Set FRIGG_PREVIEW_IMAGE in db migrations ## Code After: from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('deployments', '0003_prdeployment_start_time'), ] operations = [ migrations.AlterField( model_name='prdeployment', name='image', field=models.CharField(default=settings.FRIGG_PREVIEW_IMAGE, max_length=255), ), ]
b054fafb626a43393c418b089eda4acb00a0820b
_data/navigation.yml
_data/navigation.yml
- text: Project submenu: - text: Why HospitalRun? url: /blog/why-hospitalrun/ - text: Features url: /features - text: Try it url: /demo - text: FAQs url: /faq - text: Roadmap url: /roadmap - text: Deploy it url: http://eepurl.com/c7uKJ5 - text: Blog url: /blog - text: Community submenu: - text: Hospital Stories url: /stories - text: Contribute url: /contribute - text: Team url: /team - text: Docs url: https://docs.hospitalrun.io - text: Contact url: /contacts
- text: Project submenu: - text: Why HospitalRun? url: /blog/why-hospitalrun/ - text: Features url: /features - text: Try it url: /demo - text: FAQs url: /faq - text: Roadmap url: /roadmap - text: Deploy it url: http://eepurl.com/c7uKJ5 - text: Blog url: /blog - text: Community submenu: - text: Hospital Stories url: /stories - text: Contribute url: /contribute - text: Team url: /team - text: Standards url: /standards - text: Docs url: https://docs.hospitalrun.io - text: Contact url: /contacts
Add a link to Community's submenu
Add a link to Community's submenu I've added in Community's submenu a link to Standards' page with mandatory rules for every creator of HospitalRun.
YAML
mit
HospitalRun/hospitalrun.github.io,HospitalRun/hospitalrun.github.io,HospitalRun/hospitalrun.github.io
yaml
## Code Before: - text: Project submenu: - text: Why HospitalRun? url: /blog/why-hospitalrun/ - text: Features url: /features - text: Try it url: /demo - text: FAQs url: /faq - text: Roadmap url: /roadmap - text: Deploy it url: http://eepurl.com/c7uKJ5 - text: Blog url: /blog - text: Community submenu: - text: Hospital Stories url: /stories - text: Contribute url: /contribute - text: Team url: /team - text: Docs url: https://docs.hospitalrun.io - text: Contact url: /contacts ## Instruction: Add a link to Community's submenu I've added in Community's submenu a link to Standards' page with mandatory rules for every creator of HospitalRun. ## Code After: - text: Project submenu: - text: Why HospitalRun? url: /blog/why-hospitalrun/ - text: Features url: /features - text: Try it url: /demo - text: FAQs url: /faq - text: Roadmap url: /roadmap - text: Deploy it url: http://eepurl.com/c7uKJ5 - text: Blog url: /blog - text: Community submenu: - text: Hospital Stories url: /stories - text: Contribute url: /contribute - text: Team url: /team - text: Standards url: /standards - text: Docs url: https://docs.hospitalrun.io - text: Contact url: /contacts
7a5733d26e9a7314da2934494a4ccf048956bbb3
config.xml
config.xml
<?xml version='1.0' encoding='utf-8'?> <widget id="se.rishie.ccdiff" version="0.1.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <name>CCdiff</name> <description> An app for comparing Chinese character strokes between different languages and regions. </description> <author email="[email protected]" href="http://ccdiff.rishie.se"> Rishie Sharma </author> <content src="index.html" /> <access origin="*" /> <preference name="StatusBarOverlaysWebView" value="false" /> <preference name="StatusBarStyle" value="default" /> <preference name="DisallowOverscroll" value="true" /> <plugin name="org.apache.cordova.statusbar" spec="0.1.4" source="pgb" /> </widget>
<?xml version='1.0' encoding='utf-8'?> <widget id="se.rishie.ccdiff" version="0.1.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <name>CCdiff</name> <description> An app for comparing Chinese character strokes between different languages and regions. </description> <author email="[email protected]" href="http://ccdiff.rishie.se"> Rishie Sharma </author> <content src="index.html" /> <access origin="*" /> <preference name="StatusBarOverlaysWebView" value="false" /> <preference name="StatusBarStyle" value="default" /> <preference name="StatusBarBackgroundColor" value="#FFFFFF" /> <preference name="DisallowOverscroll" value="true" /> <plugin name="org.apache.cordova.statusbar" spec="0.1.4" source="pgb" /> </widget>
Change to white status bar color
Change to white status bar color
XML
mpl-2.0
fishie/ccdiff,fishie/ccdiff,fishie/ccdiff
xml
## Code Before: <?xml version='1.0' encoding='utf-8'?> <widget id="se.rishie.ccdiff" version="0.1.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <name>CCdiff</name> <description> An app for comparing Chinese character strokes between different languages and regions. </description> <author email="[email protected]" href="http://ccdiff.rishie.se"> Rishie Sharma </author> <content src="index.html" /> <access origin="*" /> <preference name="StatusBarOverlaysWebView" value="false" /> <preference name="StatusBarStyle" value="default" /> <preference name="DisallowOverscroll" value="true" /> <plugin name="org.apache.cordova.statusbar" spec="0.1.4" source="pgb" /> </widget> ## Instruction: Change to white status bar color ## Code After: <?xml version='1.0' encoding='utf-8'?> <widget id="se.rishie.ccdiff" version="0.1.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <name>CCdiff</name> <description> An app for comparing Chinese character strokes between different languages and regions. </description> <author email="[email protected]" href="http://ccdiff.rishie.se"> Rishie Sharma </author> <content src="index.html" /> <access origin="*" /> <preference name="StatusBarOverlaysWebView" value="false" /> <preference name="StatusBarStyle" value="default" /> <preference name="StatusBarBackgroundColor" value="#FFFFFF" /> <preference name="DisallowOverscroll" value="true" /> <plugin name="org.apache.cordova.statusbar" spec="0.1.4" source="pgb" /> </widget>
0b8faccaf2decc8628c376ba85e18f237bff6935
data/class_groups/glance_all.yaml
data/class_groups/glance_all.yaml
classes: - glance - glance::api - glance::registry - "glance::backend::%{glance_backend}"
classes: - glance - glance::api - glance::registry - "glance::backend::%{glance_backend}" - glance::cache::pruner
Add glance cache pruner job
Add glance cache pruner job On nodes where we set up glance, we currently don't set up a glance cache pruning job. This is a recommended practice as it can allow glance images to take up more disk space than they should be allowed to by the image_cache_max_size setting (refer to http://docs.openstack.org/developer/glance/cache.html). This patch adds glance::cache::pruner to the glance_all class group so that a pruner job gets added to nodes running glance. Change-Id: I9cf46057f7cf436a54c121b5364a2d17ebc9fbb8 Implements: blueprint add-glance-cache-pruner
YAML
apache-2.0
CiscoSystems/puppet_openstack_builder,phchoic/puppet_openstack_builder,michaeltchapman/puppet_openstack_builder,michaeltchapman/puppet_openstack_builder,michaeltchapman/vagrant-consul,michaeltchapman/vagrant-consul,phchoic/puppet_openstack_builder,CiscoSystems/puppet_openstack_builder,michaeltchapman/puppet_openstack_builder,phchoic/puppet_openstack_builder
yaml
## Code Before: classes: - glance - glance::api - glance::registry - "glance::backend::%{glance_backend}" ## Instruction: Add glance cache pruner job On nodes where we set up glance, we currently don't set up a glance cache pruning job. This is a recommended practice as it can allow glance images to take up more disk space than they should be allowed to by the image_cache_max_size setting (refer to http://docs.openstack.org/developer/glance/cache.html). This patch adds glance::cache::pruner to the glance_all class group so that a pruner job gets added to nodes running glance. Change-Id: I9cf46057f7cf436a54c121b5364a2d17ebc9fbb8 Implements: blueprint add-glance-cache-pruner ## Code After: classes: - glance - glance::api - glance::registry - "glance::backend::%{glance_backend}" - glance::cache::pruner
6f33921cc33dac50b0d17c496bc58f46d888c841
app/js/arethusa.review/directives/review_linker.js
app/js/arethusa.review/directives/review_linker.js
"use strict"; angular.module('arethusa.review').directive('reviewLinker', [ 'review', 'translator', function(review, translator) { return { restrict: 'A', scope: {}, link: function(scope, element, attrs) { scope.review = review; scope.translations = {}; translator('review.link', scope.translations, 'link'); translator('review.unlink', scope.translations, 'unlink'); function setTitle(prop) { element.attr('title', scope.translations[scope.icon]); } scope.$watch('translations', function(newVal, oldVal) { if (newVal !== oldVal) setTitle(); }); scope.$watch('review.link', function(newVal, oldVal) { if (newVal) { scope.icon = 'unlink'; review.goToCurrentChunk(); } else { scope.icon = 'link'; } setTitle(); }); }, templateUrl: 'templates/arethusa.review/review_linker.html' }; } ]);
"use strict"; angular.module('arethusa.review').directive('reviewLinker', [ 'review', 'translator', function(review, translator) { return { restrict: 'A', scope: {}, link: function(scope, element, attrs) { scope.review = review; scope.translations = {}; translator('review.link', scope.translations, 'link'); translator('review.unlink', scope.translations, 'unlink'); function setTitle(prop) { element.attr('title', scope.translations[scope.icon]); } scope.$watch('translations', function(newVal, oldVal) { if (newVal !== oldVal) setTitle(); }); scope.$watch('review.link', function(newVal, oldVal) { if (newVal) { scope.icon = 'unlink'; if (newVal !== oldVal) { review.goToCurrentChunk(); } } else { scope.icon = 'link'; } setTitle(); }); }, templateUrl: 'templates/arethusa.review/review_linker.html' }; } ]);
Fix prematurely firing reviewLinker directive
Fix prematurely firing reviewLinker directive
JavaScript
mit
fbaumgardt/arethusa,alpheios-project/arethusa,Masoumeh/arethusa,PonteIneptique/arethusa,alpheios-project/arethusa,latin-language-toolkit/arethusa,fbaumgardt/arethusa,fbaumgardt/arethusa,PonteIneptique/arethusa,Masoumeh/arethusa,alpheios-project/arethusa,latin-language-toolkit/arethusa
javascript
## Code Before: "use strict"; angular.module('arethusa.review').directive('reviewLinker', [ 'review', 'translator', function(review, translator) { return { restrict: 'A', scope: {}, link: function(scope, element, attrs) { scope.review = review; scope.translations = {}; translator('review.link', scope.translations, 'link'); translator('review.unlink', scope.translations, 'unlink'); function setTitle(prop) { element.attr('title', scope.translations[scope.icon]); } scope.$watch('translations', function(newVal, oldVal) { if (newVal !== oldVal) setTitle(); }); scope.$watch('review.link', function(newVal, oldVal) { if (newVal) { scope.icon = 'unlink'; review.goToCurrentChunk(); } else { scope.icon = 'link'; } setTitle(); }); }, templateUrl: 'templates/arethusa.review/review_linker.html' }; } ]); ## Instruction: Fix prematurely firing reviewLinker directive ## Code After: "use strict"; angular.module('arethusa.review').directive('reviewLinker', [ 'review', 'translator', function(review, translator) { return { restrict: 'A', scope: {}, link: function(scope, element, attrs) { scope.review = review; scope.translations = {}; translator('review.link', scope.translations, 'link'); translator('review.unlink', scope.translations, 'unlink'); function setTitle(prop) { element.attr('title', scope.translations[scope.icon]); } scope.$watch('translations', function(newVal, oldVal) { if (newVal !== oldVal) setTitle(); }); scope.$watch('review.link', function(newVal, oldVal) { if (newVal) { scope.icon = 'unlink'; if (newVal !== oldVal) { review.goToCurrentChunk(); } } else { scope.icon = 'link'; } setTitle(); }); }, templateUrl: 'templates/arethusa.review/review_linker.html' }; } ]);
9e06868011d7045b014dbe766c65dde40b8f41d1
spec/ruby_spec.rb
spec/ruby_spec.rb
require "spec_helper_#{ENV['SPEC_TARGET_BACKEND']}" describe package('ruby'), :if => os[:family] == 'darwin' do it { should be_installed.by('homebrew') } end describe package('ruby'), :if => os[:family] == 'debian' do it { should be_installed.by('apt') } end describe package('ruby') do its(:version) { should >= '2.0' } end describe command('which ruby') do its(:exit_status) { should eq 0 } end describe command('which gem') do its(:exit_status) { should eq 0 } end describe package('bundler') do it { should be_installed.by('gem') } end describe command('which bundle') do its(:exit_status) { should eq 0 } end
require "spec_helper_#{ENV['SPEC_TARGET_BACKEND']}" # In default, Serverspec uses the context specified environment variables are clear. # Ref. https://github.com/mizzy/specinfra/blob/master/lib/specinfra/backend/exec.rb#L128 set :env, :GEM_PATH => ENV['GEM_PATH'] describe package('ruby'), :if => os[:family] == 'darwin' do it { should be_installed.by('homebrew') } end describe package('ruby'), :if => os[:family] == 'debian' do it { should be_installed.by('apt') } end describe package('ruby') do its(:version) { should >= '2.0' } end describe command('which ruby') do its(:exit_status) { should eq 0 } end describe command('which gem') do its(:exit_status) { should eq 0 } end describe package('bundler') do it { should be_installed.by('gem') } end describe command('which bundle') do its(:exit_status) { should eq 0 } end
Set GEM_PATH to Specinfra config.
Set GEM_PATH to Specinfra config. Or, Serverspec can't find gems Ansible playbooks install.
Ruby
mit
FGtatsuro/ansible-ruby
ruby
## Code Before: require "spec_helper_#{ENV['SPEC_TARGET_BACKEND']}" describe package('ruby'), :if => os[:family] == 'darwin' do it { should be_installed.by('homebrew') } end describe package('ruby'), :if => os[:family] == 'debian' do it { should be_installed.by('apt') } end describe package('ruby') do its(:version) { should >= '2.0' } end describe command('which ruby') do its(:exit_status) { should eq 0 } end describe command('which gem') do its(:exit_status) { should eq 0 } end describe package('bundler') do it { should be_installed.by('gem') } end describe command('which bundle') do its(:exit_status) { should eq 0 } end ## Instruction: Set GEM_PATH to Specinfra config. Or, Serverspec can't find gems Ansible playbooks install. ## Code After: require "spec_helper_#{ENV['SPEC_TARGET_BACKEND']}" # In default, Serverspec uses the context specified environment variables are clear. # Ref. https://github.com/mizzy/specinfra/blob/master/lib/specinfra/backend/exec.rb#L128 set :env, :GEM_PATH => ENV['GEM_PATH'] describe package('ruby'), :if => os[:family] == 'darwin' do it { should be_installed.by('homebrew') } end describe package('ruby'), :if => os[:family] == 'debian' do it { should be_installed.by('apt') } end describe package('ruby') do its(:version) { should >= '2.0' } end describe command('which ruby') do its(:exit_status) { should eq 0 } end describe command('which gem') do its(:exit_status) { should eq 0 } end describe package('bundler') do it { should be_installed.by('gem') } end describe command('which bundle') do its(:exit_status) { should eq 0 } end
2c86c4f865baed1235e7432c928d02c50eb1080a
popup.html
popup.html
<!DOCTYPE html> <html> <head> <script src="popup.js"></script> <script src="jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="popup.css" /> </head> <body> <header> <h1>Tumblr Batch Block</h1> </header> <main> <section id="instructions"> <h1>Instructions:</h1> <ol> <li>Navigate to the 'Edit appearance' page for your blog.</li> <li>Click the button with the action you would like to take.</li> </ol> <p><strong>Please note:</strong> Both blocking and exporting may take some time, but you can continue to surf the web in another tab while the app runs.</p> </section> <!-- end instructions --> <section id="controls"> <h1>Controls</h1> <button id='blockButton'>Block</button> <button id='exportBlockListButton'>Export Blocklist</button> </section> <!-- end controls --> </main> <footer> <nav> <a href="https://github.com/realityfabric/Tumblr-Batch-Block">Project Site</a> <a href="https://github.com/realityfabric/Tumblr-Batch-Block/issues">Report an Issue</a> </nav> </footer> </body> </html>
<!DOCTYPE html> <html> <head> <script src="popup.js"></script> <script src="jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="popup.css" /> </head> <body> <header> <h1>Tumblr Batch Block</h1> </header> <main> <section id="instructions"> <h1>Instructions:</h1> <ol> <li>Navigate to the 'Edit appearance' page for your blog.</li> <li>Click the button with the action you would like to take.</li> </ol> <p><strong>Please note:</strong> Both blocking and exporting may take some time, but you can continue to surf the web in another tab while the app runs. When exporting, the list will appear at the top of the page in the sidebar on the right.</p> </section> <!-- end instructions --> <section id="controls"> <h1>Controls</h1> <button id='blockButton'>Block</button> <button id='exportBlockListButton'>Export Blocklist</button> </section> <!-- end controls --> </main> <footer> <nav> <a href="https://github.com/realityfabric/Tumblr-Batch-Block">Project Site</a> <a href="https://github.com/realityfabric/Tumblr-Batch-Block/issues">Report an Issue</a> </nav> </footer> </body> </html>
Add instructions on how to find the exported blocklist
Add instructions on how to find the exported blocklist
HTML
agpl-3.0
realityfabric/Tumblr-Batch-Block,realityfabric/Tumblr-Batch-Block
html
## Code Before: <!DOCTYPE html> <html> <head> <script src="popup.js"></script> <script src="jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="popup.css" /> </head> <body> <header> <h1>Tumblr Batch Block</h1> </header> <main> <section id="instructions"> <h1>Instructions:</h1> <ol> <li>Navigate to the 'Edit appearance' page for your blog.</li> <li>Click the button with the action you would like to take.</li> </ol> <p><strong>Please note:</strong> Both blocking and exporting may take some time, but you can continue to surf the web in another tab while the app runs.</p> </section> <!-- end instructions --> <section id="controls"> <h1>Controls</h1> <button id='blockButton'>Block</button> <button id='exportBlockListButton'>Export Blocklist</button> </section> <!-- end controls --> </main> <footer> <nav> <a href="https://github.com/realityfabric/Tumblr-Batch-Block">Project Site</a> <a href="https://github.com/realityfabric/Tumblr-Batch-Block/issues">Report an Issue</a> </nav> </footer> </body> </html> ## Instruction: Add instructions on how to find the exported blocklist ## Code After: <!DOCTYPE html> <html> <head> <script src="popup.js"></script> <script src="jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="popup.css" /> </head> <body> <header> <h1>Tumblr Batch Block</h1> </header> <main> <section id="instructions"> <h1>Instructions:</h1> <ol> <li>Navigate to the 'Edit appearance' page for your blog.</li> <li>Click the button with the action you would like to take.</li> </ol> <p><strong>Please note:</strong> Both blocking and exporting may take some time, but you can continue to surf the web in another tab while the app runs. When exporting, the list will appear at the top of the page in the sidebar on the right.</p> </section> <!-- end instructions --> <section id="controls"> <h1>Controls</h1> <button id='blockButton'>Block</button> <button id='exportBlockListButton'>Export Blocklist</button> </section> <!-- end controls --> </main> <footer> <nav> <a href="https://github.com/realityfabric/Tumblr-Batch-Block">Project Site</a> <a href="https://github.com/realityfabric/Tumblr-Batch-Block/issues">Report an Issue</a> </nav> </footer> </body> </html>
bbcada86c706520c09e13320cb4edf6b1b8eaf41
Cargo.toml
Cargo.toml
[package] name = "chorus_studio" version = "0.1.0" authors = ["Daniel Hauser <[email protected]>"] [dependencies] gl = "0.7.0" glutin = "0.12.0" nalgebra = "0.13.1" unicode-normalization = "0.1.5" # indextree = "1.1.0" [dependencies.nanovg] git = "https://github.com/KevinKelley/nanovg-rs" features = ["gl3"] [dependencies.indextree] path = "../indextree"
[package] name = "chorus_studio" version = "0.1.0" authors = ["Daniel Hauser <[email protected]>"] [dependencies] gl = "0.7.0" glutin = "0.12.0" nalgebra = "0.13.1" unicode-normalization = "0.1.5" # indextree = "1.1.0" [dependencies.nanovg] git = "https://github.com/KevinKelley/nanovg-rs" features = ["gl3"] [dependencies.indextree] git = "https://github.com/saschagrunert/indextree"
Use git version of indextree instead of rel path
Use git version of indextree instead of rel path Awaiting a crates.io version bump with my pull request.
TOML
apache-2.0
Lisoph/chorus_studio
toml
## Code Before: [package] name = "chorus_studio" version = "0.1.0" authors = ["Daniel Hauser <[email protected]>"] [dependencies] gl = "0.7.0" glutin = "0.12.0" nalgebra = "0.13.1" unicode-normalization = "0.1.5" # indextree = "1.1.0" [dependencies.nanovg] git = "https://github.com/KevinKelley/nanovg-rs" features = ["gl3"] [dependencies.indextree] path = "../indextree" ## Instruction: Use git version of indextree instead of rel path Awaiting a crates.io version bump with my pull request. ## Code After: [package] name = "chorus_studio" version = "0.1.0" authors = ["Daniel Hauser <[email protected]>"] [dependencies] gl = "0.7.0" glutin = "0.12.0" nalgebra = "0.13.1" unicode-normalization = "0.1.5" # indextree = "1.1.0" [dependencies.nanovg] git = "https://github.com/KevinKelley/nanovg-rs" features = ["gl3"] [dependencies.indextree] git = "https://github.com/saschagrunert/indextree"
3259c2e382b736e13069265eb264079e3d3b9148
production/bin/start.sh
production/bin/start.sh
LOGFILE=${DEPLOYDIR}/log/${RAILS_ENV}.log SERVER_PORT=3300 #since GITHUB_TOKEN environment variable is a json object, we need parse the value #This function is here due to a limitation by "secrets manager" if [[ -z ${GITHUB_TOKEN+x} || -z ${DEPLOY_ENV+x} || -z ${APP+x} ]]; then echo "GITHUB_TOKEN, DEPLOY_ENV and APP must be in the environment. Exiting." exit 1 fi if [ ! -d "configurator" ]; then git clone -q https://${GITHUB_TOKEN}:[email protected]/meedan/configurator ./configurator; fi d=configurator/check/${DEPLOY_ENV}/${APP}/; for f in $(find $d -type f); do cp "$f" "${f/$d/}"; done mkdir -p ${PWD}/tmp/pids puma="${PWD}/tmp/puma-${RAILS_ENV}.rb" cp config/puma.rb ${puma} cat << EOF >> ${puma} pidfile '/app/current/tmp/pids/server-${RAILS_ENV}.pid' environment '${RAILS_ENV}' port ${SERVER_PORT} workers 3 EOF bundle exec puma -C ${puma} -t 8:32
LOGFILE=${DEPLOYDIR}/log/${RAILS_ENV}.log SERVER_PORT=3300 #since GITHUB_TOKEN environment variable is a json object, we need parse the value #This function is here due to a limitation by "secrets manager" if [[ -z ${GITHUB_TOKEN+x} || -z ${DEPLOY_ENV+x} || -z ${APP+x} ]]; then echo "GITHUB_TOKEN, DEPLOY_ENV and APP must be in the environment. Exiting." exit 1 fi if [ ! -d "configurator" ]; then git clone -q https://${GITHUB_TOKEN}:[email protected]/meedan/configurator ./configurator; fi d=configurator/check/${DEPLOY_ENV}/${APP}/; for f in $(find $d -type f); do cp "$f" "${f/$d/}"; done mkdir -p ${PWD}/tmp/pids puma="${PWD}/tmp/puma-${RAILS_ENV}.rb" cp config/puma.rb ${puma} cat << EOF >> ${puma} pidfile '/app/current/tmp/pids/server-${RAILS_ENV}.pid' environment '${RAILS_ENV}' port ${SERVER_PORT} workers 2 worker_timeout 120 EOF bundle exec puma -C ${puma} -t 4:32
Update worker timeout and threads
Update worker timeout and threads
Shell
mit
meedan/check-api,meedan/check-api,meedan/check-api,meedan/check-api,meedan/check-api
shell
## Code Before: LOGFILE=${DEPLOYDIR}/log/${RAILS_ENV}.log SERVER_PORT=3300 #since GITHUB_TOKEN environment variable is a json object, we need parse the value #This function is here due to a limitation by "secrets manager" if [[ -z ${GITHUB_TOKEN+x} || -z ${DEPLOY_ENV+x} || -z ${APP+x} ]]; then echo "GITHUB_TOKEN, DEPLOY_ENV and APP must be in the environment. Exiting." exit 1 fi if [ ! -d "configurator" ]; then git clone -q https://${GITHUB_TOKEN}:[email protected]/meedan/configurator ./configurator; fi d=configurator/check/${DEPLOY_ENV}/${APP}/; for f in $(find $d -type f); do cp "$f" "${f/$d/}"; done mkdir -p ${PWD}/tmp/pids puma="${PWD}/tmp/puma-${RAILS_ENV}.rb" cp config/puma.rb ${puma} cat << EOF >> ${puma} pidfile '/app/current/tmp/pids/server-${RAILS_ENV}.pid' environment '${RAILS_ENV}' port ${SERVER_PORT} workers 3 EOF bundle exec puma -C ${puma} -t 8:32 ## Instruction: Update worker timeout and threads ## Code After: LOGFILE=${DEPLOYDIR}/log/${RAILS_ENV}.log SERVER_PORT=3300 #since GITHUB_TOKEN environment variable is a json object, we need parse the value #This function is here due to a limitation by "secrets manager" if [[ -z ${GITHUB_TOKEN+x} || -z ${DEPLOY_ENV+x} || -z ${APP+x} ]]; then echo "GITHUB_TOKEN, DEPLOY_ENV and APP must be in the environment. Exiting." exit 1 fi if [ ! -d "configurator" ]; then git clone -q https://${GITHUB_TOKEN}:[email protected]/meedan/configurator ./configurator; fi d=configurator/check/${DEPLOY_ENV}/${APP}/; for f in $(find $d -type f); do cp "$f" "${f/$d/}"; done mkdir -p ${PWD}/tmp/pids puma="${PWD}/tmp/puma-${RAILS_ENV}.rb" cp config/puma.rb ${puma} cat << EOF >> ${puma} pidfile '/app/current/tmp/pids/server-${RAILS_ENV}.pid' environment '${RAILS_ENV}' port ${SERVER_PORT} workers 2 worker_timeout 120 EOF bundle exec puma -C ${puma} -t 4:32
0cd621e5433b739c6b1e227fd700066876958791
partials/navbar-menu.html
partials/navbar-menu.html
<li id="usermenu"> <a href="catalogs"> <span class="glyphicon glyphicon-inbox"></span> {{'navbar_manage_catalogs' | transl8}} </a> <a href="editUser"> <span class="glyphicon glyphicon-pencil"></span> {{ 'navbar_edit_profile' | transl8 }} </a> <a href="pwdreset"> <span class="glyphicon glyphicon-lock"></span> {{ 'navbar_change_password' | transl8 }} </a> <a href="admin/dataimport" ng-if="userObject.groupID>=800"> <span class="glyphicon glyphicon-transfer"></span> Dataimport </a> </li>
<li id="usermenu"> <a href="catalogs"> <span class="glyphicon glyphicon-inbox"></span> {{'navbar_manage_catalogs' | transl8}} </a> <a href="editUser"> <span class="glyphicon glyphicon-pencil"></span> {{ 'navbar_edit_profile' | transl8 }} </a> <!--<a href="pwdreset"></a> this does not work for logged in users--> <a href="admin/dataimport" ng-if="userObject.groupID>=800"> <span class="glyphicon glyphicon-transfer"></span> Dataimport </a> </li>
Remove non working (for logged in users) )link to pwdreset.
Remove non working (for logged in users) )link to pwdreset.
HTML
apache-2.0
codarchlab/arachnefrontend,dainst/arachnefrontend,codarchlab/arachnefrontend,dainst/arachnefrontend
html
## Code Before: <li id="usermenu"> <a href="catalogs"> <span class="glyphicon glyphicon-inbox"></span> {{'navbar_manage_catalogs' | transl8}} </a> <a href="editUser"> <span class="glyphicon glyphicon-pencil"></span> {{ 'navbar_edit_profile' | transl8 }} </a> <a href="pwdreset"> <span class="glyphicon glyphicon-lock"></span> {{ 'navbar_change_password' | transl8 }} </a> <a href="admin/dataimport" ng-if="userObject.groupID>=800"> <span class="glyphicon glyphicon-transfer"></span> Dataimport </a> </li> ## Instruction: Remove non working (for logged in users) )link to pwdreset. ## Code After: <li id="usermenu"> <a href="catalogs"> <span class="glyphicon glyphicon-inbox"></span> {{'navbar_manage_catalogs' | transl8}} </a> <a href="editUser"> <span class="glyphicon glyphicon-pencil"></span> {{ 'navbar_edit_profile' | transl8 }} </a> <!--<a href="pwdreset"></a> this does not work for logged in users--> <a href="admin/dataimport" ng-if="userObject.groupID>=800"> <span class="glyphicon glyphicon-transfer"></span> Dataimport </a> </li>
02e7738a6c698f4f488e95f2932490b26f0b53a7
src/js/components/TimeColumn.js
src/js/components/TimeColumn.js
import React, { Component, PropTypes } from 'react'; export default class TimeColumn extends Component { // static propTypes = { // times: PropTypes.array.isRequired // }; render() { const hours = ['12', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11']; const minutes = ['00', '15', '30', '45'] const times = _.flatten(hours.map((hour) => { return minutes.map((min) => { return `${hour}:${min}`; }); })); const timesToRender = times.map((ts, i) => { return <li key={i}>{ts}</li>; }); return <div> <h1>Times</h1> <ul> {timesToRender} </ul> </div>; } }
import React, { Component, PropTypes } from 'react'; export default class TimeColumn extends Component { // static propTypes = { // times: PropTypes.array.isRequired // }; render() { const hours = ['12', '1', '2', '3', '4', '5', '6', '7', '8', '9']; const minutes = ['00', '15', '30', '45'] const times = _.flatten(hours.map((hour) => { return minutes.map((min) => { return `${hour}:${min}`; }); })); const timesToRender = times.map((ts, i) => { return <li key={i}>{ts}</li>; }); return <div> <h1>Times</h1> <ul> {timesToRender} </ul> </div>; } }
Update length of Times to go to 10pm
Update length of Times to go to 10pm
JavaScript
mit
gregRV/myoutsidelands-frontend,gregRV/myoutsidelands-frontend
javascript
## Code Before: import React, { Component, PropTypes } from 'react'; export default class TimeColumn extends Component { // static propTypes = { // times: PropTypes.array.isRequired // }; render() { const hours = ['12', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11']; const minutes = ['00', '15', '30', '45'] const times = _.flatten(hours.map((hour) => { return minutes.map((min) => { return `${hour}:${min}`; }); })); const timesToRender = times.map((ts, i) => { return <li key={i}>{ts}</li>; }); return <div> <h1>Times</h1> <ul> {timesToRender} </ul> </div>; } } ## Instruction: Update length of Times to go to 10pm ## Code After: import React, { Component, PropTypes } from 'react'; export default class TimeColumn extends Component { // static propTypes = { // times: PropTypes.array.isRequired // }; render() { const hours = ['12', '1', '2', '3', '4', '5', '6', '7', '8', '9']; const minutes = ['00', '15', '30', '45'] const times = _.flatten(hours.map((hour) => { return minutes.map((min) => { return `${hour}:${min}`; }); })); const timesToRender = times.map((ts, i) => { return <li key={i}>{ts}</li>; }); return <div> <h1>Times</h1> <ul> {timesToRender} </ul> </div>; } }
9e805906ec1ba090bb6aebe630458ff817aaf995
test/CXX/dcl.dcl/dcl.link/p7-2.cpp
test/CXX/dcl.dcl/dcl.link/p7-2.cpp
// RUN: %clang_cc1 -ast-print -o - %s | FileCheck %s extern "C" void f(void); // CHECK: extern "C" void f() extern "C" void v; // CHECK: extern "C" void v
// RUN: %clang_cc1 -ast-print -o - %s | FileCheck %s extern "C" int f(void); // CHECK: extern "C" int f() extern "C" int v; // CHECK: extern "C" int v
Replace void with int to make this a valid C++ file.
Replace void with int to make this a valid C++ file. The test was passing because clang would still print the ast before exiting with an error. Since that didn't seem to be the intent of the test, I change the test instead of adding 'not' to the command line. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@185634 91177308-0d34-0410-b5e6-96231b3b80d8
C++
apache-2.0
apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang
c++
## Code Before: // RUN: %clang_cc1 -ast-print -o - %s | FileCheck %s extern "C" void f(void); // CHECK: extern "C" void f() extern "C" void v; // CHECK: extern "C" void v ## Instruction: Replace void with int to make this a valid C++ file. The test was passing because clang would still print the ast before exiting with an error. Since that didn't seem to be the intent of the test, I change the test instead of adding 'not' to the command line. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@185634 91177308-0d34-0410-b5e6-96231b3b80d8 ## Code After: // RUN: %clang_cc1 -ast-print -o - %s | FileCheck %s extern "C" int f(void); // CHECK: extern "C" int f() extern "C" int v; // CHECK: extern "C" int v
0bd6c1126a111084d69990ef25440ad6d858d936
config/schedule.rb
config/schedule.rb
@root_path = File.expand_path('../..', __FILE__) set :output, "#{@root_path}/tmp/cron_log.log" every :sunday, :at => '18:13pm' do command "#{@root_path}/bin/deliciousletter" end
@root_path = File.expand_path('../..', __FILE__) set :output, "#{@root_path}/tmp/cron_log.log" every :sunday, :at => '18:13pm' do command "bundle exec #{@root_path}/bin/deliciousletter" end
Use bundler when calling wheneverized commands
Use bundler when calling wheneverized commands
Ruby
mit
shakaman/DeliciousLetter
ruby
## Code Before: @root_path = File.expand_path('../..', __FILE__) set :output, "#{@root_path}/tmp/cron_log.log" every :sunday, :at => '18:13pm' do command "#{@root_path}/bin/deliciousletter" end ## Instruction: Use bundler when calling wheneverized commands ## Code After: @root_path = File.expand_path('../..', __FILE__) set :output, "#{@root_path}/tmp/cron_log.log" every :sunday, :at => '18:13pm' do command "bundle exec #{@root_path}/bin/deliciousletter" end
2b40c556a544c0ba8ac9bab53dd073623a80f7dd
src/rest/core.clj
src/rest/core.clj
(ns rest.core (:require [ring.util.response :as resp] [compojure.handler :as handler] [compojure.core :refer [routes]] ; Auth [cemerick.friend :as friend] (cemerick.friend [credentials :as credentials] [workflows :as workflows]) [rest.auth.views :refer [unauthorized]] [rest.auth.services :refer [user]] ; Routes [rest.auth.routes :refer [auth-routes]] [rest.tasks.routes :refer [tasks-routes]] [rest.base.routes :refer [base-routes]])) (def app-routes (routes auth-routes tasks-routes base-routes)) (def app (handler/site (friend/authenticate app-routes {:allow-anon? true :login-url "/login" :unauthorized-handler #(-> unauthorized resp/response (resp/status 401)) :credential-fn #(credentials/bcrypt-credential-fn user %) :workflows [(workflows/interactive-form)]})))
(ns rest.core (:require [ring.util.response :as resp] [compojure.handler :as handler] [compojure.core :refer [routes]] ; Auth [cemerick.friend :as friend] (cemerick.friend [credentials :as credentials] [workflows :as workflows]) [rest.auth.views :refer [unauthorized]] [rest.auth.services :refer [user]] ; Routes [rest.auth.routes :refer [auth-routes]] [rest.tasks.routes :refer [tasks-routes]] [rest.base.routes :refer [base-routes]])) (def app-routes (routes auth-routes tasks-routes base-routes)) (def app (handler/site (friend/authenticate app-routes {:allow-anon? true :login-url "/login" :default-landing-uri "/tasks" :unauthorized-handler #(-> unauthorized resp/response (resp/status 401)) :credential-fn #(credentials/bcrypt-credential-fn user %) :workflows [(workflows/interactive-form)]})))
Use /tasks as the landing URI after login
Use /tasks as the landing URI after login
Clojure
apache-2.0
Alotor/poc-clojure-rest
clojure
## Code Before: (ns rest.core (:require [ring.util.response :as resp] [compojure.handler :as handler] [compojure.core :refer [routes]] ; Auth [cemerick.friend :as friend] (cemerick.friend [credentials :as credentials] [workflows :as workflows]) [rest.auth.views :refer [unauthorized]] [rest.auth.services :refer [user]] ; Routes [rest.auth.routes :refer [auth-routes]] [rest.tasks.routes :refer [tasks-routes]] [rest.base.routes :refer [base-routes]])) (def app-routes (routes auth-routes tasks-routes base-routes)) (def app (handler/site (friend/authenticate app-routes {:allow-anon? true :login-url "/login" :unauthorized-handler #(-> unauthorized resp/response (resp/status 401)) :credential-fn #(credentials/bcrypt-credential-fn user %) :workflows [(workflows/interactive-form)]}))) ## Instruction: Use /tasks as the landing URI after login ## Code After: (ns rest.core (:require [ring.util.response :as resp] [compojure.handler :as handler] [compojure.core :refer [routes]] ; Auth [cemerick.friend :as friend] (cemerick.friend [credentials :as credentials] [workflows :as workflows]) [rest.auth.views :refer [unauthorized]] [rest.auth.services :refer [user]] ; Routes [rest.auth.routes :refer [auth-routes]] [rest.tasks.routes :refer [tasks-routes]] [rest.base.routes :refer [base-routes]])) (def app-routes (routes auth-routes tasks-routes base-routes)) (def app (handler/site (friend/authenticate app-routes {:allow-anon? true :login-url "/login" :default-landing-uri "/tasks" :unauthorized-handler #(-> unauthorized resp/response (resp/status 401)) :credential-fn #(credentials/bcrypt-credential-fn user %) :workflows [(workflows/interactive-form)]})))
b91d14fd6cc0d4be8611451813ee7ecbea85f713
tests/cases/fourslash/declarationExpressions.ts
tests/cases/fourslash/declarationExpressions.ts
/// <reference path="fourslash.ts"/> ////class A {} ////const B = class C { //// public x; ////}; ////function D() {} ////const E = function F() {} ////console.log(function inner() {}) ////String(function fun() { class cls { public prop; } })) function navExact(name: string, kind: string) { verify.navigationItemsListContains(name, kind, name, "exact"); } navExact("A", "class"); navExact("B", "const"); navExact("C", "class"); navExact("x", "property"); navExact("D", "function"); navExact("E", "const"); navExact("F", "function") navExact("inner", "function"); navExact("fun", "function"); navExact("cls", "class"); navExact("prop", "property");
/// <reference path="fourslash.ts"/> ////class A {} ////const B = class C { //// public x; ////}; ////function D() {} ////const E = function F() {} ////console.log(function() {}, class {}); // Expression with no name should have no effect. ////console.log(function inner() {}); ////String(function fun() { class cls { public prop; } })); function navExact(name: string, kind: string) { verify.navigationItemsListContains(name, kind, name, "exact"); } navExact("A", "class"); navExact("B", "const"); navExact("C", "class"); navExact("x", "property"); navExact("D", "function"); navExact("E", "const"); navExact("F", "function") navExact("inner", "function"); navExact("fun", "function"); navExact("cls", "class"); navExact("prop", "property");
Test expressions with no name
Test expressions with no name
TypeScript
apache-2.0
erikmcc/TypeScript,minestarks/TypeScript,kitsonk/TypeScript,jwbay/TypeScript,RyanCavanaugh/TypeScript,DLehenbauer/TypeScript,thr0w/Thr0wScript,Eyas/TypeScript,alexeagle/TypeScript,nojvek/TypeScript,TukekeSoft/TypeScript,plantain-00/TypeScript,kpreisser/TypeScript,chuckjaz/TypeScript,SaschaNaz/TypeScript,DLehenbauer/TypeScript,basarat/TypeScript,plantain-00/TypeScript,RyanCavanaugh/TypeScript,chuckjaz/TypeScript,kpreisser/TypeScript,basarat/TypeScript,kitsonk/TypeScript,synaptek/TypeScript,mihailik/TypeScript,thr0w/Thr0wScript,alexeagle/TypeScript,DLehenbauer/TypeScript,weswigham/TypeScript,kitsonk/TypeScript,basarat/TypeScript,SaschaNaz/TypeScript,Eyas/TypeScript,donaldpipowitch/TypeScript,nojvek/TypeScript,TukekeSoft/TypeScript,nojvek/TypeScript,chuckjaz/TypeScript,SaschaNaz/TypeScript,Eyas/TypeScript,Microsoft/TypeScript,thr0w/Thr0wScript,microsoft/TypeScript,synaptek/TypeScript,erikmcc/TypeScript,synaptek/TypeScript,vilic/TypeScript,mihailik/TypeScript,synaptek/TypeScript,mihailik/TypeScript,donaldpipowitch/TypeScript,vilic/TypeScript,Microsoft/TypeScript,minestarks/TypeScript,chuckjaz/TypeScript,alexeagle/TypeScript,basarat/TypeScript,TukekeSoft/TypeScript,RyanCavanaugh/TypeScript,weswigham/TypeScript,Microsoft/TypeScript,jwbay/TypeScript,jeremyepling/TypeScript,SaschaNaz/TypeScript,donaldpipowitch/TypeScript,Eyas/TypeScript,jwbay/TypeScript,jeremyepling/TypeScript,microsoft/TypeScript,microsoft/TypeScript,plantain-00/TypeScript,jeremyepling/TypeScript,erikmcc/TypeScript,thr0w/Thr0wScript,jwbay/TypeScript,plantain-00/TypeScript,kpreisser/TypeScript,weswigham/TypeScript,nojvek/TypeScript,mihailik/TypeScript,vilic/TypeScript,donaldpipowitch/TypeScript,DLehenbauer/TypeScript,erikmcc/TypeScript,minestarks/TypeScript,vilic/TypeScript
typescript
## Code Before: /// <reference path="fourslash.ts"/> ////class A {} ////const B = class C { //// public x; ////}; ////function D() {} ////const E = function F() {} ////console.log(function inner() {}) ////String(function fun() { class cls { public prop; } })) function navExact(name: string, kind: string) { verify.navigationItemsListContains(name, kind, name, "exact"); } navExact("A", "class"); navExact("B", "const"); navExact("C", "class"); navExact("x", "property"); navExact("D", "function"); navExact("E", "const"); navExact("F", "function") navExact("inner", "function"); navExact("fun", "function"); navExact("cls", "class"); navExact("prop", "property"); ## Instruction: Test expressions with no name ## Code After: /// <reference path="fourslash.ts"/> ////class A {} ////const B = class C { //// public x; ////}; ////function D() {} ////const E = function F() {} ////console.log(function() {}, class {}); // Expression with no name should have no effect. ////console.log(function inner() {}); ////String(function fun() { class cls { public prop; } })); function navExact(name: string, kind: string) { verify.navigationItemsListContains(name, kind, name, "exact"); } navExact("A", "class"); navExact("B", "const"); navExact("C", "class"); navExact("x", "property"); navExact("D", "function"); navExact("E", "const"); navExact("F", "function") navExact("inner", "function"); navExact("fun", "function"); navExact("cls", "class"); navExact("prop", "property");
3669f58975b30e41fab9839c1209d93cabdfc393
src/Console/FacebookCommand.php
src/Console/FacebookCommand.php
<?php namespace Stratedge\PassportFacebook\Console; use Illuminate\Console\Command; class FacebookCommand extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'passport:facebook {client_id : ID of the client}'; /** * The console command description. * * @var string */ protected $description = 'Grant a client access to the Facebook grant'; /** * Execute the console command. * * @param \Laravel\Passport\ClientRepository $clients * @return void */ public function handle(ClientRepository $clients) { $client = Client::find($this->argument("client_id")); if (!$client) { throw new Exception("Could not find client with ID " . $this->argument("client_id")); } $client->facebook_client = true; $client->save(); $this->info("Client " . $this->argument("client_id") . " has been granted access to the Facebook grant."); } }
<?php namespace Stratedge\PassportFacebook\Console; use Illuminate\Console\Command; use Laravel\Passport\Client; class FacebookCommand extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'passport:facebook {client_id : ID of the client}'; /** * The console command description. * * @var string */ protected $description = 'Grant a client access to the Facebook grant'; /** * Execute the console command. * * @param \Laravel\Passport\ClientRepository $clients * @return void */ public function handle() { $client = Client::find($this->argument("client_id")); if (!$client) { throw new Exception("Could not find client with ID " . $this->argument("client_id")); } $client->facebook_client = true; $client->save(); $this->info("Client " . $this->argument("client_id") . " has been granted access to the Facebook grant."); } }
Fix dependency injection in Facebook command
Fix dependency injection in Facebook command
PHP
mit
stratedge/passport-facebook
php
## Code Before: <?php namespace Stratedge\PassportFacebook\Console; use Illuminate\Console\Command; class FacebookCommand extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'passport:facebook {client_id : ID of the client}'; /** * The console command description. * * @var string */ protected $description = 'Grant a client access to the Facebook grant'; /** * Execute the console command. * * @param \Laravel\Passport\ClientRepository $clients * @return void */ public function handle(ClientRepository $clients) { $client = Client::find($this->argument("client_id")); if (!$client) { throw new Exception("Could not find client with ID " . $this->argument("client_id")); } $client->facebook_client = true; $client->save(); $this->info("Client " . $this->argument("client_id") . " has been granted access to the Facebook grant."); } } ## Instruction: Fix dependency injection in Facebook command ## Code After: <?php namespace Stratedge\PassportFacebook\Console; use Illuminate\Console\Command; use Laravel\Passport\Client; class FacebookCommand extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'passport:facebook {client_id : ID of the client}'; /** * The console command description. * * @var string */ protected $description = 'Grant a client access to the Facebook grant'; /** * Execute the console command. * * @param \Laravel\Passport\ClientRepository $clients * @return void */ public function handle() { $client = Client::find($this->argument("client_id")); if (!$client) { throw new Exception("Could not find client with ID " . $this->argument("client_id")); } $client->facebook_client = true; $client->save(); $this->info("Client " . $this->argument("client_id") . " has been granted access to the Facebook grant."); } }
6aace8d82612e82a99c03aeaf1e8436800e35b28
tests/server/signs-test.js
tests/server/signs-test.js
const app = require('../../tools/app.js') const request = require('supertest') const assert = require('assert') describe('Sign functionality', () => { let sessionID before(() => { return request(app) .post('/resources/cgi-bin/scrollery-cgi.pl') .send({ USER_NAME: 'test', PASSWORD: 'asdf', SCROLLVERSION: 1, transaction: 'validateSession', }) .then(res => { sessionID = res.body.SESSION_ID }) }) const send = payload => request(app) .post('/resources/cgi-bin/scrollery-cgi.pl') .send({ ...payload, SESSION_ID: sessionID, }) it('should attempt to get the text of a fragment', () => { return send({ transaction: 'getTextOfFragment', scroll_version_id: 808, col_id: 9111, }) .expect(200) .then(res => { console.log('Response:') console.log(res.body) }) }) })
const app = require('../../tools/app.js') const request = require('supertest') const assert = require('assert') // describe('Sign functionality', () => { // let sessionID // before(() => { // return request(app) // .post('/resources/cgi-bin/scrollery-cgi.pl') // .send({ // USER_NAME: 'test', // PASSWORD: 'asdf', // SCROLLVERSION: 1, // transaction: 'validateSession', // }) // .then(res => { // sessionID = res.body.SESSION_ID // }) // }) // const send = payload => // request(app) // .post('/resources/cgi-bin/scrollery-cgi.pl') // .send({ // ...payload, // SESSION_ID: sessionID, // }) // it('should attempt to get the text of a fragment', () => { // return send({ // transaction: 'getTextOfFragment', // scroll_version_id: 808, // col_id: 9111, // }) // .expect(200) // .then(res => { // console.log('Response:') // console.log(res.body) // }) // }) // })
Comment out test that does nothing and fails.
Comment out test that does nothing and fails.
JavaScript
mit
Scripta-Qumranica-Electronica/Scrollery-website,Scripta-Qumranica-Electronica/Scrollery-website,Scripta-Qumranica-Electronica/Scrollery-website,Scripta-Qumranica-Electronica/Scrollery-website
javascript
## Code Before: const app = require('../../tools/app.js') const request = require('supertest') const assert = require('assert') describe('Sign functionality', () => { let sessionID before(() => { return request(app) .post('/resources/cgi-bin/scrollery-cgi.pl') .send({ USER_NAME: 'test', PASSWORD: 'asdf', SCROLLVERSION: 1, transaction: 'validateSession', }) .then(res => { sessionID = res.body.SESSION_ID }) }) const send = payload => request(app) .post('/resources/cgi-bin/scrollery-cgi.pl') .send({ ...payload, SESSION_ID: sessionID, }) it('should attempt to get the text of a fragment', () => { return send({ transaction: 'getTextOfFragment', scroll_version_id: 808, col_id: 9111, }) .expect(200) .then(res => { console.log('Response:') console.log(res.body) }) }) }) ## Instruction: Comment out test that does nothing and fails. ## Code After: const app = require('../../tools/app.js') const request = require('supertest') const assert = require('assert') // describe('Sign functionality', () => { // let sessionID // before(() => { // return request(app) // .post('/resources/cgi-bin/scrollery-cgi.pl') // .send({ // USER_NAME: 'test', // PASSWORD: 'asdf', // SCROLLVERSION: 1, // transaction: 'validateSession', // }) // .then(res => { // sessionID = res.body.SESSION_ID // }) // }) // const send = payload => // request(app) // .post('/resources/cgi-bin/scrollery-cgi.pl') // .send({ // ...payload, // SESSION_ID: sessionID, // }) // it('should attempt to get the text of a fragment', () => { // return send({ // transaction: 'getTextOfFragment', // scroll_version_id: 808, // col_id: 9111, // }) // .expect(200) // .then(res => { // console.log('Response:') // console.log(res.body) // }) // }) // })
817f340f4313553cc0c8a386cc4984d244a0bc2c
app/models/user.rb
app/models/user.rb
class User < ActiveRecord::Base has_secure_password has_many :photo_queues has_many :photos, through: :photo_queues validates :username, :email, presence: true validates :username, :email, uniqueness: true validates :username, format: { with: /\A[a-zA-Z0-9]+\z/, message: "only allows letters and numbers" } validates :username, length: { in: 2..25 } validates :password, length: { in: 8..48 }, allow_nil: true serialize :unsplash_token def add_photos_to_queue(photos_to_add) photos.create(photos_to_add) if invalid? invalid_ids = photos.map {|x| x.unsplash_id if x.invalid?}.compact in_db = Photo.where(unsplash_id: invalid_ids) in_queue = photo_queues.where(photo_id: in_db).pluck(:photo_id) photos << in_db.select {|x| !in_queue.include?(x.id)} end # existing_photos = Photo.where(unsplash_id: unsplash_ids) # existing_queues = PhotoQueue. # includes(:photos). # where(photo_id: existing_photos) # photos_to_add.each do |photo| # photos.find_or_create_by(unsplash_id: photo[:unsplash_id]) do |x| # x.width = photo[:width] # x.height = photo[:height] # x.photographer_name = photo[:photographer_name] # x.photographer_link = photo[:photographer_link] # x.raw_url = photo[:raw_url] # x.full_url = photo[:full_url] # x.regular_url = photo[:regular_url] # x.small_url = photo[:small_url] # x.thumb_url = photo[:thumb_url] # x.link = photo[:link] # end # end end end
class User < ActiveRecord::Base has_secure_password has_many :photo_queues has_many :photos, through: :photo_queues validates :username, :email, presence: true validates :username, :email, uniqueness: true validates :username, format: { with: /\A[a-zA-Z0-9]+\z/, message: "only allows letters and numbers" } validates :username, length: { in: 2..25 } validates :password, length: { in: 8..48 }, allow_nil: true serialize :unsplash_token def add_photos_to_queue(photos_to_add) photos.create(photos_to_add) if invalid? invalid_ids = photos.map {|x| x.unsplash_id if x.invalid?}.compact in_db = Photo.where(unsplash_id: invalid_ids) in_queue = photo_queues.where(photo_id: in_db).pluck(:photo_id) photos << in_db.select {|x| !in_queue.include?(x.id)} end end end
Remove unused code in User model
Remove unused code in User model
Ruby
mit
snsavage/photovistas,snsavage/photovistas
ruby
## Code Before: class User < ActiveRecord::Base has_secure_password has_many :photo_queues has_many :photos, through: :photo_queues validates :username, :email, presence: true validates :username, :email, uniqueness: true validates :username, format: { with: /\A[a-zA-Z0-9]+\z/, message: "only allows letters and numbers" } validates :username, length: { in: 2..25 } validates :password, length: { in: 8..48 }, allow_nil: true serialize :unsplash_token def add_photos_to_queue(photos_to_add) photos.create(photos_to_add) if invalid? invalid_ids = photos.map {|x| x.unsplash_id if x.invalid?}.compact in_db = Photo.where(unsplash_id: invalid_ids) in_queue = photo_queues.where(photo_id: in_db).pluck(:photo_id) photos << in_db.select {|x| !in_queue.include?(x.id)} end # existing_photos = Photo.where(unsplash_id: unsplash_ids) # existing_queues = PhotoQueue. # includes(:photos). # where(photo_id: existing_photos) # photos_to_add.each do |photo| # photos.find_or_create_by(unsplash_id: photo[:unsplash_id]) do |x| # x.width = photo[:width] # x.height = photo[:height] # x.photographer_name = photo[:photographer_name] # x.photographer_link = photo[:photographer_link] # x.raw_url = photo[:raw_url] # x.full_url = photo[:full_url] # x.regular_url = photo[:regular_url] # x.small_url = photo[:small_url] # x.thumb_url = photo[:thumb_url] # x.link = photo[:link] # end # end end end ## Instruction: Remove unused code in User model ## Code After: class User < ActiveRecord::Base has_secure_password has_many :photo_queues has_many :photos, through: :photo_queues validates :username, :email, presence: true validates :username, :email, uniqueness: true validates :username, format: { with: /\A[a-zA-Z0-9]+\z/, message: "only allows letters and numbers" } validates :username, length: { in: 2..25 } validates :password, length: { in: 8..48 }, allow_nil: true serialize :unsplash_token def add_photos_to_queue(photos_to_add) photos.create(photos_to_add) if invalid? invalid_ids = photos.map {|x| x.unsplash_id if x.invalid?}.compact in_db = Photo.where(unsplash_id: invalid_ids) in_queue = photo_queues.where(photo_id: in_db).pluck(:photo_id) photos << in_db.select {|x| !in_queue.include?(x.id)} end end end
035be40c5869ea9e65dd89c0ea16aafac2636a3e
frontend/src/lib/StatusCalculator.ts
frontend/src/lib/StatusCalculator.ts
import Status from 'models/Status'; import Step from 'models/Step'; import Feature from 'models/Feature'; type ScenarioDetails = { backgroundSteps: Step[]; steps: Step[]; }; const STATUS_PRIORITY_ORDER = [Status.Failed, Status.Undefined, Status.Skipped, Status.Passed]; export const calculateFeatureStatus = (feature: Feature): Status => { const scenarioStatuses = feature.scenarios.map(scenario => scenario.calculatedStatus || scenario.originalAutomatedStatus); const featureStatus = STATUS_PRIORITY_ORDER.find(status => scenarioStatuses.includes(status)); if (featureStatus) { return featureStatus; } return Status.Passed; }; const calculateStatus = (scenario: ScenarioDetails, getStepStatus: (step: Step) => Status): Status => { const statuses: Status[] = []; statuses.push(...scenario.backgroundSteps.map(getStepStatus)); statuses.push(...scenario.steps.map(getStepStatus)); statuses.sort((status1, status2) => STATUS_PRIORITY_ORDER.indexOf(status1) - STATUS_PRIORITY_ORDER.indexOf(status2)); if (statuses.length > 0) { return statuses[0]; } return Status.Passed; }; export const calculateManualStatus = (scenario: ScenarioDetails): Status => calculateStatus(scenario, step => step.manualStatus || step.status); export const calculateAutoStatus = (scenario: ScenarioDetails): Status => calculateStatus(scenario, step => step.status);
import Status from 'models/Status'; import Step from 'models/Step'; import Feature from 'models/Feature'; type ScenarioDetails = { backgroundSteps: Step[]; steps: Step[]; }; const STATUS_PRIORITY_ORDER = [Status.Failed, Status.Undefined, Status.Skipped, Status.Passed]; export const calculateFeatureStatus = (feature: Feature): Status => { const scenarioStatuses = feature.scenarios.map(scenario => scenario.calculatedStatus || scenario.originalAutomatedStatus); const featureStatus = STATUS_PRIORITY_ORDER.find(status => scenarioStatuses.includes(status)); if (featureStatus) { return featureStatus; } return Status.Passed; }; const calculateStatus = (scenario: ScenarioDetails, getStepStatus: (step: Step) => Status): Status => { const statuses: Status[] = []; if (scenario.backgroundSteps) { statuses.push(...scenario.backgroundSteps.map(getStepStatus)); } statuses.push(...scenario.steps.map(getStepStatus)); statuses.sort((status1, status2) => STATUS_PRIORITY_ORDER.indexOf(status1) - STATUS_PRIORITY_ORDER.indexOf(status2)); if (statuses.length > 0) { return statuses[0]; } return Status.Passed; }; export const calculateManualStatus = (scenario: ScenarioDetails): Status => calculateStatus(scenario, step => step.manualStatus || step.status); export const calculateAutoStatus = (scenario: ScenarioDetails): Status => calculateStatus(scenario, step => step.status);
Check for null backgroundSteps just in case.
Check for null backgroundSteps just in case.
TypeScript
apache-2.0
orionhealth/XBDD,orionhealth/XBDD,orionhealth/XBDD,orionhealth/XBDD,orionhealth/XBDD
typescript
## Code Before: import Status from 'models/Status'; import Step from 'models/Step'; import Feature from 'models/Feature'; type ScenarioDetails = { backgroundSteps: Step[]; steps: Step[]; }; const STATUS_PRIORITY_ORDER = [Status.Failed, Status.Undefined, Status.Skipped, Status.Passed]; export const calculateFeatureStatus = (feature: Feature): Status => { const scenarioStatuses = feature.scenarios.map(scenario => scenario.calculatedStatus || scenario.originalAutomatedStatus); const featureStatus = STATUS_PRIORITY_ORDER.find(status => scenarioStatuses.includes(status)); if (featureStatus) { return featureStatus; } return Status.Passed; }; const calculateStatus = (scenario: ScenarioDetails, getStepStatus: (step: Step) => Status): Status => { const statuses: Status[] = []; statuses.push(...scenario.backgroundSteps.map(getStepStatus)); statuses.push(...scenario.steps.map(getStepStatus)); statuses.sort((status1, status2) => STATUS_PRIORITY_ORDER.indexOf(status1) - STATUS_PRIORITY_ORDER.indexOf(status2)); if (statuses.length > 0) { return statuses[0]; } return Status.Passed; }; export const calculateManualStatus = (scenario: ScenarioDetails): Status => calculateStatus(scenario, step => step.manualStatus || step.status); export const calculateAutoStatus = (scenario: ScenarioDetails): Status => calculateStatus(scenario, step => step.status); ## Instruction: Check for null backgroundSteps just in case. ## Code After: import Status from 'models/Status'; import Step from 'models/Step'; import Feature from 'models/Feature'; type ScenarioDetails = { backgroundSteps: Step[]; steps: Step[]; }; const STATUS_PRIORITY_ORDER = [Status.Failed, Status.Undefined, Status.Skipped, Status.Passed]; export const calculateFeatureStatus = (feature: Feature): Status => { const scenarioStatuses = feature.scenarios.map(scenario => scenario.calculatedStatus || scenario.originalAutomatedStatus); const featureStatus = STATUS_PRIORITY_ORDER.find(status => scenarioStatuses.includes(status)); if (featureStatus) { return featureStatus; } return Status.Passed; }; const calculateStatus = (scenario: ScenarioDetails, getStepStatus: (step: Step) => Status): Status => { const statuses: Status[] = []; if (scenario.backgroundSteps) { statuses.push(...scenario.backgroundSteps.map(getStepStatus)); } statuses.push(...scenario.steps.map(getStepStatus)); statuses.sort((status1, status2) => STATUS_PRIORITY_ORDER.indexOf(status1) - STATUS_PRIORITY_ORDER.indexOf(status2)); if (statuses.length > 0) { return statuses[0]; } return Status.Passed; }; export const calculateManualStatus = (scenario: ScenarioDetails): Status => calculateStatus(scenario, step => step.manualStatus || step.status); export const calculateAutoStatus = (scenario: ScenarioDetails): Status => calculateStatus(scenario, step => step.status);
b6e61319ed50ce05623cd77bdde82bcf9c58b0bd
src/css/components/task-file-list.less
src/css/components/task-file-list.less
/* ============== * Task File List (table) * ============== */ .task-file-list { tr { .btn { float: right; opacity: 0; margin-top: -@horizontal-spacing-unit; margin-bottom: -@horizontal-spacing-unit; } &:hover { .btn { opacity: 1; } } } }
/* ============== * Task File List (table) * ============== */ .task-file-list { margin-top: @base-spacing-unit * 3; tr { .btn { float: right; opacity: 0; margin-top: -@horizontal-spacing-unit; margin-bottom: -@horizontal-spacing-unit; } &:hover { .btn { opacity: 1; } } } }
Adjust task file list styles
Adjust task file list styles
Less
apache-2.0
cribalik/marathon-ui,cribalik/marathon-ui,mesosphere/marathon-ui,mesosphere/marathon-ui
less
## Code Before: /* ============== * Task File List (table) * ============== */ .task-file-list { tr { .btn { float: right; opacity: 0; margin-top: -@horizontal-spacing-unit; margin-bottom: -@horizontal-spacing-unit; } &:hover { .btn { opacity: 1; } } } } ## Instruction: Adjust task file list styles ## Code After: /* ============== * Task File List (table) * ============== */ .task-file-list { margin-top: @base-spacing-unit * 3; tr { .btn { float: right; opacity: 0; margin-top: -@horizontal-spacing-unit; margin-bottom: -@horizontal-spacing-unit; } &:hover { .btn { opacity: 1; } } } }
36a4730d95742d6500198d8289aa083b3b2af3cb
master/assets/javascript/admin.min.js
master/assets/javascript/admin.min.js
$(document).ready(function(){ $.urlParam = function(name){ var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(decodeURIComponent(window.location.href)); if (results==null){ return null; } else{ return results[1] || 0; } } /* * Defaults to Active Page * Can be Manually Called if Page is a Subset of the current page (e.g. view.php) */ function setActiveOption(e){ var page; if(typeof(e) === "undefined"){ pageInfo = $(location).attr("href").split('/'); page = pageInfo.slice(-1)[0]; folder = (pageInfo.pop() == '') ? pageInfo[pageInfo.length - 1] : pageInfo.pop(); page = folder + "-" + page.replace(".php", ""); }else page = e; $("#sidenav_" + page).addClass("active"); } setActiveOption(); });
$(document).ready(function(){ $.urlParam = function(name){ var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(decodeURIComponent(window.location.href)); if (results==null){ return null; } else{ return results[1] || 0; } } function getPageName(url) { var index = url.lastIndexOf("/") + 1; var filenameWithExtension = url.substr(index); var filename = filenameWithExtension.split(".")[0]; return filename; } /* * Defaults to Active Page * Can be Manually Called if Page is a Subset of the current page (e.g. view.php) */ function setActiveOption(e){ var page; var currentURL = $(location).attr("href"); if(typeof(e) === "undefined"){ page = getPageName(currentURL); pageInfo = currentURL.split('/'); folder = (pageInfo.pop() == '') ? pageInfo[pageInfo.length - 1] : pageInfo.pop(); page = folder + "-" + page; }else page = e; $("#sidenav_" + page).addClass("active"); } setActiveOption(); });
Fix jQuery for selecting active tab
Fix jQuery for selecting active tab
JavaScript
apache-2.0
PufferPanel/PufferPanel,PufferPanel/PufferPanel,PufferPanel/PufferPanel,PufferPanel/PufferPanel
javascript
## Code Before: $(document).ready(function(){ $.urlParam = function(name){ var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(decodeURIComponent(window.location.href)); if (results==null){ return null; } else{ return results[1] || 0; } } /* * Defaults to Active Page * Can be Manually Called if Page is a Subset of the current page (e.g. view.php) */ function setActiveOption(e){ var page; if(typeof(e) === "undefined"){ pageInfo = $(location).attr("href").split('/'); page = pageInfo.slice(-1)[0]; folder = (pageInfo.pop() == '') ? pageInfo[pageInfo.length - 1] : pageInfo.pop(); page = folder + "-" + page.replace(".php", ""); }else page = e; $("#sidenav_" + page).addClass("active"); } setActiveOption(); }); ## Instruction: Fix jQuery for selecting active tab ## Code After: $(document).ready(function(){ $.urlParam = function(name){ var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(decodeURIComponent(window.location.href)); if (results==null){ return null; } else{ return results[1] || 0; } } function getPageName(url) { var index = url.lastIndexOf("/") + 1; var filenameWithExtension = url.substr(index); var filename = filenameWithExtension.split(".")[0]; return filename; } /* * Defaults to Active Page * Can be Manually Called if Page is a Subset of the current page (e.g. view.php) */ function setActiveOption(e){ var page; var currentURL = $(location).attr("href"); if(typeof(e) === "undefined"){ page = getPageName(currentURL); pageInfo = currentURL.split('/'); folder = (pageInfo.pop() == '') ? pageInfo[pageInfo.length - 1] : pageInfo.pop(); page = folder + "-" + page; }else page = e; $("#sidenav_" + page).addClass("active"); } setActiveOption(); });
d2e75449e20050f12b1fd028ea8250c7dadbdebe
lib/door.js
lib/door.js
'use strict' let Gpio = require('onoff').Gpio let EventEmitter = require('events').EventEmitter class Door extends EventEmitter { constructor(options) { super() EventEmitter.call(this) this.options = options this.isOpen = false let pins = options.pins let sensor = new Gpio(pins.sensor, 'in', 'both') let statusOpen = new Gpio(pins.statusOpen, 'out') let statusClosed = new Gpio(pins.statusClosed, 'out') let update = (err, value) => { statusOpen.writeSync(value^1) statusClosed.writeSync(value) this.isOpen = value this.emit(this.status()) } sensor.read(update) sensor.watch(update) } status() { return this.isOpen ? 'open' : 'closed' } toggle() { console.log('Door toggled') var doorSwitch = new Gpio(this.options.pins.doorSwitch, 'out') doorSwitch.writeSync(1) setTimeout(function() { doorSwitch.writeSync(0) }, 100) } open() { if (!this.isOpen) this.toggle() } close() { if (this.isOpen) this.toggle() } } module.exports = Door
'use strict' let Gpio = require('onoff').Gpio let EventEmitter = require('events').EventEmitter class Door extends EventEmitter { constructor(options) { super() EventEmitter.call(this) this.options = options this.isOpen = false let pins = options.pins let sensor = new Gpio(pins.sensor, 'in', 'both') let statusOpen = new Gpio(pins.statusOpen, 'out') let statusClosed = new Gpio(pins.statusClosed, 'out') let update = (err, value) => { if (this.isOpen !== value) { statusOpen.writeSync(value^1) statusClosed.writeSync(value) this.isOpen = value this.emit(this.status()) } } sensor.read(update) sensor.watch(update) } status() { return this.isOpen ? 'open' : 'closed' } toggle() { console.log('Door toggled') var doorSwitch = new Gpio(this.options.pins.doorSwitch, 'out') doorSwitch.writeSync(1) setTimeout(function() { doorSwitch.writeSync(0) }, 100) } open() { if (!this.isOpen) this.toggle() } close() { if (this.isOpen) this.toggle() } } module.exports = Door
Make sure state is different
Make sure state is different
JavaScript
mit
rosie-home-automation/garage_door_core
javascript
## Code Before: 'use strict' let Gpio = require('onoff').Gpio let EventEmitter = require('events').EventEmitter class Door extends EventEmitter { constructor(options) { super() EventEmitter.call(this) this.options = options this.isOpen = false let pins = options.pins let sensor = new Gpio(pins.sensor, 'in', 'both') let statusOpen = new Gpio(pins.statusOpen, 'out') let statusClosed = new Gpio(pins.statusClosed, 'out') let update = (err, value) => { statusOpen.writeSync(value^1) statusClosed.writeSync(value) this.isOpen = value this.emit(this.status()) } sensor.read(update) sensor.watch(update) } status() { return this.isOpen ? 'open' : 'closed' } toggle() { console.log('Door toggled') var doorSwitch = new Gpio(this.options.pins.doorSwitch, 'out') doorSwitch.writeSync(1) setTimeout(function() { doorSwitch.writeSync(0) }, 100) } open() { if (!this.isOpen) this.toggle() } close() { if (this.isOpen) this.toggle() } } module.exports = Door ## Instruction: Make sure state is different ## Code After: 'use strict' let Gpio = require('onoff').Gpio let EventEmitter = require('events').EventEmitter class Door extends EventEmitter { constructor(options) { super() EventEmitter.call(this) this.options = options this.isOpen = false let pins = options.pins let sensor = new Gpio(pins.sensor, 'in', 'both') let statusOpen = new Gpio(pins.statusOpen, 'out') let statusClosed = new Gpio(pins.statusClosed, 'out') let update = (err, value) => { if (this.isOpen !== value) { statusOpen.writeSync(value^1) statusClosed.writeSync(value) this.isOpen = value this.emit(this.status()) } } sensor.read(update) sensor.watch(update) } status() { return this.isOpen ? 'open' : 'closed' } toggle() { console.log('Door toggled') var doorSwitch = new Gpio(this.options.pins.doorSwitch, 'out') doorSwitch.writeSync(1) setTimeout(function() { doorSwitch.writeSync(0) }, 100) } open() { if (!this.isOpen) this.toggle() } close() { if (this.isOpen) this.toggle() } } module.exports = Door
ee87592bc8f7b340d0d81692a01b4b19dcb7e0cd
script.sh
script.sh
wget https://releases.hashicorp.com/terraform/0.6.15/terraform_0.6.15_linux_amd64.zip -O /tmp/terraform.zip mkdir /tmp/terraform unzip /tmp/terraform.zip -d /tmp/terraform chmod 755 -R /tmp/terraform mv /tmp/terraform/* /usr/local/bin/ apt-get update apt-get install -y unzip python-pip python-dev python-virtualenv pip install ansible
wget https://releases.hashicorp.com/terraform/0.6.16/terraform_0.6.16_linux_amd64.zip -O /tmp/terraform.zip mkdir /tmp/terraform unzip /tmp/terraform.zip -d /tmp/terraform chmod 755 -R /tmp/terraform mv /tmp/terraform/* /usr/local/bin/ apt-get update apt-get install -y unzip python-pip python-dev python-virtualenv libffi-dev libssl-dev pip install --upgrade cffi pip install ansible
Add package for Ansible and MoFo schedule - Install libffi to fix Ansible/MoFo schedule deps - Upgrade cffi to fix dep chain - Upgrade Terraform to 0.6.16
Add package for Ansible and MoFo schedule - Install libffi to fix Ansible/MoFo schedule deps - Upgrade cffi to fix dep chain - Upgrade Terraform to 0.6.16
Shell
mpl-2.0
flamingspaz/partinfra-jenkins
shell
## Code Before: wget https://releases.hashicorp.com/terraform/0.6.15/terraform_0.6.15_linux_amd64.zip -O /tmp/terraform.zip mkdir /tmp/terraform unzip /tmp/terraform.zip -d /tmp/terraform chmod 755 -R /tmp/terraform mv /tmp/terraform/* /usr/local/bin/ apt-get update apt-get install -y unzip python-pip python-dev python-virtualenv pip install ansible ## Instruction: Add package for Ansible and MoFo schedule - Install libffi to fix Ansible/MoFo schedule deps - Upgrade cffi to fix dep chain - Upgrade Terraform to 0.6.16 ## Code After: wget https://releases.hashicorp.com/terraform/0.6.16/terraform_0.6.16_linux_amd64.zip -O /tmp/terraform.zip mkdir /tmp/terraform unzip /tmp/terraform.zip -d /tmp/terraform chmod 755 -R /tmp/terraform mv /tmp/terraform/* /usr/local/bin/ apt-get update apt-get install -y unzip python-pip python-dev python-virtualenv libffi-dev libssl-dev pip install --upgrade cffi pip install ansible
1218da61bce4270182f37dea508809d2d67c72d4
spec/orm/active_record.rb
spec/orm/active_record.rb
ActiveRecord::Migration.verbose = false ActiveRecord::Migrator.migrate(File.expand_path('../../rails_app/db/migrate/', __FILE__))
ActiveRecord::Migration.verbose = false migration_path = File.expand_path('../../rails_app/db/migrate/', __FILE__) if ActiveRecord.version.release < Gem::Version.new('5.2.0') ActiveRecord::Migrator.migrate(migration_path) else ActiveRecord::MigrationContext.new(migration_path).migrate end
Fix specs on Rails 5.2
Fix specs on Rails 5.2
Ruby
mit
allenwq/devise-multi_email,allenwq/devise-multi_email,allenwq/devise-multi_email
ruby
## Code Before: ActiveRecord::Migration.verbose = false ActiveRecord::Migrator.migrate(File.expand_path('../../rails_app/db/migrate/', __FILE__)) ## Instruction: Fix specs on Rails 5.2 ## Code After: ActiveRecord::Migration.verbose = false migration_path = File.expand_path('../../rails_app/db/migrate/', __FILE__) if ActiveRecord.version.release < Gem::Version.new('5.2.0') ActiveRecord::Migrator.migrate(migration_path) else ActiveRecord::MigrationContext.new(migration_path).migrate end
fe4beb01974c8a57baaa957e7d1f4b5bd9ed3b63
common/engine/keyboardprocessor/src/keyboard.cpp
common/engine/keyboardprocessor/src/keyboard.cpp
/* Copyright: © 2018 SIL International. Description: Internal keyboard class and adaptor class for the API. Create Date: 2 Oct 2018 Authors: Tim Eves (TSE) History: 7 Oct 2018 - TSE - Refactored out of km_kbp_keyboard_api.cpp */ #include "keyboard.hpp" #include "json.hpp" using namespace km::kbp; keyboard::keyboard(std::filesystem::path const & path) : _keyboard_id(path.stem().string()), _version_string("3.145"), _folder_path(path.parent_path()), _default_opts {KM_KBP_OPTIONS_END} { version_string = _version_string.c_str(); id = _keyboard_id.c_str(); folder_path = _folder_path.native().c_str(); default_options = _default_opts.data(); } json & km::kbp::operator << (json & j, km::kbp::keyboard const & kb) { j << json::object << "id" << kb.id << "folder" << kb.folder_path << "version" << kb.version_string << "rules" << json::array << json::close; return j << json::close; }
/* Copyright: © 2018 SIL International. Description: Internal keyboard class and adaptor class for the API. Create Date: 2 Oct 2018 Authors: Tim Eves (TSE) History: 7 Oct 2018 - TSE - Refactored out of km_kbp_keyboard_api.cpp */ #include "keyboard.hpp" #include "json.hpp" using namespace km::kbp; keyboard::keyboard(std::filesystem::path const & path) : _keyboard_id(path.stem().string()), _version_string("3.145"), _folder_path(path.parent_path()), _default_opts {KM_KBP_OPTIONS_END} { version_string = _version_string.c_str(); id = _keyboard_id.c_str(); folder_path = _folder_path.native().c_str(); default_options = _default_opts.data(); } json & km::kbp::operator << (json & j, km::kbp::keyboard const & kb) { j << json::object << "id" << kb.id << "folder" << kb._folder_path.string() << "version" << kb.version_string << "rules" << json::array << json::close; return j << json::close; }
Make sure to convert path to utf8 for json output of folder name.
Make sure to convert path to utf8 for json output of folder name.
C++
apache-2.0
tavultesoft/keymanweb,tavultesoft/keymanweb
c++
## Code Before: /* Copyright: © 2018 SIL International. Description: Internal keyboard class and adaptor class for the API. Create Date: 2 Oct 2018 Authors: Tim Eves (TSE) History: 7 Oct 2018 - TSE - Refactored out of km_kbp_keyboard_api.cpp */ #include "keyboard.hpp" #include "json.hpp" using namespace km::kbp; keyboard::keyboard(std::filesystem::path const & path) : _keyboard_id(path.stem().string()), _version_string("3.145"), _folder_path(path.parent_path()), _default_opts {KM_KBP_OPTIONS_END} { version_string = _version_string.c_str(); id = _keyboard_id.c_str(); folder_path = _folder_path.native().c_str(); default_options = _default_opts.data(); } json & km::kbp::operator << (json & j, km::kbp::keyboard const & kb) { j << json::object << "id" << kb.id << "folder" << kb.folder_path << "version" << kb.version_string << "rules" << json::array << json::close; return j << json::close; } ## Instruction: Make sure to convert path to utf8 for json output of folder name. ## Code After: /* Copyright: © 2018 SIL International. Description: Internal keyboard class and adaptor class for the API. Create Date: 2 Oct 2018 Authors: Tim Eves (TSE) History: 7 Oct 2018 - TSE - Refactored out of km_kbp_keyboard_api.cpp */ #include "keyboard.hpp" #include "json.hpp" using namespace km::kbp; keyboard::keyboard(std::filesystem::path const & path) : _keyboard_id(path.stem().string()), _version_string("3.145"), _folder_path(path.parent_path()), _default_opts {KM_KBP_OPTIONS_END} { version_string = _version_string.c_str(); id = _keyboard_id.c_str(); folder_path = _folder_path.native().c_str(); default_options = _default_opts.data(); } json & km::kbp::operator << (json & j, km::kbp::keyboard const & kb) { j << json::object << "id" << kb.id << "folder" << kb._folder_path.string() << "version" << kb.version_string << "rules" << json::array << json::close; return j << json::close; }
a720bf5023cf9fdab60ef668aa3a3f9371a0bcb0
questions/styledbutton-20642553/main.cpp
questions/styledbutton-20642553/main.cpp
int main(int argc, char *argv[]) { QApplication a{argc, argv}; QWidget w; QHBoxLayout layout{&w}; QPushButton button1{"Default"}; button1.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum); layout.addWidget(&button1); QPushButton button2{"Styled"}; button2.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); button2.setStyleSheet( "* { border: 2px solid #8f8f91; border-radius: 12px; background-color: #d02020; }" "*:pressed { background-color: #f6f7fa; }"); layout.addWidget(&button2); auto pal = w.palette(); pal.setBrush(QPalette::Background, Qt::darkBlue); w.setPalette(pal); w.show(); return a.exec(); }
// https://github.com/KubaO/stackoverflown/tree/master/questions/styledbutton-20642553 #include <QPushButton> #include <QHBoxLayout> #include <QApplication> int main(int argc, char *argv[]) { QApplication a{argc, argv}; QWidget w; QHBoxLayout layout{&w}; QPushButton button1{"Default"}; button1.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum); layout.addWidget(&button1); QPushButton button2{"Styled"}; button2.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); button2.setStyleSheet( "* { border: 2px solid #8f8f91; border-radius: 12px; background-color: #d02020; }" "*:pressed { background-color: #f6f7fa; }"); layout.addWidget(&button2); auto pal = w.palette(); pal.setBrush(QPalette::Background, Qt::darkBlue); w.setPalette(pal); w.show(); return a.exec(); }
Add github link, make code narrower.
Add github link, make code narrower.
C++
unlicense
KubaO/stackoverflown,KubaO/stackoverflown,KubaO/stackoverflown
c++
## Code Before: int main(int argc, char *argv[]) { QApplication a{argc, argv}; QWidget w; QHBoxLayout layout{&w}; QPushButton button1{"Default"}; button1.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum); layout.addWidget(&button1); QPushButton button2{"Styled"}; button2.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); button2.setStyleSheet( "* { border: 2px solid #8f8f91; border-radius: 12px; background-color: #d02020; }" "*:pressed { background-color: #f6f7fa; }"); layout.addWidget(&button2); auto pal = w.palette(); pal.setBrush(QPalette::Background, Qt::darkBlue); w.setPalette(pal); w.show(); return a.exec(); } ## Instruction: Add github link, make code narrower. ## Code After: // https://github.com/KubaO/stackoverflown/tree/master/questions/styledbutton-20642553 #include <QPushButton> #include <QHBoxLayout> #include <QApplication> int main(int argc, char *argv[]) { QApplication a{argc, argv}; QWidget w; QHBoxLayout layout{&w}; QPushButton button1{"Default"}; button1.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum); layout.addWidget(&button1); QPushButton button2{"Styled"}; button2.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); button2.setStyleSheet( "* { border: 2px solid #8f8f91; border-radius: 12px; background-color: #d02020; }" "*:pressed { background-color: #f6f7fa; }"); layout.addWidget(&button2); auto pal = w.palette(); pal.setBrush(QPalette::Background, Qt::darkBlue); w.setPalette(pal); w.show(); return a.exec(); }
a61701fbece30628912034c48383a37ef2b93a3c
.travis.yml
.travis.yml
language: rust script: - cargo test --features="live_tests" - cargo test --features="tls" sudo: false after_success: | [ $TRAVIS_BRANCH = master ] && [ $TRAVIS_PULL_REQUEST = false ] && cargo doc && echo "<meta http-equiv=refresh content=0;url=`echo $TRAVIS_REPO_SLUG | cut -d '/' -f 2`/index.html>" > target/doc/index.html && pip install --user ghp-import && /home/travis/.local/bin/ghp-import -n target/doc && git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages env: global: secure: eSYRUJ2wTq1g6AiPp0zvtxVJFn/3FnrCRAJmGCN1TBYpnl11ZvLZfhUA9IC4S48/YVmdeP1pywpIjY3ZGk7gWuaRLpTrwBxgm01RbOglQS1if6Pryc01FcwCSGb1fJKY4qR0v6iQRb23jaFfSELHfThf4rmG4QiKiNviHJRzb0c=
language: rust matrix: include: - rust: nightly - rust: beta - rust: stable script: - cargo test --features="live_tests" - cargo test --features="tls" sudo: false after_success: | [ $TRAVIS_BRANCH = master ] && [ $TRAVIS_PULL_REQUEST = false ] && [ $TRAVIS_RUST_VERSION = stable ] && cargo doc && echo "<meta http-equiv=refresh content=0;url=`echo $TRAVIS_REPO_SLUG | cut -d '/' -f 2`/index.html>" > target/doc/index.html && pip install --user ghp-import && /home/travis/.local/bin/ghp-import -n target/doc && git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages env: global: secure: eSYRUJ2wTq1g6AiPp0zvtxVJFn/3FnrCRAJmGCN1TBYpnl11ZvLZfhUA9IC4S48/YVmdeP1pywpIjY3ZGk7gWuaRLpTrwBxgm01RbOglQS1if6Pryc01FcwCSGb1fJKY4qR0v6iQRb23jaFfSELHfThf4rmG4QiKiNviHJRzb0c=
Enable test matrix with all three rustc channels
ci/Travis: Enable test matrix with all three rustc channels
YAML
mit
tempbottle/solicit,gwicke/solicit,mlalic/solicit,stepancheg/solicit
yaml
## Code Before: language: rust script: - cargo test --features="live_tests" - cargo test --features="tls" sudo: false after_success: | [ $TRAVIS_BRANCH = master ] && [ $TRAVIS_PULL_REQUEST = false ] && cargo doc && echo "<meta http-equiv=refresh content=0;url=`echo $TRAVIS_REPO_SLUG | cut -d '/' -f 2`/index.html>" > target/doc/index.html && pip install --user ghp-import && /home/travis/.local/bin/ghp-import -n target/doc && git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages env: global: secure: eSYRUJ2wTq1g6AiPp0zvtxVJFn/3FnrCRAJmGCN1TBYpnl11ZvLZfhUA9IC4S48/YVmdeP1pywpIjY3ZGk7gWuaRLpTrwBxgm01RbOglQS1if6Pryc01FcwCSGb1fJKY4qR0v6iQRb23jaFfSELHfThf4rmG4QiKiNviHJRzb0c= ## Instruction: ci/Travis: Enable test matrix with all three rustc channels ## Code After: language: rust matrix: include: - rust: nightly - rust: beta - rust: stable script: - cargo test --features="live_tests" - cargo test --features="tls" sudo: false after_success: | [ $TRAVIS_BRANCH = master ] && [ $TRAVIS_PULL_REQUEST = false ] && [ $TRAVIS_RUST_VERSION = stable ] && cargo doc && echo "<meta http-equiv=refresh content=0;url=`echo $TRAVIS_REPO_SLUG | cut -d '/' -f 2`/index.html>" > target/doc/index.html && pip install --user ghp-import && /home/travis/.local/bin/ghp-import -n target/doc && git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages env: global: secure: eSYRUJ2wTq1g6AiPp0zvtxVJFn/3FnrCRAJmGCN1TBYpnl11ZvLZfhUA9IC4S48/YVmdeP1pywpIjY3ZGk7gWuaRLpTrwBxgm01RbOglQS1if6Pryc01FcwCSGb1fJKY4qR0v6iQRb23jaFfSELHfThf4rmG4QiKiNviHJRzb0c=
41b5a95a5c396c131d1426dd926e0a1a4beccc86
mrp_workorder_sequence/models/mrp_production.py
mrp_workorder_sequence/models/mrp_production.py
from odoo import models class MrpProduction(models.Model): _inherit = "mrp.production" def _reset_work_order_sequence(self): for rec in self: current_sequence = 1 for work in rec.workorder_ids: work.sequence = current_sequence current_sequence += 1 def _generate_workorders(self, exploded_boms): res = super()._generate_workorders(exploded_boms) self._reset_work_order_sequence() return res
from odoo import models class MrpProduction(models.Model): _inherit = "mrp.production" def _reset_work_order_sequence(self): for rec in self: current_sequence = 1 for work in rec.workorder_ids: work.sequence = current_sequence current_sequence += 1 def _create_workorder(self): res = super()._create_workorder() self._reset_work_order_sequence() return res
Call method changed on v14
[FIX] mrp_workorder_sequence: Call method changed on v14
Python
agpl-3.0
OCA/manufacture,OCA/manufacture
python
## Code Before: from odoo import models class MrpProduction(models.Model): _inherit = "mrp.production" def _reset_work_order_sequence(self): for rec in self: current_sequence = 1 for work in rec.workorder_ids: work.sequence = current_sequence current_sequence += 1 def _generate_workorders(self, exploded_boms): res = super()._generate_workorders(exploded_boms) self._reset_work_order_sequence() return res ## Instruction: [FIX] mrp_workorder_sequence: Call method changed on v14 ## Code After: from odoo import models class MrpProduction(models.Model): _inherit = "mrp.production" def _reset_work_order_sequence(self): for rec in self: current_sequence = 1 for work in rec.workorder_ids: work.sequence = current_sequence current_sequence += 1 def _create_workorder(self): res = super()._create_workorder() self._reset_work_order_sequence() return res
6e12974b1099044dff95fb632307cd6c5500c411
corehq/apps/builds/utils.py
corehq/apps/builds/utils.py
import re from .models import CommCareBuild, CommCareBuildConfig def get_all_versions(versions=None): """ Returns a list of all versions found in the database, plus those in the optional list parameter. """ versions = versions or [] db = CommCareBuild.get_db() results = db.view('builds/all', group_level=1).all() versions += [result['key'][0] for result in results] return sorted(list(set(versions))) def get_default_build_spec(): return CommCareBuildConfig.fetch().get_default() def extract_build_info_from_filename(content_disposition): """ >>> extract_build_info_from_filename( ... 'attachment; filename=CommCare_CommCare_2.13_32703_artifacts.zip' ... ) ('2.13', 32703) >>> try: ... extract_build_info_from_filename('foo') ... except ValueError as e: ... print e Could not find filename like 'CommCare_CommCare_([\\\\d\\\\.]+)_(\\\\d+)_artifacts.zip' in 'foo' """ pattern = r'CommCare_CommCare_([\d\.]+)_(\d+)_artifacts.zip' match = re.search(pattern, content_disposition) if match: version, number = match.groups() return version, int(number) else: raise ValueError('Could not find filename like {!r} in {!r}'.format( pattern, content_disposition))
import re from .models import CommCareBuild, CommCareBuildConfig def get_all_versions(versions): """ Returns a list of all versions found in the database, plus those in the optional list parameter. """ db = CommCareBuild.get_db() results = db.view('builds/all', group_level=1).all() versions += [result['key'][0] for result in results] return sorted(list(set(versions))) def get_default_build_spec(): return CommCareBuildConfig.fetch().get_default() def extract_build_info_from_filename(content_disposition): """ >>> extract_build_info_from_filename( ... 'attachment; filename=CommCare_CommCare_2.13_32703_artifacts.zip' ... ) ('2.13', 32703) >>> try: ... extract_build_info_from_filename('foo') ... except ValueError as e: ... print e Could not find filename like 'CommCare_CommCare_([\\\\d\\\\.]+)_(\\\\d+)_artifacts.zip' in 'foo' """ pattern = r'CommCare_CommCare_([\d\.]+)_(\d+)_artifacts.zip' match = re.search(pattern, content_disposition) if match: version, number = match.groups() return version, int(number) else: raise ValueError('Could not find filename like {!r} in {!r}'.format( pattern, content_disposition))
Remove optional arg that's now always used
Remove optional arg that's now always used
Python
bsd-3-clause
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
python
## Code Before: import re from .models import CommCareBuild, CommCareBuildConfig def get_all_versions(versions=None): """ Returns a list of all versions found in the database, plus those in the optional list parameter. """ versions = versions or [] db = CommCareBuild.get_db() results = db.view('builds/all', group_level=1).all() versions += [result['key'][0] for result in results] return sorted(list(set(versions))) def get_default_build_spec(): return CommCareBuildConfig.fetch().get_default() def extract_build_info_from_filename(content_disposition): """ >>> extract_build_info_from_filename( ... 'attachment; filename=CommCare_CommCare_2.13_32703_artifacts.zip' ... ) ('2.13', 32703) >>> try: ... extract_build_info_from_filename('foo') ... except ValueError as e: ... print e Could not find filename like 'CommCare_CommCare_([\\\\d\\\\.]+)_(\\\\d+)_artifacts.zip' in 'foo' """ pattern = r'CommCare_CommCare_([\d\.]+)_(\d+)_artifacts.zip' match = re.search(pattern, content_disposition) if match: version, number = match.groups() return version, int(number) else: raise ValueError('Could not find filename like {!r} in {!r}'.format( pattern, content_disposition)) ## Instruction: Remove optional arg that's now always used ## Code After: import re from .models import CommCareBuild, CommCareBuildConfig def get_all_versions(versions): """ Returns a list of all versions found in the database, plus those in the optional list parameter. """ db = CommCareBuild.get_db() results = db.view('builds/all', group_level=1).all() versions += [result['key'][0] for result in results] return sorted(list(set(versions))) def get_default_build_spec(): return CommCareBuildConfig.fetch().get_default() def extract_build_info_from_filename(content_disposition): """ >>> extract_build_info_from_filename( ... 'attachment; filename=CommCare_CommCare_2.13_32703_artifacts.zip' ... ) ('2.13', 32703) >>> try: ... extract_build_info_from_filename('foo') ... except ValueError as e: ... print e Could not find filename like 'CommCare_CommCare_([\\\\d\\\\.]+)_(\\\\d+)_artifacts.zip' in 'foo' """ pattern = r'CommCare_CommCare_([\d\.]+)_(\d+)_artifacts.zip' match = re.search(pattern, content_disposition) if match: version, number = match.groups() return version, int(number) else: raise ValueError('Could not find filename like {!r} in {!r}'.format( pattern, content_disposition))
06c4d38ee41ed5ce0b59e2670d8a952aeaffb97d
desktop/src/main/scala/org/talkingpuffin/Main.scala
desktop/src/main/scala/org/talkingpuffin/Main.scala
package org.talkingpuffin import javax.swing.{UIManager, JFrame} import mac.MacInit import twitter.{Credentials, CredentialsRepository, AuthenticatedSession} import ui.{TopFrame} /** * TalkingPuffin main object */ object Main { val title = "TalkingPuffin" def main(args: Array[String]): Unit = { MacInit init Main.title UIManager setLookAndFeel UIManager.getSystemLookAndFeelClassName JFrame setDefaultLookAndFeelDecorated true if ( 0 == CredentialsRepository.getAll.size ) launchNewSession() else launchAllSessions } def launchNewSession(credentials: Option[Credentials] = None) = new TopFrame(AuthenticatedSession.logIn(credentials)) private def launchAllSessions = CredentialsRepository.getAll.foreach(cred => launchNewSession(Some(cred))) }
package org.talkingpuffin import javax.swing.{UIManager, JFrame} import mac.MacInit import twitter.{Credentials, CredentialsRepository, AuthenticatedSession} import ui.{TopFrame} /** * TalkingPuffin main object */ object Main { val title = "TalkingPuffin" def main(args: Array[String]): Unit = { MacInit init Main.title UIManager setLookAndFeel UIManager.getSystemLookAndFeelClassName JFrame setDefaultLookAndFeelDecorated true launchAllSessions } def launchNewSession(credentials: Option[Credentials] = None) = new TopFrame(AuthenticatedSession.logIn(credentials)) private def launchAllSessions = { val credentials = CredentialsRepository.getAll if (credentials.isEmpty) launchNewSession(None) else credentials.foreach(cred => launchNewSession(Some(cred))) } }
Rework Leif’s essential fix slightly to avoid calling CredentialsRepository.getAll twice.
Rework Leif’s essential fix slightly to avoid calling CredentialsRepository.getAll twice.
Scala
mit
dcbriccetti/talking-puffin,dcbriccetti/talking-puffin
scala
## Code Before: package org.talkingpuffin import javax.swing.{UIManager, JFrame} import mac.MacInit import twitter.{Credentials, CredentialsRepository, AuthenticatedSession} import ui.{TopFrame} /** * TalkingPuffin main object */ object Main { val title = "TalkingPuffin" def main(args: Array[String]): Unit = { MacInit init Main.title UIManager setLookAndFeel UIManager.getSystemLookAndFeelClassName JFrame setDefaultLookAndFeelDecorated true if ( 0 == CredentialsRepository.getAll.size ) launchNewSession() else launchAllSessions } def launchNewSession(credentials: Option[Credentials] = None) = new TopFrame(AuthenticatedSession.logIn(credentials)) private def launchAllSessions = CredentialsRepository.getAll.foreach(cred => launchNewSession(Some(cred))) } ## Instruction: Rework Leif’s essential fix slightly to avoid calling CredentialsRepository.getAll twice. ## Code After: package org.talkingpuffin import javax.swing.{UIManager, JFrame} import mac.MacInit import twitter.{Credentials, CredentialsRepository, AuthenticatedSession} import ui.{TopFrame} /** * TalkingPuffin main object */ object Main { val title = "TalkingPuffin" def main(args: Array[String]): Unit = { MacInit init Main.title UIManager setLookAndFeel UIManager.getSystemLookAndFeelClassName JFrame setDefaultLookAndFeelDecorated true launchAllSessions } def launchNewSession(credentials: Option[Credentials] = None) = new TopFrame(AuthenticatedSession.logIn(credentials)) private def launchAllSessions = { val credentials = CredentialsRepository.getAll if (credentials.isEmpty) launchNewSession(None) else credentials.foreach(cred => launchNewSession(Some(cred))) } }
022bc01fb857c018cfba54825d8bac10181355fe
app/overrides/add_events_to_order_tabs.rb
app/overrides/add_events_to_order_tabs.rb
Deface::Override.new(:virtual_path => "spree/admin/shared/_order_tabs", :name => "add_events_to_order_tabs", :insert_bottom => "[data-hook='admin_order_tabs']", :text => %q{ <li<%== ' class="active"' if current == 'Events' %>> <%= link_to_with_icon 'icon-cogs', t(:order_events), spree.admin_order_events_url(@order) %> </li> }, :disabled => false)
Deface::Override.new(:virtual_path => "spree/admin/shared/_order_tabs", :name => "add_events_to_order_tabs", :insert_bottom => "[data-hook='admin_order_tabs']", :text => %q{ <li<%== ' class="active"' if current == 'Events' %>> <%= link_to_with_icon 'icon-exclamation-sign', t(:order_events), spree.admin_order_events_url(@order) %> </li> }, :disabled => false)
Use exclamation sign icon for order events tab
Use exclamation sign icon for order events tab
Ruby
bsd-3-clause
spree/spree_pro_connector,spree/spree_hub_connector,spree/spree_pro_connector,spree/spree_hub_connector
ruby
## Code Before: Deface::Override.new(:virtual_path => "spree/admin/shared/_order_tabs", :name => "add_events_to_order_tabs", :insert_bottom => "[data-hook='admin_order_tabs']", :text => %q{ <li<%== ' class="active"' if current == 'Events' %>> <%= link_to_with_icon 'icon-cogs', t(:order_events), spree.admin_order_events_url(@order) %> </li> }, :disabled => false) ## Instruction: Use exclamation sign icon for order events tab ## Code After: Deface::Override.new(:virtual_path => "spree/admin/shared/_order_tabs", :name => "add_events_to_order_tabs", :insert_bottom => "[data-hook='admin_order_tabs']", :text => %q{ <li<%== ' class="active"' if current == 'Events' %>> <%= link_to_with_icon 'icon-exclamation-sign', t(:order_events), spree.admin_order_events_url(@order) %> </li> }, :disabled => false)
bd2a007f4d46bdb690d3f160e21a0360e7cdeb3a
app.yaml
app.yaml
application: sympy-live-hrd version: 31 runtime: python27 threadsafe: true api_version: 1 handlers: - url: /static static_dir: static expiration: 1d # if you're adding the shell to your own app, change this regex url to the URL # endpoint where you want the shell to run, e.g. /shell . You'll also probably # want to add login: admin to restrict to admins only. - url: .* script: shell.application
application: sympy-live-hrd version: 31 runtime: python27 threadsafe: true api_version: 1 libraries: - name: numpy version: latest handlers: - url: /static static_dir: static expiration: 1d # if you're adding the shell to your own app, change this regex url to the URL # endpoint where you want the shell to run, e.g. /shell . You'll also probably # want to add login: admin to restrict to admins only. - url: .* script: shell.application
Enable the external library numpy
Enable the external library numpy This will let people import numpy in the SymPy Live shell.
YAML
bsd-3-clause
wyom/sympy-live,wyom/sympy-live
yaml
## Code Before: application: sympy-live-hrd version: 31 runtime: python27 threadsafe: true api_version: 1 handlers: - url: /static static_dir: static expiration: 1d # if you're adding the shell to your own app, change this regex url to the URL # endpoint where you want the shell to run, e.g. /shell . You'll also probably # want to add login: admin to restrict to admins only. - url: .* script: shell.application ## Instruction: Enable the external library numpy This will let people import numpy in the SymPy Live shell. ## Code After: application: sympy-live-hrd version: 31 runtime: python27 threadsafe: true api_version: 1 libraries: - name: numpy version: latest handlers: - url: /static static_dir: static expiration: 1d # if you're adding the shell to your own app, change this regex url to the URL # endpoint where you want the shell to run, e.g. /shell . You'll also probably # want to add login: admin to restrict to admins only. - url: .* script: shell.application
9b5b542bc807f7bd6370495946867efad29b541d
rust/hamming/src/lib.rs
rust/hamming/src/lib.rs
pub fn hamming_distance<'a, 'b>(a: &'a str, b: &'a str) -> Result<usize, &'b str> { if a.len() != b.len() { return Err("Length is not same"); } let max = a.len(); let mut ai = a.chars(); let mut bi = b.chars(); let mut count = 0; for _ in 0..max { if ai.next() != bi.next() { count += 1; } } Ok(count) }
pub fn hamming_distance(a: &str, b: &str) -> Result<usize, &'static str> { if a.len() != b.len() { return Result::Err("Length is not same"); } let count = a.chars() .zip(b.chars()) .filter(|&(an, bn)| an != bn) .count(); Result::Ok(count) }
Use a smart way stolen from others
Use a smart way stolen from others I like functional programming style now
Rust
bsd-2-clause
gyn/exercism,gyn/exercism,gyn/exercism,gyn/exercism
rust
## Code Before: pub fn hamming_distance<'a, 'b>(a: &'a str, b: &'a str) -> Result<usize, &'b str> { if a.len() != b.len() { return Err("Length is not same"); } let max = a.len(); let mut ai = a.chars(); let mut bi = b.chars(); let mut count = 0; for _ in 0..max { if ai.next() != bi.next() { count += 1; } } Ok(count) } ## Instruction: Use a smart way stolen from others I like functional programming style now ## Code After: pub fn hamming_distance(a: &str, b: &str) -> Result<usize, &'static str> { if a.len() != b.len() { return Result::Err("Length is not same"); } let count = a.chars() .zip(b.chars()) .filter(|&(an, bn)| an != bn) .count(); Result::Ok(count) }
51dac8664492a264d403ae6b5fd00cf9710f6871
get_reverse_geocode.js
get_reverse_geocode.js
const _ = require('lodash'); const GoogleMapsAPI = require('googlemaps'); const gmAPI = new GoogleMapsAPI(); module.exports = function(latitude, longitude, language = 'zh-TW') { return new Promise(function(resolve, reject) { gmAPI.reverseGeocode({ latlng: `${latitude},${longitude}`, language: language }, function(err, body) { if (err) { reject(err); } let components = body.results.length > 0 ? body.results[0].address_components : []; components = _.filter(components, (o) => { for (let type of o.types) { if (type.match(/^administrative_area_level/)) { return true; } } return false; }).map((o) => o.long_name); resolve(components); }); }); }
const _ = require('lodash'); const GoogleMapsAPI = require('googlemaps'); const gmAPI = new GoogleMapsAPI(); module.exports = function(latitude, longitude, language = 'zh-TW') { return new Promise(function(resolve, reject) { gmAPI.reverseGeocode({ latlng: `${latitude},${longitude}`, language: language }, function(err, body) { if (err) { reject(err); } let components = body && body.results && body.results.length > 0 ? body.results[0].address_components : []; components = _.filter(components, (o) => { for (let type of o.types) { if (type.match(/^administrative_area_level/)) { return true; } } return false; }).map((o) => o.long_name); resolve(components); }); }); }
Check the response body from google geocode api
Check the response body from google geocode api
JavaScript
mit
dimotsai/pokemongo-notification
javascript
## Code Before: const _ = require('lodash'); const GoogleMapsAPI = require('googlemaps'); const gmAPI = new GoogleMapsAPI(); module.exports = function(latitude, longitude, language = 'zh-TW') { return new Promise(function(resolve, reject) { gmAPI.reverseGeocode({ latlng: `${latitude},${longitude}`, language: language }, function(err, body) { if (err) { reject(err); } let components = body.results.length > 0 ? body.results[0].address_components : []; components = _.filter(components, (o) => { for (let type of o.types) { if (type.match(/^administrative_area_level/)) { return true; } } return false; }).map((o) => o.long_name); resolve(components); }); }); } ## Instruction: Check the response body from google geocode api ## Code After: const _ = require('lodash'); const GoogleMapsAPI = require('googlemaps'); const gmAPI = new GoogleMapsAPI(); module.exports = function(latitude, longitude, language = 'zh-TW') { return new Promise(function(resolve, reject) { gmAPI.reverseGeocode({ latlng: `${latitude},${longitude}`, language: language }, function(err, body) { if (err) { reject(err); } let components = body && body.results && body.results.length > 0 ? body.results[0].address_components : []; components = _.filter(components, (o) => { for (let type of o.types) { if (type.match(/^administrative_area_level/)) { return true; } } return false; }).map((o) => o.long_name); resolve(components); }); }); }
85bdd4fac9c463982ef05c93e70ff0bc29e3a754
plugin.yml
plugin.yml
name: PvPTeleport main: net.simpvp.PvPTeleport.PvPTeleport version: 1.8 depend: [MultiWorld] commands: world: description: Teleports player between overworld and pvp world. usage: Error. Please report at https://github.com/C4K3/PvPTeleport pvplist: description: Lists all players in the pvp world. usage: Error. Please report at https://github.com/C4K3/PvPTeleport
name: PvPTeleport main: net.simpvp.PvPTeleport.PvPTeleport version: 1.8 commands: world: description: Teleports player between overworld and pvp world. usage: Error. Please report at https://github.com/C4K3/PvPTeleport pvplist: description: Lists all players in the pvp world. usage: Error. Please report at https://github.com/C4K3/PvPTeleport
Remove bukkit dependency on Multiworld
Remove bukkit dependency on Multiworld Multiple plugins can be used to provide multiworld support, and just having a multiworld plugin is not a guarantee that the pvp world will be loaded. Rather it should be a dynamic check whenever people use the command.
YAML
unlicense
C4K3/PvPTeleport
yaml
## Code Before: name: PvPTeleport main: net.simpvp.PvPTeleport.PvPTeleport version: 1.8 depend: [MultiWorld] commands: world: description: Teleports player between overworld and pvp world. usage: Error. Please report at https://github.com/C4K3/PvPTeleport pvplist: description: Lists all players in the pvp world. usage: Error. Please report at https://github.com/C4K3/PvPTeleport ## Instruction: Remove bukkit dependency on Multiworld Multiple plugins can be used to provide multiworld support, and just having a multiworld plugin is not a guarantee that the pvp world will be loaded. Rather it should be a dynamic check whenever people use the command. ## Code After: name: PvPTeleport main: net.simpvp.PvPTeleport.PvPTeleport version: 1.8 commands: world: description: Teleports player between overworld and pvp world. usage: Error. Please report at https://github.com/C4K3/PvPTeleport pvplist: description: Lists all players in the pvp world. usage: Error. Please report at https://github.com/C4K3/PvPTeleport
4955cd290ec3b753e801cf7d38c15047a5eeed27
.goreleaser.yml
.goreleaser.yml
env: - GO111MODULE=on - GOPROXY=https://gocenter.io before: hooks: - go mod download builds: - env: - CGO_ENABLED=0 goos: - linux goarch: - amd64 - arm - arm64 checksum: name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt" changelog: sort: asc filters: exclude: - "^docs:" - "^test:" - Merge pull request - Merge branch archives: - name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" replacements: linux: Linux amd64: x86_64 nfpms: - homepage: https://github.com/aleroyer/rsyslog_exporter description: rsyslog-exporter for prometheus maintainer: Antoine Leroyer <[email protected]> license: Apache 2.0 bindir: /usr/bin release: 1 formats: - deb - rpm overrides: deb: file_name_template: '{{ replace .ProjectName "_" "-" }}_{{ .Version }}-{{ .Release }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' rpm: file_name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Release }}.{{ .Arch }}"
env: - GO111MODULE=on - GOPROXY=https://gocenter.io before: hooks: - go mod download builds: - env: - CGO_ENABLED=0 goos: - linux goarch: - amd64 - arm - arm64 checksum: name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt" changelog: sort: asc filters: exclude: - "^docs:" - "^test:" - Merge pull request - Merge branch archives: - name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" replacements: linux: Linux amd64: x86_64 nfpms: - package_name: "rsyslog-exporter" homepage: https://github.com/aleroyer/rsyslog_exporter description: rsyslog-exporter for prometheus maintainer: Antoine Leroyer <[email protected]> license: Apache 2.0 bindir: /usr/bin release: 1 formats: - deb - rpm overrides: deb: file_name_template: '{{ replace .ProjectName "_" "-" }}_{{ .Version }}-{{ .Release }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' rpm: file_name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Release }}.{{ .Arch }}"
Change package_name because it's not debian compatible
Change package_name because it's not debian compatible
YAML
apache-2.0
aleroyer/rsyslog_exporter
yaml
## Code Before: env: - GO111MODULE=on - GOPROXY=https://gocenter.io before: hooks: - go mod download builds: - env: - CGO_ENABLED=0 goos: - linux goarch: - amd64 - arm - arm64 checksum: name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt" changelog: sort: asc filters: exclude: - "^docs:" - "^test:" - Merge pull request - Merge branch archives: - name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" replacements: linux: Linux amd64: x86_64 nfpms: - homepage: https://github.com/aleroyer/rsyslog_exporter description: rsyslog-exporter for prometheus maintainer: Antoine Leroyer <[email protected]> license: Apache 2.0 bindir: /usr/bin release: 1 formats: - deb - rpm overrides: deb: file_name_template: '{{ replace .ProjectName "_" "-" }}_{{ .Version }}-{{ .Release }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' rpm: file_name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Release }}.{{ .Arch }}" ## Instruction: Change package_name because it's not debian compatible ## Code After: env: - GO111MODULE=on - GOPROXY=https://gocenter.io before: hooks: - go mod download builds: - env: - CGO_ENABLED=0 goos: - linux goarch: - amd64 - arm - arm64 checksum: name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt" changelog: sort: asc filters: exclude: - "^docs:" - "^test:" - Merge pull request - Merge branch archives: - name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" replacements: linux: Linux amd64: x86_64 nfpms: - package_name: "rsyslog-exporter" homepage: https://github.com/aleroyer/rsyslog_exporter description: rsyslog-exporter for prometheus maintainer: Antoine Leroyer <[email protected]> license: Apache 2.0 bindir: /usr/bin release: 1 formats: - deb - rpm overrides: deb: file_name_template: '{{ replace .ProjectName "_" "-" }}_{{ .Version }}-{{ .Release }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' rpm: file_name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Release }}.{{ .Arch }}"
7eb7c333a57ef7da6296bd52e2e4e6e03672c83f
zable.gemspec
zable.gemspec
Gem::Specification.new do |s| s.name = "zable" s.summary = "HTML tables" s.description = "HTML searching, sorting and pagination made dead simple" s.files = Dir["lib/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"] s.version = "0.0.1" s.authors = ["Derek Croft"] s.add_runtime_dependency 'will_paginate' end
Gem::Specification.new do |s| s.name = "zable" s.summary = "HTML tables" s.description = "HTML searching, sorting and pagination made dead simple" s.files = Dir["lib/**/*", "app/**/*", "public/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"] s.version = "0.0.1" s.authors = ["Derek Croft"] s.add_runtime_dependency 'will_paginate' end
Add app and public to requires
Add app and public to requires
Ruby
mit
derekcroft/zable,derekcroft/zable
ruby
## Code Before: Gem::Specification.new do |s| s.name = "zable" s.summary = "HTML tables" s.description = "HTML searching, sorting and pagination made dead simple" s.files = Dir["lib/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"] s.version = "0.0.1" s.authors = ["Derek Croft"] s.add_runtime_dependency 'will_paginate' end ## Instruction: Add app and public to requires ## Code After: Gem::Specification.new do |s| s.name = "zable" s.summary = "HTML tables" s.description = "HTML searching, sorting and pagination made dead simple" s.files = Dir["lib/**/*", "app/**/*", "public/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"] s.version = "0.0.1" s.authors = ["Derek Croft"] s.add_runtime_dependency 'will_paginate' end
9f58a739e8704e1e2a5a33c4db01927b78f5597b
setup.cfg
setup.cfg
[build_sphinx] config-dir = doc source-dir = doc build-dir = build/doc builder = html all_files = 1
[build_sphinx] config-dir = doc source-dir = doc build-dir = build/doc builder = html all_files = 1 [coverage:run] branch = True source = clique
Add default coverage run options.
Add default coverage run options.
INI
apache-2.0
4degrees/clique
ini
## Code Before: [build_sphinx] config-dir = doc source-dir = doc build-dir = build/doc builder = html all_files = 1 ## Instruction: Add default coverage run options. ## Code After: [build_sphinx] config-dir = doc source-dir = doc build-dir = build/doc builder = html all_files = 1 [coverage:run] branch = True source = clique
ee2d4906fdf8685bb618d6cc4e04c4ffdf5d7c36
.github/workflows/ci.yml
.github/workflows/ci.yml
name: ci on: [push, pull_request] jobs: build: strategy: matrix: os: [macOS-latest, windows-latest, ubuntu-latest] toolchain: [stable, beta, nightly] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@master - name: Install Rust uses: actions-rs/toolchain@v1 with: toolchain: ${{ matrix.toolchain }} override: true - name: Run cargo check --all env: RUSTFLAGS: -D warnings run: | cargo check --all --all-targets - name: Compile the tests env: RUSTFLAGS: -D warnings run: | cargo test --all --all-targets --no-run - name: Run cargo doc env: RUSTFLAGS: -D warnings run: | cargo doc --all --all-features
name: ci on: [push, pull_request] jobs: build: strategy: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] toolchain: [stable, beta, nightly] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@master - name: Install Rust uses: actions-rs/toolchain@v1 with: toolchain: ${{ matrix.toolchain }} override: true - name: Run cargo check --all env: RUSTFLAGS: -D warnings run: | cargo check --all --all-targets - name: Compile the tests env: RUSTFLAGS: -D warnings run: | cargo test --all --all-targets --no-run - name: Run cargo doc env: RUSTFLAGS: -D warnings run: | cargo doc --all --all-features
Disable Mac OS for now for the CI
Disable Mac OS for now for the CI See https://github.com/rust-windowing/winit/pull/2078
YAML
apache-2.0
glium/glium
yaml
## Code Before: name: ci on: [push, pull_request] jobs: build: strategy: matrix: os: [macOS-latest, windows-latest, ubuntu-latest] toolchain: [stable, beta, nightly] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@master - name: Install Rust uses: actions-rs/toolchain@v1 with: toolchain: ${{ matrix.toolchain }} override: true - name: Run cargo check --all env: RUSTFLAGS: -D warnings run: | cargo check --all --all-targets - name: Compile the tests env: RUSTFLAGS: -D warnings run: | cargo test --all --all-targets --no-run - name: Run cargo doc env: RUSTFLAGS: -D warnings run: | cargo doc --all --all-features ## Instruction: Disable Mac OS for now for the CI See https://github.com/rust-windowing/winit/pull/2078 ## Code After: name: ci on: [push, pull_request] jobs: build: strategy: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] toolchain: [stable, beta, nightly] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@master - name: Install Rust uses: actions-rs/toolchain@v1 with: toolchain: ${{ matrix.toolchain }} override: true - name: Run cargo check --all env: RUSTFLAGS: -D warnings run: | cargo check --all --all-targets - name: Compile the tests env: RUSTFLAGS: -D warnings run: | cargo test --all --all-targets --no-run - name: Run cargo doc env: RUSTFLAGS: -D warnings run: | cargo doc --all --all-features
93fc6b584d3313ac8ae16f7fe14833711476f522
custom/10-circe.el
custom/10-circe.el
;; IRC reconnect (eval-after-load 'rcirc '(defun-rcirc-command reconnect (arg) "Reconnect the server process." (interactive "i") (unless process (error "There's no process for this target")) (let* ((server (car (process-contact process))) (port (process-contact process :service)) (nick (rcirc-nick process)) channels query-buffers) (dolist (buf (buffer-list)) (with-current-buffer buf (when (eq process (rcirc-buffer-process)) (remove-hook 'change-major-mode-hook 'rcirc-change-major-mode-hook) (if (rcirc-channel-p rcirc-target) (setq channels (cons rcirc-target channels)) (setq query-buffers (cons buf query-buffers)))))) (delete-process process) (rcirc-connect server port nick rcirc-default-user-name rcirc-default-full-name channels)))) ;; Shortcut to connect to IRC (defun irc () "Connect to IRC" (interactive) (circe "Freenode")) ;; Enable chanop commands (eval-after-load 'circe '(require 'circe-chanop))
;; IRC reconnect (eval-after-load 'rcirc '(defun-rcirc-command reconnect (arg) "Reconnect the server process." (interactive "i") (unless process (error "There's no process for this target")) (let* ((server (car (process-contact process))) (port (process-contact process :service)) (nick (rcirc-nick process)) channels query-buffers) (dolist (buf (buffer-list)) (with-current-buffer buf (when (eq process (rcirc-buffer-process)) (remove-hook 'change-major-mode-hook 'rcirc-change-major-mode-hook) (if (rcirc-channel-p rcirc-target) (setq channels (cons rcirc-target channels)) (setq query-buffers (cons buf query-buffers)))))) (delete-process process) (rcirc-connect server port nick rcirc-default-user-name rcirc-default-full-name channels)))) ;; Shortcut to connect to IRC (defun irc () "Connect to IRC" (interactive) (circe "Freenode")) ;; Enable chanop commands (eval-after-load 'circe '(require 'circe-chanop)) ;; Circe (IRC) configuration ;; Put your configuration in a ~/.private.el file with permissions 0600 (load-file "~/.private.el") (setq circe-network-options `(("Freenode" :nick ,freenode-user :channels ("#mlug-au") :nickserv-password ,freenode-password )))
Add more to irc config
Add more to irc config
Emacs Lisp
mit
map7/emacs-config,map7/emacs-config,map7/emacs-config
emacs-lisp
## Code Before: ;; IRC reconnect (eval-after-load 'rcirc '(defun-rcirc-command reconnect (arg) "Reconnect the server process." (interactive "i") (unless process (error "There's no process for this target")) (let* ((server (car (process-contact process))) (port (process-contact process :service)) (nick (rcirc-nick process)) channels query-buffers) (dolist (buf (buffer-list)) (with-current-buffer buf (when (eq process (rcirc-buffer-process)) (remove-hook 'change-major-mode-hook 'rcirc-change-major-mode-hook) (if (rcirc-channel-p rcirc-target) (setq channels (cons rcirc-target channels)) (setq query-buffers (cons buf query-buffers)))))) (delete-process process) (rcirc-connect server port nick rcirc-default-user-name rcirc-default-full-name channels)))) ;; Shortcut to connect to IRC (defun irc () "Connect to IRC" (interactive) (circe "Freenode")) ;; Enable chanop commands (eval-after-load 'circe '(require 'circe-chanop)) ## Instruction: Add more to irc config ## Code After: ;; IRC reconnect (eval-after-load 'rcirc '(defun-rcirc-command reconnect (arg) "Reconnect the server process." (interactive "i") (unless process (error "There's no process for this target")) (let* ((server (car (process-contact process))) (port (process-contact process :service)) (nick (rcirc-nick process)) channels query-buffers) (dolist (buf (buffer-list)) (with-current-buffer buf (when (eq process (rcirc-buffer-process)) (remove-hook 'change-major-mode-hook 'rcirc-change-major-mode-hook) (if (rcirc-channel-p rcirc-target) (setq channels (cons rcirc-target channels)) (setq query-buffers (cons buf query-buffers)))))) (delete-process process) (rcirc-connect server port nick rcirc-default-user-name rcirc-default-full-name channels)))) ;; Shortcut to connect to IRC (defun irc () "Connect to IRC" (interactive) (circe "Freenode")) ;; Enable chanop commands (eval-after-load 'circe '(require 'circe-chanop)) ;; Circe (IRC) configuration ;; Put your configuration in a ~/.private.el file with permissions 0600 (load-file "~/.private.el") (setq circe-network-options `(("Freenode" :nick ,freenode-user :channels ("#mlug-au") :nickserv-password ,freenode-password )))
c1e5750140ebff37e306a373439570ab98610fdf
ansible/vagrant.yml
ansible/vagrant.yml
--- - hosts: all become: yes become_method: sudo gather_facts: no pre_tasks: - name: 'install python2' raw: sudo apt-get -y install python-simplejson tasks: - name: update apt cache apt: update_cache=yes - name: install packages apt: name={{ item }} state=present with_items: - g++ - git - realpath - unzip - name: update QT_VERSION in .profile lineinfile: dest=/home/vagrant/.profile line="export QTRPI_QT_VERSION='{{ lookup('env', 'QTRPI_QT_VERSION') }}'" - name: update TARGET_DEVICE in .profile lineinfile: dest=/home/vagrant/.profile line="export QTRPI_TARGET_DEVICE='{{ lookup('env', 'QTRPI_TARGET_DEVICE') }}'" - name: update ssh working directory lineinfile: dest=/home/vagrant/.profile line="cd /vagrant"
--- - hosts: all become: yes become_method: sudo gather_facts: no pre_tasks: - name: 'install python2' raw: sudo apt-get -y install python-simplejson tasks: - name: update apt cache apt: update_cache=yes - name: install packages apt: name={{ item }} state=present with_items: - g++ - git - realpath - unzip - zip - name: update QT_VERSION in .profile lineinfile: dest=/home/vagrant/.profile line="export QTRPI_QT_VERSION='{{ lookup('env', 'QTRPI_QT_VERSION') }}'" - name: update TARGET_DEVICE in .profile lineinfile: dest=/home/vagrant/.profile line="export QTRPI_TARGET_DEVICE='{{ lookup('env', 'QTRPI_TARGET_DEVICE') }}'" - name: update ssh working directory lineinfile: dest=/home/vagrant/.profile line="cd /vagrant"
Add missing zip package in ansible inventory
Add missing zip package in ansible inventory
YAML
mit
neuronalmotion/qtrpi,neuronalmotion/qtrpi
yaml
## Code Before: --- - hosts: all become: yes become_method: sudo gather_facts: no pre_tasks: - name: 'install python2' raw: sudo apt-get -y install python-simplejson tasks: - name: update apt cache apt: update_cache=yes - name: install packages apt: name={{ item }} state=present with_items: - g++ - git - realpath - unzip - name: update QT_VERSION in .profile lineinfile: dest=/home/vagrant/.profile line="export QTRPI_QT_VERSION='{{ lookup('env', 'QTRPI_QT_VERSION') }}'" - name: update TARGET_DEVICE in .profile lineinfile: dest=/home/vagrant/.profile line="export QTRPI_TARGET_DEVICE='{{ lookup('env', 'QTRPI_TARGET_DEVICE') }}'" - name: update ssh working directory lineinfile: dest=/home/vagrant/.profile line="cd /vagrant" ## Instruction: Add missing zip package in ansible inventory ## Code After: --- - hosts: all become: yes become_method: sudo gather_facts: no pre_tasks: - name: 'install python2' raw: sudo apt-get -y install python-simplejson tasks: - name: update apt cache apt: update_cache=yes - name: install packages apt: name={{ item }} state=present with_items: - g++ - git - realpath - unzip - zip - name: update QT_VERSION in .profile lineinfile: dest=/home/vagrant/.profile line="export QTRPI_QT_VERSION='{{ lookup('env', 'QTRPI_QT_VERSION') }}'" - name: update TARGET_DEVICE in .profile lineinfile: dest=/home/vagrant/.profile line="export QTRPI_TARGET_DEVICE='{{ lookup('env', 'QTRPI_TARGET_DEVICE') }}'" - name: update ssh working directory lineinfile: dest=/home/vagrant/.profile line="cd /vagrant"
72c03b58a7542c590b4e27df3ecf126188b8131f
xml/Menu/speakcivi.xml
xml/Menu/speakcivi.xml
<?xml version="1.0"?> <menu> <item> <path>civicrm/speakcivi</path> <page_callback>CRM_Speakcivi_Page_Speakcivi</page_callback> <title>Speakcivi</title> <access_callback>1</access_callback> <is_public>true</is_public> </item> <item> <path>civicrm/speakcivi/settings</path> <page_callback>CRM_Speakcivi_Form_Settings</page_callback> <title>Speakcivi API Settings</title> <access_arguments>access CiviCRM</access_arguments> </item> <item> <path>civicrm/speakcivi/confirm</path> <page_callback>CRM_Speakcivi_Page_Confirm</page_callback> <title>Your signature is confirmed</title> <access_callback>1</access_callback> <is_public>true</is_public> </item> </menu>
<?xml version="1.0"?> <menu> <item> <path>civicrm/bsd</path> <page_callback>CRM_Speakcivi_Page_Speakcivi</page_callback> <title>Speakcivi</title> <access_callback>1</access_callback> <is_public>true</is_public> </item> <item> <path>civicrm/bsd/settings</path> <page_callback>CRM_Speakcivi_Form_Settings</page_callback> <title>Speakcivi API Settings</title> <access_arguments>access CiviCRM</access_arguments> </item> <item> <path>civicrm/speakout/confirm</path> <page_callback>CRM_Speakcivi_Page_Confirm</page_callback> <title>Your signature is confirmed</title> <access_callback>1</access_callback> <is_public>true</is_public> </item> </menu>
Rename repository on SpeakCivi (1)
Rename repository on SpeakCivi (1)
XML
agpl-3.0
WeMoveEU/bsd_api,scardinius/speakcivi,scardinius/bsd_api
xml
## Code Before: <?xml version="1.0"?> <menu> <item> <path>civicrm/speakcivi</path> <page_callback>CRM_Speakcivi_Page_Speakcivi</page_callback> <title>Speakcivi</title> <access_callback>1</access_callback> <is_public>true</is_public> </item> <item> <path>civicrm/speakcivi/settings</path> <page_callback>CRM_Speakcivi_Form_Settings</page_callback> <title>Speakcivi API Settings</title> <access_arguments>access CiviCRM</access_arguments> </item> <item> <path>civicrm/speakcivi/confirm</path> <page_callback>CRM_Speakcivi_Page_Confirm</page_callback> <title>Your signature is confirmed</title> <access_callback>1</access_callback> <is_public>true</is_public> </item> </menu> ## Instruction: Rename repository on SpeakCivi (1) ## Code After: <?xml version="1.0"?> <menu> <item> <path>civicrm/bsd</path> <page_callback>CRM_Speakcivi_Page_Speakcivi</page_callback> <title>Speakcivi</title> <access_callback>1</access_callback> <is_public>true</is_public> </item> <item> <path>civicrm/bsd/settings</path> <page_callback>CRM_Speakcivi_Form_Settings</page_callback> <title>Speakcivi API Settings</title> <access_arguments>access CiviCRM</access_arguments> </item> <item> <path>civicrm/speakout/confirm</path> <page_callback>CRM_Speakcivi_Page_Confirm</page_callback> <title>Your signature is confirmed</title> <access_callback>1</access_callback> <is_public>true</is_public> </item> </menu>
e02b31012d0d87faa9ed6360e4e2e65589061c73
core/src/main/java/com/dtolabs/rundeck/core/storage/StorageTimestamperConverter.java
core/src/main/java/com/dtolabs/rundeck/core/storage/StorageTimestamperConverter.java
package com.dtolabs.rundeck.core.storage; import com.dtolabs.rundeck.plugins.storage.StorageConverterPlugin; import org.rundeck.storage.api.HasInputStream; import org.rundeck.storage.api.Path; import java.util.Date; /** * StorageTimestamperConverter sets modification and creation timestamp metadata for updated/created resources. * * @author greg * @since 2014-03-16 */ public class StorageTimestamperConverter implements StorageConverterPlugin { @Override public HasInputStream readResource(Path path, ResourceMetaBuilder resourceMetaBuilder, HasInputStream hasInputStream) { return null; } @Override public HasInputStream createResource(Path path, ResourceMetaBuilder resourceMetaBuilder, HasInputStream hasInputStream) { resourceMetaBuilder.setCreationTime(new Date()); return null; } @Override public HasInputStream updateResource(Path path, ResourceMetaBuilder resourceMetaBuilder, HasInputStream hasInputStream) { resourceMetaBuilder.setModificationTime(new Date()); return null; } }
package com.dtolabs.rundeck.core.storage; import com.dtolabs.rundeck.plugins.storage.StorageConverterPlugin; import org.rundeck.storage.api.HasInputStream; import org.rundeck.storage.api.Path; import java.util.Date; /** * StorageTimestamperConverter sets modification and creation timestamp metadata for updated/created resources. * * @author greg * @since 2014-03-16 */ public class StorageTimestamperConverter implements StorageConverterPlugin { @Override public HasInputStream readResource(Path path, ResourceMetaBuilder resourceMetaBuilder, HasInputStream hasInputStream) { return null; } @Override public HasInputStream createResource(Path path, ResourceMetaBuilder resourceMetaBuilder, HasInputStream hasInputStream) { resourceMetaBuilder.setCreationTime(new Date()); resourceMetaBuilder.setModificationTime(new Date()); return null; } @Override public HasInputStream updateResource(Path path, ResourceMetaBuilder resourceMetaBuilder, HasInputStream hasInputStream) { resourceMetaBuilder.setModificationTime(new Date()); return null; } }
Include a modification time on resource creation
Include a modification time on resource creation
Java
apache-2.0
damageboy/rundeck,variacode/rundeck,jgpacker/rundeck,paul-krohn/rundeck,variacode95/rundeck,tjordanchat/rundeck,variacode/rundeck,patcadelina/rundeck,jamieps/rundeck,jgpacker/rundeck,rophy/rundeck,jgpacker/rundeck,damageboy/rundeck,rophy/rundeck,variacode/rundeck,paul-krohn/rundeck,rundeck/rundeck,jamieps/rundeck,damageboy/rundeck,paul-krohn/rundeck,variacode95/rundeck,variacode95/rundeck,jgpacker/rundeck,rundeck/rundeck,patcadelina/rundeck,rundeck/rundeck,tjordanchat/rundeck,tjordanchat/rundeck,variacode95/rundeck,variacode/rundeck,paul-krohn/rundeck,rundeck/rundeck,rophy/rundeck,patcadelina/rundeck,variacode/rundeck,jamieps/rundeck,damageboy/rundeck,jamieps/rundeck,tjordanchat/rundeck,rophy/rundeck,rundeck/rundeck,patcadelina/rundeck
java
## Code Before: package com.dtolabs.rundeck.core.storage; import com.dtolabs.rundeck.plugins.storage.StorageConverterPlugin; import org.rundeck.storage.api.HasInputStream; import org.rundeck.storage.api.Path; import java.util.Date; /** * StorageTimestamperConverter sets modification and creation timestamp metadata for updated/created resources. * * @author greg * @since 2014-03-16 */ public class StorageTimestamperConverter implements StorageConverterPlugin { @Override public HasInputStream readResource(Path path, ResourceMetaBuilder resourceMetaBuilder, HasInputStream hasInputStream) { return null; } @Override public HasInputStream createResource(Path path, ResourceMetaBuilder resourceMetaBuilder, HasInputStream hasInputStream) { resourceMetaBuilder.setCreationTime(new Date()); return null; } @Override public HasInputStream updateResource(Path path, ResourceMetaBuilder resourceMetaBuilder, HasInputStream hasInputStream) { resourceMetaBuilder.setModificationTime(new Date()); return null; } } ## Instruction: Include a modification time on resource creation ## Code After: package com.dtolabs.rundeck.core.storage; import com.dtolabs.rundeck.plugins.storage.StorageConverterPlugin; import org.rundeck.storage.api.HasInputStream; import org.rundeck.storage.api.Path; import java.util.Date; /** * StorageTimestamperConverter sets modification and creation timestamp metadata for updated/created resources. * * @author greg * @since 2014-03-16 */ public class StorageTimestamperConverter implements StorageConverterPlugin { @Override public HasInputStream readResource(Path path, ResourceMetaBuilder resourceMetaBuilder, HasInputStream hasInputStream) { return null; } @Override public HasInputStream createResource(Path path, ResourceMetaBuilder resourceMetaBuilder, HasInputStream hasInputStream) { resourceMetaBuilder.setCreationTime(new Date()); resourceMetaBuilder.setModificationTime(new Date()); return null; } @Override public HasInputStream updateResource(Path path, ResourceMetaBuilder resourceMetaBuilder, HasInputStream hasInputStream) { resourceMetaBuilder.setModificationTime(new Date()); return null; } }
a672fa6d385f2de391ea5bc5bbff09e6fc7673fc
templates/listing/dashboard_tag_list.hbs
templates/listing/dashboard_tag_list.hbs
<div class="list-group"> <a class="list-group-item {{#unless tag}}active{{/unless}}" href="/dashboards">All <span class="badge badge-primary pull-right"></span></a> {{#each tags}} <a class="list-group-item " data-ds-tag="{{name}}" href="/dashboards/tagged/{{name}}"> {{name}} <span class="badge badge-default pull-right">{{count}}</span></a> {{/each}} </div>
<ul class="nav nav-pills nav-stacked"> <li class="{{#unless tag}}active{{/unless}}"> <a href="/dashboards"> All <span class="badge badge-primary pull-right"></span> </a> </li> {{#each tags}} <li data-ds-tag="{{name}}"> <a href="/dashboards/tagged/{{name}}"> {{name}} <span class="badge badge-default pull-right">{{count}}</span> </a> </li> {{/each}} </ul>
Use nave for tag listing, it looks cleaner
Use nave for tag listing, it looks cleaner
Handlebars
apache-2.0
jmptrader/tessera,urbanairship/tessera,tessera-metrics/tessera,Slach/tessera,aalpern/tessera,tessera-metrics/tessera,section-io/tessera,jmptrader/tessera,tessera-metrics/tessera,filippog/tessera,Slach/tessera,jmptrader/tessera,Slach/tessera,filippog/tessera,jmptrader/tessera,Slach/tessera,section-io/tessera,urbanairship/tessera,aalpern/tessera,aalpern/tessera,urbanairship/tessera,urbanairship/tessera,filippog/tessera,urbanairship/tessera,jmptrader/tessera,tessera-metrics/tessera,aalpern/tessera,section-io/tessera,section-io/tessera,tessera-metrics/tessera,aalpern/tessera
handlebars
## Code Before: <div class="list-group"> <a class="list-group-item {{#unless tag}}active{{/unless}}" href="/dashboards">All <span class="badge badge-primary pull-right"></span></a> {{#each tags}} <a class="list-group-item " data-ds-tag="{{name}}" href="/dashboards/tagged/{{name}}"> {{name}} <span class="badge badge-default pull-right">{{count}}</span></a> {{/each}} </div> ## Instruction: Use nave for tag listing, it looks cleaner ## Code After: <ul class="nav nav-pills nav-stacked"> <li class="{{#unless tag}}active{{/unless}}"> <a href="/dashboards"> All <span class="badge badge-primary pull-right"></span> </a> </li> {{#each tags}} <li data-ds-tag="{{name}}"> <a href="/dashboards/tagged/{{name}}"> {{name}} <span class="badge badge-default pull-right">{{count}}</span> </a> </li> {{/each}} </ul>
3107ff61cca3c811ea2df2af3797f1a30a032021
app/authorizers/inventory_authorizer.rb
app/authorizers/inventory_authorizer.rb
class InventoryAuthorizer < ApplicationAuthorizer def creatable_by?(user) true end def updatable_by?(user) resource.facilitator?(user: user) end def readable_by?(user) resource.member?(user: user) end def deletable_by?(user) resource.facilitator?(user: user) end end
class InventoryAuthorizer < ApplicationAuthorizer def creatable_by?(user) true end def updatable_by?(user) resource.member?(user: user) end def readable_by?(user) resource.member?(user: user) end def deletable_by?(user) resource.facilitator?(user: user) end end
Allow inventory members edit the inventory
Allow inventory members edit the inventory
Ruby
mit
MobilityLabs/pdredesign-server,MobilityLabs/pdredesign-server,MobilityLabs/pdredesign-server,MobilityLabs/pdredesign-server
ruby
## Code Before: class InventoryAuthorizer < ApplicationAuthorizer def creatable_by?(user) true end def updatable_by?(user) resource.facilitator?(user: user) end def readable_by?(user) resource.member?(user: user) end def deletable_by?(user) resource.facilitator?(user: user) end end ## Instruction: Allow inventory members edit the inventory ## Code After: class InventoryAuthorizer < ApplicationAuthorizer def creatable_by?(user) true end def updatable_by?(user) resource.member?(user: user) end def readable_by?(user) resource.member?(user: user) end def deletable_by?(user) resource.facilitator?(user: user) end end
5284cde440e54c6a841efb6a5864afdf3a0aa78e
sdl2cubes/tests/test_mesh.c
sdl2cubes/tests/test_mesh.c
int main(int argc, char *args[]) { if(argc < 2) { printf("test_mesh test-mesh-name.obj\n"); return 0; } // read mesh from standard input, push into obj parser Mesh *mesh = meshReadOBJ(args[1]); if(!mesh) { return 0; } unsigned numFloats = meshGetNumFloats(mesh); unsigned numVertices = meshGetNumVertices(mesh); float *buf = malloc(sizeof(float) * numFloats); meshPackVertices(mesh, buf); meshClose(mesh); return 0; }
int main(int argc, char *args[]) { if(argc < 2) { printf("usage: test_mesh filename.obj\n"); printf(" pass - (a dash character) as filename to read from stdin\n"); return 0; } Mesh *mesh; // read mesh from standard input or file, push into obj parser if(!strcmp("-", args[1])) { mesh = meshReadOBJF(stdin, "(stdin)"); } else { mesh = meshReadOBJ(args[1]); } if(!mesh) { return 0; } unsigned numFloats = meshGetNumFloats(mesh); unsigned numVertices = meshGetNumVertices(mesh); float *buf = malloc(sizeof(float) * numFloats); meshPackVertices(mesh, buf); meshClose(mesh); free(buf); return 0; }
Make mesh loader actually read stdin
tests: Make mesh loader actually read stdin
C
unlicense
teistiz/instanssi-samples
c
## Code Before: int main(int argc, char *args[]) { if(argc < 2) { printf("test_mesh test-mesh-name.obj\n"); return 0; } // read mesh from standard input, push into obj parser Mesh *mesh = meshReadOBJ(args[1]); if(!mesh) { return 0; } unsigned numFloats = meshGetNumFloats(mesh); unsigned numVertices = meshGetNumVertices(mesh); float *buf = malloc(sizeof(float) * numFloats); meshPackVertices(mesh, buf); meshClose(mesh); return 0; } ## Instruction: tests: Make mesh loader actually read stdin ## Code After: int main(int argc, char *args[]) { if(argc < 2) { printf("usage: test_mesh filename.obj\n"); printf(" pass - (a dash character) as filename to read from stdin\n"); return 0; } Mesh *mesh; // read mesh from standard input or file, push into obj parser if(!strcmp("-", args[1])) { mesh = meshReadOBJF(stdin, "(stdin)"); } else { mesh = meshReadOBJ(args[1]); } if(!mesh) { return 0; } unsigned numFloats = meshGetNumFloats(mesh); unsigned numVertices = meshGetNumVertices(mesh); float *buf = malloc(sizeof(float) * numFloats); meshPackVertices(mesh, buf); meshClose(mesh); free(buf); return 0; }
317926c18ac2e139d2018acd767d10b4f53428f3
installer/installer_config/views.py
installer/installer_config/views.py
from django.shortcuts import render from django.shortcuts import render_to_response from django.views.generic import CreateView, UpdateView, DeleteView from installer_config.models import EnvironmentProfile, UserChoice, Step from installer_config.forms import EnvironmentForm from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect class CreateEnvironmentProfile(CreateView): model = EnvironmentProfile template_name = 'env_profile_form.html' form_class = EnvironmentForm success_url = '/profile' def form_valid(self, form): form.instance.user = self.request.user return super(CreateEnvironmentProfile, self).form_valid(form) def post(self, request, *args, **kwargs): form_class = self.get_form_class() form = form_class(request.POST) if form.is_valid(): config_profile = form.save(commit=False) config_profile.user = request.user config_profile.save() return HttpResponseRedirect(reverse('profile:profile')) return self.render_to_response({'form': form}) class UpdateEnvironmentProfile(UpdateView): model = EnvironmentProfile context_object_name = 'profile' template_name = 'env_profile_form.html' form_class = EnvironmentForm success_url = '/profile' class DeleteEnvironmentProfile(DeleteView): model = EnvironmentProfile success_url = '/profile' def download_profile_view(request, **kwargs): choices = UserChoice.objects.filter(profiles=kwargs['pk']).all() # import pdb; pdb.set_trace() response = render_to_response('installer_template.py', {'choices': choices}, content_type='application') response['Content-Disposition'] = 'attachment; filename=something.py' return response
from django.shortcuts import render from django.shortcuts import render_to_response from django.views.generic import CreateView, UpdateView, DeleteView from installer_config.models import EnvironmentProfile, UserChoice, Step from installer_config.forms import EnvironmentForm from django.core.urlresolvers import reverse class CreateEnvironmentProfile(CreateView): model = EnvironmentProfile template_name = 'env_profile_form.html' form_class = EnvironmentForm success_url = '/profile' def form_valid(self, form): form.instance.user = self.request.user return super(CreateEnvironmentProfile, self).form_valid(form) class UpdateEnvironmentProfile(UpdateView): model = EnvironmentProfile context_object_name = 'profile' template_name = 'env_profile_form.html' form_class = EnvironmentForm success_url = '/profile' class DeleteEnvironmentProfile(DeleteView): model = EnvironmentProfile success_url = '/profile' def download_profile_view(request, **kwargs): choices = UserChoice.objects.filter(profiles=kwargs['pk']).all() response = render_to_response('installer_template.py', {'choices': choices}, content_type='application') response['Content-Disposition'] = 'attachment; filename=something.py' return response
Remove unneeded post method from CreateEnvProfile view
Remove unneeded post method from CreateEnvProfile view
Python
mit
ezPy-co/ezpy,alibulota/Package_Installer,ezPy-co/ezpy,alibulota/Package_Installer
python
## Code Before: from django.shortcuts import render from django.shortcuts import render_to_response from django.views.generic import CreateView, UpdateView, DeleteView from installer_config.models import EnvironmentProfile, UserChoice, Step from installer_config.forms import EnvironmentForm from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect class CreateEnvironmentProfile(CreateView): model = EnvironmentProfile template_name = 'env_profile_form.html' form_class = EnvironmentForm success_url = '/profile' def form_valid(self, form): form.instance.user = self.request.user return super(CreateEnvironmentProfile, self).form_valid(form) def post(self, request, *args, **kwargs): form_class = self.get_form_class() form = form_class(request.POST) if form.is_valid(): config_profile = form.save(commit=False) config_profile.user = request.user config_profile.save() return HttpResponseRedirect(reverse('profile:profile')) return self.render_to_response({'form': form}) class UpdateEnvironmentProfile(UpdateView): model = EnvironmentProfile context_object_name = 'profile' template_name = 'env_profile_form.html' form_class = EnvironmentForm success_url = '/profile' class DeleteEnvironmentProfile(DeleteView): model = EnvironmentProfile success_url = '/profile' def download_profile_view(request, **kwargs): choices = UserChoice.objects.filter(profiles=kwargs['pk']).all() # import pdb; pdb.set_trace() response = render_to_response('installer_template.py', {'choices': choices}, content_type='application') response['Content-Disposition'] = 'attachment; filename=something.py' return response ## Instruction: Remove unneeded post method from CreateEnvProfile view ## Code After: from django.shortcuts import render from django.shortcuts import render_to_response from django.views.generic import CreateView, UpdateView, DeleteView from installer_config.models import EnvironmentProfile, UserChoice, Step from installer_config.forms import EnvironmentForm from django.core.urlresolvers import reverse class CreateEnvironmentProfile(CreateView): model = EnvironmentProfile template_name = 'env_profile_form.html' form_class = EnvironmentForm success_url = '/profile' def form_valid(self, form): form.instance.user = self.request.user return super(CreateEnvironmentProfile, self).form_valid(form) class UpdateEnvironmentProfile(UpdateView): model = EnvironmentProfile context_object_name = 'profile' template_name = 'env_profile_form.html' form_class = EnvironmentForm success_url = '/profile' class DeleteEnvironmentProfile(DeleteView): model = EnvironmentProfile success_url = '/profile' def download_profile_view(request, **kwargs): choices = UserChoice.objects.filter(profiles=kwargs['pk']).all() response = render_to_response('installer_template.py', {'choices': choices}, content_type='application') response['Content-Disposition'] = 'attachment; filename=something.py' return response
51a11b61451ab94d6606c66fffd5485c04c8f91f
Modules/TubeGraph/CMakeLists.txt
Modules/TubeGraph/CMakeLists.txt
MITK_CREATE_MODULE( INCLUDE_DIRS PRIVATE src/Algorithms src/DataStructure src/Interactions src/Rendering src/IO DEPENDS MitkSceneSerializationBase PACKAGE_DEPENDS Boost #WARNINGS_AS_ERRORS ) #add_subdirectory(test)
set(disable_module 0) if(GCC_VERSION VERSION_GREATER 0 AND GCC_VERSION VERSION_LESS 4.7) # The Boost Graph library at least up to version 1.57 does not # compile with gcc < 4.7 and -std=c++0x, see # http://stackoverflow.com/questions/25395805/compile-error-with-boost-graph-1-56-0-and-g-4-6-4 set(disable_module 1) endif() if(NOT disable_module) MITK_CREATE_MODULE( INCLUDE_DIRS PRIVATE src/Algorithms src/DataStructure src/Interactions src/Rendering src/IO DEPENDS MitkSceneSerializationBase PACKAGE_DEPENDS Boost #WARNINGS_AS_ERRORS ) #add_subdirectory(test) endif()
Disable TubeGraph if gcc < 4.7 is used.
COMP: Disable TubeGraph if gcc < 4.7 is used.
Text
bsd-3-clause
iwegner/MITK,fmilano/mitk,fmilano/mitk,NifTK/MITK,iwegner/MITK,iwegner/MITK,iwegner/MITK,NifTK/MITK,fmilano/mitk,RabadanLab/MITKats,MITK/MITK,MITK/MITK,iwegner/MITK,fmilano/mitk,MITK/MITK,fmilano/mitk,RabadanLab/MITKats,MITK/MITK,MITK/MITK,RabadanLab/MITKats,MITK/MITK,RabadanLab/MITKats,RabadanLab/MITKats,NifTK/MITK,NifTK/MITK,NifTK/MITK,fmilano/mitk,RabadanLab/MITKats,iwegner/MITK,NifTK/MITK,fmilano/mitk
text
## Code Before: MITK_CREATE_MODULE( INCLUDE_DIRS PRIVATE src/Algorithms src/DataStructure src/Interactions src/Rendering src/IO DEPENDS MitkSceneSerializationBase PACKAGE_DEPENDS Boost #WARNINGS_AS_ERRORS ) #add_subdirectory(test) ## Instruction: COMP: Disable TubeGraph if gcc < 4.7 is used. ## Code After: set(disable_module 0) if(GCC_VERSION VERSION_GREATER 0 AND GCC_VERSION VERSION_LESS 4.7) # The Boost Graph library at least up to version 1.57 does not # compile with gcc < 4.7 and -std=c++0x, see # http://stackoverflow.com/questions/25395805/compile-error-with-boost-graph-1-56-0-and-g-4-6-4 set(disable_module 1) endif() if(NOT disable_module) MITK_CREATE_MODULE( INCLUDE_DIRS PRIVATE src/Algorithms src/DataStructure src/Interactions src/Rendering src/IO DEPENDS MitkSceneSerializationBase PACKAGE_DEPENDS Boost #WARNINGS_AS_ERRORS ) #add_subdirectory(test) endif()
3cb84621e985128099e973874d5795c9c62c5524
src/Query/Capability/HasOrderBy.php
src/Query/Capability/HasOrderBy.php
<?php declare(strict_types=1); namespace Latitude\QueryBuilder\Query\Capability; use Latitude\QueryBuilder\ExpressionInterface; use Latitude\QueryBuilder\StatementInterface; use function Latitude\QueryBuilder\listing; use function Latitude\QueryBuilder\order; trait HasOrderBy { /** @var StatementInterface[] */ protected $orderBy; public function orderBy($column, string $direction = ''): self { $this->orderBy[] = order($column, $direction); return $this; } protected function applyOrderBy(ExpressionInterface $query): ExpressionInterface { return $this->orderBy ? $query->append('ORDER BY %s', listing($this->orderBy)) : $query; } }
<?php declare(strict_types=1); namespace Latitude\QueryBuilder\Query\Capability; use Latitude\QueryBuilder\ExpressionInterface; use Latitude\QueryBuilder\StatementInterface; use function Latitude\QueryBuilder\listing; use function Latitude\QueryBuilder\order; trait HasOrderBy { /** @var StatementInterface[] */ protected $orderBy; public function orderBy($column, string $direction = ''): self { if (empty($column)) { $this->orderBy = []; return $this; } $this->orderBy[] = order($column, $direction); return $this; } protected function applyOrderBy(ExpressionInterface $query): ExpressionInterface { return $this->orderBy ? $query->append('ORDER BY %s', listing($this->orderBy)) : $query; } }
Allow nullable order by to clear out the order
Allow nullable order by to clear out the order
PHP
mit
shadowhand/latitude
php
## Code Before: <?php declare(strict_types=1); namespace Latitude\QueryBuilder\Query\Capability; use Latitude\QueryBuilder\ExpressionInterface; use Latitude\QueryBuilder\StatementInterface; use function Latitude\QueryBuilder\listing; use function Latitude\QueryBuilder\order; trait HasOrderBy { /** @var StatementInterface[] */ protected $orderBy; public function orderBy($column, string $direction = ''): self { $this->orderBy[] = order($column, $direction); return $this; } protected function applyOrderBy(ExpressionInterface $query): ExpressionInterface { return $this->orderBy ? $query->append('ORDER BY %s', listing($this->orderBy)) : $query; } } ## Instruction: Allow nullable order by to clear out the order ## Code After: <?php declare(strict_types=1); namespace Latitude\QueryBuilder\Query\Capability; use Latitude\QueryBuilder\ExpressionInterface; use Latitude\QueryBuilder\StatementInterface; use function Latitude\QueryBuilder\listing; use function Latitude\QueryBuilder\order; trait HasOrderBy { /** @var StatementInterface[] */ protected $orderBy; public function orderBy($column, string $direction = ''): self { if (empty($column)) { $this->orderBy = []; return $this; } $this->orderBy[] = order($column, $direction); return $this; } protected function applyOrderBy(ExpressionInterface $query): ExpressionInterface { return $this->orderBy ? $query->append('ORDER BY %s', listing($this->orderBy)) : $query; } }
ad5e3b01c32527c34291fe8f4a0240c8c4e14ede
lib/statsd/instrument/environment.rb
lib/statsd/instrument/environment.rb
require 'logger' module StatsD::Instrument::Environment extend self def default_backend case environment when 'production' StatsD::Instrument::Backends::UDPBackend.new(ENV['STATSD_ADDR'], ENV['STATSD_IMPLEMENTATION']) when 'test' StatsD::Instrument::Backends::NullBackend.new else logger = defined?(Rails) ? Rails.logger : Logger.new($stdout) StatsD::Instrument::Backends::LoggerBackend.new(logger) end end def environment if defined?(Rails) Rails.env.to_s else ENV['RAILS_ENV'] || ENV['RACK_ENV'] || ENV['ENV'] || 'development' end end end StatsD.default_sample_rate = ENV.fetch('STATSD_SAMPLE_RATE', 1.0).to_f StatsD.logger = defined?(Rails) ? Rails.logger : Logger.new($stderr)
require 'logger' module StatsD::Instrument::Environment extend self def default_backend case environment when 'production' StatsD::Instrument::Backends::UDPBackend.new(ENV['STATSD_ADDR'], ENV['STATSD_IMPLEMENTATION']) when 'test' StatsD::Instrument::Backends::NullBackend.new else StatsD::Instrument::Backends::LoggerBackend.new(StatsD.logger) end end def environment if defined?(Rails) Rails.env.to_s else ENV['RAILS_ENV'] || ENV['RACK_ENV'] || ENV['ENV'] || 'development' end end end StatsD.default_sample_rate = ENV.fetch('STATSD_SAMPLE_RATE', 1.0).to_f StatsD.logger = defined?(Rails) ? Rails.logger : Logger.new($stderr)
Use StatsD.logger for logger backend
Use StatsD.logger for logger backend
Ruby
mit
yakovenkodenis/statsd-instrument,Shopify/statsd-instrument
ruby
## Code Before: require 'logger' module StatsD::Instrument::Environment extend self def default_backend case environment when 'production' StatsD::Instrument::Backends::UDPBackend.new(ENV['STATSD_ADDR'], ENV['STATSD_IMPLEMENTATION']) when 'test' StatsD::Instrument::Backends::NullBackend.new else logger = defined?(Rails) ? Rails.logger : Logger.new($stdout) StatsD::Instrument::Backends::LoggerBackend.new(logger) end end def environment if defined?(Rails) Rails.env.to_s else ENV['RAILS_ENV'] || ENV['RACK_ENV'] || ENV['ENV'] || 'development' end end end StatsD.default_sample_rate = ENV.fetch('STATSD_SAMPLE_RATE', 1.0).to_f StatsD.logger = defined?(Rails) ? Rails.logger : Logger.new($stderr) ## Instruction: Use StatsD.logger for logger backend ## Code After: require 'logger' module StatsD::Instrument::Environment extend self def default_backend case environment when 'production' StatsD::Instrument::Backends::UDPBackend.new(ENV['STATSD_ADDR'], ENV['STATSD_IMPLEMENTATION']) when 'test' StatsD::Instrument::Backends::NullBackend.new else StatsD::Instrument::Backends::LoggerBackend.new(StatsD.logger) end end def environment if defined?(Rails) Rails.env.to_s else ENV['RAILS_ENV'] || ENV['RACK_ENV'] || ENV['ENV'] || 'development' end end end StatsD.default_sample_rate = ENV.fetch('STATSD_SAMPLE_RATE', 1.0).to_f StatsD.logger = defined?(Rails) ? Rails.logger : Logger.new($stderr)
cc83cdc16cf5e7ba911d5f1735b3a48c7ed83644
binder/src/main/java/jp/satorufujiwara/binder/recycler/RecyclerBinder.java
binder/src/main/java/jp/satorufujiwara/binder/recycler/RecyclerBinder.java
package jp.satorufujiwara.binder.recycler; import android.content.Context; import android.support.annotation.LayoutRes; import android.support.v7.widget.RecyclerView; import android.view.View; import android.view.ViewGroup; import jp.satorufujiwara.binder.Binder; import jp.satorufujiwara.binder.ViewType; public abstract class RecyclerBinder<V extends ViewType> implements Binder<V, RecyclerView.ViewHolder> { private final V mViewType; private Context mContext; protected RecyclerBinder(final Context context, final V viewType) { mContext = context; mViewType = viewType; } @LayoutRes public abstract int layoutResId(); public abstract RecyclerView.ViewHolder onCreateViewHolder(final View v); @Override public final RecyclerView.ViewHolder onCreateViewHolder(final ViewGroup parent) { return onCreateViewHolder(View.inflate(mContext, layoutResId(), null)); } @Override public void onViewRecycled(RecyclerView.ViewHolder holder) { // no op } @Override public void onRemoved() { mContext = null; } @Override public V getViewType() { return mViewType; } public final Context getContext() { return mContext; } }
package jp.satorufujiwara.binder.recycler; import android.content.Context; import android.support.annotation.LayoutRes; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import jp.satorufujiwara.binder.Binder; import jp.satorufujiwara.binder.ViewType; public abstract class RecyclerBinder<V extends ViewType> implements Binder<V, RecyclerView.ViewHolder> { private final V mViewType; private Context mContext; protected RecyclerBinder(final Context context, final V viewType) { mContext = context; mViewType = viewType; } @LayoutRes public abstract int layoutResId(); public abstract RecyclerView.ViewHolder onCreateViewHolder(final View v); @Override public final RecyclerView.ViewHolder onCreateViewHolder(final ViewGroup parent) { return onCreateViewHolder(LayoutInflater.from(mContext).inflate(layoutResId(), parent, false)); } @Override public void onViewRecycled(RecyclerView.ViewHolder holder) { // no op } @Override public void onRemoved() { mContext = null; } @Override public V getViewType() { return mViewType; } public final Context getContext() { return mContext; } }
Fix inflated view using parent view.
Fix inflated view using parent view.
Java
apache-2.0
MaTriXy/recyclerview-binder,satorufujiwara/recyclerview-binder
java
## Code Before: package jp.satorufujiwara.binder.recycler; import android.content.Context; import android.support.annotation.LayoutRes; import android.support.v7.widget.RecyclerView; import android.view.View; import android.view.ViewGroup; import jp.satorufujiwara.binder.Binder; import jp.satorufujiwara.binder.ViewType; public abstract class RecyclerBinder<V extends ViewType> implements Binder<V, RecyclerView.ViewHolder> { private final V mViewType; private Context mContext; protected RecyclerBinder(final Context context, final V viewType) { mContext = context; mViewType = viewType; } @LayoutRes public abstract int layoutResId(); public abstract RecyclerView.ViewHolder onCreateViewHolder(final View v); @Override public final RecyclerView.ViewHolder onCreateViewHolder(final ViewGroup parent) { return onCreateViewHolder(View.inflate(mContext, layoutResId(), null)); } @Override public void onViewRecycled(RecyclerView.ViewHolder holder) { // no op } @Override public void onRemoved() { mContext = null; } @Override public V getViewType() { return mViewType; } public final Context getContext() { return mContext; } } ## Instruction: Fix inflated view using parent view. ## Code After: package jp.satorufujiwara.binder.recycler; import android.content.Context; import android.support.annotation.LayoutRes; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import jp.satorufujiwara.binder.Binder; import jp.satorufujiwara.binder.ViewType; public abstract class RecyclerBinder<V extends ViewType> implements Binder<V, RecyclerView.ViewHolder> { private final V mViewType; private Context mContext; protected RecyclerBinder(final Context context, final V viewType) { mContext = context; mViewType = viewType; } @LayoutRes public abstract int layoutResId(); public abstract RecyclerView.ViewHolder onCreateViewHolder(final View v); @Override public final RecyclerView.ViewHolder onCreateViewHolder(final ViewGroup parent) { return onCreateViewHolder(LayoutInflater.from(mContext).inflate(layoutResId(), parent, false)); } @Override public void onViewRecycled(RecyclerView.ViewHolder holder) { // no op } @Override public void onRemoved() { mContext = null; } @Override public V getViewType() { return mViewType; } public final Context getContext() { return mContext; } }
20dc917d01e7188bc1e31c95cf0af4c44e7ed7b6
.travis.yml
.travis.yml
language: node_js node_js: - "0.11" script: "bin/test.sh" services: - mongodb after_script: "npm install [email protected] && cat ./coverage/lcov.info | coveralls"
language: node_js node_js: - "0.11" script: "bin/test.sh" services: - mongodb
Remove failing coverage after script
Remove failing coverage after script
YAML
mit
Wercajk/KaThinka,Wercajk/KaThinka
yaml
## Code Before: language: node_js node_js: - "0.11" script: "bin/test.sh" services: - mongodb after_script: "npm install [email protected] && cat ./coverage/lcov.info | coveralls" ## Instruction: Remove failing coverage after script ## Code After: language: node_js node_js: - "0.11" script: "bin/test.sh" services: - mongodb
4496a3c2dc452da375c940449fb7f3d8f08a5536
src/Channels/FirebaseChannel.php
src/Channels/FirebaseChannel.php
<?php namespace DouglasResende\FCM\Channels; use DouglasResende\FCM\Messages\FirebaseMessage; use Illuminate\Contracts\Config\Repository as Config; use GuzzleHttp\Client; use DouglasResende\FCM\Contracts\FirebaseNotification as Notification; /** * Class FirebaseChannel * @package DouglasResende\FCM\Channels */ class FirebaseChannel { /** * @const api uri */ const API_URI = 'https://fcm.googleapis.com/fcm/send'; /** * @var Client */ private $client; /** * @var Config */ private $config; /** * FirebaseChannel constructor. * @param Client $client * @param Config $config */ public function __construct(Client $client, Config $config) { $this->client = $client; $this->config = $config; } /** * @param $notifiable * @param Notification $notification */ public function send($notifiable, Notification $notification) { $message = $notification->toFCM($notifiable, new FirebaseMessage); $this->client->post(FirebaseChannel::API_URI, [ 'headers' => [ 'Authorization' => 'key=' . $this->getApiKey(), 'Content-Type' => 'application/json', ], 'body' => $message->serialize(), ]); } /** * @return mixed */ private function getApiKey() { return $this->config->get('services.fcm.key'); } }
<?php namespace DouglasResende\FCM\Channels; use DouglasResende\FCM\Messages\FirebaseMessage; use Illuminate\Contracts\Config\Repository as Config; use GuzzleHttp\Client; use Illuminate\Notifications\Notification; /** * Class FirebaseChannel * @package DouglasResende\FCM\Channels */ class FirebaseChannel { /** * @const api uri */ const API_URI = 'https://fcm.googleapis.com/fcm/send'; /** * @var Client */ private $client; /** * @var Config */ private $config; /** * FirebaseChannel constructor. * @param Client $client * @param Config $config */ public function __construct(Client $client, Config $config) { $this->client = $client; $this->config = $config; } /** * @param $notifiable * @param Notification $notification */ public function send($notifiable, Notification $notification) { $message = $notification->toFCM($notifiable, new FirebaseMessage); $this->client->post(FirebaseChannel::API_URI, [ 'headers' => [ 'Authorization' => 'key=' . $this->getApiKey(), 'Content-Type' => 'application/json', ], 'body' => $message->serialize(), ]); } /** * @return mixed */ private function getApiKey() { return $this->config->get('services.fcm.key'); } }
Remove dependency on FirebaseNotification Contract
Remove dependency on FirebaseNotification Contract
PHP
mit
douglasresendemaciel/fcm-laravel-notification
php
## Code Before: <?php namespace DouglasResende\FCM\Channels; use DouglasResende\FCM\Messages\FirebaseMessage; use Illuminate\Contracts\Config\Repository as Config; use GuzzleHttp\Client; use DouglasResende\FCM\Contracts\FirebaseNotification as Notification; /** * Class FirebaseChannel * @package DouglasResende\FCM\Channels */ class FirebaseChannel { /** * @const api uri */ const API_URI = 'https://fcm.googleapis.com/fcm/send'; /** * @var Client */ private $client; /** * @var Config */ private $config; /** * FirebaseChannel constructor. * @param Client $client * @param Config $config */ public function __construct(Client $client, Config $config) { $this->client = $client; $this->config = $config; } /** * @param $notifiable * @param Notification $notification */ public function send($notifiable, Notification $notification) { $message = $notification->toFCM($notifiable, new FirebaseMessage); $this->client->post(FirebaseChannel::API_URI, [ 'headers' => [ 'Authorization' => 'key=' . $this->getApiKey(), 'Content-Type' => 'application/json', ], 'body' => $message->serialize(), ]); } /** * @return mixed */ private function getApiKey() { return $this->config->get('services.fcm.key'); } } ## Instruction: Remove dependency on FirebaseNotification Contract ## Code After: <?php namespace DouglasResende\FCM\Channels; use DouglasResende\FCM\Messages\FirebaseMessage; use Illuminate\Contracts\Config\Repository as Config; use GuzzleHttp\Client; use Illuminate\Notifications\Notification; /** * Class FirebaseChannel * @package DouglasResende\FCM\Channels */ class FirebaseChannel { /** * @const api uri */ const API_URI = 'https://fcm.googleapis.com/fcm/send'; /** * @var Client */ private $client; /** * @var Config */ private $config; /** * FirebaseChannel constructor. * @param Client $client * @param Config $config */ public function __construct(Client $client, Config $config) { $this->client = $client; $this->config = $config; } /** * @param $notifiable * @param Notification $notification */ public function send($notifiable, Notification $notification) { $message = $notification->toFCM($notifiable, new FirebaseMessage); $this->client->post(FirebaseChannel::API_URI, [ 'headers' => [ 'Authorization' => 'key=' . $this->getApiKey(), 'Content-Type' => 'application/json', ], 'body' => $message->serialize(), ]); } /** * @return mixed */ private function getApiKey() { return $this->config->get('services.fcm.key'); } }
184d0753b1743eafa1044f99831d14297871a7ce
_config.yml
_config.yml
name: Arch Linux 臺灣社群 name_en: Arch Linux Taiwan Community url: http://archlinux.tw markdown: redcarpet highlighter: 'pygments' timezone: 'Asia/Taipei' exclude: ['Gemfile', 'Gemfile.lock', 'AUTHORS', 'LICENSE', 'NOTICE', 'README.md', 'CHRONICLES.md', 'config.rb', 'build.sh', 'bootstrap'] rss_post_limit: 10 paginate: 5 paginate_path: "news/page:num"
name: Arch Linux 臺灣社群 name_en: Arch Linux Taiwan Community url: http://archlinux.tw markdown: redcarpet highlighter: 'pygments' timezone: 'Asia/Taipei' exclude: ['Gemfile', 'Gemfile.lock', 'AUTHORS', 'LICENSE', 'NOTICE', 'README.md', 'CHRONICLES.md', 'config.rb', 'build.sh'] keep_files: ['bootstrap'] rss_post_limit: 10 paginate: 5 paginate_path: "news/page:num"
Fix Twitter Bootstrap submodule locating
Fix Twitter Bootstrap submodule locating Signed-off-by: Huei-Horng Yo <[email protected]>
YAML
mit
hiroshiyui/arch.linux.org.tw,xatier/arch.linux.org.tw,xatier/arch.linux.org.tw,xatier/arch.linux.org.tw,hiroshiyui/arch.linux.org.tw,linux-taiwan/arch.linux.org.tw,hiroshiyui/arch.linux.org.tw,linux-taiwan/arch.linux.org.tw,hiroshiyui/arch.linux.org.tw,linux-taiwan/arch.linux.org.tw,linux-taiwan/arch.linux.org.tw,xatier/arch.linux.org.tw
yaml
## Code Before: name: Arch Linux 臺灣社群 name_en: Arch Linux Taiwan Community url: http://archlinux.tw markdown: redcarpet highlighter: 'pygments' timezone: 'Asia/Taipei' exclude: ['Gemfile', 'Gemfile.lock', 'AUTHORS', 'LICENSE', 'NOTICE', 'README.md', 'CHRONICLES.md', 'config.rb', 'build.sh', 'bootstrap'] rss_post_limit: 10 paginate: 5 paginate_path: "news/page:num" ## Instruction: Fix Twitter Bootstrap submodule locating Signed-off-by: Huei-Horng Yo <[email protected]> ## Code After: name: Arch Linux 臺灣社群 name_en: Arch Linux Taiwan Community url: http://archlinux.tw markdown: redcarpet highlighter: 'pygments' timezone: 'Asia/Taipei' exclude: ['Gemfile', 'Gemfile.lock', 'AUTHORS', 'LICENSE', 'NOTICE', 'README.md', 'CHRONICLES.md', 'config.rb', 'build.sh'] keep_files: ['bootstrap'] rss_post_limit: 10 paginate: 5 paginate_path: "news/page:num"
f16e910dd2a83f1b51153b8904be5f25a3884376
lib/puppet/type/java_ks.rb
lib/puppet/type/java_ks.rb
module Puppet newtype(:java_ks) do @doc = 'Manages entries in a java keystore.' ensurable do newvalue(:present) do provider.create end newvalue(:absent) do provider.destroy end newvalue(:latest) do if provider.exists? provider.update else provider.create end end def insync?(is) @should.each do |should| case should when :present return true if is == :present when :absent return true if is == :absent when :latest unless is == :absent return true if provider.latest == provider.current end end end false end defaultto :present end newparam(:name) do desc '' isnamevar munge do |value| value.downcase end end newparam(:target) do desc '' isnamevar end newparam(:certificate) do desc '' end newparam(:private_key) do desc '' end newparam(:password) do desc '' end newparam(:trustcacerts) do desc '' end def self.title_patterns identity = lambda {|x| x} [[ /^(.*):(.*)$/, [ [ :name, identity ], [ :target, identity ] ] ]] end end end
module Puppet newtype(:java_ks) do @doc = 'Manages entries in a java keystore.' ensurable do newvalue(:present) do provider.create end newvalue(:absent) do provider.destroy end newvalue(:latest) do if provider.exists? provider.update else provider.create end end def insync?(is) @should.each do |should| case should when :present return true if is == :present when :absent return true if is == :absent when :latest unless is == :absent return true if provider.latest == provider.current end end end false end defaultto :present end newparam(:name) do desc '' isnamevar munge do |value| value.downcase end end newparam(:target) do desc '' isnamevar end newparam(:certificate) do desc '' end newparam(:private_key) do desc '' end newparam(:password) do desc '' end newparam(:trustcacerts) do desc '' end autorequire(:file) do auto_requires = [] [:private_key, :certificate].each do |param| if @parameters.include?(param) auto_requires << @parameters[param].value end end if @parameters.include(:target) auto_requires << ::File.dirname(@parameters[:target].value) end auto_requires end def self.title_patterns identity = lambda {|x| x} [[ /^(.*):(.*)$/, [ [ :name, identity ], [ :target, identity ] ] ]] end end end
Add autorequires for file resources.
Add autorequires for file resources. This patch sets up dependancies on file resources for private_key, certificate, and target's directory. Before this you had to do it yourself.
Ruby
apache-2.0
synyx/puppet-keytool,arthurbarton/puppetlabs-java_ks
ruby
## Code Before: module Puppet newtype(:java_ks) do @doc = 'Manages entries in a java keystore.' ensurable do newvalue(:present) do provider.create end newvalue(:absent) do provider.destroy end newvalue(:latest) do if provider.exists? provider.update else provider.create end end def insync?(is) @should.each do |should| case should when :present return true if is == :present when :absent return true if is == :absent when :latest unless is == :absent return true if provider.latest == provider.current end end end false end defaultto :present end newparam(:name) do desc '' isnamevar munge do |value| value.downcase end end newparam(:target) do desc '' isnamevar end newparam(:certificate) do desc '' end newparam(:private_key) do desc '' end newparam(:password) do desc '' end newparam(:trustcacerts) do desc '' end def self.title_patterns identity = lambda {|x| x} [[ /^(.*):(.*)$/, [ [ :name, identity ], [ :target, identity ] ] ]] end end end ## Instruction: Add autorequires for file resources. This patch sets up dependancies on file resources for private_key, certificate, and target's directory. Before this you had to do it yourself. ## Code After: module Puppet newtype(:java_ks) do @doc = 'Manages entries in a java keystore.' ensurable do newvalue(:present) do provider.create end newvalue(:absent) do provider.destroy end newvalue(:latest) do if provider.exists? provider.update else provider.create end end def insync?(is) @should.each do |should| case should when :present return true if is == :present when :absent return true if is == :absent when :latest unless is == :absent return true if provider.latest == provider.current end end end false end defaultto :present end newparam(:name) do desc '' isnamevar munge do |value| value.downcase end end newparam(:target) do desc '' isnamevar end newparam(:certificate) do desc '' end newparam(:private_key) do desc '' end newparam(:password) do desc '' end newparam(:trustcacerts) do desc '' end autorequire(:file) do auto_requires = [] [:private_key, :certificate].each do |param| if @parameters.include?(param) auto_requires << @parameters[param].value end end if @parameters.include(:target) auto_requires << ::File.dirname(@parameters[:target].value) end auto_requires end def self.title_patterns identity = lambda {|x| x} [[ /^(.*):(.*)$/, [ [ :name, identity ], [ :target, identity ] ] ]] end end end
8418da4072b1579a7b51c13468bc36d0c2335255
src/condor_ckpt/machdep.h
src/condor_ckpt/machdep.h
extern "C" int brk( void * ); extern "C" void *sbrk( int ); typedef void (*SIG_HANDLER)(); #elif defined(ULTRIX43) extern "C" char *brk( char * ); extern "C" char *sbrk( int ); typedef void (*SIG_HANDLER)(); #elif defined(SUNOS41) extern "C" int brk( void * ); extern "C" void *sbrk( int ); typedef void (*SIG_HANDLER)(); #elif defined(OSF1) extern "C" int brk( void * ); # include <sys/types.h> extern "C" void *sbrk( ssize_t ); typedef void (*SIG_HANDLER)( int ); #elif defined(HPUX9) extern "C" int brk( const void * ); extern "C" void *sbrk( int ); # include <signal.h> typedef void (*SIG_HANDLER)( __harg ); #else # error UNKNOWN PLATFORM #endif
extern "C" int brk( void * ); extern "C" void *sbrk( int ); typedef void (*SIG_HANDLER)(); #elif defined(ULTRIX43) extern "C" char *brk( char * ); extern "C" char *sbrk( int ); typedef void (*SIG_HANDLER)(); #elif defined(SUNOS41) extern "C" int brk( void * ); extern "C" void *sbrk( int ); typedef void (*SIG_HANDLER)(); #elif defined(OSF1) extern "C" int brk( void * ); # include <sys/types.h> extern "C" void *sbrk( ssize_t ); typedef void (*SIG_HANDLER)( int ); #elif defined(HPUX9) extern "C" int brk( const void * ); extern "C" void *sbrk( int ); # include <signal.h> typedef void (*SIG_HANDLER)( __harg ); #elif defined(AIX32) extern "C" int brk( void * ); extern "C" void *sbrk( int ); typedef void (*SIG_HANDLER)( int ); #else # error UNKNOWN PLATFORM #endif
Add definitions for AIX 3.2.
Add definitions for AIX 3.2.
C
apache-2.0
bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,djw8605/condor,mambelli/osg-bosco-marco,djw8605/htcondor,neurodebian/htcondor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,djw8605/condor,neurodebian/htcondor,htcondor/htcondor,mambelli/osg-bosco-marco,clalancette/condor-dcloud,neurodebian/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,zhangzhehust/htcondor,htcondor/htcondor,clalancette/condor-dcloud,djw8605/condor,bbockelm/condor-network-accounting,neurodebian/htcondor,mambelli/osg-bosco-marco,clalancette/condor-dcloud,clalancette/condor-dcloud,htcondor/htcondor,clalancette/condor-dcloud,neurodebian/htcondor,zhangzhehust/htcondor,zhangzhehust/htcondor,djw8605/htcondor,htcondor/htcondor,bbockelm/condor-network-accounting,neurodebian/htcondor,mambelli/osg-bosco-marco,htcondor/htcondor,djw8605/condor,djw8605/condor,djw8605/htcondor,neurodebian/htcondor,djw8605/htcondor,djw8605/condor,bbockelm/condor-network-accounting,djw8605/condor,djw8605/htcondor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,htcondor/htcondor,djw8605/htcondor,zhangzhehust/htcondor,htcondor/htcondor,clalancette/condor-dcloud,zhangzhehust/htcondor,djw8605/htcondor,mambelli/osg-bosco-marco,djw8605/htcondor,neurodebian/htcondor,bbockelm/condor-network-accounting,djw8605/htcondor,djw8605/condor,htcondor/htcondor,clalancette/condor-dcloud
c
## Code Before: extern "C" int brk( void * ); extern "C" void *sbrk( int ); typedef void (*SIG_HANDLER)(); #elif defined(ULTRIX43) extern "C" char *brk( char * ); extern "C" char *sbrk( int ); typedef void (*SIG_HANDLER)(); #elif defined(SUNOS41) extern "C" int brk( void * ); extern "C" void *sbrk( int ); typedef void (*SIG_HANDLER)(); #elif defined(OSF1) extern "C" int brk( void * ); # include <sys/types.h> extern "C" void *sbrk( ssize_t ); typedef void (*SIG_HANDLER)( int ); #elif defined(HPUX9) extern "C" int brk( const void * ); extern "C" void *sbrk( int ); # include <signal.h> typedef void (*SIG_HANDLER)( __harg ); #else # error UNKNOWN PLATFORM #endif ## Instruction: Add definitions for AIX 3.2. ## Code After: extern "C" int brk( void * ); extern "C" void *sbrk( int ); typedef void (*SIG_HANDLER)(); #elif defined(ULTRIX43) extern "C" char *brk( char * ); extern "C" char *sbrk( int ); typedef void (*SIG_HANDLER)(); #elif defined(SUNOS41) extern "C" int brk( void * ); extern "C" void *sbrk( int ); typedef void (*SIG_HANDLER)(); #elif defined(OSF1) extern "C" int brk( void * ); # include <sys/types.h> extern "C" void *sbrk( ssize_t ); typedef void (*SIG_HANDLER)( int ); #elif defined(HPUX9) extern "C" int brk( const void * ); extern "C" void *sbrk( int ); # include <signal.h> typedef void (*SIG_HANDLER)( __harg ); #elif defined(AIX32) extern "C" int brk( void * ); extern "C" void *sbrk( int ); typedef void (*SIG_HANDLER)( int ); #else # error UNKNOWN PLATFORM #endif
40681d1553455e5ccd2b749808203dd39cf26452
README.md
README.md
This benchmark compares gRPC, Aeron and KryoNet. ![img](results/20161024/ping-pong.png) ![img](results/20161024/price-stream.png) Please see the [latest results](https://github.com/benalexau/rpc-bench/blob/master/results/20161024/README.md).
[![Build Status](https://travis-ci.org/benalexau/rpc-bench.svg?branch=master)](https://travis-ci.org/benalexau/rpc-bench) [![License](https://img.shields.io/hexpm/l/plug.svg?maxAge=2592000)](http://www.apache.org/licenses/LICENSE-2.0.txt) # RPC Benchmark This benchmark compares gRPC, Aeron and KryoNet. ![img](results/20161024/ping-pong.png) ![img](results/20161024/price-stream.png) Please see the [latest results](https://github.com/benalexau/rpc-bench/blob/master/results/20161024/README.md).
Add badge for Travis CI status
Add badge for Travis CI status
Markdown
apache-2.0
benalexau/rpc-bench
markdown
## Code Before: This benchmark compares gRPC, Aeron and KryoNet. ![img](results/20161024/ping-pong.png) ![img](results/20161024/price-stream.png) Please see the [latest results](https://github.com/benalexau/rpc-bench/blob/master/results/20161024/README.md). ## Instruction: Add badge for Travis CI status ## Code After: [![Build Status](https://travis-ci.org/benalexau/rpc-bench.svg?branch=master)](https://travis-ci.org/benalexau/rpc-bench) [![License](https://img.shields.io/hexpm/l/plug.svg?maxAge=2592000)](http://www.apache.org/licenses/LICENSE-2.0.txt) # RPC Benchmark This benchmark compares gRPC, Aeron and KryoNet. ![img](results/20161024/ping-pong.png) ![img](results/20161024/price-stream.png) Please see the [latest results](https://github.com/benalexau/rpc-bench/blob/master/results/20161024/README.md).
4b782555199a6b797b610a84691d11042da0e7db
src/components/HomePage.js
src/components/HomePage.js
import React from 'react'; import { Link } from 'react-router'; import DatesPage from './DatesPage'; function weeks_between(date1, date2) { const ONE_WEEK = 1000 * 60 * 60 * 24 * 7; const date1_ms = date1.getTime(); const date2_ms = date2.getTime(); const difference_ms = Math.abs(date1_ms - date2_ms); return Math.floor(difference_ms / ONE_WEEK); } function days_between(date1, date2) { const ONE_DAY = 1000 * 60 * 60 * 24; const date1_ms = date1.getTime(); const date2_ms = date2.getTime(); const difference_ms = Math.abs(date1_ms - date2_ms); return Math.floor(difference_ms / ONE_DAY); } function months_between(date1, date2) { let months = date2.getMonth() - date1.getMonth() + (12 * (date2.getFullYear() - date1.getFullYear())); if (date2.getDate() < date1.getDate()) { months--; } return months; } const HomePage = () => { const natka = new Date("2016-11-03T18:40:00"); const days = days_between(natka, new Date()); const weeks = weeks_between(natka, new Date()); const months = months_between(natka, new Date()); return ( <div> <h1>Days since Natka was born: {days}</h1> <h1>Weeks since Natka was born: {weeks}</h1> <h1>Months since Natka was born: {months}</h1> <DatesPage /> </div> ); }; export default HomePage;
import React from 'react'; import { Link } from 'react-router'; import DatesPage from './DatesPage'; import moment from 'moment'; const HomePage = () => { const natka = moment([2016, 10, 3]); const days = moment().diff(natka, 'days'); const weeks = moment().diff(natka, 'weeks'); const months = moment().diff(natka, 'months'); return ( <div> <h1>Days since Natka was born: {days}</h1> <h1>Weeks since Natka was born: {weeks}</h1> <h1>Months since Natka was born: {months}</h1> <DatesPage /> </div> ); }; export default HomePage;
Use moment lib to get diifs
Use moment lib to get diifs
JavaScript
mit
gregorysl/date-minder,gregorysl/date-minder
javascript
## Code Before: import React from 'react'; import { Link } from 'react-router'; import DatesPage from './DatesPage'; function weeks_between(date1, date2) { const ONE_WEEK = 1000 * 60 * 60 * 24 * 7; const date1_ms = date1.getTime(); const date2_ms = date2.getTime(); const difference_ms = Math.abs(date1_ms - date2_ms); return Math.floor(difference_ms / ONE_WEEK); } function days_between(date1, date2) { const ONE_DAY = 1000 * 60 * 60 * 24; const date1_ms = date1.getTime(); const date2_ms = date2.getTime(); const difference_ms = Math.abs(date1_ms - date2_ms); return Math.floor(difference_ms / ONE_DAY); } function months_between(date1, date2) { let months = date2.getMonth() - date1.getMonth() + (12 * (date2.getFullYear() - date1.getFullYear())); if (date2.getDate() < date1.getDate()) { months--; } return months; } const HomePage = () => { const natka = new Date("2016-11-03T18:40:00"); const days = days_between(natka, new Date()); const weeks = weeks_between(natka, new Date()); const months = months_between(natka, new Date()); return ( <div> <h1>Days since Natka was born: {days}</h1> <h1>Weeks since Natka was born: {weeks}</h1> <h1>Months since Natka was born: {months}</h1> <DatesPage /> </div> ); }; export default HomePage; ## Instruction: Use moment lib to get diifs ## Code After: import React from 'react'; import { Link } from 'react-router'; import DatesPage from './DatesPage'; import moment from 'moment'; const HomePage = () => { const natka = moment([2016, 10, 3]); const days = moment().diff(natka, 'days'); const weeks = moment().diff(natka, 'weeks'); const months = moment().diff(natka, 'months'); return ( <div> <h1>Days since Natka was born: {days}</h1> <h1>Weeks since Natka was born: {weeks}</h1> <h1>Months since Natka was born: {months}</h1> <DatesPage /> </div> ); }; export default HomePage;
5eb55023030d34902f4af9e063875554a349c945
core/app/mailers/spree/carton_mailer.rb
core/app/mailers/spree/carton_mailer.rb
module Spree class CartonMailer < BaseMailer # Send an email to customers to notify that an individual carton has been # shipped. If a carton contains items from multiple orders then this will be # called with that carton one time for each order. # # @param carton [Spree::Carton] the shipped carton # @param order [Spree::Order] one of the orders with items in the carton # @param resend [Boolean] indicates whether the email is a 'resend' (e.g. # triggered by the admin "resend" button) # @return [Mail::Message] # # Note: The signature of this method has changed. The new (non-deprecated) # signature is: # def shipped_email(carton:, order:, resend: false) def shipped_email(options, _deprecated_options = {}) @order = options.fetch(:order) @carton = options.fetch(:carton) @manifest = @carton.manifest_for_order(@order) options = { resend: false }.merge(options) @store = @order.store subject = (options[:resend] ? "[#{t('spree.resend').upcase}] " : '') subject += "#{@store.name} #{t('spree.shipment_mailer.shipped_email.subject')} ##{@order.number}" mail(to: @order.email, from: from_address(@store), subject: subject) end end end
module Spree class CartonMailer < BaseMailer # Send an email to customers to notify that an individual carton has been # shipped. If a carton contains items from multiple orders then this will be # called with that carton one time for each order. # # @option options carton [Spree::Carton] the shipped carton # @option options order [Spree::Order] one of the orders with items in the carton # @option options resend [Boolean] indicates whether the email is a 'resend' (e.g. # triggered by the admin "resend" button) # @return [Mail::Message] # # Note: The signature of this method has changed. The new (non-deprecated) # signature is: # def shipped_email(carton:, order:, resend: false) def shipped_email(options, _deprecated_options = {}) @order = options.fetch(:order) @carton = options.fetch(:carton) @manifest = @carton.manifest_for_order(@order) options = { resend: false }.merge(options) @store = @order.store subject = (options[:resend] ? "[#{t('spree.resend').upcase}] " : '') subject += "#{@store.name} #{t('spree.shipment_mailer.shipped_email.subject')} ##{@order.number}" mail(to: @order.email, from: from_address(@store), subject: subject) end end end
Fix yard doc of carton mailer
Fix yard doc of carton mailer
Ruby
bsd-3-clause
pervino/solidus,pervino/solidus,pervino/solidus,pervino/solidus
ruby
## Code Before: module Spree class CartonMailer < BaseMailer # Send an email to customers to notify that an individual carton has been # shipped. If a carton contains items from multiple orders then this will be # called with that carton one time for each order. # # @param carton [Spree::Carton] the shipped carton # @param order [Spree::Order] one of the orders with items in the carton # @param resend [Boolean] indicates whether the email is a 'resend' (e.g. # triggered by the admin "resend" button) # @return [Mail::Message] # # Note: The signature of this method has changed. The new (non-deprecated) # signature is: # def shipped_email(carton:, order:, resend: false) def shipped_email(options, _deprecated_options = {}) @order = options.fetch(:order) @carton = options.fetch(:carton) @manifest = @carton.manifest_for_order(@order) options = { resend: false }.merge(options) @store = @order.store subject = (options[:resend] ? "[#{t('spree.resend').upcase}] " : '') subject += "#{@store.name} #{t('spree.shipment_mailer.shipped_email.subject')} ##{@order.number}" mail(to: @order.email, from: from_address(@store), subject: subject) end end end ## Instruction: Fix yard doc of carton mailer ## Code After: module Spree class CartonMailer < BaseMailer # Send an email to customers to notify that an individual carton has been # shipped. If a carton contains items from multiple orders then this will be # called with that carton one time for each order. # # @option options carton [Spree::Carton] the shipped carton # @option options order [Spree::Order] one of the orders with items in the carton # @option options resend [Boolean] indicates whether the email is a 'resend' (e.g. # triggered by the admin "resend" button) # @return [Mail::Message] # # Note: The signature of this method has changed. The new (non-deprecated) # signature is: # def shipped_email(carton:, order:, resend: false) def shipped_email(options, _deprecated_options = {}) @order = options.fetch(:order) @carton = options.fetch(:carton) @manifest = @carton.manifest_for_order(@order) options = { resend: false }.merge(options) @store = @order.store subject = (options[:resend] ? "[#{t('spree.resend').upcase}] " : '') subject += "#{@store.name} #{t('spree.shipment_mailer.shipped_email.subject')} ##{@order.number}" mail(to: @order.email, from: from_address(@store), subject: subject) end end end
198b12b992be72288fb63816e978b45d78680289
src/test/resources/testng.xml
src/test/resources/testng.xml
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > <suite name="jenjin-io" verbose="1" > <test name="io"> <packages> <package name="com.jenjinstudios.io" /> </packages> </test> </suite>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > <suite name="jenjin-io" verbose="1" > <test name="io"> <packages> <package name="com.jenjinstudios.io" /> </packages> </test> <test name="serialization" verbose="1" > <packages> <package name="com.jenjinstudios.io.serialization"/> </packages> </test> </suite>
Add test for serialization package
Add test for serialization package
XML
mit
floralvikings/jenjin-io
xml
## Code Before: <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > <suite name="jenjin-io" verbose="1" > <test name="io"> <packages> <package name="com.jenjinstudios.io" /> </packages> </test> </suite> ## Instruction: Add test for serialization package ## Code After: <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > <suite name="jenjin-io" verbose="1" > <test name="io"> <packages> <package name="com.jenjinstudios.io" /> </packages> </test> <test name="serialization" verbose="1" > <packages> <package name="com.jenjinstudios.io.serialization"/> </packages> </test> </suite>
19aaa32a846e66e50270963aa85ae80c0ed35b38
roles/db/tasks/main.yml
roles/db/tasks/main.yml
--- - name: Install PostgreSQL apt: name={{ item }} update_cache={{ update_apt_cache }} state=installed with_items: - postgresql - postgresql-contrib - libpq-dev - python-psycopg2 tags: packages - name: Ensure the PostgreSQL service is running service: name=postgresql state=started enabled=yes - name: Ensure database is created sudo_user: postgres postgresql_db: db={{ db_name }} state=present - name: Ensure user has access to the database sudo_user: postgres postgresql_user: db={{ db_name }} name={{ db_user }} password={{ db_password }} priv=ALL state=present - name: Ensure user does not have unnecessary privileges sudo_user: postgres postgresql_user: name={{ db_user }} role_attr_flags=NOSUPERUSER,NOCREATEDB state=present
--- - name: Install PostgreSQL apt: name={{ item }} update_cache={{ update_apt_cache }} state=installed with_items: - postgresql - postgresql-contrib - libpq-dev - python-psycopg2 tags: packages - name: Ensure the PostgreSQL service is running service: name=postgresql state=started enabled=yes - name: Ensure database is created sudo_user: postgres postgresql_db: db={{ db_name }} state=present - name: Ensure database is created sudo_user: postgres postgresql_db: name={{ db_name }} encoding='UTF-8' lc_collate='en_US.UTF-8' lc_ctype='en_US.UTF-8' template='template0' state=present - name: Ensure user does not have unnecessary privileges sudo_user: postgres postgresql_user: name={{ db_user }} role_attr_flags=NOSUPERUSER,NOCREATEDB state=present
Use UTF8 when creating the database.
Use UTF8 when creating the database.
YAML
mit
YPCrumble/ansible-django-stack,jcalazan/ansible-django-stack,jcalazan/ansible-django-stack,DavidCain/mitoc-ansible,DavidCain/mitoc-ansible,jcalazan/ansible-django-stack,YPCrumble/ansible-django-stack,DavidCain/mitoc-ansible,YPCrumble/ansible-django-stack
yaml
## Code Before: --- - name: Install PostgreSQL apt: name={{ item }} update_cache={{ update_apt_cache }} state=installed with_items: - postgresql - postgresql-contrib - libpq-dev - python-psycopg2 tags: packages - name: Ensure the PostgreSQL service is running service: name=postgresql state=started enabled=yes - name: Ensure database is created sudo_user: postgres postgresql_db: db={{ db_name }} state=present - name: Ensure user has access to the database sudo_user: postgres postgresql_user: db={{ db_name }} name={{ db_user }} password={{ db_password }} priv=ALL state=present - name: Ensure user does not have unnecessary privileges sudo_user: postgres postgresql_user: name={{ db_user }} role_attr_flags=NOSUPERUSER,NOCREATEDB state=present ## Instruction: Use UTF8 when creating the database. ## Code After: --- - name: Install PostgreSQL apt: name={{ item }} update_cache={{ update_apt_cache }} state=installed with_items: - postgresql - postgresql-contrib - libpq-dev - python-psycopg2 tags: packages - name: Ensure the PostgreSQL service is running service: name=postgresql state=started enabled=yes - name: Ensure database is created sudo_user: postgres postgresql_db: db={{ db_name }} state=present - name: Ensure database is created sudo_user: postgres postgresql_db: name={{ db_name }} encoding='UTF-8' lc_collate='en_US.UTF-8' lc_ctype='en_US.UTF-8' template='template0' state=present - name: Ensure user does not have unnecessary privileges sudo_user: postgres postgresql_user: name={{ db_user }} role_attr_flags=NOSUPERUSER,NOCREATEDB state=present
fd94a11a0bb27f7686d175a6e620810ec8c2e236
bin/generate/design.rb
bin/generate/design.rb
<% clock = aModuleInfo.clock_port.name rescue "YOUR_CLOCK_SIGNAL_HERE" %> # Simulates the design under test for one clock cycle. def DUT.cycle! <%= clock %>.high! advance_time <%= clock %>.low! advance_time end <% reset = aModuleInfo.reset_port.name rescue "YOUR_RESET_SIGNAL_HERE" %> # Brings the design under test into a blank state. def DUT.reset! <%= reset %>.high! cycle! <%= reset %>.low! end
<% clock = aModuleInfo.clock_port.name rescue "YOUR_CLOCK_SIGNAL_HERE" %> # Simulates the design under test for one clock cycle. def DUT.cycle! <%= clock %>.t! advance_time <%= clock %>.f! advance_time end <% reset = aModuleInfo.reset_port.name rescue "YOUR_RESET_SIGNAL_HERE" %> # Brings the design under test into a blank state. def DUT.reset! <%= reset %>.t! cycle! <%= reset %>.f! end
Fix 'ArgumentError: "VpiHigh" is not a valid VPI property'
Fix 'ArgumentError: "VpiHigh" is not a valid VPI property' This is done by replacing .high! and .low! wigh .t! and .f! in generated *_design.rb files. This only affects generation of files using "ruby-vpi generate".
Ruby
isc
sunaku/ruby-vpi,sunaku/ruby-vpi
ruby
## Code Before: <% clock = aModuleInfo.clock_port.name rescue "YOUR_CLOCK_SIGNAL_HERE" %> # Simulates the design under test for one clock cycle. def DUT.cycle! <%= clock %>.high! advance_time <%= clock %>.low! advance_time end <% reset = aModuleInfo.reset_port.name rescue "YOUR_RESET_SIGNAL_HERE" %> # Brings the design under test into a blank state. def DUT.reset! <%= reset %>.high! cycle! <%= reset %>.low! end ## Instruction: Fix 'ArgumentError: "VpiHigh" is not a valid VPI property' This is done by replacing .high! and .low! wigh .t! and .f! in generated *_design.rb files. This only affects generation of files using "ruby-vpi generate". ## Code After: <% clock = aModuleInfo.clock_port.name rescue "YOUR_CLOCK_SIGNAL_HERE" %> # Simulates the design under test for one clock cycle. def DUT.cycle! <%= clock %>.t! advance_time <%= clock %>.f! advance_time end <% reset = aModuleInfo.reset_port.name rescue "YOUR_RESET_SIGNAL_HERE" %> # Brings the design under test into a blank state. def DUT.reset! <%= reset %>.t! cycle! <%= reset %>.f! end
244934a7ac6f5a0f565fc68e5a265d79f955d901
bin/custom_authenticate_ns_ldap.pl
bin/custom_authenticate_ns_ldap.pl
use strict; # use warning; # Custom modules use lib "/exlibris/primo/p3_1/pds/custom/lib"; use lib "/exlibris/primo/p3_1/pds/custom/vendor/lib"; # PDS program modules use lib "/exlibris/primo/p3_1/pds/program"; # NYU Libraries modules use NYU::Libraries::Util qw(parse_conf); use NYU::Libraries::PDS; # PDS Core modules use PDSUtil qw(getEnvironmentParams); use PDSParamUtil; sub custom_authenticate_ns_ldap { my ($session_id, $id, $password, $institute, $user_ip, $params) = @_; my $pds_directory = getEnvironmentParams('pds_directory'); my $conf = parse_conf("$pds_directory/config/nyu.conf"); my $calling_system = PDSParamUtil::getAndFilterParam('calling_system'); my $target_url = PDSParamUtil::queryUrl(); my $session_controller = NYU::Libraries::PDS::controller($conf, $institute, $calling_system, $target_url, $session_id); $session_controller->authenticate_ns_ldap($id, $password); }
use strict; # use warning; # Custom modules use lib "/exlibris/primo/p3_1/pds/custom/lib"; use lib "/exlibris/primo/p3_1/pds/custom/vendor/lib"; # PDS program modules use lib "/exlibris/primo/p3_1/pds/program"; # NYU Libraries modules use NYU::Libraries::Util qw(parse_conf); use NYU::Libraries::PDS; # PDS Core modules use PDSUtil qw(getEnvironmentParams); use PDSParamUtil; sub custom_authenticate_ns_ldap { my ($session_id, $id, $password, $institute, $user_ip, $params) = @_; my $pds_directory = getEnvironmentParams('pds_directory'); my $conf = parse_conf("$pds_directory/config/nyu.conf"); my $calling_system = PDSParamUtil::getAndFilterParam('calling_system'); my $target_url = PDSParamUtil::queryUrl(); my $session_controller = NYU::Libraries::PDS::controller($conf, $institute, $calling_system, $target_url, $session_id); my $session = $session_controller->authenticate_ns_ldap($id, $password) return ($session_controller->error) ? ("11", "<error/>", $session_controller->error) : ("00", $session->to_xml); }
Update authentication and glue :rainbow:
Update authentication and glue :rainbow:
Perl
mit
NYULibraries/pds-custom
perl
## Code Before: use strict; # use warning; # Custom modules use lib "/exlibris/primo/p3_1/pds/custom/lib"; use lib "/exlibris/primo/p3_1/pds/custom/vendor/lib"; # PDS program modules use lib "/exlibris/primo/p3_1/pds/program"; # NYU Libraries modules use NYU::Libraries::Util qw(parse_conf); use NYU::Libraries::PDS; # PDS Core modules use PDSUtil qw(getEnvironmentParams); use PDSParamUtil; sub custom_authenticate_ns_ldap { my ($session_id, $id, $password, $institute, $user_ip, $params) = @_; my $pds_directory = getEnvironmentParams('pds_directory'); my $conf = parse_conf("$pds_directory/config/nyu.conf"); my $calling_system = PDSParamUtil::getAndFilterParam('calling_system'); my $target_url = PDSParamUtil::queryUrl(); my $session_controller = NYU::Libraries::PDS::controller($conf, $institute, $calling_system, $target_url, $session_id); $session_controller->authenticate_ns_ldap($id, $password); } ## Instruction: Update authentication and glue :rainbow: ## Code After: use strict; # use warning; # Custom modules use lib "/exlibris/primo/p3_1/pds/custom/lib"; use lib "/exlibris/primo/p3_1/pds/custom/vendor/lib"; # PDS program modules use lib "/exlibris/primo/p3_1/pds/program"; # NYU Libraries modules use NYU::Libraries::Util qw(parse_conf); use NYU::Libraries::PDS; # PDS Core modules use PDSUtil qw(getEnvironmentParams); use PDSParamUtil; sub custom_authenticate_ns_ldap { my ($session_id, $id, $password, $institute, $user_ip, $params) = @_; my $pds_directory = getEnvironmentParams('pds_directory'); my $conf = parse_conf("$pds_directory/config/nyu.conf"); my $calling_system = PDSParamUtil::getAndFilterParam('calling_system'); my $target_url = PDSParamUtil::queryUrl(); my $session_controller = NYU::Libraries::PDS::controller($conf, $institute, $calling_system, $target_url, $session_id); my $session = $session_controller->authenticate_ns_ldap($id, $password) return ($session_controller->error) ? ("11", "<error/>", $session_controller->error) : ("00", $session->to_xml); }
6dcb33004c3775d707f362a6f2c8217c1d558f56
kobin/server_adapters.py
kobin/server_adapters.py
from typing import Dict, Any class ServerAdapter: quiet = False def __init__(self, host: str='127.0.0.1', port: int=8080, **options) -> None: self.options = options self.host = host self.port = int(port) def run(self, handler): pass def __repr__(self): args = ', '.join(['%s=%s' % (k, repr(v)) for k, v in self.options.items()]) return "%s(%s)" % (self.__class__.__name__, args) class WSGIRefServer(ServerAdapter): def run(self, app): from wsgiref.simple_server import make_server # type: ignore self.httpd = make_server(self.host, self.port, app) self.port = self.httpd.server_port try: self.httpd.serve_forever() except KeyboardInterrupt: self.httpd.server_close() raise servers = { 'wsgiref': WSGIRefServer, } # type: Dict[str, Any]
from typing import Dict, Any class ServerAdapter: quiet = False def __init__(self, host: str='127.0.0.1', port: int=8080, **options) -> None: self.options = options self.host = host self.port = int(port) def run(self, handler): pass def __repr__(self): args = ', '.join(['%s=%s' % (k, repr(v)) for k, v in self.options.items()]) return "%s(%s)" % (self.__class__.__name__, args) class WSGIRefServer(ServerAdapter): def run(self, app): from wsgiref.simple_server import make_server # type: ignore self.httpd = make_server(self.host, self.port, app) self.port = self.httpd.server_port try: self.httpd.serve_forever() except KeyboardInterrupt: self.httpd.server_close() raise class GunicornServer(ServerAdapter): def run(self, handler): from gunicorn.app.base import Application config = {'bind': "%s:%d" % (self.host, int(self.port))} config.update(self.options) class GunicornApplication(Application): def init(self, parser, opts, args): return config def load(self): return handler GunicornApplication().run() servers = { 'wsgiref': WSGIRefServer, 'gunicorn': GunicornServer, } # type: Dict[str, Any]
Add a gunicorn server adpter
Add a gunicorn server adpter
Python
mit
kobinpy/kobin,kobinpy/kobin,c-bata/kobin,c-bata/kobin
python
## Code Before: from typing import Dict, Any class ServerAdapter: quiet = False def __init__(self, host: str='127.0.0.1', port: int=8080, **options) -> None: self.options = options self.host = host self.port = int(port) def run(self, handler): pass def __repr__(self): args = ', '.join(['%s=%s' % (k, repr(v)) for k, v in self.options.items()]) return "%s(%s)" % (self.__class__.__name__, args) class WSGIRefServer(ServerAdapter): def run(self, app): from wsgiref.simple_server import make_server # type: ignore self.httpd = make_server(self.host, self.port, app) self.port = self.httpd.server_port try: self.httpd.serve_forever() except KeyboardInterrupt: self.httpd.server_close() raise servers = { 'wsgiref': WSGIRefServer, } # type: Dict[str, Any] ## Instruction: Add a gunicorn server adpter ## Code After: from typing import Dict, Any class ServerAdapter: quiet = False def __init__(self, host: str='127.0.0.1', port: int=8080, **options) -> None: self.options = options self.host = host self.port = int(port) def run(self, handler): pass def __repr__(self): args = ', '.join(['%s=%s' % (k, repr(v)) for k, v in self.options.items()]) return "%s(%s)" % (self.__class__.__name__, args) class WSGIRefServer(ServerAdapter): def run(self, app): from wsgiref.simple_server import make_server # type: ignore self.httpd = make_server(self.host, self.port, app) self.port = self.httpd.server_port try: self.httpd.serve_forever() except KeyboardInterrupt: self.httpd.server_close() raise class GunicornServer(ServerAdapter): def run(self, handler): from gunicorn.app.base import Application config = {'bind': "%s:%d" % (self.host, int(self.port))} config.update(self.options) class GunicornApplication(Application): def init(self, parser, opts, args): return config def load(self): return handler GunicornApplication().run() servers = { 'wsgiref': WSGIRefServer, 'gunicorn': GunicornServer, } # type: Dict[str, Any]
a2adc67d83874a8a87282459c27f56c2e45bae29
.travis.yml
.travis.yml
language: go go: - 1.x # skip the install step. don't `go get` deps. only build with code in vendor/ install: true notifications: email: false # install linter before_script: - go install ./vendor/github.com/golangci/golangci-lint/cmd/golangci-lint script: - golangci-lint run - go test -v -race ./...
sudo: false language: go go: - 1.x # skip the install step. don't `go get` deps. only build with code in vendor/ install: true notifications: email: false # like script, but with set -e before_script: - go install ./vendor/github.com/golangci/golangci-lint/cmd/golangci-lint # like before_script, but with set +e script: - golangci-lint run - go test -v -race ./...
Use fast container-based test runner on Travis (sudo: false)
Use fast container-based test runner on Travis (sudo: false)
YAML
mit
y0ssar1an/qq,y0ssar1an/qq,y0ssar1an/q
yaml
## Code Before: language: go go: - 1.x # skip the install step. don't `go get` deps. only build with code in vendor/ install: true notifications: email: false # install linter before_script: - go install ./vendor/github.com/golangci/golangci-lint/cmd/golangci-lint script: - golangci-lint run - go test -v -race ./... ## Instruction: Use fast container-based test runner on Travis (sudo: false) ## Code After: sudo: false language: go go: - 1.x # skip the install step. don't `go get` deps. only build with code in vendor/ install: true notifications: email: false # like script, but with set -e before_script: - go install ./vendor/github.com/golangci/golangci-lint/cmd/golangci-lint # like before_script, but with set +e script: - golangci-lint run - go test -v -race ./...
e30e2cf3bc42e1f8b59048855909a7f341647dc7
src/parsers/guides/axis-domain.js
src/parsers/guides/axis-domain.js
import {Top, Bottom} from './constants'; import guideMark from './guide-mark'; import {RuleMark} from '../marks/marktypes'; import {AxisDomainRole} from '../marks/roles'; import {addEncode} from '../encode/encode-util'; export default function(spec, config, userEncode, dataRef) { var orient = spec.orient, zero = {value: 0}, encode = {}, enter, update, u, u2, v; encode.enter = enter = { opacity: zero }; addEncode(enter, 'stroke', config.tickColor); addEncode(enter, 'strokeWidth', config.tickWidth); encode.exit = { opacity: zero }; encode.update = update = { opacity: {value: 1} }; (orient === Top || orient === Bottom) ? (u = 'x', v = 'y') : (u = 'y', v = 'x'); u2 = u + '2', enter[v] = zero; update[u] = enter[u] = position(spec, 0); update[u2] = enter[u2] = position(spec, 1); return guideMark(RuleMark, AxisDomainRole, null, dataRef, encode, userEncode); } function position(spec, pos) { return {scale: spec.scale, range: pos}; }
import {Top, Bottom} from './constants'; import guideMark from './guide-mark'; import {RuleMark} from '../marks/marktypes'; import {AxisDomainRole} from '../marks/roles'; import {addEncode} from '../encode/encode-util'; export default function(spec, config, userEncode, dataRef) { var orient = spec.orient, zero = {value: 0}, encode = {}, enter, update, u, u2, v; encode.enter = enter = { opacity: zero }; addEncode(enter, 'stroke', config.domainColor); addEncode(enter, 'strokeWidth', config.domainWidth); encode.exit = { opacity: zero }; encode.update = update = { opacity: {value: 1} }; (orient === Top || orient === Bottom) ? (u = 'x', v = 'y') : (u = 'y', v = 'x'); u2 = u + '2', enter[v] = zero; update[u] = enter[u] = position(spec, 0); update[u2] = enter[u2] = position(spec, 1); return guideMark(RuleMark, AxisDomainRole, null, dataRef, encode, userEncode); } function position(spec, pos) { return {scale: spec.scale, range: pos}; }
Fix axis domain config lookup.
Fix axis domain config lookup.
JavaScript
bsd-3-clause
vega/vega-parser
javascript
## Code Before: import {Top, Bottom} from './constants'; import guideMark from './guide-mark'; import {RuleMark} from '../marks/marktypes'; import {AxisDomainRole} from '../marks/roles'; import {addEncode} from '../encode/encode-util'; export default function(spec, config, userEncode, dataRef) { var orient = spec.orient, zero = {value: 0}, encode = {}, enter, update, u, u2, v; encode.enter = enter = { opacity: zero }; addEncode(enter, 'stroke', config.tickColor); addEncode(enter, 'strokeWidth', config.tickWidth); encode.exit = { opacity: zero }; encode.update = update = { opacity: {value: 1} }; (orient === Top || orient === Bottom) ? (u = 'x', v = 'y') : (u = 'y', v = 'x'); u2 = u + '2', enter[v] = zero; update[u] = enter[u] = position(spec, 0); update[u2] = enter[u2] = position(spec, 1); return guideMark(RuleMark, AxisDomainRole, null, dataRef, encode, userEncode); } function position(spec, pos) { return {scale: spec.scale, range: pos}; } ## Instruction: Fix axis domain config lookup. ## Code After: import {Top, Bottom} from './constants'; import guideMark from './guide-mark'; import {RuleMark} from '../marks/marktypes'; import {AxisDomainRole} from '../marks/roles'; import {addEncode} from '../encode/encode-util'; export default function(spec, config, userEncode, dataRef) { var orient = spec.orient, zero = {value: 0}, encode = {}, enter, update, u, u2, v; encode.enter = enter = { opacity: zero }; addEncode(enter, 'stroke', config.domainColor); addEncode(enter, 'strokeWidth', config.domainWidth); encode.exit = { opacity: zero }; encode.update = update = { opacity: {value: 1} }; (orient === Top || orient === Bottom) ? (u = 'x', v = 'y') : (u = 'y', v = 'x'); u2 = u + '2', enter[v] = zero; update[u] = enter[u] = position(spec, 0); update[u2] = enter[u2] = position(spec, 1); return guideMark(RuleMark, AxisDomainRole, null, dataRef, encode, userEncode); } function position(spec, pos) { return {scale: spec.scale, range: pos}; }
0154da942d5d184f3fcd9294da2baee7d5702708
manifests/haproxy.yml
manifests/haproxy.yml
--- name: haproxy addons: - name: bpm jobs: - name: bpm release: bpm instance_groups: - name: haproxy azs: [z1] instances: 1 vm_type: default stemcell: default networks: [{name: default}] jobs: - name: haproxy release: haproxy properties: ha_proxy: backend_port: ((haproxy-backend-port)) backend_servers: ((haproxy-backend-servers)) update: canaries: 1 max_in_flight: 1 canary_watch_time: 1000-30000 update_watch_time: 1000-30000 serial: false stemcells: - alias: default os: ubuntu-xenial version: latest releases: - name: haproxy version: 9.4.0 url: https://github.com/cloudfoundry-incubator/haproxy-boshrelease/releases/download/v9.4.0/haproxy-9.4.0.tgz sha1: e873611c1c24a0044130319c3b2799b7068ff734 - name: bpm version: 1.0.0 url: https://github.com/cloudfoundry-incubator/bpm-release/releases/download/v1.0.0/bpm-release-1.0.0.tgz
--- name: haproxy addons: - name: bpm jobs: - name: bpm release: bpm instance_groups: - name: haproxy azs: [z1] instances: 1 vm_type: default stemcell: default networks: [{name: default}] jobs: - name: haproxy release: haproxy properties: ha_proxy: backend_port: ((haproxy-backend-port)) backend_servers: ((haproxy-backend-servers)) update: canaries: 1 max_in_flight: 1 canary_watch_time: 1000-30000 update_watch_time: 1000-30000 serial: false stemcells: - alias: default os: ubuntu-xenial version: latest releases: - name: bpm version: 1.0.0 url: https://github.com/cloudfoundry-incubator/bpm-release/releases/download/v1.0.0/bpm-release-1.0.0.tgz sha1: 42b95d4a0d6d15dd0b0ead62418ffb56208e2307 - name: haproxy version: 9.4.0 url: https://github.com/cloudfoundry-incubator/haproxy-boshrelease/releases/download/v9.4.0/haproxy-9.4.0.tgz sha1: e873611c1c24a0044130319c3b2799b7068ff734
Update manifest for compatibility with ci update-manifest script
Update manifest for compatibility with ci update-manifest script
YAML
apache-2.0
cloudfoundry-community/cf-haproxy-boshrelease,cloudfoundry-community/cf-haproxy-boshrelease,cloudfoundry-community/cf-haproxy-boshrelease
yaml
## Code Before: --- name: haproxy addons: - name: bpm jobs: - name: bpm release: bpm instance_groups: - name: haproxy azs: [z1] instances: 1 vm_type: default stemcell: default networks: [{name: default}] jobs: - name: haproxy release: haproxy properties: ha_proxy: backend_port: ((haproxy-backend-port)) backend_servers: ((haproxy-backend-servers)) update: canaries: 1 max_in_flight: 1 canary_watch_time: 1000-30000 update_watch_time: 1000-30000 serial: false stemcells: - alias: default os: ubuntu-xenial version: latest releases: - name: haproxy version: 9.4.0 url: https://github.com/cloudfoundry-incubator/haproxy-boshrelease/releases/download/v9.4.0/haproxy-9.4.0.tgz sha1: e873611c1c24a0044130319c3b2799b7068ff734 - name: bpm version: 1.0.0 url: https://github.com/cloudfoundry-incubator/bpm-release/releases/download/v1.0.0/bpm-release-1.0.0.tgz ## Instruction: Update manifest for compatibility with ci update-manifest script ## Code After: --- name: haproxy addons: - name: bpm jobs: - name: bpm release: bpm instance_groups: - name: haproxy azs: [z1] instances: 1 vm_type: default stemcell: default networks: [{name: default}] jobs: - name: haproxy release: haproxy properties: ha_proxy: backend_port: ((haproxy-backend-port)) backend_servers: ((haproxy-backend-servers)) update: canaries: 1 max_in_flight: 1 canary_watch_time: 1000-30000 update_watch_time: 1000-30000 serial: false stemcells: - alias: default os: ubuntu-xenial version: latest releases: - name: bpm version: 1.0.0 url: https://github.com/cloudfoundry-incubator/bpm-release/releases/download/v1.0.0/bpm-release-1.0.0.tgz sha1: 42b95d4a0d6d15dd0b0ead62418ffb56208e2307 - name: haproxy version: 9.4.0 url: https://github.com/cloudfoundry-incubator/haproxy-boshrelease/releases/download/v9.4.0/haproxy-9.4.0.tgz sha1: e873611c1c24a0044130319c3b2799b7068ff734
4cda4a912c3206fd566ab62772be33713f690611
README.md
README.md
A tiny script to generate a printable HTML page (with QR codes) to back up your TOTP secrets, [SSSS](https://en.wikipedia.org/wiki/Shamir%27s_Secret_Sharing) passphrase shards, etc. ## Usage bundle install echo 'foo: 12345678901234567890' | gpg --encrypt > my-secrets.yml.gpg bundle exec ./burn-after-reading my-secrets.yml.gpg open my-secrets.html ## Running Tests bundle exec rake test
A tiny script to generate a printable HTML page (with QR codes) to back up your TOTP secrets, [SSSS](https://en.wikipedia.org/wiki/Shamir%27s_Secret_Sharing) passphrase shards, etc. ## Usage bundle install # There are two options for encrypting the YAML data, choose one... # 1. Recommended: a private key in your keyring echo 'foo: 12345678901234567890' | gpg --encrypt --recipient USER_ID > my-secrets.yml.gpg # 2. Symmetric encryption with only a passphrase gpg -o my-secrets.yml.gpg --symmetric <(echo 'foo: 12345678901234567890') bundle exec ./burn-after-reading my-secrets.yml.gpg open my-secrets.html ## Running Tests bundle exec rake test
Fix gpg instructions, offer choice of key-pair or symmetric
Fix gpg instructions, offer choice of key-pair or symmetric
Markdown
mit
actblue/burn-after-reading,actblue/burn-after-reading
markdown
## Code Before: A tiny script to generate a printable HTML page (with QR codes) to back up your TOTP secrets, [SSSS](https://en.wikipedia.org/wiki/Shamir%27s_Secret_Sharing) passphrase shards, etc. ## Usage bundle install echo 'foo: 12345678901234567890' | gpg --encrypt > my-secrets.yml.gpg bundle exec ./burn-after-reading my-secrets.yml.gpg open my-secrets.html ## Running Tests bundle exec rake test ## Instruction: Fix gpg instructions, offer choice of key-pair or symmetric ## Code After: A tiny script to generate a printable HTML page (with QR codes) to back up your TOTP secrets, [SSSS](https://en.wikipedia.org/wiki/Shamir%27s_Secret_Sharing) passphrase shards, etc. ## Usage bundle install # There are two options for encrypting the YAML data, choose one... # 1. Recommended: a private key in your keyring echo 'foo: 12345678901234567890' | gpg --encrypt --recipient USER_ID > my-secrets.yml.gpg # 2. Symmetric encryption with only a passphrase gpg -o my-secrets.yml.gpg --symmetric <(echo 'foo: 12345678901234567890') bundle exec ./burn-after-reading my-secrets.yml.gpg open my-secrets.html ## Running Tests bundle exec rake test
4164f34fa499bc94a3a5a938701d090c6ec695af
app/static/custom/js/custom.js
app/static/custom/js/custom.js
function applyChanges(data, url, showResult) { var success = false; $.ajax({ type : "POST", url : url, data : JSON.stringify(data),// now data come in this function contentType : "application/json; charset=utf-8", crossDomain : true, dataType : "json", success : function(data, status, jqXHR) { console.log("Applied changes successfully.") if (showResult) { var modal = $("#modal_success"); modal.find('.modal-body p').text("Applied changes successfully"); modal.modal('show'); } }, error : function(jqXHR, status) { console.log(jqXHR); var modal = $("#modal_error"); modal.find('.modal-body p').text(jqXHR["responseText"]); modal.modal('show'); } }); }
function applyChanges(data, url, showResult) { var success = false; $.ajax({ type : "POST", url : url, data : JSON.stringify(data),// now data come in this function contentType : "application/json; charset=utf-8", crossDomain : true, dataType : "json", success : function(data, status, jqXHR) { console.log("Applied changes successfully.") if (showResult) { var modal = $("#modal_success"); modal.find('.modal-body p').text("Applied changes successfully"); modal.modal('show'); } }, error : function(jqXHR, status) { console.log(jqXHR); var modal = $("#modal_error"); modal.find('.modal-body p').text(jqXHR["responseText"]); modal.modal('show'); } }); } function getTableData(table) { var rData = [] // reformat - pretty format var records = [] table.rows().every(function() { var r = this.data(); var record = {} record["record_name"] = r[0].trim(); record["record_type"] = r[1].trim(); record["record_status"] = r[2].trim(); record["record_ttl"] = r[3].trim(); record["record_data"] = r[4].trim(); records.push(record); }); return records }
Add 'getDataTable' function from old template.
Add 'getDataTable' function from old template.
JavaScript
mit
ngoduykhanh/PowerDNS-Admin,ivanfilippov/PowerDNS-Admin,0x97/PowerDNS-Admin,CaptainQwark/PowerDNS-Admin,CaptainQwark/PowerDNS-Admin,ngoduykhanh/PowerDNS-Admin,0x97/PowerDNS-Admin,CaptainQwark/PowerDNS-Admin,ivanfilippov/PowerDNS-Admin,ngoduykhanh/PowerDNS-Admin,0x97/PowerDNS-Admin,ivanfilippov/PowerDNS-Admin,0x97/PowerDNS-Admin,ivanfilippov/PowerDNS-Admin,ngoduykhanh/PowerDNS-Admin,CaptainQwark/PowerDNS-Admin
javascript
## Code Before: function applyChanges(data, url, showResult) { var success = false; $.ajax({ type : "POST", url : url, data : JSON.stringify(data),// now data come in this function contentType : "application/json; charset=utf-8", crossDomain : true, dataType : "json", success : function(data, status, jqXHR) { console.log("Applied changes successfully.") if (showResult) { var modal = $("#modal_success"); modal.find('.modal-body p').text("Applied changes successfully"); modal.modal('show'); } }, error : function(jqXHR, status) { console.log(jqXHR); var modal = $("#modal_error"); modal.find('.modal-body p').text(jqXHR["responseText"]); modal.modal('show'); } }); } ## Instruction: Add 'getDataTable' function from old template. ## Code After: function applyChanges(data, url, showResult) { var success = false; $.ajax({ type : "POST", url : url, data : JSON.stringify(data),// now data come in this function contentType : "application/json; charset=utf-8", crossDomain : true, dataType : "json", success : function(data, status, jqXHR) { console.log("Applied changes successfully.") if (showResult) { var modal = $("#modal_success"); modal.find('.modal-body p').text("Applied changes successfully"); modal.modal('show'); } }, error : function(jqXHR, status) { console.log(jqXHR); var modal = $("#modal_error"); modal.find('.modal-body p').text(jqXHR["responseText"]); modal.modal('show'); } }); } function getTableData(table) { var rData = [] // reformat - pretty format var records = [] table.rows().every(function() { var r = this.data(); var record = {} record["record_name"] = r[0].trim(); record["record_type"] = r[1].trim(); record["record_status"] = r[2].trim(); record["record_ttl"] = r[3].trim(); record["record_data"] = r[4].trim(); records.push(record); }); return records }
6a677478e754b1e042356763ef2a52aa5525d8de
rust/run-length-encoding/src/lib.rs
rust/run-length-encoding/src/lib.rs
pub fn encode(text: &str) -> String { if text.is_empty() { return "".to_string(); } let mut last = text.chars().nth(0).unwrap(); let mut count = 0; let mut result = String::new(); for c in text.chars() { if c == last { count += 1; continue; } if count != 1 { result.push_str(&count.to_string()); } result.push(last); last = c; count = 1; } // deal with the last one if count != 1 { result.push_str(&count.to_string()); } result.push(last); result } pub fn decode(text: &str) -> String { let mut result = String::new(); let mut count = 0; for c in text.chars() { if !c.is_numeric() { if count < 2 { result.push(c); } else { result.push_str(&std::iter::repeat(c).take(count).collect::<String>()); } count = 0; continue; } count = count * 10 + c.to_digit(10).unwrap() as usize; } result }
pub fn encode(text: &str) -> String { let mut count = 0; let mut result = String::new(); let mut iter = text.chars().peekable(); while let Some(c) = iter.next() { count += 1; if iter.peek() != Some(&c) { if count > 1 { result.push_str(&count.to_string()); } result.push(c); count = 0; } } result } pub fn decode(text: &str) -> String { let mut count = 0; let mut result = String::new(); for c in text.chars() { if let Some(v) = c.to_digit(10) { count = count * 10 + v as usize; continue; } if count < 2 { result.push(c); } else { let s = std::iter::repeat(c).take(count).collect::<String>(); result.push_str(&s); } count = 0; } result }
Use peekable to simplify rust code for run-length-encoding
Use peekable to simplify rust code for run-length-encoding It is a good solution to check next element by peek function
Rust
bsd-2-clause
gyn/exercism,gyn/exercism,gyn/exercism,gyn/exercism
rust
## Code Before: pub fn encode(text: &str) -> String { if text.is_empty() { return "".to_string(); } let mut last = text.chars().nth(0).unwrap(); let mut count = 0; let mut result = String::new(); for c in text.chars() { if c == last { count += 1; continue; } if count != 1 { result.push_str(&count.to_string()); } result.push(last); last = c; count = 1; } // deal with the last one if count != 1 { result.push_str(&count.to_string()); } result.push(last); result } pub fn decode(text: &str) -> String { let mut result = String::new(); let mut count = 0; for c in text.chars() { if !c.is_numeric() { if count < 2 { result.push(c); } else { result.push_str(&std::iter::repeat(c).take(count).collect::<String>()); } count = 0; continue; } count = count * 10 + c.to_digit(10).unwrap() as usize; } result } ## Instruction: Use peekable to simplify rust code for run-length-encoding It is a good solution to check next element by peek function ## Code After: pub fn encode(text: &str) -> String { let mut count = 0; let mut result = String::new(); let mut iter = text.chars().peekable(); while let Some(c) = iter.next() { count += 1; if iter.peek() != Some(&c) { if count > 1 { result.push_str(&count.to_string()); } result.push(c); count = 0; } } result } pub fn decode(text: &str) -> String { let mut count = 0; let mut result = String::new(); for c in text.chars() { if let Some(v) = c.to_digit(10) { count = count * 10 + v as usize; continue; } if count < 2 { result.push(c); } else { let s = std::iter::repeat(c).take(count).collect::<String>(); result.push_str(&s); } count = 0; } result }
55b1bc48bcc24f1c332369225387aa1ce3f0675b
.travis.yml
.travis.yml
language: ruby cache: bundler sudo: false matrix: fast_finish: true include: - rvm: 2.1 - rvm: 2.2 - rvm: 2.3.0 - rvm: 2.3.1 - rvm: 2.4.0 - rvm: jruby-head allow_failures: - rvm: jruby-head - rvm: 2.4.0 notifications: email: false
language: ruby cache: bundler sudo: false dist: trusty matrix: fast_finish: true include: - rvm: 2.1 - rvm: 2.2 - rvm: 2.3 - rvm: 2.4.0 - rvm: 2.4.1 - rvm: jruby-head allow_failures: - rvm: jruby-head - rvm: 2.4.1 notifications: email: false
Tweak what versions we build and what OS
Tweak what versions we build and what OS We now build on Trusty instead of Precise. Limiting to just one version of 2.3, and major versions of 2.4.
YAML
mit
Temikus/fog-google,Temikus/fog-google,fog/fog-google
yaml
## Code Before: language: ruby cache: bundler sudo: false matrix: fast_finish: true include: - rvm: 2.1 - rvm: 2.2 - rvm: 2.3.0 - rvm: 2.3.1 - rvm: 2.4.0 - rvm: jruby-head allow_failures: - rvm: jruby-head - rvm: 2.4.0 notifications: email: false ## Instruction: Tweak what versions we build and what OS We now build on Trusty instead of Precise. Limiting to just one version of 2.3, and major versions of 2.4. ## Code After: language: ruby cache: bundler sudo: false dist: trusty matrix: fast_finish: true include: - rvm: 2.1 - rvm: 2.2 - rvm: 2.3 - rvm: 2.4.0 - rvm: 2.4.1 - rvm: jruby-head allow_failures: - rvm: jruby-head - rvm: 2.4.1 notifications: email: false
9352d93d471b57bd68826c9b14981c9aacbf342a
src/main/java/com/elmakers/mine/bukkit/api/spell/Spell.java
src/main/java/com/elmakers/mine/bukkit/api/spell/Spell.java
package com.elmakers.mine.bukkit.api.spell; import org.bukkit.Location; import org.bukkit.command.CommandSender; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.util.Vector; /** * Represents a Spell that may be cast by a Mage. * * Each Spell is based on a SpellTemplate, which are defined * by the spells configuration files. * * Every spell uses a specific Class that must extend from * com.elmakers.mine.bukkit.plugins.magic.spell.Spell. * * To create a new custom spell from scratch, you must also * implement the MageSpell interface. */ public interface Spell extends SpellTemplate { public boolean cast(); public boolean cast(String[] parameters); public boolean cast(String[] parameters, Location defaultLocation); public Location getLocation(); public void target(); public Location getTargetLocation(); public Entity getTargetEntity(); public Vector getDirection(); public boolean canTarget(Entity entity); public boolean isActive(); public boolean hasBrushOverride(); public boolean canCast(Location location); public long getRemainingCooldown(); public CastingCost getRequiredCost(); }
package com.elmakers.mine.bukkit.api.spell; import org.bukkit.Location; import org.bukkit.command.CommandSender; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.util.Vector; /** * Represents a Spell that may be cast by a Mage. * * Each Spell is based on a SpellTemplate, which are defined * by the spells configuration files. * * Every spell uses a specific Class that must extend from * com.elmakers.mine.bukkit.plugins.magic.spell.Spell. * * To create a new custom spell from scratch, you must also * implement the MageSpell interface. */ public interface Spell extends SpellTemplate { public boolean cast(); public boolean cast(String[] parameters); public boolean cast(String[] parameters, Location defaultLocation); public Location getLocation(); public void target(); public Location getTargetLocation(); public Entity getTargetEntity(); public Vector getDirection(); public boolean canTarget(Entity entity); public boolean isActive(); public boolean hasBrushOverride(); public boolean canCast(Location location); public long getRemainingCooldown(); public CastingCost getRequiredCost(); public void playEffects(String effectName, float scale, Location source, Entity sourceEntity, Location target, Entity targetEntity); }
Add a projectile hit handler, and allow for hit FX on projectiles
Add a projectile hit handler, and allow for hit FX on projectiles
Java
mit
elBukkit/MagicPlugin,elBukkit/MagicAPI,elBukkit/MagicPlugin,elBukkit/MagicPlugin
java
## Code Before: package com.elmakers.mine.bukkit.api.spell; import org.bukkit.Location; import org.bukkit.command.CommandSender; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.util.Vector; /** * Represents a Spell that may be cast by a Mage. * * Each Spell is based on a SpellTemplate, which are defined * by the spells configuration files. * * Every spell uses a specific Class that must extend from * com.elmakers.mine.bukkit.plugins.magic.spell.Spell. * * To create a new custom spell from scratch, you must also * implement the MageSpell interface. */ public interface Spell extends SpellTemplate { public boolean cast(); public boolean cast(String[] parameters); public boolean cast(String[] parameters, Location defaultLocation); public Location getLocation(); public void target(); public Location getTargetLocation(); public Entity getTargetEntity(); public Vector getDirection(); public boolean canTarget(Entity entity); public boolean isActive(); public boolean hasBrushOverride(); public boolean canCast(Location location); public long getRemainingCooldown(); public CastingCost getRequiredCost(); } ## Instruction: Add a projectile hit handler, and allow for hit FX on projectiles ## Code After: package com.elmakers.mine.bukkit.api.spell; import org.bukkit.Location; import org.bukkit.command.CommandSender; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.util.Vector; /** * Represents a Spell that may be cast by a Mage. * * Each Spell is based on a SpellTemplate, which are defined * by the spells configuration files. * * Every spell uses a specific Class that must extend from * com.elmakers.mine.bukkit.plugins.magic.spell.Spell. * * To create a new custom spell from scratch, you must also * implement the MageSpell interface. */ public interface Spell extends SpellTemplate { public boolean cast(); public boolean cast(String[] parameters); public boolean cast(String[] parameters, Location defaultLocation); public Location getLocation(); public void target(); public Location getTargetLocation(); public Entity getTargetEntity(); public Vector getDirection(); public boolean canTarget(Entity entity); public boolean isActive(); public boolean hasBrushOverride(); public boolean canCast(Location location); public long getRemainingCooldown(); public CastingCost getRequiredCost(); public void playEffects(String effectName, float scale, Location source, Entity sourceEntity, Location target, Entity targetEntity); }
a9d5c56df011f10015601bffe5b8ed6bb984c70c
react-front/src/components/Attendee/Attendee.js
react-front/src/components/Attendee/Attendee.js
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import './Attendee.css'; import Clap from '../../components/Clap/Clap.container'; class Atendee extends Component { constructor(props) { super(props); this.confettiClass = 'button button--large button--circle button--withChrome u-baseColor--buttonNormal button--withIcon button--withSvgIcon clapButton js-actionMultirecommendButton clapButton--largePill u-relative u-foreground u-width60 u-height60 u-accentColor--textNormal u-accentColor--buttonNormal is-touched'; this.pulsatingClass = 'button button--large button--circle button--withChrome u-baseColor--buttonNormal button--withIcon button--withSvgIcon clapButton js-actionMultirecommendButton clapButton--largePill u-relative u-foreground u-width60 u-height60 u-accentColor--textNormal u-accentColor--buttonNormal is-touched'; } componentWillMount() { // this.props.join(); } render() { return ( <button className={this.pulsatingClass} style={{ top: 14, padding: 2 }}> <Clap /> </button> ); } } Atendee.propTypes = { join: PropTypes.func.isRequired, }; export default Atendee;
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import './Attendee.css'; import Clap from '../../components/Clap/Clap.container'; class Atendee extends Component { constructor(props) { super(props); this.confettiClass = 'button button--large button--circle button--withChrome u-baseColor--buttonNormal button--withIcon button--withSvgIcon clapButton js-actionMultirecommendButton clapButton--largePill u-relative u-foreground u-width60 u-height60 u-accentColor--textNormal u-accentColor--buttonNormal is-touched'; this.pulsatingClass = 'button button--large button--circle button--withChrome u-baseColor--buttonNormal button--withIcon button--withSvgIcon clapButton js-actionMultirecommendButton clapButton--largePill u-relative u-foreground u-accentColor--textNormal u-accentColor--buttonNormal is-touched'; } componentWillMount() { // this.props.join(); } render() { return ( <button className={this.pulsatingClass} style={{ top: 14, padding: 2 }}> <Clap /> </button> ); } } Atendee.propTypes = { join: PropTypes.func.isRequired, }; export default Atendee;
Add style to the attendee
Add style to the attendee
JavaScript
mit
adaschevici/firebase-demo,adaschevici/firebase-demo,adaschevici/firebase-demo
javascript
## Code Before: import React, { Component } from 'react'; import PropTypes from 'prop-types'; import './Attendee.css'; import Clap from '../../components/Clap/Clap.container'; class Atendee extends Component { constructor(props) { super(props); this.confettiClass = 'button button--large button--circle button--withChrome u-baseColor--buttonNormal button--withIcon button--withSvgIcon clapButton js-actionMultirecommendButton clapButton--largePill u-relative u-foreground u-width60 u-height60 u-accentColor--textNormal u-accentColor--buttonNormal is-touched'; this.pulsatingClass = 'button button--large button--circle button--withChrome u-baseColor--buttonNormal button--withIcon button--withSvgIcon clapButton js-actionMultirecommendButton clapButton--largePill u-relative u-foreground u-width60 u-height60 u-accentColor--textNormal u-accentColor--buttonNormal is-touched'; } componentWillMount() { // this.props.join(); } render() { return ( <button className={this.pulsatingClass} style={{ top: 14, padding: 2 }}> <Clap /> </button> ); } } Atendee.propTypes = { join: PropTypes.func.isRequired, }; export default Atendee; ## Instruction: Add style to the attendee ## Code After: import React, { Component } from 'react'; import PropTypes from 'prop-types'; import './Attendee.css'; import Clap from '../../components/Clap/Clap.container'; class Atendee extends Component { constructor(props) { super(props); this.confettiClass = 'button button--large button--circle button--withChrome u-baseColor--buttonNormal button--withIcon button--withSvgIcon clapButton js-actionMultirecommendButton clapButton--largePill u-relative u-foreground u-width60 u-height60 u-accentColor--textNormal u-accentColor--buttonNormal is-touched'; this.pulsatingClass = 'button button--large button--circle button--withChrome u-baseColor--buttonNormal button--withIcon button--withSvgIcon clapButton js-actionMultirecommendButton clapButton--largePill u-relative u-foreground u-accentColor--textNormal u-accentColor--buttonNormal is-touched'; } componentWillMount() { // this.props.join(); } render() { return ( <button className={this.pulsatingClass} style={{ top: 14, padding: 2 }}> <Clap /> </button> ); } } Atendee.propTypes = { join: PropTypes.func.isRequired, }; export default Atendee;
15e1bef7e4d96c7f4bdd3c7261e59a083c0fe73f
spec/controllers/gestionnaires/passwords_controller_spec.rb
spec/controllers/gestionnaires/passwords_controller_spec.rb
require "spec_helper" describe Gestionnaires::PasswordsController, type: :controller do before do @request.env["devise.mapping"] = Devise.mappings[:gestionnaire] end describe "update" do context "unified login" do let(:gestionnaire) { create(:gestionnaire, email: '[email protected]', password: 'password') } let(:user) { create(:user, email: '[email protected]', password: 'password') } before do allow(Features).to receive(:unified_login).and_return(true) @token = gestionnaire.send(:set_reset_password_token) user # make sure it's created end it "also signs user in" do put :update, gestionnaire: { reset_password_token: @token, password: "supersecret", password_confirmation: "supersecret", } expect(subject.current_gestionnaire).to eq(gestionnaire) expect(subject.current_user).to eq(user) end end end end
require "spec_helper" describe Gestionnaires::PasswordsController, type: :controller do before do @request.env["devise.mapping"] = Devise.mappings[:gestionnaire] end describe "update" do context "unified login" do let(:gestionnaire) { create(:gestionnaire, email: '[email protected]', password: 'password') } let(:user) { create(:user, email: '[email protected]', password: 'password') } before do allow(Features).to receive(:unified_login).and_return(true) @token = gestionnaire.send(:set_reset_password_token) user # make sure it's created end it "also signs user in" do put :update, params: {gestionnaire: { reset_password_token: @token, password: "supersecret", password_confirmation: "supersecret", }} expect(subject.current_gestionnaire).to eq(gestionnaire) expect(subject.current_user).to eq(user) end end end end
Fix DEPRECATION WARNING for spec/controllers/gestionnaires/*.rb
Fix DEPRECATION WARNING for spec/controllers/gestionnaires/*.rb
Ruby
agpl-3.0
sgmap/tps,sgmap/tps,sgmap/tps
ruby
## Code Before: require "spec_helper" describe Gestionnaires::PasswordsController, type: :controller do before do @request.env["devise.mapping"] = Devise.mappings[:gestionnaire] end describe "update" do context "unified login" do let(:gestionnaire) { create(:gestionnaire, email: '[email protected]', password: 'password') } let(:user) { create(:user, email: '[email protected]', password: 'password') } before do allow(Features).to receive(:unified_login).and_return(true) @token = gestionnaire.send(:set_reset_password_token) user # make sure it's created end it "also signs user in" do put :update, gestionnaire: { reset_password_token: @token, password: "supersecret", password_confirmation: "supersecret", } expect(subject.current_gestionnaire).to eq(gestionnaire) expect(subject.current_user).to eq(user) end end end end ## Instruction: Fix DEPRECATION WARNING for spec/controllers/gestionnaires/*.rb ## Code After: require "spec_helper" describe Gestionnaires::PasswordsController, type: :controller do before do @request.env["devise.mapping"] = Devise.mappings[:gestionnaire] end describe "update" do context "unified login" do let(:gestionnaire) { create(:gestionnaire, email: '[email protected]', password: 'password') } let(:user) { create(:user, email: '[email protected]', password: 'password') } before do allow(Features).to receive(:unified_login).and_return(true) @token = gestionnaire.send(:set_reset_password_token) user # make sure it's created end it "also signs user in" do put :update, params: {gestionnaire: { reset_password_token: @token, password: "supersecret", password_confirmation: "supersecret", }} expect(subject.current_gestionnaire).to eq(gestionnaire) expect(subject.current_user).to eq(user) end end end end
7f04090c574b48b0e1de4590017c7f9960c515fb
nova/policies/ips.py
nova/policies/ips.py
from oslo_policy import policy from nova.policies import base POLICY_ROOT = 'os_compute_api:ips:%s' ips_policies = [ policy.RuleDefault( name=POLICY_ROOT % 'show', check_str=base.RULE_ADMIN_OR_OWNER), policy.RuleDefault( name=POLICY_ROOT % 'index', check_str=base.RULE_ADMIN_OR_OWNER), ] def list_rules(): return ips_policies
from nova.policies import base POLICY_ROOT = 'os_compute_api:ips:%s' ips_policies = [ base.create_rule_default( POLICY_ROOT % 'show', base.RULE_ADMIN_OR_OWNER, """Shows IP addresses details for a network label of a server.""", [ { 'method': 'GET', 'path': '/servers/{server_id}/ips/{network_label}' } ]), base.create_rule_default( POLICY_ROOT % 'index', base.RULE_ADMIN_OR_OWNER, """Lists IP addresses that are assigned to a server.""", [ { 'method': 'GET', 'path': '/servers/{server_id}/ips' } ]), ] def list_rules(): return ips_policies
Add policy description for Servers IPs
Add policy description for Servers IPs This commit adds policy doc for Servers IPs policies. Partial implement blueprint policy-docs Change-Id: I94a7c023dd97413d30f5be9edc313caeb47cb633
Python
apache-2.0
vmturbo/nova,mikalstill/nova,gooddata/openstack-nova,openstack/nova,Juniper/nova,rahulunair/nova,vmturbo/nova,rajalokan/nova,Juniper/nova,gooddata/openstack-nova,vmturbo/nova,rahulunair/nova,vmturbo/nova,mahak/nova,rahulunair/nova,rajalokan/nova,rajalokan/nova,mikalstill/nova,klmitch/nova,klmitch/nova,gooddata/openstack-nova,phenoxim/nova,klmitch/nova,openstack/nova,klmitch/nova,gooddata/openstack-nova,jianghuaw/nova,jianghuaw/nova,jianghuaw/nova,Juniper/nova,phenoxim/nova,rajalokan/nova,mahak/nova,openstack/nova,jianghuaw/nova,mahak/nova,mikalstill/nova,Juniper/nova
python
## Code Before: from oslo_policy import policy from nova.policies import base POLICY_ROOT = 'os_compute_api:ips:%s' ips_policies = [ policy.RuleDefault( name=POLICY_ROOT % 'show', check_str=base.RULE_ADMIN_OR_OWNER), policy.RuleDefault( name=POLICY_ROOT % 'index', check_str=base.RULE_ADMIN_OR_OWNER), ] def list_rules(): return ips_policies ## Instruction: Add policy description for Servers IPs This commit adds policy doc for Servers IPs policies. Partial implement blueprint policy-docs Change-Id: I94a7c023dd97413d30f5be9edc313caeb47cb633 ## Code After: from nova.policies import base POLICY_ROOT = 'os_compute_api:ips:%s' ips_policies = [ base.create_rule_default( POLICY_ROOT % 'show', base.RULE_ADMIN_OR_OWNER, """Shows IP addresses details for a network label of a server.""", [ { 'method': 'GET', 'path': '/servers/{server_id}/ips/{network_label}' } ]), base.create_rule_default( POLICY_ROOT % 'index', base.RULE_ADMIN_OR_OWNER, """Lists IP addresses that are assigned to a server.""", [ { 'method': 'GET', 'path': '/servers/{server_id}/ips' } ]), ] def list_rules(): return ips_policies
88031f79636541b07c318a9ba10e802e74544a84
js/lib/ltri-to-url.js
js/lib/ltri-to-url.js
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') { module.exports = ltriToUrl; } /** * Translate an LTRI to a URL * * @param {string} url LTRI or URL * @return {string} */ function ltriToUrl(url) { if (url.match(/^https?:\/\//)) return url; var baseElement = document.querySelector('head base'); var base = baseElement ? baseElement.getAttribute('href') : null; base = base || '/'; var scheme = window.location.protocol + '//'; var host = window.location.host; base = base.replace(/service\/[a-z]+\//, 'service/'); if (!base.match(/^(https?:)?\/\//)) { base = host + '/' + base.replace(/^\//, ''); } url = url.replace('lt:', ''); var auth = url.match(/^[^:\/@]+:[^:\/@]+@/); if (auth) { url = url.replace(auth[0], ''); base = auth[0] + base; } url = url.replace(/^([a-z]+):(\/)?/, function(match, resource) { var start = resource === 'external' ? host : base.replace(/\/$/, ''); return scheme + start + '/' + resource + '/'; }); return url; }
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') { module.exports = ltriToUrl; } /** * Translate an LTRI to a URL * * @param {string} url LTRI or URL * @return {string} */ function ltriToUrl(url) { if (url.match(/^https?:\/\//)) return url; var baseElement = document.querySelector('head base'); var base = baseElement ? baseElement.getAttribute('href') : null; base = base || '/'; var scheme = window.location.protocol + '//'; var host = window.location.host; base = base.replace(/service\/[a-z]+\//, 'service/'); if (!base.match(/^(https?:)?\/\//)) { base = host + '/' + base.replace(/^\//, ''); } if (url.match('lt:')) { url = url.replace('lt:', ''); if (typeof legalforms !== 'undefined') { host = legalforms.base_url.replace(/https?:\/\//, ''); } } var auth = url.match(/^[^:\/@]+:[^:\/@]+@/); if (auth) { url = url.replace(auth[0], ''); base = auth[0] + base; } url = url.replace(/^([a-z]+):(\/)?/, function(match, resource) { var start = resource === 'external' ? host : base.replace(/\/$/, ''); return scheme + start + '/' + resource + '/'; }); return url; }
Replace wordpress host with base_url from config
Replace wordpress host with base_url from config
JavaScript
mit
legalthings/legalform-js,legalthings/legalform-js
javascript
## Code Before: if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') { module.exports = ltriToUrl; } /** * Translate an LTRI to a URL * * @param {string} url LTRI or URL * @return {string} */ function ltriToUrl(url) { if (url.match(/^https?:\/\//)) return url; var baseElement = document.querySelector('head base'); var base = baseElement ? baseElement.getAttribute('href') : null; base = base || '/'; var scheme = window.location.protocol + '//'; var host = window.location.host; base = base.replace(/service\/[a-z]+\//, 'service/'); if (!base.match(/^(https?:)?\/\//)) { base = host + '/' + base.replace(/^\//, ''); } url = url.replace('lt:', ''); var auth = url.match(/^[^:\/@]+:[^:\/@]+@/); if (auth) { url = url.replace(auth[0], ''); base = auth[0] + base; } url = url.replace(/^([a-z]+):(\/)?/, function(match, resource) { var start = resource === 'external' ? host : base.replace(/\/$/, ''); return scheme + start + '/' + resource + '/'; }); return url; } ## Instruction: Replace wordpress host with base_url from config ## Code After: if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') { module.exports = ltriToUrl; } /** * Translate an LTRI to a URL * * @param {string} url LTRI or URL * @return {string} */ function ltriToUrl(url) { if (url.match(/^https?:\/\//)) return url; var baseElement = document.querySelector('head base'); var base = baseElement ? baseElement.getAttribute('href') : null; base = base || '/'; var scheme = window.location.protocol + '//'; var host = window.location.host; base = base.replace(/service\/[a-z]+\//, 'service/'); if (!base.match(/^(https?:)?\/\//)) { base = host + '/' + base.replace(/^\//, ''); } if (url.match('lt:')) { url = url.replace('lt:', ''); if (typeof legalforms !== 'undefined') { host = legalforms.base_url.replace(/https?:\/\//, ''); } } var auth = url.match(/^[^:\/@]+:[^:\/@]+@/); if (auth) { url = url.replace(auth[0], ''); base = auth[0] + base; } url = url.replace(/^([a-z]+):(\/)?/, function(match, resource) { var start = resource === 'external' ? host : base.replace(/\/$/, ''); return scheme + start + '/' + resource + '/'; }); return url; }
7200e71bd598642c6570babb1c8637a56fc1c9b8
cmd/root.go
cmd/root.go
package cmd import ( "log" "os" "github.com/spf13/cobra" ) var rootCmd = &cobra.Command{ Use: "mocli", Short: "", Long: `Mobingi API command line interface.`, } func Execute() { if err := rootCmd.Execute(); err != nil { log.Println(err) os.Exit(-1) } } func init() { rootCmd.PersistentFlags().StringP("token", "t", "", "access token for API access") }
package cmd import ( "log" "os" "github.com/spf13/cobra" ) var rootCmd = &cobra.Command{ Use: "mocli", Short: "Mobingi API command line interface.", Long: `Mobingi API command line interface.`, } func Execute() { if err := rootCmd.Execute(); err != nil { log.Println(err) os.Exit(-1) } } func init() { rootCmd.PersistentFlags().StringP("token", "t", "", "access token for API access") }
Add short description for help.
Add short description for help.
Go
mpl-2.0
mobingi/mobingi-cli
go
## Code Before: package cmd import ( "log" "os" "github.com/spf13/cobra" ) var rootCmd = &cobra.Command{ Use: "mocli", Short: "", Long: `Mobingi API command line interface.`, } func Execute() { if err := rootCmd.Execute(); err != nil { log.Println(err) os.Exit(-1) } } func init() { rootCmd.PersistentFlags().StringP("token", "t", "", "access token for API access") } ## Instruction: Add short description for help. ## Code After: package cmd import ( "log" "os" "github.com/spf13/cobra" ) var rootCmd = &cobra.Command{ Use: "mocli", Short: "Mobingi API command line interface.", Long: `Mobingi API command line interface.`, } func Execute() { if err := rootCmd.Execute(); err != nil { log.Println(err) os.Exit(-1) } } func init() { rootCmd.PersistentFlags().StringP("token", "t", "", "access token for API access") }