Skip to content

Instantly share code, notes, and snippets.

View KerryRitter's full-sized avatar

Kerry Ritter KerryRitter

View GitHub Profile
@KerryRitter
KerryRitter / example.cs
Last active November 3, 2016 14:36
Dapper relationship query example
using (var connection = new SqlConnection(_config["Connection"]))
{
string query = @"SELECT *
FROM [Template]
WHERE [Type] = @type;
SELECT tct.TemplateId as TemplateId, tc.Name as CategoryName
FROM [TemplateCategory_Template] tct
JOIN [TemplateCategory] tc ON tct.TemplateCategoryId = tc.Id;
@KerryRitter
KerryRitter / CigarController.cs
Last active November 7, 2016 16:53
bedframe example
public class CigarSerializer : Serializer<Cigar, CigarDto>
{
public Cigar Serialize(CigarDto request)
{
return new Cigar
{
Name = request.Name,
Brand = request.Brand
};
}
@KerryRitter
KerryRitter / dappermap.cs
Created December 9, 2016 17:19
dapper mapping
public class OmgDapperRules
{
public List<ProjectVersionField> GetAllForVersion(int projectVersionId)
{
using (var connection = _connectionFactory.Create())
{
var fields = connection.Query<ProjectVersionField, ProjectTemplateField, ProjectTemplateFieldType, ProjectVersionField>(@"
SELECT pvf.*, ptf.*, ptft.*
FROM [dbo].[ProjectVersionField] pvf
INNER JOIN [dbo].[ProjectTemplateField] ptf ON ptf.Id = pvf.ProjectTemplateFieldId
@KerryRitter
KerryRitter / app.ts
Created December 13, 2016 02:32
webpack typescript test
import { Person } from "./person";
import "test";
const person = new Person("Kerry", "Ritter");
alert(person.fullName);
@KerryRitter
KerryRitter / loadingService.ts
Created January 17, 2017 19:07
Angular Loading service using Bootstrap UI
import { Inject, Service } from "core/decorators";
@Service("loadingService")
export class LoadingService {
private _modal: ng.ui.bootstrap.IModalServiceInstance;
constructor(
@Inject("$uibModal") private _modalService: ng.ui.bootstrap.IModalService
) {
}
{
"compilerOptions": {
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"module": "none",
"moduleResolution": "node",
"sourceMap": true,
"target": "es5",
"inlineSources": true,
@KerryRitter
KerryRitter / FormRepository.cs
Last active March 16, 2017 18:32
xamarin.forms form example
using System;
using System.Collections.Generic;
using System.Linq;
using Realms;
using StubbsTest.Models;
namespace StubbsTest.Data
{
public class FormRepository : IDisposable
{
@KerryRitter
KerryRitter / membershipPaymentForm.ts
Last active April 12, 2017 17:13
jQuery TS example
class MembershipPaymentForm {
private get form() {
return $("#membership-payment-form");
}
private get individualElements() {
return this.form.find("*[type='individual']");
}
private get partnerElements() {
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
class RatingController extends Controller
{
public function __construct() {
@KerryRitter
KerryRitter / ProfCalcTest.vf
Created July 19, 2017 18:05
S1ScrollerTest
<apex:page showHeader="false" standardStylesheets="false" sidebar="false" applyHtmlTag="false" applyBodyTag="false" docType="html-5.0" standardController="Account">
<style>
html,
html body {
overflow: visible;
-webkit-overflow-scrolling: touch;
}
body {
position: absolute;