Git Product home page Git Product logo

gists's Introduction

Gists

Welcome to the Gists repository of SLIIT FOSS. This repository is dedicated to hosting and sharing various code snippets, scripts, notes, and ideas contributed by members of our community. Whether you're a beginner exploring programming concepts or an experienced developer looking to share helpful code snippets, this is the place for you.

Volume 1

Volume 2

gists's People

Contributors

gihaa avatar quintusjoyal avatar mrmihi avatar thulinawickramasinghe avatar dinal-qlub avatar

Stargazers

Deshan-Samarathunga avatar Thathsara Pramodya Thalangama avatar tniromin avatar  avatar  avatar

Watchers

Nandun Bandara avatar  avatar

gists's Issues

How to invoke Azure Functions

// Use this to access the input data passed while manually invoking a timer trigger
const requestData = context.bindingData[context.executionContext?.functionName]

// Add the following as a pre-request script in postman while making the request
pm.request.body.update({
 mode: "raw",
 raw: JSON.stringify({
    input: JSON.stringify(JSON.parse(pm.request.body.raw).input)
}),
 options: {
     raw: {
         language: "json"
     }
 }
})

Defines a task for VSCode

{
    "version": "2.0.0",
    "tasks": [
      {
        "label": "Start Server",
        "type": "shell",
        "command": "yarn dev",
        "group": "none",
        "presentation": {
          "reveal": "always",
          "panel": "new"
        },
        "runOptions": {
          "runOn": "folderOpen"
        }
      }
    ]
  }

Git commit from user pool

Could someone please help migrate this over to the instructed markdown format which this repository follows

Description:

 Makes things a little bit faster if you were to commit as multiple users to a single repository

Usage:

 - sh cfup "chore: some commit message" - Commits and pushes as a random user from the pool
 
 - sh cfup "chore: some commit message" shelob - Commits and pushes as user shelob

Script:

#!/bin/bash

message=$1
user=$2

configure_commit_push() {
   git config user.name "$1"
   git config user.email "$2"
   git add . && git commit -m "$message" && git push
}

talion() {
    configure_commit_push "Talion" "[email protected]"
}

celebrimbor() {
    configure_commit_push "Celebrimbor" "[email protected]"
}

shelob() {
    configure_commit_push "Shelob" "[email protected]>"
}

functions=("talion" "celebrimbor" "shelob")

if [ -z "$user" ]; then
    random_function=${functions[$RANDOM % ${#functions[@]}]}
    $random_function
elif type "$user" >/dev/null 2>&1; then
    $user
else
    echo "Invalid user provided."
fi

Deletes all topics in a service bus

resource_group=your_rg
namespace=your_namespace

topics=$(az servicebus topic list --resource-group $resource_group --namespace-name $namespace)

ids=""

for i in $(seq 0 $(echo "${topics}" | jq '. | length'))
do
   ids="$ids $(echo "${topics}" | jq ".[$i].id")"
done

az servicebus topic delete --resource-group $resource_group --namespace-name $namespace --ids $ids

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.