Skip to content

Instantly share code, notes, and snippets.

@jrcryer
jrcryer / .jscsrc
Last active December 14, 2015 20:49
jshint + jscs (jshintignore, jshintrc, jscs)
{
"preset": "google",
"fileExtensions": [".js", "jscs"],
"requireSemicolons": true,
"requireParenthesesAroundIIFE": true,
"maximumLineLength": 120,
"validateLineBreaks": "LF",
"validateIndentation": 4,
//
// KizuWifiIcon.h
// Kizu
//
// Created by James Cryer on 13/06/2015.
// Copyright (c) 2015 KIZU Ltd. All rights reserved.
//
#import <UIKit/UIKit.h>
@jrcryer
jrcryer / gist:3af95c61f5752489e55d
Created July 7, 2015 10:35
Using Packages and Native nodejs Modules in AWS Lambda

Currently:

$ PKG_CONFIG_PATH=~/opencv/lib/pkgconfig/  npm install –prefix=~/opencv_example opencv

Should be:

$ PKG_CONFIG_PATH=~/opencv/lib/pkgconfig/  npm install --prefix=~/opencv_example opencv
diff --git a/app/uk/co/bbc/travel/models/Report.scala b/app/uk/co/bbc/travel/models/Report.scala
index 892d34f..dc2f780 100644
--- a/app/uk/co/bbc/travel/models/Report.scala
+++ b/app/uk/co/bbc/travel/models/Report.scala
@@ -22,7 +22,6 @@ object Report {
report.name = map("name")
report.updated = map("updated")
report.fileSize = map("fileSize")
- report.summary = service.getObjectSummaries(map("key"))
report
@jrcryer
jrcryer / gist:d7f2c92e8253d6c57fb1
Created September 24, 2014 14:49
DynamoDB Ruby
#require 'rubygems'
require 'aws-sdk'
dynamo_db = AWS::DynamoDB.new
table = dynamo_db.tables['table-name']
table.load_schema
table.items.each do |incident|
attributes = incident.attributes.to_hash
locations = attributes['locations']
@jrcryer
jrcryer / gist:bd2ffc800bb63e8c9220
Last active July 18, 2019 10:55
DynamoDB Local Starter
#!/bin/bash
WORKING_DIR="dynamodb"
VERSION="dynamodb_local_2014-04-24"
ARCHIVE="${VERSION}.tar.gz"
URL="https://s3-us-west-2.amazonaws.com/dynamodb-local/${ARCHIVE}"
PID_FILE="${WORKING_DIR}/PID"
download() {
@jrcryer
jrcryer / Dockerfile
Created June 29, 2014 00:26
MongoDb Dockerfile
############################################################
# Dockerfile to build MongoDB container images
# Based on Ubuntu
############################################################
# Set the base image to Ubuntu
FROM ubuntu
# File Author / Maintainer
MAINTAINER James Cryer
We're all familiar with the performance recommendations regarding content deliver (e.g. reducing and minizing data transfer between server and client) but we are now faced with a new challenge: browser rendering performance. It's time to get jank busting! As developers we need to arm ourselves with techniques and tools to remove the janky experience from our apps.
We'll explore some of the most common rendering bottlenecks and the tools available to identify and analyse these issues.
@jrcryer
jrcryer / Gruntfile.coffee
Created December 29, 2013 01:30
Gruntfile for Jekyll workflow when working with Github pages. Includes LiveReload, JSHint, SASS and ImageMin.
module.exports = (grunt) ->
require('time-grunt')(grunt)
require('matchdep').filterDev('grunt-*').forEach grunt.loadNpmTasks
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
paths:
images: "img"
js: "js"
@jrcryer
jrcryer / gist:7926686
Last active December 31, 2015 03:19
12 months of workflow optimisation... notes

Day 0

  • CSS preprocessor
  • PHPCS
  • In house tool
  • Maintained by ourselves and new features had to be compiled built and run

Month 1