Skip to content

Instantly share code, notes, and snippets.

View Jessicaward's full-sized avatar
🇮🇲
.NET programmer from the Isle of Man

Jessica Ward Jessicaward

🇮🇲
.NET programmer from the Isle of Man
View GitHub Profile
@DanDiplo
DanDiplo / JS-LINQ.js
Last active April 4, 2024 05:26
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// First: This version using older JavaScript notation for universal browser support (scroll down for ES6 version):
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },
@subnetmarco
subnetmarco / CorsRequest.js
Last active July 10, 2018 09:03
Sample code for executing an AJAX request using jQuery.
$.ajax({
url: 'MASHAPE-URL', // The URL to the API. You can get this by clicking on "Show CURL example" from an API profile
type: 'POST', // The HTTP Method
data: {}, // Additional parameters here
dataType: 'json',
success: function(data) { alert(JSON.stringify(data)); },
error: function(err) { alert(err); },
beforeSend: function(xhr) {
xhr.setRequestHeader("X-Mashape-Authorization", "YOUR-MASHAPE-KEY"); // Enter here your Mashape key
}