Skip to content

Instantly share code, notes, and snippets.

View robertberry-zz's full-sized avatar

Rob Berry robertberry-zz

View GitHub Profile
{
"LaunchConfig": {
"Type": "AWS::AutoScaling::LaunchConfiguration",
"Metadata": {
"AWS::CloudFormation::Authentication" : {
"distributionAuthentication" : {
"type": "S3",
"roleName": "role name here",
"buckets": [ "mobile-notifications-dist" ]
import Control.Concurrent
import Control.Monad
import Network.HTTP
alphabet = ['a'..'z']
prefixes :: [String]
prefixes = [[a, b, c] | a <- alphabet, b <- alphabet, c <- alphabet]
searchUrl :: String -> String
import Control.Monad
import Network.HTTP
alphabet = "abcdefghijklmnopqrstuvwxyz"
prefixes :: [String]
prefixes = [ [a, b, c] | a <- alphabet, b <- alphabet, c <- alphabet]
searchUrl :: String -> String
searchUrl = ("http://localhost:9000/howMany/" ++)
@robertberry-zz
robertberry-zz / gist:7679248
Created November 27, 2013 17:02
Look at this :-(
public class Blah {
public void blah() {
/**
* Do this here, as otherwise we might end up loading comments twice if the Observable completes before the
* web view HTML renders.
*/
final boolean loadRelated = (relatedContent != null);
new Handler().post(new Runnable() {
@Override
/*
I would say
tabs indent quite far on Github
whereas four spaces do not
*/
{
"EC2SecurityGroup": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "Open up HTTP access to load balancer",
"SecurityGroupIngress": [
{
"IpProtocol": "tcp",
"FromPort": "9000",
"ToPort": "9000",
object ContentApiDataProvider {
// ...
def showAllInterestingData[Q <: ApiClient.ShowParameters[Q] with ApiClient.ShowReferenceParameters[Q]]
(q: Q, apiSpecifier: ApiSpecifier): Q = {
val updatedQueryShowingCommonFields = q.edition(apiSpecifier.contentApiEdition)
.showFields("all")
.showTags("all")
.showMedia("all")
[error] /home/robert/Git/mobile-aggregator/mobile-aggregator/src/main/scala/com/gu/mobileaggregator/dataproviders/ContentApiDataProvider.scala:639: value showFields is not a member of type parameter Owner
[error] possible cause: maybe a semicolon is missing before `value showFields'?
[error] .showFields("all")
[error] ^
[error] /home/robert/Git/mobile-aggregator/mobile-aggregator/src/main/scala/com/gu/mobileaggregator/dataproviders/ContentApiDataProvider.scala:655: value edition is not a member of type parameter Owner
[error] possible cause: maybe a semicolon is missing before `value edition'?
[error] .edition(apiSpecifier.region)
[error] ^
Exception in thread "Thread-22" com.gu.openplatform.contentapi.ApiError: Not Found
at com.gu.openplatform.contentapi.Api$$anonfun$fetch$2.apply(Api.scala:196)
at com.gu.openplatform.contentapi.Api$$anonfun$fetch$2.apply(Api.scala:193)
at dispatch.Promise$$anon$5.dispatch$Promise$$anon$$other$lzycompute(promise.scala:97)
at dispatch.Promise$$anon$5.dispatch$Promise$$anon$$other(promise.scala:97)
at dispatch.Promise$$anon$5$$anonfun$addListener$3.apply(promise.scala:99)
at dispatch.Promise$$anon$5$$anonfun$addListener$3.apply(promise.scala:99)
at dispatch.Promise$$anonfun$foreach$1.apply$mcV$sp(promise.scala:133)
at dispatch.Promise$$anonfun$foreach$1.apply(promise.scala:133)
at dispatch.Promise$$anonfun$foreach$1.apply(promise.scala:133)
package com.gu.openplatform.contentapi.util
import dispatch.{Http, Promise}
import com.gu.openplatform.contentapi.ApiError
object DispatchPromiseInstances {
implicit val promiseMonad: Monad[Promise] = new Monad[Promise] {
def point[A](a: A) = Http.promise(a)