Skip to content

Instantly share code, notes, and snippets.

Avatar

David Meza david-meza

View GitHub Profile
@david-meza
david-meza / geocoderService.js
Last active Jul 19, 2017 — forked from benmj/geocoder-service.js
An AngularJS Service for intelligently geocoding addresses using Google's API. Queries Google's API synchronously to avoid `google.maps.GeocoderStatus.OVER_QUERY_LIMIT`
View geocoderService.js
(function(angular) {
'use strict';
angular.module('geocoder', ['uiGmapgoogle-maps', 'ngStorage']).factory('geocoderService', ['$q', '$timeout', 'uiGmapGoogleMapApi', '$localStorage',
function ($q, $timeout, mapsApi, $localStorage) {
var locations = $localStorage.locations ? JSON.parse($localStorage.locations) : {};
console.log(locations);
View luhn.rb
require 'pry'
class Luhn
def initialize(input)
@digits = input.to_s.chars.map(&:to_i)
end
# ---------------- Class Methods ------------------
def self.create_hacky(input)
@david-meza
david-meza / Procfile
Created Jan 4, 2016
Heroku node.js buildpack
View Procfile
web: node server.js
@david-meza
david-meza / roman_numerals.rb
Last active Sep 18, 2018
Convert arabic to roman numerals in Ruby
View roman_numerals.rb
class Fixnum
# Constant variable with 'unique' roman numerals, plus some special cases (e.g. "IV, IX, XC, CM...")
ROMANS = { 1000 => "M",
900 => "CM",
500 => "D",
400 => "CD",
100 => "C",
90 => "XC",
50 => "L",