Skip to content

Instantly share code, notes, and snippets.

View swproxy.go
package main
import (
"github.com/elazarl/goproxy"
"log"
"net/http"
"strings"
)
func onSWCall(req *http.Request, resp *http.Response) {
View .ycm_extra_conf.py
# Generated by YCM Generator at 2016-03-24 15:30:34.198292
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
@skroll
skroll / ngx_x509rfc2253_module.c
Created Mar 24, 2016
Example module of getting the SSL Subject/Issuer DN is RFC 2253 format
View ngx_x509rfc2253_module.c
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
typedef ngx_int_t (*ngx_x509rfc2253_variable_handler_pt)(ngx_connection_t *c,
ngx_pool_t *pool, ngx_str_t *s);
static ngx_int_t ngx_x509rfc2253_variable(ngx_http_request_t *r,
ngx_http_variable_value_t *v, uintptr_t data);
static ngx_int_t ngx_x509rfc2253_add_variables(ngx_conf_t *cf);
View SubclassBug.kt
package com.github.skroll
public abstract class AbstractFoo<K, V> : Map<K, V> {
override operator fun get(key: K): V? {
println("AbstractFoo")
return null
}
override val size: Int
get() = throw UnsupportedOperationException()
View subclass.kt
public abstract class AbstractFoo<K, V> : kotlin.Map<K, V> {
override operator fun get(key: K): V? {
println("AbstractFoo")
return null
}
override val size: Int
get() = throw UnsupportedOperationException()
override fun isEmpty(): Boolean {
@skroll
skroll / 0001-llvm-libs.patch
Created Oct 10, 2014
sparse 5.0 patch to fix builds when llvm is on system
View 0001-llvm-libs.patch
--- a/Makefile
+++ b/Makefile
@@ -87,6 +87,7 @@
LLVM_LDFLAGS := $(shell llvm-config --ldflags)
LLVM_CFLAGS := $(shell llvm-config --cflags | sed -e "s/-DNDEBUG//g")
LLVM_LIBS := $(shell llvm-config --libs)
+LLVM_LIBS += $(shell llvm-config --system-libs 2>/dev/null)
PROGRAMS += $(LLVM_PROGS)
INST_PROGRAMS += sparse-llvm sparsec
sparse-llvm.o: BASIC_CFLAGS += $(LLVM_CFLAGS)
@skroll
skroll / open-vm-tools-2013.09.16-1328054-compat_d_count.patch
Created Jul 10, 2014
Patches to get open-vm-tools-2013.09.16-1328054 vmhgfs kernel module to compile and work on 3.15
View open-vm-tools-2013.09.16-1328054-compat_d_count.patch
diff --git a/modules/linux/shared/compat_dcache.h b/modules/linux/shared/compat_dcache.h
index 0450aee..a38c861 100644
--- a/modules/linux/shared/compat_dcache.h
+++ b/modules/linux/shared/compat_dcache.h
@@ -48,4 +48,15 @@
})
#endif
+/*
+ * d_count field was removed in 3.11.0.