Some useful commands when using git
Make a commit:
git add *
git commit -m "message"
git push origin master
Recover the state (be careful, overrides local changes!):
git reset --hard HEAD
git clean -f -d
git pull origin master
Delete on the repository the local deleted files:
(from http://stackoverflow.com/questions/1402776/how-do-i-commit-all-deleted-files-in-git)
Welcome to Fer programes, a blog created with the intention to help us and other programmers in the developing of IT applications. It includes some commands used previously to solve specific problems, links to interesting web pages and general explanations about informatic topics. You are free to collaborate with comments when you consider it is oportune.
Wednesday, October 23, 2013
Using the ndv3.js library
nvd3.js is an amazing d3 charts library.
However, it has few documentation in its website. In this post I put a summary of the useful things I've done when working with nvd3.
In this site there is the source code of the package, what allows us to see the possible parametrizations of the chart:
def load_chart(chart_type, series, container, x_is_date=False, x_axis_date_format="%d %b %Y", tag_script_js=True, color_category='category20'):
The variable color category is the way to specify the colors range of the chart. However, in my case I had to specify its values in the javascript code instead of doing it directly in Python.
...
(javascript)
var mycolors = ["#80B898","#007030","#E58A01"];
d3.scale.mycolors = function() {
return d3.scale.ordinal().range(mycolors);
}
(end javascript)
{% load_chart grafico.charttype grafico.chartdata "grafico_container" True "%d %b %Y" color_category='mycolors' %}
...
Event trigger when a serie is selected
Brush extent when working with a line with focus chart
Updating different d3 charts on the same page
However, it has few documentation in its website. In this post I put a summary of the useful things I've done when working with nvd3.
- Integrating nvd3 with Django
In this site there is the source code of the package, what allows us to see the possible parametrizations of the chart:
def load_chart(chart_type, series, container, x_is_date=False, x_axis_date_format="%d %b %Y", tag_script_js=True, color_category='category20'):
The variable color category is the way to specify the colors range of the chart. However, in my case I had to specify its values in the javascript code instead of doing it directly in Python.
...
var mycolors = ["#80B898","#007030","#E58A01"];
d3.scale.mycolors = function() {
return d3.scale.ordinal().range(mycolors);
}
{% load_chart grafico.charttype grafico.chartdata "grafico_container" True "%d %b %Y" color_category='mycolors' %}
...
- Customizing more nvd3.js charts
Event trigger when a serie is selected
Brush extent when working with a line with focus chart
Updating different d3 charts on the same page
Sunday, June 2, 2013
How to add a Gmail account with double step verification to an Android phone
It is a bit tricky. When you are asked to write the password, it is not your account password. You must specify a password which is unique for the Android application. It is well explained here:
http://alleged.org.uk/pdc/2012/11/29.html
http://alleged.org.uk/pdc/2012/11/29.html
Thursday, May 23, 2013
Ubuntu 12.04 things
- How to add to launcher Chrome in incognito mode:
- Configure Ubuntu inside Virtualbox. Install virtualbox-guest-additions
Wednesday, May 8, 2013
CSS - Utilities
- How to make an horizontal list. Very well explained. Step by step:
- Resolution order in CSS
http://www.webteacher.ws/2010/08/26/resolving-conflicts-in-css/
http://www.webteacher.ws/2008/05/19/tip-calculate-the-specificity-of-css-selectors/
- id vs class
http://stackoverflow.com/questions/544010/css-div-id-vs-div-class
- 3 column liquid layout
http://matthewjamestaylor.com/blog/perfect-3-column.htm
- How to float divs
Apart from these utilities, recently I found "the collection", the most popular set of utlities for the front end desig: Twitter Bootstrap. Twitter Bootstrap is a free collection of tools for creating websites and web applications (HTML, CSS, and JavaScript toolkit). It contains HTML and CSS-based design templates for typography, forms, buttons, charts, navigation and other interface components, as well as optional JavaScript extensions. It is the most popular project in GitHub and is used by NASA and MSNBC among others.
http://twitter.github.io/bootstrap/
Sunday, April 28, 2013
Wednesday, January 2, 2013
Galaxy Ace - Boot sounds
To manage the start up and shut down sounds on a Samsung Galaxy Ace device, you must change the following files (with a root admin file manager application, like TotalCommander):
- Start up: /system/etc/poweron.ogg
- Shut down: /system/media/audio/ui/sh
utdown.ogg
Subscribe to:
Posts (Atom)