Skip to content

Instantly share code, notes, and snippets.

Avatar

Dana Majid danamajid

View GitHub Profile
View nosql-done-right-with-dynamodb.js
// See: https://www.youtube.com/watch?v=HaEPXoXVf2k
const AWS = require('aws-sdk');
AWS.config.update({region: 'us-east-1'});
const dynamoDb = new AWS.DynamoDB.DocumentClient({ api_version: '2012-08-10' });
const TABLE = 'single-table-design';
const GSI1 = 'gsi1';
const GSI1PK = `${GSI1}pk`;
const GSI1SK = `${GSI1}sk`;
View example.js
const AWS = require('aws-sdk');
AWS.config.update({region: 'us-east-1'});
const dynamoDb = new AWS.DynamoDB.DocumentClient({ api_version: '2012-08-10' });
const TABLE = 'single-table-design';
const GSI1 = 'gsi1';
const GSI1PK = `${GSI1}pk`;
const GSI1SK = `${GSI1}sk`;
const GSI2 = 'gsi2';
const GSI2PK = `${GSI2}pk`;
@danamajid
danamajid / dropdown-directive
Created Nov 7, 2014
Simple Dropdown Directive AngularJS
View dropdown-directive
app.directive('hasDropdown', function ($window, $timeout) {
return {
restrict: 'A',
replace: false,
link: function (scope, elm, attrs) {
elm.bind("click", open);
function open(e) {
elm[0].classList.add("open");
$timeout(function () {