Skip to content

Instantly share code, notes, and snippets.

View WildGenie's full-sized avatar
🤖
I ❤️ Machine Learning

Bilgehan Zeki ÖZAYTAÇ WildGenie

🤖
I ❤️ Machine Learning
View GitHub Profile
@WildGenie
WildGenie / Program.cs
Created May 24, 2016 03:38 — forked from mhusseini/Program.cs
Timings test for NamedFormats: Object vs ExpandoObject
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Dynamic;
namespace guerillacoder
{
internal class Program
{
@WildGenie
WildGenie / StringInterpol.cs
Created May 24, 2016 03:27 — forked from GuerrillaCoder/StringInterpol.cs
C# Named Value String Format Replace For Templating
// This is a modification of https://mhusseini.wordpress.com/2014/05/03/fast-named-formats-in-c.
// To make it work as a flexible templating system I modified it so that it can use dynamic objects
// and silently removes unused fields.
// I am not sure how this has effected its performance.
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
protected override void RequestStartup(TinyIoCContainer container, IPipelines pipelines, NancyContext context)
{
base.RequestStartup(container, pipelines, context);
var formsAuthConfiguration =
new FormsAuthenticationConfiguration()
{
DisableRedirect = true,
UserMapper = container.Resolve<IUserMapper>()
};
@WildGenie
WildGenie / shellcommand.sh
Created May 3, 2016 02:03 — forked from jankkhvej/shellcommand.sh
script to parse PHP short open tags and convert ones to normal
find project/dir/ -type f -iname "*.php" -exec php -d short_open_tag=On the_script.php {} \;
using System;
using System.Drawing;
using System.Windows.Forms;
namespace DrawCar
{
public partial class Form1 : Form
{
public Form1()
{
namespace mat_islem
{
public static class matematik
{
public static int cift(int a, int b)
{
if (a < b)
{
void Main()
{
//If the calling context is important (for example in GUI applications)
//you'd might want to save the Synchronization Context
//for example: context = SynchronizationContext.Current
//and use if in the lambda below e.g. s => context.Post(s => this.Close(), null)
var timer = new System.Threading.Timer(
s => this.Close(), null, CalcMsToHour(23, 00, 00), Timeout.Infinite);
}
TimeSpan ts = TimeSpan.FromMilliseconds(Environment.TickCount);
Console.WriteLine("{0}d {1}h {2}m {3}s", ts.Days, ts.Hours, ts.Minutes, ts.Seconds);
//---------------------------
using System.Diagnostics;
PerformanceCounter upTime = new PerformanceCounter("System", "System Up Time");
upTime.NextValue();
TimeSpan ts = TimeSpan.FromSeconds(upTime.NextValue());
Console.WriteLine("{0}d {1}h {2}m {3}s", ts.Days, ts.Hours, ts.Minutes, ts.Seconds);
#!/bin/sh
#/etc/init.d/MyMonoApp
#
APP_NAME="MyMonoApp"
APP_PATH="/home/mono/MyMonoApp"
APP_USER=mono
case "$1" in
#include
#include "windows.h"
#include "stdlib.h"
using namespace std;
int main(int argc, char *argv[])
{
HANDLE prochandle; //a handle to the process we want to inject our dll into
HANDLE threadhandle; //this will be a handle to the remote thread we will create