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
$(document).ready(function () { | |
JSONP('http://URL.json?cb=JSONP'); | |
function JSONP(URL) { | |
$.ajax({ | |
url: URL, | |
dataType: 'jsonp', | |
data: { |
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
// create a new order and redirect to a payment page | |
protected void checkoutButton_Click(object sender, EventArgs e) | |
{ | |
DataTable dt = ShoppingCartAccess.CreateOrder(); | |
StringBuilder sb = new StringBuilder(); |
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
// ASP .NET C# | |
using System; | |
using System.IO; | |
using System.Text; | |
using System.Net; | |
using System.Web; | |
public partial class csIPNexample : System.Web.UI.Page | |
{ |
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
<li id="author-bio-social-links" class="clr"> | |
<a href="http://twitter.com/webdesigntunes" title="Twitter" target="_blank"><img src="http://www.webdesigntunes.com/wp-content/themes/web- | |
design/images/social/twitter.png" alt="Twitter"></a> | |
<a href="http://facebook.com/webdesigntunes" title="Facebook" target="_blank"><img src="http://www.webdesigntunes.com/wp-content/themes/web- | |
design/images/social/facebook.png" alt="Facebook"></a> | |
<a href="https://plus.google.com/u/1/117072715276995034167" title="Google Plus" target="_blank"><img src="http://www.webdesigntunes.com/wp-content/themes/web- | |
design/images/social/googleplus.png" alt="Google Plus"></a> |
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
from datetime import datetime | |
import time | |
#------------------------------------------------- | |
# conversions to strings | |
#------------------------------------------------- | |
# datetime object to string | |
dt_obj = datetime(2008, 11, 10, 17, 53, 59) | |
date_str = dt_obj.strftime("%Y-%m-%d %H:%M:%S") |
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
statusList = new SelectList(ListNotifications.GroupBy(p => p.Status, (key, g) => key)); | |
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
Regex.Replace(Body, @"(\t|\n|\r|p?></?\w+)(?>(?:[^>'""]+|'[^']*'|""[^""]*"")*)>", ""); |
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 Promise = require('bluebird'); | |
// EXAMPLE 1 | |
// EXAMPLE 1 | |
// EXAMPLE 1 | |
// ERROR HANDLER WILL CATCH REJECTION | |
function getPromise1(){ | |
return new Promise(function(resolve, reject){ | |
reject(new Error("Rejected error")) | |
}).then(function(result) { |
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
/// REVERSE ARRAY | |
var array = [1,2,3,4,5,6,7,8,9]; | |
var leftMark = 0; | |
var rightMark = array.length; | |
reverseArray(array,leftMark,rightMark); | |
function reverseArray(array, leftMark, rightMark){ |
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 MyCustomError(message) { | |
this.message = message; | |
this.name = "MyCustomError"; | |
Error.captureStackTrace(this, MyCustomError); | |
} | |
MyCustomError.prototype = Object.create(Error.prototype); | |
MyCustomError.prototype.constructor = MyCustomError; |
OlderNewer