Skip to content

Instantly share code, notes, and snippets.

@kappa7194
kappa7194 / Program.cs
Created Apr 6, 2018
Single instance C# application
View Program.cs
using System;
using System.Globalization;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Security.AccessControl;
using System.Security.Principal;
using System.Threading;
public static class Program
{
@kappa7194
kappa7194 / UserParametersParser.cs
Created Dec 5, 2017
An example on how to decode Active Directory's User-Parameters attribute
View UserParametersParser.cs
namespace UserParametersParser
{
using System;
using System.DirectoryServices.Protocols;
using System.IO;
using System.Net;
using System.Text;
public static class Program
{
View talos.log
-------- START OF LOG --------
22:25:49 LOG: Core version: $Version: Talos_PC_distro; Talos-Windows-Final; 244371 2015-07-23 19:11:28 @builder14; Win32-Static-Final-Default$
22:25:49 LOG: Command: $
22:25:49 LOG: Initializing timer.
22:25:49 LOG: QueryPerformanceFrequency: 3515637
22:25:49 LOG: Timestamp: 2015/09/18 22:25:49
22:25:49 LOG: Binary name: Talos.exe
22:25:49 LOG: Binary soft path: Bin/
22:25:49 LOG: Binary hard path: C:\Program Files (x86)\Steam\steamapps\common\The Talos Principle\Bin\
@kappa7194
kappa7194 / gist:fe652bef133f6f511c10
Created Mar 26, 2015
git-for-windows/git — net-installer-preview-1 — git-sdk-64-installer-preview.7z.exe setup log
View gist:fe652bef133f6f511c10
Cloning into 'git'...
remote: Counting objects: 210455, done.
Receiving objects: 100% (210455/210455), 66.17 MiB | 499.00 KiB/s, done.
Resolving deltas: 100% (154048/154048), done.
remote: Total 210455 (delta 0), reused 0 (delta 0), pack-reused 210455
Checking connectivity... done.
GIT_VERSION = 2.3.4.windows.2
* new build flags
CC credential-store.o
* new link flags
View user.js
// ==UserScript==
// @name My Fancy New Userscript
// @namespace http://your.homepage/
// @version 0.1
// @description enter something useful
// @author You
// @match http://stackoverflow.com/review/close*
// @grant none
// ==/UserScript==
View payload.json
{
"reviewTaskId": 5968807,
"postId": 26303029,
"postTypeId": 1,
"actions": [
{
"type": 8,
"name": "Leave Open",
"description": "if this question should not be closed",
"tooltip": "disagree with this close vote",
View user.js
// ==UserScript==
// @name StackOverflow close votes shortcuts
// @namespace https://github.com/kappa7194/stackoverflow-close-votes-shortcuts
// @version 0.1
// @description A script to add keyboard shortcuts to StackOverflow's close votes review queue
// @author Albireo
// @match http://stackoverflow.com/review/close*
// @grant none
// ==/UserScript==
@kappa7194
kappa7194 / gist:e7ed4db71045a3fa1a9a
Last active Aug 29, 2015
StackOverflow close votes review queue keyboard shortcuts
View gist:e7ed4db71045a3fa1a9a
// ==UserScript==
// @name StackOverflow close votes review queue keyboard shortcuts
// @namespace http://stackoverflow.com/review/
// @version 0.4
// @description A script to add keyboard hotkey support to StackOverflow's close votes review queue
// @author Albireo
// @match http://stackoverflow.com/review/close*
// @grant none
// ==/UserScript==
@kappa7194
kappa7194 / gist:21c3390130f3e8d54fc2
Created Sep 30, 2014
Compare nullable type expressions
View gist:21c3390130f3e8d54fc2
void Main()
{
Expression<Func<DateTime?>> foo = () => DateTime.MaxValue;
Expression<Func<DateTime>> bar = () => DateTime.MinValue;
Expression<Func<string>> baz = () => string.Empty;
GreaterThan(foo.Body, bar.Body); // Works.
GreaterThan(foo.Body, baz.Body); // Throws.
GreaterThan(bar.Body, baz.Body); // Throws.
}
View test.html
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
</head>
<body>
<script>
'use strict';
Object.preventExtensions(window);
var foo = 'foo';