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
#!/usr/bin/env bash | |
# | |
# Remove any argument matching --env= and prepend --env=test | |
# | |
args=("$@") | |
idx=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
# Create a new Token | |
curl -u 'githubuser' -d '{"note":"Your Application"}' https://api.github.com/authorizations | |
# It is: "ebab4dc37e654bb230a9c69ebcd5f38e9a81e210" | |
#{ | |
# "created_at": "2013-01-04T18:00:28Z", | |
# "app": { | |
# "url": "http://developer.github.com/v3/oauth/#oauth-authorizations-api", |
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
# Cronjob for poor man monitoring of server health | |
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" | |
# Every sunday, check for apt-get upgrades. | |
33 3 * * 0 root apt-get update ; apt-get -q --simulate upgrade | |
# Every sunday, check for SMART errors. | |
34 3 * * 0 root echo 'SMART Sectors'; smartctl -a /dev/sda | grep -i sector ; smartctl -a /dev/sdb | grep -i sector; echo 'SMART All'; smartctl -a /dev/sda ; smartctl -a /dev/sdb |
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
mkdir scrutinizer && cd scrutinizer | |
# Install tools | |
# - Scrutinizer and composer | |
wget http://scrutinizer-ci.com/scrutinizer.phar | |
curl -sS https://getcomposer.org/installer | php | |
# - All needed CI tools | |
php composer.phar require h4cc/phpqatools:~1.2 | |
cp -p composer.phar vendor/bin/composer |
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
<?php | |
use Doctrine\ODM\MongoDB\Mapping\Annotations as Mongo; | |
/** @Mongo\Document(collection="documents") */ | |
class Document | |
{ | |
/** @Mongo\Id */ | |
public $id; |
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
<?php | |
/** | |
* ContentAwareImage | |
* | |
* @author stig | |
*/ | |
class ContentAwareImage { | |
protected static $start_time = 0.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
<?php | |
class ImageType extends AbstractType | |
{ | |
public function buildForm(FormBuilderInterface $builder, array $options) | |
{ | |
if ($options['required_auto'] && ! $options['required']) { | |
$builder->addEventListener(\Symfony\Component\Form\FormEvents::PRE_SET_DATA, array($this, 'determineRequired')); | |
} |
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
# Install a Webserver | |
apt-get -y install apache2 | |
# Target docroot to /home/satis/web/ | |
# Install PHP5 CLI and needed programs. | |
apt-get -y install php5-cli php5-curl php5-json git wget | |
# Add a specifix user for our task | |
adduser satis |
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
# Script to delete all but a specified list of tags | |
# from a git repo, both locally and remotely | |
# Run like `mode=test ruby git_tag_cleanup` to test; | |
# use 'execute' mode to actually delete the tags | |
mode = ENV['mode'] || 'test' | |
tags_to_keep = %w[v2.0.0 v2.0.1] | |
tags_to_delete = `git tag`.split("\n") - tags_to_keep |
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
# hubot | |
description "Hubot Campfire bot" | |
author "David Wittman <david@wittman.com>" | |
start on filesystem or runlevel [2345] | |
stop on runlevel [!2345] | |
# Path to Hubot installation | |
env HUBOT_DIR='/opt/hubot/' |
OlderNewer