Skip to content

Instantly share code, notes, and snippets.

@jonsagara
jonsagara / elastic-gnaf.fsx
Created September 18, 2019 15:32 — forked from codebrain/elastic-gnaf.fsx
Building a realtime address search with the Australian G-NAF dataset
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
@jonsagara
jonsagara / Examples.cs
Created September 4, 2016 15:59 — forked from NickCraver/Examples.cs
SQL Exception handy helpers
// Here are some example usages for unimportant jobs we have where crap happens occasionally:
/// <summary>
/// intended for database commands that might deadlock, but are just "nice to haves"; we don't care if they deadlock every now and then
/// and we DON'T want them to block execution of the rest of /daily or /hourly! this returns -1 if deadlocked, otherwise, returns
/// the # of rows that the SQL command affected
/// </summary>
private int ExecuteIgnoreDeadlocks(string sql, object param = null, bool logDeadlock = false)
{
try