Create a public gist on Github with one or more Markdown-syntax files. Note the gist ID number. It’s usually a longish number like 29388372. View your writing presented nicely at gist.io/gist-id-here
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Mathieu 'p01' Henri <http://www.p01.org/releases/> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public partial class Form1 : Form | |
{ | |
bool clicked = false; | |
CheckBoxState state; | |
public Form1() | |
{ | |
InitializeComponent(); | |
listView1.View = View.Details; | |
listView1.Columns.Add("Col1", 150); | |
listView1.Columns.Add("Col2", 150); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Get the modified file list | |
svn status | grep '^M ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void PrintSQLServerInfo() | |
{ | |
SqlDataSourceEnumerator dataSourceEnumarator = SqlDataSourceEnumerator.Instance; | |
DataTable dataTable = dataSourceEnumarator.GetDataSources(); | |
foreach (DataRow row in dataTable.Rows) | |
{ | |
Console.WriteLine("----------------------------Sources----------------------------"); | |
Console.WriteLine("Server Name:" + row["ServerName"]); | |
Console.WriteLine("Instance Name:" + row["InstanceName"]); | |
Console.WriteLine("Is Clustered:" + row["IsClustered"]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Management; | |
using System.Security.Principal; | |
using Microsoft.Win32; | |
public class SysInfoHelper | |
{ | |
public static void LogSystemInfo(int messageID) | |
{ | |
LogOSVersionInfo(messageID); | |
LogUserInfo(messageID); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void radix_sort(unsigned *begin, unsigned *end) | |
{ | |
unsigned *begin1 = new unsigned[end - begin]; | |
unsigned *end1 = begin1 + (end - begin); | |
for (unsigned shift = 0; shift < 32; shift += 8) { | |
size_t count[0x100] = {}; | |
for (unsigned *p = begin; p != end; p++) | |
count[(*p >> shift) & 0xFF]++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class MemoryInfo | |
{ | |
[DllImport("psapi.dll", SetLastError = true)] | |
[return: MarshalAs(UnmanagedType.Bool)] | |
public static extern bool GetPerformanceInfo([Out] out PerformanceInformation PerformanceInformation, [In] int Size); | |
[StructLayout(LayoutKind.Sequential)] | |
public struct PerformanceInformation | |
{ | |
public int Size; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Reset the modifications | |
git checkout -- <filename> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Change the headefile for Windows | |
#include <memory> | |
#include <winsock2.h> | |
#include <ws2tcpip.h> | |
#pragma comment(lib,"Ws2_32.lib"); | |
#include <string> | |
using namespace std; | |
// This is compatible with old version of Windows. | |
bool IsIPAddress(const string& value) |
OlderNewer