Skip to content

Instantly share code, notes, and snippets.

View percybolmer's full-sized avatar

ProgrammingPercy percybolmer

View GitHub Profile
const HDWalletProvider = require('@truffle/hdwallet-provider');
const fs = require('fs');
const mnemonic = fs.readFileSync(".secret").toString().trim();
module.exports = {
networks: {
development: {
host: "127.0.0.1", // Localhost (default: none)
port: 8545, // Standard BSC port (default: none)
network_id: "*", // Any network (default: none)
// getContractAddress returns the address of the contract
// hardcoded :)
function getContractAddress() {
// replace this to match your contract address
return "0x083863013a6b34a4a265eb6ff696daf35071c48e";
}
package main
import (
"log"
zlog "github.com/rs/zerolog/log"
)
func main() {
log.Print("Hello")
zlog.Print("Hello")
package main
import (
"github.com/rs/zerolog/log"
)
func main() {
// Log with service name
log.Info().
package main
import (
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
)
func main() {
// Apply zerolog global level, this will stop zerolog from logging any debug messages
package main
import (
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
)
var (
HelloCounter = 1
logger zerolog.Logger
JIRA_USER="[email protected]"
JIRA_TOKEN="api-token"
JIRA_URL="https://your-cloud-name.atlassian.com"
package main
import (
"log"
"os"
"github.com/joho/godotenv"
jira "gopkg.in/andygrunwald/go-jira.v1"
)
// getProjects is a function that lists all projects
func getProjects(client *jira.Client) {
// use the Project domain to list all projects
projectList, _, err := client.Project.GetList()
if err != nil {
log.Fatal(err)
}
// Range over the projects and print the key and name
for _, project := range *projectList {
fmt.Printf("%s: %s\n", project.Key, project.Name)
// getIssues will query Jira API using the provided JQL string
func getIssues(client *jira.Client, jql string) {
issues, _, err := client.Issue.Search(jql, nil)
if err != nil {
panic(err)
}
for _, i := range issues {
fmt.Printf("%s (%s/%s): %+v -> %s\n", i.Key, i.Fields.Type.Name, i.Fields.Priority.Name, i.Fields.Summary, i.Fields.Status.Name)
fmt.Printf("Assignee : %v\n", i.Fields.Assignee.DisplayName)