How to disable all links using jQuery

To disable all links using jQuery you cna use the snippet below.

Samples

jQuery Sample

If you have any questions or suggestions feel free to rate this snippet, post a comment or Contact Us via Email.

Related links:

Please rate this snippet

How to enumerate an Enum in C# and VB.NET

To enumerate an Enum in C# and VB.NET you can use the snippet below.

Sample C#

public enum TestEnum
{
	These = 0,
	Are = 1,
	Sample = 2,
	Enums = 3,
	Duplicates = 3,
	Included = 4
}

static void Main(string[] args)
{
	foreach (var testEnum in Enum.GetNames(typeof(TestEnum)))
	{
		System.Console.WriteLine(testEnum);
	}
	Console.Read();
}

Sample VB.NET

Public Enum TestEnum
	These = 0
	Are = 1
	Sample = 2
	Enums = 3
	Duplicates = 3
	Included = 4
End Enum

Private Shared Sub Main(args As String())
	For Each testEnum As var In [Enum].GetNames(GetType(TestEnum))
		System.Console.WriteLine(testEnum)
	Next
	Console.Read()
End Sub

Please rate this snippet

How to reload a ViewController in IOS using Objective-C

To reload a UITableViewController in IOS using Objective-C you can simply use the reloadData method of the ViewController.

//MyTablViewController is a UITableViewController
[MyTableViewController.tableView reloadData] 

Please rate this snippet

How to format a float to 2 decimal places in Objective-C

To format a float to 2 decimal places in Objective-C you can use the following snippet.

Sample Objective-C

NSString* formattedVariable = [NSString stringWithFormat:@"%.02f", myFloatVariable];

Please rate this snippet

How to create and write a textfile in VBA

To create and write a textfile in VBA you can use the following snippet.
This should also work when using VB6.

Sample VBA

Dim fso as Object
Dim oFile as Object

Set fso = CreateObject("Scripting.FileSystemObject")
Set oFile = FSO.CreateTextFile("C:\Users\Codesnippets\Desktop\Test.txt")

oFile.WriteLine "This is a sample line!" 
oFile.Close

Set fso = Nothing
Set oFile = Nothing  

Please rate this snippet

How to style a link by filetype in CSS

To style a link by filetype in CSS you can use the following snippet.

Sample CSS

a[href$=".exe"] { background: url(icons/exe.png) left center no-repeat; padding-left: 50px; }
a[href$=".rar"] { background: url(icons/rar.png) left center no-repeat; padding-left: 50px; }
a[href$=".doc"] { background: url(icons/doc.png) left center no-repeat; padding-left: 50px; }
a[href$=".pdf"] { background: url(icons/pdf.png) left center no-repeat; padding-left: 50px; }
a[href$=".zip"] { background: url(icons/zip.png) left center no-repeat; padding-left: 50px; }
a[href$=".html"] { background: url(icons/link.png) left center no-repeat; padding-left: 50px; }

Please rate this snippet