Skip to content

Instantly share code, notes, and snippets.

View dsandor's full-sized avatar

David Sandor dsandor

View GitHub Profile
angular.module('d3AngularApp', ['d3'])
.directive('d3Bars', ['$window', '$timeout', 'd3Service',
function($window, $timeout, d3Service) {
return {
restrict: 'A',
scope: {
data: '=',
label: '@',
onClick: '&'
},
@dsandor
dsandor / MaterialTextInput.js
Created May 8, 2017 20:07
Material UI inspired TextInput for React Native
'use strict';
import React, { Component } from 'react';
import {
View,
TextInput,
Dimensions,
Animated,
StyleSheet
} from 'react-native';
@dsandor
dsandor / 0-README.md
Last active June 8, 2017 12:47 — forked from sc0ttkclark/0-README.md
PhpStorm.app Mac integration with Tower.app for diff and merge - https://youtrack.jetbrains.com/issue/WI-26090

Changed Php to Web for use with WebStorm.

WebStorm.app Mac integration with Tower.app for diff and merge

You must place both files in the ~/Library/Application Support/com.fournova.Tower2/CompareTools/ directory and chmod +x webstorm.sh

This integration is based on the one I found for Beyond Compare's beta integration:

https://github.com/tednaleid/git-tower-beyond-compare-shim

@dsandor
dsandor / mongodb-s3-backup.sh
Created August 23, 2019 13:10 — forked from eladnava/mongodb-s3-backup.sh
Automatically backup a MongoDB database to S3 using mongodump, tar, and awscli (Ubuntu 14.04 LTS)
#!/bin/sh
# Make sure to:
# 1) Name this file `backup.sh` and place it in /home/ubuntu
# 2) Run sudo apt-get install awscli to install the AWSCLI
# 3) Run aws configure (enter s3-authorized IAM user and specify region)
# 4) Fill in DB host + name
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket)
# 6) Run chmod +x backup.sh
# 7) Test it out via ./backup.sh
@dsandor
dsandor / template.yaml
Last active March 19, 2023 14:22
CloudFormation Template Example - Subscribe a Lambda to an SNS Topic
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
example-lambda-sns
Example CloudFormation template to subscribe a lambda to an SNS Topic.
Resources:
ExampleTopic:
Type: AWS::SNS::Topic
Properties:

Keybase proof

I hereby claim:

  • I am dsandor on github.
  • I am dsandor (https://keybase.io/dsandor) on keybase.
  • I have a public key ASCmCwOje9FkvgCByw49ng6RysmaFVUJLKfp9qLvoEfvQgo

To claim this, I am signing this object:

@dsandor
dsandor / template.yaml
Created January 2, 2020 20:58
SAM Template to connect a Lambda up to an S3 file event.
AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Globals:
Function:
MemorySize: 128
Timeout: 15
Resources:
# Roles
AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Globals:
Function:
MemorySize: 128
Timeout: 15
Resources:
# Permissions
AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Globals:
Function:
MemorySize: 128
Timeout: 15
Resources:
# S3 Bucket
module.exports.handler = (event) => {
console.log('event:\n', JSON.stringify(event));
};