Skip to content

Instantly share code, notes, and snippets.

Everesting notes

Floods Road: https://www.strava.com/activities/492911911

Choose a good climb. There's a trade off between getting it done quickly on a steep hill and it being hard; compared to an easy climb and it being longer and taking more time. Choose a climb that suits you, my ideal would be mostly seated with the occasional pinch to give you some standing. Be careful with the descent, late at night it gets hard with wildlife, and if it rains it become extra hard.

If possible, choose somewhere without traffic. Ours had none during the night but was quite busy during the day. This was tricky as it was quite a narrow road.

Invite as many people as you can. Sherpas are awesome and will help you through. Rely on them to roll laps, make food, set up camp, get food, etc. You will make it far far harder for yourself if you try to do it solo.

@tomjadams
tomjadams / ExampleServer.scala
Created June 4, 2016 09:38 — forked from vastdevblog/ExampleServer.scala
Example of a Finagle server
package com.vast.example
import java.net.InetSocketAddress
import java.util.UUID
import java.util.concurrent.{Executors, TimeUnit}
import com.google.common.base.Splitter
import com.twitter.finagle.http.Http
import com.twitter.finagle.builder.{Server, ServerBuilder}
import com.twitter.finagle.service.TimeoutFilter
import com.twitter.finagle.{Service, SimpleFilter, GlobalRequestTimeoutException}
@tomjadams
tomjadams / how-to-set-up-stress-free-ssl-on-os-x.md
Created October 29, 2015 22:44 — forked from jed/how-to-set-up-stress-free-ssl-on-os-x.md
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@tomjadams
tomjadams / notes.md
Created July 25, 2011 11:36 — forked from nkpart/notes.md
My Lion Install Notes

Interesting FP Reading

Papers

  • [Why Functional Programming Matters][whyfp]
  • [Applicative Programming with Effects][app]
  • [The Essence of the Iterator Pattern][iter]
  • [Generalising Monads to Arrows][arrows]
package com.foo.http
import scapps.http.BaseApp
import scapps.http.route.OptionKleisli._
import scapps.http.route.Route._
import scalaz._
import scalaz.http.servlet.{HttpServletRequest}
import scalaz.http.response._
import scalaz.http.request._
// OLD
- (NSDictionary *)parsePerks:(NSArray *)perks {
NSMutableArray *convertedPerks = [NSMutableArray arrayWithCapacity:[perks count]];
for (NSDictionary *perk in perks) {
PLPerk *convertedPerk = [[PLPerk alloc] initWithProgramName:[perk objectForKey:@"program_name"]
shortDescription:[perk objectForKey:@"perk_title"] longDescription:[perk objectForKey:@"perk_desc"]
location:[self parseLocation:[perk objectForKey:@"locations"]]];
[convertedPerks addObject:convertedPerk];
[convertedPerk release];
module UserAgentHelper
def on_iphone_like_device?
request && (request.user_agent =~ /iPhone/ || request.user_agent =~ /iPod.*AppleWebKit.*Mobile.*Safari/)
end
end
#!/bin/sh
NUM_CORES=2
FJ_ARTIFACTS_DIR=/home/me/functionaljava/artifacts/latest
cd FJ_ARTIFACTS_DIR
javac -d /tmp/ -classpath functionaljava.jar demo/1.5/concurrent/Fibs.java
java -classpath /tmp/:functionaljava.jar concurrent.Fibs ${NUM_CORES}
+ (FKEither *)doParseContent:(NSString *)rssContent {
PXRss20ParserDelegate *parser = [[PXRss20ParserDelegate alloc] initWithContent:rssContent];
FKEither *maybeItems = [parser.parse.right map:[NSArray liftFunction:[FKFunction functionFromSelector:@selector(parseItem:)]]];
[parser release];
return maybeItems;
}
+ (PXRss20Item *)parseItem:(NSDictionary *)item {
return [PXRss20Item title:[item objectForKey:@"item"] link:[NSURL URLWithString:[item objectForKey:@"link"]] description:[item objectForKey:@"description"]];
}