Skip to content

Instantly share code, notes, and snippets.

View hhariri's full-sized avatar

Hadi Hariri hhariri

View GitHub Profile
/**
* Make a request to a specific URL using a method
* @param {string} url
* @param {string} method
*/
var makeRequestDocumented = function (url, method) {
// make a request
};
require(["mathFunctions"], function (math) {
console.log(math.add(5,3));
console.log(math.subtract(10, 3));
});
public class When_baseuri_is_null_and_query_is_null
{
Establish context = () =>
{
uriComposer = new UriComposer();
query = null;
baseUri = null;
};
Because of = () => url = uriComposer.Compose(baseUri, query, uri);
void InitRequest(string uri, object query, HttpMethod method)
{
Request.Uri = !String.IsNullOrEmpty(_baseUri) ? _uriComposer.Compose(_baseUri, uri, query): uri;
Request.Data = null;
Request.PutFilename = String.Empty;
Request.Expect = false;
Request.KeepAlive = true;
Request.MultiPartFormData = null;
Request.MultiPartFileData = null;
Request.ContentEncoding = null;
function logger(options) {
if ('object' == typeof options) {
options = options || {};
} else if (options) {
options = { format: options };
} else {
options = {};
}
function logger(options) {
if ('object' == typeof options) {
options = options || {};
} else if (options) {
options = { format: options };
} else {
options = {};
}
describe('Farting', function () {
describe('when shaking the phone with my hands', function () {
it('a farting sound should appear', function (done) {
// TODO: Implement Fart
done();
});
});
public class a_response_that_contains_umlats
{
Because of = () =>
{
var http = new HttpClient();
http.Request.Accept = HttpContentTypes.ApplicationJson;
response = http.Get("https://api.github.com/users/thecodejunkie");
[Subject("Encoding Enums")]
public class when_encoding_an_object_that_contains_an_enum
{
Establish context = () =>
{
IEnumerable<IDataReader> readers = new List<IDataReader> { new JsonReader(new DataReaderSettings(), "application/.*json") };
IEnumerable<IDataWriter> writers = new List<IDataWriter> { new JsonWriter(new DataWriterSettings(), "application/.*json") };
codec = new DefaultCodec(new RegExBasedDataReaderProvider(readers), new RegExBasedDataWriterProvider(writers));
_routeConventions.MapAction("Create").WithNoParameters().ToCustomUrl("/new").ConstraintToVerb(HttpVerbs.Get);