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
[:program, [:stmts_add, [:stmts_new], [:method_add_block, [:command_call, [:var_ref, [:@const, "RSpec", [1, 0]]], :".", | |
[:@ident, "describe", [1, 6]], [:args_add_block, [:args_add, [:args_new], [:var_ref, [:@const, "Something", [1, 15]]]], | |
false]], [:do_block, nil, [:stmts_add, [:stmts_new], [:method_add_block, [:command, [:@ident, "describe", [2, 2]], | |
[:args_add_block, [:args_add, [:args_new], [:string_literal, [:string_add, [:string_content], [:@tstring_content, | |
"when creating the handler", [2, 12]]]]], false]], [:do_block, nil, [:stmts_add, [:stmts_new], [:method_add_block, | |
[:command, [:@ident, "it", [3, 4]], [:args_add_block, [:args_add, [:args_new], [:string_literal, [:string_add, | |
[:string_content], [:@tstring_content, "fails if no tweet has been provided", [3, 8]]]]], false]], [:do_block, nil, | |
[:stmts_add, [:stmts_new], [:command_call, [:method_add_arg, [:fcall, [:@ident, "expect", [4, 6]]], [:arg_paren, | |
[:args_add_block, [:args_add, [:args_new], [:@int, "0", [4, 13]]], false]]], :".", [:@ident, |
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
RSpec.describe SUT do | |
describe 'when the sut does something' do | |
it 'works as expected' do | |
expect(1).to be 1 | |
end | |
end | |
end |
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
public enum Cacheability | |
{ | |
NoCache, | |
Private, | |
Public, | |
} |
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 class ST | |
{ | |
public int Id { get; set; } | |
public string Name { get; set; } | |
} | |
public void ProcessChildCategories(XElement categoriesNode, Category parentNode) | |
{ | |
var xmlCategories = categoriesNode.Elements("Category"); |
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
// This script assumes unique Abbreviation field. | |
const int countryId = 72; | |
var sql = | |
@"IF NOT EXISTS (SELECT 1 FROM StateProvince WHERE Abbreviation = '{2}') | |
BEGIN | |
INSERT StateProvince (CountryId, Name, Abbreviation, Published, DisplayOrder) VALUES ({0}, '{1}', '{2}', {3}, {4}) | |
END;"; |
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
/* | |
* log= (insanity?) | |
* http://benalman.com/ | |
* | |
* Copyright (c) 2012 "Cowboy" Ben Alman | |
* Licensed under the MIT license. | |
*/ | |
Object.defineProperty(global, 'log', { | |
set: function(args) { |
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
<html> | |
<head> | |
<script type="application/javascript"> | |
var _context = null; | |
var _counterIdentifier = null; | |
var _counterState = 0; | |
function startCounter() { | |
if (canvas.getContext) { | |
_context = canvas.getContext("2d"); |
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
var baseRequest = ((HttpContextWrapper)request.Properties["MS_HttpContext"]).Request; | |
var remoteDir = baseRequest.ServerVariables["REMOTE_ADDR"]; | |
var directionsOfRedirection = baseRequest.ServerVariables["X_FORWARDED_FOR"]; | |
return remoteDir ?? directionsOfRedirection; |
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
<html> | |
<head> | |
<script type="application/javascript"> | |
var _context = null; | |
var _counter = 0; | |
var _maxIterations = 15; | |
var _current_x_position = 0; | |
var _current_y_position = 384; | |
function draw() { |
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 string ObjectToTextTemplate(string text, object objectToSerialize) | |
{ | |
const string enclosingSymbol = "#"; | |
const string entityProxyModule = "EntityProxyModule"; | |
var type = objectToSerialize.GetType(); | |
var isEntityFrameworkProxyObject = type.Module.ScopeName.Contains(entityProxyModule); | |
foreach (var propertyInfo in type.GetProperties()) | |
{ |