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
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist | |
rm -r /usr/local/var/mysql/ | |
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist | |
unset TMPDIR | |
mysqld --initialize | |
mysql.server start |
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
sudo ifdown --exclude=lo -a && sudo ifup --exclude=lo -a |
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
require 'active_support/concern' | |
module ThrowsError | |
extend ActiveSupport::Concern | |
included do | |
define_method 'errors_as_json' do |*args| | |
{ | |
errors: errors |
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
namespace :test do | |
namespace :db do | |
namespace :fixtures do | |
desc 'Create YAML test fixtures from data in an existing database. | |
Defaults to development database. Set RAILS_ENV to override.' | |
task :dump => :environment do | |
sql = "SELECT * FROM %s" | |
skip_tables = ["schema_migrations"] | |
ActiveRecord::Base.establish_connection(:development) | |
(ActiveRecord::Base.connection.tables - skip_tables).each do |table_name| |
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 Manager | |
def self.make_available(klass, user) | |
klass.class_eval do | |
define_method("for_#{user}") do | |
end | |
end | |
end | |
end |
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 AuditableMethodLogger | |
def log(klass, method_name) | |
# Extend the class | |
klass.class_eval do | |
# WARNING - this method will get overritten everytime! | |
alias_method :method, method_name | |
# WARNING - this method is a new method to alias the passed | |
alias_method "#{method_name}_passed", method_name | |
# Dyanmically define a method name or in this case, override | |
define_method method_name do |*args, &block| |
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 | |
pear upgrade pear | |
## Install Phing ####################################### | |
pear channel-discover pear.phing.info | |
pear install --alldeps phing/phing | |
## Install PHPUnit ##################################### | |
yum install php-xml |
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
<!DOCTYPE> | |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.18/angular.min.js"></script> | |
<script> | |
// Create a parent app | |
var app = angular.module('app', []); | |
// A single controller to rule them all | |
app.controller('ParentController', ['$scope', function ($scope){ |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project name="YourProject" default="build" basedir="."> | |
<target name="build" | |
depends="build-common,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpcb" /> | |
<target name="build-clean" | |
depends="clean,build-common,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpcb" /> |
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
<?xml version='1.0' encoding='UTF-8'?> | |
<project> | |
<actions/> | |
<description><img type="image/svg+xml" height="300" src="ws/build/pdepend/overview-pyramid.svg" width="500"></img>
 | |
<img type="image/svg+xml" height="300" src="ws/build/pdepend/dependencies.svg" width="500"></img></description> | |
<keepDependencies>false</keepDependencies> | |
<properties/> | |
<scm class="hudson.scm.NullSCM"/> | |
<canRoam>true</canRoam> | |
<disabled>true</disabled> |
NewerOlder