README is empty
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package api_security | |
import java.util | |
import be.objectify.deadbolt.core.models.{Permission, Role, Subject} | |
import be.objectify.deadbolt.scala.cache.HandlerCache | |
import io.igl.jwt._ | |
import play.api.inject.{Binding, Module} | |
import play.api.libs.json.{JsBoolean, JsString, JsValue} | |
import play.api.{Configuration, Environment, Logger} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Productivity | |
alias ls="ls --color=auto" | |
alias ll="ls --color -al" | |
alias grep='grep --color=auto' | |
mcd() { mkdir -p "$1"; cd "$1";} | |
cl() { cd "$1"; ls;} | |
backup() { cp "$1"{,.bak};} | |
md5check() { md5sum "$1" | grep "$2";} | |
alias makescript="fc -rnl | head -1 >" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package graph | |
/** | |
* Created by sami on 13/9/16. | |
*/ | |
case class Edge[E, N](source: Graph[E, N], target: Graph[E, N], value: E) | |
class Graph[E, N](var value: N = null.asInstanceOf[N]) { | |
import scala.collection.immutable.Queue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Sound Switcher | |
sudo apt-add-repository ppa:yktooo/ppa | |
sudo apt update && sudo apt install indicator-sound-switcher | |
#change Sudo timeout | |
#https://itsfoss.com/change-sudo-password-timeout-ubuntu/ | |
#command notify | |
#https://itsfoss.com/notification-terminal-command-completion-ubuntu/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**code taken from http://stackoverflow.com/a/4051500/845019 | |
* substitutes the string with #{variableName} format | |
*/ | |
implicit def RichFormatter(string: String) = new { | |
def richFormat(replacement: Map[String, Any]) = | |
(string /: replacement) { (res, entry) => res.replaceAll("#\\{%s\\}".format(entry._1), entry._2.toString) } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db['your-collection'].find().forEach(function (doc){ | |
d = doc._id.getTimestamp(); | |
doc.visitedOn = d; | |
db['your-collection'].update({"_id":doc._id},doc,{upsert:true}); | |
print(d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate() + " " + d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds()) }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import thunk from 'redux-thunk'; | |
import expect from 'expect'; | |
describe('actions test', () => { | |
beforeAll(() => { | |
// do something here which you want to be executed before first test runs | |
} | |
it('editor.newPatient() should create a new patient', (done) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source `which virtualenvwrapper.sh` | |
cd ~ | |
rm Node* | |
workon latest-sovrin-master | |
nohup start_sovrin_node Node1 9701 9702 > Node1.log & | |
sleep 5 | |
nohup start_sovrin_node Node2 9703 9704 > Node2.log & | |
sleep 5 | |
nohup start_sovrin_node Node3 9705 9706 > Node3.log & | |
sleep 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pathPrefix("user") { | |
path("msgPackTest") { | |
post { | |
extractRequest { | |
req => | |
println(req.headers) | |
req.entity match { | |
case strict: HttpEntity.Strict => | |
val resp = req.entity.dataBytes.runFold(ByteString.empty) { case (acc, b) => acc ++ b } | |
.map(x=> processMsgPackMsg(x.compact.toArray[Byte])) |
OlderNewer