Skip to content

Instantly share code, notes, and snippets.

View serdarb's full-sized avatar
👀

Serdar Büyüktemiz serdarb

👀
  • Ankara
View GitHub Profile
@serdarb
serdarb / ECDSA
Created October 25, 2018 14:47
using System.Security.Cryptography;
using System.Text;
namespace ConsoleApp
{
class Program
{
class ECDsaHelper
{
public CngAlgorithm Algorithm { get; set; }
## coding challenge: count words in Moby Dick
the book "Moby Dick"
by Herman Melville
describes an epic battle of a gloomy captain against his personal nemesis,
the white whale.
you can find the full text
for Herman Melville’s “Moby Dick”
as a **text file**
@serdarb
serdarb / gist:6869134
Created October 7, 2013 14:41
Download and Unzip Powershell
$path = "C:\Setups"
$url = "http://www.dotpdn.com/files/Paint.NET.3.5.11.Install.zip"
md $path
$pieces = $url.Split("/")
$fileName = $pieces[$pieces.Count-1]
$unzipped = "$path\$fileName"
@serdarb
serdarb / Download and Install MongoDB as Windows Service PowerShell Script
Last active July 26, 2023 12:22
A nice powershell that dowloads mongodb and installs it as windows service... this script is good for development machines.
Set-ExecutionPolicy RemoteSigned
$mongoDbPath = "C:\MongoDB"
$mongoDbConfigPath = "$mongoDbPath\mongod.cfg"
$url = "http://downloads.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.4.9.zip"
$zipFile = "$mongoDbPath\mongo.zip"
$unzippedFolderContent ="$mongoDbPath\mongodb-win32-x86_64-2008plus-2.4.9"
if ((Test-Path -path $mongoDbPath) -eq $True)
{
@serdarb
serdarb / allrequesthandler.config
Created September 12, 2012 09:46
Web.Config To Handle all requests in one handler
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<httpHandlers>
<add verb="GET,HEAD"
path="*.css,*.js,*.xml,*.txt,*.swf,*.jpg,*.jpeg,*.gif,*.png,*.bmp,*.ico,*.pdf,*.xls,*.doc,*.ppt,*.xlsx,*.docx,*.pptx,*.swf,*.zip,*.rar"
type="System.Web.StaticFileHandler" />
namespace DogmaticWcf.Web.Controllers
{
public class HomeController : Controller
{
private readonly IMyService _service;
public HomeController(IMyService service)
{
_service = service;
}
namespace DogmaticWcf.Web
{
public class ServiceInstaller : IWindsorInstaller
{
public void Install(IWindsorContainer container, IConfigurationStore store)
{
container.AddFacility<WcfFacility>();
container.Register(
Component.For<IMyService>()
.AsWcfClient(
static void Main()
{
if (Environment.UserInteractive)
{
Bootstrapper.Initialize();
Console.WriteLine("Server ready...");
Console.ReadLine();
}
else
{
namespace DogmaticWcf.Server.Services
{
public class MyService : IMyService
{
public string DoSomething(MyDto data)
{
return string.Format("I did something at {0} with {1}", DateTime.Now, data.MyProperty);
}
}
}
namespace DogmaticWcf.Server.Contracts
{
[ServiceContract]
public interface IMyService
{
[OperationContract]
string DoSomething(MyDto data);
}
[DataContract]