Skip to content

Instantly share code, notes, and snippets.

View rajish's full-sized avatar

Radzisław Galler rajish

View GitHub Profile
@rajish
rajish / subtitles.txt
Created January 29, 2012 23:19
Translation of http://youtu.be/3jg1AheF4n0 - O'Reilly OSCON Java 2011: Martin Odersky, "Working Hard to Keep It Simple"
00:00:02.800,00:00:05.320
Dziękuję za zaproszenie i możliwość
wystąpienia tutaj.
00:00:05.830,00:00:10.430
Właściwie mam dzisiaj dwa wystąpienia
później tego popołudnia,
00:00:10.850,00:00:14.960
ponieważ zastępuje również Jonasa
@rajish
rajish / gist:2308783
Created April 5, 2012 07:36 — forked from seyhunak/gist:1264003
Github Badge
<style>
#github {left: -65px;
height: 30px;
top: 40px;
position: absolute;
text-decoration: none;
width: 250px;
-moz-transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
@rajish
rajish / gist:2346686
Created April 9, 2012 21:33 — forked from Gregg/gist:968534
Code School Screencasting Framework

Screencasting Framework

The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.

Why you should care about screencasting?

You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.

  1. Communicating more effectively - At Envy Labs we produce screencasts for our clients all the time. Whether it's demoing a new feature or for a presentation for an invester, they're often much more effective and pleasent than a phone call or screen sharing.
@rajish
rajish / Secured.scala
Created April 9, 2012 21:34 — forked from guillaumebort/Secured.scala
HTTP Basic Authorization for Play 2.0
def Secured[A](username: String, password: String)(action: Action[A]) = Action(action.parser) { request =>
request.headers.get("Authorization").flatMap { authorization =>
authorization.split(" ").drop(1).headOption.filter { encoded =>
new String(org.apache.commons.codec.binary.Base64.decodeBase64(encoded.getBytes)).split(":").toList match {
case u :: p :: Nil if u == username && password == p => true
case _ => false
}
}.map(_ => action(request))
}.getOrElse {
Unauthorized.withHeaders("WWW-Authenticate" -> """Basic realm="Secured"""")
@rajish
rajish / fears.scala
Created May 4, 2012 14:02
y is 6 afraid of 7
// A scala exercise based on the http://thedet.wordpress.com/2012/04/25/y-is-6-afraidof-7/ blog entry
// The goal is to remove the parenthesis
case class Fears(value:Int) {
var s: String = "... Wait! %d has no fears!".format(value)
def afraid(f: Fears) = {
if (value == 6)
f.s = s + f.s
@rajish
rajish / gist:2781723
Created May 24, 2012 14:00
Play serving stream from a sub-process stdout
package controllers
import play.api._
import play.api.mvc._
import play.api.libs.iteratee._
import java.io._
import scala.io._
import scala.concurrent._
@rajish
rajish / all_docs_opt.scala
Created June 20, 2012 22:08
Generated Scala with problems
// Generated by <a href="http://scalaxb.org/">scalaxb</a>.
package models
case class ZpBaseType(zpbasetypeoption: scalaxb.DataRecord[Any]*)
trait ZpBaseTypeOption
@rajish
rajish / all_docs_opt.xsd
Created June 21, 2012 21:55
XSD schemas
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "XMLSchema.dtd" [
<!-- provide ID type information even for parsers which only read the internal subset -->
<!ATTLIST xs:schema id ID #IMPLIED>
<!ATTLIST xs:complexType id ID #IMPLIED>
<!ATTLIST xs:complexContent id ID #IMPLIED>
<!ATTLIST xs:simpleContent id ID #IMPLIED>
<!ATTLIST xs:extension id ID #IMPLIED>
<!ATTLIST xs:element id ID #IMPLIED>
<!ATTLIST xs:group id ID #IMPLIED>
@rajish
rajish / Util.scala
Created June 29, 2012 11:51
scalaxb generated code MongoDB conversion helper - a specific case
package models.util
import javax.xml.datatype.{XMLGregorianCalendar}
import javax.xml.namespace.QName
import com.mongodb.casbah.commons.conversions.MongoConversionHelper
import org.bson.{BSON, Transformer}
import scalaxb._
import models._
import play.api._
import com.novus.salat._
@rajish
rajish / gist:223041144513446bd5c7
Created December 4, 2014 10:43
sbt 0.13.7 cached dependency issue
auth> compile
[info] Updating {file:/Users/rajish/proj/auth-server/}auth...
[info] :: resolving dependencies :: org.scala-sbt.temp#temp-resolve-912253f8916a7e933f1b4ef2b333ab8535739622;1.0
[info] confs: [compile, runtime, test, provided, optional, compile-internal, runtime-internal, test-internal, plugin, sources, docs, pom, scala-tool]
[info] Resolving org.scala-lang#scala-compiler;2.10.4 ...
[info] found org.scala-lang#scala-compiler;2.10.4 in sbt-chain
[info] Resolving org.scala-lang#scala-library;2.10.4 ...
[info] found org.scala-lang#scala-library;2.10.4 in sbt-chain
[info] [2.10.4] org.scala-lang#scala-library;2.10.4
[info] Resolving org.scala-lang#scala-reflect;2.10.4 ...