Skip to content

Instantly share code, notes, and snippets.

@dmitryvk
dmitryvk / Cargo.toml
Created March 29, 2020 17:07
Gtk-rs async `alert` example
[package]
name = "async-ui"
version = "0.1.0"
authors = ["Dmitry Kalyanov <Kalyanov.Dmitry@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
futures = "0.3.4"
@dmitryvk
dmitryvk / Program.cs
Last active November 5, 2019 13:17
Program that demonstrates HttpRequestException from HttpClient.PostAsync after Keep-Alive timeout
namespace HttpClientTest
{
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading;
class Program
{
static void Main(string[] args)
@dmitryvk
dmitryvk / MonoTxScope.csproj
Last active April 9, 2019 10:06
Mono Transaction Scope
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{17C90BFF-D5EB-4FF4-BB67-BCCA7535E6A1}</ProjectGuid>
<OutputType>Exe</OutputType>
<TargetFramework>net472</TargetFramework>
<AssemblyTitle>MonoTxScope</AssemblyTitle>
<Product>MonoTxScope</Product>
<Copyright>Copyright © 2019</Copyright>
</PropertyGroup>
<ItemGroup>
@dmitryvk
dmitryvk / Program.cs
Created December 28, 2018 11:58
Reduced reproduction of data race inside Mono's System.Web.Caching.Cache
namespace ConsoleApplication10
{
using System;
using System.Linq;
using System.Reflection;
using System.Threading;
using System.Web.Caching;
internal class Program
{
@dmitryvk
dmitryvk / Global.asax.cs
Created December 18, 2018 10:47
Mono-async-EndRequest
namespace WebApplication2
{
using System;
using System.Threading.Tasks;
using System.Web;
public class MvcApplication : HttpApplication
{
public MvcApplication()
{
1535632227632 geckodriver INFO geckodriver 0.21.0
1535632227636 geckodriver INFO Listening on 127.0.0.1:26017
1535632227780 mozrunner::runner INFO Running command: "/usr/bin/firefox" "-marionette" "-start-debugger-server" "43839" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofile.UxXQkDyAeQcH"
1535632250049 addons.manager DEBUG Application has been upgraded
1535632250063 addons.manager DEBUG Loaded provider scope for resource://gre/modules/addons/XPIProvider.jsm: ["XPIProvider", "XPIInternal"]
1535632250066 addons.manager DEBUG Loaded provider scope for resource://gre/modules/LightweightThemeManager.jsm: ["LightweightThemeManager"]
1535632250080 addons.manager DEBUG Loaded provider scope for resource://gre/modules/addons/GMPProvider.jsm
1535632250082 addons.manager DEBUG Loaded provider scope for resource://gre/modules/addons/PluginProvider.jsm
1535632250082 addons.manager DEBUG Starting provider: XPIProvider
1535632250083 addons.xpi D
true
@dmitryvk
dmitryvk / hql_clean.g
Last active August 29, 2015 14:22
NHibernate HQL AST Grammar
tree grammar HqlSqlWalker options {language=CSharp3; output=AST; tokenVocab=Hql; ASTLabelType=IASTNode; } ;
public statement : selectStatement | updateStatement
| deleteStatement | insertStatement;
selectStatement : query ;
updateStatement : ^(UPDATE VERSIONED? fromClause setClause whereClause?);
deleteStatement : ^(DELETE fromClause whereClause?) ;
insertStatement : ^(INSERT intoClause query) ;
intoClause : ^(INTO path insertablePropertySpec) ;
insertablePropertySpec : ^(RANGE IDENT+);
$ cd ~/.config/chromium/Default
$ sqlite3 History "select date(t0.visit_time / 1000000 - 11644473600, 'unixepoch', 'localtime'), count(*) from visits t0 join urls t1 on t0.url=t1.id and t1.url='https://twitter.com/' group by 1 order by 1 desc limit 10"
$ sqlite3 "Archived History" "select date(t0.visit_time / 1000000 - 11644473600, 'unixepoch', 'localtime'), count(*) from visits t0 join urls t1 on t0.url=t1.id and t1.url='https://twitter.com/' group by 1 order by 1 desc limit 10"
2013-06-19|1
2013-06-18|8
2013-06-17|35
2013-06-16|3
2013-06-15|11
2013-06-14|30
2013-06-13|34
$ cd ~/.mozilla/firefox/*.default
$ $ sqlite3 places.sqlite "select date(t0.visit_date / 1000000, 'unixepoch', 'localtime'), count(*) from moz_historyvisits t0 join moz_places t1 on t0.place_id=t1.id and t1.url='http://twitter.com/' group by date(t0.visit_date / 1000000, 'unixepoch', 'localtime') order by 1 desc limit 10"
2014-10-08|5
2014-10-07|12
2014-10-06|2
2014-10-05|3
2014-10-04|4
2014-10-03|13
2014-10-02|8
2014-10-01|10