Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Jeshan Giovanni BABOOA jeshan

🏠
Working from home
View GitHub Profile
@jeshan
jeshan / cdk-profile-plugin.js
Last active Jul 26, 2020
How to select AWS profiles per account in AWS CDK
View cdk-profile-plugin.js
const { CredentialProviderChain } = require('aws-sdk');
const AWS = require('aws-sdk');
const accountProvider = require('./account-provider');
let getEnv = function(accountId) {
// TODO: insert logic to get your desired profile name
return profileName;
};
let getProvider = async (accountId, mode) => {
@jeshan
jeshan / config
Created Apr 1, 2019 — forked from justinpawela/config
AWS CodeCommit Multiple Account Config
View config
# This file is: ~/.ssh/config
# You may have other (non-CodeCommit) SSH credentials stored in this
# config file – in addition to the CodeCommit settings shown below.
# NOTE: Make sure to run [ chmod 600 ~/.ssh/config ] after creating this file!
# Credentials for Account1
Host awscc-account1 # 'awscc-account1' is a name you pick
Hostname git-codecommit.us-east-1.amazonaws.com # This points to CodeCommit in the 'US East' region
@jeshan
jeshan / cognito.yaml
Created Feb 4, 2018 — forked from singledigit/cognito.yaml
Create a Cognito Authentication Backend via CloudFormation
View cognito.yaml
AWSTemplateFormatVersion: '2010-09-09'
Description: Cognito Stack
Parameters:
AuthName:
Type: String
Description: Unique Auth Name for Cognito Resources
Resources:
# Creates a role that allows Cognito to send SNS messages
@jeshan
jeshan / wildfly-install.sh
Last active Oct 16, 2017 — forked from sukharevd/wildfly-install.sh
Script to install JBoss Wildfly 10.x as service in Linux
View wildfly-install.sh
#!/bin/bash
#title :wildfly-install.sh
#description :The script to install Wildfly 10.x
#more :http://sukharevd.net/wildfly-8-installation.html
#author :Dmitriy Sukharev
#date :2016-06-18T02:45-0700
#usage :/bin/bash wildfly-install.sh
#tested-version1 :10.0.0.CR3
#tested-distros1 :Ubuntu 15.10; Debian 7,8; CentOS 7; Fedora 22
#tested-version2 :10.0.0.Final
@jeshan
jeshan / get-lambda-event-source.js
Last active Sep 22, 2020
AWS Lambda: Determine Event Source from event object. Note that this is an approximation as anybody can send a payload that resembles the real thing.
View get-lambda-event-source.js
function getLambdaEventSource(event) {
if (event.Records && event.Records[0].cf) return 'isCloudfront';
if (event.configRuleId && event.configRuleName && event.configRuleArn) return 'isAwsConfig';
if (event.Records && (event.Records[0].eventSource === 'aws:codecommit')) return 'isCodeCommit';
if (event.authorizationToken === "incoming-client-token") return 'isApiGatewayAuthorizer';
if (event.StackId && event.RequestType && event.ResourceType) return 'isCloudFormation';
View gist:53bd7477b476e61e80f1e3560f7599c5
app.factory('PaypalService', ['$q', '$ionicPlatform', 'shopSettings', '$filter', '$timeout', function ($q, $ionicPlatform, shopSettings, $filter, $timeout) {
var init_defer;
/**
* Service object
* @type object
*/
var service = {
View angular-intro-12.html
<!DOCTYPE html>
<html ng-app='angularApp'>
<head>
<script src="https://code.jquery.com/jquery.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet" type="text/css" />
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<meta name="description" content="angular-intro-11; internationalisation">
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<script src="//code.angularjs.org/1.3.2/i18n/angular-locale_en-gb.js"></script>
View ionic-yeoman-source-layout.txt
.
├── app
│   ├── bower_components
│   └── main
├── gulp
├── hooks
│   └── after_prepare
├── node_modules
│   ├── abbrev
View calendar-add-anonymous-class.java
calendar.add(new Appointment() {{
name("birthday party");
at(fourPM);
}});
View get-me-some-html-fluent.java
public String getMeSomeHtml() {
return html()
.head()
.meta("charset", "UTF-8")
.meta("viewport", "width=device-width")
.html()
.body()
.paragraph("hello, world!")
.heading(Heading.Level.ONE, "Level one text")
.html().toString();
You can’t perform that action at this time.