How to remove class after delay in jQuery

To remove class after delay in jQuery you can use one of the snippet below.

Samples

jQuery Sample using setTimeout()

Samples

jQuery Sample using delay() and queue()

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

IsNull extension method for C# and VB.NET

You can use the IsNull Extension method by using the snippet below.

Sample C#

public static bool IsNull(this object source)
{
     return source == null;
}

Sample VB.NET

<System.Runtime.CompilerServices.Extension> _
Public Shared Function IsNull(source As Object) As Boolean
	Return source Is Nothing
End Function

As always, this extension method has been added to the Github Fesslersoft.Extensions Repository

Please rate this snippet

What is the best datatype for money in C# and VB.NET

The best Datatype for money in C# and VB.NET is Decimal.
What is the MSDN saying about Decimal.

The Decimal value type represents decimal numbers ranging from positive 79,228,162,514,264,337,593,543,950,335 to negative 79,228,162,514,264,337,593,543,950,335. The Decimal value type is appropriate for financial calculations requiring large numbers of significant integral and fractional digits and no round-off errors. The Decimal type does not eliminate the need for rounding. Rather, it minimizes errors due to rounding.

MSDN SOURCE

Please rate this snippet

How to ignore all unmapped properties using Automapper in C# and VB.NET

To ignore all unmapped properties using Automapper in C# and VB.NET you can use the following snippet.

Sample C#

var testClassA = new TestclassA() {Name = "Testname", Title = "Testtitle"};
Mapper.CreateMap<TestclassA, TestclassB>().ForAllMembers(opt => opt.Ignore());
Mapper.CreateMap<TestclassA, TestclassB>().ForMember(source => source.Title, destination => destination.MapFrom(x => x.Title));

var testClassB = Mapper.Map<TestclassA, TestclassB>(testClassA);
Console.WriteLine(testClassB.Title); //prints out "Testtitle"
Console.WriteLine(testClassB.Name); //print nothing  (NULL)

Sample VB.NET

Dim testClassA = New TestclassA() With { _
	Key .Name = "Testname", _
	Key .Title = "Testtitle" _
}
Mapper.CreateMap(Of TestclassA, TestclassB)().ForAllMembers(Function(opt) opt.Ignore())
Mapper.CreateMap(Of TestclassA, TestclassB)().ForMember(Function(source) source.Title, Function(destination) destination.MapFrom(Function(x) x.Title))

Dim testClassB = Mapper.Map(Of TestclassA, TestclassB)(testClassA)
Console.WriteLine(testClassB.Title)
'prints out "Testtitle"
Console.WriteLine(testClassB.Name)
'print nothing  (NULL)

Please rate this snippet

How to make a seperator line in C# and VB.NET

To make a seperator line in C# and VB.NET you can use the following snippet.

Sample C# / VB.NET

label1.Height = 2;
label1.AutoSize = false;
label1.BorderStyle = BorderStyle.Fixed3D;

Result:

SeperatorLine_NET

A Seperator line in .NET

Please rate this snippet

How to iterate a dictionary in C# and VB.NET

To iterate a dictionary in C# and VB.NET you can use the following snippet.

Sample C#

var myDictionary = new Dictionary<int, string>();
myDictionary.Add(10, "Value1");
myDictionary.Add(20, "Value2");
myDictionary.Add(30, "Value3");

foreach (KeyValuePair<int, string> myPair in myDictionary)
{
    Console.WriteLine("{0} - {1}", myPair.Key, myPair.Value);
}

Sample VB.NET

Dim myDictionary = New Dictionary(Of Integer, String)()
myDictionary.Add(10, "Value1")
myDictionary.Add(20, "Value2")
myDictionary.Add(30, "Value3")

For Each myPair As KeyValuePair(Of Integer, String) In myDictionary
	Console.WriteLine("{0} - {1}", myPair.Key, myPair.Value)
Next

for more informations see KeyValuePair

Please rate this snippet

How to start a process and wait for exit in Powershell

To start a application and wait for exit in Powershell you can use the following snippet.

Sample Powershell

start-process -filepath "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe" -Wait -NoNewWindow -argumentlist '-args'

for more informations take a look at the MSDN Start-Process

Please rate this snippet