Skip to content

Instantly share code, notes, and snippets.

View iancrowther's full-sized avatar
💻
01001011 01101111 01101110 01100001 01101101 01101001

Ian Crowther iancrowther

💻
01001011 01101111 01101110 01100001 01101101 01101001
View GitHub Profile
@iancrowther
iancrowther / media.css
Last active August 29, 2015 14:07 — forked from BenHall/media.css
/* iPhone */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 568px) { /* iPhone 5 in portrait & landscape */
}
@media only screen
and (min-device-width : 320px)
and (max-device-width : 568px)
and (orientation : landscape) { /* iPhone 5 in landscape */

Image service - S3 client acess - 1652 ms should allow access to uploaded files by the app - 1041 ms should not allow web access to uploaded files - 392 ms should not allow an unauthorised user to access the bucket - 218 ms

Image service - upload limit - 972 ms should reject uploads if they are over 2MB - 652 ms should allow uploads if they are under 2MB - 320 ms

#uploadFileForPublicAccess - 341 ms

from streams session

  • end-of-stream - specify a callback to be called when a stream ends (which is surpsingly hard to get right)
  • duplexify - compose a Duplex stream from a Readable and a Writable stream
  • pump - pipe streams together and close all of them if one of them closes
  • pumpify - combine an array of streams into a single duplex stream using pump and duplexify
  • through2 - tools for making Transform streams
  • from2 - tools for making Readable streams

from "participatory modules" session

@iancrowther
iancrowther / lambda-not-anon.js
Created October 23, 2015 10:01
The distinction between anonymous functions and lambdas in JavaScript.
// TL;DR - Lambda means "function used as data".
// Anonymous function means "function without a name".
// This is one of the relatively few cases where the Wikipedia definition of
// a word, while not entirely wrong, is misleading. Lambdas and anonymous
// functions are distinct ideas.
// These ideas are commonly confused because in many programming languages
// all lambdas are anonymous or vise verse.
@iancrowther
iancrowther / active.md
Created June 20, 2016 13:04 — forked from paulmillr/active.md
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Fri, 19 Jun 2015 15:17:38 GMT till Sun, 19 Jun 2016 15:17:38 GMT.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user => user.followers > 635)
@iancrowther
iancrowther / fix_github_https_repo.sh
Created October 19, 2016 18:03 — forked from m14t/fix_github_https_repo.sh
Convert HTTPS github clones to use SSH
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."
exit
fi
@iancrowther
iancrowther / update_git_repos.sh
Created September 3, 2018 22:17 — forked from douglas/update_git_repos.sh
Update all git repositories under a base directory
#!/bin/bash
# store the current dir
CUR_DIR=$(pwd)
# Let the person running the script know what's going on.
echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n"
# Find all git repositories and update it to the master latest revision
for i in $(find . -name ".git" | cut -c 3-); do

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@iancrowther
iancrowther / list.txt
Created September 9, 2019 16:05 — forked from shortjared/list.txt
List of AWS Service Principals
acm.amazonaws.com
alexa-appkit.amazon.com
apigateway.amazonaws.com
application-autoscaling.amazonaws.com
appstream.application-autoscaling.amazonaws.com
appsync.amazonaws.com
athena.amazonaws.com
autoscaling.amazonaws.com
batch.amazonaws.com
channels.lex.amazonaws.com