This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mkdir /tmp/tmpVideo/ | |
| ffmpeg -t $3 -ss $2 -qscale:v 1 -i $1 /tmp/tmpVideo/out%04d.png | |
| convert -delay 1.8 -loop 0 /tmp/tmpVideo/out*.png /tmp/tmpVideo/tmp.gif | |
| convert -layers Optimize /tmp/tmpVideo/tmp.gif ./out.gif | |
| rm -rf /tmp/tmpVideo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var selectTemplate = "SELECT TOP 5 PERCENT SumOfTRAFFIC_IN_MB as percentile, provincia, mes FROM a_Trafico_Agregado_Provincias_15M WHERE Provincia = '%provincia%' AND Mes = %mes%"; | |
| var provincias = ['ALMERIA','BADAJOZ','BALEARES','BARCELONA','BURGOS','CACERES','CADIZ','CANTABRIA','CASTELLON','CIUDAD REAL','CORDOBA','GIRONA','GRANADA','HUELVA','JAEN','LA CORUÑA','LA RIOJA','LEON','LLEIDA','MADRID','MÁLAGA','MURCIA','PONTEVEDRA','SEVILLA','TARRAGONA','TOLEDO','VALENCIA','VALLADOLID','ZARAGOZA']; | |
| var getSelect = function(mes) { | |
| var selects = []; | |
| for(var i in provincias) { | |
| var prov = provincias[i]; | |
| var select = selectTemplate.replace('%mes%', mes).replace('%provincia%', prov); | |
| selects.push(select); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (SELECT * | |
| FROM test1 | |
| WHERE test1.interface = '1' ORDER BY traffic DESC LIMIT 2) | |
| UNION | |
| (SELECT * | |
| FROM test1 | |
| WHERE test1.interface = '2' ORDER BY traffic DESC LIMIT 2) | |
| UNION | |
| (SELECT * | |
| FROM test1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Object.defineProperty(Array.prototype, "removeElement", { | |
| value: function(element) { | |
| var found = []; | |
| var i = this.length; | |
| while (i) { | |
| if (this[i - 1] === element) { | |
| found.push(i - 1); | |
| } | |
| i--; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Alerter | |
| constructor: (name) -> | |
| this.span = document.getElementsByTagName('span')[0] | |
| this.span.addEventListener('click', this.handler) | |
| handler: () -> alert('hello') | |
| window.alerter = new Alerter('hey') | |
| delete window.alerter // ZAS!! Memory leak |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var A = function() {} | |
| A.prototype = { | |
| // methods | |
| } | |
| var AMock = function() {} | |
| AMock.prototype = { | |
| // mocked methods | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // we need to generate 4 html structures for 4 diferent maps, and we use a loop to avoid repeating the same nodes with only different ids. | |
| // also, we need to add each map title from a i18n variable (cpyTitleWhatever) | |
| // any way to do this in a cleaner way? | |
| <% | |
| var maps = ['hits', 'calls', 'registrations', 'map'] | |
| _.each(maps, function(e,i) { | |
| %> | |
| <div class="group mapGroup <%= e %>"> | |
| <h4><% print(eval('cpyTitle'+e.charAt(0).toUpperCase() + e.slice(1))) %></h4> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var svg = d3.select("body").append("svg") | |
| .attr("width", 1000) | |
| .attr("height", 1000); | |
| var gatete = svg.append("g").append("foreignObject") | |
| .attr("width", 100) | |
| .attr("height", 100) | |
| .attr('class', 'gatete') | |
| .attr('x', 5) | |
| .attr('y',1) | |
| .append("xhtml:body") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DATABASES = { | |
| 'default': { | |
| 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. | |
| 'NAME': 'vinyl', # Or path to database file if using sqlite3. | |
| 'USER': 'root', # Not used with sqlite3. | |
| 'PASSWORD': '', # Not used with sqlite3. | |
| 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. | |
| 'PORT': '', # Set to empty string for default. Not used with sqlite3. | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //FightCode can only understand your robot | |
| //if its class is called Robot | |
| var Robot = function(robot) { | |
| }; | |
| Robot.prototype.seed = 1; | |
| Robot.prototype.detected = false; | |
| Robot.prototype.heading = false; | |
| Robot.prototype.onIdle = function(ev) { |