Skip to content

Instantly share code, notes, and snippets.

View ccamara's full-sized avatar

Carlos Cámara ccamara

View GitHub Profile
@ccamara
ccamara / .gitconfig
Last active May 13, 2020 20:43
#git #configuration and #aliases
[user]
name = Your Name
email = your@email.here
[color]
status = auto
branch = auto
interactive = auto
diff = auto
[alias]
st = status -sb
CCAA date total
1 Andalucía 16-03-20 0
2 Andalucía 17-03-20 0
3 Andalucía 18-03-20 38
4 Andalucía 19-03-20 33
5 Andalucía 20-03-20 72
6 Andalucía 21-03-20 72
7 Andalucía 22-03-20 38
8 Aragón 16-03-20 0
9 Aragón 17-03-20 0
@ccamara
ccamara / counters.scss
Created May 17, 2013 07:30
CSS Counters #css #scss
/*
* CSS Counters
* More information here: https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Counters
*/
ol{
counter-reset: simple-numbering; // Sets the counter called simple-numbering to 0.
li {
list-style: none;
position: relative;
@ccamara
ccamara / README.md
Created June 14, 2018 11:39 — forked from jsanz/README.md
MapboxGL + OSM data

Simple script to get data (nodes and polygons separately) from OSM using Overpass API and render it on a Mapbox GL map.

This is probably a work in progress.

To do:

  • Work on having to do just a single call to the Overpass API and then split the geometries by type.
  • Better styling
  • Popups?
@ccamara
ccamara / sample-ggplot.R
Created February 28, 2017 13:10
Annotation in #R #ggplot
# Source: http://sharpsightlabs.com/blog/simple-annotate-plot-ggplot2/
ggplot(df, aes(x = Año, y = Población, group = 1)) +
geom_line(colour = "red", size = 1.5) +
geom_point(colour = "red", size = 4, shape = 21, fill = "white") +
geom_text(aes(label = Año), size = 3, hjust = 0.5, vjust = 3, position = "stack") +
scale_y_continuous(labels = function(x) format(x, big.mark = ".", scientific = FALSE)) +
ggtitle("Evolución de población en Detroit") +
labs(x = "Año", y = "Población") +
geom_vline(xintercept = 1973, linetype = "dashed") +
@ccamara
ccamara / osm-download.model
Last active June 27, 2016 16:11
Example of non-working QGIS model
{
"values": {
"inputs": {
"STRING_CITY": {
"values": {
"pos": {
"values": {
"y": 22.0,
"x": 120.0
},
@ccamara
ccamara / yourmodule.module
Last active January 3, 2016 02:39
Programatically creation of nodes in #Drupal7
<?php
/**
* Creates 'nodetype' pages.
*
* @param array $content
* Assoc array with machine names as key and node title.
*/
function yourmodule_create_nodetype($content) {
foreach ($content as $machine_name => $content_item) {
@ccamara
ccamara / .bash_profile
Last active December 31, 2015 14:49 — forked from modcab/gist:8002917
Aguasingas' .bash_profile, with some git goodness.
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
# Autocompletion for git.
# http://code-worrier.com/blog/autocomplete-git/
# Download doing curl https://raw.github.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
@ccamara
ccamara / images.scss
Last active December 30, 2015 03:49
if we are using images in #compass there's no need of using a full url path to them. We can use image-url() instead #css #scss #sass
.background-image {
background: image-url('image-name.png'); //image-url() is defined in config.rb file so its prefered
}
@ccamara
ccamara / nth-element.css
Created November 11, 2013 09:53
#CSS nth-element pseudo selector
//More info: http://css-tricks.com/how-nth-child-works/
ul li:nth-child(3n+3) {
color: #ccc;
}
ul li:nth-child(5) {
color: #ccc;
}