Skip to content

Instantly share code, notes, and snippets.

@qbig
qbig / work-with-db.md
Created August 19, 2018 16:12
Working with Databases

Connecting the database

       package main

       import (
         "database/sql"
         "fmt"

         _ "github.com/lib/pq"
       )
.
├── 00structure.txt
├── Makefile
├── main.go
├── public
│   ├── dev
│   │   └── config.json
│   └── prod
│   └── config.json
└── statik
@radxene
radxene / working_with_files.go
Created October 10, 2017 09:18
Golang - Working with Files
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/*-- CREATE EMPTY FILE --*/
package main
import (
"log"
"os"
)
@alirobe
alirobe / setupWindowsServer2016.ps1
Created September 15, 2017 07:37
setupWindowsServer2016.ps1
##########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <disassembler@dasm.cz>
# Modified by: alirobe <alirobe@alirobe.com> based on my personal preferences.
# Version: 2.6.1, 2017-08-02
# Primary Author Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
# Tweaked Source: https://gist.github.com/alirobe/7f3b34ad89a159e6daa1/
# Tweak difference:
#
# @alirobe's version is a subset focused on safely disabling telemetry, 'smart' features, and 3rd party bloat ...
@jessfraz
jessfraz / boxstarter.ps1
Last active July 7, 2024 22:46
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
#!/usr/bin/python
# python get-all-stash-repos.py [host] [project] [user] [password] [target-root-dir]
import sys
import os
import stashy
import git
import argparse
import getpass
parser = argparse.ArgumentParser(description='get all repositories from stash')
package main
import (
"archive/tar"
"bytes"
"compress/gzip"
"crypto/sha1"
"flag"
"fmt"
"io"
@Lupus
Lupus / jira_oauth.go
Last active February 20, 2023 11:44
Example of using OAuth authentication with JIRA in Go
/*
To the extent possible under law, Konstantin Olkhovskiy has waived
all copyright and related or neighboring rights to this snippet.
CC0 license: http://creativecommons.org/publicdomain/zero/1.0/
*/
package main
import (
"crypto/x509"
@eferro
eferro / _aws_golang_examples.md
Last active July 21, 2023 09:35
golang aws: examples

AWS Golang SDK examples

@r0l1
r0l1 / confirm.go
Last active June 9, 2024 04:38
Go (golang): How to ask for user confirmation via command line
/* MIT License
*
* Copyright (c) 2017 Roland Singer [roland.singer@desertbit.com]
*
* 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
* furnished to do so, subject to the following conditions: