Skip to content

Instantly share code, notes, and snippets.

@david-meza
david-meza / geocoderService.js
Last active July 19, 2017 17:22 — 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`
(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);
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 January 4, 2016 04:38
Heroku node.js buildpack
web: node server.js
@david-meza
david-meza / roman_numerals.rb
Last active November 9, 2023 10:01
Convert arabic to roman numerals in Ruby
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",