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 matching tags of ss
C#
//Email regex validator
Regex regex = new Regex(@"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*");
 
//Website regex validator
Regex regex = new Regex(@"^http\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(/\S*)?$");
 
//Comments on forum regex validator (max 4000 characters)
Regex regex = new Regex(@"^[+_%@:,.'!?"\\\^\&\#\$\*\(\)\-\/a-zA-Z0-9\s]{1,4000}$");
by Egli   Monday @ 9:34pm
14 Views
no comments
 
C#
/// <summary>
/// Creates the mail message.
/// </summary>
/// <param name="emailBody">The email body.</param>
/// <param name="maTo">The ma to.</param>
/// <param name="maFrom">The ma from.</param>
/// <param name="maBcc">The ma BCC.</param>
/// <param name="attachment">The attachment.</param>
/// <returns></returns>
public static MailMessage CreateMailMessage(string emailBody, string maTo, string maFrom, string maBcc, Attachment attachment)
by Prithvi Ramana A   December 22, 2011 @ 2:51am
23 Views
1 comments
 
my code here. 
by JasonLeeTrott   December 08, 2011 @ 1:07am
61 Views
no comments
 
/etc/gdm3/Xsession: Beginning session setup...
GNOME_KEYRING_CONTROL=/tmp/keyring-x1jPm2
GPG_AGENT_INFO=/tmp/keyring-x1jPm2/gpg:0:1
SSH_AUTH_SOCK=/tmp/keyring-x1jPm2/ssh
GNOME_KEYRING_CONTROL=/tmp/keyring-x1jPm2
GNOME_KEYRING_CONTROL=/tmp/keyring-x1jPm2
GPG_AGENT_INFO=/tmp/keyring-x1jPm2/gpg:0:1
SSH_AUTH_SOCK=/tmp/keyring-x1jPm2/ssh
GNOME_KEYRING_CONTROL=/tmp/keyring-x1jPm2
GPG_AGENT_INFO=/tmp/keyring-x1jPm2/gpg:0:1
by alirezaimi   November 12, 2011 @ 11:37am
173 Views
no comments
 
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title></title>
    <style>
    .bigbutton
    {
        background: #1e5799; /* Old browsers */        
        color: White;
by Rick Strahl   November 09, 2011 @ 6:35pm
Tags: HTML, CSS, Button
68 Views
no comments
 
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Soneta.Types;
using Soneta.Business;
using Soneta.Business.App;
using Soneta.Tools;
using Soneta.Forms;
using System.Windows.Forms;
by Lukasz Ligocki   November 08, 2011 @ 4:47am
34 Views
no comments
 
XML
<configuration>
<httpHandlers>
   <add verb="*" path="*.jsp" type="HinoCentral.Website.AppCode.JSPHandler"/>
   <add verb="*" path="*.jspf" type="HinoCentral.Website.AppCode.JSPHandler"/>
</httpHandlers>
<system.webServer>
    <handlers>
      <add name="JSPHandler_jsp"  path="*.jsp" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv2.0,bitness64" />
      <add name="JSPHandler_jspf" path="*.jspf" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv2.0,bitness64" />
    </handlers>
by Egli   October 25, 2011 @ 2:36pm
60 Views
no comments
 
cls
@ECHO OFF
title Folder Personal
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Personal goto MDLOCKER
:CONFIRM
echo Are you sure u want to lock the folder(Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
by Sean Hall   September 03, 2011 @ 10:30am
93 Views
no comments
 
C#
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using Orchard.DisplayManagement.Descriptors;
using Orchard.Environment.Descriptor.Models;
using Orchard.Environment.Extensions;
using Orchard.Environment.Extensions.Models;
by pekkah   August 28, 2011 @ 5:48am
Tags: Orchard, Less
147 Views
no comments
 
C#
///////////////////////////////////////////////////////////////////////////////
// SAMPLE: Generates random password, which complies with the strong password
//         rules and does not contain ambiguous characters.
//
// To run this sample, create a new Visual C# project using the Console
// Application template and replace the contents of the Class1.cs file with
// the code below.
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
by Nathan   July 31, 2011 @ 5:37pm
Tags: password
48 Views
no comments
 
XML
<ifModule mod_gzip.c>
  mod_gzip_on Yes
  mod_gzip_dechunk Yes
  mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
  mod_gzip_item_include handler ^cgi-script$
  mod_gzip_item_include mime ^text/.*
  mod_gzip_item_include mime ^application/x-javascript.*
  mod_gzip_item_exclude mime ^image/.*
  mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
by Aria Radmand   July 12, 2011 @ 5:12am
102 Views
no comments
 
$('input:checkbox').addClass(function (index, currentClass) {
    var addedClass;
 
    if (currentClass === "") {
        addedClass = "rTick";
    }
 
    return addedClass;
});
by Badz   June 29, 2011 @ 7:32pm
103 Views
no comments
 
//Class fields needed
private static int addFileFailures = 0;
 
//some other code
 
//addFile() Method
    public void addFile(File file)
            throws FileLimitReachedException, MemoryLimitReachedException, InvalidFileSizeException {
        
        //Increments the addFileFailures
by Licínio Mendes   May 31, 2011 @ 7:30am
90 Views
2 comments
 
C#
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
public partial class Features_ImportExport : System.Web.UI.Page
{
    const string DocumentUrl = @"~/Content/Demo/SampleImportDocument.rtf";
    const string ContentFolder = @"~/UploadImages/Imported";
by Mehul Harry   May 30, 2011 @ 10:04pm
220 Views
no comments
 
CSS
body
{
    background-color: #000000;
}
 
.MainTitle  /* Class */
{
    font-family: Arial, Helvetica, sans-serif;
    font-size: xx-large;
    color: #0000CC;
by Jose David Parra   May 01, 2011 @ 5:14pm
Tags: CSS, web Dev
85 Views
no comments
 
C#
var text = "I (Iceland) Found (Faroe Islands) the Needles (Norway) South (Sweden) of Finland (Finland). Drinks (Denmark) for Everyone (Estonia) Laughed (Latvia) the Little (Lithuania) Neanderthal (Northern Ireland) Selling (Scotland) English (England) Wales (Wales) Inside (Ireland) Northern Europe";
var rg = new Regex(@"\([^)]*\)", RegexOptions.IgnorePatternWhitespace);
var replacedStr = rg.Replace(text,"");
by nyinyithann   February 16, 2011 @ 7:43am
107 Views
no comments
 
C#
protected void Map(Expression<Func<T, object>> property, Func<PropertyDescriptor, string> columnNamer)
{
    MemberInfo memberInfo;
 
    if (property.Body is MemberExpression)
        memberInfo = ((MemberExpression)property.Body).Member;
    else
        memberInfo = ((MemberExpression)((UnaryExpression)property.Body).Operand).Member;
 
    Map(memberInfo.Name, columnNamer);
by Andy Sherwood   February 04, 2011 @ 3:24pm
184 Views
no comments
 
C#
/// <summary>
/// An entry that can be either a single ip or a range
/// </summary>
public class IpEntry
{
    public string StartRange { get; set; }
 
    public string EndRange { get; set; }
 
    public bool IsRange
by rawbert   January 17, 2011 @ 1:29am
196 Views
2 comments
 
C#
//Calling Code for VM to pass message box delegate
Func<string, string, MessageBoxButton, MessageBoxImage, MessageBoxResult> messageBox = (msg, caption, buttons, image) => MessageBox.Show(msg, caption, buttons, image);
 
//pass above variable to VM
 
//Usage of message box delegate variable inside VM
MessageBoxResult = messageBoxinVM("Test Message", "Test Caption for Message", MessageBoxButton.YesNoCancel, MessageBoxImage.Question);
by Vijay Sharma   January 13, 2011 @ 2:13am
289 Views
no comments
 
C#
using System;
using System.Linq.Expressions;
 
public static class Aaa
{
    public class A
    {
        public string NameField;
    }
by b1gbr0   October 26, 2010 @ 3:30am
177 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