Skip to content

Instantly share code, notes, and snippets.

Avatar
🍫
Life is like a box of chocolates, you never know what you gonna get.

s.shivasurya shivasurya

🍫
Life is like a box of chocolates, you never know what you gonna get.
View GitHub Profile
View service_req_creation_body.json
{
"service_name": "Temp Service",
"service_description": "<p>Hello Text Description</p>",
"is_private": 0,
"service_type": "appointment",
"trainer_id": 18,
"booking_policy": "",
"cancelation_policy": 7,
"reschedule_policy": "7",
"refund_policy": 1,
View axios-sample.js
var axios = require('axios');
var qs = require('qs');
var data = qs.stringify({
'jsonString': '{\n "email" : "srm@gmail.com",\n "role" : "admin",\n "first_name" : "Srirama Moorthy",\n "last_name":"Srm"\n}'
});
var config = {
method: 'post',
url: 'https://api.goschedule.io/users/inviteuser',
headers: {
'X-API-KEY': 'gsid=s%3ADbdXXXXXXXXXXXXXXXXXXXXXXYI5y3kNGxyXcVQqFdHR%2FmAdCh1cM4j1JtcEANILrV2w;',
@shivasurya
shivasurya / template-creator.js
Created May 28, 2020
AWS SES Email Template Create/Update Script Wrapper
View template-creator.js
// install those dependencies first
var minify = require("html-minifier").minify;
var fs = require("fs");
var AWS = require("aws-sdk");
// usage : node .\template-creater.js .\emailtemplate.html emailtemplate.json false emailtemplate-unique-name "Subject for the email"
// 1st Argument => Templated HTML File
// 2nd Argument => Name of the generated template json file
// 3rd Argument => Update or Create template ( boolean )
// 4th Argument => Unique template name
View HTML Timezone Select
<select name="DropDownTimezone" id="DropDownTimezone">
<option value="-12.0">(GMT -12:00) Eniwetok, Kwajalein</option>
<option value="-11.0">(GMT -11:00) Midway Island, Samoa</option>
<option value="-10.0">(GMT -10:00) Hawaii</option>
<option value="-9.0">(GMT -9:00) Alaska</option>
<option value="-8.0">(GMT -8:00) Pacific Time (US &amp; Canada)</option>
<option value="-7.0">(GMT -7:00) Mountain Time (US &amp; Canada)</option>
<option value="-6.0">(GMT -6:00) Central Time (US &amp; Canada), Mexico City</option>
<option value="-5.0">(GMT -5:00) Eastern Time (US &amp; Canada), Bogota, Lima</option>
<option value="-4.0">(GMT -4:00) Atlantic Time (Canada), Caracas, La Paz</option>
@shivasurya
shivasurya / .gitlab-ci.yml
Created Jul 10, 2017
Gitlab Shared Runner CI with Docker Tutorial - Complete Guide on Building Android Studio Project in Gitlab
View .gitlab-ci.yml
image: registry.gitlab.com/yourUsername/yourprojectregisty:latest
before_script:
- chmod +x ./gradlew
build:
script:
- ./gradlew assembleDebug
artifacts:
paths:
@shivasurya
shivasurya / .gitlab-ci.yml
Created Jul 10, 2017
Gitlab Shared Runner CI with Docker Tutorial - Complete Guide on Building Android Studio Project in Gitlab
View .gitlab-ci.yml
build_image:
image: docker:git
services:
- docker:dind
script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
- docker build -t registry.gitlab.com/yourUserName/yourProjectName .
- docker push registry.gitlab.com/yourUserName/yourProjectName:latest
only:
- YOUR_CI_BRANCH_NAME
@shivasurya
shivasurya / Dockerfile
Created Jul 10, 2017
Gitlab Shared Runner CI with Docker Tutorial - Complete Guide on Building Android Studio Project in Gitlab
View Dockerfile
FROM openjdk:8-jdk
MAINTAINER S Shivasurya <s.shivasurya@gmail.com>
ENV ANDROID_TARGET_SDK="25" \
ANDROID_BUILD_TOOLS="25.0.3" \
ANDROID_SDK_TOOLS="24.4.1"
RUN apt-get --quiet update --yes
RUN apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1
@shivasurya
shivasurya / app.js
Last active Apr 28, 2017
Pdf.js example source code - i-visionblog
View app.js
PDFJS.workerSrc = 'build/pdf.worker.js';
var url = 'pdf/appathon.pdf';
var currentPage = 1;
PDFJS.getDocument(url).then(function (pdf) {
PROGRESS.max = pdf.numPages;
PROGRESS.value = 1;
var holder = document.getElementById('canvas')
@shivasurya
shivasurya / auth-google.php
Created Nov 29, 2016
Authenticate with a Backend server (PHP) - Sign-in with Google For Android - i-visionblog
View auth-google.php
/*
MIT License
Copyright (c) [2016] [S Shivasurya]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
View server.js
var express = require('express');
var http = require('http');
var app = express();
var body = require('body-parser');
var geolib = require('geolib');
app.use(body.urlencoded({ extended: false }))
// parse application/json
app.use(body.json())