Skip to content

Instantly share code, notes, and snippets.

View shawnmclean's full-sized avatar
🐭
:)

Shawn Mclean shawnmclean

🐭
:)
View GitHub Profile
@shawnmclean
shawnmclean / zod-optional-null.ts
Created September 28, 2024 17:12 — forked from ciiqr/zod-optional-null.ts
zod optional/nullable/nullish differences
// zod schema
z.object({
// valid if string or:
optional: z.string().optional(), // field not provided, or explicitly `undefined`
nullable: z.string().nullable(), // field explicitly `null`
nullish: z.string().nullish(), // field not provided, explicitly `null`, or explicitly `undefined`
});
// type
{
@shawnmclean
shawnmclean / rss-contentful.js
Created November 2, 2022 00:24
Spotify Podcast RSS to Contentful Migration
import { env } from "process";
import * as Parser from "rss-parser";
import slufigy from "slugify";
import * as Contentful from "contentful-management";
import { htmlToText } from "html-to-text";
const client = Contentful.createClient({
accessToken: env.ACCESS_TOKEN,
});
{
"JobStatus": "SUCCEEDED",
"VideoMetadata": {
"Codec": "h264",
"DurationMillis": 14900,
"Format": "QuickTime / MOV",
"FrameRate": 30,
"FrameHeight": 576,
"FrameWidth": 320
},

Shawn Mclean contributions week ending Jan 14, 2017

Neon Wallet Repo Management

  • Cleaned up old branches
  • Closed old and resolved issues (25+ issues closed)
  • Labeled/Categorized issues
@shawnmclean
shawnmclean / COZ-contributions-week-19.md
Last active November 13, 2017 18:37
COZ-contributions-week-19

shawnmclean contributions for week 19

Neon Wallet

PRs and Issues

  • Code reviews and manual smoke test for refactoring stories, modals and getters.
  • Closed a few Issues that were not relevant.

shawnmclean contributions for week 16

Review and merging PRs for the week

  • Code reviews of the container refactoring
  • Manual testing of dev branch after major PR changes.

Integration Test

  • Accepted PR for integration test
  • Partial working of integration test on CI
@shawnmclean
shawnmclean / jaobersvervotehack.js
Last active August 29, 2015 14:27
Free Vote Script for Jamaica Observer Voting System
var request = require('request');
var lineReader = require('line-reader');
var selection = 1; // <- the id of the person to vote for
lineReader.eachLine('proxy.txt', function(line, last) {
request.post({
uri: 'http://jol.jamaicaobserver.com/mogul_poll/add_vote.php?the_vote='+selection,
proxy: 'http://'+ line
}, function (err, resp, body) {});
});
@shawnmclean
shawnmclean / swap.ps1
Created September 18, 2014 05:54
Swap Azure staging and production
Import-Module Azure
Import-AzurePublishSettingsFile "C:\Certificate\Azure.publishsettings"
Write-Host "Swapping staging and production slots..."
Switch-AzureWebsiteSlot -Name "griklyapi" -Slot1 "production" -Slot2 "staging" -Force
Write-Host "Swap complete"
[TestClass]
public class AccountsTests : TestBase
{
[TestMethod]
public async Task Register_Returns_Successfull()
{
var registerModel = new RegisterModel
{
Email = Constants.USER_EMAIL,
FirstName = "Shawn",
@shawnmclean
shawnmclean / TestBase.cs
Last active August 29, 2015 14:05
Base Test class for integration testing WebAPI
[TestClass]
public class TestBase
{
private static TestServer server;
public static TestServer Server
{
get { return server; }
}