Skip to content

Instantly share code, notes, and snippets.

View Rud5G's full-sized avatar
🏡
Working remotely

Rudger Rud5G

🏡
Working remotely
View GitHub Profile
#!/usr/bin/env bash
# Git Timetracker. Copyright Kevin van Zonneveld (kvz.io)
# License under MIT
#
# This file
#
# - can be run inside a git repository to get a list on what hours work took place (for billing)
# - takes 1 argument: since. It defaults to "2 months"
#
# Usage:
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = '2'
VAGRANT_MIN_VERSION = '1.3.4'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Check Vagrant version
if Vagrant::VERSION < VAGRANT_MIN_VERSION
# optie 1:
# http://stackoverflow.com/questions/7283010/magento-database-transaction
#
$transaction = Mage::getSingleton('core/resource')->getConnection('core_write');
try {
$transaction->beginTransaction();
// Make saves and other actions that affect the database
#!/usr/bin/env ruby
# This script is intended to preprocess a knife ec2 server create command and
# generate a user_data script in the /tmp folder that will rename the host
# to match whatever the node name is before the chef bootstrapping process
# begins. It then splits the knife command in front of the --node-name or -N
# options and inserts "--user-data /tmp/server-01.userdata" (in the example
# below) and execs the command.
#
# Usage:
<?php
$cfg = array(
'server' => 'mongodb://127.0.0.1:27017/?journal=false&w=1&wTimeoutMS=20000',
'db' => 'cm_cache',
'collection' => 'cm_cache'
);
// set to timezone to UTC, like magento do this
date_default_timezone_set('UTC');
<?php
umask(0);
ini_set('memory_limit','512M');
set_time_limit(0);
if(file_exists('app/Mage.php')) require 'app/Mage.php';
else require '../../app/Mage.php';
// Init without cache so we get a fresh version
Mage::app('admin','store', array('global_ban_use_cache' => TRUE));
# original file: https://gist.github.com/Rud5G/623d417209c237944186
# create in /etc/sysctl.d/
fs.inotify.max_user_watches = 100000
~
~
~
~
~
<?php
class EmailTestCase extends PHPUnit_Framework_TestCase {
/**
* @var \Guzzle\Http\Client
*/
private $mailcatcher;
public function setUp()
{
<?php
class EmailTestCase extends PHPUnit_Framework_TestCase {
/**
* @var \Guzzle\Http\Client
*/
private $mailcatcher;
public function setUp()
{
@Rud5G
Rud5G / EmailTestCase.php
Last active August 29, 2015 14:04
composer.json automated testing emails
<?php
class EmailTestCase extends PHPUnit_Framework_TestCase {
/**
* @var \Guzzle\Http\Client
*/
private $mailcatcher;
public function setUp()