Skip to content

Instantly share code, notes, and snippets.

View saleiva's full-sized avatar
🤓

Sergio Álvarez Leiva saleiva

🤓
View GitHub Profile
@saleiva
saleiva / node-sass.md
Created August 14, 2017 11:10
Easy node-sass setup

Installation

  1. Install node
  2. npm install -g node-sass installs node-sass globally -g

Execution

  • node-sass my-styles.scss my-styles.css compiles a single file manually.
  • node-sass my-sass-folder/ -o my-css-folder/ compiles all the files in a folder manually.
  • node-sass -w sass/ -o css/ compiles all the files in a folder whenever a file in the original folder changes
@saleiva
saleiva / Insert fake data on a CartoDB table
Created May 6, 2014 16:43
Insert fake data on a CartoDB table
import string
import urllib
import urllib2
import math, random
import time
from optparse import OptionParser
account_name = ''
account_api_key = ''
@saleiva
saleiva / gist:10635674
Created April 14, 2014 10:25
Developer Intern at CartoDB

Developer Intern at CartoDB

We are building the easiest and most powerful data mapping engine ever. We have more than 40.000 loving users (growing rapidly) and customers from all around the world, And we have offices in downtown Madrid and NY.

Our team of engineers and designers are changing the way maps are made. This is a big task, we need to scale! We're looking for talented people with a passion for maps, code and quality. Our team is fast, smart and independent.

@saleiva
saleiva / gist:10121008
Last active September 17, 2020 17:15
Software Engineer - Back End at CartoDB

Software Engineer - Back End at CartoDB

We are building the easiest and most powerful data mapping engine ever. We have more than 40.000 loving users (growing rapidly) and customers from all around the world, And we have offices in downtown Madrid and NY.

Our team of engineers and designers are changing the way maps are made. This is a big task, we need to scale! Because we're looking for truly talented engineers with a passion for maps, code and quality. Our team is fast, smart and independent.

//goto: https://twitter.com/messages?since_id=0
// delete console.log
querySelectorAttempt._timerIDs = []
function querySelectorAttempt(selectors, callback, _attempts){
if (!Array.isArray(selectors)) selectors = selectors.toString().split(/\s*,\s*/)
console.log('querySelectorAttempt', selectors, _attempts)
if (_attempts == null) _attempts = 20;
var elements
selectors.forEach(function(selector){
UPDATE k9_police_dogs_killed_in_the_line_of_duty_2009 SET date_proc = to_timestamp(date_of_death, 'Day, Month DD, YYYY')
SELECT ST_centroid(the_geom) as the_geom, ST_centroid(the_geom_webmercator) as the_geom_webmercator, cartodb_id, desig_abbr, tourism FROM buildings
<div class="cartodb-popup">
<a href="#close" class="cartodb-popup-close-button close">x</a>
<div class="cartodb-popup-content-wrapper">
<div class="cartodb-popup-content">
<h4 style="position:absolute; top:12px; left:19px; right:21px; display:block; width:auto; padding:8px; text-align:center; color:white; background:rgba(0,0,0,0.7)">{{name}}</h4>
<img src="http://maps.googleapis.com/maps/api/staticmap?size=188x170&center={{latitude}},{{longitude}}&zoom=13&maptype=satellite&markers=
icon:http://bit.ly/19isKFH|{{latitude}},{{longitude}}&sensor=false" />
</div>
</div>
<div class="cartodb-popup-tip-container"></div>
{"cities":[{"pop_max":35676000,"name":"Tokyo"},{"pop_max":19040000,"name":"New York"},{"pop_max":19028000,"name":"Mexico City"},{"pop_max":18978000,"name":"Mumbai"},{"pop_max":18845000,"name":"Sao Paulo"},{"pop_max":15926000,"name":"Delhi"},{"pop_max":14987000,"name":"Shanghai"},{"pop_max":14787000,"name":"Kolkata"},{"pop_max":13485000,"name":"Dhaka"},{"pop_max":12795000,"name":"Buenos Aires"},{"pop_max":12500000,"name":"Los Angeles"},{"pop_max":12130000,"name":"Karachi"},{"pop_max":11893000,"name":"Cairo"},{"pop_max":11748000,"name":"Rio de Janeiro"},{"pop_max":11294000,"name":"Osaka"},{"pop_max":11106000,"name":"Beijing"},{"pop_max":11100000,"name":"Manila"},{"pop_max":10452000,"name":"Moscow"},{"pop_max":10061000,"name":"Istanbul"},{"pop_max":9904000,"name":"Paris"},{"pop_max":9796000,"name":"Seoul"},{"pop_max":9466000,"name":"Lagos"},{"pop_max":9125000,"name":"Jakarta"},{"pop_max":8990000,"name":"Chicago"},{"pop_max":8829000,"name":"Guangzhou"},{"pop_max":8567000,"name":"London"},{"pop_max":8012000,"name"
@saleiva
saleiva / gist:4604263
Last active December 11, 2015 12:58
Delete clicked div and the following ones (jquery)
var array_de_divs = $('div');
$('div').bind('click',function(){
var indice_clickado = $(this).index()
for(i=indice_clickado;i<=a.length-1;i++){
$(a[i]).hide()
}
})