Skip to content

Instantly share code, notes, and snippets.

View RyannosaurusRex's full-sized avatar

Ryan Hayes RyannosaurusRex

View GitHub Profile
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
#Import-Module PSColors
#Import-Module posh-git
Import-Module -Name Terminal-Icons
@RyannosaurusRex
RyannosaurusRex / RockRmsExportToPCO.sql
Last active September 21, 2018 16:10
An Export script for use when migrating from RockRMS to Planning Center Online's CSV import format. Use this with SQL Operations Studio to export the results directly to .csv.
SELECT TOP (1000)
p.[Id] as PersonId
,COALESCE( [FirstName] , '' ) as FirstName
,COALESCE([NickName], '') AS NickName
,COALESCE([MiddleName], '') AS MiddleName
,COALESCE([LastName], '') AS LastName
,[BirthDate] as Birthdate
,[AnniversaryDate] as Anniversary
--,MedicalNotes
,g.id as HouseholdID

Keybase proof

I hereby claim:

  • I am ryannosaurusrex on github.
  • I am ryannosaurusrex (https://keybase.io/ryannosaurusrex) on keybase.
  • I have a public key ASCmgpW0YP-qQLDMTUAGT9QQpd7SwrY_2EwpJyCpFz44ewo

To claim this, I am signing this object:

@RyannosaurusRex
RyannosaurusRex / webnotification.js
Created January 10, 2017 18:56
Example of how to send a notification using the Web Notification API
function showNotification(title, body) {
var notification = new Notification(title, { body });
notification.onclick = e => {
alert("Clicked!");
};
}
Notification.requestPermission(permission => {
console.log(permission);
if(permission==="granted") {
@RyannosaurusRex
RyannosaurusRex / ryan.boxstarter
Created August 20, 2016 01:48
Ryan's Dev Boxstarter
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
Enable-RemoteDesktop
cinst fiddler4
cisnt nodejs.install
cinst git-credential-winstore
cinst console-devel
cinst filezilla
cinst poshgit
cinst skype
@RyannosaurusRex
RyannosaurusRex / build.cake
Last active March 15, 2017 11:43
Cake build watcher task. It includes a Windows 10 toast notification when the build completes.
#addin "nuget:?package=Cake.Watch" // Put this at the top to pull in the Cake.Watch package for use.
// Add this task in your build file somewhere. You can update which target to run, the file pattern to watch, and even the toast notification.
Task("Watch")
.Does(() => {
var settings = new WatchSettings {
Recursive = true,
Path = "./",
Pattern = "*.*"
};
@RyannosaurusRex
RyannosaurusRex / email.csx
Created November 6, 2015 18:28
Send an email using ScriptCS
// This script sends an email using ScriptCS.
// Useful as an isolated, easy to configure email sender to debug SMTP
// issues that may be hard/impossible by running your production application
// over and over just to send an email.
// More Info: http://scriptcs.net/
using System.Net.Mail;
string from = "from@address.com";
string to = "to@address.com";
@RyannosaurusRex
RyannosaurusRex / package.bat
Created October 14, 2015 18:44
Recursively package all .nuspec files in a directory from a .bat file.
@ECHO OFF
SETLOCAL
SET VERSION=%1
SET NUGET=.\BuildAndPackageSupport\nuget.exe
FOR /r %%f IN (*.nuspec) DO (
echo "packing..."
%NUGET% pack %%f -Version %VERSION%
)
@RyannosaurusRex
RyannosaurusRex / mark-required.js
Created April 29, 2015 01:20
Mark Fields as Required
// Checks an element to see if the validation says it is required
// and if so, adds a '*' to the label using the 'for' semantic attribute.
function MarkAsRequired(element) {
var req = $(element).attr('data-val-required');
if (undefined != req) {
var label = $('label[for="' + $(element).attr('id') + '"]');
var text = label.text();
if (text.length > 0) {
label.append('<span style="color:red"> *</span>');
}
@RyannosaurusRex
RyannosaurusRex / Ember in ASP.NET MVC.md
Last active August 10, 2023 04:17
Adding an EmberJS app to an ASP.NET MVC app

How to set up an Ember app inside of an ASP.NET MVC app.

I love Ember. It helps me build fantastic UIs, but security isn't super straightforward and I suck at it. I love ASP.NET MVC. It help me build secure applications and solid APIs, but for some apps I need a great responsive UI with great interaction.

Together, these two technologies can be used together to create really amazing apps (and really quickly, too). So this guide is to show you how to set them up together.

Note: This article assumes you have created a stock new ASP.NET project within Visual Studio and included MVC and WebAPI options. It also assumes you have EMBER CLI installed and have run ember new my-ember-app into a directory in the root of your ASP.NET MVC project.