This file contains 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" | |
"sync" | |
) | |
type unlocked struct { | |
i int | |
} |
This file contains 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
OUT := binariy-name | |
PKG := gitlab.com/group/project | |
VERSION := $(shell git describe --always --long --dirty) | |
PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/) | |
GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/) | |
all: run | |
server: | |
go build -i -v -o ${OUT} -ldflags="-X main.version=${VERSION}" ${PKG} |
This file contains 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/sh | |
# Copyright 2012 The Go Authors. All rights reserved. | |
# Use of this source code is governed by a BSD-style | |
# license that can be found in the LICENSE file. | |
# git goimports pre-commit hook | |
# | |
# To use, store as .git/hooks/pre-commit inside your repository and make sure | |
# it has execute permissions. | |
# |
This file contains 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 | |
NAME=$(git branch | grep '*' | sed 's/* //') | |
ISSUE_NUMBER=$(git branch | grep '*' | sed 's/* //' | tr -dc '0-9') | |
if [ "$2" == "message" ]; then | |
echo "Message given, we do not modify the git commit message" | |
exit 0 | |
fi | |
if [ "$2" == "merge" ] || [ "$2" == "squash" ]; then | |
echo "$2 commit, we do not edit the message" | |
exit 0 |
This file contains 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 | |
type Wrapper string | |
type Chain struct { | |
wrps []Wrapper | |
} | |
func (c Chain) Append1(wrps ...Wrapper) Chain { | |
newWrps := make([]Wrapper, len(c.wrps)+len(wrps)) |
This file contains 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 | |
if [[ "${#}" != "1" ]]; then | |
echo "Need exactly one command line argument: package name" | |
exit 1 | |
fi | |
PACKAGE=${1} | |
echo "Please allow backup for: ${PACKAGE}" | |
adb backup -f data.ab -noapk ${PACKAGE} | |
dd if=data.ab bs=1 skip=24 | openssl zlib -d | tar -xvf - | |
rm data.ab |
This file contains 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
# adjust these path to where ever the executables are | |
COFFEE_BIN = ./node_modules/.bin/coffee | |
UGLIFY_BIN = ./node_modules/.bin/uglifyjs | |
# https://github.com/edc/mapcat | |
MAPCAT_BIN = ./node_modules/.bin/mapcat | |
# Where your coffee files are | |
INPUT_FOLDER = ./input | |
# Where you want your output | |
OUTPUT_FOLDER = ./output |
This file contains 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
description "nginx http daemon" | |
author "Philipp Klose" | |
start on (filesystem and net-device-up IFACE=lo) | |
stop on runlevel [!2345] | |
env DAEMON=/opt/nginx/sbin/nginx | |
env PID=/opt/nginx/logs/nginx.pid | |
expect fork |
This file contains 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
generateUUID: () -> | |
d = new Date().getTime() | |
'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace /[xy]/g, (c) -> | |
r = (d + Math.random() * 16) % 16 | 0 | |
d = Math.floor(d / 16) | |
(if c is 'x' then r else r & 0x3 | 0x8).toString 16 |
This file contains 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 | |
# | |
# abort commit if on feature/branch and nothing else than auto generated commit message | |
# is entered | |
current_branch=$(git rev-parse --abbrev-ref HEAD) | |
if [[ $current_branch == "feature/"* ]] | |
then | |
first_line=$(head -n 1 $1) | |
if [[ $first_line == "(${current_branch:8}):" ]]; then | |
echo 'No valid commit message entered.' |
NewerOlder