Skip to content

Instantly share code, notes, and snippets.

View shawnmclean's full-sized avatar
🐭
:)

Shawn Mclean shawnmclean

🐭
:)
View GitHub Profile
@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
},
@shawnmclean
shawnmclean / IRepository.cs
Created August 24, 2012 04:09
Example of a generic repository interface
public interface IRepository<T> where T : class
{
/// <summary>
/// Gets all objects from database
/// </summary>
IQueryable<T> All();
/// <summary>
/// Gets objects from database by filter.
/// </summary>

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 / getFile.cs
Created April 6, 2012 21:16
Return a file content from asp.net webapi action
public HttpResponseMessage GetText()
{
try
{
string content = "Hello";
HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK);
result.Content = new StringContent(content);
//a text file is actually an octet-stream (pdf, etc)
result.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
@shawnmclean
shawnmclean / IUnitOfWork.cs
Created July 4, 2013 16:00
Interface for Unit Of Work
/// <summary>
/// Interface for the unit of work pattern, inherits from IDisposable to dispose of the DbContext
/// </summary>
public interface IUnitOfWork: IDisposable
{
/// <summary>
/// Saves the changes of the DbContext wrapped by the UoW
/// </summary>
/// <returns></returns>
int SaveChanges();
@shawnmclean
shawnmclean / EntityRepository.cs
Created July 3, 2013 22:37
Generic Entity Framework Repository concrete class
public class EntityRepository<T> : IRepository<T>
where T : class
{
protected DbContext Context = null;
public EntityRepository(DbContext context)
{
if (context == null) throw new ArgumentNullException("context");
Context = context;
@shawnmclean
shawnmclean / IRepository.cs
Created July 3, 2013 22:32
Generic Repository Interface
public interface IRepository<T> where T : class
{
/// <summary>
/// Gets all objects from database
/// </summary>
IQueryable<T> All(params string[] includes);
/// <summary>
/// Gets objects from database by filter.
/// </summary>