Skip to content

Instantly share code, notes, and snippets.

@linquize
linquize / StrCmpLogical.cs
Created July 29, 2012 12:02
C# StrCmpLogical
static bool IsDigit(char c)
{
return c >= '0' && c <= '9';
}
unsafe static int UnsafeStrCmpLogical(string s1, string s2)
{
fixed (char* p1 = s1)
{
fixed (char* p2 = s2)
@linquize
linquize / uac-mfc.cpp
Created October 29, 2012 14:12
UAC MFC
BOOL IsAdmin()
{
SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY;
PSID AdministratorsGroup;
// Initialize SID.
if (!AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &AdministratorsGroup))
return false;
// Check whether the token is present in admin group.
@linquize
linquize / WixProject.cs
Created November 15, 2012 15:12
SharpDevelop WixProject
.../WixBinding/Project/Src/Project/WixProject.cs | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/src/AddIns/BackendBindings/WixBinding/Project/Src/Project/WixProject.cs b/src/AddIns/BackendBindings/WixBinding/Project/Src/Project/WixProject.cs
index 64540d3..bad42f9 100644
--- a/src/AddIns/BackendBindings/WixBinding/Project/Src/Project/WixProject.cs
+++ b/src/AddIns/BackendBindings/WixBinding/Project/Src/Project/WixProject.cs
@@ -40,12 +40,21 @@ namespace ICSharpCode.WixBinding
{
SetProperty("OutputType", "Package");
https://github.com/siuying/legco-hansard-parser/
Left the Chamber with the assistance of the Clerk and security personnel
@linquize
linquize / gist:c25f0c8ae3c92965ae03
Last active August 29, 2015 14:14
nixos preparation
# Install git minimal
nix-env -i git-minimal
# Enable webkit in Konqueror
nix-env -i kwebkitpart
kbuildsycoca4
# Change configuration
sudo -i nano /etc/nixos/configuration.nix
@linquize
linquize / index.html
Last active November 4, 2018 13:02
OpenStreetMap Filtered Changesets
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Filtered Changesets | OpenStreetMap</title>
<link rel="stylesheet" href="node_modules/leaflet/dist/leaflet.css" />
<script type="text/javascript" src="node_modules/leaflet/dist/leaflet.js"></script>
<script type="text/javascript" src="node_modules/moment/min/moment.min.js"></script>
@linquize
linquize / caddy_websocket.html
Created November 5, 2018 16:26
Caddy Websocket test
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Caddy Websocket test</title>
</head>
<body>
<pre>
<span id="console" style="border: 1px solid black"></span>