Skip to content

Instantly share code, notes, and snippets.

View mrstebo's full-sized avatar
💻

Steven Atkinson mrstebo

💻
View GitHub Profile
@mrstebo
mrstebo / RestSharpExecuteAsyncMoq.cs
Last active April 19, 2021 14:52
Example for mocking RestSharps IRestClient ExecuteAsync method using Moq
using Moq;
using NUnit.Framework;
using RestSharp;
using System;
using System.Net;
namespace RestsharpTests
{
[TestFixture]
public class RestsharpExecuteAsyncMoq
@mrstebo
mrstebo / StringExtensions.cs
Created August 23, 2016 10:34
A nice little method for Slugifying a string
using System.Text.RegularExpressions;
namespace mrstebo
{
internal static class StringExtensions
{
public static string Slugify(this string s)
{
return s
.ReplaceSpecialSymbols()
@mrstebo
mrstebo / setup_postgres_for_rails.sh
Created September 7, 2016 21:25
Bash script for setting up Postgres for a local rails application
#!/bin/sh
echo -n "Please enter the username you want to add: "
read USERNAME
echo -n "Please enter the password for ${USERNAME} (will not be shown): "
read -s PASSWORD
echo ""
psql -U postgres -c "create user ${USERNAME} with password '${PASSWORD}';"
psql -U postgres -c "alter user ${USERNAME} superuser;"
@mrstebo
mrstebo / js-jsx.png
Last active August 23, 2017 09:30
Atom stylesheet with ligatures - JS/JSX
js-jsx.png
@mrstebo
mrstebo / ruby.png
Last active September 30, 2016 13:50
Atom stylesheet with ligatures - Ruby
ruby.png
@mrstebo
mrstebo / Dockerfile
Created December 20, 2016 08:59
Dockerfile for installing Ruby on Windows Server Core
FROM microsoft/windowsservercore
ENV DEVKITFILENAME DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe
ENV APPDIR c:\\app
ENV DEVKITDIR devkit
RUN powershell -Command \
$ErrorActionPreference = 'Stop'; \
Invoke-WebRequest -Method Get -Uri http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.3.3-x64.exe -OutFile c:\rubyinstaller-2.3.3-x64.exe; \
Start-Process c:\rubyinstaller-2.3.3-x64.exe -ArgumentList '/verysilent' -Wait; \
@mrstebo
mrstebo / Header.asp
Created March 27, 2017 21:07
Classic ASP Header Component
<%
Class Header
Public Function Render
Dim filename : filename = Server.MapPath("/components/Header/Template.html")
Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
Dim fs : Set fs = fso.OpenTextFile(filename, 1)
If Not fs.AtEndOfStream Then Render = fs.ReadAll
Set fs = Nothing
Set fso = Nothing
End Function
@mrstebo
mrstebo / BodyContainer.asp
Created March 27, 2017 21:10
Classic ASP BodyContainer Component
<%
Class BodyContainer
Public Function Render
Dim filename : filename = Server.MapPath("/components/BodyContainer/Template.html")
Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
Dim fs : Set fs = fso.OpenTextFile(filename, 1)
If Not fs.AtEndOfStream Then Render = fs.ReadAll
Set fs = Nothing
Set fso = Nothing
End Function
@mrstebo
mrstebo / includes.asp
Created March 27, 2017 21:13
Classic ASP Component inclusion
<!--#include FILE=Header/Header.asp-->
<!--#include FILE=BodyContainer/BodyContainer.asp-->
@mrstebo
mrstebo / index.asp
Created March 27, 2017 21:15
Classic ASP Components - Entrypoint
<!--#include VIRTUAL=/components/includes.asp-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Classic ASP Component Test</title>
<link type="text/css" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
</head>
<body>
<% response.write((New Header).Render) %>