Skip to content

Instantly share code, notes, and snippets.

[92] pry(main)> Taskrabbit.configure do |config|
[92] pry(main)* config.api_secret = 'SECRET_KEY'
[92] pry(main)* config.api_key = 'CovsfUly0Atqk2bnxfvSVNE0FH1c2YqsQjXKvWRN'
[92] pry(main)* config.base_uri = 'https://taskrabbitdev.com'
[92] pry(main)* config.endpoint = 'api/v1'
[92] pry(main)* end
=> Taskrabbit
[93] pry(main)> tr = Taskrabbit::Api.new("my oauth token")
=> #<Taskrabbit::Api:0x00000100b062c8
@api_key="SECRET_KEY",
@smarden1
smarden1 / gist:6290286
Created August 21, 2013 04:21
is this crazy
diff --git a/scalding-core/src/main/scala/com/twitter/scalding/Job.scala b/scalding-core/src/main/scala/com/twitter/scalding/Job.scala
index 367f3f3..ab3c7f8 100644
--- a/scalding-core/src/main/scala/com/twitter/scalding/Job.scala
+++ b/scalding-core/src/main/scala/com/twitter/scalding/Job.scala
@@ -18,7 +18,7 @@ package com.twitter.scalding
import com.twitter.chill.config.{ScalaMapConfig, ConfiguredInstantiator}
import cascading.pipe.assembly.AggregateBy
-import cascading.flow.{Flow, FlowDef, FlowProps, FlowListener, FlowSkipStrategy, FlowStepStrategy}
+import cascading.flow.{Flow, FlowDef, FlowProps, FlowListener, FlowSkipStrategy, FlowStepStrategy, FlowProcess}
@smarden1
smarden1 / gist:7126014
Last active December 26, 2015 08:59
sketch of providing access to the FlowProcess from within scalding
object RichFlowProcess extends java.io.Serializable {
private var _flowProcess : Option[FlowProcess[_]] = None
def setFlowProcess(fp : FlowProcess[_]) =
_flowProcess = Some(fp)
def flowProcess() : FlowProcess[_] = {
assert(_flowProcess.isDefined, "flow process is undefined: your operation needs to set the flow process")
_flowProcess.get
diff --git a/scalding-core/src/main/scala/com/twitter/scalding/CascadeJob.scala b/scalding-core/src/main/scala/com/twitter/scalding/CascadeJob.scala
index 9247c69..0cd31d2 100644
--- a/scalding-core/src/main/scala/com/twitter/scalding/CascadeJob.scala
+++ b/scalding-core/src/main/scala/com/twitter/scalding/CascadeJob.scala
@@ -7,14 +7,17 @@ abstract class CascadeJob(args: Args) extends Job(args) {
def jobs: Seq[Job]
- override def run : Boolean = {
- val flows = jobs.map { _.buildFlow }
#!/usr/bin/env php
<?php
include('mustache.php');
$engine = new Mustache_Engine(array());
$data = array("title" => "TITLE");
$template = "{{{title}}}";
$output = $engine->render($template, $data);
my_object = {foo : "bar"}
_.bindAll(my_object, "missing")
my_object.missing()
TypeError: Cannot read property 'apply' of undefined
var NanoTimer = require('nanotimer');
var timing = new NanoTimer();
d = {};
i = 10000;
while (i > 0) {
d[i] = true;
i --;
}
Building a feature flag system
There are more blog posts that could possibly be read on the subject of AB testing -- why it is important, why you are doing it wrong, and this one crazy trick to double your conversions in a matter of minutes. At this point you are probably convinced that ab testing is probably something you should do, but the real question is, what is the best way to go about building such a system. This ignores the larger and more pertinent question of whether you should be building something yourself.
So what's actually involved in building an ab testing system? Well there are several different components that you will want...
1. an easy way to configure tests.
2. an api for determining whether a test is on/off for a given request/user/etc