Skip to content

Instantly share code, notes, and snippets.

View ahaverty's full-sized avatar

Alan ahaverty

View GitHub Profile
@ahaverty
ahaverty / create_doorkeeper_tables.rb
Created November 15, 2019 14:11
API Password Auth
class CreateDoorkeeperTables < ActiveRecord::Migration[6.0]
def change
create_table :oauth_applications do |t|
t.string :name, null: false
t.string :uid, null: false
t.string :secret, null: false
# Remove `null: false` if you are planning to use grant flows
# that doesn't require redirect URI to be used during authorization
# like Client Credentials flow or Resource Owner Password.
@ahaverty
ahaverty / index.js
Created December 20, 2018 14:02
Simple Firebase Function Https
const firebaseFunctions = require("firebase-functions");
let testHttpsFunction = firebaseFunctions.https.onRequest((req, res) => {
console.log("This ran successfully");
res.send(200);
});
exports.testHttpsFunction = testHttpsFunction;
import datetime
import glob
import os
from openpyxl import Workbook
from openpyxl import load_workbook
from os.path import expanduser
home = expanduser("~")
os.chdir(home + "/Downloads")
@ahaverty
ahaverty / test-call.ts
Last active April 26, 2018 13:46
Firebase Test Call API
import * as functions from 'firebase-functions';
import * as rp from 'request-promise';
import { google } from 'googleapis';
let projectId: string = "my-firebase-project-id";
export let testFunctions = functions.pubsub.topic("testfunctions").onPublish(async (message, context) => {
let functionsToExecute = ["functionA", "functionB", "functionC", "functionD",]
@ahaverty
ahaverty / category-converter.ts
Last active March 14, 2018 17:14
Json2Typescript Map type converter
import { JsonConverter } from 'json2typescript';
import { MapConvert } from './map-converter';
import { Category } from '../index';
@JsonConverter
export class CategoryConvert extends MapConvert<Category> {
deserialize(data: any): Map<string, Category> {
return this.deserializeMap<Category>(data, Category);
}