👨⚖️
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
using Funq; | |
using Raven.Client; | |
using ServiceStack.Authentication.RavenDb; | |
using ServiceStack.CacheAccess; | |
using ServiceStack.CacheAccess.Providers; | |
using ServiceStack.Configuration; | |
using ServiceStack.ServiceInterface; | |
using ServiceStack.ServiceInterface.Auth; | |
using ServiceStack.WebHost.Endpoints; |
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
using System; | |
using System.Dynamic; | |
using System.Text; | |
namespace Spiffy | |
{ | |
class Program | |
{ | |
static void Main(string[] 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
public var GetPost(string id) { | |
var post = Db.Posts.Find(id); | |
return post as IPost; | |
} |
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
open System.Drawing | |
open System.Windows.Forms | |
type HelloWindow() = | |
let frm = new Form(Width = 400, Height = 140) | |
let fnt = new Font("Time New Roman", 28.0f) | |
let lbl = new Label(Dock = DockStyle.Fill, Font = fnt, TextAlign = ContentAlignment.MiddleCenter) | |
do frm.Controls.Add(lbl) |
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
class Program | |
{ | |
public static Dictionary<Type, object> Stubs = new Dictionary<Type, object> | |
{ | |
{ | |
typeof (GetUserById), new StubGetUserById(x => new Person { Name = string.Format("{0} {1} {2}", x.FirstName, x.LastName, "Test") } ) | |
} | |
}; | |
static void Main(string[] 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
// for loop | |
var items = new List<Item>(); | |
foreach (var i in existingItems) { | |
items.Add(new Item(i)); | |
} | |
// linq statement | |
var items = existingItems.Select(x => new Item(x)).ToList(); |
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
[Documentation(Section = "Math", | |
Intro = "addition_intro.md", | |
Conclusion = "addition_conclusion.md", | |
Order = 1 )] | |
public class Addition | |
{ | |
[Fact] | |
[Documentation(Title = "Adding Two Numbers", Intro = "adding_two_numbers.md", Order = 1)] | |
public void Adding_two_numbers() | |
{ |
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
// put this in your browser | |
https://api.github.com/search/code?q=kotlin+repo:hhariri/hhariri.github.io | |
// Get a list of JSON results back :) | |
// Potentially do some JSON / JavaScript magic to show the results and links. |
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 username = **YOUR USERNAME**; | |
var password = **YOUR PASSWORD**; | |
var url = "http://hackers-endpoint.com?username={0}&password={1}"; | |
var client = new HttpClient(); | |
var response = await client.GetAsync(string.Format(url, username, password)); | |
response.EnsureSuccessStatusCode(); | |
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 ActionResult Index() { | |
return ProgressFlushResult(x => { | |
x.PartialView("First"); | |
x.PartialView("Second"); | |
x.PartialView("Third"); | |
}); | |
} |