Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View cassaram09's full-sized avatar

Matt Cassara cassaram09

View GitHub Profile
@cassaram09
cassaram09 / loadGoogleMaps.js
Created September 13, 2017 21:58
tool to load Google Maps API
import load from "little-loader";
import qs from "query-string";
// YOUR_API_KEY - string
// libraries - array of strings, eg ['places']
const loadGoogleMaps = (YOUR_API_KEY, libraries) => {
return new Promise( (resolve, reject) => {
var params = {key: YOUR_API_KEY, libraries: libraries}
@cassaram09
cassaram09 / deepClone.js
Last active October 12, 2021 06:22
JavaScript deep clone function
function deepClone(source){
// If the source isn't an Object or Array, throw an error.
if ( !(source instanceof Object) || source instanceof Date || source instanceof String) {
throw 'Only Objects or Arrays are supported.'
}
// Set the target data type before copying.
var target = source instanceof Array ? [] : {};
for (let prop in source){
@cassaram09
cassaram09 / new_tab_with_directory.sh
Last active August 20, 2020 16:59
Open a new tab in Iterm2 with current directory
# Add these functions to your Bash profile.
# Copies the current directory to the clipboard
function cwd {
pwd | pbcopy
}
# Changes the current directory, after new tab has been loaded
function chwd {
DIR=`pbpaste`
@cassaram09
cassaram09 / Google-Sheet-Form-Post.md
Created March 9, 2017 20:49 — forked from willpatera/Google-Sheet-Form-Post.md
Post to google spreadsheet from html form

Overview

This collection of files serves as a simple static demonstration of how to post to a google spreadsheet from an external html <form> following the example by Martin Hawksey

Run example

You should be able to just open index.html in your browser and test locally.

However if there are some permissions errors you can make a quick html server with python. Open terminal and cd to the directory where the gist files are located and enter python -m SimpleHTTPServer. By default this creates a local server at localhost:8000

@cassaram09
cassaram09 / project_setup.sh
Last active September 13, 2022 02:46
Bash script to setup a bare git repository on a server utilizing ssh for deployment and password protection using htaccess
# This script will help configure automated deployment of projects to a server using Git.
# Created by Matt Cassara
# More info at http://mattcassara.com/automated-git-project-deployment/
# This is based on a script by Richard Westenra
# See http://richardwestenra.com/automating-git-deployment/
echo -e "\n"
echo ">> Welcome to the DSB project set up script."
@cassaram09
cassaram09 / files
Created July 27, 2016 19:27
$$$@@$#R
aeongs
@cassaram09
cassaram09 / awesdf
Created July 27, 2016 19:26
sdfsdgg
asfdg
ets
ets
aefgs