George Opritescu

Developer from somewhere

ignore commits by an author in git log

This would show all commits where the author does not contain George:

git log --perl-regexp --author='^((?!George).*)$'
Read More
git

parallelize with space separated args with xargs

echo "node0 node1 node2" | xargs -n1 -P3 -IBOX sh -c 'vagrant halt BOX'
Read More

disable parameter wrapping in rails

Add a wrap_parameters false in your controller, if you need to get rid of the extra hash wrapped around your params.

Read More

iterm2 commands

  • View frequent directories:
    1
    
    cmd-alt-/
  • Get notification when a command finishes:
    1
    
    cmd-alt-a
  • Make current split take entire screen:
    1
    
    cmd-shift-enter
Read More

git grep in commits that may be dangling

git log -p -g --grep='some_text'
Read More
git

using maven exec to run a class in a multi module maven setup

Had the following structure:

project/
  tests/
    pom.xml
    integration-tests/
      pom.xml
      src
        test
          java
            Potato.java
...

and I wanted to run the Potato class using maven exec. The following command did the trick:

mvn -Dexec.mainClass="my.pkg.Potato" -Dexec.classpathScope=test exec:java -pl tests/integration-tests
Read More

ours and theirs in git rebase

$ git checkout branch1
$ git rebase master
ours   = master
theirs = branch1
Read More
git

check which gitignore ignores your file

git check-ignore -v path
Read More
git

using the hostonly ip with chef and vagrant

Example from a config file:

listen_address: <%= node[:network][:interfaces][:eth1][:addresses].find{|k,v| v[:family] == "inet"}.first %>
Read More

No Directive annotation found on AppComponent

Received the following exception when following the “Tour of heroes” app quickstart:

No Directive annotation found on AppComponent

Turned out, my code was like this:

@Component({
    selector: 'my-app',
    template: '<h1></h1><h2> details!</h2>'
})

export class Hero {
  id: number;
  name: string;
}

export class AppComponent {

when it should have been like this:

export class Hero {
  id: number;
  name: string;
}

@Component({
    selector: 'my-app',
    template: '<h1></h1><h2> details!</h2>'
})
export class AppComponent {

notice the annotation has to be on the AppComponent class.

Read More