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 IP
//******************************//
//Prevent wrong input for mobile
//******************************//
 $("#Mobile").keydown(function (event) 
{
    // Allow: backspace, delete, tab and escape
    if (event.keyCode == 46 || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 27 ||
    // Allow: Ctrl+A
    (event.keyCode == 65 && event.ctrlKey === true) ||
    // Allow: home, end, left, right
by Egli   May 14, 2012 @ 11:43pm
10 Views
no comments
 
var baseUrl;
var applicationUrl;
 
baseUrl = document.location.href;
baseUrl = baseUrl.substring(0, baseUrl.lastIndexOf('/'));
applicationUrl = baseUrl.substring(0, baseUrl.lastIndexOf('/'));
by Warren Wiltshire   May 02, 2012 @ 5:24am
17 Views
no comments
 
//start processing
var api = new moviesApi();
api.getRatings({
    success: function (result) {
        for (var i = 0; i < result.length; i++) {
            //new Option(text, value)
            var option = new Option(result[i].ID, result[i].Name);
            $('#ratings').append(
                $('<option></option>').val(result[i].ID).html(result[i].Name)
            );
22 Views
no comments
 
displayError = function (result) {
    $('#errorDisplay').show();
    $('#errorDisplay').html(result.responseText);
}
by Warren Wiltshire   May 02, 2012 @ 5:20am
31 Views
no comments
 
<%@ Page Title="" Language="C#" MasterPageFile="~/Miso1.Master" AutoEventWireup="true" CodeBehind="Currency.aspx.cs" Inherits="WebApplication1.Currency" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" runat="server">
    <script type="text/javascript" language="javascript">
 
        $(document).ready(function () {
        });
 
 
        String.prototype.replaceAll = function (str1, str2, ignore) {
            return this.replace(new RegExp(str1.replace(/([\/\,\!\\\^\$\{\}\[\]\(\)\.\*\+\?\|\<\>\-\&])/g, "\\$&"), (ignore ? "gi" : "g")), (typeof (str2) == "string") ? str2.replace(/\$/g, "$$$$") : str2);
by Fred Peters   April 03, 2012 @ 6:44am
46 Views
no comments
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
 
        <script type="text/javascript" src="JavaScript/jquery-1.4.1.min.js"></script>
        
        <script type="text/javascript" language="javascript">
 
        String.prototype.replaceAll = function (str1, str2, ignore) {
by Fred Peters   April 03, 2012 @ 6:42am
33 Views
no comments
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
 
        <script type="text/javascript" src="JavaScript/jquery-1.4.1.min.js"></script>
        
        <script type="text/javascript" language="javascript">
 
        String.prototype.replaceAll = function (str1, str2, ignore) {
by Fred Peters   March 30, 2012 @ 11:00am
39 Views
no comments
 
<--- SIP read from UDP:10.2.0.53:51284 --->
REGISTER sip:10.2.3.18:5060 SIP/2.0
Via: SIP/2.0/UDP 10.2.0.53:51284;branch=z9hG4bK-d8754z-cb790979687a7f73-1---d8754z-;rport
Max-Forwards: 70
Contact: <sip:chrispersico@10.2.0.53:51284;rinstance=39c7401a82d6d682>
To: "sam.bengtson"<sip:chrispersico@10.2.3.18:5060>
From: "sam.bengtson"<sip:chrispersico@10.2.3.18:5060>;tag=c329ac16
Call-ID: MjI0ZmFlMGM3ODAwYjI4YWRlZTFjYjc3ZWE5M2VmYzQ.
CSeq: 1 REGISTER
Expires: 120
by Sam   March 26, 2012 @ 11:33am
17 Views
no comments
 
 ajaxCallMethod("CallbackHandler.ashx?", "Test",
             [{ Entered: "03/15/2010", Name: "Rick"}],
             function (result) {
                 alert(result);
             });
ajaxCallMethod("CallbackHandler.ashx?", "Test",
             [{ Entered: new Date(2010,2,15), Name: "Rick"}],
             function (result) {
                 alert(result);
             });
by Rick Strahl   March 19, 2012 @ 2:10pm
57 Views
no comments
 
C#
using System;
using System.Net.Http.Formatting;
using System.Threading.Tasks;
using System.Web.Script.Serialization;
using System.Json;
using System.IO;
 
namespace Westwind.Web.WebApi
{
    public class JavaScriptSerializerFormatter : MediaTypeFormatter
by Rick Strahl   March 08, 2012 @ 5:17pm
386 Views
no comments
 
/*IDE Shortcuts */
//Finds a type inside a class
Ctr + Shift + T
 
//Finds a resource inside a class
Ctr + Shift + R
 
//Search for methods or variables inside a class
Ctr + O
 
by Egli   February 13, 2012 @ 8:15pm
47 Views
no comments
 
function IsPageValid() 
{
    var validated = Page_ClientValidate('UserComments');
 
    if (validated) 
    {
        //Its valid
        return true;
    }
    else 
by Egli   February 09, 2012 @ 4:04pm
69 Views
no comments
 
http://filevelocity.com/sfp3zcy422x6/Dream Hause 2011 DVDRip.part1.rar.html
http://filevelocity.com/gehr1px6sw2k/Dream Hause 2011 DVDRip.part2.rar.html
http://filevelocity.com/wi5tmc1l12q9/Dream Hause 2011 DVDRip.part3.rar.html
http://filevelocity.com/b2e1c5h25e9y/Dream Hause 2011 DVDRip.part4.rar.html
http://filevelocity.com/mbscjvmr44vn/Dream Hause 2011 DVDRip.part5.rar.html
http://filevelocity.com/igeaqml05mlt/Dream Hause 2011 DVDRip.part6.rar.html
http://filevelocity.com/ngidojk8agwk/Dream Hause 2011 DVDRip.part7.rar.html
http://filevelocity.com/gfs54dqtrcqa/Dream Hause 2011 DVDRip.part8.rar.html
39 Views
no comments
 
$(document).ready(function () {
    if (window.location.protocol == 'https:') {
        $("a[href^='http:\/\/" + window.location.hostname + "']").each(function() { 
               this.href = this.href.replace(/^http:/i, "https:");
           });
    };
});
by Javier Callico   January 24, 2012 @ 7:27am
46 Views
no comments
 
SQL
 
 
 
 /*************************************************************************************
  *
  *        Copyright 2012 Davide Orazio Montersino http://www.davidemontersino.com
  *
  *        This program is free software: you can redistribute it and/or modify
  *        it under the terms of the GNU General Public License as published by
  *        the Free Software Foundation, either version 3 of the License, or
by Davide Orazio Montersino   January 10, 2012 @ 2:19am
57 Views
no comments
 
<script type="text/javascript">
 
    function CustomValidatorOmbudsmanNotifiedDate(s, args) {
        var dt = args.Value
 
        if (!dt && $("*[id$='OmbudsmanNotifiedFlag'] input:checked").val() == '1') {
            args.IsValid = false;
        }
        else {
            args.IsValid = true;
by Cat   December 12, 2011 @ 3:27pm
85 Views
no comments
 
XML
<!-- CTRL+K, CTRL+X = Insert Snippet -->
<!-- CTRL+K, CTRL+B = Manage Snippets -->
<CodeSnippet Format="1.0.0" 
             xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  
  <Header>
    <Title>Property with NotifyPropertyChanged</Title>
    <Author>Jerry Nixon</Author>
    <Shortcut>propnote</Shortcut>
    <Description>Property with NotifyPropertyChanged</Description>
by Jerry Nixon   November 08, 2011 @ 9:29am
374 Views
1 comments
 
SQL
/*
Since you cant alter the database straight away, you first need to kill the user thats currently connected to it...
So...
Step 1:
Get the session thats connected to that database
*/
 
select d.name, d.dbid, spid, login_time, nt_domain, nt_username, loginame
from master.dbo.sysprocesses p inner join master.dbo.sysdatabases d on p.dbid = d.dbid
where d.name = 'DATABASE NAME GOES HERE'
by Egli   November 01, 2011 @ 5:33pm
64 Views
no comments
 
C#
   public static UserPrincipal GetUserAdInfo(string domainName, string loginName)
   {
       PrincipalContext ctx = new PrincipalContext(ContextType.Domain, domainName);
 
       UserPrincipal user = UserPrincipal.FindByIdentity(ctx, loginName); 
 
       if(user != null) 
       {
           return user;
       }
by jaredmroberts   September 30, 2011 @ 4:24pm
105 Views
no comments
 
XML
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
    <CodeSnippet Format="1.0.0">
        <Header>
            <Title>nprop</Title>
            <Shortcut>nprop</Shortcut>
            <Description>Notifying property, utilizing NotifyingObject</Description>
            <Author>Spree Interactive</Author>
            <SnippetTypes>
                <SnippetType>Expansion</SnippetType>
by Sami Lamti   September 18, 2011 @ 6:02am
170 Views
2 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