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
App = { | |
start: function () { | |
new StockCollectionView; | |
} | |
}; | |
$().ready(function() { | |
App.start(); | |
}); |
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
Authorization: Basic <key:secret> | |
Content-Type: application/json | |
Host: go.urbanairship.com | |
Content-Length: 243 | |
POST - https://go.urbanairship.com/api/push/ | |
Request Body: | |
{ |
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
private ZebraSocket tryPublicApiWay() throws ZebraPrinterConnectionException | |
{ | |
try { | |
BluetoothSocket bSocket = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(this.macAddress).createRfcommSocketToServiceRecord(UUID.fromString("00001101-0000-1000-8000-00805F9B34FB")); | |
ZebraBluetoothSocket zBtSocket = new ZebraBluetoothSocket(bSocket); | |
zBtSocket.connect(); | |
return zBtSocket; | |
} catch (IOException e) { | |
throw new ZebraPrinterConnectionException(e.getMessage()); | |
} |
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
[HttpPost] | |
public JsonResult SubmitCharge(string token, int amount) | |
{ | |
const string baseUrl = "https://api.stripe.com/"; | |
const string endPoint = "v1/charges"; | |
var apiKey = ConfigurationManager.AppSettings.Get("StripeSecretKey"); | |
var client = new RestClient(baseUrl) { Authenticator = new HttpBasicAuthenticator(apiKey, "") }; | |
var request = new RestRequest(endPoint, Method.POST); |
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
[HttpPost] | |
public JsonResult SubmitCharge(string token, int amount) | |
{ | |
const string baseUrl = "https://api.stripe.com/"; | |
const string endPoint = "v1/charges"; | |
var apiKey = ConfigurationManager.AppSettings.Get("StripeSecretKey"); | |
var client = new RestClient(baseUrl) { Authenticator = new HttpBasicAuthenticator(apiKey, "") }; | |
var request = new RestRequest(endPoint, Method.POST); |
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
m.Views.Friend = Backbone.View.extend({ | |
template: "#friend-item-template", | |
initialize: function () { | |
this.model.on("change", this.render, this); | |
} | |
}) | |
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
cleanViews: function(views) { | |
// Clear out all existing views. | |
_.each(aConcat.call([], views), function(view) { | |
// Remove all custom events attached to this View. | |
view.unbind(); | |
// Automatically unbind `model`. | |
if (view.model instanceof Backbone.Model) { | |
view.model.off(null, null, view); | |
} |
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
namespace ExampleTemplateGenerator | |
{ | |
partial class Entity | |
{ | |
private readonly string _entityName; | |
private readonly string _assemblyName; | |
public Entity(string entityName, string assemblyName) | |
{ | |
_entityName = entityName; |
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
<#@ template language="C#" #> | |
<#@ assembly name="System.Core" #> | |
<#@ import namespace="System.Linq" #> | |
<#@ import namespace="System.Text" #> | |
<#@ import namespace="System.Collections.Generic" #> | |
using System; | |
namespace <#= _assemblyName #>.Infrastructure.Entities | |
{ |