Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<title>Test</title>
</head>
<body>
<script>
'use strict';
Object.preventExtensions(window);
var foo = 'foo';
@kappa7194
kappa7194 / gist:21c3390130f3e8d54fc2
Created September 30, 2014 09:02
Compare nullable type expressions
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.
}
@kappa7194
kappa7194 / gist:e7ed4db71045a3fa1a9a
Last active August 29, 2015 14:07
StackOverflow close votes review queue keyboard shortcuts
// ==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==
// ==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==
{
"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",
// ==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==
@kappa7194
kappa7194 / gist:fe652bef133f6f511c10
Created March 26, 2015 16:32
git-for-windows/git — net-installer-preview-1 — git-sdk-64-installer-preview.7z.exe setup log
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
-------- 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 / prestazioni.sql
Created December 12, 2011 09:39
Query per prestazioni
dbcc dropcleanbuffers
dbcc freeproccache
select a.IdErrore, a.Url, a.[Description], a.[File], a.Line
from dbo.Errori a
left join dbo.ErroriSql b on b.[Description] = a.[Description]
where b.[Description] is null and a.Data >= '2011-12-12' and a.Data < '2011-12-13' and a.Url like '%tracking%'
@kappa7194
kappa7194 / cerca-errori.sql
Created December 12, 2011 11:22
Cerca errori
set nocount on
set statistics io on
set transaction isolation level read uncommitted
dbcc dropcleanbuffers
dbcc freeproccache
select
a.IdErrore
, a.Data