Skip to content

Instantly share code, notes, and snippets.

View sheenobu's full-sized avatar
🙃
smug

Sheena Artrip sheenobu

🙃
smug
View GitHub Profile
@sheenobu
sheenobu / architecture-thoughts.markdown
Created November 8, 2012 18:06
Architecture thoughts v 0.1.1

Architecture Thoughts

A quick writeup of architecture ideas for developing and deploying ruby applications.

(NOTE: I'm still semi-new to ruby so I'm mainly compiling untested ideas I hear about).

TODO

  • Mocking
  • Unit Testing
@sheenobu
sheenobu / declarative_async.rb
Created November 9, 2012 23:08
Ruby Declarative Async Experiment.
require 'eventmachine'
require 'aquarium'
class Promise
def null_method(*args)
end
def initialize
@sheenobu
sheenobu / api.markdown
Created November 22, 2012 18:08
sharding dsl writeup

API

A proposed external API, does not include functions like 'managed' which are internal to the object migrations.

Toplevel

ShardDSL - includes the API

shard(&blk) - activate and configure sharding on this object.

class ProdOpenstackExternalInterfaceH(logger: ActorRef, xActorSystem: ActorSystem, _httpClient: ActorRef)
extends OpenstackExternalInterfaceH
with HttpHelper with JsonProcessor {
implicit val system = xActorSystem
implicit val httpClient = _httpClient
def parseIpAddress = { json: JValue =>
((json \ "server" \ "addresses" \ "public").filter({
case JObject(List(JField("version", JInt(x)), JField("addr", JString(_)))) => x == 4
class ProductionDomainNameServiceExternal(logger: ActorRef, xActorSystem: ActorSystem, _httpClient: ActorRef)
extends DomainNameServiceExternal
with HttpHelper with JsonProcessor {
implicit val system = xActorSystem
implicit val httpClient = _httpClient
def with_json(resp: HttpResponse)(callback: JValue => Unit) {
callback(parse(resp.bodyAsString))
}
module AuthenticateBeforeRequests
def self.append_features mod
Aquarium::Aspects::Aspect.new :around, :type => mod,
:methods => [:create_dns_entry,:create_arpa,:exists?,:zone],
:method_options => [:exclude_ancestor_methods] do |jp, object, *args|
object.authenticate
jp.proceed
end
end
end
@sheenobu
sheenobu / stuff_to_learn.markdown
Created November 27, 2012 15:46
Stuff I need to learn

Stuff to learn and do

By Sheena Artrip

Java

  • Continue developing on spring-data-jdbc.
    • Build example application.
  • Webhook OSGI engine.
@sheenobu
sheenobu / blog_posts.txt
Created November 28, 2012 14:44
Blog Posts
TODO blog posts.
* Iterative integration development using resque and resque-steps.
* Continue the OSGI webhook blog post.
* Development using octorake.
* Being agile with Java, an opinion post and series of experiments
* Inherited Resources and Versioncake, together.
* Revisiting Jobs: Introduction
* Revisiting Jobs: Electronic Filing.
#convert a list of integers into a list of booleans.
1.9.3p194 :026 > [1,2,3,4].map { |x| x == 3 } => [false, false, true, false]
# return true if any integer is three
1.9.3p194 :027 > [1,2,3,4].map { |x| x == 3 }.reduce(false,:or) => true
# return true if ALL integers are three
1.9.3p194 :028 > [1,2,3,4].map { |x| x == 3 }.reduce(true,:and) => false
# return true if ALL integers are three
interface GenderModifier {
public void visit(GenderWords words);
}
class PropertiesTranslationGenderModifier implements GenderModifier {
final String prefix;
final Properties properties;
final Locale locale;
public void visit(GenderWords words) {
words.setPossessive(properties.get("genderTranslator." + locale.toString() + "." + prefix + ".possessive"));