Skip to content

Instantly share code, notes, and snippets.

@srkirkland
srkirkland / migrate.sql
Created April 18, 2019 22:06
use loop and declare variables to call procedure
BEGIN
FOR i IN (SELECT DUPPIDM as pidm FROM MIGRATEPIDMS) LOOP
declare
P_APPL_NO_OUT NUMBER;
term NUMBER;
num_apps NUMBER;
begin
select count(*) into num_apps from saradap where saradap_pidm = i.pidm;
@srkirkland
srkirkland / deletemerged.ps1
Created January 13, 2016 22:04
delete merged branches powershell
git branch --merged | ?{-not ($_ -like "*master")} | %{git branch -d $_.trim()}
@srkirkland
srkirkland / minst.ipynb
Created December 13, 2017 22:51
minst example for appdev presentation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@srkirkland
srkirkland / failing.tsx
Created November 29, 2017 22:29
failing typescript stuff
Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op.
Please check the code for the HelloWorld component.
@srkirkland
srkirkland / context.jsx
Created November 29, 2017 18:15
notes about how to enable context in TSX
// Main Type of the context
export interface ProviderContext {
name: String;
}
// Provider
export default class App extends React.Component<{}, {}> {
static childContextTypes = {
name: PropTypes.string
}
@srkirkland
srkirkland / authtokenfilter.cs
Created May 25, 2017 17:29
Token filter for securing APIs
using System;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Configuration;
using System.Web.Http;
using System.Web.Http.Controllers;
namespace GivingService.Attributes
{
@srkirkland
srkirkland / outgoingips.ps1
Created December 6, 2016 23:54
powershell for outgoing IP addresses
Get-AzureRmResource -ResourceGroupName "Default-Web-WestUS" -ResourceType Microsoft.Web/sites `
-ResourceName prepurchasing -ApiVersion 2015-08-01 | select -expand Properties |
ft @{l=”OutboundIPAddresses”; e={$_.OutboundIPAddresses -split “,”}}
@srkirkland
srkirkland / mockextension.cs
Created November 28, 2016 19:47
Moq extensions to turn queryable set of data into a mocked db set that will return that data
public static class MockExtensions
{
public static Mock<DbSet<T>> MockDbSet<T>(this IQueryable<T> data) where T : class, new()
{
var mockSet = new Mock<DbSet<T>>();
mockSet.As<IQueryable<T>>().Setup(m => m.Provider).Returns(data.Provider);
mockSet.As<IQueryable<T>>().Setup(m => m.Expression).Returns(data.Expression);
mockSet.As<IQueryable<T>>().Setup(m => m.ElementType).Returns(data.ElementType);
mockSet.As<IQueryable<T>>().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator());
@srkirkland
srkirkland / .eslintrc
Created July 27, 2016 01:01
eslint config file for react native app, based on facebook's f8 example and airbnb style, plus some of my own favorite rules.
{
"extends": "airbnb",
"plugins": [
"react"
],
"env": {
"es6": true,
"jasmine": true,
},
"rules": {
@srkirkland
srkirkland / putonglasses.txt
Created May 6, 2016 18:48 — forked from cheeaun/putonglasses.txt
put on glasses unicode
(•_•)
( •_•)>⌐■-■
(⌐■_■)