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
import base64 | |
import datetime | |
import hmac | |
import hashlib | |
from hashlib import md5 | |
import random | |
import re | |
import time | |
import urllib | |
import urllib2 |
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
{ | |
"recordCount":6, | |
"records":[{"id":"31fbc59c-e006-4145-8fd4-97679ee5fc08", | |
"alias":"Craig", | |
"number":"1", | |
"email":"[email protected]", | |
"emailId":"d9fb21ef-33ad-41b6-86f1-46a1d8e0d3af", | |
"isLoyaltyEnrolled":true, | |
"tokens":[], | |
"addresses":[{ |
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
"models":{ | |
"Category":{ | |
"id":"Category", | |
"properties":{ | |
"id":{ | |
"type":"long" | |
}, | |
"name":{ | |
"type":"string" | |
} |
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 class ResourceListingFactory | |
{ | |
private readonly SwaggerConfiguration _config; | |
public ResourceListingFactory(SwaggerConfiguration config) | |
{ | |
_basePath = basePath; | |
_apiDescriptions = apiDescriptions; | |
_config = config; | |
} |
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
@spin_size: 24; | |
@color1: hsl(0, 100%, 80%); | |
@color2: spin(@color1, @spin_size); | |
@color3: spin(@color2, @spin_size); | |
@color4: spin(@color3, @spin_size); | |
@color5: spin(@color4, @spin_size); | |
@color6: spin(@color5, @spin_size); | |
@color7: spin(@color6, @spin_size); | |
@color8: spin(@color7, @spin_size); | |
@color9: spin(@color8, @spin_size); |
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 class JsonpResult : JsonResult | |
{ | |
public override void ExecuteResult(ControllerContext context) | |
{ | |
if (context == null) | |
{ | |
throw new ArgumentNullException("context"); | |
} | |
var request = context.HttpContext.Request; | |
var response = context.HttpContext.Response; |
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
heroku neo4j addon | |
http://2df11a700:[email protected]:7183 | |
sinatra rest endpoint | |
http://neo4j-rest-proxy.herokuapp.com/ | |
production.rb | |
ENV["NEO4J_URL"] = 'http://neo4j-rest-proxy.herokuapp.com/' |
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.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Web.Helpers; | |
using Helpers; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; |
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
partial class FranchisesController | |
{ | |
public ViewResult Edit(int id) | |
{ | |
Franchise franchise = context.Franchises.Include(f => f.Rates).Single(x => x.Id == id); | |
return View(franchise); | |
} | |
[HttpPost] |
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 static void BulkInsert<T>(string connection, string tableName, IList<T> list) | |
{ | |
using (var bulkCopy = new SqlBulkCopy(connection)) | |
{ | |
bulkCopy.BatchSize = list.Count; | |
bulkCopy.DestinationTableName = tableName; | |
var table = new DataTable(); | |
var props = TypeDescriptor.GetProperties(typeof(T)) | |
//Dirty hack to make sure we only have system data types |