Skip to content

Instantly share code, notes, and snippets.

View ShariqT's full-sized avatar

Shariq Torres ShariqT

  • Los Angeles, CA
View GitHub Profile
@ShariqT
ShariqT / respond-with-sam.yml
Created January 6, 2022 02:51
respond-with-sam.yml
name: Always Sam
on:
issues:
types: [opened]
jobs:
respond_with_sam:
runs-on: ubuntu-latest
steps:
- uses: lob/action_sam_jackson@0.0.2
with:
@ShariqT
ShariqT / index.js
Created January 6, 2022 02:20
index.js
const github = require("@actions/github")
const core = require("@actions/core")
const { Octokit } = require("@octokit/action");
let gifURLs = [
'https://c.tenor.com/p29xMArwXB8AAAAd/samuel-l-jackson-silly.gif', //silly face sam
'https://c.tenor.com/8aKkFuCN7TsAAAAC/samuel-l-jackson-snakes-on-a-plane.gif', //snakes on a plane
'https://c.tenor.com/PUw8yTi8V5AAAAAC/samuel-l-jackson-shocked.gif', //oh-really-sam?!
@ShariqT
ShariqT / action.yml
Created January 6, 2022 01:48
action.yml
name: 'Sam Jackson Greeter'
description: 'An action to greet people who interact with the repo with a gif of Samuel L. Jackson'
inputs:
message:
description: 'Message displayed along side the Samuel L Jackson gif'
required: true
default: 'You need some Sam Jackson in your life'
token:
description: 'Github secret token'
required: true
@ShariqT
ShariqT / update_npm.yml
Created January 6, 2022 01:04
update_npm.yml
name: Current Release
on:
release:
types: [published]
jobs:
release:
name: Build and release new version to NPM
runs-on: ubuntu-latest
steps:
@ShariqT
ShariqT / main.yml
Created January 6, 2022 00:33
Main.yml
name: CI
on: [pull_request]
jobs:
build:
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ['10.x', '12.x', '14.x']
@ShariqT
ShariqT / backend-router2.js
Created December 7, 2021 00:38
backend-router2.js
import callback from "./postcard/callback.js";
router.post("/postcard/callback", callback);
@ShariqT
ShariqT / callback.js
Created December 7, 2021 00:34
callback.js
export default function callback(req, res) {
const eventType = req.body.event_type.id;
const from = req.body.body.to.name;
const to = req.body.body.from.name;
switch (eventType) {
case "postcard.created":
case "postcard.deleted":
// update the billing software
@ShariqT
ShariqT / list-postcards4.vue
Created December 7, 2021 00:01
list-postcards4.vue
<template>
<!-- other code -->
<ul>
<li v-for="postcard in postcards">
<span v-if="postcard.from != null">
From {{ postcard.from.name }} to {{ postcard.to.name }}.
</span>
<span v-else>
From *Address Missing* to {{ postcard.to.name }}.
</span>
@ShariqT
ShariqT / list-postcards3.vue
Created December 6, 2021 23:56
list-postcards3.vue
<script setup>
// other code
function cancel(id) {
fetch(`http://localhost:3030/postcard/cancel/${id}`)
.then((data) => data.json())
.then((data) => {
if (data.deleted) {
postcards.value = postcards.value.filter(postcard => postcard.id !== id)
}
});
@ShariqT
ShariqT / list-postcards2.vue
Last active December 6, 2021 23:56
list-postcards2.vue
<template>
<ul>
<li v-for="postcard in postcards">
<span v-if="postcard.from != null">
From {{ postcard.from.name }} to {{ postcard.to.name }}.
</span>
<span v-else>
From *Address Missing* to {{ postcard.to.name }}.
</span>
<span v-if="canCancel(postcard.send_date)" class="cancel">Cancel</span>