George Opritescu

Developer from somewhere

tracing a specific block of code in NewRelic

Info available here. Make sure you extend the NewRelic tracer in your class:

extend ::NewRelic::Agent::MethodTracer

self.class.trace_execution_scoped("Custom/Some/TransactionName") do
  # traced code
end
Read More

check if database exists in postgresql

select * from pg_database where datname='some-name'
Read More

local subdomains in rails

If you want to configure subdomains, using /etc/hosts, this will not work:

127.0.0.1 api.localhost

Instead, you need to use

127.0.0.1 api.localhost.local

As mentioned here, Rails 3 treats api.localhost as the domain.

Read More

You're up and running!

Next you can update your site name, avatar and other options using the _config.yml file in the root of your repository (shown below).

_config.yml

The easiest way to make your first post is to edit this one. Go into /_posts/ and update the Hello World markdown file. For more instructions head over to the Jekyll Now repository on GitHub.

Read More

curl GET request with json

$ curl “http://some.url” -H “Content-Type: application/json” -d ‘{“my_array”:[1,2,3]}’ -X GET

Read More

vim delete without cut

If you want to delete without losing your yank, select your text and then do “_d , and this will send the text to a throwaway registry.

Read More
vim

angularjs controller, required by directive, can't be found

This kind of errors:

Controller 'ngModel', required by directive 'ngSubmit', can't be found!

Can be fixed by following the steps in this stackoverflow post. Basically, configure your directive require like this:

require: "^?ngModel"

instead of:

require: "ngModel"
Read More