CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
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
by Al Gonzalez   July 27, 2011 @ 8:12am
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
by Al Gonzalez   July 16, 2011 @ 11:53am
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
by Al Gonzalez   July 16, 2011 @ 11:39am
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.
 
 
by Al Gonzalez   June 16, 2011 @ 3:44pm
119 Views
no comments
 
#-- Files
*.bak.*
*.bak
*.dll
*.exe
*.ldf
*.log
*.mdf
*.msi
*.resharper
by Al Gonzalez   June 06, 2011 @ 8:08am
126 Views
no comments
 
C#
//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
//
by Al Gonzalez   January 05, 2011 @ 9:28am
Tags: C#
161 Views
no comments
 
mcd=md $1&cd $1
by Al Gonzalez   November 08, 2010 @ 1:16pm
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
by Al Gonzalez   November 08, 2010 @ 1:14pm
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"
 
by Al Gonzalez   July 12, 2010 @ 4:39pm
256 Views
no comments
 
C#
var procs = Process.GetProcessesByName("msnmsgr");
if (procs.Length > 0)
{
    var proc = procs[0];
    proc.Kill();
}
by Al Gonzalez   June 19, 2010 @ 1:05pm
Tags:
198 Views
no comments
 
C#
public static PerpetualEnumerator<T> GetPerpetualEnumerator<T>(this IEnumerable<T> items)
{
    return new PerpetualEnumerator<T>(items);
}
277 Views
no comments
 
C#
using System.Collections;
using System.Collections.Generic;
 
namespace nl4net
{
    /// <summary>
    /// Wraps a standard IEnumerator&lt;T&gt; to provide
    /// iteration over a generic collection that automatically 
    /// resets to the beginning once it reaches the end.
    /// </summary>
by Al Gonzalez   June 17, 2010 @ 9:08pm
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"){
by Al Gonzalez   June 06, 2010 @ 7:15pm
526 Views
no comments
 
C#
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!");
by Al Gonzalez   May 24, 2010 @ 8:58pm
310 Views
1 comments
 
C#
public class ConsoleSpinner
{
    const int MaxSegmentIndex = 3;
 
    readonly char[] _segments = new [] {  '\\', '|', '/', '-'};
    readonly int _left;
    readonly int _top;
 
    int _curIndex;
by Al Gonzalez   May 18, 2010 @ 6:43am
477 Views
no comments
 
C#
// 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");
by Al Gonzalez   May 10, 2010 @ 2:18pm
Tags:
147 Views
no comments
 
C#
using System;
using System.Runtime.Serialization;
 
public class ArgumentExceptionTemplate
    : ArgumentException
{
    public ArgumentExceptionTemplate()
    { }
 
    public ArgumentExceptionTemplate(string message)
by Al Gonzalez   April 07, 2010 @ 12:53pm
236 Views
no comments
 
C#
using System;
using System.Runtime.Serialization;
 
public class ExceptionTemplate
    : Exception
{
    public ExceptionTemplate()
    { }
 
    public ExceptionTemplate(string message)
by Al Gonzalez   April 07, 2010 @ 12:48pm
320 Views
no comments
 
C#
/// <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)
by Al Gonzalez   March 15, 2010 @ 11:05am
Tags: String, LINQ, Any
398 Views
no comments
 
C#
/// <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&gt;TSource&lt; 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&gt;TSource&lt; 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.
by Al Gonzalez   March 15, 2010 @ 9:59am
Tags: LINQ, Skip, Take, Paging
297 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate