Skip to content

Instantly share code, notes, and snippets.

View milkowski's full-sized avatar

Wojciech Miłkowski milkowski

View GitHub Profile
I tried to write a bit about my short contacts with
Haskell and why I don't really like it, but that's
just going to attract an angry mob; besides, my
experiences are too brief to really build a
solid opinion I would be able to defend.
So instead I'll write a bit about why I think that
our problems go deeper than any text-based
programming language could solve.
@morganrallen
morganrallen / _README.md
Last active January 15, 2023 19:41
Janky Browser

JankyBrowser

The only cross-platform browser that fits in a Gist!

One line install. Works on Linux, MacOSX and Windows.

Local Install

$> npm install http://gist.github.com/morganrallen/f07f59802884bcdcad4a/download
@LeoColomb
LeoColomb / README.md
Last active January 15, 2023 19:42 — forked from morganrallen/_README.md
JankyBrowser

JankyBrowser

The only cross-platform browser that fits in a Gist!

One line install. Works on Linux, MacOSX and Windows.

Local Install

$> npm install http://gist.github.com/morganrallen/f07f59802884bcdcad4a/download
@equalsraf
equalsraf / gist:4685f7aef022a36c26d5
Last active November 15, 2017 22:13
Building Neovim with MSVC 2015

Check the pull request for the changes and the main issue for discussion. If you run into trouble check the Known Errors section at the end, or drop me a comment.

Requirements

  • MSVC 2015, cl should report > 19.*
  • Python 2 (required by libuv to get gyp) - python 3 will not work, see the issue
  • Git (required by libuv to get gyp)
  • libintl
  • You might need the Windows 10 SDK to be installed (unverified, please drop me a comment in #810, specially if you are in Windows8 or lower.)
@aras-p
aras-p / gist:1c2e27b71006023a1108
Last active August 29, 2015 14:17
min16float workaround
// add this in your shader before using min16float etc. in current (4.x and 5.0)
// unity versions. will fix this soon
#if !defined(SHADER_API_D3D11) && !defined(SHADER_API_D3D11_9X)
#define min16float half
#define min16float2 half2
#define min16float3 half3
#define min16float4 half4
#define min10float fixed
#define min10float2 fixed2
#define min10float3 fixed3
@ngo
ngo / XSD
Last active March 20, 2020 05:46
PhDays 2015 WAF bypass challenge
There was an XSD challenge, which nobody, as far as I know, solved in an intended way. We weren't quite sure that this was xsd, and found SQLi first.
The vulnerable interface was parsing XML from POST requests to /tickets.php and its id parameter was vulnerable to sqli. We quickly understood that the WAF enforced the parameter length to be exactly 35 chars long, which was a nuisance. Fortunately, we found that changing host to foo.waf-bypass.com (from the intended choo-choo.waf-bypass.com) removed that restriction. All that was left was to bypass the syntax anomaly detection, which was quite easy. The final vector is as follows (db was postgres, so this uses a relatively new error-based box() vector with xml functions to quickly get all database):
POST /tickets.php HTTP/1.1
Host: hui.phdays.com
Content-Type: text/xml
X-Requested-With: XMLHttpRequest
Referer: http://choo-choo.phdays.com/index.php?search=%27%22%3E
Content-Length: 174
Cookie: WAFBYPASS=5727e690-39f4-44f1-a271-c6edfc1b4336
Connection: keep-alive
diff --git a/Makefile b/Makefile
index 7b200d7..4ecd833 100644
--- a/Makefile
+++ b/Makefile
@@ -158,7 +158,7 @@ endif
$(LUAJIT_LIB): build/$(LUAJIT_TAR)
(cd build; tar -xf $(LUAJIT_TAR))
- (cd $(LUAJIT_DIR); make CC=$(CC) STATIC_CC="$(CC) -fPIC")
+ (cd $(LUAJIT_DIR); make CC=$(CC) STATIC_CC="$(CC) -fPIC" Q="" XCFLAGS="-DLUAJIT_ENABLE_LUA52COMPAT")
-- This is the LuaJIT implementation of Smoothsort [1], a comparison-based
-- sorting algorithm with worst-case asymptotic O(n log n) behaviour, best-case
-- O(n) behaviour, and a smooth transition in between. Largely based on the C++
-- code by Keith Schwarz [2], translated to LuaJIT by Lesley De Cruz.
-- [1] Dijkstra, E. W. (1982). Smoothsort, an alternative for sorting in situ.
-- Science of Computer Programming, 1(3), 223-233.
-- [2] Schwarz, K. Smoothsort demystified. http://www.keithschwarz.com/smoothsort/.
local ffi = require("ffi")
@paniq
paniq / pool.lisp
Last active September 5, 2015 23:54
pool.n
; Implementation for a pool allocator that guarantees compactness
; (unsorted gapless iteration without indirections) while preserving element ids
; (using one order-optimized indirection), with insertion, deletion and lookup
; in O(1) time.
;
; the memory requirement is (sizeof index-type) * capacity, typically
; 4 bytes per entry.
;
; Because all id <-> index assignments are symmetric swaps, only a single table
; is required to resolve index from id and id from index.
@paniq
paniq / paralleldelaunay.rst
Last active December 24, 2021 01:00
Parallelizable Gather-based Delaunay Transforms

Parallelizable Gather-based Delaunay Transforms

by Leonard Ritter, Duangle GbR

Today I figured out how to do GPU-friendly Delaunay transforms, and I'd like to describe how the algorithm works before I forget everything.

What the algorithm does is to flip edges in a half-edge triangle mesh where a flip would improve the quality of the adjacent triangles (an equilateral triangle