Skip to content

Instantly share code, notes, and snippets.

@hirthwork
hirthwork / vixen.vim
Last active September 23, 2019 13:23
{
"keymaps": {
"0": { "type": "scroll.home" },
":": { "type": "command.show" },
"ж": { "type": "command.show" },
"o": { "type": "command.show.open", "alter": false },
"щ": { "type": "command.show.open", "alter": false },
"O": { "type": "command.show.open", "alter": true },
"Щ": { "type": "command.show.open", "alter": true },
"t": { "type": "command.show.tabopen", "alter": false },
@hirthwork
hirthwork / .cvimrc
Last active February 8, 2018 16:34
let searchengine imdb = "https://www.google.com/search?btnI=1&q=site:imdb.com+"
let searchengine ru = "https://ru.wikipedia.org/w/index.php?search="
let searchengine java = "https://www.google.com/search?btnI=1&q=site:https://docs.oracle.com/javase/9/docs/api/java/+"
let searchengine multitran = "http://www.multitran.ru/c/m.exe?l1=1&l2=2&s="
let searchengine maps = ["https://yandex.ru/maps/?l=trf", "http://maps.yandex.ru/?text=%s"]
let searchengine gmaps = ["https://www.google.com/maps/", "https://www.google.com/maps/search/"]
let searchengine market = "http://market.yandex.ru/search.xml?text="
let searchengine subscene = "http://subscene.com/subtitles/release?q="
let searchengine yandex = "http://yandex.ru/yandsearch?text="
let searchengine wiki = "http://search.yandex-team.ru/search?opensearch=1&text="
#scrollToTop {
display: none !important;
}
#stat-blacklisters {
display: block !important;
}
* {
color: #cccccc !important;
background-color: #444444 !important;
-moz-appearance: none !important;
import java.io.IOException;
import java.io.StringReader;
import java.util.ArrayDeque;
import java.util.Deque;
public class Calc {
private final Deque<TokenType> tokens = new ArrayDeque<>();
private final Lexer lexer;
#!/bin/zsh
function usage() {
>&$2 echo -e "Usage: $1 <cookie> <user> [<since>]\nExample:"
>&$2 echo -e "\t$1 user=f25bf40e0bc05d002b407a53bb76c63ee20ef8f8 hirthwork 'week ago'"
}
if [ "$1" = --help ]
then
usage $0 1
exit 0
--- a/mcabber/xmpp.c
+++ b/mcabber/xmpp.c
@@ -1538,7 +1538,9 @@
{
char *r;
char *buf;
+ GSList* roster_node;
int newbuddy;
+ guint subscription;
guint hook_result;
@hirthwork
hirthwork / i2p-proxy.php
Created January 17, 2015 08:20
i2p-proxy.php
<?php
function headerfunc($ch, $str){
header($str);
return strlen($str);
}
function writefunc($ch, $str){
print $str;
flush();
return strlen($str);
@hirthwork
hirthwork / nginx.conf
Created December 27, 2014 08:51
i2p rss crutches
server {
listen 127.0.0.1:81;
root /var/www/localhost/htdocs;
rewrite ^(.*)$ /i2p-proxy.php break;
location / {
proxy_read_timeout 5m;
fastcgi_param HTTP_HOST zzz.i2p;
@hirthwork
hirthwork / HttpAsyncService.patch
Last active August 29, 2015 14:10
Allow to send response from request consumer
diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
index 8d6a23a..d85aa0b 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
@@ -98,6 +98,7 @@ import org.apache.http.util.Asserts;
*/
@Immutable // provided injected dependencies are immutable
public class HttpAsyncService implements NHttpServerEventHandler {
+ public static final String HTTP_EXCHANGE = "http.nio.http-exchange";
@hirthwork
hirthwork / EmptyHttpServer.java
Created November 12, 2014 17:11
Simple illustration problems with empty HttpEntities which is not returned to connections pool
import java.util.concurrent.TimeUnit;
import org.apache.http.HttpRequest;
import org.apache.http.HttpResponse;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.config.SocketConfig;
import org.apache.http.impl.bootstrap.HttpServer;
import org.apache.http.impl.bootstrap.ServerBootstrap;