Skip to content

Instantly share code, notes, and snippets.

View pulpfree's full-sized avatar
💭
Enjoying the benefits of AWS Lambda and Golang

Ron Dyck pulpfree

💭
Enjoying the benefits of AWS Lambda and Golang
View GitHub Profile
@pulpfree
pulpfree / mongodb-s3-backup.sh
Created July 26, 2017 03:26 — 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
@pulpfree
pulpfree / types.js
Created February 2, 2017 14:54 — forked from alexnm/types.js
const QUACK = "app/duck/QUACK";
const SWIM = "app/duck/SWIM";
export default {
QUACK,
SWIM
};
@pulpfree
pulpfree / ec2.tf
Created January 25, 2017 22:18 — forked from solarce/ec2.tf
terraform.io example template for ec2 instance with tags
# The various ${var.foo} come from variables.tf
# Specify the provider and access details
provider "aws" {
region = "${var.aws_region}"
access_key = "${var.aws_access_key}"
secret_key = "${var.aws_secret_key}"
}
<!DOCTYPE html>
<!--
Created using JS Bin
http://jsbin.com
Copyright (c) 2016 by yelouafi (http://jsbin.com/sodowa/9/edit)
Released under the MIT license: http://jsbin.mit-license.org
-->
<meta name="robots" content="noindex">
@pulpfree
pulpfree / baseResolvers.js
Created December 6, 2016 02:25 — forked from thebigredgeek/baseResolvers.js
Breed-able Resolvers
import { AlreadyAuthenticatedError, NotAuthenticatedError, NotAuthorizedError } from '../errors/functional';
import createResolver from '../lib/createResolver';
export const baseResolver = createResolver();
export const isAuthenticatedResolver = baseResolver.createResolver(
(root, args, context) => {
if (!context.user || !context.user.id) throw new NotAuthenticatedError();
}
server {
server_name www.theteachableproject.org;
return 301 $scheme://theteachbleproject.org$request_uri;
}
server {
listen 80;
listen 443 ssl;
server_name theteachableproject.org;
@pulpfree
pulpfree / delay-$watch
Last active August 29, 2015 14:08
Delay angularjs $watch response
// Taken from: http://stackoverflow.com/questions/20397253/implement-a-delay-on-scope-watch
var timeoutPromise;
var delayInMs = 0;
vm.isEdit = false;
$scope.$watch(function () {
return vm.editId;
}, function (currentValue) {
$timeout.cancel(timeoutPromise); //does nothing, if timeout alrdy done
@pulpfree
pulpfree / gist:6bcd4f63ae7a96f7a64a
Created May 6, 2014 13:15
apigiility file upload output
The $data var in POST (create) returns:
stdClass Object
(
[field_name] => slide_image
[file_type] => image/jpeg
[file_resize] => {"width":900,"height":700}
[name] => aaa
[caption] => aaa
[slideshow_id] => 53501394499c13a204d63af2
)

AngularJS Floating Menu

Wanted to test creating a AngularJS directive for dragging an element containing other transcluded elements, mainly other draggable items as well as the accordion directive from AngularJS-UI-Bootstrap

A Pen by Ron Dyck on CodePen.

License.

@pulpfree
pulpfree / OSX-php-install.md
Last active January 1, 2016 21:19
php install instruction for OS X Mavericks

PHP install on Fresh OS X Mavericks

Rename (or delete) existing php binaries

sudo mv /usr/bin/php /usr/bin/php.bak
sudo mv /usr/bin/php-config /usr/bin/php-config.bak
sudo mv /usr/bin/phpize /usr/bin/phpize.bak

Fetch brew taps and install php