Skip to content

Instantly share code, notes, and snippets.

View ffflabs's full-sized avatar

Felipe Figueroa ffflabs

View GitHub Profile
@ffflabs
ffflabs / README.md
Last active August 29, 2015 14:05
Toggle KML elements

Declare an array named kmlArray to store the kml layers. Toggle them using the corresponding marker index.

@ffflabs
ffflabs / README.md
Created October 30, 2014 01:52
Benchmarking Google Maps Marker creation

This example creates 2000 random coordinate pairs nearby San Francisco. You can use the buttons to print them using a synchronous loop or an asynchronous loop.

@ffflabs
ffflabs / index.html
Created November 15, 2014 02:36
associating buttons with map positions
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
@ffflabs
ffflabs / index.html
Created November 17, 2014 22:10
Appending place details to html element
<!DOCTYPE html>
<html>
<head>
<title>Place searches</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;
@ffflabs
ffflabs / index.html
Last active August 29, 2015 14:09
Change Google Maps location and zoom with a Select control
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<style>
#map-canvas {
height:600px;
}
</style>
@ffflabs
ffflabs / index.html
Created November 24, 2014 12:08
Overlaying an SVG maker on top of Google Maps
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Google Maps Multiple Markers</title>
<style>
#map {
margin:20px auto;
@ffflabs
ffflabs / index.html
Created March 31, 2015 18:21
Clustering markers for a Redditor
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<style>
#map-canvas {
height:500px;
}
</style>

jQuery vs WebWorker Request

The aim of this example is to show that, while jQuery will execute and resolve a bunch of request sequentially, delegating the task to webworkers will instead execute the request in parallel.

Be careful, this example will fire ~30 webworkers and may crash your browser.

The webworker is using pure javascript implementation of ajax request. jQuery kept throwing Cannot read property 'defaultView' of undefined error.

@ffflabs
ffflabs / DBStuff.php
Last active August 29, 2015 14:25
Refactor your script into a class
<?php
include '../connection.php';
class DBStuff
{
public $totalpricy = 0;
public function __construct(\PDO $conn)
{
$this->conn = $conn;
@ffflabs
ffflabs / comboboxvariation.js
Created August 4, 2012 23:49
jQuery UI Combobox Variation
(function($){
$.widget( "ui.combobox", $.ui.autocomplete,
{
options: {
/* override default values here */
minLength: 3,
/* the argument to pass to ajax to get the complete list */
ajaxGetAll: {get: "all"}
},