This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public CheckoutCreateResponse Create(CheckoutCreateRequest req) | |
{ | |
CheckoutCreateResponse response; | |
try | |
{ | |
response = new WePayClient().Invoke<CheckoutCreateRequest, CheckoutCreateResponse>(req, req.actionUrl,req.accessToken); | |
} | |
catch (WePayException ex) | |
{ | |
response = new CheckoutCreateResponse { checkout_id = 0, checkout_uri =req.redirect_uri+"?error="+ex.error, Error =ex }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP TABLE #Fields | |
CREATE TABLE #Fields(ColumnID int ,Field varchar(150) NOT NULL ,Records bigint NULL) | |
DECLARE @count INT | |
DECLARE @colCount INT | |
DECLARE @Column VARCHAR(150) | |
DECLARE @Table VarChar(150) | |
DECLARE @RecordCount BIGINT | |
DECLARE @Sql VarChar(8000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collection<SvnLogEventArgs> list; | |
using(SvnClient client = new SvnClient()) | |
{ | |
//client.Authentication.DefaultCredentials = new NetworkCredential("user", "pass"); | |
Uri svnrepo = new Uri("svn://servername/reponame/"); | |
SvnInfoEventArgs info; | |
client.GetInfo(svnrepo, out info); | |
long lastRev = info.Revision; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = true)] | |
public class UserTrackingAttribute : ActionFilterAttribute | |
{ | |
public static readonly string appId = "your CloudMine app Id"; | |
public static readonly string appSecret = "your CloudMine app Secret"; | |
class PageRequest | |
{ | |
public int PageId { get; set; } | |
public Double Created { get; set; } | |
public string Url { get; set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string ip = Request.ServerVariables["X-Forwarded-For"] | |
public class LocationInfo | |
{ | |
public string Country { get; set; } | |
public string RegionName { get; set; } | |
public string City { get; set; } | |
public string ZipCode { get; set; } | |
public float Latitude { get; set; } | |
public float Longitude { get; set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HttpPostedFileBase file = Request.Files[0]; | |
if (file.ContentLength > 0) // accept the file | |
{ | |
string accessKey = "XXXXXXXXXXX"; | |
string secretKey = "122334XXXXXXXXXX"; | |
AmazonS3 client; | |
using (client = Amazon.AWSClientFactory.CreateAmazonS3Client(accessKey, secretKey)) | |
{ | |
PutObjectRequest request = new PutObjectRequest(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Raven.Client; | |
public class RavenSearch | |
{ | |
private IEnumerable<T> GetAllResults<T>(IDocumentSession session) where T : class | |
{ | |
session.Advanced.MaxNumberOfRequestsPerSession = 1000; | |
int skip = 0; | |
var results = new List<T>(); | |
var query = session.Query<T>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Data.Common; | |
using System.Data.Linq; | |
namespace MyApp.Models.DataContextWrapper | |
{ | |
public interface IDataContextWrapper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function () { | |
$('a').mousedown(function () { | |
_gaq.push(['_trackEvent', 'userClick', $(this).attr('href'), '@User.Identity.Name']); | |
}); | |
}); |
OlderNewer