Skip to content

Instantly share code, notes, and snippets.

@sweetjian
sweetjian / OpenWithSublimeText3.bat
Last active April 15, 2016 04:56 — forked from roundand/OpenWithSublimeText3.bat
Open folders and files with Sublime Text 3 from windows explorer context menu (tested in Windows 7)
@echo off
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for all file types
rem @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
rem @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
rem @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@sweetjian
sweetjian / HexBox.cs
Created October 11, 2014 14:06
text-hex editor
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Globalization;
using System.Text;
using System.Windows.Forms;
namespace TestLab
{
/// <summary>
@sweetjian
sweetjian / DesignTimeHelper.cs
Last active August 29, 2015 14:04
DesignTimeHelper
using System.ComponentModel;
using System.Diagnostics;
namespace Utilities
{
public static class DesignTimeHelper
{
/// <summary>
/// Check is in design mode.
/// http://stackoverflow.com/questions/2427381/how-to-detect-that-c-sharp-windows-forms-code-is-executed-within-visual-studio
@sweetjian
sweetjian / SimulateData.cs
Created May 22, 2014 02:51
data simulation
/// <summary>
/// 模拟数据
/// </summary>
public class SimulateData
{
/// <summary>
/// 阈值
/// </summary>
private readonly double min, max;
/// <summary>