Skip to content

Instantly share code, notes, and snippets.

View Diastro's full-sized avatar

David Albertson Diastro

  • Microsoft
  • Bellevue, WA
View GitHub Profile
@Diastro
Diastro / DiagnoseRedisErrors-ClientSide.md
Created October 17, 2017 16:30 — forked from JonCole/DiagnoseRedisErrors-ClientSide.md
Diagnosing Redis errors caused by issues on the client side

Diagnosing Redis errors on the client side

Customers periodically ask "Why am I getting errors when talking to Redis". The answer is complicated - it could be a client or server side problem. In this article, I am going to talk about client side issues. For server side issues, see here

Clients can see connectivity issues or timeouts for several reason, here are some of the common ones I see:


Memory pressure

@Diastro
Diastro / Github backup
Created October 9, 2016 00:22
Personal Github backup script
# dependency : pygithub
from subprocess import call
import datetime
import os
from github import *
access_token = ""
@Diastro
Diastro / gist:e9e6161e4614bd2e6fbb
Created August 12, 2015 02:59
Event raised twice
using System;
namespace ProcessPrototype
{
using System.Diagnostics;
class Program
{
static void Main(string[] argsd)
{
msg = """
**------------ CoolGithubProjects Bot ------------**
Your post has been removed since it looks like the link you submitted
[*{link}*]
is **not** pointing to a github project.
Feel free to repost using a link pointing to a github project!
c:\Users\David\Desktop\at\resources\app\apm\node_modules\atom-package-manager\lib\install.js:202
throw new Error('You must have Visual Studio 2010, 2012, or 2013 insta
^
Error: You must have Visual Studio 2010, 2012, or 2013 installed
at Install.module.exports.Install.getVisualStudioFlags (c:\Users\David\Desktop\at\resources\app\apm\node_modules\atom-package-manager\lib\install.js:202:15)
at Install.module.exports.Install.installModule (c:\Users\David\Desktop\at\resources\app\apm\node_modules\atom-package-manager\lib\install.js:128:25)
at c:\Users\David\Desktop\at\resources\app\apm\node_modules\atom-package-manager\lib\install.js:396:28
at fn (c:\Users\David\Desktop\at\resources\app\apm\node_modules\atom-package-manager\node_modules\async\lib\async.js:582:34)
at Object._onImmediate (c:\Users\David\Desktop\at\resources\app\apm\node_modules\atom-package-manager\node_modules\async\lib\async.js:498:34)
at processImmediate [as _immediateCallback] (timers.js:330:15)
<?php
// Setup
$I = new Api($scenario);
$I->wantTo('add a new product');
$I->haveHttpHeader('Authorization-User','admin');
$I->haveHttpHeader('Authorization-Password','test');
// Creating a new product
$variant = array('size' => 'medium',
'sku' => '11b02020202-M',
<?php
class HTTP{
const GET = "GET";
const PUT = "PUT";
const POST = "POST";
const DELETE = "DELETE";
}
class Protocol{
import re, os
def formatMethods(methods):
formattedMethods = ''
for m in methods:
m['params'] = filter(None, m['params'])
if m['params']:
methodStruct = """
{access} {type} {name}({params}){{
@Diastro
Diastro / gist:9266557
Created February 28, 2014 06:55
Proxy creator
import re, os
def formatMethods(methods):
formattedMethods = ''
for m in methods:
methodStruct = """
{access} {type} {name}({params}){{
return parent::makeRequest(__FUNCTION__);
}}
@Diastro
Diastro / gist:9264774
Created February 28, 2014 03:42
PHP interface parser
//
import re
s = "al($test, $test2)"
m = re.search(r"\((A-Za-z0-9_+)\)", s)
print m.group(1)
//
import re