Skip to content

Instantly share code, notes, and snippets.

View mrcnc's full-sized avatar

Marc Cenac mrcnc

View GitHub Profile
@mrcnc
mrcnc / setCookieLambda.js
Last active July 3, 2018 19:53
simple lambda that sets a tracking cookie
'use strict';
// based on this blog post: https://aws.amazon.com/blogs/compute/simply-serverless-using-aws-lambda-to-expose-custom-cookies-with-api-gateway/
exports.handler = (event, context) => {
let cookieKey = process.env.KEY || "wid";
let cookieId = Math.random().toString(36).substring(6);
let domain = process.env.DOMAIN || "127.0.0.1:3000";
let expires = "Fri, 31 Dec 9999 23:59:59 GMT";
let cookieString = `${cookieKey}=${cookieId}; domain=${domain}; expires=${expires};`;
context.done(null, {"Cookie": cookieString});
};
@mrcnc
mrcnc / secretsmanager.sh
Last active July 10, 2023 09:39
aws secrets manager cli usage
aws secretsmanager list-secrets
aws secretsmanager describe-secret \
--secret-id arn:aws:secretsmanager:us-west-2:432117387956:secret:my-db-credentials-Ny5zb7
aws secretsmanager get-secret-value \
--secret-id arn:aws:secretsmanager:us-west-2:432117387956:secret:my-db-credentials-Ny5zb7
aws secretsmanager get-secret-value --secret-id my-db-credentials
@mrcnc
mrcnc / index.html
Created June 13, 2018 21:44
simple s3 uploader
<!DOCTYPE html>
<html>
<head>
<title>Simple Uploader</title>
<meta charset="utf-8">
<script src="https://sdk.amazonaws.com/js/aws-sdk-2.243.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/blueimp-md5/2.10.0/js/md5.min.js"></script>
</head>
@mrcnc
mrcnc / un-photo-test.geojson
Created April 7, 2018 11:28
you can upload this if you want to test creating a layer that's photo enabled
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mrcnc
mrcnc / style.json
Last active March 8, 2018 19:04
test raster tile mb style doc
{
"layers": [
{
"id": "simple-tiles",
"maxzoom": 22,
"minzoom": 0,
"source": "simple-tiles",
"type": "raster"
}
],
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mrcnc
mrcnc / geos.rb
Last active December 7, 2017 20:40
Homebrew formula for installing GEOS 3.6.1 on macOS/OS X
class Geos < Formula
desc "Geometry Engine"
homepage "https://trac.osgeo.org/geos"
url "http://download.osgeo.org/geos/geos-3.6.1.tar.bz2"
sha256 "4a2e4e3a7a09a7cfda3211d0f4a235d9fd3176ddf64bd8db14b4ead266189fc5"
bottle do
cellar :any
sha256 "02aa28dcfd38747e924fa486b1607c90ddf5e18c7a400510e3d7f12ef6b90d86" => :sierra
sha256 "b4f3fd82b0f39f109ff3da7d5027471c8c2bc8f39bc24198af145df9d3576a71" => :el_capitan
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mrcnc
mrcnc / index.html
Created December 7, 2017 02:23
a simple openlayers map displaying satellite imagery from gis.nola.gov
<!DOCTYPE html>
<html>
<head>
<title>New Orleans Satellite Imagery</title>
<link rel="stylesheet" href="//openlayers.org/en/latest/css/ol.css" type="text/css">
<script src="//openlayers.org/en/latest/build/ol.js"></script>
</head>
<body>
<div id="map" class="map"></div>
<script>
@mrcnc
mrcnc / racks.geojson
Created October 25, 2017 15:38
nola bike racks
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.