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
// ~/Library/KeyBinding/DefaultKeyBindings.dict | |
{ | |
"\UF729" = moveToBeginningOfLine:; // home | |
"\UF72B" = moveToEndOfLine:; // end | |
"$\UF729" = moveToBeginningOfLineAndModifySelection:; // shift-home | |
"$\UF72B" = moveToEndOfLineAndModifySelection:; // shift-end | |
"^\UF729" = moveToBeginningOfDocument:; // ctrl-home | |
"^\UF72B" = moveToEndOfDocument:; // ctrl-end | |
"$^\UF729" = moveToBeginningOfDocumentAndModifySelection:; // shift-ctrl-home |
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
#!/usr/bin/python | |
''' | |
We are bound to forget to checkout some new branch we have just created and | |
commit something to a branch that is supposed to be protected. This pre-commit | |
hook helps us to set a list of branches we dont want to allow any commits. | |
Install | |
Create the file .git/hooks/pre-commit on your repository and make it | |
executable with `chmod +x <file>`. After, add the following code to it, | |
changing the list of protected branches to whatever you like. |
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
const ( | |
roleUser = 1 << iota | |
roleSuperUser | |
roleAdmin | |
) | |
type User struct { | |
name string | |
role uint | |
} |
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 com.marcelustrojahn.models | |
import io.ebean.Ebean | |
import io.kotlintest.matchers.shouldBe | |
import io.kotlintest.matchers.shouldNotBe | |
import io.kotlintest.specs.FreeSpec | |
class BaseEntityTests: FreeSpec() { | |
init { | |
// remember the database will always be empty in the beggining of tests |
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
@Entity | |
class Script( | |
@Id | |
@GeneratedValue(strategy = GenerationType.AUTO) | |
var id: Long? = null, | |
var name: String = "", | |
var source: String = "", | |
var description: String = "", | |
@Version | |
var version: Long = 0L, |
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 com.marcelustrojahn.models | |
import io.ebean.Ebean | |
import io.kotlintest.matchers.shouldBe | |
import io.kotlintest.matchers.shouldNotBe | |
import io.kotlintest.specs.FreeSpec | |
class BaseEntityTests: FreeSpec() { | |
init { | |
// remember the database will always be empty in the beggining of tests |
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
ebean.packages=com.marcelustrojahn.models | |
ebean.db.ddl.generate=true | |
ebean.db.ddl.run=true | |
datasource.db.username=sa | |
datasource.db.password= | |
datasource.db.databaseUrl=jdbc:h2:file:~/monies_db_test;AUTO_SERVER=true | |
datasource.db.databaseDriver=org.h2.Driver |