This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"LaunchConfig": { | |
"Type": "AWS::AutoScaling::LaunchConfiguration", | |
"Metadata": { | |
"AWS::CloudFormation::Authentication" : { | |
"distributionAuthentication" : { | |
"type": "S3", | |
"roleName": "role name here", | |
"buckets": [ "mobile-notifications-dist" ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/" ++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
I would say | |
tabs indent quite far on Github | |
whereas four spaces do not | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"EC2SecurityGroup": { | |
"Type": "AWS::EC2::SecurityGroup", | |
"Properties": { | |
"GroupDescription": "Open up HTTP access to load balancer", | |
"SecurityGroupIngress": [ | |
{ | |
"IpProtocol": "tcp", | |
"FromPort": "9000", | |
"ToPort": "9000", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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] ^ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |