Skip to content

Instantly share code, notes, and snippets.


Jake Marsh jakemmarsh

View GitHub Profile
tomduncalf / example.js
Last active Mar 23, 2021
How to upload a local (iOS filesystem) file to S3 using React Native with temporary credentials
View example.js
* I recently needed to upload a file from the phone's filesystem to S3 using temporary credentials
* (i.e. access key, secret key and session token) issued by an API for a React Native application,
* without the overhead of Base64 encoding the file and passing it over the bridge (as it could be
* several MB big), and wanted to avoid writing native code to do this.
* None of the S3 libraries online worked with the temporary credentials, but I figured out a
* solution using the official AWS SDK (which is good, as it supports all the relevant authentication
* out of the box) and the react-native-fetch-blob module, which allows you to upload directly from the
* filesystem with the correct Content-type header (as far as I can tell, React Native's fetch only
moea / nginx.config
Created Feb 11, 2016
Place in .ebextensions to increase Nginx timeout in a non-Docker AWS Elastic Beanstalk Worker Environment
View nginx.config
mode: "000644"
owner: root
group: root
content: |
proxy_send_timeout 1200;
proxy_read_timeout 1200;
send_timeout 1200;
itskingori /
Last active Dec 24, 2017
Example to show how to integrate a site with AnnotatorJS with Store. Includes the Javascript part as well as some server side token generators : one in Ruby and the other in Python.

Replace the Auth options hash value having token: <TOKEN_FOR_TESTING_THAT_LASTS_FOR_A_DAY> with an actual token. This token can be generated by the server side scripts and copied in. It supercedes the tokenUrl: if set.

Just to be 100% sure, feel free to verify the validity of the JSON Web Token generated using, JWT debugger. Oh, and the TTL is set to 86400 which is a day. Enough time to generate a token and play around with it.

Ps: If there are any amendments that I can make to improve clarity or fix issues, feel free to leave a comment below. I'll get a notification and act on it as soon as I can.

Ps 2: I was experiencing an issue with CORS and so I submitted the issue (and this code) to the annotator-dev mailing list. Check the July 2014 archives for an email with the subject ... '[annotator-dev] Integrating Site With AnnotateIt Store'.

constellates / timeago.filter.js
Last active Aug 29, 2015 — forked from rodyhaddad/timeago.filter.js
A time ago filter with built in timezone conversion from a UTC time source.
View timeago.filter.js
.filter('timeago', function () {
* time: the time
* local: compared to what time? default: now
* raw: wheter you want in a format of "5 minutes ago", or "5 minutes"
// parse string date to milliseconds
// Note: months are 0-based
idosela / http-response-interceptor.js
Last active Sep 9, 2020
Sample code for ng-conf 2014
View http-response-interceptor.js
angular.module('myMdl', []).config(['$httpProvider', function($httpProvider) {
'$q', '$templateCache', 'activeProfile',
function($q, $templateCache, activeProfile) {
// Keep track which HTML templates have already been modified.
var modifiedTemplates = {};
// Tests if there are any keep/omit attributes.
var HAS_FLAGS_EXP = /data-(keep|omit)/;
ndarville /
Last active Oct 7, 2021
Business models based on the compiled list at I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models


Models Examples
Display ads Yahoo!
Search ads Google
sekati /
Created Jul 24, 2012
Xcode Auto-increment Build & Version Numbers
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)