Skip to content

Instantly share code, notes, and snippets.

View felipesilva's full-sized avatar

Felipe Silva felipesilva

  • The New York Times
  • New York
View GitHub Profile
@felipesilva
felipesilva / perceived-performance-large-scale-web-applications
Last active July 25, 2019 19:37
Sources used for the presentation @ #FrontInBH
Jakob Nielsen and Robert Miller
* https://www.nngroup.com/articles/website-response-times/
* http://yusufarslan.net/sites/yusufarslan.net/files/upload/content/Miller1968.pdf
How perceived perf can impact User Engagement
* https://www.wsj.com/articles/financial-times-hopes-speedy-new-website-will-boost-subscribers-1475553602
* https://www.doubleclickbygoogle.com/articles/mobile-speed-matters/
* https://digiday.com/media/gq-com-cut-page-load-time-80-percent/
* https://www.soasta.com/blog/introducing-a-new-web-performance-metric-for-media-sites-activity-impact-score/
* https://www.soasta.com/blog/google-mobile-web-performance-study/
var Build = require("wf-build");
module.exports = {
plugins: [
new Build.webpack({ options })
]
};
Given 2 sorted arrays, merge them into one single sorted array and print its elements to standard output.
Expected complexity: O(N)
Example input:
a: 2 3 7 8 8
b: 7 8 13
Example output:
2 3 7 7 8 8 8 13
Given an array containing all numbers from 1 to N with the exception of one print the missing number to the standard output.
Example input:
array: 5 4 1 2
Example output:
3
VHS.plugin('name_your_plugin', {
_initialize: function(){
//method is called when the player is ready and the plugin was registered
this._player //player instance
this._options //options used to configure the player
this._element //jQuery element: video tag or object tag
this._data //video data that comes from the internal video/playlist api
this._container //player wrapper jquery element
},
yourMethod: function(e){
@felipesilva
felipesilva / robot.js
Created December 2, 2012 08:50 — forked from cezarsa/robot.js
Simple Wall Robot
var Robot = function(robot){
robot.turnLeft(robot.angle % 90);
robot.turnGunRight(90);
robot.clone();
this.direction = 1;
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(1);
if (robot.parentId) {
//FightCode can only understand your robot
//if its class is called robotClass
var robotClass = function(){
};
robotClass.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
robot.rotateCannon(360);