George Opritescu

Developer from somewhere

debugging go with gdb

go build -gcflags "-N -l" your_file.go

and after that:

gdb ./your_file

Continue with info from here

Read More

golang array to variadic

some_method(your_array...)
Read More

applying reject git patch

git apply --reject --whitespace=fix mychanges.path
Read More

Input string is longer than NAMEDATALEN 1 (63) on rails4

This error occurs because when you rename a table, the indexes are also renamed, and most likely one of your indexes auto-generated name is too long.

Read More

Adjacent XJS react

The following error:

Error: Parse Error: Adjacent XJS elements must be wrapped in an enclosing tag

Is probably because you are not returning one element, but multiple. So, return:

<div>
  <SomeComponent/>
  <SomeOtherComponent/>
</div>

instead of:

  <SomeComponent/>
  <SomeOtherComponent/>
Read More

debug cors with curl

Example take from here

curl -H "Origin: http://example.com" --verbose \
  https://www.googleapis.com/discovery/v1/apis?fields=
Read More

adding time in go

import "time"

now := time.Now()
end := now.Add(1 * time.Hour)
// formatting as iso8601
now_string := now.Format(time.RFC3339)
Read More

linx 7

  • gin - web framework for go
  • ampersandjs - web framework based on backbone.js
Read More

timing out with curl

To “timeout” a request after a number of seconds, use the -m switch:

curl -m 5 some_url

And in case the web server doesn’t respond after 5 seconds, curl will exit with an error code.

Read More

long lines in csv reports

If you have some CSV files with lines longer than 990 chars, you may notice that the lines get splitted. The fix is described here

attachments['file.csv']= { :data=> ActiveSupport::Base64.encode64(@string), :encoding => 'base64' }
Read More