Skip to content

Instantly share code, notes, and snippets.

@jpv001
jpv001 / inspect.py
Created November 29, 2022 16:11
Inspect NEXRAD Level II file on AWS
import boto3
import botocore
from botocore.client import Config
import matplotlib.pyplot as plt
from metpy.io import Level2File
from metpy.plots import add_timestamp, ctables
from mpl_toolkits.axes_grid1 import make_axes_locatable
import numpy as np
s3 = boto3.resource('s3', config=Config(signature_version=botocore.UNSIGNED,
void Main()
{
var policy = Policy
.Handle<TimeoutException>()
.Or<SqlException>(ex => (new[] { 40613, 40501, 40197, 10929, 10928, 10060, 10054, 10053, 233, 64, 20 }).Contains(ex.Number))
.WaitAndRetry(5, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt) / 2),
(ex, count) =>
{
count.Dump();
//log
void Main()
{
var d = new Dictionary<BigInteger, BigInteger>();
var t = DateTime.Now;
var howfar = 0;
var r = 0;
for (int x = 0; x < 100000; x++)
{
for (int i = 0; i < 10000000; i++)
{
@jpv001
jpv001 / gist:2faf60c83254b108ca0c
Created April 22, 2015 22:51
Mirror Commands
Mirror Commands
Create Mirror
Configure Connections between the dbs using certificates/endpoints - https://technet.microsoft.com/en-us/library/ms191140.aspx
-- Disable automatic backup jobs before starting --
1. Backup database
@jpv001
jpv001 / xunit-scaffold.cs
Last active August 29, 2015 14:19
XUnit Linqpad Scaffold
void Main()
{
XunitHelpers.LaunchXunitGui(Assembly.GetExecutingAssembly());
}
#region Public XUnit Tests Here
public class TestThis
{
[Fact]
@jpv001
jpv001 / gist:f955d5786814aa42c5c0
Created July 25, 2014 00:03
Api Calling code - Web API
async void Main()
{
var client = new ApiClient("http://localhost/");
var products = await client.Get<dynamic>("products", MediaType.Json);
}
public class MediaFormatterTypes
{
public MediaTypeFormatter MediaTypeFormatter { get; set; }
public string ContentTypeHeaderValue { get; set; }
@jpv001
jpv001 / Cafe_ByNameAndLocation.cs
Created April 20, 2012 12:43
Raven Location Spike
public class Cafe
{
public string Id { get; set; }
public string Name { get; set; }
public double Latitude { get; set; }
public double Longitude { get; set; }
}
[TestFixture]
public class AddCafeTest
{