Skip to content

Instantly share code, notes, and snippets.

View 0xdevalias's full-sized avatar
👀
Open to opportunities

Glenn 'devalias' Grant 0xdevalias

👀
Open to opportunities
View GitHub Profile
@0xdevalias
0xdevalias / scala-cake-cbdi.md
Last active August 29, 2015 14:06
Scala CAKE / Component Based Dependency Injection
@0xdevalias
0xdevalias / reactiveMongoVersionedModel.scala
Last active August 29, 2015 14:05
Basic example of how a 'versioned' model might be implementable with ReactiveMongo
// Expanding on basic case from 'Use Readers to deserialize documents automatically' http://reactivemongo.org/releases/0.10/documentation/tutorial/find-documents.html
case class Person(id: BSONObjectID, firstName: String, lastName: String, age: Int)
object Person {
implicit object PersonReader extends BSONDocumentReader[Person] {
def read(doc: BSONDocument): Person = {
// Common fields
val id = doc.getAs[BSONObjectID]("_id").get
val version = doc.getAs[Int]("_version").get
@0xdevalias
0xdevalias / octopress_github.html.diff
Created August 17, 2014 01:50
Slight modifications to Octopress GitHub Aside to not try and show repo's when configured to show 0
diff --git a/source/_includes/asides/github.html b/source/_includes/asides/github.html
index bdc970f..8675623 100644
--- a/source/_includes/asides/github.html
+++ b/source/_includes/asides/github.html
@@ -1,12 +1,15 @@
{% if site.github_user %}
<section>
<h1>GitHub</h1>
+ {% if site.github_repo_count > 0 %}
<ul id="gh_repos">
@0xdevalias
0xdevalias / play-framework-stuff.md
Last active August 29, 2015 14:05
Play framework libraries, etc
  • Play Framework - Play Framework makes it easy to build web applications with Java & Scala.
  • Akka - Akka is a toolkit and runtime for building highly concurrent, distributed, and fault tolerant event-driven applications on the JVM.

Authentication/Authorisation

Authorisation

  • Deadbolt - Deadbolt is a powerful, comprehensive authorization module for the Play framework.

Authentication

@0xdevalias
0xdevalias / blog-mdwiki-and-how-to-get-started.md
Last active November 21, 2022 10:09
MDwiki (and how to get started)

(Blog post: http://blog.devalias.net/post/92579952637/mdwiki-and-how-to-get-started)

MDwiki (and how to get started)

If you haven't already heard about it, MDwiki is a cool little CMS/Wiki that runs entirely clientside (HTML5/Javascript) and uses Markdown

Since it's all clientside, we can do really cool things like track our changes in git and then host it all on GitHub Pages. That means super simple forking, contributing and sharing. Yay for open source!

Setting up MDwiki with GitHub

@0xdevalias
0xdevalias / play-framework-ws-seperate-library.md
Last active August 29, 2015 14:02
Because I couldn't find it easily on the net, simple notes on how to access Play Framework's seperated WS library
@0xdevalias
0xdevalias / JavaScalaFuturePromiseMap.md
Last active November 6, 2015 03:38
A side by side comparison (now that I finally got it figured out!) of Play Framework v2.2.x promise unwrapping in Java and Scala.

Java/Scala Future/Promise Map

A side by side comparison (now that I finally got it figured out!) of Play Framework v2.2.x promise unwrapping in Java and Scala.

Java

  public Promise<ObjectNode> getEmployees(final Optional<String> filterEmail)
	{
		// Call the webservice
@0xdevalias
0xdevalias / buildHTML utility
Last active October 15, 2024 07:35 — forked from 1Marc/buildHTML utility
Simple little method to build a html element form the given data object.
/* buildHtml - Helper method to construct html tags easily */
var buildHtml = function(tag, attrs, innerHtml) {
var h = '<' + tag;
for (var attr in attrs) {
if(attrs[attr] === false) {
continue;
}
h += ' ' + attr + '="' + attrs[attr] + '"';
}
return h += innerHtml ? '>' + innerHtml + '</' + tag + '>' : '/>';