Skip to content

Instantly share code, notes, and snippets.

View palumbo's full-sized avatar

Joseph Palumbo palumbo

View GitHub Profile
@palumbo
palumbo / zapier.js
Created January 10, 2018 01:06
JS for pulling CloudWatch alarm data into zapier
/*
EXAMPLE:
input.messy_data_from_previous_trigger_or_action = 'This is a single string of text that contains lots of different data. {"name": "John"} Sometimes when you are building a Zap, you will need to pull out one piece of data from a long, messy string of text. {"email": "[email protected]"} Thankfully, you can use the "Formatter by Zapier" app or the "Code by Zapier" app to extract the information you need.'
*/
function extract_piece_of_data(entire_string_of_text, characters_before_desired_data, characters_after_desired_data) {
var desired_data_with_stuff_after_it = entire_string_of_text.substr(entire_string_of_text.indexOf(characters_before_desired_data) + characters_before_desired_data.length);
@palumbo
palumbo / hn.html
Last active November 4, 2017 16:38
web page that pulls the top stories from hacker news firebase using jQuery
<html>
<head>
<title>Hacker News</title>
<link rel="stylesheet" href="../main.css" type="text/css" />
<style type="text/css" media="screen">
#gist {
display: none;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
@palumbo
palumbo / mrrExtractor.gs
Last active October 16, 2017 05:04
Google Script that reformats pasted in text from HostOps and creates a chart showing revenue over a period of time
function onOpen(e) {
// create custom menu
var ui = SpreadsheetApp.getUi();
ui.createMenu('Functions')
.addItem('Extract MRR', 'mrrExtractor')
.addItem('Reset Sheet', 'resetSheet')
.addToUi();
};
//
// ViewController.swift
// Say Hello
//
// Created by Joseph Palumbo on 10/8/17.
// Copyright © 2017 Joseph Palumbo. All rights reserved.
//
import UIKit
@palumbo
palumbo / UISwitches.swift
Last active October 8, 2017 21:40
Swift 4 solution for controlling 2 UISwitch elements and UILabels
//
// ViewController.swift
// Basic
//
// Created by Joseph Palumbo on 10/8/17.
// Copyright © 2017 Joseph Palumbo. All rights reserved.
//
import UIKit
@palumbo
palumbo / in_array.php
Last active May 7, 2017 05:08
in_array example
<?php $numbers = [8, 23, 15, 42, 16, 5]; ?>
<?php # is 15 in array?
$ans = in_array("15", $numbers);
if ($ans == 1) {
echo "true"; # returns true
} else {
echo "false";
};
@palumbo
palumbo / 20pics.html
Created February 24, 2016 18:55
20pics.html
<html>
<head>
<title>1 Image - 100 Possibilities</title>
<style>
body { font-family: sans-serif; }
#imageUpload {
background-color: #4CAF50; /* Green */
border: none;
color: white;
<!DOCTYPE html>
<html>
<head>
<title>Baconator (Powered by Filestack)</title>
<style>
body { font-family: sans-serif; }
#baconator {
background-color: #f44336;
border: none;
<img data-fp-src="https://upload.wikimedia.org/wikipedia/commons/1/1e/Alamo_pano.jpg" data-fp-apikey="A1AJmUYdDTj2Y5wEFtRO7z" data-fp-pixel-round="10" data-fp-on-resize="all" width="100%"/>
<html>
<head>
<title>Write Demo</title>
<style>
body {
font-family: sans-serif;
}
#uploadConfirmation {
color: green;