Skip to content

Instantly share code, notes, and snippets.

View josephtaylor's full-sized avatar

J. Taylor O'Connor josephtaylor

View GitHub Profile
@yefim
yefim / Dockerrun.aws.json
Last active April 7, 2023 16:11
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "443"
}
@zchee
zchee / SSHwithgit2go.go
Last active March 10, 2023 18:29 — forked from xorpaul/SSHwithgit2go.go
Working example with SSH and libgit2/git2go
package main
import (
git "github.com/libgit2/git2go"
"log"
)
func credentialsCallback(url string, username string, allowedTypes git.CredType) (git.ErrorCode, *git.Cred) {
ret, cred := git.NewCredSshKey("git", "/home/vagrant/.ssh/id_rsa.pub", "/home/vagrant/.ssh/id_rsa", "")
return git.ErrorCode(ret), &cred
@jkeiser
jkeiser / gist:8790315
Last active May 4, 2017 18:36
in_parallel and in_serial

Parallelization in Chef Recipes

Chef presently runs the resources in a recipe serially, one after the next. In this proposal, user-selected groups of resources will run their actions in parallel.

MVP (Minimum Viable Product) Features

in_parallel

To run a group of resources in parallel, you write it this way:

@jpouellet
jpouellet / fancy-debug.c
Created April 20, 2013 16:16
Fancy debug
/*
* depending on whether you use a named variadic macro or not you get either:
* fancy-debug.c:20:20: warning: ISO C does not permit named variadic macros
* or
* fancy-debug.c:28:13: warning: ISO C99 requires rest arguments to be used
* or sometimes both depending on your compiler.
*
* See also:
* http://gcc.gnu.org/onlinedocs/gcc-3.1/cpp/Standard-Predefined-Macros.html
* http://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html