Skip to content

Instantly share code, notes, and snippets.

View koraysaritas's full-sized avatar

Koray Sarıtaş koraysaritas

View GitHub Profile
@koraysaritas
koraysaritas / add.c
Created April 27, 2017 10:46 — forked from barosl/add.c
Function overloading in C
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int addi(int a, int b) {
return a + b;
}
char *adds(char *a, char *b) {
char *res = malloc(strlen(a) + strlen(b) + 1);
@koraysaritas
koraysaritas / rm.txt
Created February 28, 2017 10:52
Remove folders/files matching pattern recursively
# Remove folders matching pattern recursively
FOR /F "tokens=*" %G IN ('DIR /B /AD /S bin') DO RMDIR /S /Q "%G"
FOR /F "tokens=*" %G IN ('DIR /B /AD /S obj') DO RMDIR /S /Q "%G"
FOR /F "tokens=*" %G IN ('DIR /B /AD /S .vs') DO RMDIR /S /Q "%G"
# Remove files matching pattern recursively
FOR /F "tokens=*" %G IN ('DIR /B /A /S *.log') DO DEL /F /S /Q /A "%G"
@koraysaritas
koraysaritas / BottomRightForm.cs
Created January 11, 2016 10:18
BottomRightForm
Rectangle workingArea = Screen.GetWorkingArea(this);
FrmHede hede = new FrmHede();
hede.StartPosition = FormStartPosition.Manual;
hede.Location = new Point(workingArea.Right - hede.Width, workingArea.Bottom - hede.Height);
// hede.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - hede.Width, Screen.PrimaryScreen.WorkingArea.Height - hede.Height);
@koraysaritas
koraysaritas / TheTurkishIProblem.cs
Created July 30, 2015 11:40
This is known as "the Turkish I Problem"
string username = txtUsername.Text.ToUpper().ToUpperInvariant().ToLowerInvariant().ToLower().ToUpperInvariant(); // kerim -> KERIM