$ curl -sSL https://gist.github.com/jaymecd/6900705/raw/gitconfig | sudo tee /etc/gitconfig
$ curl -sSL https://gist.github.com/jaymecd/6900705/raw/gitignore | sudo tee /etc/gitignore
$ curl -sSL https://gist.github.com/jaymecd/6887829/raw/bash_prompt | sudo tee /etc/bash_prompt
$ curl -sSL https://gist.github.com/jaymecd/6887829/raw/bash_alias | sudo tee /etc/bash_alias
$ curl -sSL https://gist.github.com/jaymecd/6887829/raw/bashrc | tee -a ~/.bashrc
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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
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 | |
# concept from http://stackoverflow.com/a/3403786/267224 | |
############# | |
# log to file | |
LOGFILE=/home/user/log/script.log | |
exec > >(tee -a $LOGFILE) | |
exec 2>&1 | |
############ |
The differences between a domain service and an application services are subtle but critical:
- Domain services are very granular where as application services are a facade purposed with providing an API.
- Domain services contain domain logic that can’t naturally be placed in an entity or value object whereas application services orchestrate the execution of domain logic and don’t themselves implement any domain logic.
- Domain service methods can have other domain elements as operands and return values whereas application services operate upon trivial operands such as identity values and primitive data structures.
- Application services declare dependencies on infrastructural services required to execute domain logic.
- Command handlers are a flavor of application services which focus on handling a single command typically in a CQRS architecture.
Source: http://gorodinski.com/blog/2012/04/14/services-in-domain-driven-design-ddd/
If you're like I used to be, you always have trouble remembering the difference between how Windows and Linux terminate lines in text files. Does Windows add the extra stuff, or does Linux? What exactly is the extra stuff? How do I get the stuff out?
Well, hopefully by the end of this you'll be taken care of once and for all.
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
<?php | |
namespace Psr\Log; | |
interface Loggable | |
{ | |
public function getContext(); | |
} | |
class Car implements Loggable |
Either copy the aliases from the .gitconfig
or run the commands in add-pr-alias.sh
Easily checkout local copies of pull requests from remotes:
git pr 4
- creates local branchpr/4
from the githubupstream
(if it exists) ororigin
remote and checks it outgit pr 4 someremote
- creates local branchpr/4
fromsomeremote
remote and checks it out
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 kill `ps -ax | grep 'coreaudiod' | grep 'sbin' |awk '{print $1}'` | |
# or... | |
sudo killall coreaudiod |
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
<?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')); | |
} |