Skip to content

Instantly share code, notes, and snippets.

Adam Bull adaam2

Block or report user

Report or block adaam2

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View codingtest.js
const courses = {
starters: ["🍔", "🍐", "🍅"],
mains: ["🍏", "🍊"],
desserts: ["🍰", "🍓"]
};
const dishesChefCanMake = ["🍏", "🍅", "🍐", "🍔"];
// for each of the courses, find the dishes that the chef can make
// and print them out like so:
View database_cleaner.rb
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.strategy = :transaction
end
config.before(:each, js: true) do
View Example.cs
public interface IRepository<T> where T : class
{
T Find(int id);
List<T> All();
void Delete(int id);
void Update(T obj);
}
public class ProductRepository : IRepository<Product>
{
@adaam2
adaam2 / IRepository.cs
Last active Jul 23, 2018
Basic IRepository
View IRepository.cs
public interface IRepository<T> where T : class
{
T Find(int id);
List<T> All();
void Delete(int id);
void Update(T obj);
}
View Index.cshtml
@model Product
<h1>@Model.Name</h1>
View hello.json
{
"Name":"Stripey Socks",
"Slug":"stripey-socks",
"ShortDescription":"Get some stripes rawr",
"LongDescription":"Three separate boxes full of stripey socks delivered to your doorstep each month. The perfect gift for your Gran!",
"ProductShortCode":"GF",
"DespatchDayOfMonth":5,
"DeliveryDates":[
{
"Date":"2016-06-05T00:00:00",
View mvc.txt
MVC Practice.
Sample database connection string:
Data Source=mhknbn2kdz.database.windows.net;Initial Catalog=AdventureWorks2012;Integrated Security=False;User ID=sqlfamily;Password=sqlf@m1ly;Pooling=False
Things to touch on (in order)
1. Any questions / things that confuse you before starting)
2. Class libraries (adding references)
View devsetup.md

MB Dev Environment Setup

##Development Applications

  • Visual Studio 2015 Community Edition
  • SourceTree (if you don't want to use the command line. n.b. SSH keys are setup with SourceTree using Pageant / PuTTy)
  • Sublime Text 3
  • DbForge Studio for SQL Server (or SQL Server Management Studio 2014)
View demo.js
var arr = [[1,2,[3]],4];
// Call the method
var flattened = flatten(arr);
// Print the result out to the console..
console.log(flattened);
function flatten(arr) {
var flatArray = [];
You can’t perform that action at this time.