Skip to content

Instantly share code, notes, and snippets.

View erkantaylan's full-sized avatar
🫖
I'm a teapot

erkan erkantaylan

🫖
I'm a teapot
  • TURKEY
  • 10:24 (UTC +03:00)
View GitHub Profile
C:\Users\erkan\Documents\Python
λ python alda27700.py
0
[27700] Playing code...
1
[27700] Playing code...
2
[27700] Playing code...
3
[27700] Playing code...
@erkantaylan
erkantaylan / open_program_by_name.ahk
Last active December 18, 2016 13:26
Opens a program by typing a short name, tag. (while caps lock on)
pressedKeys := ""
nameList := Object()
nameList.Insert("7ZIP")
nameList.Insert("DERS")
nameList.Insert("FIREFOX")
nameList.Insert("PHPSTORM")
nameList.Insert("SKYPE")
nameList.Insert("SPOTIFY")
nameList.Insert("SUBLIME")
@erkantaylan
erkantaylan / ebll.md
Created February 23, 2017 13:10
everything but little little

count total lines in path with cs and xaml extension only, without blank lines

(gci -include *.cs,*.xaml -recurse | select-string .).Count

with blank lines and cs, cpp, h, idl, idl asmx extension

(gci -include *.cs,*.cpp,*.h,*.idl,*.asmx -recurse | select-string .).Count
{deneme:[
"PatientName": "IBRAHIM KABIZ",
"PhoneNumber": "+909009009090",
"Stickies": [
{
"Ilaclar": {
"Bilgi": {
"DozkullanimTitle": "",
"DrugCount": 1,
"DrugNumber": 0,
private void HandlePreviewMouseWheel(object sender, MouseWheelEventArgs e) {
ScrollViewer scrollControl = sender as ScrollViewer;
if (!e.Handled && sender != null) {
bool cancelScrolling = false;
if (e.Delta > 0 && scrollControl.VerticalOffset == 0
|| e.Delta <= 0
&& scrollControl.VerticalOffset >= scrollControl.ExtentHeight - scrollControl.ViewportHeight) {
e.Handled = true;
MouseWheelEventArgs eventArg = new MouseWheelEventArgs(e.MouseDevice, e.Timestamp, e.Delta);
eventArg.RoutedEvent = MouseWheelEvent;
@erkantaylan
erkantaylan / ConEmu.xml
Last active October 23, 2018 18:15
cmder options backup
<?xml version="1.0" encoding="utf-8"?>
<key name="Software">
<key name="ConEmu">
<key name=".Vanilla" modified="2018-10-17 14:28:20" build="161206">
<value name="ColorTable00" type="dword" data="00222827"/>
<value name="ColorTable01" type="dword" data="009e5401"/>
<value name="ColorTable02" type="dword" data="0004aa74"/>
<value name="ColorTable03" type="dword" data="00a6831a"/>
<value name="ColorTable04" type="dword" data="003403a7"/>
<value name="ColorTable05" type="dword" data="009c5689"/>
@erkantaylan
erkantaylan / DelayedUpdateBehavior.cs
Created May 3, 2017 12:07
Update textbox's text property after N miliseconds later
/* Sample usage at xaml side
behaviors:DelayedUpdateBehavior.TargetProperty="{x:Static TextBox.TextProperty}"
behaviors:DelayedUpdateBehavior.Milliseconds="300"
*/
public static class DelayedUpdateBehavior {
private class PropertyChangeTimer {
private readonly BindingExpression expression;
private DispatcherTimer timer;
@erkantaylan
erkantaylan / KeyboardListener.cs
Last active May 4, 2017 07:29
Listen keys from keyboard
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows.Forms;
public class KeyboardListener {
private const int WH_KEYBOARD_LL = 13;
private const int WM_KEYDOWN = 0x0100;
private static Keys Shortcut1;
private static Keys Shortcut2;
using System;
using System.Data;
using System.Data.SqlClient;
internal class DbConnection
{
SqlConnection _sqlCnn; //Bağlantı
SqlCommand _sqlCmd; //Sql Komutu
SqlDataAdapter _sqlDa;
private readonly string _cnnStr; //= "Data Source=localhost;Initial Catalog=bilmuh;Integrated Security=True";
@erkantaylan
erkantaylan / GetActiveWindowProcessName.ahk
Created May 22, 2017 10:36
Autohotkey Active Window Process Name
GetActiveWindowProcessName() {
WinGet, Active_ID, ID, A
WinGet, Active_Process, ProcessName, ahk_id %Active_ID%
return Active_Process
}