Skip to content

Instantly share code, notes, and snippets.

miguelmota / cmd.go
Created Oct 7, 2018
Golang cobra example
View cmd.go
package cmd
import (
server ""
drandarov-io / D.R.Y. - Reuse Gradle repository definition
Last active May 28, 2019
D.R.Y. - Reuse Gradle repository definition
View D.R.Y. - Reuse Gradle repository definition
This works however:
#### build.gradle
buildscript {
// Repository Configuration
ext.repos = {
maven { url '' }
h4cc / Makefile
Last active Jul 11, 2021
Ubuntu 18.04 Bionic Beaver - Basic packages i usually install
View Makefile
# Ubuntu 18.04 (Bionic Beaver)
# Basic packages i usually install.
# Author: Julius Beckmann <>
# Upgraded Script from 17.04:
# Upgraded Script from 16.04:
tomcatzh / readwrite.go
Created Apr 1, 2015
Golang readline and writeline
View readwrite.go
func readLines(path string) ([]string, error) {
file, err := os.Open(path)
if err != nil {
return nil, err
defer file.Close()
var lines []string
scanner := bufio.NewScanner(file)
for scanner.Scan() {
docwhat / example1
Created Dec 7, 2015
choco install dotnet3.5 fails (but succeeds?)
View example1
PS C:\Users\Administrator> choco install dotnet3.5 -debug -yes
Chocolatey is running on Windows v 6.3.9600.0
Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
Command line: "C:\ProgramData\chocolatey\choco.exe" install dotnet3.5 -debug -yes
Received arguments: install dotnet3.5 -debug -yes
NOTE: Hiding sensitive configuration data! Please double and triple
check to be sure no sensitive data is shown, especially if copying
output to a gist for review.
romaninsh / lambda-vpc-internet-access-cloudformation.yml
Last active Dec 22, 2021
CloudFormation template implementing Private network which can be used by Serverless to deploy Lambda into VPCs an maintaining internet access
View lambda-vpc-internet-access-cloudformation.yml
# Add the following to your existing VPC CF stack
# create 2 subnets, lambdas like to be in multiple subnets
Type: AWS::EC2::Subnet
VpcId: !Ref VPC
AvailabilityZone: !Select [ 0, !GetAZs ]
CidrBlock: !Ref Private1CIDR
madevelopers / readzip.go
Created Jan 29, 2015
golang: Read zip file
View readzip.go
package main
import (
type myCloser interface {
Close() error
matthewpalmer / pod.yaml
Last active Mar 7, 2022
Example Kubernetes pod for the multi-container sidecar design pattern
View pod.yaml
# Example YAML configuration for the sidecar pattern.
# It defines a main application container which writes
# the current date to a log file every five seconds.
# The sidecar container is nginx serving that log file.
# (In practice, your sidecar is likely to be a log collection
# container that uploads to external storage.)
# To run:
espaciomore /
Last active Apr 5, 2022
Watch command for Git Bash
while(true); do
echo -e "${OUTPUT[@]}"
schacon / gist:942899
Created Apr 26, 2011
delete all remote branches that have already been merged into master
View gist:942899
$ git branch -r --merged |
grep origin |
grep -v '>' |
grep -v master |
xargs -L1 |
awk '{split($0,a,"/"); print a[2]}' |
xargs git push origin --delete