Format:
Recent snippets for: Al Gonzalez
;-- Symbols -- ©®™¿¡±¢€£¥°°¹²³¶¼½¾…«» :*:!(c)::© ; alt+0169 Copyright :*:!copy::© ; alt+0169 Copyright :*:!(r)::® ; alt+0174 Registered :*:!reg::® ; alt+0174 Registered :*:!tm::™ ; alt+0153 Tradmark :*:!??::¿ ; alt+0191 Inverted ? :*:!!!::¡ ; alt+0161 Inverted ! :*:!+-::± ; alt+0177 Plus or Minus
92 Views
no comments
;-----------------------------------------------------------------------------------
; Control the Volume Settings
;-----------------------------------------------------------------------------------
!PgUp::Send {Volume_Up} ; Raise the master volume by 1 interval (typically 5%).
!PgDn::Send {Volume_Down} ; Lower the master volume by 1 interval.
!End::Send {Volume_Mute} ; Toggle mute/unmute the master volume.
!Home::Run %SystemRoot%\system32\sndvol.exe ; open the Volume Mixer
95 Views
no comments
;----------------------------------------------------------------------------------- ; Control Transparency of Current Window ;----------------------------------------------------------------------------------- ; Set transparency of the active window #0:: WinSet, Transparent, 255, A ; 0% transparency / 100% opacity #1:: WinSet, Transparent, 230, A ; 10% transparency / 90% opacity #2:: WinSet, Transparent, 204, A ; 20% transparency / 80% opacity #3:: WinSet, Transparent, 179, A ; 30% transparency / 70% opacity #4:: WinSet, Transparent, 153, A ; 40% transparency / 60% opacity #5:: WinSet, Transparent, 127, A ; 50% transparency / 50% opacity
83 Views
no comments
copy $(ProjectDir)\..\{path to file} $(TargetDir)
rem add '1>nul' to NOT display any messages from the copy.
rem add '2>nul' to NOT fail the build and to NOT display any error messages from the copy.
119 Views
no comments
#-- Files *.bak.* *.bak *.dll *.exe *.ldf *.log *.mdf *.msi *.resharper
126 Views
no comments
//Example calls: // //string a = null, b = null, c = "dude", d = null; //string x = FirstNonNullOrDefault(a, b, c, d); //Console.WriteLine(x ?? "ISNULL"); // output is ISNULL // //c = "dude" //string x = FirstNonNullOrDefault(a, b, c, d); //Console.WriteLine(x ?? "ISNULL"); // output is dude //
161 Views
no comments
mcd=md $1&cd $1
186 Views
no comments
mdsd=echo off &&for /F "tokens=2,3,4 delims=/ " %i in ('date /t') do set dtName=%k%i%j$Tmd $1%dtName%$2$Tset dtName=&& echo on
150 Views
no comments
To Encrypt, run the following from the Visual Studio command prompt: aspnet_regiis -pe "connectionStrings" -app "/AppName" -prov "RsaProtectedConfigurationProvider" To Decrypt, run the following from the Visual Studio command prompt: aspnet_regiis -pd "connectionStrings" -app "/AppName"
256 Views
no comments
var procs = Process.GetProcessesByName("msnmsgr"); if (procs.Length > 0) { var proc = procs[0]; proc.Kill(); }
198 Views
no comments
public static PerpetualEnumerator<T> GetPerpetualEnumerator<T>(this IEnumerable<T> items) { return new PerpetualEnumerator<T>(items); }
277 Views
no comments
using System.Collections; using System.Collections.Generic; namespace nl4net { /// <summary> /// Wraps a standard IEnumerator<T> to provide /// iteration over a generic collection that automatically /// resets to the beginning once it reaches the end. /// </summary>
182 Views
no comments
see http://www.fiddler2.com/fiddler2/
NOTE: When using the Visual Studio Developer Web Server you
will need to do one of the following:
1. Call the web services using http://127.0.0.1.:55555/ (note the period after the 1)
2. Add the following to the Fiddler Rules in OnBeforeRequest function,
remembering to change {machinename} to your computers name
// [CUSTOM] Added to remap call from machine back to localhost
if (oSession.host=="{machinename}:55555"){
526 Views
no comments
public static void Copy(string sourceDirName, string destDirName, bool excludeSubdirectories) { // Style #1: fluent Guard.MethodArgument("sourceDirName").IsNotNullOrEmpty(sourceDirName); Guard.MethodArgument("destDirName").IsNotNullOrEmpty(destDirName, "The destination directory is required!"); // Style #2: lambdas and expressions Guard.Argument.IsNotNullOrWhiteSpace(()=>sourceDirName); Guard.Argument.IsNotNullOrWhiteSpace(()=>destDirName, "The destination directory is required!");
310 Views
1 comments
public class ConsoleSpinner { const int MaxSegmentIndex = 3; readonly char[] _segments = new [] { '\\', '|', '/', '-'}; readonly int _left; readonly int _top; int _curIndex;
477 Views
no comments
// Comparing C# to the "Java’s toLowerCase() has got a surprise for you!" article: // http://javapapers.com/core-java/javas-tolowercase-has-got-a-surprise-for-you/ // ------------------------------------------------------------ // NOTE: C# doesn't seem to exhibit the same issue. // ------------------------------------------------------------ static void Main(string[] args) { // setting Lithuanian as locale System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("lt");
147 Views
no comments
using System; using System.Runtime.Serialization; public class ArgumentExceptionTemplate : ArgumentException { public ArgumentExceptionTemplate() { } public ArgumentExceptionTemplate(string message)
236 Views
no comments
using System; using System.Runtime.Serialization; public class ExceptionTemplate : Exception { public ExceptionTemplate() { } public ExceptionTemplate(string message)
320 Views
no comments
/// <summary> /// Determine if the specified string is blank, where blank is defined /// as null, empty or containing only whitespace characters. /// </summary> /// <param name="value">string to be evaluated</param> /// <returns> /// true if the value is null, empty or contains only /// whitespace characters; otherwise false /// </returns> static bool IsNullOrWhiteSpace(string value)
398 Views
no comments
/// <summary> /// Returns a page worth of items from the specified collection. /// </summary> /// <typeparam name="TSource">the type of the items in the collection</typeparam> /// <param name="source">an IEnumerable>TSource< of items to page</param> /// <param name="pageNumber">the number of the page to return</param> /// <param name="itemsPerPage">the number of items that make up a page</param> /// <returns> /// An IEnumerable>TSource< the contains the specified number of items for the specified pageNumber. /// If pageNumber exceeds the number of available pages, the returned collection will be empty.
297 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
