Skip to content

Instantly share code, notes, and snippets.

View prashanth-sams's full-sized avatar
🍎
Each day is interesting!!!

Prashanth Sams prashanth-sams

🍎
Each day is interesting!!!
View GitHub Profile
@prashanth-sams
prashanth-sams / testrail_config.rb
Created April 15, 2019 17:46
TestRail configuration
class TestrailConfig
attr_reader :config
CONFIG_FILE = './testrail_config.yml'
def initialize
if File.exist? CONFIG_FILE
@config = YAML.load_file(CONFIG_FILE)
raise 'configuration not loaded successfully' if @config.nil?
@prashanth-sams
prashanth-sams / testrail_uploader.rb
Created April 14, 2019 08:08
Upload test results in TestRail app
require_relative '../../features/helpers/testrail'
class ResultUploader
attr_accessor :client
def initialize(scenario)
@scenario = scenario
@config = TestrailConfig.new.config['testrail']
setup_testrail_client
@prashanth-sams
prashanth-sams / testrail.rb
Last active April 14, 2019 06:46
TestRail Ruby API
#
# TestRail API binding for Ruby (API v2, available since TestRail 3.0)
#
# Learn more:
#
# http://docs.gurock.com/testrail-api2/start
# http://docs.gurock.com/testrail-api2/accessing
#
# Copyright Gurock Software GmbH. See license.md for details.
#
@prashanth-sams
prashanth-sams / github-emoji.md
Created April 4, 2019 08:39
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
# Description:
# Show open issues from a Github repository
# Commands:
# hubot label <label> -- Lists all the closed issues with specific label.
_ = require("underscore")
module.exports = (robot) ->
github = require("githubot")(robot)
@prashanth-sams
prashanth-sams / github_list_closed_issues_with_label.coffee
Last active March 25, 2019 14:51
GitHub closed issues 1 - Chatbot
# Description:
# Show closed issues from a Github repository
# Commands:
# hubot closed <assignee> <label> -- Lists all the closed issues with specific label.
_ = require("underscore")
module.exports = (robot) ->
github = require("githubot")(robot)
@prashanth-sams
prashanth-sams / hubot_node_cron.js
Created March 25, 2019 07:50
Hubot - Cron job 1
const cron = require("node-cron");
module.exports = robot => {
new cron.schedule("*/1 * * * *", function() {
robot.messageRoom(
"website", `I am running once in every 1 minute`
)
});
}
@prashanth-sams
prashanth-sams / hubot_cron.js
Last active March 25, 2019 07:50
Hubot - Cron job 2
const CronJob = require("cron").CronJob
module.exports = robot => {
new CronJob(
"00 37 16 * * *",
function() {
try {
robot.messageRoom(
"general", `Hey Prashanth! You got a notification message now`
)
const express = require('express');
const app = express();
const ServerPortRouter = express.Router();
const ServerPort = require('../models/ServerPort');
ServerPortRouter.route('/add').post(function (req, res) {
const serverport = new ServerPort(req.body);
serverport.save()
.then(serverport => {
@prashanth-sams
prashanth-sams / sonar.sh
Created January 23, 2019 14:47 — forked from guiwoda/sonar.sh
Run sonarqube analysis
#!/bin/bash
if [ "$PULL_REQUEST_NUMBER" == "false" ]; then
~/sonar-scanner/sonar-scanner-2.8/bin/sonar-scanner -Dsonar.analysis.mode=preview \
              -Dsonar.github.repository=$SEMAPHORE_REPO_SLUG \
              -Dsonar.github.oauth=$GITHUB_TOKEN \
              -Dsonar.host.url=$SONAR_HOST_URL \
              -Dsonar.login=$SONAR_TOKEN
else
~/sonar-scanner/sonar-scanner-2.8/bin/sonar-scanner -Dsonar.analysis.mode=preview \