Skip to content

Instantly share code, notes, and snippets.

LINUX - COMMAND LINE

TO COUNT NUMBER OF LINES AND STRING LENGTH

wc -l <filename>  # lines
wc -c 'string'  #length of the string
sed '<lne_number>q;d' <filename> | wc -c  # length of the output string

TO READ A SPECIFIC ROW IN A FILE

ser 'q;d' 

##MAC - COMMAND LINE

###Random #####Go to teh home directory Cmd + shift + H

you should create your own bash profile: ~/.profile

#####compress files tar -cvzf nameofmytar.tar.gz /path/to/file/*.xxx

@ucaiado
ucaiado / gist:67ba7e8fc80ff70e74c4
Last active August 29, 2015 14:08
Sublime Defaults
[
{ "keys": ["ctrl+7"], "command": "toggle_comment", "args": { "block": false } },
{ "keys": ["ctrl+shift+7"], "command": "toggle_comment", "args": { "block": true } }
]
@ucaiado
ucaiado / gist:5737e7b7d8388d1b3b83
Last active August 29, 2015 14:09
D3.js Reference
@ucaiado
ucaiado / gist:c0180fcb9470f6e32f5a
Last active August 29, 2015 14:09
VBA: getting the line of clicked button
'source: http://stackoverflow.com/questions/6242605/excel-vba-getting-row-of-clicked-button
Sub test()
MsgBox ("Row of pressed button: " & ActiveSheet.Shapes(Application.Caller).TopLeftCell.Row)
End Sub
@ucaiado
ucaiado / README.md
Last active August 29, 2015 14:10
US Smartphone Market

It is my redesigned version of a pie chart that was presented in a one of Steve Jobs presentations about smartphone market. It was a exercise from Lecture 3 of 'Data Visualization and D3.js' course from Udacity .

Please, visit here to see the result and click here to come back to this page.

I base my code on this and this examples. I'm still don't understand very well what I am doing =)

@ucaiado
ucaiado / README.md
Last active August 29, 2015 14:10
US unemployment rate 2011

As pointed at the source, in the original chart, the november rate is lower then the previous one, but it is shown as if it was at the same level.

Also, I decided to keep the Y axes starting at 8% to emphasise the rate change between the months. As the unemployment rate of any country is unlikely to go to 0, I guess that it makes sense starting the chart in a higher rate.

Variable Type Encoding
date Quantitative X
unemployment rate Quantitative Y