This file contains 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
extern "C" | |
{ | |
int InitSQL(); | |
int Rollback(); | |
int Commit(); | |
int DoMySelect(MyItem** ppItems); | |
}; | |
void DoSomethingTheOldWay(); |
This file contains 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
#rails gen model Player name:string | |
class Player < ActiveRecord:Base | |
has_many :wins, :class_name => "Game", :foreign_key => "winner" | |
has_many :losses, :class_name => "Game", :foreign_key => "loser" | |
end | |
#rails gen model Game winner:integer loser:integer | |
class Game < ActiveRecord:Base | |
belongs_to :winner, :class_name => "Player", :foreign_key => "player_id" | |
belongs_to :loser, :class_name => "Player", :foreign_key => "player_id" |
This file contains 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
void Sub exampleBtn_Click(Object sender, EventArgs e) | |
{ | |
if( txtBox1.Value <> "" ) then | |
if( txtBox1.Value = "some other bad thing" ) then | |
Exit Sub | |
end if | |
end if | |
' 50 million things like this, sometimes nested deeper | |
} |
This file contains 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
using NUnit.Framework; | |
using Noesis.Javascript.Headless; | |
using Noesis.Javascript.Headless.Reporters; | |
namespace Noesis.Javascript.Headless.Example.Specs | |
{ | |
[TestFixture] | |
public class JasmineSpecs | |
{ | |
private JavaScriptTestRunner _jsTestRunner; |
This file contains 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 class ResultsReporter : IJavaScriptReporter | |
{ | |
private readonly Dictionary<string, string> _results = new Dictionary<string,string>(); | |
public Dictionary<string, string> Results | |
{ | |
get { return _results; } | |
} | |
public string Result | |
{ |
This file contains 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 static class EnumerableExtensions | |
{ | |
public static void ForEach<T>(this IEnumerable<T> items, Action<T> action) | |
{ | |
foreach (var item in items) | |
action(item); | |
} | |
} |
This file contains 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
describe('Backbone View Example', function () { | |
beforeEach(function () { | |
this.collection = jasmine.createSpyObj(MyModels, ['bind']); | |
this.view = new MyView({collection: this.collection}); | |
}); | |
it('should render itself when the collection changes', function () { | |
expect(this.collection.bind) | |
.toHaveBeenCalledWith(['change', this.view.render]); | |
}); |
This file contains 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
describe("testing a Backbone fetch", function () { | |
beforeEach(function () { | |
spyOn($, 'ajax'); | |
}); | |
it("should have been called with this", function () { | |
var sut = new MyModel({}); | |
sut.fetch(); | |
var ajaxOptions = { type: 'GET', dataType: 'json', success: undefined, error: jasmine.any(Function), url: '/MyModel' }; |
This file contains 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 class AbsFragmentActivity extends FragmentActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
ActionBar actionBar = getSupportActionBar(); | |
} | |
} |