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 util.matching.Regex | |
class KillsScala2.8.1 { | |
val ErrorR = new Regex("\\[ERROR\\](.*)") | |
val LogR = new Regex("\\[LOG\\](.*)") | |
val SuspendedUserR = new Regex("\\[SUSPENDED_USER\\](.*)") | |
val CreatedUserR = new Regex("\\[CREATED_USER\\](.*)") | |
val NumUsersProcessedR = new Regex("\\[NUM_USERS_PROCESSED\\](.*)") | |
val NumUsersPendingR = new Regex("\\[NUM_USERS_PENDING\\](.*)") |
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 java.util.concurrent.BlockingQueue | |
import collection.JavaConversions | |
object Drainer { | |
def drain[T](queue: BlockingQueue[T], max: Option[Int] = None) : Seq[T] = { | |
val arrayList = new java.util.ArrayList[T] | |
queue.drainTo(arrayList, max.getOrElse(queue.size())) | |
JavaConversions.JListWrapper(arrayList) | |
} |
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/env ruby | |
require 'benchmark' | |
def permute(chars) | |
if chars.length <= 1 | |
[chars] | |
else | |
result = [] | |
chars.each_with_index do |char, idx| |
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
defaults write com.apple.Dock autohide-delay -float 0 | |
defaults write com.apple.dock autohide-time-modifier -float 0.50 | |
killall Dock |
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 main | |
import ( | |
"database/sql" | |
"fmt" | |
"time" | |
) | |
type User struct { | |
Id string |
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 main | |
import ( | |
"database/sql" | |
"fmt" | |
"time" | |
) | |
type User struct { | |
Id string |
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 main | |
import ( | |
"fmt" | |
"net/http" | |
) | |
func main() { | |
fmt.Printf("Starting HTTP server...\n") | |
http.HandleFunc("/authenticate", Authenticate) |
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
val record : Option[Thing] = lookForThing() | |
record.foreach(r => r.doSomething()) |
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
public class AuthConfiguration extends Configuration { | |
@Valid | |
@NotNull | |
@JsonProperty | |
private DatabaseConfiguration database = new DatabaseConfiguration(); | |
public DatabaseConfiguration getDatabaseConfiguration() { | |
return database; | |
} |
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
database: | |
driverClass: org.postgresql.Driver | |
user: postgres | |
password: postgres | |
url: jdbc:postgresql://localhost/authdb | |
properties: | |
charSet: UTF-8 | |
maxWaitForConnection: 1s | |
validationQuery: "/* MyService Health Check */ SELECT 1" | |
minSize: 8 |
OlderNewer