Skip to content

Instantly share code, notes, and snippets.

View kameshsampath's full-sized avatar

Kamesh Sampath kameshsampath

View GitHub Profile
@kameshsampath
kameshsampath / ow_promise_blog_working.js
Last active February 23, 2018 05:38
The working version of the api
'use strict';
const gmap = require('@google/maps');
function location(params) {
const latlng = JSON.parse(JSON.stringify(params.coords))
const gmapClient = gmap.createClient({
key: process.env.GOOGLE_MAPS_API_KEY,
@kameshsampath
kameshsampath / photobooth.html
Last active September 24, 2018 16:47
How to use fabricjs and HTML5 to create a image application
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Collaby by Code :: Demo Code for Photo and Filter</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- the javascript library used for build the Photo with Frames -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/2.3.6/fabric.min.js"></script>

Run Strimzi on Minishift

As a cluster-admin user, with a correctly running Minishift, perform the following steps:

#!/usr/bin/env bash

# Turn colors in this script off by setting the NO_COLOR variable in your
# environment to any value:
#
@kameshsampath
kameshsampath / istio_minshift_profile.sh
Last active October 6, 2018 04:59
Commands required to setup minishift profile for Istio
#!/bin/bash
set -e
# Create a profile called "servicemesh"
minishift profile set servicemesh
# give the profile 8GB of memory
minishift config set memory 8GB
# give the profile 4 CPU
minishift config set cpus 4
# adding container image caching to allow faster profile setup
#!/bin/bash
set -e
git clone https://github.com/minishift/minishift-addons
minishift addon install ./minishift-addons/add-ons/istio
#!/bin/bash
set -e
minishift addon enable istio
minishift addon apply istio
@kameshsampath
kameshsampath / building_service.sh
Last active February 13, 2019 09:52
gist for medium story
cd $PROJECT_HOME/service
kubectl create namespace demos
kubectl label namespace demos istio-injection=enabled
eval $(minikube docker-env)
docker build -t dev.local/rhdevelopers/node-greeter:0.0.1 .
kubectl apply -f service.yaml -n demos
INGRESSGATEWAY=istio-ingressgateway
IP_ADDRESS="$(minishift ip):$(kubectl get svc $INGRESSGATEWAY --namespace istio-system --output 'jsonpath={.spec.ports[?(@.port==80)].nodePort}')"
curl -H "Host: greeter.demos.example.com" $IP_ADDRESS
Instead of creating a new gist, you can update an existing one by passing its ID
or URL with "-u". For this to work, you must be logged in, and have created the
original gist with the same GitHub account.
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app: customer
version: v1
name: customer
spec:
replicas: 1
selector: