⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
[Fact] | |
public void Should_add_multipart_formdata_encoded_files_to_request_filestream() | |
{ | |
// Given | |
var stream = | |
CreateFakeFileStream("This is the contents of a file"); | |
var multipart = new BrowserContextMultipartFormData(x => { | |
x.AddFile("foo", "foo.txt", "text/plain", stream); | |
}); |
#Four Ways To Do Pub/Sub With jQuery and jQuery UI (in the future)
Between jQuery 1.7 and some of work going into future versions of jQuery UI, there are a ton of hot new ways for you to get your publish/subscribe on. Here are just four of them, three of which are new.
(PS: If you're unfamiliar with pub/sub, read the guide to it that Julian Aubourg and I wrote here http://msdn.microsoft.com/en-us/scriptjunkie/hh201955.aspx)
##Option 1: Using jQuery 1.7's $.Callbacks() feature:
// ==UserScript== | |
// @name Use Markdown, sometimes, in your HTML. | |
// @author Paul Irish <http://paulirish.com/> | |
// @link http://git.io/data-markdown | |
// @match * | |
// ==/UserScript== | |
// If you're not using this as a userscript just delete from this line up. It's cool, homey. |
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
using System.Threading; | |
using Raven.Abstractions.Extensions; | |
using Raven.Client.Embedded; | |
using Raven.Client.Indexes; | |
using Raven.Client.Linq; |
var user = { | |
validateCredentials: function (username, password) { | |
return ( | |
(!(username += '') || username === '') ? { error: "No Username Given.", field: 'name' } | |
: (!(username += '') || password === '') ? { error: "No Password Given.", field: 'pass' } | |
: (username.length < 3) ? { error: "Username is less than 3 Characters.", field: 'name' } | |
: (password.length < 4) ? { error: "Password is less than 4 Characters.", field: 'pass' } | |
: (!/^([a-z0-9_-]+)$/i.test(username)) ? { error: "Username contains invalid characters.", field: 'name' } | |
: false | |
); |
package com.squareup.example; | |
public abstract BaseActivity extends SherlockActivity { | |
private final ScopedBus scopedBus = new ScopedBus(); | |
protected ScopedBus getBus() { | |
return scopedBus; | |
} | |
@Override public void onPause() { |
param( | |
[string]$server = "origin", | |
[string]$branch = "master" | |
) | |
$gitStatus = (Get-GitStatus) | |
if ($gitStatus -eq $null) { | |
write-error "Not in a Git repository." | |
} elseif ($gitStatus.HasUntracked -or $gitStatus.HasWorking -or $gitStatus.HasIndex) { |
function Bump-Version | |
{ | |
param([string]$part = $(throw "Part is a required parameter.")) | |
$version = Get-AssemblyInfoVersion -Directory ..\Source -GlobalAssemblyInfo $true | |
$bumpedVersion = Clone-Object -Object $version | |
switch -wildcard ($part) | |
{ | |
"ma*" { $bumpedVersion.Major = Bump-NumericVersion -Current $version.Major } |