This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script to delete merged remote branches except those in the no-delete list | |
# Usage: | |
# ./delete_merged_git.sh [target-branch] [--delete] [--old-days N] | |
# Default target branch is "develop" | |
# Use --delete to actually delete branches; otherwise it's a dry run | |
# Use --old-days N to also delete branches older than N days | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"iam:CreateRole", | |
"iam:DeleteRole", | |
"iam:UpdateRole", | |
"iam:GetRole", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math" | |
"os" | |
"strconv" | |
) | |
func main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run --rm \ | |
--name test-acme \ | |
-v "$(pwd)":/usr/app \ | |
golang:1.18 \ | |
bash -c "cd /usr/app && go test -v ./..." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: 2010-09-09 | |
Parameters: | |
PoolName: | |
Type: String | |
PoolClientName: | |
Type: string | |
Resources: | |
Pool: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require("express") | |
const sessions = require("express-session") | |
const FileStore = require("session-file-store")(sessions) | |
const app = express() | |
app.use(sessions({ | |
secret: "whatasecret", | |
saveUninitialized: false, | |
resave: false, | |
store: new FileStore({}), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func replaceImageInTemplate(filepath string, prefix string, newString string) error { | |
input, err := ioutil.ReadFile(filepath) | |
if err != nil { | |
return err | |
} | |
r, err := regexp.Compile(fmt.Sprintf("(?m)^%s(.*?)$", prefix)) | |
if err != nil { | |
return err | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func ReplaceInTemplate(filepath string, origString string, replaceString string) error { | |
input, err := ioutil.ReadFile(filepath) | |
if err != nil { | |
return err | |
} | |
output := bytes.Replace(input, []byte(origString), []byte(replaceString), -1) | |
if err = ioutil.WriteFile(filepath, output, 0666); err != nil { | |
return err |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func RemoveFiles(dir string) error { | |
d, err := os.Open(dir) | |
if err != nil { | |
return err | |
} | |
defer d.Close() | |
names, err := d.Readdirnames(-1) | |
if err != nil { | |
return err |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"encoding/json" | |
"errors" | |
"flag" | |
"fmt" | |
"net/http" | |
"os" |
NewerOlder