Skip to content

Instantly share code, notes, and snippets.

@erezwanderman
erezwanderman / ListAllOutlookCategories.bas
Created April 19, 2023 18:19
List all outlook categories VBA macro
Option Explicit
' This creates a file %TEMP%\Categories.xml that lists all categories in Outlook
Sub ListAllOutlookCategories()
Dim theStores As stores
Dim xmlStr As String
xmlStr = xmlStr + "<CategoriesList>" & vbCrLf
Set theStores = Session.stores
@erezwanderman
erezwanderman / DB.cs
Created October 29, 2019 16:02
Read a DB value in C#, handle DBNull
//method:
/// <summary>
/// Returns the value, or null if it is DBNull
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="o"></param>
/// <returns></returns>
/// <remarks>Author: Erez Wanderman</remarks>
private static T GetDbValue<T>(object o)
@erezwanderman
erezwanderman / ChangeAllWorkspacesToPublic.cs
Created June 30, 2019 11:36
This program makes all TFS/Azure DevOps TVFC workspaces of a specific user public
// Add from Nuget: Microsoft.TeamFoundationServer.ExtendedClient
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.Framework.Client;
using Microsoft.TeamFoundation.Framework.Common;
using Microsoft.TeamFoundation.VersionControl.Client;
using Microsoft.TeamFoundation.VersionControl.Common;
using System;
using System.Text;
using IdentityNotFoundException = Microsoft.TeamFoundation.VersionControl.Client.IdentityNotFoundException;
@erezwanderman
erezwanderman / gist:13e82ab1af1e80fe961ea67303d1d8a3
Created November 22, 2017 23:44
Bitcoin <-> Bitcoin Gold address translator
// Bitcoin <-> Bitcoin Gold address translator
// 1) Paste this to https://npm.runkit.com/
// 2) Change the address
// 3) Run!
var base58check = require("base58check")
// ***************************************
// CHANGE THIS
// ***************************************
var add = '1DWxkUks8xMdTdyYGQBKHyB7AYSsEcsP3d';
<?php
require_once(__DIR__ . "/global.php");
function bit2c_query($key, $secret, $path, array $req = array()) {
static $curl_tmpl = null;
if ($curl_tmpl === null) {
$curl_tmpl = curl_init();
curl_setopt($curl_tmpl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_tmpl, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0');
//curl_setopt($ch, CURLOPT_URL, $path);
@erezwanderman
erezwanderman / GetBitcoinBalances.cs
Created January 20, 2015 20:12
Get balance of multiple bitcoin addresses using insight API
List<string> lstAddresses = new List<string>() {
"1Jz6HEKNJpYjXAYRLn49QUUUrizL5qGxjM",
"1JoktQJhCzuCQkt3GnQ8Xddcq4mUgNyXEa",
"18vo26nEeDt1Tw17CuWap3F5rKJjBXSMmL",
};
string URL = "https://insight.bitpay.com/api/addrs/utxo";
var request = WebRequest.Create(new Uri(URL)) as HttpWebRequest;
if (request == null)
throw new Exception("Non HTTP WebRequest");
<?php
/* This file is hereby released to public domain */
require_once(__DIR__ . '/../lib/jsonRPCClient_bitcoin.php');
global $CONFIG;
$CONFIG = array(
'bitcoind_user' => 'change_this',
'bitcoind_pass' => 'change_this',
'bitcoind_port' => 'change_this',
'bitcoind_fee' => 0.0002, // Shoudl be enough for anybody