Skip to content

Instantly share code, notes, and snippets.

View erkantaylan's full-sized avatar
🍇

erkan erkantaylan

🍇
  • TURKEY
  • 14:37 (UTC +03:00)
View GitHub Profile
@Ciantic
Ciantic / keyboardlistener.cs
Created July 11, 2010 17:33
C# Keyboard listener
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
using System.Windows.Input;
using System.Windows.Threading;
using System.Collections.Generic;
namespace Ownskit.Utils
{
@jsonw23
jsonw23 / FolderTree.xaml
Created February 27, 2012 21:32
Folder Tree WPF Control: Part 1 - Lazy Loading
<TreeView ItemsSource="{Binding Path=Drives}" TreeViewItem.Expanded="FolderTree_Expanded">
<TreeView.ItemContainerStyle>
<Style TargetType="TreeViewItem">
<Setter Property="IsExpanded" Value="{Binding Path=IsExpanded, Mode=TwoWay}" />
</Style>
</TreeView.ItemContainerStyle>
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding Path=Folders}">
<TextBlock Text="{Binding Path=Label}" />
</HierarchicalDataTemplate>
@dherman
dherman / emacs-cheat-sheet.md
Created August 2, 2012 16:22
My emacs cheat sheet

In penance for cracking stupid jokes on Twitter, here's my Emacs cheat sheet. Emacs has a steep learning curve, so I've tried to order them by importance so you could learn them in stages.

One overall rule of thumb: pay attention to the minibuffer (the line at the bottom of the editor). It will often guide you through a process, and also gives you hints about what state you're in, such as the middle of a multi-chord sequence.

The other rule of thumb: when in doubt, C-g it out.

Basics (mandatory)

You simply can't get by without having these at your fingertips.

@awidegreen
awidegreen / vim_cheatsheet.md
Last active October 27, 2024 12:13
Vim shortcuts

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
@1wErt3r
1wErt3r / SMBDIS.ASM
Created November 9, 2012 22:27
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger ([email protected])
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
@grey-code
grey-code / gist:5286786
Created April 1, 2013 18:41
AutoHotkey: StrDiff()
/*
By Toralf:
Forum thread: http://www.autohotkey.com/forum/topic59407.html
Basic idea for SIFT3 code by Siderite Zackwehdex
http://siderite.blogspot.com/2007/04/super-fast-and-accurate-string-distance.html
Took idea to normalize it to longest string from Brad Wood
http://www.bradwood.com/string_compare/
@cheynewallace
cheynewallace / NetStatPortsAndProcessNames.cs
Last active July 6, 2024 12:18
C# Get Active Ports and Associated Process Names. This code will parse the output from a "netstat -a -n -o" and retrieve a list of active listening ports, along with the associated PID. The PID is then resolved to a process name so we can see exactly which port is attached to which process.
// ===============================================
// The Method That Parses The NetStat Output
// And Returns A List Of Port Objects
// ===============================================
public static List<Port> GetNetStatPorts()
{
var Ports = new List<Port>();
try {
using (Process p = new Process()) {
@ekwus
ekwus / MainViewModel
Created September 10, 2013 09:05
Example of binding MahApps.Metro Flyout IsOpen using MVVM Light
using System;
using System.Collections.ObjectModel;
using System.Threading;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using TrinityToolkit;
using TrinityPlayer.Model;
@lsd
lsd / dota-2-console-commands.markdown
Last active January 5, 2024 13:08
DOTA 2 useful console commands

DOTA2 console commands

The most useful command here is probably dota_force_right_click_attack 1
More will be added as they come. The essentials DO NOT require sv_cheats
and as far as I know do not violate any official competition rules.

Turn on console

  • In steam, right cilck on "Dota 2" > properties
  • Click on Set Launcher Options and add -console
  • Save and start game. The default hotkey is ```` (backtick)
@prakhar1989
prakhar1989 / richhickey.md
Last active November 8, 2023 17:19 — forked from stijlist/gist:bb932fb93e22fe6260b2
richhickey.md

Rich Hickey on becoming a better developer

Rich Hickey • 3 years ago

Sorry, I have to disagree with the entire premise here.

A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.

Mastery comes from a combination of at least several of the following: