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
_.mixin({ | |
'multiSplice': function (array, indexes) { | |
if (!_.isArray(array) || !_.isArray(indexes) || !_.all(indexes, _.isNumber)) { | |
return []; | |
} | |
var results = []; | |
if (indexes.length > 0) { | |
var i = indexes.length - 1; | |
for (; i >= 0; i--) { |
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
Outcome<string> IAuthenticationService.ValidatePassword(IDssPrincipal dssPrincipal, string password) | |
{ | |
const int minimumLength = 8; | |
const int maximumLength = 20; | |
const string specialCharactersPattern = @"\#\$\%\&\@\*\+\-\=\!\.\?\:\;\(\)\[\]\{\}\^\~_"; | |
var observations = new List<string>(); | |
var email = dssPrincipal.Identity.EmailAddress.ToMaybe(); | |
// Password must not be null |
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
private IEnumerable<Func<string, Maybe<string>, Outcome<string>>> GetValidators() | |
{ | |
// Password cannot be empty | |
yield return (password, email) => string.IsNullOrWhiteSpace(password) | |
? Outcome.Failure("Password cannot be empty") | |
: Outcome.Success(); | |
// Password must have at least 8 characters | |
yield return (password, email) => | |
{ |
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
Server Error in '/' Application. | |
The property MvcApp.Models.ISpy.Name could not be found. | |
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. | |
Exception Details: System.ArgumentException: The property MvcApp.Models.ISpy.Name could not be found. | |
Source Error: |
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
// ---------------------------------------------------------------- | |
// This example shows my solution for the question I posted here: | |
// http://stackoverflow.com/questions/7087312 | |
// ---------------------------------------------------------------- | |
public class Person { | |
public string First { get; set; } | |
public string Last { get; set; } | |
public string Twitter { 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
private void SendHttpRequest(string httpMethod, string mimeType, string requestBody, string uri) | |
{ | |
byte[] xmlBytes = Encoding.UTF8.GetBytes(requestBody); | |
var md5Base64 = Hasher.Md5Hash(xmlBytes).ToBase64(); | |
var dateString = GetDateString(); | |
var stringToSign = GetStringToSign(httpMethod, md5Base64, mimeType, uri, dateString, null); | |
var signature = Hasher.GetSignature(SecretKey, stringToSign); | |
Console.Write(DebugMessage("String To Sign", stringToSign)); |
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
POST http://preprod-services.stupeflix.com/stupeflix-1.0/screenfeed/c30e406f/?Date=1306188442&AccessKey=ZvlQcWYSJ13iJFjbPo82&Signature=aa327acf9a0d0defad49d0be23debe476a0f3b0f HTTP/1.1 | |
Content-Type: application/x-www-form-urlencoded | |
Content-MD5: PtwIhXcJHapJ1NoJRN+pRw== | |
Host: preprod-services.stupeflix.com | |
Content-Length: 226 | |
Expect: 100-continue | |
ProfilesXML=%3cprofiles%3e%3cprofile+name%3d%22ntsc-wide-wmv%22%3e%3cs3+bucket%3d%22screenfeed%22+resourcePrefix%3d%22c30e406f%22%3e%3cmeta%3e%3cacl%3epublic%3c%2facl%3e%3c%2fmeta%3e%3c%2fs3%3e%3c%2fprofile%3e%3c%2fprofiles%3e |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/> | |
<title>Google Maps JavaScript API v3 Example: Geocoding Simple</title> | |
<link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" /> | |
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> | |
<script type="text/javascript"> | |
var geoResults = {}; |
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
var ss = $("#slideshow-display").slideshow({ | |
urls: ['image.jpg', 'image2.jpg'], // This is the only required setting | |
photoBaseUrl: "http://photos.screenfeed.com/', | |
interval: 3000, // Number of milliseconds each photo should be shown | |
transitionDuration: 300, // Time it takes for fade animation to complete | |
preloadBuffer: 3, // Number of images to preload before slideshow starts | |
onImageChanging: null, // If specified, this is fired right before the image is swapped | |
onImageLoading: null, // If specified, this is fired when an image is requested. |
NewerOlder