Skip to content

Instantly share code, notes, and snippets.

@yak1ex
yak1ex / emlsplit.py
Created September 18, 2019 00:00
eml by futakuro splitter
import sys
import re
from email.parser import BytesParser, Parser
from email.policy import default
from pathlib import Path
from urllib.parse import urlparse
from html.parser import HTMLParser
class URLConverter(HTMLParser):
def __init__(self, mapping):
@yak1ex
yak1ex / memo.md
Created July 5, 2019 01:31
revive shortcuts field for Chrome Dev

User Data/Local State

{"ntp":{"activate_hide_shortcuts_field_trial":false}}
@yak1ex
yak1ex / memo.md
Last active June 5, 2019 11:52
Issue report for buildbot

env

  • Python version: 3.7.2
  • Buildbot version: 2.3.1
  • Twisted version: 19.2.0

SVNPoller

svn info may return %-encoding characters. Therefore, it is a safer way to call urllib.parse.unquote() for root in determine_prefix.

2018

  • 64-bit Debian 9.3 (stretch)
  • Bash: GNU bash 4.4.12(1)
  • C: gcc 6.3.0 (packages: gcc, libc6-dev) -pthread -lm -O3
  • C++: gcc 6.3.0 (packages: gcc, g++) -std=c++14 -pthread -O3
  • C#: Mono JIT 4.62 (package: mono-devel)
  • Go: 1.7.4 (package: golang-go)
  • Haskell: The Glorious Glasgow Haskell Compilation System 8.0.1 (package: ghc) +RTS -V0 -RTS -rtsopts -O2
  • Java: openjdk 1.8.0_151 (package: openjdk-8-jdk)
@yak1ex
yak1ex / a.cpp
Created April 15, 2019 12:58
GCJ2019 R1A A and another C++ matters
#include <iomanip>
#include <iostream>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <limits>
#include <bitset>
#include <map>
#include <set>
#include <queue>
https://stackoverflow.com/a/38043447
@yak1ex
yak1ex / wp.driver
Last active February 21, 2019 10:53
/**************************************************************************/
/* */
/* This file is part of WP plug-in of Frama-C. */
/* */
/* Copyright (C) 2007-2018 */
/* CEA (Commissariat a l'energie atomique et aux energies */
/* alternatives) */
/* */
/* you can redistribute it and/or modify it under the terms of the GNU */
/* Lesser General Public License as published by the Free Software */
diff -ur Win32-Ldd-0.02-orig/Ldd.xs Win32-Ldd-0.02/Ldd.xs
--- Win32-Ldd-0.02-orig/Ldd.xs 2017-06-26 21:57:35.000000000 +0900
+++ Win32-Ldd-0.02/Ldd.xs 2018-05-09 21:23:20.769338100 +0900
@@ -62,7 +62,7 @@
static struct DepTreeElement *
build_dep_tree(char *pe_file,
SearchPaths *search_paths,
- int datarelocs, int recursive, int functionrelocs) {
+ int recursive, int datarelocs, int functionrelocs) {
/* warn("build_dep_tree(%s, %p, %d, %d)", pe_file, search_paths, datarelocs, functionrelocs); */
--- origsrc/subversion-1.10.0/subversion/libsvn_subr/io.c 2018-04-24 15:58:49.920742300 +0900
+++ src/subversion-1.10.0/subversion/libsvn_subr/io.c 2018-04-24 21:16:56.215447100 +0900
@@ -4294,6 +4294,7 @@ svn_io_file_rename2(const char *from_pat
status = apr_file_rename(from_path_apr, to_path_apr, pool);
}
#elif defined (__CYGWIN__)
+ status = apr_file_rename(from_path_apr, to_path_apr, pool);
WIN32_RETRY_LOOP(status, apr_file_rename(from_path_apr, to_path_apr, pool));
#else
status = apr_file_rename(from_path_apr, to_path_apr, pool);
@yak1ex
yak1ex / ToolTemplate.cpp
Last active June 4, 2018 12:39
Convert plain C array to C++ std::array by using clang::Tooling
//===---- tools/extra/ToolTemplate.cpp - Template for refactoring tool ----===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file implements an empty refactoring tool using the clang tooling.