Skip to content

Instantly share code, notes, and snippets.

@bhameyie
bhameyie / vms.tf
Created January 16, 2015 21:01
Sample terraform vms
variable "memory" {}
variable "environment" {}
variable "version" {}
variable "region" {}
variable "aws_secretkey" {}
variable "aws_accesskey" {}
variable "docker_email" {}
variable "docker_user" {}
variable "docker_pass" {}
@bhameyie
bhameyie / terraform.tfvars
Created January 16, 2015 20:50
Sample variables files
docker_email = "yours"
docker_user = "yours"
docker_pass = "yours"
mongo_uri = "yours"
neo4j_uri = "yours"
rabbit_uri = "amqp://yours"
aws_accesskey = "yours"
aws_secretkey = "yours+yours+yours"
pub_key = "/yours/.ssh/deployment.pub"
pvt_key = "/yours/.ssh/deployment"
//NOTE: written in older version of Swift back in January 2015. Swift has since changed a bit.
import Foundation
import UIKit
class UploadViewController: UIViewController,CLUploaderDelegate
{
@IBOutlet weak var capturedImage: UIImageView!
var Cloudinary:CLCloudinary!
var image:UIImage?
#ifndef EL_Bridging_Header_h
#define EL_Bridging_Header_h
#import "Cloudinary.h"
#endif
@bhameyie
bhameyie / ImageCaptureController.swift
Created January 8, 2015 11:36
Sample controller to pick image either from gallery or from camera via 2 buttons
import Foundation
import MobileCoreServices
import UIKit
class ImageCaptureController: UIViewController,UINavigationControllerDelegate, UIImagePickerControllerDelegate
{
override func viewDidLoad() {
super.viewDidLoad()
@bhameyie
bhameyie / ChangeLogs.rb
Last active August 29, 2015 13:57
Getting change logs between latest and previous tags
`git fetch --tags`
tag_name = `git describe --abbrev=0`.split("\n")[0]
current_tag= tag_name.gsub(".","").to_i
tags_dictionary = Hash[`git tag`.split("\n").map{|tag| [tag.gsub(".","").to_i, tag]}]
tags = `git tag`.split("\n").collect{|tag| tag.gsub(".","").to_i}
tags.sort
tagIndex= tags.index(current_tag)
previous_tag=tags[tagIndex-1]
public class WebApiApplication : System.Web.HttpApplication {
[ImportMany]
List<IComposableApiMetadata> m_composers;
private CompositionContainer m_container;
protected void Application_Start() {
var catalog = new AggregateCatalog();
var servicesFolder = @"C:\dllFolder";
@bhameyie
bhameyie / ExternalApiMetadata.cs
Created February 1, 2014 00:19
Sample Metadata for ASP.NET WebAPi service composition
[Export(typeof(IComposableApiMetadata))]
public class ExternalApiMetadata : IComposableApiMetadata {
public void Compose(ContainerBuilder builder) {
builder.Register(e => new BookRepository()).As<IBookRepository>().InstancePerApiRequest();
}
public Assembly ApiAssembly() {
return typeof(BooksController).Assembly;
}
}
@bhameyie
bhameyie / IComposableApiMetadata.cs
Created February 1, 2014 00:11
Api interface for WebApi service comoposition
public interface IComposableApiMetadata
{
void Compose(ContainerBuilder builder);
Assembly ApiAssembly();
}
@bhameyie
bhameyie / codeship
Last active August 29, 2015 13:55
Codeship commands to deploy scalatra app to Elastic Beanstalk
pip install ebs-deploy
ebs-deploy init
ebs-deploy deploy --environment muzzy-app-dev