Skip to content

Instantly share code, notes, and snippets.

@vkbandi
vkbandi / Tweets.cs
Created September 16, 2015 20:07
C#.net class can be used to update statuses, delete, retweet statuses, obtain information regarding a particular status and any body who retweeted a particular status using status id
using System;
using System.Text;
using System.Collections.Generic;
namespace TwitterAPI
{
public class Tweets
{
#region Class-Level-Declarations
@vkbandi
vkbandi / Program.cs
Last active September 17, 2015 15:39
A sample code to display the usage of the whois class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DomainTools
{
class Program
{
static void Main(string[] args)
@vkbandi
vkbandi / Whois.cs
Last active February 23, 2016 19:56
A C#.net class to fetch whois information for a .com domain name
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
namespace DomainTools
{
public class ConditionalPerformance
{
//If block
public long WithOnlyIf(int myFlag)
{
Stopwatch myTimer = new Stopwatch();
string someString = "";
myTimer.Start();
for (int i = 0; i < 1000000; i++)
{
@vkbandi
vkbandi / DomainNameExtract.sql
Created September 16, 2015 19:46
T-SQL Query will retrieve anything that is after the @ symbol, the query can be very useful for retrieving the domain of an email address
SELECT SUBSTRING(T.Email,(CHARINDEX('@',T.Email)+1),LEN(T.Email) - (CHARINDEX('@',T.Email))) as DomainName FROM EmailTable T
@vkbandi
vkbandi / DomainSearch.cs
Last active September 17, 2015 17:02
A simple C# class for demonstrating the use of whois to check the availability of a domain name - code snippet for coderbuddy.wordpress.com
public class DomainSearch
{
/// <summary>
/// Check whether a given domain name is available or not
/// </summary>
/// <param name="domainName">domain name to be verified</param>
/// <returns></returns>
public static bool IsDomainNameAvailable(string domainName)
{
string whoisData = Whois.Lookup(domainName);