This file contains hidden or 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
<div id="opacity" data-animated-property="opacity" data-animated-from="1" data-animated-to="0"></div> |
This file contains hidden or 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
!!! | |
%html | |
%head | |
%title | |
= content_for?(:title) ? yield(:title) : "" | |
%body | |
= yield |
This file contains hidden or 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 all the datas! except the ViewState | |
jQuery.post('https://www.example.com', jQuery("#form :not(#__VIEWSTATE) > :input").serialize() ,function(data,status){ | |
if(data[0]["Status"] == "Success"){ | |
jQuery("#poststatus").html("Thank you!"); | |
}else{ | |
jQuery("#poststatus").html("There has been an error while accepting your submission. Please contact us."); | |
} | |
}); |
This file contains hidden or 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.Web.Mvc; | |
public static class GravatarExtensions | |
{ | |
public static MvcHtmlString Gravatar(this HtmlHelper helper, string email, string username, int size) | |
{ | |
var baseURL = "http://www.gravatar.com/avatar/{0}?s={1}&d=identicon&r=PG"; | |
TagBuilder link = new TagBuilder("a"); | |
link.Attributes.Add("href", "/User/" + username); |
This file contains hidden or 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
Regex.Split(inputString, "<br>"); | |
This file contains hidden or 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 static string MD5Hash(string input) | |
{ | |
StringBuilder hash = new StringBuilder(); | |
MD5CryptoServiceProvider md5provider = new MD5CryptoServiceProvider(); | |
byte[] bytes = md5provider.ComputeHash(new UTF8Encoding().GetBytes(input)); | |
for (int i = 0; i < bytes.Length; i++) | |
{ | |
hash.Append(bytes[i].ToString("x2")); | |
} |
This file contains hidden or 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
Regex rxnum = new Regex(@"(\d+(?! */))? *-? *(?:(\d+) */ *(\d+))?.*$"); | |
Match numMatch = rxnum.Match(ingredient); | |
if (numMatch.Success) | |
{ | |
amount = (!string.IsNullOrEmpty(numMatch.Groups[1].Value) ? numMatch.Groups[1].Value : string.Empty) + (!string.IsNullOrEmpty(numMatch.Groups[2].Value) ? " " + numMatch.Groups[2].Value + "/" + numMatch.Groups[3].Value : string.Empty); | |
// do something with the amount... | |
} |
NewerOlder