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
FROM alpine | |
MAINTAINER Balazs Nadasdi <[email protected]> | |
# Update package index and install go + git | |
RUN apk add --update go git | |
# Set up GOPATH | |
RUN mkdir /go | |
ENV GOPATH /go |
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
# shell logger (if DEBUG = 1) | |
log() { | |
if [[ "$DEBUG" = 1 ]] | |
then | |
echo " *** [`date +'%x %T'`] $*" >&2 | |
fi | |
} | |
# Random password generator | |
# 1st parameter is the length of the password (15 by default) |
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/sh | |
git fetch --tags && \ | |
git tag | \ | |
grep "autotag-`date +"%Y%m%d"`" > /dev/null \ | |
|| git tag "autotag-`date +"%Y%m%d"`" -m 'autotag' \ | |
&& git tag "autotag-`date +"%Y%m%d"`-"$((`git tag | sort -n | tail -n 1 | sed -Ee 's/autotag-[0-9]{8}-?([0-9]*)/\1/g'` + 1)) |
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
class TestConstMissing | |
# default value | |
DEFAULT_VALUE = 0 | |
# self because constants defined on that level | |
# and not in instances | |
def self.const_missing(name) | |
puts "[log] Nope! '#{name}'" | |
self::DEFAULT_VALUE |
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
#!/usr/bin/env bash | |
keyFile=$1 | |
keyHash=`sed -e 's/^[^ ]* //' ~/.ssh/acquia_rsa.pub | sed -e 's/ .*//'` | |
comment=`awk '{print $3}' $keyFile` | |
getHexValue() { | |
content=$1 | |
from=$2 | |
length=$3 |
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/sh | |
# Basic logic: | |
# Check if current user is not equal with the file owner | |
# Parse mysql parameters from app/config/parameters.ini | |
# Check differeces from origin | |
# Merge remote changes | |
# If merge says there is nothing to do then simply exit | |
# If there was SQL files then execute them | |
# Updtae Symfony stuffs |
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
jQuery(function() { | |
var archive = jQuery('.widget_archive li a').toArray().map(function(item) { | |
var t = item.innerText.split(/ /); | |
return { | |
'link': item.getAttribute('href'), | |
'year': parseInt(t[1], 10), | |
'month': t[0], | |
'count': parseInt(item.parentNode.innerText.match(/\(([0-9]+)\)$/)[1], 10) | |
}; | |
}).reduce(function(memo, item) { |
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
// ... cut | |
Users.findById(id, function(err, result) { | |
if (err) { | |
// OMG! We got an error | |
return response.redirect('/404.html'); | |
} | |
// nice we can do something with user | |
}); | |
// ... cut |
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
#!/usr/bin/env node | |
var sys = require("sys"), | |
spawn = require('child_process').spawn; | |
/* | |
* htmlEntities function is from Chris Coyier | |
* URL: http://css-tricks.com/snippets/javascript/htmlentities-for-javascript/ | |
*/ | |
function htmlEntities(str) { |
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
all: cover build | |
coverFile := $(shell mktemp -u -t cover.out.XXXXXX) | |
projectName := $(shell basename `pwd`) | |
hasGocov := #$(shell which gocov) | |
packages := $(shell go list ./...) | |
ifndef OUTPUT | |
OUTPUT = "text" | |
endif |