Skip to content

Instantly share code, notes, and snippets.

View dkowis's full-sized avatar
☢️

David Kowis dkowis

☢️
View GitHub Profile

Keybase proof

I hereby claim:

  • I am dkowis on github.
  • I am dkowis (https://keybase.io/dkowis) on keybase.
  • I have a public key whose fingerprint is 98EC 7077 CB97 00A1 F2E7 3834 C9DF FAF4 70EB 739B

To claim this, I am signing this object:

@dkowis
dkowis / wrapped.scala
Created November 19, 2014 22:41
An example to wrap it instead of copy/pasting try/finally on each one. Same effect as calling a function in try/finally, but you can do more
def withContext(f: LoggingServiceImpl => Unit) = {
val loggingService = new LoggingServiceImpl()
val context = LogManager.getContext(false).asInstanceOf[LoggerContext]
try {
f(loggingService)
} finally {
System.clearProperty(ConfigurationFactory.CONFIGURATION_FILE_FACTORY)
context.reconfigure
StatusLogger.getLogger.reset
}
package org.openrepose.spring
import java.net.URL
import org.openrepose.commons.config.parser.ConfigurationParserFactory
import org.openrepose.commons.config.resource.impl.BufferedURLConfigurationResource
import org.openrepose.core.container.config.ContainerConfiguration
import org.openrepose.core.systemmodel.SystemModel
import scala.reflect.ClassTag
$  unzip -l war-1.NOPE.war
Archive: war-1.NOPE.war
Length Date Time Name
--------- ---------- ----- ----
0 2014-09-23 12:05 META-INF/
25 2014-09-23 12:05 META-INF/MANIFEST.MF
0 2014-09-23 12:05 WEB-INF/
0 2014-09-23 12:05 WEB-INF/classes/
0 2014-09-23 11:29 WEB-INF/classes/org/
0 2014-09-23 11:29 WEB-INF/classes/org/protorepose/
@dkowis
dkowis / Project Structure.md
Last active August 29, 2015 14:06
Repose Project Structure Proposal

Existing project structure

  • repose
    • documentation
    • repose-aggregator
      • commons
        • classloader
        • configuration
        • jetty
  • utilities
@dkowis
dkowis / RomanConvert.scala
Created July 24, 2014 22:11
Scala Coding Dojo files
object RomanConvert {
val arabic = List(
"I" -> 1,
"IV" -> 4,
"V" -> 5,
"IX" -> 9,
"X" -> 10,
"XL" -> 40,
"L" -> 50,
"XC" -> 90,
import org.scalatest.{Matchers, FunSpec}
class RomanTest extends FunSpec with Matchers {
val testCases = Map(
"CCXCI" -> 291
)
describe("Converting arabic numerals to roman numerals") {
describe("Defining the range of our problem") {
puppet agent output:
Error: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install java' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package java
Error: /Stage[main]/Java/Package[java]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install java' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package java
@dkowis
dkowis / gist:d74e9527ebf77ce14e0d
Created May 29, 2014 20:18
git stuff in bashrc
# git shell stuff of awesomeness
# do cool color things with the shell line
c_cyan=`tput setaf 6`
c_red=`tput setaf 1`
c_green=`tput setaf 2`
c_sgr0=`tput sgr0`
parse_git_branch ()
{
if /usr/bin/git rev-parse --git-dir >/dev/null 2>&1
[snapshots]
name=Snapshots
baseurl=http://protorepo.openrepose.org/nexus/content/repositories/snapshots
enabled=1
protect=0
gpgcheck=0
metadata_expire=30s
autorefresh=1
type=rpm-md