Skip to content

Instantly share code, notes, and snippets.

@linnet8989
linnet8989 / Install_OpenSSL_GIT.sh
Created September 24, 2018 10:29 — forked from kuoe0/Install_OpenSSL_GIT.sh
編譯採用 OpenSSL 的 git,避免某些網路環境下發生 gnutls_handshake() failed 的情況!
#!/usr/bin/env bash
# =============================================================================
# FileName: Install_OpenSSL_GIT.sh
# Desc: Build GIT with OpenSSL and Install it
# Environment: Ubuntu 13.04 amd64
# Usage: ./Install_OpenSSL_GIT.sh
# Author: KuoE0 <kuoe0.tw@gmail.com>
# HomePage: http://kuoe0.tw/
# Copyright: BSD License (C) 2013 KuoE0
# =============================================================================
@linnet8989
linnet8989 / KeyboardShortcutsSettings.vssettings
Created May 26, 2018 06:59
Keyboard Shortcuts Settings backup for visual studio 2015 and above
<DefaultShortcuts/>
<ShortcutsScheme>Visual C++ 6</ShortcutsScheme>
<UserShortcuts><Shortcut Command="Edit.ScrollLineUp" Scope="文本编辑器">Ctrl+K</Shortcut><Shortcut Command="Edit.ScrollLineDown" Scope="文本编辑器">Ctrl+J</Shortcut><Shortcut Command="Edit.ScrollPageUp" Scope="文本编辑器">Ctrl+Shift+K</Shortcut><Shortcut Command="Edit.ScrollPageDown" Scope="文本编辑器">Ctrl+Shift+J</Shortcut><Shortcut Command="Edit.PreviousBookmarkInFolder" Scope="全局">Ctrl+Shift+E, Ctrl+Shift+P</Shortcut><Shortcut Command="Edit.NextBookmarkInFolder" Scope="全局">Ctrl+Shift+E, Ctrl+Shift+N</Shortcut><Shortcut Command="Edit.SwapAnchor" Scope="文本编辑器">Ctrl+E, Ctrl+A</Shortcut><Shortcut Command="Edit.DeleteHorizontalWhiteSpace" Scope="文本编辑器">Ctrl+E, Ctrl+\</Shortcut><Shortcut Command="Edit.ClearBookmarks" Scope="文本编辑器">Ctrl+E, Ctrl+L</Shortcut><Shortcut Command="Edit.ToggleBookmark" Scope="文本编辑器">Ctrl+E, Ctrl+K</Shortcut><Shortcut Command="Edit.EnableBookmark" Scope="文本编辑器">Ctrl+E, Ctrl+B</Shortcut><Shortcut Command="Edit.FormatSelection" Scope="文本编辑器"
@linnet8989
linnet8989 / EnumString.h
Last active October 16, 2023 16:01
Tricks of C++ and Windows API
// EnumString - A utility to provide stringizing support for C++ enums
// Author: Francis Xavier Joseph Pulikotil
// Improved by: linnet8989
//
// This code is free software: you can do whatever you want with it,
// although I would appreciate if you gave credit where it's due.
//
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@linnet8989
linnet8989 / RunAsAdmin.psl
Created May 2, 2018 16:15
run powershell.exe/cmd.exe as Administrator in powershell and use current working directory as its working directory
# open a new powershell
# full version:
$arg = '-NoExit -Command "& {cd '+ "'" + $pwd + "'"+ '}"'
Start-Process Powershell -ArgumentList $arg -Verb runAs
# simplified version:
$arg = '-noexit -c "& {cd '+ "'" + $pwd + "'"+ '}"'
start powershell -a $arg -v runas
# open a new cmd
# full version:
@linnet8989
linnet8989 / ReadUnknownSizeForFile.cpp
Created April 22, 2018 12:20
Read Unknown Size Data For File
// Example for pfnRead
int ReadThunk(int* pData, FILE* pFile)
{
fread(pData, sizeof(*pData), 1, pFile);
// EOF ?
if (*pData == 0)
{
return 0;
}
}
@linnet8989
linnet8989 / GenerateProperty.py
Last active April 21, 2018 13:33
c# get set Property auto Generation and Model class Template (CallerMemberName requires .net 4.5 and higher) for WPF
# -*- coding: UTF-8 -*-\
s = " \
string Name; \
int Number; \
"
s2 = "\
private %s m_%s;\n\
public %s %s\n\
{\n\
get => m_%s;\n\
@linnet8989
linnet8989 / main.cpp
Created September 20, 2017 09:13
template
#include <tchar.h>
int _tmain(int argc, TCHAR *argv[], char *envp[])
{
}

1.3.1

C: 1, 3, 6
C++: 1, 3, 4, 6
Cobol: 
Fortran: 
Java: 1, 3, 4, 6
Lisp:
ML:
Perl:
@linnet8989
linnet8989 / sort.cs
Last active September 16, 2017 02:05
void swap(int arr[], int i, int j)
{
int temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
//bubble
void f1(int arr[], int length)
{