Skip to content

Instantly share code, notes, and snippets.

View c1982's full-sized avatar
🍄
yeah!

Oğuzhan Yılmaz c1982

🍄
yeah!
View GitHub Profile
@c1982
c1982 / MethodResult.cs
Created August 27, 2015 16:03
MethodResult
public class MethodResult
{
public bool Status { get; set; }
public string Msg { get; set; }
public string HowToResolve { get; set; }
}
@c1982
c1982 / tyyp.reg
Created February 6, 2014 02:08
Bilgisayarınızda tyyp:// protokolünü aktifleştirmek için aşağıdaki dosyayı .reg uzantısı ile kaydedip çalıştırdıktan sonra istediğiniz herhangi bir siteyi tyyp://www.google.com şeklinde çalıştırıp internetin keyfini yaşayabilirsiniz.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\tyyp]
@="URL:HyperText Transfer Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\tyyp\DefaultIcon]
@="C:\\Windows\\System32\\url.dll,0"
[HKEY_CLASSES_ROOT\tyyp\shell]
using System.Web.Mvc;
using System.Web.Routing;
using MvcApplication1.Models;
namespace MvcApplication1
{
public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
using System.Web.Mvc;
namespace MvcApplication1.Models
{
public class LoginRequiredAttribute : ActionFilterAttribute
{
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
if (filterContext.HttpContext.Session["isLogIn"] == null)
filterContext.Result = new RedirectResult("~/Home/Login");
@c1982
c1982 / gist:847125
Created February 28, 2011 09:26
Mikrotik API: Add Static Firewall Rule
using Mikrotik.Api;
namespace Usage
{
class Program
{
static void Main(string[] args)
{
var variable = new Firewall("192.168.2.8", "admin", "password")
.Chain(Targets.forward)
@c1982
c1982 / gist:847133
Created February 28, 2011 09:32
Create Backup, Change Identity, Login Notice, Reboot
using Mikrotik.Api;
namespace Usage
{
class Program
{
static void Main(string[] args)
{
//TODO : Create Mikrotik backup
var variable = new RouterOs("192.168.2.8", "admin", "password")
@c1982
c1982 / gist:856761
Created March 5, 2011 22:09
DynamicOverload Pattern
class Program
{
static void Main(string[] args)
{
var cmd = new Executor();
dynamic commandItem = RemoteServer.GetCommandItemFromRemoteServer(); //return Object;
cmd.ExecuteCommand(commandItem);
Console.ReadKey();
public void Before_1()
{
string Year = "";
string Month = "";
string Week = "";
string Day = "";
}
public void After_1()
{
string Year, Month, Week, Day = String.Empty;
}
@c1982
c1982 / gist:1626359
Created January 17, 2012 11:39
is exists sql server process in local machine?
public bool SqlServerIsUp()
{
return Process.GetProcessesByName("sqlservr").Any();
}