Skip to content

Instantly share code, notes, and snippets.

View raulsananes's full-sized avatar

Raul Sananes raulsananes

View GitHub Profile
@raulsananes
raulsananes / RaulsPhoneAreaCode.gs
Last active September 3, 2017 07:51
This Google Apps Script will allow you to determine the state and timezone of any phone number in the United States. Please check also http://j.mp/RaulsPhoneCodes
function state(phone){
phonet=phone.toString();
areaCode=phonet.replace(/\D/g,'').substr(0, 3);
areaCodei=Number(areaCode);
switch (areaCodei)
{
case 205:
case 251:
case 256:
case 334:
@rheajt
rheajt / Code.gs
Created June 14, 2017 15:38
google apps script to open a new website in a new window
function openTab() {
var selection = SpreadsheetApp.getActiveSheet().getActiveCell().getValue();
var html = "<script>window.open('" + selection + "');google.script.host.close();</script>";
var userInterface = HtmlService.createHtmlOutput(html);
SpreadsheetApp.getUi().showModalDialog(userInterface, 'Open Tab');
}