Skip to content

Instantly share code, notes, and snippets.

View jfromaniello's full-sized avatar
😀
coding

José F. Romaniello jfromaniello

😀
coding
View GitHub Profile
$.paginator = {
create: function(settings){
settings = $.extend({
items: ko.observableArray(),
pageSize: 10
}, settings);
var vm = {
@jfromaniello
jfromaniello / continous-qunit.ps1
Created August 4, 2011 14:22
The powershell continuously watch for file changes in a directory, then it executes PhantomJs with the Run-Qunit.js attached to your htm qunit test harness.
# watch a file changes in the current directory,
# execute all tests when a file is changed or renamed
$watcher = New-Object System.IO.FileSystemWatcher
$watcher.Path = get-location
$watcher.IncludeSubdirectories = $true
$watcher.EnableRaisingEvents = $false
$watcher.NotifyFilter = [System.IO.NotifyFilters]::LastWrite -bor [System.IO.NotifyFilters]::FileName
while($TRUE){
test("when calling save users then post the list of users", function () {
//mock the ajax call
var postData;
$.mockjax({
url: $.tellago.GetRootUrl() + "user/SaveUsersForServer",
response: function (settings) {
postData = settings.data;
}
});
[Authorize]
public class SomeController : Controller
{
private readonly IQuerySomething querySomething;
public SomeController(
IQuerySomething1 querySomething,
IQuerySomething2 querySomething,
IQuerySomething3 querySomething)
{
Sorry, an error occurred while processing your request.
System.Data.Services.Client.DataServiceRequestException: An error occurred while processing this request. ---> System.Data.Services.Client.DataServiceClientException: An error occurred while processing this request. The document was understood, but it could not be processed. - The WSDL document contains links that could not be resolved. - There was an error downloading 'file:///C:/Windows/TEMP/CardholderMessages.xsd'. - Could not find file 'C:\Windows\TEMP\CardholderMessages.xsd'. - Could not find file 'C:\Windows\TEMP\CardholderMessages.xsd'. - Could not find file 'C:\Windows\TEMP\CardholderMessages.xsd'. System.InvalidOperationException at System.Web.Services.Discovery.DiscoveryClientProtocol.DiscoverAny(String url) at (Object , String ) at Tellago.ServiceModel.Governance.Resources.ServiceMetadataImporter.(String url) at Tellago.ServiceModel.Governance.Resources.ServiceMetadataImporter.GetMetadataImporterFromWSDL(String content) at Tellago.ServiceMod
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Reactive.Linq;
using System.Web;
namespace LongPollingExample.Client
{
class Program
{
static void Main(string[] args)
{
//var chunk = File.ReadAllText("sample.json");
var serializer = new JsonSerializer();
using (var streamReader = new StreamReader("sample.json"))
{
var deserialized = serializer.Deserialize<List<object>>(new JsonTextReader(streamReader));
Use this within notepad++ / nppexec in order to preview a markup file as html
perl "C:\Markdown_1.0.1\Markdown.pl" "$(FULL_CURRENT_PATH)"
CON_SAVETO $(CURRENT_DIRECTORY)\$(NAME_PART).html
cmd /c start file://$(CURRENT_DIRECTORY)\$(NAME_PART).html
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
namespace ConsoleApplication26
{
class Program
public class CustomerByName : Specification<Customer>
{
private readonly string firstName;
public CustomerByName(string firstName)
{
this.firstName = firstName;
}
public override Expression<Func<Customer, bool>> IsSatisfiedBy()