Skip to content

Instantly share code, notes, and snippets.

View goshmx's full-sized avatar
💭
Build. Fail. Learn. Repeat. 👾

Gosh Hernandez goshmx

💭
Build. Fail. Learn. Repeat. 👾
View GitHub Profile
@goshmx
goshmx / hack.sh
Created December 25, 2013 10:38 — forked from cjsaylor/hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#

Zumba Javascript Code Standard

Contents

  1. Preface
  2. Quick Reference
  3. General Naming
  4. Specific Naming
  5. Layout
  6. Variables
<?php
$data = array(
'labels' => array(
array('string' => 'Sample'),
array('number' => 'Piston 1'),
array('number' => 'Piston 2')
),
'data' => array(
array('S1', 74.01, 74.03),
<?php
$data = array(
'labels' => array(
array('string' => 'Sample'),
array('number' => 'Piston 1'),
array('number' => 'Piston 2')
),
'data' => array(
array('S1', 74.01, 74.03),
<?php
$data = array(
'labels' => array(
array('string' => 'Sample'),
array('number' => 'Piston 1'),
array('number' => 'Piston 2')
),
'data' => array(
array('S1', 74.01, 74.03),
@goshmx
goshmx / HTML a Excel
Created January 23, 2014 07:41
Funcion Javascript para exportar una tabla HTML a formato Excel
var Tabla2Excel = (function() {
var uri = 'data:application/vnd.ms-excel;base64,',
template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>',
base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) },
format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p]; }) }
return function(table, nombre) {
if (!table.nodeType) table = document.getElementById(table)
var ctx = {worksheet: nombre || 'Worksheet', table: table.innerHTML}
window.location.href = uri + base64(format(template, ctx))
}

Project

Description: What does this project do and who does it serve?

Project Setup

How do I, as a developer, start working on the project?

  1. What dependencies does it have (where are they expressed) and how do I install them?
  2. How can I see the project working before I change anything?

##Create an alias to MAMP's PHP installation

To do this, we can simply create an alias for our bash profile. We'll be doing this is nano, though you can do it in vim or a number of other editors as well.

Within the terminal, run:

nano ~/.bash_profile

This will open nano with the contents, at the top in a blank line add the following line:

@goshmx
goshmx / Google maps directions
Created November 1, 2014 19:25
Uso de la libreria Direction para mostrar la ruta
// Variables que deben ser cargadas al principio de todo el codigo js para identificar variables globales.
var direcciones; //Esta variable tendra la polilinea con la ruta
var direccionServicio = new google.maps.DirectionsService();// Este es el servicio que hara el calculo de las direcciones
var map; //Mapa declarado como global para instanciar otros servicios.
//Adicionalmente despues que cargaste tu mapa, agregas esta linea, despues de map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions); o algo simiilar
direcciones.setMap(mapa);
/*Funcion que se invoca para calcular la ruta
@goshmx
goshmx / htttp.js
Last active November 23, 2016 16:28
Fix Sails js error . Request entity too large. Code 413
//This fragment goes in your config/http.js file.
//Ensure to install skipper previusly...
//Tested in Sails.js v0.10.5
module.exports.http = {
bodyParser: (function () {
var opts = {limit:'50mb'};
var fn;