Skip to content

Instantly share code, notes, and snippets.

View shicholas's full-sized avatar
🏁
small victories add up

nick shicholas

🏁
small victories add up
  • Earth
View GitHub Profile
@shicholas
shicholas / AppSync.yaml
Created June 24, 2019 08:41
CloudFormation for Cognito & AppSync
---
AWSTemplateFormatVersion: '2010-09-09'
Description: >
This template creates an Authenticated AppSync API & Resolver Lambda
Parameters:
pGraphqlDefinition:
Description: GraphQL Schema
Type: String
pFunctionName:
Description: Name to Call the Function and Role
@shicholas
shicholas / hosts
Created August 18, 2018 18:20
Block Facebook (etc/hosts file)
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
@shicholas
shicholas / .zshrc
Created January 27, 2018 01:25
only typescript zshrc
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:/Users/nicholasshook/Library/Android/sdk:$PATH
alias git=hub
# Path to your oh-my-zsh installation.
export ZSH=/Users/nicholasshook/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
@shicholas
shicholas / spacemacs.el
Created October 3, 2017 13:12
SPACEMACS
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
<div id="leafly-menu"></div><div style="text-align:center;">Visit our profile on <a href="https://www.leafly.com/dispensary-info/the-apothecary-shoppe">Leafly</a></div><script src="https://www.leafly.com/public/global/js/dispensarymanager/embed.js"></script>
<script>var pymParent = pym.Parent('leafly-menu', 'https://www.leafly.com/embed/menu2/the-apothecary-shoppe', {});</script>
@shicholas
shicholas / json-api-formatter-test.clj
Last active January 18, 2017 18:45
ORM-Less JSONAPI
(ns vsa-portal-api.json-api-formatter-test
(:require [vsa-portal-api.json-api-formatter :as sut]
[cheshire.core :as json]
[clojure.test :as t]))
(t/deftest ->toJsonAPI
(t/testing "with an empty vector"
(t/is
(thrown? java.lang.Exception
(sut/->toJsonAPI []))))

To find out how many classes you did at a studio do the following:

  1. Log in to the studio Mind Body Portal by navigating to https://clients.mindbodyonline.com/ASP/su1.asp?studioid=47475
  2. Visit your visit history by navigating to https://clients.mindbodyonline.com/ASP/my_vh.asp
  3. Open the console in your web browser. You can do that in Chrome on Windows by pressing Ctrl + Shift + J simultaneously (or Cmd + Opt + J for macs). For Firefox the keyboard shortcuts are Ctrl + Shift + K and Cmd + Opt + K respectively.
  4. Copy and paste the following code, it counts all the table rows for classes this year.
@shicholas
shicholas / find-or-create-person.sql
Created December 29, 2016 01:41
SQL function for finding/creating a person based on an invited user attribute
CREATE OR REPLACE FUNCTION find_or_create_person(invited_user_id uuid)
RETURNS SETOF people AS
$BODY$
DECLARE
invited_user invited_users%ROWTYPE;
person people%ROWTYPE;
BEGIN
RAISE NOTICE 'Verifying the invited user exists';
SELECT INTO invited_user *
FROM invited_users u
@shicholas
shicholas / find-or-create-person.sql
Created December 28, 2016 23:25
Find or Create Person based of a related "Invited User" record. Email and Name in both records should match before creating a new one.
-- :name define-find-or-create-person :!
-- :doc define find-or-create-person function based off invited user id
CREATE OR REPLACE FUNCTION find_or_create_person(invited_user_id UUID)
RETURNS record AS
$BODY$
DECLARE
invited_user record;
person record;
BEGIN
RAISE NOTICE 'Verifying the invited user exists';
---
AWSTemplateFormatVersion: '2010-09-09'
Description: >
This template a ruby elasticbeanstalk environment that connects to a
postgresql database by allowing for traffic within the databases\'s vpc
Parameters:
ApplicationName:
Description: Name of Elasticbeanstalk application
Type: String